UNPKG

@shopify/create-app

Version:

A CLI tool to create a new Shopify app.

943 lines (942 loc) • 416 kB
import { __esm, init_cjs_shims } from "./chunk-PKR7KJ6P.js"; // ../../node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/plugins/babel.mjs function Ws(a2, t) { if (a2 == null) return {}; var e = {}; for (var s in a2) if ({}.hasOwnProperty.call(a2, s)) { if (t.indexOf(s) !== -1) continue; e[s] = a2[s]; } return e; } function D(a2, t) { let { line: e, column: s, index: i } = a2; return new R(e, s + t, i + t); } function Ot(a2, t, e) { Object.defineProperty(a2, t, { enumerable: !1, configurable: !0, value: e }); } function ti({ toMessage: a2, code: t, reasonCode: e, syntaxPlugin: s }) { let i = e === "MissingPlugin" || e === "MissingOneOfPlugins"; return function r(n, o) { let h = new SyntaxError(); return h.code = t, h.reasonCode = e, h.loc = n, h.pos = n.index, h.syntaxPlugin = s, i && (h.missingPlugin = o.missingPlugin), Ot(h, "clone", function(u = {}) { let { line: f, column: d, index: x } = u.loc ?? n; return r(new R(f, d, x), Object.assign({}, o, u.details)); }), Ot(h, "details", o), Object.defineProperty(h, "message", { configurable: !0, get() { let l = `${a2(o)} (${n.line}:${n.column})`; return this.message = l, l; }, set(l) { Object.defineProperty(this, "message", { value: l, writable: !0 }); } }), h; }; } function F(a2, t) { if (Array.isArray(a2)) return (s) => F(s, a2[0]); let e = {}; for (let s of Object.keys(a2)) { let i = a2[s], r = typeof i == "string" ? { message: () => i } : typeof i == "function" ? { message: i } : i, { message: n } = r, o = Ws(r, ei), h = typeof n == "string" ? () => n : n; e[s] = ti(Object.assign({ code: "BABEL_PARSER_SYNTAX_ERROR", reasonCode: s, toMessage: h }, t ? { syntaxPlugin: t } : {}, o)); } return e; } function si() { return { sourceType: "script", sourceFilename: void 0, startIndex: 0, startColumn: 0, startLine: 1, allowAwaitOutsideFunction: !1, allowReturnOutsideFunction: !1, allowNewTargetOutsideFunction: !1, allowImportExportEverywhere: !1, allowSuperOutsideMethod: !1, allowUndeclaredExports: !1, allowYieldOutsideFunction: !1, plugins: [], strictMode: void 0, ranges: !1, tokens: !1, createImportExpressions: !0, createParenthesizedExpressions: !1, errorRecovery: !1, attachComment: !0, annexB: !0 }; } function ii(a2) { let t = si(); if (a2 == null) return t; if (a2.annexB != null && a2.annexB !== !1) throw new Error("The `annexB` option can only be set to `false`."); for (let e of Object.keys(t)) a2[e] != null && (t[e] = a2[e]); if (t.startLine === 1) a2.startIndex == null && t.startColumn > 0 ? t.startIndex = t.startColumn : a2.startColumn == null && t.startIndex > 0 && (t.startColumn = t.startIndex); else if (a2.startColumn == null || a2.startIndex == null) throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`."); if (t.sourceType === "commonjs") { if (a2.allowAwaitOutsideFunction != null) throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`."); if (a2.allowReturnOutsideFunction != null) throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`."); if (a2.allowNewTargetOutsideFunction != null) throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`."); } return t; } function ne(a2) { return Ft(a2.loc.start, "index"), Ft(a2.loc.end, "index"), a2; } function S(a2, t = {}) { t.keyword = a2; let e = P(a2, t); return ft.set(a2, e), e; } function v(a2, t) { return P(a2, { beforeExpr: T, binop: t }); } function P(a2, t = {}) { return ++pe, mt.push(a2), yt.push(t.binop ?? -1), xt.push(t.beforeExpr ?? !1), Pt.push(t.startsExpr ?? !1), gt.push(t.prefix ?? !1), dt.push(new we(a2, t)), pe; } function b(a2, t = {}) { return ++pe, ft.set(a2, pe), mt.push(a2), yt.push(t.binop ?? -1), xt.push(t.beforeExpr ?? !1), Pt.push(t.startsExpr ?? !1), gt.push(t.prefix ?? !1), dt.push(new we("name", t)), pe; } function w(a2) { return a2 >= 93 && a2 <= 133; } function hi(a2) { return a2 <= 92; } function O(a2) { return a2 >= 58 && a2 <= 133; } function Jt(a2) { return a2 >= 58 && a2 <= 137; } function ci(a2) { return xt[a2]; } function ce(a2) { return Pt[a2]; } function li(a2) { return a2 >= 29 && a2 <= 33; } function Bt(a2) { return a2 >= 129 && a2 <= 131; } function pi(a2) { return a2 >= 90 && a2 <= 92; } function Tt(a2) { return a2 >= 58 && a2 <= 92; } function ui(a2) { return a2 >= 39 && a2 <= 59; } function fi(a2) { return a2 === 34; } function di(a2) { return gt[a2]; } function mi(a2) { return a2 >= 121 && a2 <= 123; } function yi(a2) { return a2 >= 124 && a2 <= 130; } function z(a2) { return mt[a2]; } function Ae(a2) { return yt[a2]; } function xi(a2) { return a2 === 57; } function $e(a2) { return a2 >= 24 && a2 <= 25; } function Gt(a2) { return dt[a2]; } function Ke(a2, t) { let e = 65536; for (let s = 0, i = t.length; s < i; s += 2) { if (e += t[s], e > a2) return !1; if (e += t[s + 1], e >= a2) return !0; } return !1; } function B(a2) { return a2 < 65 ? a2 === 36 : a2 <= 90 ? !0 : a2 < 97 ? a2 === 95 : a2 <= 122 ? !0 : a2 <= 65535 ? a2 >= 170 && Pi.test(String.fromCharCode(a2)) : Ke(a2, Yt); } function K(a2) { return a2 < 48 ? a2 === 36 : a2 < 58 ? !0 : a2 < 65 ? !1 : a2 <= 90 ? !0 : a2 < 97 ? a2 === 95 : a2 <= 122 ? !0 : a2 <= 65535 ? a2 >= 170 && gi.test(String.fromCharCode(a2)) : Ke(a2, Yt) || Ke(a2, Ti); } function Qt(a2, t) { return t && a2 === "await" || a2 === "enum"; } function Zt(a2, t) { return Qt(a2, t) || Ai.has(a2); } function es(a2) { return Si.has(a2); } function ts(a2, t) { return Zt(a2, t) || es(a2); } function wi(a2) { return bi.has(a2); } function Ci(a2, t, e) { return a2 === 64 && t === 64 && B(e); } function Ii(a2) { return Ei.has(a2); } function ki(a2) { return a2.type === "DeclareExportAllDeclaration" || a2.type === "DeclareExportDeclaration" && (!a2.declaration || a2.declaration.type !== "TypeAlias" && a2.declaration.type !== "InterfaceDeclaration"); } function Rt(a2) { return a2.importKind === "type" || a2.importKind === "typeof"; } function Li(a2, t) { let e = [], s = []; for (let i = 0; i < a2.length; i++) (t(a2[i], i, a2) ? e : s).push(a2[i]); return [e, s]; } function G(a2) { switch (a2) { case 10: case 13: case 8232: case 8233: return !0; default: return !1; } } function Ut(a2, t, e) { for (let s = t; s < e; s++) if (G(a2.charCodeAt(s))) return !0; return !1; } function Fi(a2) { switch (a2) { 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 8239: case 8287: case 12288: case 65279: return !0; default: return !1; } } function V(a2) { return a2 ? a2.type === "JSXOpeningFragment" || a2.type === "JSXClosingFragment" : !1; } function J(a2) { if (a2.type === "JSXIdentifier") return a2.name; if (a2.type === "JSXNamespacedName") return a2.namespace.name + ":" + a2.name.name; if (a2.type === "JSXMemberExpression") return J(a2.object) + "." + J(a2.property); throw new Error("Node had unexpected type: " + a2.type); } function Se(a2, t) { return (a2 ? 2 : 0) | (t ? 1 : 0); } function ss(a2, t) { a2.trailingComments === void 0 ? a2.trailingComments = t : a2.trailingComments.unshift(...t); } function Ri(a2, t) { a2.leadingComments === void 0 ? a2.leadingComments = t : a2.leadingComments.unshift(...t); } function X(a2, t) { a2.innerComments === void 0 ? a2.innerComments = t : a2.innerComments.unshift(...t); } function $(a2, t, e) { let s = null, i = t.length; for (; s === null && i > 0; ) s = t[--i]; s === null || s.start > e.start ? X(a2, e.comments) : ss(s, e.comments); } function jt(a2, t, e, s, i, r) { let n = e, o = s, h = i, l = "", u = null, f = e, { length: d } = t; for (; ; ) { if (e >= d) { r.unterminated(n, o, h), l += t.slice(f, e); break; } let x = t.charCodeAt(e); if (_i(a2, x, t, e)) { l += t.slice(f, e); break; } if (x === 92) { l += t.slice(f, e); let A = ji(t, e, s, i, a2 === "template", r); A.ch === null && !u ? u = { pos: e, lineStart: s, curLine: i } : l += A.ch, { pos: e, lineStart: s, curLine: i } = A, f = e; } else x === 8232 || x === 8233 ? (++e, ++i, s = e) : x === 10 || x === 13 ? a2 === "template" ? (l += t.slice(f, e) + ` `, ++e, x === 13 && t.charCodeAt(e) === 10 && ++e, ++i, f = s = e) : r.unterminated(n, o, h) : ++e; } return { pos: e, str: l, firstInvalidLoc: u, lineStart: s, curLine: i }; } function _i(a2, t, e, s) { return a2 === "template" ? t === 96 || t === 36 && e.charCodeAt(s + 1) === 123 : t === (a2 === "double" ? 34 : 39); } function ji(a2, t, e, s, i, r) { let n = !i; t++; let o = (l) => ({ pos: t, ch: l, lineStart: e, curLine: s }), h = a2.charCodeAt(t++); switch (h) { case 110: return o(` `); case 114: return o("\r"); case 120: { let l; return { code: l, pos: t } = et(a2, t, e, s, 2, !1, n, r), o(l === null ? null : String.fromCharCode(l)); } case 117: { let l; return { code: l, pos: t } = rs(a2, t, e, s, n, r), o(l === null ? null : String.fromCodePoint(l)); } case 116: return o(" "); case 98: return o("\b"); case 118: return o("\v"); case 102: return o("\f"); case 13: a2.charCodeAt(t) === 10 && ++t; case 10: e = t, ++s; case 8232: case 8233: return o(""); case 56: case 57: if (i) return o(null); r.strictNumericEscape(t - 1, e, s); default: if (h >= 48 && h <= 55) { let l = t - 1, f = /^[0-7]+/.exec(a2.slice(l, t + 2))[0], d = parseInt(f, 8); d > 255 && (f = f.slice(0, -1), d = parseInt(f, 8)), t += f.length - 1; let x = a2.charCodeAt(t); if (f !== "0" || x === 56 || x === 57) { if (i) return o(null); r.strictNumericEscape(l, e, s); } return o(String.fromCharCode(d)); } return o(String.fromCharCode(h)); } } function et(a2, t, e, s, i, r, n, o) { let h = t, l; return { n: l, pos: t } = is(a2, t, e, s, 16, i, r, !1, o, !n), l === null && (n ? o.invalidEscapeSequence(h, e, s) : t = h - 1), { code: l, pos: t }; } function is(a2, t, e, s, i, r, n, o, h, l) { let u = t, f = i === 16 ? _t.hex : _t.decBinOct, d = i === 16 ? Te.hex : i === 10 ? Te.dec : i === 8 ? Te.oct : Te.bin, x = !1, A = 0; for (let k = 0, N = r ?? 1 / 0; k < N; ++k) { let C = a2.charCodeAt(t), I; if (C === 95 && o !== "bail") { let Pe = a2.charCodeAt(t - 1), ae = a2.charCodeAt(t + 1); if (o) { if (Number.isNaN(ae) || !d(ae) || f.has(Pe) || f.has(ae)) { if (l) return { n: null, pos: t }; h.unexpectedNumericSeparator(t, e, s); } } else { if (l) return { n: null, pos: t }; h.numericSeparatorInEscapeSequence(t, e, s); } ++t; continue; } if (C >= 97 ? I = C - 97 + 10 : C >= 65 ? I = C - 65 + 10 : Ui(C) ? I = C - 48 : I = 1 / 0, I >= i) { if (I <= 9 && l) return { n: null, pos: t }; if (I <= 9 && h.invalidDigit(t, e, s, i)) I = 0; else if (n) I = 0, x = !0; else break; } ++t, A = A * i + I; } return t === u || r != null && t - u !== r || x ? { n: null, pos: t } : { n: A, pos: t }; } function rs(a2, t, e, s, i, r) { let n = a2.charCodeAt(t), o; if (n === 123) { if (++t, { code: o, pos: t } = et(a2, t, e, s, a2.indexOf("}", t) - t, !0, i, r), ++t, o !== null && o > 1114111) if (i) r.invalidCodePoint(t, e, s); else return { code: null, pos: t }; } else ({ code: o, pos: t } = et(a2, t, e, s, 4, !1, i, r)); return { code: o, pos: t }; } function he(a2, t, e) { return new R(e, a2 - t, a2); } function zi() { return new Z(3); } function qi() { return new Ce(1); } function $i() { return new Ce(2); } function as() { return new Z(); } function Ki(a2) { if (a2 == null) throw new Error(`Unexpected ${a2} value.`); return a2; } function zt(a2) { if (!a2) throw new Error("Assert fail"); } function Hi(a2) { switch (a2) { case "any": return "TSAnyKeyword"; case "boolean": return "TSBooleanKeyword"; case "bigint": return "TSBigIntKeyword"; case "never": return "TSNeverKeyword"; case "number": return "TSNumberKeyword"; case "object": return "TSObjectKeyword"; case "string": return "TSStringKeyword"; case "symbol": return "TSSymbolKeyword"; case "undefined": return "TSUndefinedKeyword"; case "unknown": return "TSUnknownKeyword"; default: return; } } function qt(a2) { return a2 === "private" || a2 === "public" || a2 === "protected"; } function Wi(a2) { return a2 === "in" || a2 === "out"; } function lt(a2) { if (a2.extra?.parenthesized) return !1; switch (a2.type) { case "Identifier": return !0; case "MemberExpression": return !a2.computed && lt(a2.object); case "TSInstantiationExpression": return lt(a2.expression); default: return !1; } } function Gi(a2) { if (a2.type !== "MemberExpression") return !1; let { computed: t, property: e } = a2; return t && e.type !== "StringLiteral" && (e.type !== "TemplateLiteral" || e.expressions.length > 0) ? !1 : os(a2.object); } function Xi(a2, t) { let { type: e } = a2; if (a2.extra?.parenthesized) return !1; if (t) { if (e === "Literal") { let { value: s } = a2; if (typeof s == "string" || typeof s == "boolean") return !0; } } else if (e === "StringLiteral" || e === "BooleanLiteral") return !0; return !!(ns(a2, t) || Yi(a2, t) || e === "TemplateLiteral" && a2.expressions.length === 0 || Gi(a2)); } function ns(a2, t) { return t ? a2.type === "Literal" && (typeof a2.value == "number" || "bigint" in a2) : a2.type === "NumericLiteral" || a2.type === "BigIntLiteral"; } function Yi(a2, t) { if (a2.type === "UnaryExpression") { let { operator: e, argument: s } = a2; if (e === "-" && ns(s, t)) return !0; } return !1; } function os(a2) { return a2.type === "Identifier" ? !0 : a2.type !== "MemberExpression" || a2.computed ? !1 : os(a2.object); } function er(a2) { if (a2.has("decorators")) { if (a2.has("decorators-legacy")) throw new Error("Cannot use the decorators and decorators-legacy plugin together"); let t = a2.get("decorators").decoratorsBeforeExport; if (t != null && typeof t != "boolean") throw new Error("'decoratorsBeforeExport' must be a boolean, if specified."); let e = a2.get("decorators").allowCallParenthesized; if (e != null && typeof e != "boolean") throw new Error("'allowCallParenthesized' must be a boolean."); } if (a2.has("flow") && a2.has("typescript")) throw new Error("Cannot combine flow and typescript plugins."); if (a2.has("placeholders") && a2.has("v8intrinsic")) throw new Error("Cannot combine placeholders and v8intrinsic plugins."); if (a2.has("pipelineOperator")) { let t = a2.get("pipelineOperator").proposal; if (!Kt.includes(t)) { let e = Kt.map((s) => `"${s}"`).join(", "); throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`); } if (t === "hack") { if (a2.has("placeholders")) throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); if (a2.has("v8intrinsic")) throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); let e = a2.get("pipelineOperator").topicToken; if (!Ht.includes(e)) { let s = Ht.map((i) => `"${i}"`).join(", "); throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${s}.`); } } } if (a2.has("moduleAttributes")) throw new Error("`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead."); if (a2.has("importAssertions")) throw new Error("`importAssertions` has been removed in Babel 8, please use import attributes instead. To use the non-standard `assert` syntax you can enable the `deprecatedImportAssert` parser plugin."); if (!a2.has("deprecatedImportAssert") && a2.has("importAttributes") && a2.get("importAttributes").deprecatedAssertSyntax) throw new Error("The 'importAttributes' plugin has been removed in Babel 8. If you need to enable support for the deprecated `assert` syntax, you can enable the `deprecatedImportAssert` parser plugin."); if (a2.has("recordAndTuple")) throw new Error("The 'recordAndTuple' plugin has been removed in Babel 8. Please remove it from your configuration."); if (a2.has("asyncDoExpressions") && !a2.has("doExpressions")) { let t = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); throw t.missingPlugins = "doExpressions", t; } if (a2.has("optionalChainingAssign") && a2.get("optionalChainingAssign").version !== "2023-07") throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'."); if (a2.has("discardBinding") && a2.get("discardBinding").syntaxType !== "void") throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'."); { if (a2.has("decimal")) throw new Error("The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration."); if (a2.has("importReflection")) throw new Error("The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code."); } } function rr(a2, t, e) { for (let s = 0; s < a2.length; s++) { let i = a2[s], { type: r } = i; typeof r == "number" && (i.type = Gt(r)); } return a2; } function Ie(a2, t) { if (t?.sourceType === "unambiguous") { t = Object.assign({}, t); try { t.sourceType = "module"; let e = le(t, a2), s = e.parse(); if (e.sawUnambiguousESM) return s; if (e.ambiguousScriptDifferentAst) try { return t.sourceType = "script", le(t, a2).parse(); } catch { } else s.program.sourceType = "script"; return s; } catch (e) { try { return t.sourceType = "script", le(t, a2).parse(); } catch { } throw e; } } else return le(t, a2).parse(); } function Ne(a2, t) { let e = le(t, a2); return e.options.strictMode && (e.state.strict = !0), e.getExpression(); } function ar(a2) { let t = {}; for (let e of Object.keys(a2)) t[e] = Gt(a2[e]); return t; } function le(a2, t) { let e = Ee, s = /* @__PURE__ */ new Map(); if (a2?.plugins) { for (let i of a2.plugins) { let r, n; typeof i == "string" ? r = i : [r, n] = i, s.has(r) || s.set(r, n || {}); } er(s), e = nr(s); } return new e(a2, t, s); } function nr(a2) { let t = []; for (let i of tr) a2.has(i) && t.push(i); let e = t.join("|"), s = Wt.get(e); if (!s) { s = Ee; for (let i of t) s = hs[i](s); Wt.set(e, s); } return s; } function ke(a2) { return (t, e, s) => { let i = !!s?.backwards; if (e === !1) return !1; let { length: r } = t, n = e; for (; n >= 0 && n < r; ) { let o = t.charAt(n); if (a2 instanceof RegExp) { if (!a2.test(o)) return n; } else if (!a2.includes(o)) return n; i ? n-- : n++; } return n === -1 || n === r ? n : !1; }; } function or(a2, t) { if (t === !1) return !1; if (a2.charAt(t) === "/" && a2.charAt(t + 1) === "*") { for (let e = t + 2; e < a2.length; ++e) if (a2.charAt(e) === "*" && a2.charAt(e + 1) === "/") return e + 2; } return t; } function hr(a2, t, e) { let s = !!e?.backwards; if (t === !1) return !1; let i = a2.charAt(t); if (s) { if (a2.charAt(t - 1) === "\r" && i === ` `) return t - 2; if (us(i)) return t - 1; } else { if (i === "\r" && a2.charAt(t + 1) === ` `) return t + 2; if (us(i)) return t + 1; } return t; } function cr(a2, t) { return t === !1 ? !1 : a2.charAt(t) === "/" && a2.charAt(t + 1) === "/" ? ls(a2, t) : t; } function lr(a2, t) { let e = null, s = t; for (; s !== e; ) e = s, s = cs(a2, s), s = ps(a2, s), s = ds(a2, s), s = fs(a2, s); return s; } function ys(a2) { let t = []; for (let e of a2) try { return e(); } catch (s) { t.push(s); } throw Object.assign(new Error("All combinations failed"), { errors: t }); } function pr(a2) { if (!a2.startsWith("#!")) return ""; let t = a2.indexOf(` `); return t === -1 ? a2 : a2.slice(0, t); } function dr(a2) { return this[a2 < 0 ? this.length + a2 : a2]; } function M(a2) { let t = a2.range?.[0] ?? a2.start, e = (a2.declaration?.decorators ?? a2.decorators)?.[0]; return e ? Math.min(M(e), t) : t; } function L(a2) { return a2.range?.[1] ?? a2.end; } function yr(a2) { let t = new Set(a2); return (e) => t.has(e?.type); } function gr(a2) { return St.has(a2) || St.set(a2, se(a2) && a2.value[0] === "*" && /@(?:type|satisfies)\b/u.test(a2.value)), St.get(a2); } function Tr(a2) { if (!se(a2)) return !1; let t = `*${a2.value}*`.split(` `); return t.length > 1 && t.every((e) => e.trimStart()[0] === "*"); } function br(a2) { return wt.has(a2) || wt.set(a2, Tr(a2)), wt.get(a2); } function Ar(a2) { if (a2.length < 2) return; let t; for (let e = a2.length - 1; e >= 0; e--) { let s = a2[e]; if (t && L(s) === M(t) && Ct(s) && Ct(t) && (a2.splice(e + 1, 1), s.value += "*//*" + t.value, s.range = [M(s), L(t)]), !gs(s) && !se(s)) throw new TypeError(`Unknown comment type: "${s.type}".`); t = s; } } function Sr(a2) { return a2 !== null && typeof a2 == "object"; } function ye(a2) { if (me !== null && typeof me.property) { let t = me; return me = ye.prototype = null, t; } return me = ye.prototype = a2 ?? /* @__PURE__ */ Object.create(null), new ye(); } function Et(a2) { return ye(a2); } function Cr(a2, t = "type") { Et(a2); function e(s) { let i = s[t], r = a2[i]; if (!Array.isArray(r)) throw Object.assign(new Error(`Missing visitor keys for '${i}'.`), { node: s }); return r; } return e; } function Le(a2, t) { if (!As(a2)) return a2; if (Array.isArray(a2)) { for (let s = 0; s < a2.length; s++) a2[s] = Le(a2[s], t); return a2; } if (t.onEnter) { let s = t.onEnter(a2) ?? a2; if (s !== a2) return Le(s, t); a2 = s; } let e = Cs(a2); for (let s = 0; s < e.length; s++) a2[e[s]] = Le(a2[e[s]], t); return t.onLeave && (a2 = t.onLeave(a2) || a2), a2; } function Ir(a2, t) { let { parser: e, text: s } = t, { comments: i } = a2, r = e === "oxc" && t.oxcAstType === "ts"; bs(i); let n = a2.type === "File" ? a2.program : a2; n.interpreter && (i.unshift(n.interpreter), delete n.interpreter), r && a2.hashbang && (i.unshift(a2.hashbang), delete a2.hashbang), a2.type === "Program" && (a2.range = [0, s.length]); let o; return a2 = Es(a2, { onEnter(h) { switch (h.type) { case "ParenthesizedExpression": { let { expression: l } = h, u = M(h); if (l.type === "TypeCastExpression") return l.range = [u, L(h)], l; let f = !1; if (!r) { if (!o) { o = []; for (let x of i) Ts(x) && o.push(L(x)); } let d = xs(0, o, (x) => x <= u); f = d && s.slice(d, u).trim().length === 0; } return f ? void 0 : (l.extra = { ...l.extra, parenthesized: !0 }, l); } case "TemplateLiteral": if (h.expressions.length !== h.quasis.length - 1) throw new Error("Malformed template literal."); break; case "TemplateElement": if (e === "flow" || e === "hermes" || e === "espree" || e === "typescript" || r) { let l = M(h) + 1, u = L(h) - (h.tail ? 1 : 2); h.range = [l, u]; } break; case "VariableDeclaration": { let l = Ps(0, h.declarations, -1); l?.init && s[L(l)] !== ";" && (h.range = [M(h), L(l)]); break; } case "TSParenthesizedType": return h.typeAnnotation; case "TopicReference": a2.extra = { ...a2.extra, __isUsingHackPipeline: !0 }; break; case "TSUnionType": case "TSIntersectionType": if (h.types.length === 1) return h.types[0]; break; case "ImportExpression": e === "hermes" && h.attributes && !h.options && (h.options = h.attributes); break; } }, onLeave(h) { switch (h.type) { case "LogicalExpression": if (Is(h)) return It(h); break; case "TSImportType": !h.source && h.argument.type === "TSLiteralType" && (h.source = h.argument.literal, delete h.argument); break; } } }), a2; } function Is(a2) { return a2.type === "LogicalExpression" && a2.right.type === "LogicalExpression" && a2.operator === a2.right.operator; } function It(a2) { return Is(a2) ? It({ type: "LogicalExpression", operator: a2.operator, left: It({ type: "LogicalExpression", operator: a2.operator, left: a2.left, right: a2.right.left, range: [M(a2.left), L(a2.right.left)] }), right: a2.right.right, range: [M(a2), L(a2)] }) : a2; } function Nr(a2, t) { let e = new SyntaxError(a2 + " (" + t.loc.start.line + ":" + t.loc.start.column + ")"); return Object.assign(e, t); } function kr(a2) { let { message: t, loc: e, reasonCode: s } = a2; if (!e) return a2; let { line: i, column: r } = e, n = a2; (s === "MissingPlugin" || s === "MissingOneOfPlugins") && (t = "Unexpected token.", n = void 0); let o = ` (${i}:${r})`; return t.endsWith(o) && (t = t.slice(0, -o.length)), t.startsWith(ks) && (t = t.slice(ks.length)), De(t, { loc: { start: { line: i, column: r + 1 } }, cause: n }); } function Ds(a2) { let t = a2.match(Or); return t ? t[0].trimStart() : ""; } function Ms(a2) { a2 = xe(0, a2.replace(Mr, "").replace(Dr, ""), Rr, "$1"); let e = ""; for (; e !== a2; ) e = a2, a2 = xe(0, a2, Br, ` $1 $2 `); a2 = a2.replace(vs, "").trimEnd(); let s = /* @__PURE__ */ Object.create(null), i = xe(0, a2, Ls, "").replace(vs, "").trimEnd(), r; for (; r = Ls.exec(a2); ) { let n = xe(0, r[2], Fr, ""); if (typeof s[r[1]] == "string" || Array.isArray(s[r[1]])) { let o = s[r[1]]; s[r[1]] = [...Ur, ...Array.isArray(o) ? o : [o], n]; } else s[r[1]] = n; } return { comments: i, pragmas: s }; } function Bs(a2) { let t = ve(a2); t && (a2 = a2.slice(t.length + 1)); let e = Ds(a2), { pragmas: s, comments: i } = Ms(e); return { shebang: t, text: a2, pragmas: s, comments: i }; } function Rs(a2) { let { pragmas: t } = Bs(a2); return Fs.some((e) => Object.prototype.hasOwnProperty.call(t, e)); } function Us(a2) { let { pragmas: t } = Bs(a2); return Os.some((e) => Object.prototype.hasOwnProperty.call(t, e)); } function _r(a2) { return a2 = typeof a2 == "function" ? { parse: a2 } : a2, { astFormat: "estree", hasPragma: Rs, hasIgnorePragma: Us, locStart: M, locEnd: L, ...a2 }; } function _s(a2) { if (typeof a2 == "string") { if (a2 = a2.toLowerCase(), /\.(?:mjs|mts)$/iu.test(a2)) return Oe; if (/\.(?:cjs|cts)$/iu.test(a2)) return Nt; } } function jr(a2, t) { let { type: e = "JsExpressionRoot", rootMarker: s, text: i } = t, { tokens: r, comments: n } = a2; return delete a2.tokens, delete a2.comments, { tokens: r, comments: n, type: e, node: a2, range: [0, i.length], rootMarker: s }; } function qr(a2, t) { if (t?.endsWith(".js.flow")) return !0; let e = ve(a2); e && (a2 = a2.slice(e.length)); let s = ms(a2, 0); return s !== !1 && (a2 = a2.slice(0, s)), zr.test(a2); } function $r(a2, t, e) { let s = a2(t, e), i = s.errors.find((r) => !Hr.has(r.reasonCode)); if (i) throw i; return s; } function Kr({ isExpression: a2 = !1, optionsCombinations: t }) { return (e, s = {}) => { let { filepath: i } = s; if (typeof i != "string" && (i = void 0), (s.parser === "babel" || s.parser === "__babel_estree") && qr(e, i)) return s.parser = "babel-flow", qs.parse(e, s); let r = t, n = s.__babelSourceType ?? _s(i); n && n !== Oe && (r = r.map((u) => ({ ...u, sourceType: n, ...n === Nt ? { allowReturnOutsideFunction: void 0, allowNewTargetOutsideFunction: void 0 } : void 0 }))); let o = /%[A-Z]/u.test(e); e.includes("|>") ? r = (o ? [...Vs, js] : Vs).flatMap((f) => r.map((d) => _([f], d))) : o && (r = r.map((u) => _([js], u))); let h = a2 ? Ne : Ie, l; try { l = ys(r.map((u) => () => $r(h, e, u))); } catch ({ errors: [u] }) { throw Me(u); } return a2 && (l = Fe(l, { text: e, rootMarker: s.rootMarker })), Ns(l, { text: e }); }; } function Qr(a2) { return Array.isArray(a2) && a2.length > 0; } function Zr(a2) { let t = Ie(a2, $s), { program: e } = t; if (e.body.length === 0 && e.directives.length === 0 && !e.interpreter) return t; } function Be(a2, t = {}) { let { allowComments: e = !0, allowEmpty: s = !1 } = t, i; try { i = Ne(a2, $s); } catch (r) { if (s && r.code === "BABEL_PARSER_SYNTAX_ERROR" && r.reasonCode === "ParseExpressionEmptyInput") try { i = Zr(a2); } catch { } if (!i) throw Me(r); } if (!e && vt(i.comments)) throw q(i.comments[0], "Comment"); return i = Fe(i, { type: "JsonRoot", text: a2 }), i.node.type === "File" ? delete i.node : re(i.node), i; } function q(a2, t) { let [e, s] = [a2.loc.start, a2.loc.end].map(({ line: i, column: r }) => ({ line: i, column: r + 1 })); return De(`${t} is not allowed in JSON.`, { loc: { start: e, end: s } }); } function re(a2) { switch (a2.type) { case "ArrayExpression": for (let t of a2.elements) t !== null && re(t); return; case "ObjectExpression": for (let t of a2.properties) re(t); return; case "ObjectProperty": if (a2.computed) throw q(a2.key, "Computed key"); if (a2.shorthand) throw q(a2.key, "Shorthand property"); a2.key.type !== "Identifier" && re(a2.key), re(a2.value); return; case "UnaryExpression": { let { operator: t, argument: e } = a2; if (t !== "+" && t !== "-") throw q(a2, `Operator '${a2.operator}'`); if (e.type === "NumericLiteral" || e.type === "Identifier" && (e.name === "Infinity" || e.name === "NaN")) return; throw q(e, `Operator '${t}' before '${e.type}'`); } case "Identifier": if (a2.name !== "Infinity" && a2.name !== "NaN" && a2.name !== "undefined") throw q(a2, `Identifier '${a2.name}'`); return; case "TemplateLiteral": if (vt(a2.expressions)) throw q(a2.expressions[0], "'TemplateLiteral' with expression"); for (let t of a2.quasis) re(t); return; case "NullLiteral": case "BooleanLiteral": case "NumericLiteral": case "StringLiteral": case "TemplateElement": return; default: throw q(a2, `'${a2.type}'`); } } var Hs, Re, Ks, kt, R, Q, Dt, Js, Mt, be, Gs, Xs, Ys, Qs, Zs, ei, p, ri, Ft, ai, W, E, T, m, Ue, oe, j, ni, we, ft, pe, dt, mt, yt, xt, Pt, gt, oi, bt, Xt, Pi, gi, Yt, Ti, At, bi, Ai, Si, Ei, ue, fe, He, We, Ni, g, vi, Di, Mi, Oi, ge, _e, je, U, Bi, Je, Ge, Xe, Ye, Qe, Ze, Ui, _t, Te, Vi, tt, st, it, rt, Z, Ce, at, nt, Y, de, Vt, ot, ht, ct, Ve, y, Ji, $t, Qi, Zi, Kt, Ht, hs, tr, pt, ze, sr, ir, qe, ut, Ee, ua, Wt, da, cs, ma, ls, ps, us, fs, ds, ms, ve, ee, ur, fr, xs, mr, Ps, te, xr, se, Pr, gs, St, Ts, wt, Ct, bs, As, me, wr, Ss, c, ws, Er, Cs, Es, fn, Ns, De, ks, Me, vr, Lr, xe, Dr, Mr, Or, Fr, vs, Br, Ls, Rr, Ur, Os, Fs, H, Oe, Nt, Fe, ie, Vr, js, Vs, _, zr, Hr, zs, Wr, Jr, Gr, Xr, qs, Yr, Lt, vt, $s, ea, ta, sa, ia, ra, init_babel = __esm({ "../../node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/plugins/babel.mjs"() { init_cjs_shims(); Hs = Object.defineProperty, Re = (a2, t) => { for (var e in t) Hs(a2, e, { get: t[e], enumerable: !0 }); }, Ks = {}; Re(Ks, { parsers: () => ra }); kt = {}; Re(kt, { __babel_estree: () => Yr, __js_expression: () => Gr, __ts_expression: () => Xr, __vue_event_binding: () => Wr, __vue_expression: () => Gr, __vue_ts_event_binding: () => Jr, __vue_ts_expression: () => Xr, babel: () => Wr, "babel-flow": () => qs, "babel-ts": () => Jr }); R = class { line; column; index; constructor(t, e, s) { this.line = t, this.column = e, this.index = s; } }, Q = class { start; end; filename; identifierName; constructor(t, e) { this.start = t, this.end = e; } }; Dt = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED", Js = { ImportMetaOutsideModule: { message: `import.meta may appear only with 'sourceType: "module"'`, code: Dt }, ImportOutsideModule: { message: `'import' and 'export' may appear only with 'sourceType: "module"'`, code: Dt } }, Mt = { ArrayPattern: "array destructuring pattern", AssignmentExpression: "assignment expression", AssignmentPattern: "assignment expression", ArrowFunctionExpression: "arrow function expression", ConditionalExpression: "conditional expression", CatchClause: "catch clause", ForOfStatement: "for-of statement", ForInStatement: "for-in statement", ForStatement: "for-loop", FormalParameters: "function parameter list", Identifier: "identifier", ImportSpecifier: "import specifier", ImportDefaultSpecifier: "import default specifier", ImportNamespaceSpecifier: "import namespace specifier", ObjectPattern: "object destructuring pattern", ParenthesizedExpression: "parenthesized expression", RestElement: "rest element", UpdateExpression: { true: "prefix operation", false: "postfix operation" }, VariableDeclarator: "variable declaration", YieldExpression: "yield expression" }, be = (a2) => a2.type === "UpdateExpression" ? Mt.UpdateExpression[`${a2.prefix}`] : Mt[a2.type], Gs = { AccessorIsGenerator: ({ kind: a2 }) => `A ${a2}ter cannot be a generator.`, ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", BadGetterArity: "A 'get' accessor must not have any formal parameters.", BadSetterArity: "A 'set' accessor must have exactly one formal parameter.", BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.", ConstructorClassField: "Classes may not have a field named 'constructor'.", ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", ConstructorIsAccessor: "Class constructor may not be an accessor.", ConstructorIsAsync: "Constructor can't be an async function.", ConstructorIsGenerator: "Constructor can't be a generator.", DeclarationMissingInitializer: ({ kind: a2 }) => `Missing initializer in ${a2} declaration.`, DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.", DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.", DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", DecoratorSemicolon: "Decorators must not be followed by a semicolon.", DecoratorStaticBlock: "Decorators can't be used with a static block.", DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.', DeletePrivateField: "Deleting a private field is not allowed.", DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", DuplicateConstructor: "Duplicate constructor in the same class.", DuplicateDefaultExport: "Only one default export allowed per module.", DuplicateExport: ({ exportName: a2 }) => `\`${a2}\` has already been exported. Exported identifiers must be unique.`, DuplicateProto: "Redefinition of __proto__ property.", DuplicateRegExpFlags: "Duplicate regular expression flag.", ElementAfterRest: "Rest element must be last element.", EscapedCharNotAnIdentifier: "Invalid Unicode escape.", ExportBindingIsString: ({ localName: a2, exportName: t }) => `A string literal cannot be used as an exported binding without \`from\`. - Did you mean \`export { '${a2}' as '${t}' } from 'some-module'\`?`, ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", ForInOfLoopInitializer: ({ type: a2 }) => `'${a2 === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, ForInUsing: "For-in loop may not start with 'using' declaration.", ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", IllegalBreakContinue: ({ type: a2 }) => `Unsyntactic ${a2 === "BreakStatement" ? "break" : "continue"}.`, IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", IllegalReturn: "'return' outside of function.", ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.", ImportBindingIsString: ({ importName: a2 }) => `A string literal cannot be used as an imported binding. - Did you mean \`import { "${a2}" as foo }\`?`, ImportCallArity: "`import()` requires exactly one or two arguments.", ImportCallNotNewExpression: "Cannot use new with import(...).", ImportCallSpreadArgument: "`...` is not allowed in `import()`.", ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", ImportReflectionHasAssertion: "`import module x` cannot have assertions.", ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", InvalidBigIntLiteral: "Invalid BigIntLiteral.", InvalidCodePoint: "Code point out of bounds.", InvalidCoverDiscardElement: "'void' must be followed by an expression when not used in a binding position.", InvalidCoverInitializedName: "Invalid shorthand property initializer.", InvalidDecimal: "Invalid decimal.", InvalidDigit: ({ radix: a2 }) => `Expected number in radix ${a2}.`, InvalidEscapeSequence: "Bad character escape sequence.", InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", InvalidEscapedReservedWord: ({ reservedWord: a2 }) => `Escape sequence in keyword ${a2}.`, InvalidIdentifier: ({ identifierName: a2 }) => `Invalid identifier ${a2}.`, InvalidLhs: ({ ancestor: a2 }) => `Invalid left-hand side in ${be(a2)}.`, InvalidLhsBinding: ({ ancestor: a2 }) => `Binding invalid left-hand side in ${be(a2)}.`, InvalidLhsOptionalChaining: ({ ancestor: a2 }) => `Invalid optional chaining in the left-hand side of ${be(a2)}.`, InvalidNumber: "Invalid number.", InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", InvalidOrUnexpectedToken: ({ unexpected: a2 }) => `Unexpected character '${a2}'.`, InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", InvalidPrivateFieldResolution: ({ identifierName: a2 }) => `Private name #${a2} is not defined.`, InvalidPropertyBindingPattern: "Binding member expression.", InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", InvalidRestAssignmentPattern: "Invalid rest operator's argument.", LabelRedeclaration: ({ labelName: a2 }) => `Label '${a2}' is already declared.`, LetInLexicalBinding: "'let' is disallowed as a lexically bound name.", LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", MalformedRegExpFlags: "Invalid regular expression flag.", MissingClassName: "A class name is required.", MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", MissingSemicolon: "Missing semicolon.", MissingPlugin: ({ missingPlugin: a2 }) => `This experimental syntax requires enabling the parser plugin: ${a2.map((t) => JSON.stringify(t)).join(", ")}.`, MissingOneOfPlugins: ({ missingPlugin: a2 }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${a2.map((t) => JSON.stringify(t)).join(", ")}.`, MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", ModuleAttributesWithDuplicateKeys: ({ key: a2 }) => `Duplicate key "${a2}" is not allowed in module attributes.`, ModuleExportNameHasLoneSurrogate: ({ surrogateCharCode: a2 }) => `An export name cannot include a lone surrogate, found '\\u${a2.toString(16)}'.`, ModuleExportUndefined: ({ localName: a2 }) => `Export '${a2}' is not defined.`, MultipleDefaultsInSwitch: "Multiple default clauses.", NewlineAfterThrow: "Illegal newline after throw.", NoCatchOrFinally: "Missing catch or finally clause.", NumberIdentifier: "Identifier directly after number.", NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", ParamDupe: "Argument name clash.", PatternHasAccessor: "Object pattern can't contain getter or setter.", PatternHasMethod: "Object pattern can't contain methods.", PrivateInExpectedIn: ({ identifierName: a2 }) => `Private names are only allowed in property accesses (\`obj.#${a2}\`) or in \`in\` expressions (\`#${a2} in obj\`).`, PrivateNameRedeclaration: ({ identifierName: a2 }) => `Duplicate private name #${a2}.`, RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", RecordNoProto: "'__proto__' is not allowed in Record expressions.", RestTrailingComma: "Unexpected trailing comma after rest element.", SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.', StaticPrototype: "Classes may not have static property named prototype.", SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", SuperPrivateField: "Private fields can't be accessed on super.", TrailingDecorator: "Decorators must be attached to a class element.", TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', UnexpectedDigitAfterHash: "Unexpected digit after hash token.", UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", UnexpectedKeyword: ({ keyword: a2 }) => `Unexpected keyword '${a2}'.`, UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", UnexpectedPrivateField: "Unexpected private name.", UnexpectedReservedWord: ({ reservedWord: a2 }) => `Unexpected reserved word '${a2}'.`, UnexpectedSuper: "'super' is only allowed in object methods and classes.", UnexpectedToken: ({ expected: a2, unexpected: t }) => `Unexpected token${t ? ` '${t}'.` : ""}${a2 ? `, expected "${a2}"` : ""}`, UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.", UnexpectedVoidPattern: "Unexpected void binding.", UnsupportedBind: "Binding should be performed on object property.", UnsupportedDecoratorExport: "A decorated export must export a class declaration.", UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", UnsupportedMetaProperty: ({ target: a2, onlyValidPropertyName: t }) => `The only valid meta property for ${a2} is ${a2}.${t}.`, UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", UnterminatedComment: "Unterminated comment.", UnterminatedRegExp: "Unterminated regular expression.", UnterminatedString: "Unterminated string constant.", UnterminatedTemplate: "Unterminated template.", UsingDeclarationExport: "Using declaration cannot be exported.", UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", VarRedeclaration: ({ identifierName: a2 }) => `Identifier '${a2}' has already been declared.`, VoidPatternCatchClauseParam: "A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.", VoidPatternInitializer: "A void binding may not have an initializer.", YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", YieldInParameter: "Yield expression is not allowed in formal parameters.", YieldNotInGeneratorFunction: "'yield' is only allowed within generator functions.", ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." }, Xs = { StrictDelete: "Deleting local variable in strict mode.", StrictEvalArguments: ({ referenceName: a2 }) => `Assigning to '${a2}' in strict mode.`, StrictEvalArgumentsBinding: ({ bindingName: a2 }) => `Binding '${a2}' in strict mode.`, StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", StrictWith: "'with' in strict mode." }, Ys = { ParseExpressionEmptyInput: "Unexpected parseExpression() input: The input is empty or contains only comments.", ParseExpressionExpectsEOF: ({ unexpected: a2 }) => `Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(a2)}\`.` }, Qs = /* @__PURE__ */ new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]), Zs = Object.assign({ PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", PipeTopicRequiresHackPipes: 'Topic references are only supported when using the `"proposal": "hack"