ct-rich-text-editor 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/style.css +5319 -1
- package/dist/{babel-1c4a328b.js → babel-d155920e.js} +2303 -2279
- package/dist/{babel-1c4a328b.js.map → babel-d155920e.js.map} +1 -1
- package/dist/estree-b1fff53b.js +4706 -0
- package/dist/{estree-2cbea43c.js.map → estree-b1fff53b.js.map} +1 -1
- package/dist/html-f95ee5dc.js +2885 -0
- package/dist/{html-c18fb60e.js.map → html-f95ee5dc.js.map} +1 -1
- package/dist/index-7c4c0170.js +655 -0
- package/dist/index-7c4c0170.js.map +1 -0
- package/dist/index-c98eb13a.js +27325 -0
- package/dist/index-c98eb13a.js.map +1 -0
- package/dist/index.js +48 -15
- package/dist/index.js.map +1 -1
- package/dist/markdown-1d9e6c3f.js +3759 -0
- package/dist/markdown-1d9e6c3f.js.map +1 -0
- package/dist/postcss-c2592f3f.js +5399 -0
- package/dist/postcss-c2592f3f.js.map +1 -0
- package/dist/standalone-bcc7f37a.js +2649 -0
- package/dist/standalone-bcc7f37a.js.map +1 -0
- package/dist/typescript-48c10f50.js +13601 -0
- package/dist/{typescript-39d06710.js.map → typescript-48c10f50.js.map} +1 -1
- package/package.json +4 -4
- package/dist/estree-2cbea43c.js +0 -4668
- package/dist/html-c18fb60e.js +0 -2842
- package/dist/index-0e027fdf.js +0 -806
- package/dist/index-0e027fdf.js.map +0 -1
- package/dist/index-bd25a91b.js +0 -35926
- package/dist/index-bd25a91b.js.map +0 -1
- package/dist/markdown-39c3822b.js +0 -3548
- package/dist/markdown-39c3822b.js.map +0 -1
- package/dist/postcss-bbcc713e.js +0 -5152
- package/dist/postcss-bbcc713e.js.map +0 -1
- package/dist/standalone-36ad3877.js +0 -2601
- package/dist/standalone-36ad3877.js.map +0 -1
- package/dist/typescript-39d06710.js +0 -13534
package/dist/estree-2cbea43c.js
DELETED
|
@@ -1,4668 +0,0 @@
|
|
|
1
|
-
var Qa = Object.defineProperty;
|
|
2
|
-
var Ya = (e, t, n) => t in e ? Qa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var _t = (e, t, n) => (Ya(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
var Za = Object.defineProperty, Jr = (e) => {
|
|
5
|
-
throw TypeError(e);
|
|
6
|
-
}, en = (e, t) => {
|
|
7
|
-
for (var n in t)
|
|
8
|
-
Za(e, n, { get: t[n], enumerable: !0 });
|
|
9
|
-
}, qr = (e, t, n) => t.has(e) || Jr("Cannot " + n), Le = (e, t, n) => (qr(e, t, "read from private field"), n ? n.call(e) : t.get(e)), eo = (e, t, n) => t.has(e) ? Jr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), to = (e, t, n, r) => (qr(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), _r = {};
|
|
10
|
-
en(_r, { languages: () => DD, options: () => lD, printers: () => cD });
|
|
11
|
-
var no = [{ linguistLanguageId: 183, name: "JavaScript", type: "programming", tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", color: "#f1e05a", aliases: ["js", "node"], extensions: [".js", "._js", ".bones", ".cjs", ".es", ".es6", ".frag", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib", ".wxs"], filenames: ["Jakefile"], interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell", "zx"], parsers: ["babel", "acorn", "espree", "meriyah", "babel-flow", "babel-ts", "flow", "typescript"], vscodeLanguageIds: ["javascript", "mongo"] }, { linguistLanguageId: 183, name: "Flow", type: "programming", tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", color: "#f1e05a", aliases: [], extensions: [".js.flow"], filenames: [], interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell"], parsers: ["flow", "babel-flow"], vscodeLanguageIds: ["javascript"] }, { linguistLanguageId: 183, name: "JSX", type: "programming", tmScope: "source.js.jsx", aceMode: "javascript", codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", color: void 0, aliases: void 0, extensions: [".jsx"], filenames: void 0, interpreters: void 0, parsers: ["babel", "babel-flow", "babel-ts", "flow", "typescript", "espree", "meriyah"], vscodeLanguageIds: ["javascriptreact"], group: "JavaScript" }, { linguistLanguageId: 378, name: "TypeScript", type: "programming", color: "#3178c6", aliases: ["ts"], interpreters: ["deno", "ts-node"], extensions: [".ts", ".cts", ".mts"], tmScope: "source.ts", aceMode: "typescript", codemirrorMode: "javascript", codemirrorMimeType: "application/typescript", parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescript"] }, { linguistLanguageId: 94901924, name: "TSX", type: "programming", color: "#3178c6", group: "TypeScript", extensions: [".tsx"], tmScope: "source.tsx", aceMode: "javascript", codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescriptreact"] }], Xr = {};
|
|
12
|
-
en(Xr, { canAttachComment: () => ls, embed: () => Qs, experimentalFeatures: () => tD, getCommentChildNodes: () => cs, getVisitorKeys: () => Ur, handleComments: () => cu, insertPragma: () => lp, isBlockComment: () => De, isGap: () => Ds, massageAstNode: () => si, print: () => eD, printComment: () => vi, willPrintOwnComments: () => hu });
|
|
13
|
-
var ro = (e, t, n, r) => {
|
|
14
|
-
if (!(e && t == null))
|
|
15
|
-
return t.replaceAll ? t.replaceAll(n, r) : n.global ? t.replace(n, r) : t.split(n).join(r);
|
|
16
|
-
}, H = ro, uo = (e, t, n) => {
|
|
17
|
-
if (!(e && t == null))
|
|
18
|
-
return Array.isArray(t) || typeof t == "string" ? t[n < 0 ? t.length + n : n] : t.at(n);
|
|
19
|
-
}, _ = uo;
|
|
20
|
-
function ao(e) {
|
|
21
|
-
return e !== null && typeof e == "object";
|
|
22
|
-
}
|
|
23
|
-
var oo = ao;
|
|
24
|
-
function* io(e, t) {
|
|
25
|
-
let { getVisitorKeys: n, filter: r = () => !0 } = t, u = (a) => oo(a) && r(a);
|
|
26
|
-
for (let a of n(e)) {
|
|
27
|
-
let o = e[a];
|
|
28
|
-
if (Array.isArray(o))
|
|
29
|
-
for (let i of o)
|
|
30
|
-
u(i) && (yield i);
|
|
31
|
-
else
|
|
32
|
-
u(o) && (yield o);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function* so(e, t) {
|
|
36
|
-
let n = [e];
|
|
37
|
-
for (let r = 0; r < n.length; r++) {
|
|
38
|
-
let u = n[r];
|
|
39
|
-
for (let a of io(u, t))
|
|
40
|
-
yield a, n.push(a);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function po(e, { getVisitorKeys: t, predicate: n }) {
|
|
44
|
-
for (let r of so(e, { getVisitorKeys: t }))
|
|
45
|
-
if (n(r))
|
|
46
|
-
return !0;
|
|
47
|
-
return !1;
|
|
48
|
-
}
|
|
49
|
-
var lo = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
50
|
-
function co(e) {
|
|
51
|
-
return e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
|
|
52
|
-
}
|
|
53
|
-
function Do(e) {
|
|
54
|
-
return e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9776 && e <= 9783 || e >= 9800 && e <= 9811 || e === 9855 || e >= 9866 && e <= 9871 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12773 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101631 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e >= 119552 && e <= 119638 || e >= 119648 && e <= 119670 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129673 || e >= 129679 && e <= 129734 || e >= 129742 && e <= 129756 || e >= 129759 && e <= 129769 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141;
|
|
55
|
-
}
|
|
56
|
-
var yo = (e) => !(co(e) || Do(e)), mo = /[^\x20-\x7F]/u;
|
|
57
|
-
function fo(e) {
|
|
58
|
-
if (!e)
|
|
59
|
-
return 0;
|
|
60
|
-
if (!mo.test(e))
|
|
61
|
-
return e.length;
|
|
62
|
-
e = e.replace(lo(), " ");
|
|
63
|
-
let t = 0;
|
|
64
|
-
for (let n of e) {
|
|
65
|
-
let r = n.codePointAt(0);
|
|
66
|
-
r <= 31 || r >= 127 && r <= 159 || r >= 768 && r <= 879 || (t += yo(r) ? 1 : 2);
|
|
67
|
-
}
|
|
68
|
-
return t;
|
|
69
|
-
}
|
|
70
|
-
var ct = fo;
|
|
71
|
-
function Jn(e) {
|
|
72
|
-
return (t, n, r) => {
|
|
73
|
-
let u = !!(r != null && r.backwards);
|
|
74
|
-
if (n === !1)
|
|
75
|
-
return !1;
|
|
76
|
-
let { length: a } = t, o = n;
|
|
77
|
-
for (; o >= 0 && o < a; ) {
|
|
78
|
-
let i = t.charAt(o);
|
|
79
|
-
if (e instanceof RegExp) {
|
|
80
|
-
if (!e.test(i))
|
|
81
|
-
return o;
|
|
82
|
-
} else if (!e.includes(i))
|
|
83
|
-
return o;
|
|
84
|
-
u ? o-- : o++;
|
|
85
|
-
}
|
|
86
|
-
return o === -1 || o === a ? o : !1;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
var Dt = Jn(" "), Eo = Jn(",; "), Fo = Jn(/[^\n\r]/u);
|
|
90
|
-
function Ao(e, t, n) {
|
|
91
|
-
let r = !!(n != null && n.backwards);
|
|
92
|
-
if (t === !1)
|
|
93
|
-
return !1;
|
|
94
|
-
let u = e.charAt(t);
|
|
95
|
-
if (r) {
|
|
96
|
-
if (e.charAt(t - 1) === "\r" && u === `
|
|
97
|
-
`)
|
|
98
|
-
return t - 2;
|
|
99
|
-
if (u === `
|
|
100
|
-
` || u === "\r" || u === "\u2028" || u === "\u2029")
|
|
101
|
-
return t - 1;
|
|
102
|
-
} else {
|
|
103
|
-
if (u === "\r" && e.charAt(t + 1) === `
|
|
104
|
-
`)
|
|
105
|
-
return t + 2;
|
|
106
|
-
if (u === `
|
|
107
|
-
` || u === "\r" || u === "\u2028" || u === "\u2029")
|
|
108
|
-
return t + 1;
|
|
109
|
-
}
|
|
110
|
-
return t;
|
|
111
|
-
}
|
|
112
|
-
var yt = Ao;
|
|
113
|
-
function go(e, t, n = {}) {
|
|
114
|
-
let r = Dt(e, n.backwards ? t - 1 : t, n), u = yt(e, r, n);
|
|
115
|
-
return r !== u;
|
|
116
|
-
}
|
|
117
|
-
var se = go;
|
|
118
|
-
function xo(e, t) {
|
|
119
|
-
if (t === !1)
|
|
120
|
-
return !1;
|
|
121
|
-
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
|
|
122
|
-
for (let n = t + 2; n < e.length; ++n)
|
|
123
|
-
if (e.charAt(n) === "*" && e.charAt(n + 1) === "/")
|
|
124
|
-
return n + 2;
|
|
125
|
-
}
|
|
126
|
-
return t;
|
|
127
|
-
}
|
|
128
|
-
var qn = xo;
|
|
129
|
-
function ho(e, t) {
|
|
130
|
-
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? Fo(e, t) : t;
|
|
131
|
-
}
|
|
132
|
-
var _n = ho;
|
|
133
|
-
function Co(e, t) {
|
|
134
|
-
let n = null, r = t;
|
|
135
|
-
for (; r !== n; )
|
|
136
|
-
n = r, r = Eo(e, r), r = qn(e, r), r = Dt(e, r);
|
|
137
|
-
return r = _n(e, r), r = yt(e, r), r !== !1 && se(e, r);
|
|
138
|
-
}
|
|
139
|
-
var Xn = Co;
|
|
140
|
-
function To(e) {
|
|
141
|
-
return Array.isArray(e) && e.length > 0;
|
|
142
|
-
}
|
|
143
|
-
var O = To, Rr = new Proxy(() => {
|
|
144
|
-
}, { get: () => Rr }), Rn = Rr, Xt = "'", yr = '"';
|
|
145
|
-
function So(e, t) {
|
|
146
|
-
let n = t === !0 || t === Xt ? Xt : yr, r = n === Xt ? yr : Xt, u = 0, a = 0;
|
|
147
|
-
for (let o of e)
|
|
148
|
-
o === n ? u++ : o === r && a++;
|
|
149
|
-
return u > a ? r : n;
|
|
150
|
-
}
|
|
151
|
-
var $r = So;
|
|
152
|
-
function bo(e, t, n) {
|
|
153
|
-
let r = t === '"' ? "'" : '"', u = H(!1, e, /\\(.)|(["'])/gsu, (a, o, i) => o === r ? o : i === t ? "\\" + i : i || (n && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(o) ? o : "\\" + o));
|
|
154
|
-
return t + u + t;
|
|
155
|
-
}
|
|
156
|
-
var Bo = bo;
|
|
157
|
-
function vo(e, t) {
|
|
158
|
-
Rn.ok(/^(?<quote>["']).*\k<quote>$/su.test(e));
|
|
159
|
-
let n = e.slice(1, -1), r = t.parser === "json" || t.parser === "jsonc" || t.parser === "json5" && t.quoteProps === "preserve" && !t.singleQuote ? '"' : t.__isInHtmlAttribute ? "'" : $r(n, t.singleQuote);
|
|
160
|
-
return e.charAt(0) === r ? e : Bo(n, r, !1);
|
|
161
|
-
}
|
|
162
|
-
var dt = vo;
|
|
163
|
-
function W(e) {
|
|
164
|
-
var t, n, r;
|
|
165
|
-
let u = ((t = e.range) == null ? void 0 : t[0]) ?? e.start, a = (r = ((n = e.declaration) == null ? void 0 : n.decorators) ?? e.decorators) == null ? void 0 : r[0];
|
|
166
|
-
return a ? Math.min(W(a), u) : u;
|
|
167
|
-
}
|
|
168
|
-
function j(e) {
|
|
169
|
-
var t;
|
|
170
|
-
return ((t = e.range) == null ? void 0 : t[1]) ?? e.end;
|
|
171
|
-
}
|
|
172
|
-
function tn(e, t) {
|
|
173
|
-
let n = W(e);
|
|
174
|
-
return Number.isInteger(n) && n === W(t);
|
|
175
|
-
}
|
|
176
|
-
function ko(e, t) {
|
|
177
|
-
let n = j(e);
|
|
178
|
-
return Number.isInteger(n) && n === j(t);
|
|
179
|
-
}
|
|
180
|
-
function Po(e, t) {
|
|
181
|
-
return tn(e, t) && ko(e, t);
|
|
182
|
-
}
|
|
183
|
-
var St = null;
|
|
184
|
-
function vt(e) {
|
|
185
|
-
if (St !== null && typeof St.property) {
|
|
186
|
-
let t = St;
|
|
187
|
-
return St = vt.prototype = null, t;
|
|
188
|
-
}
|
|
189
|
-
return St = vt.prototype = e ?? /* @__PURE__ */ Object.create(null), new vt();
|
|
190
|
-
}
|
|
191
|
-
var wo = 10;
|
|
192
|
-
for (let e = 0; e <= wo; e++)
|
|
193
|
-
vt();
|
|
194
|
-
function No(e) {
|
|
195
|
-
return vt(e);
|
|
196
|
-
}
|
|
197
|
-
function Io(e, t = "type") {
|
|
198
|
-
No(e);
|
|
199
|
-
function n(r) {
|
|
200
|
-
let u = r[t], a = e[u];
|
|
201
|
-
if (!Array.isArray(a))
|
|
202
|
-
throw Object.assign(new Error(`Missing visitor keys for '${u}'.`), { node: r });
|
|
203
|
-
return a;
|
|
204
|
-
}
|
|
205
|
-
return n;
|
|
206
|
-
}
|
|
207
|
-
var Wr = Io, jo = { ArrayExpression: ["elements"], AssignmentExpression: ["left", "right"], BinaryExpression: ["left", "right"], InterpreterDirective: [], Directive: ["value"], DirectiveLiteral: [], BlockStatement: ["directives", "body"], BreakStatement: ["label"], CallExpression: ["callee", "arguments", "typeParameters", "typeArguments"], CatchClause: ["param", "body"], ConditionalExpression: ["test", "consequent", "alternate"], ContinueStatement: ["label"], DebuggerStatement: [], DoWhileStatement: ["body", "test"], EmptyStatement: [], ExpressionStatement: ["expression"], File: ["program"], ForInStatement: ["left", "right", "body"], ForStatement: ["init", "test", "update", "body"], FunctionDeclaration: ["id", "typeParameters", "params", "predicate", "returnType", "body"], FunctionExpression: ["id", "typeParameters", "params", "returnType", "body"], Identifier: ["typeAnnotation", "decorators"], IfStatement: ["test", "consequent", "alternate"], LabeledStatement: ["label", "body"], StringLiteral: [], NumericLiteral: [], NullLiteral: [], BooleanLiteral: [], RegExpLiteral: [], LogicalExpression: ["left", "right"], MemberExpression: ["object", "property"], NewExpression: ["callee", "arguments", "typeParameters", "typeArguments"], Program: ["directives", "body"], ObjectExpression: ["properties"], ObjectMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], ObjectProperty: ["key", "value", "decorators"], RestElement: ["argument", "typeAnnotation", "decorators"], ReturnStatement: ["argument"], SequenceExpression: ["expressions"], ParenthesizedExpression: ["expression"], SwitchCase: ["test", "consequent"], SwitchStatement: ["discriminant", "cases"], ThisExpression: [], ThrowStatement: ["argument"], TryStatement: ["block", "handler", "finalizer"], UnaryExpression: ["argument"], UpdateExpression: ["argument"], VariableDeclaration: ["declarations"], VariableDeclarator: ["id", "init"], WhileStatement: ["test", "body"], WithStatement: ["object", "body"], AssignmentPattern: ["left", "right", "decorators", "typeAnnotation"], ArrayPattern: ["elements", "typeAnnotation", "decorators"], ArrowFunctionExpression: ["typeParameters", "params", "predicate", "returnType", "body"], ClassBody: ["body"], ClassExpression: ["decorators", "id", "typeParameters", "superClass", "superTypeParameters", "mixins", "implements", "body", "superTypeArguments"], ClassDeclaration: ["decorators", "id", "typeParameters", "superClass", "superTypeParameters", "mixins", "implements", "body", "superTypeArguments"], ExportAllDeclaration: ["source", "attributes", "exported"], ExportDefaultDeclaration: ["declaration"], ExportNamedDeclaration: ["declaration", "specifiers", "source", "attributes"], ExportSpecifier: ["local", "exported"], ForOfStatement: ["left", "right", "body"], ImportDeclaration: ["specifiers", "source", "attributes"], ImportDefaultSpecifier: ["local"], ImportNamespaceSpecifier: ["local"], ImportSpecifier: ["imported", "local"], ImportExpression: ["source", "options"], MetaProperty: ["meta", "property"], ClassMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], ObjectPattern: ["properties", "typeAnnotation", "decorators"], SpreadElement: ["argument"], Super: [], TaggedTemplateExpression: ["tag", "typeParameters", "quasi", "typeArguments"], TemplateElement: [], TemplateLiteral: ["quasis", "expressions"], YieldExpression: ["argument"], AwaitExpression: ["argument"], BigIntLiteral: [], ExportNamespaceSpecifier: ["exported"], OptionalMemberExpression: ["object", "property"], OptionalCallExpression: ["callee", "arguments", "typeParameters", "typeArguments"], ClassProperty: ["decorators", "variance", "key", "typeAnnotation", "value"], ClassAccessorProperty: ["decorators", "key", "typeAnnotation", "value"], ClassPrivateProperty: ["decorators", "variance", "key", "typeAnnotation", "value"], ClassPrivateMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], PrivateName: ["id"], StaticBlock: ["body"], AnyTypeAnnotation: [], ArrayTypeAnnotation: ["elementType"], BooleanTypeAnnotation: [], BooleanLiteralTypeAnnotation: [], NullLiteralTypeAnnotation: [], ClassImplements: ["id", "typeParameters"], DeclareClass: ["id", "typeParameters", "extends", "mixins", "implements", "body"], DeclareFunction: ["id", "predicate"], DeclareInterface: ["id", "typeParameters", "extends", "body"], DeclareModule: ["id", "body"], DeclareModuleExports: ["typeAnnotation"], DeclareTypeAlias: ["id", "typeParameters", "right"], DeclareOpaqueType: ["id", "typeParameters", "supertype"], DeclareVariable: ["id"], DeclareExportDeclaration: ["declaration", "specifiers", "source", "attributes"], DeclareExportAllDeclaration: ["source", "attributes"], DeclaredPredicate: ["value"], ExistsTypeAnnotation: [], FunctionTypeAnnotation: ["typeParameters", "this", "params", "rest", "returnType"], FunctionTypeParam: ["name", "typeAnnotation"], GenericTypeAnnotation: ["id", "typeParameters"], InferredPredicate: [], InterfaceExtends: ["id", "typeParameters"], InterfaceDeclaration: ["id", "typeParameters", "extends", "body"], InterfaceTypeAnnotation: ["extends", "body"], IntersectionTypeAnnotation: ["types"], MixedTypeAnnotation: [], EmptyTypeAnnotation: [], NullableTypeAnnotation: ["typeAnnotation"], NumberLiteralTypeAnnotation: [], NumberTypeAnnotation: [], ObjectTypeAnnotation: ["properties", "indexers", "callProperties", "internalSlots"], ObjectTypeInternalSlot: ["id", "value"], ObjectTypeCallProperty: ["value"], ObjectTypeIndexer: ["variance", "id", "key", "value"], ObjectTypeProperty: ["key", "value", "variance"], ObjectTypeSpreadProperty: ["argument"], OpaqueType: ["id", "typeParameters", "supertype", "impltype"], QualifiedTypeIdentifier: ["qualification", "id"], StringLiteralTypeAnnotation: [], StringTypeAnnotation: [], SymbolTypeAnnotation: [], ThisTypeAnnotation: [], TupleTypeAnnotation: ["types", "elementTypes"], TypeofTypeAnnotation: ["argument", "typeArguments"], TypeAlias: ["id", "typeParameters", "right"], TypeAnnotation: ["typeAnnotation"], TypeCastExpression: ["expression", "typeAnnotation"], TypeParameter: ["bound", "default", "variance"], TypeParameterDeclaration: ["params"], TypeParameterInstantiation: ["params"], UnionTypeAnnotation: ["types"], Variance: [], VoidTypeAnnotation: [], EnumDeclaration: ["id", "body"], EnumBooleanBody: ["members"], EnumNumberBody: ["members"], EnumStringBody: ["members"], EnumSymbolBody: ["members"], EnumBooleanMember: ["id", "init"], EnumNumberMember: ["id", "init"], EnumStringMember: ["id", "init"], EnumDefaultedMember: ["id"], IndexedAccessType: ["objectType", "indexType"], OptionalIndexedAccessType: ["objectType", "indexType"], JSXAttribute: ["name", "value"], JSXClosingElement: ["name"], JSXElement: ["openingElement", "children", "closingElement"], JSXEmptyExpression: [], JSXExpressionContainer: ["expression"], JSXSpreadChild: ["expression"], JSXIdentifier: [], JSXMemberExpression: ["object", "property"], JSXNamespacedName: ["namespace", "name"], JSXOpeningElement: ["name", "typeParameters", "typeArguments", "attributes"], JSXSpreadAttribute: ["argument"], JSXText: [], JSXFragment: ["openingFragment", "children", "closingFragment"], JSXOpeningFragment: [], JSXClosingFragment: [], Noop: [], Placeholder: [], V8IntrinsicIdentifier: [], ArgumentPlaceholder: [], BindExpression: ["object", "callee"], ImportAttribute: ["key", "value"], Decorator: ["expression"], DoExpression: ["body"], ExportDefaultSpecifier: ["exported"], RecordExpression: ["properties"], TupleExpression: ["elements"], ModuleExpression: ["body"], TopicReference: [], PipelineTopicExpression: ["expression"], PipelineBareFunction: ["callee"], PipelinePrimaryTopicReference: [], TSParameterProperty: ["parameter", "decorators"], TSDeclareFunction: ["id", "typeParameters", "params", "returnType", "body"], TSDeclareMethod: ["decorators", "key", "typeParameters", "params", "returnType"], TSQualifiedName: ["left", "right"], TSCallSignatureDeclaration: ["typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSConstructSignatureDeclaration: ["typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSPropertySignature: ["key", "typeAnnotation"], TSMethodSignature: ["key", "typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSIndexSignature: ["parameters", "typeAnnotation"], TSAnyKeyword: [], TSBooleanKeyword: [], TSBigIntKeyword: [], TSIntrinsicKeyword: [], TSNeverKeyword: [], TSNullKeyword: [], TSNumberKeyword: [], TSObjectKeyword: [], TSStringKeyword: [], TSSymbolKeyword: [], TSUndefinedKeyword: [], TSUnknownKeyword: [], TSVoidKeyword: [], TSThisType: [], TSFunctionType: ["typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSConstructorType: ["typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSTypeReference: ["typeName", "typeParameters", "typeArguments"], TSTypePredicate: ["parameterName", "typeAnnotation"], TSTypeQuery: ["exprName", "typeParameters", "typeArguments"], TSTypeLiteral: ["members"], TSArrayType: ["elementType"], TSTupleType: ["elementTypes"], TSOptionalType: ["typeAnnotation"], TSRestType: ["typeAnnotation"], TSNamedTupleMember: ["label", "elementType"], TSUnionType: ["types"], TSIntersectionType: ["types"], TSConditionalType: ["checkType", "extendsType", "trueType", "falseType"], TSInferType: ["typeParameter"], TSParenthesizedType: ["typeAnnotation"], TSTypeOperator: ["typeAnnotation"], TSIndexedAccessType: ["objectType", "indexType"], TSMappedType: ["typeParameter", "nameType", "typeAnnotation"], TSTemplateLiteralType: ["quasis", "types"], TSLiteralType: ["literal"], TSExpressionWithTypeArguments: ["expression", "typeParameters"], TSInterfaceDeclaration: ["id", "typeParameters", "extends", "body"], TSInterfaceBody: ["body"], TSTypeAliasDeclaration: ["id", "typeParameters", "typeAnnotation"], TSInstantiationExpression: ["expression", "typeParameters", "typeArguments"], TSAsExpression: ["expression", "typeAnnotation"], TSSatisfiesExpression: ["expression", "typeAnnotation"], TSTypeAssertion: ["typeAnnotation", "expression"], TSEnumBody: ["members"], TSEnumDeclaration: ["id", "members"], TSEnumMember: ["id", "initializer"], TSModuleDeclaration: ["id", "body"], TSModuleBlock: ["body"], TSImportType: ["argument", "options", "qualifier", "typeParameters", "typeArguments"], TSImportEqualsDeclaration: ["id", "moduleReference"], TSExternalModuleReference: ["expression"], TSNonNullExpression: ["expression"], TSExportAssignment: ["expression"], TSNamespaceExportDeclaration: ["id"], TSTypeAnnotation: ["typeAnnotation"], TSTypeParameterInstantiation: ["params"], TSTypeParameterDeclaration: ["params"], TSTypeParameter: ["constraint", "default", "name"], ChainExpression: ["expression"], ExperimentalRestProperty: ["argument"], ExperimentalSpreadProperty: ["argument"], Literal: [], MethodDefinition: ["decorators", "key", "value"], PrivateIdentifier: [], Property: ["key", "value"], PropertyDefinition: ["decorators", "key", "typeAnnotation", "value", "variance"], AccessorProperty: ["decorators", "key", "typeAnnotation", "value"], TSAbstractAccessorProperty: ["decorators", "key", "typeAnnotation"], TSAbstractKeyword: [], TSAbstractMethodDefinition: ["key", "value"], TSAbstractPropertyDefinition: ["decorators", "key", "typeAnnotation"], TSAsyncKeyword: [], TSClassImplements: ["expression", "typeArguments", "typeParameters"], TSDeclareKeyword: [], TSEmptyBodyFunctionExpression: ["id", "typeParameters", "params", "returnType"], TSExportKeyword: [], TSInterfaceHeritage: ["expression", "typeArguments", "typeParameters"], TSPrivateKeyword: [], TSProtectedKeyword: [], TSPublicKeyword: [], TSReadonlyKeyword: [], TSStaticKeyword: [], AsConstExpression: ["expression"], AsExpression: ["expression", "typeAnnotation"], BigIntLiteralTypeAnnotation: [], BigIntTypeAnnotation: [], ComponentDeclaration: ["id", "params", "body", "typeParameters", "rendersType"], ComponentParameter: ["name", "local"], ComponentTypeAnnotation: ["params", "rest", "typeParameters", "rendersType"], ComponentTypeParameter: ["name", "typeAnnotation"], ConditionalTypeAnnotation: ["checkType", "extendsType", "trueType", "falseType"], DeclareComponent: ["id", "params", "rest", "typeParameters", "rendersType"], DeclareEnum: ["id", "body"], DeclareHook: ["id"], DeclareNamespace: ["id", "body"], EnumBigIntBody: ["members"], EnumBigIntMember: ["id", "init"], HookDeclaration: ["id", "params", "body", "typeParameters", "returnType"], HookTypeAnnotation: ["params", "returnType", "rest", "typeParameters"], InferTypeAnnotation: ["typeParameter"], KeyofTypeAnnotation: ["argument"], ObjectTypeMappedTypeProperty: ["keyTparam", "propType", "sourceType", "variance"], QualifiedTypeofIdentifier: ["qualification", "id"], TupleTypeLabeledElement: ["label", "elementType", "variance"], TupleTypeSpreadElement: ["label", "typeAnnotation"], TypeOperator: ["typeAnnotation"], TypePredicate: ["parameterName", "typeAnnotation", "asserts"], NGRoot: ["node"], NGPipeExpression: ["left", "right", "arguments"], NGChainedExpression: ["expressions"], NGEmptyExpression: [], NGMicrosyntax: ["body"], NGMicrosyntaxKey: [], NGMicrosyntaxExpression: ["expression", "alias"], NGMicrosyntaxKeyedExpression: ["key", "expression"], NGMicrosyntaxLet: ["key", "value"], NGMicrosyntaxAs: ["key", "alias"], JsExpressionRoot: ["node"], JsonRoot: ["node"], TSJSDocAllType: [], TSJSDocUnknownType: [], TSJSDocNullableType: ["typeAnnotation"], TSJSDocNonNullableType: ["typeAnnotation"], NeverTypeAnnotation: [], UndefinedTypeAnnotation: [], UnknownTypeAnnotation: [], SatisfiesExpression: ["expression", "typeAnnotation"] }, Lo = Wr(jo), Ur = Lo;
|
|
208
|
-
function Mo(e) {
|
|
209
|
-
let t = new Set(e);
|
|
210
|
-
return (n) => t.has(n == null ? void 0 : n.type);
|
|
211
|
-
}
|
|
212
|
-
var J = Mo, Oo = J(["Block", "CommentBlock", "MultiLine"]), De = Oo, Jo = J(["AnyTypeAnnotation", "ThisTypeAnnotation", "NumberTypeAnnotation", "VoidTypeAnnotation", "BooleanTypeAnnotation", "BigIntTypeAnnotation", "SymbolTypeAnnotation", "StringTypeAnnotation", "NeverTypeAnnotation", "UndefinedTypeAnnotation", "UnknownTypeAnnotation", "EmptyTypeAnnotation", "MixedTypeAnnotation"]), Gr = Jo;
|
|
213
|
-
function qo(e, t) {
|
|
214
|
-
let n = t.split(".");
|
|
215
|
-
for (let r = n.length - 1; r >= 0; r--) {
|
|
216
|
-
let u = n[r];
|
|
217
|
-
if (r === 0)
|
|
218
|
-
return e.type === "Identifier" && e.name === u;
|
|
219
|
-
if (e.type !== "MemberExpression" || e.optional || e.computed || e.property.type !== "Identifier" || e.property.name !== u)
|
|
220
|
-
return !1;
|
|
221
|
-
e = e.object;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
function _o(e, t) {
|
|
225
|
-
return t.some((n) => qo(e, n));
|
|
226
|
-
}
|
|
227
|
-
var Xo = _o;
|
|
228
|
-
function Ro({ type: e }) {
|
|
229
|
-
return e.startsWith("TS") && e.endsWith("Keyword");
|
|
230
|
-
}
|
|
231
|
-
var Vr = Ro;
|
|
232
|
-
function hn(e, t) {
|
|
233
|
-
return t(e) || po(e, { getVisitorKeys: Ur, predicate: t });
|
|
234
|
-
}
|
|
235
|
-
function $n(e) {
|
|
236
|
-
return e.type === "AssignmentExpression" || e.type === "BinaryExpression" || e.type === "LogicalExpression" || e.type === "NGPipeExpression" || e.type === "ConditionalExpression" || L(e) || U(e) || e.type === "SequenceExpression" || e.type === "TaggedTemplateExpression" || e.type === "BindExpression" || e.type === "UpdateExpression" && !e.prefix || xe(e) || e.type === "TSNonNullExpression" || e.type === "ChainExpression";
|
|
237
|
-
}
|
|
238
|
-
function $o(e) {
|
|
239
|
-
return e.expressions ? e.expressions[0] : e.left ?? e.test ?? e.callee ?? e.object ?? e.tag ?? e.argument ?? e.expression;
|
|
240
|
-
}
|
|
241
|
-
function Kr(e) {
|
|
242
|
-
if (e.expressions)
|
|
243
|
-
return ["expressions", 0];
|
|
244
|
-
if (e.left)
|
|
245
|
-
return ["left"];
|
|
246
|
-
if (e.test)
|
|
247
|
-
return ["test"];
|
|
248
|
-
if (e.object)
|
|
249
|
-
return ["object"];
|
|
250
|
-
if (e.callee)
|
|
251
|
-
return ["callee"];
|
|
252
|
-
if (e.tag)
|
|
253
|
-
return ["tag"];
|
|
254
|
-
if (e.argument)
|
|
255
|
-
return ["argument"];
|
|
256
|
-
if (e.expression)
|
|
257
|
-
return ["expression"];
|
|
258
|
-
throw new Error("Unexpected node has no left side.");
|
|
259
|
-
}
|
|
260
|
-
var Et = J(["Line", "CommentLine", "SingleLine", "HashbangComment", "HTMLOpen", "HTMLClose", "Hashbang", "InterpreterDirective"]), Wo = J(["ExportDefaultDeclaration", "DeclareExportDeclaration", "ExportNamedDeclaration", "ExportAllDeclaration", "DeclareExportAllDeclaration"]), Q = J(["ArrayExpression", "TupleExpression"]), Fe = J(["ObjectExpression", "RecordExpression"]);
|
|
261
|
-
function Uo(e) {
|
|
262
|
-
return e.type === "LogicalExpression" && e.operator === "??";
|
|
263
|
-
}
|
|
264
|
-
function be(e) {
|
|
265
|
-
return e.type === "NumericLiteral" || e.type === "Literal" && typeof e.value == "number";
|
|
266
|
-
}
|
|
267
|
-
function Hr(e) {
|
|
268
|
-
return e.type === "UnaryExpression" && (e.operator === "+" || e.operator === "-") && be(e.argument);
|
|
269
|
-
}
|
|
270
|
-
function ue(e) {
|
|
271
|
-
return !!(e && (e.type === "StringLiteral" || e.type === "Literal" && typeof e.value == "string"));
|
|
272
|
-
}
|
|
273
|
-
function zr(e) {
|
|
274
|
-
return e.type === "RegExpLiteral" || e.type === "Literal" && !!e.regex;
|
|
275
|
-
}
|
|
276
|
-
var Wn = J(["Literal", "BooleanLiteral", "BigIntLiteral", "DirectiveLiteral", "NullLiteral", "NumericLiteral", "RegExpLiteral", "StringLiteral"]), Go = J(["Identifier", "ThisExpression", "Super", "PrivateName", "PrivateIdentifier"]), Je = J(["ObjectTypeAnnotation", "TSTypeLiteral", "TSMappedType"]), wt = J(["FunctionExpression", "ArrowFunctionExpression"]);
|
|
277
|
-
function Vo(e) {
|
|
278
|
-
return e.type === "FunctionExpression" || e.type === "ArrowFunctionExpression" && e.body.type === "BlockStatement";
|
|
279
|
-
}
|
|
280
|
-
function cn(e) {
|
|
281
|
-
return L(e) && e.callee.type === "Identifier" && ["async", "inject", "fakeAsync", "waitForAsync"].includes(e.callee.name);
|
|
282
|
-
}
|
|
283
|
-
var K = J(["JSXElement", "JSXFragment"]);
|
|
284
|
-
function nn(e) {
|
|
285
|
-
return e.method && e.kind === "init" || e.kind === "get" || e.kind === "set";
|
|
286
|
-
}
|
|
287
|
-
function Qr(e) {
|
|
288
|
-
return (e.type === "ObjectTypeProperty" || e.type === "ObjectTypeInternalSlot") && !e.static && !e.method && e.kind !== "get" && e.kind !== "set" && e.value.type === "FunctionTypeAnnotation";
|
|
289
|
-
}
|
|
290
|
-
function Ko(e) {
|
|
291
|
-
return (e.type === "TypeAnnotation" || e.type === "TSTypeAnnotation") && e.typeAnnotation.type === "FunctionTypeAnnotation" && !e.static && !tn(e, e.typeAnnotation);
|
|
292
|
-
}
|
|
293
|
-
var Be = J(["BinaryExpression", "LogicalExpression", "NGPipeExpression"]);
|
|
294
|
-
function st(e) {
|
|
295
|
-
return U(e) || e.type === "BindExpression" && !!e.object;
|
|
296
|
-
}
|
|
297
|
-
var Ho = J(["TSThisType", "NullLiteralTypeAnnotation", "BooleanLiteralTypeAnnotation", "StringLiteralTypeAnnotation", "BigIntLiteralTypeAnnotation", "NumberLiteralTypeAnnotation", "TSLiteralType", "TSTemplateLiteralType"]);
|
|
298
|
-
function Un(e) {
|
|
299
|
-
return Vr(e) || Gr(e) || Ho(e) || (e.type === "GenericTypeAnnotation" || e.type === "TSTypeReference") && !e.typeParameters && !e.typeArguments;
|
|
300
|
-
}
|
|
301
|
-
function zo(e) {
|
|
302
|
-
return e.type === "Identifier" && (e.name === "beforeEach" || e.name === "beforeAll" || e.name === "afterEach" || e.name === "afterAll");
|
|
303
|
-
}
|
|
304
|
-
var Qo = ["it", "it.only", "it.skip", "describe", "describe.only", "describe.skip", "test", "test.only", "test.skip", "test.step", "test.describe", "test.describe.only", "test.describe.parallel", "test.describe.parallel.only", "test.describe.serial", "test.describe.serial.only", "skip", "xit", "xdescribe", "xtest", "fit", "fdescribe", "ftest"];
|
|
305
|
-
function Yo(e) {
|
|
306
|
-
return Xo(e, Qo);
|
|
307
|
-
}
|
|
308
|
-
function rn(e, t) {
|
|
309
|
-
if ((e == null ? void 0 : e.type) !== "CallExpression" || e.optional)
|
|
310
|
-
return !1;
|
|
311
|
-
let n = ye(e);
|
|
312
|
-
if (n.length === 1) {
|
|
313
|
-
if (cn(e) && rn(t))
|
|
314
|
-
return wt(n[0]);
|
|
315
|
-
if (zo(e.callee))
|
|
316
|
-
return cn(n[0]);
|
|
317
|
-
} else if ((n.length === 2 || n.length === 3) && (n[0].type === "TemplateLiteral" || ue(n[0])) && Yo(e.callee))
|
|
318
|
-
return n[2] && !be(n[2]) ? !1 : (n.length === 2 ? wt(n[1]) : Vo(n[1]) && Z(n[1]).length <= 1) || cn(n[1]);
|
|
319
|
-
return !1;
|
|
320
|
-
}
|
|
321
|
-
var Yr = (e) => (t) => ((t == null ? void 0 : t.type) === "ChainExpression" && (t = t.expression), e(t)), L = Yr(J(["CallExpression", "OptionalCallExpression"])), U = Yr(J(["MemberExpression", "OptionalMemberExpression"]));
|
|
322
|
-
function dr(e, t = 5) {
|
|
323
|
-
return Zr(e, t) <= t;
|
|
324
|
-
}
|
|
325
|
-
function Zr(e, t) {
|
|
326
|
-
let n = 0;
|
|
327
|
-
for (let r in e) {
|
|
328
|
-
let u = e[r];
|
|
329
|
-
if (u && typeof u == "object" && typeof u.type == "string" && (n++, n += Zr(u, t - n)), n > t)
|
|
330
|
-
return n;
|
|
331
|
-
}
|
|
332
|
-
return n;
|
|
333
|
-
}
|
|
334
|
-
var Zo = 0.25;
|
|
335
|
-
function Gn(e, t) {
|
|
336
|
-
let { printWidth: n } = t;
|
|
337
|
-
if (h(e))
|
|
338
|
-
return !1;
|
|
339
|
-
let r = n * Zo;
|
|
340
|
-
if (e.type === "ThisExpression" || e.type === "Identifier" && e.name.length <= r || Hr(e) && !h(e.argument))
|
|
341
|
-
return !0;
|
|
342
|
-
let u = e.type === "Literal" && "regex" in e && e.regex.pattern || e.type === "RegExpLiteral" && e.pattern;
|
|
343
|
-
return u ? u.length <= r : ue(e) ? dt(pe(e), t).length <= r : e.type === "TemplateLiteral" ? e.expressions.length === 0 && e.quasis[0].value.raw.length <= r && !e.quasis[0].value.raw.includes(`
|
|
344
|
-
`) : e.type === "UnaryExpression" ? Gn(e.argument, { printWidth: n }) : e.type === "CallExpression" && e.arguments.length === 0 && e.callee.type === "Identifier" ? e.callee.name.length <= r - 2 : Wn(e);
|
|
345
|
-
}
|
|
346
|
-
function qe(e, t) {
|
|
347
|
-
return K(t) ? un(t) : h(t, T.Leading, (n) => se(e, j(n)));
|
|
348
|
-
}
|
|
349
|
-
function mr(e) {
|
|
350
|
-
return e.quasis.some((t) => t.value.raw.includes(`
|
|
351
|
-
`));
|
|
352
|
-
}
|
|
353
|
-
function eu(e, t) {
|
|
354
|
-
return (e.type === "TemplateLiteral" && mr(e) || e.type === "TaggedTemplateExpression" && mr(e.quasi)) && !se(t, W(e), { backwards: !0 });
|
|
355
|
-
}
|
|
356
|
-
function tu(e) {
|
|
357
|
-
if (!h(e))
|
|
358
|
-
return !1;
|
|
359
|
-
let t = _(!1, lt(e, T.Dangling), -1);
|
|
360
|
-
return t && !De(t);
|
|
361
|
-
}
|
|
362
|
-
function ei(e) {
|
|
363
|
-
if (e.length <= 1)
|
|
364
|
-
return !1;
|
|
365
|
-
let t = 0;
|
|
366
|
-
for (let n of e)
|
|
367
|
-
if (wt(n)) {
|
|
368
|
-
if (t += 1, t > 1)
|
|
369
|
-
return !0;
|
|
370
|
-
} else if (L(n)) {
|
|
371
|
-
for (let r of ye(n))
|
|
372
|
-
if (wt(r))
|
|
373
|
-
return !0;
|
|
374
|
-
}
|
|
375
|
-
return !1;
|
|
376
|
-
}
|
|
377
|
-
function nu(e) {
|
|
378
|
-
let { node: t, parent: n, key: r } = e;
|
|
379
|
-
return r === "callee" && L(t) && L(n) && n.arguments.length > 0 && t.arguments.length > n.arguments.length;
|
|
380
|
-
}
|
|
381
|
-
var ti = /* @__PURE__ */ new Set(["!", "-", "+", "~"]);
|
|
382
|
-
function fe(e, t = 2) {
|
|
383
|
-
if (t <= 0)
|
|
384
|
-
return !1;
|
|
385
|
-
if (e.type === "ChainExpression" || e.type === "TSNonNullExpression")
|
|
386
|
-
return fe(e.expression, t);
|
|
387
|
-
let n = (r) => fe(r, t - 1);
|
|
388
|
-
if (zr(e))
|
|
389
|
-
return ct(e.pattern ?? e.regex.pattern) <= 5;
|
|
390
|
-
if (Wn(e) || Go(e) || e.type === "ArgumentPlaceholder")
|
|
391
|
-
return !0;
|
|
392
|
-
if (e.type === "TemplateLiteral")
|
|
393
|
-
return e.quasis.every((r) => !r.value.raw.includes(`
|
|
394
|
-
`)) && e.expressions.every(n);
|
|
395
|
-
if (Fe(e))
|
|
396
|
-
return e.properties.every((r) => !r.computed && (r.shorthand || r.value && n(r.value)));
|
|
397
|
-
if (Q(e))
|
|
398
|
-
return e.elements.every((r) => r === null || n(r));
|
|
399
|
-
if (mt(e)) {
|
|
400
|
-
if (e.type === "ImportExpression" || fe(e.callee, t)) {
|
|
401
|
-
let r = ye(e);
|
|
402
|
-
return r.length <= t && r.every(n);
|
|
403
|
-
}
|
|
404
|
-
return !1;
|
|
405
|
-
}
|
|
406
|
-
return U(e) ? fe(e.object, t) && fe(e.property, t) : e.type === "UnaryExpression" && ti.has(e.operator) || e.type === "UpdateExpression" ? fe(e.argument, t) : !1;
|
|
407
|
-
}
|
|
408
|
-
function pe(e) {
|
|
409
|
-
var t;
|
|
410
|
-
return ((t = e.extra) == null ? void 0 : t.raw) ?? e.raw;
|
|
411
|
-
}
|
|
412
|
-
function ni(e) {
|
|
413
|
-
return e;
|
|
414
|
-
}
|
|
415
|
-
function Pe(e, t = "es5") {
|
|
416
|
-
return e.trailingComma === "es5" && t === "es5" || e.trailingComma === "all" && (t === "all" || t === "es5");
|
|
417
|
-
}
|
|
418
|
-
function ee(e, t) {
|
|
419
|
-
switch (e.type) {
|
|
420
|
-
case "BinaryExpression":
|
|
421
|
-
case "LogicalExpression":
|
|
422
|
-
case "AssignmentExpression":
|
|
423
|
-
case "NGPipeExpression":
|
|
424
|
-
return ee(e.left, t);
|
|
425
|
-
case "MemberExpression":
|
|
426
|
-
case "OptionalMemberExpression":
|
|
427
|
-
return ee(e.object, t);
|
|
428
|
-
case "TaggedTemplateExpression":
|
|
429
|
-
return e.tag.type === "FunctionExpression" ? !1 : ee(e.tag, t);
|
|
430
|
-
case "CallExpression":
|
|
431
|
-
case "OptionalCallExpression":
|
|
432
|
-
return e.callee.type === "FunctionExpression" ? !1 : ee(e.callee, t);
|
|
433
|
-
case "ConditionalExpression":
|
|
434
|
-
return ee(e.test, t);
|
|
435
|
-
case "UpdateExpression":
|
|
436
|
-
return !e.prefix && ee(e.argument, t);
|
|
437
|
-
case "BindExpression":
|
|
438
|
-
return e.object && ee(e.object, t);
|
|
439
|
-
case "SequenceExpression":
|
|
440
|
-
return ee(e.expressions[0], t);
|
|
441
|
-
case "ChainExpression":
|
|
442
|
-
case "TSSatisfiesExpression":
|
|
443
|
-
case "TSAsExpression":
|
|
444
|
-
case "TSNonNullExpression":
|
|
445
|
-
case "AsExpression":
|
|
446
|
-
case "AsConstExpression":
|
|
447
|
-
case "SatisfiesExpression":
|
|
448
|
-
return ee(e.expression, t);
|
|
449
|
-
default:
|
|
450
|
-
return t(e);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
var fr = { "==": !0, "!=": !0, "===": !0, "!==": !0 }, Rt = { "*": !0, "/": !0, "%": !0 }, Cn = { ">>": !0, ">>>": !0, "<<": !0 };
|
|
454
|
-
function Vn(e, t) {
|
|
455
|
-
return !(Ht(t) !== Ht(e) || e === "**" || fr[e] && fr[t] || t === "%" && Rt[e] || e === "%" && Rt[t] || t !== e && Rt[t] && Rt[e] || Cn[e] && Cn[t]);
|
|
456
|
-
}
|
|
457
|
-
var ri = new Map([["|>"], ["??"], ["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"], ["**"]].flatMap((e, t) => e.map((n) => [n, t])));
|
|
458
|
-
function Ht(e) {
|
|
459
|
-
return ri.get(e);
|
|
460
|
-
}
|
|
461
|
-
function ui(e) {
|
|
462
|
-
return !!Cn[e] || e === "|" || e === "^" || e === "&";
|
|
463
|
-
}
|
|
464
|
-
function ai(e) {
|
|
465
|
-
var t;
|
|
466
|
-
if (e.rest)
|
|
467
|
-
return !0;
|
|
468
|
-
let n = Z(e);
|
|
469
|
-
return ((t = _(!1, n, -1)) == null ? void 0 : t.type) === "RestElement";
|
|
470
|
-
}
|
|
471
|
-
var Dn = /* @__PURE__ */ new WeakMap();
|
|
472
|
-
function Z(e) {
|
|
473
|
-
if (Dn.has(e))
|
|
474
|
-
return Dn.get(e);
|
|
475
|
-
let t = [];
|
|
476
|
-
return e.this && t.push(e.this), Array.isArray(e.parameters) ? t.push(...e.parameters) : Array.isArray(e.params) && t.push(...e.params), e.rest && t.push(e.rest), Dn.set(e, t), t;
|
|
477
|
-
}
|
|
478
|
-
function oi(e, t) {
|
|
479
|
-
let { node: n } = e, r = 0, u = (a) => t(a, r++);
|
|
480
|
-
n.this && e.call(u, "this"), Array.isArray(n.parameters) ? e.each(u, "parameters") : Array.isArray(n.params) && e.each(u, "params"), n.rest && e.call(u, "rest");
|
|
481
|
-
}
|
|
482
|
-
var yn = /* @__PURE__ */ new WeakMap();
|
|
483
|
-
function ye(e) {
|
|
484
|
-
if (yn.has(e))
|
|
485
|
-
return yn.get(e);
|
|
486
|
-
if (e.type === "ChainExpression")
|
|
487
|
-
return ye(e.expression);
|
|
488
|
-
let t = e.arguments;
|
|
489
|
-
return e.type === "ImportExpression" && (t = [e.source], e.options && t.push(e.options)), yn.set(e, t), t;
|
|
490
|
-
}
|
|
491
|
-
function zt(e, t) {
|
|
492
|
-
let { node: n } = e;
|
|
493
|
-
if (n.type === "ChainExpression")
|
|
494
|
-
return e.call(() => zt(e, t), "expression");
|
|
495
|
-
n.type === "ImportExpression" ? (e.call((r) => t(r, 0), "source"), n.options && e.call((r) => t(r, 1), "options")) : e.each(t, "arguments");
|
|
496
|
-
}
|
|
497
|
-
function Er(e, t) {
|
|
498
|
-
let n = [];
|
|
499
|
-
if (e.type === "ChainExpression" && (e = e.expression, n.push("expression")), e.type === "ImportExpression") {
|
|
500
|
-
if (t === 0 || t === (e.options ? -2 : -1))
|
|
501
|
-
return [...n, "source"];
|
|
502
|
-
if (e.options && (t === 1 || t === -1))
|
|
503
|
-
return [...n, "options"];
|
|
504
|
-
throw new RangeError("Invalid argument index");
|
|
505
|
-
}
|
|
506
|
-
if (t < 0 && (t = e.arguments.length + t), t < 0 || t >= e.arguments.length)
|
|
507
|
-
throw new RangeError("Invalid argument index");
|
|
508
|
-
return [...n, "arguments", t];
|
|
509
|
-
}
|
|
510
|
-
function Qt(e) {
|
|
511
|
-
return e.value.trim() === "prettier-ignore" && !e.unignore;
|
|
512
|
-
}
|
|
513
|
-
function un(e) {
|
|
514
|
-
return (e == null ? void 0 : e.prettierIgnore) || h(e, T.PrettierIgnore);
|
|
515
|
-
}
|
|
516
|
-
var T = { Leading: 2, Trailing: 4, Dangling: 8, Block: 16, Line: 32, PrettierIgnore: 64, First: 128, Last: 256 }, ru = (e, t) => {
|
|
517
|
-
if (typeof e == "function" && (t = e, e = 0), e || t)
|
|
518
|
-
return (n, r, u) => !(e & T.Leading && !n.leading || e & T.Trailing && !n.trailing || e & T.Dangling && (n.leading || n.trailing) || e & T.Block && !De(n) || e & T.Line && !Et(n) || e & T.First && r !== 0 || e & T.Last && r !== u.length - 1 || e & T.PrettierIgnore && !Qt(n) || t && !t(n));
|
|
519
|
-
};
|
|
520
|
-
function h(e, t, n) {
|
|
521
|
-
if (!O(e == null ? void 0 : e.comments))
|
|
522
|
-
return !1;
|
|
523
|
-
let r = ru(t, n);
|
|
524
|
-
return r ? e.comments.some(r) : !0;
|
|
525
|
-
}
|
|
526
|
-
function lt(e, t, n) {
|
|
527
|
-
if (!Array.isArray(e == null ? void 0 : e.comments))
|
|
528
|
-
return [];
|
|
529
|
-
let r = ru(t, n);
|
|
530
|
-
return r ? e.comments.filter(r) : e.comments;
|
|
531
|
-
}
|
|
532
|
-
var we = (e, { originalText: t }) => Xn(t, j(e));
|
|
533
|
-
function mt(e) {
|
|
534
|
-
return L(e) || e.type === "NewExpression" || e.type === "ImportExpression";
|
|
535
|
-
}
|
|
536
|
-
function Ne(e) {
|
|
537
|
-
return e && (e.type === "ObjectProperty" || e.type === "Property" && !nn(e));
|
|
538
|
-
}
|
|
539
|
-
var xe = J(["TSAsExpression", "TSSatisfiesExpression", "AsExpression", "AsConstExpression", "SatisfiesExpression"]), _e = J(["TSUnionType", "UnionTypeAnnotation"]), Kn = J(["TSIntersectionType", "IntersectionTypeAnnotation"]), Xe = J(["TSConditionalType", "ConditionalTypeAnnotation"]), ii = /* @__PURE__ */ new Set(["range", "raw", "comments", "leadingComments", "trailingComments", "innerComments", "extra", "start", "end", "loc", "flags", "errors", "tokens"]), it = (e) => {
|
|
540
|
-
for (let t of e.quasis)
|
|
541
|
-
delete t.value;
|
|
542
|
-
};
|
|
543
|
-
function uu(e, t, n) {
|
|
544
|
-
var r, u;
|
|
545
|
-
if (e.type === "Program" && delete t.sourceType, (e.type === "BigIntLiteral" || e.type === "BigIntLiteralTypeAnnotation") && e.value && (t.value = e.value.toLowerCase()), (e.type === "BigIntLiteral" || e.type === "Literal") && e.bigint && (t.bigint = e.bigint.toLowerCase()), e.type === "EmptyStatement" || e.type === "JSXText" || e.type === "JSXExpressionContainer" && (e.expression.type === "Literal" || e.expression.type === "StringLiteral") && e.expression.value === " ")
|
|
546
|
-
return null;
|
|
547
|
-
if ((e.type === "Property" || e.type === "ObjectProperty" || e.type === "MethodDefinition" || e.type === "ClassProperty" || e.type === "ClassMethod" || e.type === "PropertyDefinition" || e.type === "TSDeclareMethod" || e.type === "TSPropertySignature" || e.type === "ObjectTypeProperty" || e.type === "ImportAttribute") && e.key && !e.computed) {
|
|
548
|
-
let { key: o } = e;
|
|
549
|
-
ue(o) || be(o) ? t.key = String(o.value) : o.type === "Identifier" && (t.key = o.name);
|
|
550
|
-
}
|
|
551
|
-
if (e.type === "JSXElement" && e.openingElement.name.name === "style" && e.openingElement.attributes.some((o) => o.type === "JSXAttribute" && o.name.name === "jsx"))
|
|
552
|
-
for (let { type: o, expression: i } of t.children)
|
|
553
|
-
o === "JSXExpressionContainer" && i.type === "TemplateLiteral" && it(i);
|
|
554
|
-
e.type === "JSXAttribute" && e.name.name === "css" && e.value.type === "JSXExpressionContainer" && e.value.expression.type === "TemplateLiteral" && it(t.value.expression), e.type === "JSXAttribute" && ((r = e.value) == null ? void 0 : r.type) === "Literal" && /["']|"|'/u.test(e.value.value) && (t.value.value = H(!1, e.value.value, /["']|"|'/gu, '"'));
|
|
555
|
-
let a = e.expression || e.callee;
|
|
556
|
-
if (e.type === "Decorator" && a.type === "CallExpression" && a.callee.name === "Component" && a.arguments.length === 1) {
|
|
557
|
-
let o = e.expression.arguments[0].properties;
|
|
558
|
-
for (let [i, s] of t.expression.arguments[0].properties.entries())
|
|
559
|
-
switch (o[i].key.name) {
|
|
560
|
-
case "styles":
|
|
561
|
-
Q(s.value) && it(s.value.elements[0]);
|
|
562
|
-
break;
|
|
563
|
-
case "template":
|
|
564
|
-
s.value.type === "TemplateLiteral" && it(s.value);
|
|
565
|
-
break;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
e.type === "TaggedTemplateExpression" && (e.tag.type === "MemberExpression" || e.tag.type === "Identifier" && (e.tag.name === "gql" || e.tag.name === "graphql" || e.tag.name === "css" || e.tag.name === "md" || e.tag.name === "markdown" || e.tag.name === "html") || e.tag.type === "CallExpression") && it(t.quasi), e.type === "TemplateLiteral" && ((u = e.leadingComments) != null && u.some((o) => De(o) && ["GraphQL", "HTML"].some((i) => o.value === ` ${i} `)) || n.type === "CallExpression" && n.callee.name === "graphql" || !e.leadingComments) && it(t), e.type === "ChainExpression" && e.expression.type === "TSNonNullExpression" && (t.type = "TSNonNullExpression", t.expression.type = "ChainExpression"), e.type === "TSMappedType" && (delete t.key, delete t.constraint), e.type === "TSEnumDeclaration" && delete t.body;
|
|
569
|
-
}
|
|
570
|
-
uu.ignoredProperties = ii;
|
|
571
|
-
var si = uu, Qe = "string", ve = "array", Ft = "cursor", Ye = "indent", Ze = "align", et = "trim", le = "group", $e = "fill", he = "if-break", tt = "indent-if-break", nt = "line-suffix", We = "line-suffix-boundary", oe = "line", Ie = "label", je = "break-parent", au = /* @__PURE__ */ new Set([Ft, Ye, Ze, et, le, $e, he, tt, nt, We, oe, Ie, je]);
|
|
572
|
-
function pi(e) {
|
|
573
|
-
if (typeof e == "string")
|
|
574
|
-
return Qe;
|
|
575
|
-
if (Array.isArray(e))
|
|
576
|
-
return ve;
|
|
577
|
-
if (!e)
|
|
578
|
-
return;
|
|
579
|
-
let { type: t } = e;
|
|
580
|
-
if (au.has(t))
|
|
581
|
-
return t;
|
|
582
|
-
}
|
|
583
|
-
var Ue = pi, li = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
|
|
584
|
-
function ci(e) {
|
|
585
|
-
let t = e === null ? "null" : typeof e;
|
|
586
|
-
if (t !== "string" && t !== "object")
|
|
587
|
-
return `Unexpected doc '${t}',
|
|
588
|
-
Expected it to be 'string' or 'object'.`;
|
|
589
|
-
if (Ue(e))
|
|
590
|
-
throw new Error("doc is valid.");
|
|
591
|
-
let n = Object.prototype.toString.call(e);
|
|
592
|
-
if (n !== "[object Object]")
|
|
593
|
-
return `Unexpected doc '${n}'.`;
|
|
594
|
-
let r = li([...au].map((u) => `'${u}'`));
|
|
595
|
-
return `Unexpected doc.type '${e.type}'.
|
|
596
|
-
Expected it to be ${r}.`;
|
|
597
|
-
}
|
|
598
|
-
var Di = class extends Error {
|
|
599
|
-
constructor(t) {
|
|
600
|
-
super(ci(t));
|
|
601
|
-
_t(this, "name", "InvalidDocError");
|
|
602
|
-
this.doc = t;
|
|
603
|
-
}
|
|
604
|
-
}, Nt = Di, Fr = {};
|
|
605
|
-
function yi(e, t, n, r) {
|
|
606
|
-
let u = [e];
|
|
607
|
-
for (; u.length > 0; ) {
|
|
608
|
-
let a = u.pop();
|
|
609
|
-
if (a === Fr) {
|
|
610
|
-
n(u.pop());
|
|
611
|
-
continue;
|
|
612
|
-
}
|
|
613
|
-
n && u.push(a, Fr);
|
|
614
|
-
let o = Ue(a);
|
|
615
|
-
if (!o)
|
|
616
|
-
throw new Nt(a);
|
|
617
|
-
if ((t == null ? void 0 : t(a)) !== !1)
|
|
618
|
-
switch (o) {
|
|
619
|
-
case ve:
|
|
620
|
-
case $e: {
|
|
621
|
-
let i = o === ve ? a : a.parts;
|
|
622
|
-
for (let s = i.length, l = s - 1; l >= 0; --l)
|
|
623
|
-
u.push(i[l]);
|
|
624
|
-
break;
|
|
625
|
-
}
|
|
626
|
-
case he:
|
|
627
|
-
u.push(a.flatContents, a.breakContents);
|
|
628
|
-
break;
|
|
629
|
-
case le:
|
|
630
|
-
if (r && a.expandedStates)
|
|
631
|
-
for (let i = a.expandedStates.length, s = i - 1; s >= 0; --s)
|
|
632
|
-
u.push(a.expandedStates[s]);
|
|
633
|
-
else
|
|
634
|
-
u.push(a.contents);
|
|
635
|
-
break;
|
|
636
|
-
case Ze:
|
|
637
|
-
case Ye:
|
|
638
|
-
case tt:
|
|
639
|
-
case Ie:
|
|
640
|
-
case nt:
|
|
641
|
-
u.push(a.contents);
|
|
642
|
-
break;
|
|
643
|
-
case Qe:
|
|
644
|
-
case Ft:
|
|
645
|
-
case et:
|
|
646
|
-
case We:
|
|
647
|
-
case oe:
|
|
648
|
-
case je:
|
|
649
|
-
break;
|
|
650
|
-
default:
|
|
651
|
-
throw new Nt(a);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
var Hn = yi;
|
|
656
|
-
function At(e, t) {
|
|
657
|
-
if (typeof e == "string")
|
|
658
|
-
return t(e);
|
|
659
|
-
let n = /* @__PURE__ */ new Map();
|
|
660
|
-
return r(e);
|
|
661
|
-
function r(a) {
|
|
662
|
-
if (n.has(a))
|
|
663
|
-
return n.get(a);
|
|
664
|
-
let o = u(a);
|
|
665
|
-
return n.set(a, o), o;
|
|
666
|
-
}
|
|
667
|
-
function u(a) {
|
|
668
|
-
switch (Ue(a)) {
|
|
669
|
-
case ve:
|
|
670
|
-
return t(a.map(r));
|
|
671
|
-
case $e:
|
|
672
|
-
return t({ ...a, parts: a.parts.map(r) });
|
|
673
|
-
case he:
|
|
674
|
-
return t({ ...a, breakContents: r(a.breakContents), flatContents: r(a.flatContents) });
|
|
675
|
-
case le: {
|
|
676
|
-
let { expandedStates: o, contents: i } = a;
|
|
677
|
-
return o ? (o = o.map(r), i = o[0]) : i = r(i), t({ ...a, contents: i, expandedStates: o });
|
|
678
|
-
}
|
|
679
|
-
case Ze:
|
|
680
|
-
case Ye:
|
|
681
|
-
case tt:
|
|
682
|
-
case Ie:
|
|
683
|
-
case nt:
|
|
684
|
-
return t({ ...a, contents: r(a.contents) });
|
|
685
|
-
case Qe:
|
|
686
|
-
case Ft:
|
|
687
|
-
case et:
|
|
688
|
-
case We:
|
|
689
|
-
case oe:
|
|
690
|
-
case je:
|
|
691
|
-
return t(a);
|
|
692
|
-
default:
|
|
693
|
-
throw new Nt(a);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
function ou(e, t, n) {
|
|
698
|
-
let r = n, u = !1;
|
|
699
|
-
function a(o) {
|
|
700
|
-
if (u)
|
|
701
|
-
return !1;
|
|
702
|
-
let i = t(o);
|
|
703
|
-
i !== void 0 && (u = !0, r = i);
|
|
704
|
-
}
|
|
705
|
-
return Hn(e, a), r;
|
|
706
|
-
}
|
|
707
|
-
function di(e) {
|
|
708
|
-
if (e.type === le && e.break || e.type === oe && e.hard || e.type === je)
|
|
709
|
-
return !0;
|
|
710
|
-
}
|
|
711
|
-
function te(e) {
|
|
712
|
-
return ou(e, di, !1);
|
|
713
|
-
}
|
|
714
|
-
function Ar(e) {
|
|
715
|
-
if (e.length > 0) {
|
|
716
|
-
let t = _(!1, e, -1);
|
|
717
|
-
!t.expandedStates && !t.break && (t.break = "propagated");
|
|
718
|
-
}
|
|
719
|
-
return null;
|
|
720
|
-
}
|
|
721
|
-
function mi(e) {
|
|
722
|
-
let t = /* @__PURE__ */ new Set(), n = [];
|
|
723
|
-
function r(a) {
|
|
724
|
-
if (a.type === je && Ar(n), a.type === le) {
|
|
725
|
-
if (n.push(a), t.has(a))
|
|
726
|
-
return !1;
|
|
727
|
-
t.add(a);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
function u(a) {
|
|
731
|
-
a.type === le && n.pop().break && Ar(n);
|
|
732
|
-
}
|
|
733
|
-
Hn(e, r, u, !0);
|
|
734
|
-
}
|
|
735
|
-
function fi(e) {
|
|
736
|
-
return e.type === oe && !e.hard ? e.soft ? "" : " " : e.type === he ? e.flatContents : e;
|
|
737
|
-
}
|
|
738
|
-
function Tn(e) {
|
|
739
|
-
return At(e, fi);
|
|
740
|
-
}
|
|
741
|
-
function Ei(e) {
|
|
742
|
-
switch (Ue(e)) {
|
|
743
|
-
case $e:
|
|
744
|
-
if (e.parts.every((t) => t === ""))
|
|
745
|
-
return "";
|
|
746
|
-
break;
|
|
747
|
-
case le:
|
|
748
|
-
if (!e.contents && !e.id && !e.break && !e.expandedStates)
|
|
749
|
-
return "";
|
|
750
|
-
if (e.contents.type === le && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates)
|
|
751
|
-
return e.contents;
|
|
752
|
-
break;
|
|
753
|
-
case Ze:
|
|
754
|
-
case Ye:
|
|
755
|
-
case tt:
|
|
756
|
-
case nt:
|
|
757
|
-
if (!e.contents)
|
|
758
|
-
return "";
|
|
759
|
-
break;
|
|
760
|
-
case he:
|
|
761
|
-
if (!e.flatContents && !e.breakContents)
|
|
762
|
-
return "";
|
|
763
|
-
break;
|
|
764
|
-
case ve: {
|
|
765
|
-
let t = [];
|
|
766
|
-
for (let n of e) {
|
|
767
|
-
if (!n)
|
|
768
|
-
continue;
|
|
769
|
-
let [r, ...u] = Array.isArray(n) ? n : [n];
|
|
770
|
-
typeof r == "string" && typeof _(!1, t, -1) == "string" ? t[t.length - 1] += r : t.push(r), t.push(...u);
|
|
771
|
-
}
|
|
772
|
-
return t.length === 0 ? "" : t.length === 1 ? t[0] : t;
|
|
773
|
-
}
|
|
774
|
-
case Qe:
|
|
775
|
-
case Ft:
|
|
776
|
-
case et:
|
|
777
|
-
case We:
|
|
778
|
-
case oe:
|
|
779
|
-
case Ie:
|
|
780
|
-
case je:
|
|
781
|
-
break;
|
|
782
|
-
default:
|
|
783
|
-
throw new Nt(e);
|
|
784
|
-
}
|
|
785
|
-
return e;
|
|
786
|
-
}
|
|
787
|
-
function zn(e) {
|
|
788
|
-
return At(e, (t) => Ei(t));
|
|
789
|
-
}
|
|
790
|
-
function He(e, t = lu) {
|
|
791
|
-
return At(e, (n) => typeof n == "string" ? I(t, n.split(`
|
|
792
|
-
`)) : n);
|
|
793
|
-
}
|
|
794
|
-
function Fi(e) {
|
|
795
|
-
if (e.type === oe)
|
|
796
|
-
return !0;
|
|
797
|
-
}
|
|
798
|
-
function Ai(e) {
|
|
799
|
-
return ou(e, Fi, !1);
|
|
800
|
-
}
|
|
801
|
-
function Sn(e, t) {
|
|
802
|
-
return e.type === Ie ? { ...e, contents: t(e.contents) } : t(e);
|
|
803
|
-
}
|
|
804
|
-
function gi(e) {
|
|
805
|
-
let t = !0;
|
|
806
|
-
return Hn(e, (n) => {
|
|
807
|
-
switch (Ue(n)) {
|
|
808
|
-
case Qe:
|
|
809
|
-
if (n === "")
|
|
810
|
-
break;
|
|
811
|
-
case et:
|
|
812
|
-
case We:
|
|
813
|
-
case oe:
|
|
814
|
-
case je:
|
|
815
|
-
return t = !1, !1;
|
|
816
|
-
}
|
|
817
|
-
}), t;
|
|
818
|
-
}
|
|
819
|
-
var xi = () => {
|
|
820
|
-
}, hi = xi;
|
|
821
|
-
function A(e) {
|
|
822
|
-
return { type: Ye, contents: e };
|
|
823
|
-
}
|
|
824
|
-
function Ce(e, t) {
|
|
825
|
-
return { type: Ze, contents: t, n: e };
|
|
826
|
-
}
|
|
827
|
-
function m(e, t = {}) {
|
|
828
|
-
return hi(t.expandedStates), { type: le, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
|
|
829
|
-
}
|
|
830
|
-
function Ci(e) {
|
|
831
|
-
return Ce(Number.NEGATIVE_INFINITY, e);
|
|
832
|
-
}
|
|
833
|
-
function iu(e) {
|
|
834
|
-
return Ce(-1, e);
|
|
835
|
-
}
|
|
836
|
-
function Ke(e, t) {
|
|
837
|
-
return m(e[0], { ...t, expandedStates: e });
|
|
838
|
-
}
|
|
839
|
-
function su(e) {
|
|
840
|
-
return { type: $e, parts: e };
|
|
841
|
-
}
|
|
842
|
-
function w(e, t = "", n = {}) {
|
|
843
|
-
return { type: he, breakContents: e, flatContents: t, groupId: n.groupId };
|
|
844
|
-
}
|
|
845
|
-
function an(e, t) {
|
|
846
|
-
return { type: tt, contents: e, groupId: t.groupId, negate: t.negate };
|
|
847
|
-
}
|
|
848
|
-
function gr(e) {
|
|
849
|
-
return { type: nt, contents: e };
|
|
850
|
-
}
|
|
851
|
-
var ke = { type: We }, Te = { type: je }, pu = { type: oe, hard: !0 }, Ti = { type: oe, hard: !0, literal: !0 }, C = { type: oe }, f = { type: oe, soft: !0 }, F = [pu, Te], lu = [Ti, Te], $t = { type: Ft };
|
|
852
|
-
function I(e, t) {
|
|
853
|
-
let n = [];
|
|
854
|
-
for (let r = 0; r < t.length; r++)
|
|
855
|
-
r !== 0 && n.push(e), n.push(t[r]);
|
|
856
|
-
return n;
|
|
857
|
-
}
|
|
858
|
-
function Si(e, t, n) {
|
|
859
|
-
let r = e;
|
|
860
|
-
if (t > 0) {
|
|
861
|
-
for (let u = 0; u < Math.floor(t / n); ++u)
|
|
862
|
-
r = A(r);
|
|
863
|
-
r = Ce(t % n, r), r = Ce(Number.NEGATIVE_INFINITY, r);
|
|
864
|
-
}
|
|
865
|
-
return r;
|
|
866
|
-
}
|
|
867
|
-
function Lt(e, t) {
|
|
868
|
-
return e ? { type: Ie, label: e, contents: t } : t;
|
|
869
|
-
}
|
|
870
|
-
function bi(e) {
|
|
871
|
-
let t = `*${e.value}*`.split(`
|
|
872
|
-
`);
|
|
873
|
-
return t.length > 1 && t.every((n) => n.trimStart()[0] === "*");
|
|
874
|
-
}
|
|
875
|
-
var Bi = bi;
|
|
876
|
-
function vi(e, t) {
|
|
877
|
-
let n = e.node;
|
|
878
|
-
if (Et(n))
|
|
879
|
-
return t.originalText.slice(W(n), j(n)).trimEnd();
|
|
880
|
-
if (De(n))
|
|
881
|
-
return Bi(n) ? ki(n) : ["/*", He(n.value), "*/"];
|
|
882
|
-
throw new Error("Not a comment: " + JSON.stringify(n));
|
|
883
|
-
}
|
|
884
|
-
function ki(e) {
|
|
885
|
-
let t = e.value.split(`
|
|
886
|
-
`);
|
|
887
|
-
return ["/*", I(F, t.map((n, r) => r === 0 ? n.trimEnd() : " " + (r < t.length - 1 ? n.trim() : n.trimStart()))), "*/"];
|
|
888
|
-
}
|
|
889
|
-
var cu = {};
|
|
890
|
-
en(cu, { endOfLine: () => Mi, ownLine: () => Li, remaining: () => Oi });
|
|
891
|
-
function Pi(e) {
|
|
892
|
-
let t = e.type || e.kind || "(unknown type)", n = String(e.name || e.id && (typeof e.id == "object" ? e.id.name : e.id) || e.key && (typeof e.key == "object" ? e.key.name : e.key) || e.value && (typeof e.value == "object" ? "" : String(e.value)) || e.operator || "");
|
|
893
|
-
return n.length > 20 && (n = n.slice(0, 19) + "…"), t + (n ? " " + n : "");
|
|
894
|
-
}
|
|
895
|
-
function Qn(e, t) {
|
|
896
|
-
(e.comments ?? (e.comments = [])).push(t), t.printed = !1, t.nodeDescription = Pi(e);
|
|
897
|
-
}
|
|
898
|
-
function Y(e, t) {
|
|
899
|
-
t.leading = !0, t.trailing = !1, Qn(e, t);
|
|
900
|
-
}
|
|
901
|
-
function ce(e, t, n) {
|
|
902
|
-
t.leading = !1, t.trailing = !1, n && (t.marker = n), Qn(e, t);
|
|
903
|
-
}
|
|
904
|
-
function $(e, t) {
|
|
905
|
-
t.leading = !1, t.trailing = !0, Qn(e, t);
|
|
906
|
-
}
|
|
907
|
-
function wi(e, t) {
|
|
908
|
-
let n = null, r = t;
|
|
909
|
-
for (; r !== n; )
|
|
910
|
-
n = r, r = Dt(e, r), r = qn(e, r), r = _n(e, r), r = yt(e, r);
|
|
911
|
-
return r;
|
|
912
|
-
}
|
|
913
|
-
var gt = wi;
|
|
914
|
-
function Ni(e, t) {
|
|
915
|
-
let n = gt(e, t);
|
|
916
|
-
return n === !1 ? "" : e.charAt(n);
|
|
917
|
-
}
|
|
918
|
-
var Ae = Ni;
|
|
919
|
-
function Ii(e, t, n) {
|
|
920
|
-
for (let r = t; r < n; ++r)
|
|
921
|
-
if (e.charAt(r) === `
|
|
922
|
-
`)
|
|
923
|
-
return !0;
|
|
924
|
-
return !1;
|
|
925
|
-
}
|
|
926
|
-
var Re = Ii;
|
|
927
|
-
function ji(e) {
|
|
928
|
-
return De(e) && e.value[0] === "*" && /@(?:type|satisfies)\b/u.test(e.value);
|
|
929
|
-
}
|
|
930
|
-
var Du = ji;
|
|
931
|
-
function Li(e) {
|
|
932
|
-
return [gu, du, Eu, Ki, qi, Yn, Zn, yu, mu, Yi, zi, tr, Au, Zi, fu, Fu, er, _i, is].some((t) => t(e));
|
|
933
|
-
}
|
|
934
|
-
function Mi(e) {
|
|
935
|
-
return [Ji, Eu, du, Au, Yn, Zn, yu, mu, Fu, Hi, Qi, tr, ns, er, as, os, ss].some((t) => t(e));
|
|
936
|
-
}
|
|
937
|
-
function Oi(e) {
|
|
938
|
-
return [gu, Yn, Zn, Xi, Vi, fu, tr, Gi, Ui, us, er, rs].some((t) => t(e));
|
|
939
|
-
}
|
|
940
|
-
function rt(e, t) {
|
|
941
|
-
let n = (e.body || e.properties).find(({ type: r }) => r !== "EmptyStatement");
|
|
942
|
-
n ? Y(n, t) : ce(e, t);
|
|
943
|
-
}
|
|
944
|
-
function bn(e, t) {
|
|
945
|
-
e.type === "BlockStatement" ? rt(e, t) : Y(e, t);
|
|
946
|
-
}
|
|
947
|
-
function Ji({ comment: e, followingNode: t }) {
|
|
948
|
-
return t && Du(e) ? (Y(t, e), !0) : !1;
|
|
949
|
-
}
|
|
950
|
-
function Yn({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
951
|
-
if ((n == null ? void 0 : n.type) !== "IfStatement" || !r)
|
|
952
|
-
return !1;
|
|
953
|
-
if (Ae(u, j(e)) === ")")
|
|
954
|
-
return $(t, e), !0;
|
|
955
|
-
if (t === n.consequent && r === n.alternate) {
|
|
956
|
-
let a = gt(u, j(n.consequent));
|
|
957
|
-
if (W(e) < a || n.alternate.type === "BlockStatement") {
|
|
958
|
-
if (t.type === "BlockStatement")
|
|
959
|
-
$(t, e);
|
|
960
|
-
else {
|
|
961
|
-
let o = Et(e) || e.loc.start.line === e.loc.end.line, i = e.loc.start.line === t.loc.start.line;
|
|
962
|
-
o && i ? $(t, e) : ce(n, e);
|
|
963
|
-
}
|
|
964
|
-
return !0;
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
return r.type === "BlockStatement" ? (rt(r, e), !0) : r.type === "IfStatement" ? (bn(r.consequent, e), !0) : n.consequent === r ? (Y(r, e), !0) : !1;
|
|
968
|
-
}
|
|
969
|
-
function Zn({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
970
|
-
return (n == null ? void 0 : n.type) !== "WhileStatement" || !r ? !1 : Ae(u, j(e)) === ")" ? ($(t, e), !0) : r.type === "BlockStatement" ? (rt(r, e), !0) : n.body === r ? (Y(r, e), !0) : !1;
|
|
971
|
-
}
|
|
972
|
-
function yu({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
973
|
-
return (n == null ? void 0 : n.type) !== "TryStatement" && (n == null ? void 0 : n.type) !== "CatchClause" || !r ? !1 : n.type === "CatchClause" && t ? ($(t, e), !0) : r.type === "BlockStatement" ? (rt(r, e), !0) : r.type === "TryStatement" ? (bn(r.finalizer, e), !0) : r.type === "CatchClause" ? (bn(r.body, e), !0) : !1;
|
|
974
|
-
}
|
|
975
|
-
function qi({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
976
|
-
return U(t) && (n == null ? void 0 : n.type) === "Identifier" ? (Y(t, e), !0) : !1;
|
|
977
|
-
}
|
|
978
|
-
function _i({ comment: e, enclosingNode: t, followingNode: n, options: r }) {
|
|
979
|
-
return !r.experimentalTernaries || !((t == null ? void 0 : t.type) === "ConditionalExpression" || Xe(t)) ? !1 : (n == null ? void 0 : n.type) === "ConditionalExpression" || Xe(n) ? (ce(t, e), !0) : !1;
|
|
980
|
-
}
|
|
981
|
-
function du({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u, options: a }) {
|
|
982
|
-
let o = t && !Re(u, j(t), W(e));
|
|
983
|
-
return (!t || !o) && ((n == null ? void 0 : n.type) === "ConditionalExpression" || Xe(n)) && r ? a.experimentalTernaries && n.alternate === r && !(De(e) && !Re(a.originalText, W(e), j(e))) ? (ce(n, e), !0) : (Y(r, e), !0) : !1;
|
|
984
|
-
}
|
|
985
|
-
function Xi({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
986
|
-
return Ne(n) && n.shorthand && n.key === t && n.value.type === "AssignmentPattern" ? ($(n.value.left, e), !0) : !1;
|
|
987
|
-
}
|
|
988
|
-
var Ri = /* @__PURE__ */ new Set(["ClassDeclaration", "ClassExpression", "DeclareClass", "DeclareInterface", "InterfaceDeclaration", "TSInterfaceDeclaration"]);
|
|
989
|
-
function mu({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
990
|
-
if (Ri.has(n == null ? void 0 : n.type)) {
|
|
991
|
-
if (O(n.decorators) && (r == null ? void 0 : r.type) !== "Decorator")
|
|
992
|
-
return $(_(!1, n.decorators, -1), e), !0;
|
|
993
|
-
if (n.body && r === n.body)
|
|
994
|
-
return rt(n.body, e), !0;
|
|
995
|
-
if (r) {
|
|
996
|
-
if (n.superClass && r === n.superClass && t && (t === n.id || t === n.typeParameters))
|
|
997
|
-
return $(t, e), !0;
|
|
998
|
-
for (let u of ["implements", "extends", "mixins"])
|
|
999
|
-
if (n[u] && r === n[u][0])
|
|
1000
|
-
return t && (t === n.id || t === n.typeParameters || t === n.superClass) ? $(t, e) : ce(n, e, u), !0;
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
return !1;
|
|
1004
|
-
}
|
|
1005
|
-
var $i = /* @__PURE__ */ new Set(["ClassMethod", "ClassProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod", "MethodDefinition", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "TSParameterProperty"]);
|
|
1006
|
-
function fu({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
1007
|
-
return n && t && Ae(r, j(e)) === "(" && (n.type === "Property" || n.type === "TSDeclareMethod" || n.type === "TSAbstractMethodDefinition") && t.type === "Identifier" && n.key === t && Ae(r, j(t)) !== ":" || (t == null ? void 0 : t.type) === "Decorator" && $i.has(n == null ? void 0 : n.type) && (Et(e) || e.placement === "ownLine") ? ($(t, e), !0) : !1;
|
|
1008
|
-
}
|
|
1009
|
-
var Wi = /* @__PURE__ */ new Set(["FunctionDeclaration", "FunctionExpression", "ClassMethod", "MethodDefinition", "ObjectMethod"]);
|
|
1010
|
-
function Ui({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
1011
|
-
return Ae(r, j(e)) !== "(" ? !1 : t && Wi.has(n == null ? void 0 : n.type) ? ($(t, e), !0) : !1;
|
|
1012
|
-
}
|
|
1013
|
-
function Gi({ comment: e, enclosingNode: t, text: n }) {
|
|
1014
|
-
if ((t == null ? void 0 : t.type) !== "ArrowFunctionExpression")
|
|
1015
|
-
return !1;
|
|
1016
|
-
let r = gt(n, j(e));
|
|
1017
|
-
return r !== !1 && n.slice(r, r + 2) === "=>" ? (ce(t, e), !0) : !1;
|
|
1018
|
-
}
|
|
1019
|
-
function Vi({ comment: e, enclosingNode: t, text: n }) {
|
|
1020
|
-
return Ae(n, j(e)) !== ")" ? !1 : t && (xu(t) && Z(t).length === 0 || mt(t) && ye(t).length === 0) ? (ce(t, e), !0) : ((t == null ? void 0 : t.type) === "MethodDefinition" || (t == null ? void 0 : t.type) === "TSAbstractMethodDefinition") && Z(t.value).length === 0 ? (ce(t.value, e), !0) : !1;
|
|
1021
|
-
}
|
|
1022
|
-
function Ki({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
1023
|
-
return (t == null ? void 0 : t.type) === "ComponentTypeParameter" && ((n == null ? void 0 : n.type) === "DeclareComponent" || (n == null ? void 0 : n.type) === "ComponentTypeAnnotation") && (r == null ? void 0 : r.type) !== "ComponentTypeParameter" || ((t == null ? void 0 : t.type) === "ComponentParameter" || (t == null ? void 0 : t.type) === "RestElement") && (n == null ? void 0 : n.type) === "ComponentDeclaration" && Ae(u, j(e)) === ")" ? ($(t, e), !0) : !1;
|
|
1024
|
-
}
|
|
1025
|
-
function Eu({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
1026
|
-
return (t == null ? void 0 : t.type) === "FunctionTypeParam" && (n == null ? void 0 : n.type) === "FunctionTypeAnnotation" && (r == null ? void 0 : r.type) !== "FunctionTypeParam" || ((t == null ? void 0 : t.type) === "Identifier" || (t == null ? void 0 : t.type) === "AssignmentPattern" || (t == null ? void 0 : t.type) === "ObjectPattern" || (t == null ? void 0 : t.type) === "ArrayPattern" || (t == null ? void 0 : t.type) === "RestElement" || (t == null ? void 0 : t.type) === "TSParameterProperty") && xu(n) && Ae(u, j(e)) === ")" ? ($(t, e), !0) : !De(e) && ((n == null ? void 0 : n.type) === "FunctionDeclaration" || (n == null ? void 0 : n.type) === "FunctionExpression" || (n == null ? void 0 : n.type) === "ObjectMethod") && (r == null ? void 0 : r.type) === "BlockStatement" && n.body === r && gt(u, j(e)) === W(r) ? (rt(r, e), !0) : !1;
|
|
1027
|
-
}
|
|
1028
|
-
function Fu({ comment: e, enclosingNode: t }) {
|
|
1029
|
-
return (t == null ? void 0 : t.type) === "LabeledStatement" ? (Y(t, e), !0) : !1;
|
|
1030
|
-
}
|
|
1031
|
-
function er({ comment: e, enclosingNode: t }) {
|
|
1032
|
-
return ((t == null ? void 0 : t.type) === "ContinueStatement" || (t == null ? void 0 : t.type) === "BreakStatement") && !t.label ? ($(t, e), !0) : !1;
|
|
1033
|
-
}
|
|
1034
|
-
function Hi({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
1035
|
-
return L(n) && t && n.callee === t && n.arguments.length > 0 ? (Y(n.arguments[0], e), !0) : !1;
|
|
1036
|
-
}
|
|
1037
|
-
function zi({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
1038
|
-
return _e(n) ? (Qt(e) && (r.prettierIgnore = !0, e.unignore = !0), t ? ($(t, e), !0) : !1) : (_e(r) && Qt(e) && (r.types[0].prettierIgnore = !0, e.unignore = !0), !1);
|
|
1039
|
-
}
|
|
1040
|
-
function Qi({ comment: e, enclosingNode: t }) {
|
|
1041
|
-
return Ne(t) ? (Y(t, e), !0) : !1;
|
|
1042
|
-
}
|
|
1043
|
-
function tr({ comment: e, enclosingNode: t, ast: n, isLastComment: r }) {
|
|
1044
|
-
var u;
|
|
1045
|
-
return ((u = n == null ? void 0 : n.body) == null ? void 0 : u.length) === 0 ? (r ? ce(n, e) : Y(n, e), !0) : (t == null ? void 0 : t.type) === "Program" && t.body.length === 0 && !O(t.directives) ? (r ? ce(t, e) : Y(t, e), !0) : !1;
|
|
1046
|
-
}
|
|
1047
|
-
function Yi({ comment: e, enclosingNode: t }) {
|
|
1048
|
-
return (t == null ? void 0 : t.type) === "ForInStatement" || (t == null ? void 0 : t.type) === "ForOfStatement" ? (Y(t, e), !0) : !1;
|
|
1049
|
-
}
|
|
1050
|
-
function Au({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
1051
|
-
if ((n == null ? void 0 : n.type) === "ImportSpecifier" || (n == null ? void 0 : n.type) === "ExportSpecifier")
|
|
1052
|
-
return Y(n, e), !0;
|
|
1053
|
-
let u = (t == null ? void 0 : t.type) === "ImportSpecifier" && (n == null ? void 0 : n.type) === "ImportDeclaration", a = (t == null ? void 0 : t.type) === "ExportSpecifier" && (n == null ? void 0 : n.type) === "ExportNamedDeclaration";
|
|
1054
|
-
return (u || a) && se(r, j(e)) ? ($(t, e), !0) : !1;
|
|
1055
|
-
}
|
|
1056
|
-
function Zi({ comment: e, enclosingNode: t }) {
|
|
1057
|
-
return (t == null ? void 0 : t.type) === "AssignmentPattern" ? (Y(t, e), !0) : !1;
|
|
1058
|
-
}
|
|
1059
|
-
var es = /* @__PURE__ */ new Set(["VariableDeclarator", "AssignmentExpression", "TypeAlias", "TSTypeAliasDeclaration"]), ts = /* @__PURE__ */ new Set(["ObjectExpression", "RecordExpression", "ArrayExpression", "TupleExpression", "TemplateLiteral", "TaggedTemplateExpression", "ObjectTypeAnnotation", "TSTypeLiteral"]);
|
|
1060
|
-
function ns({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
1061
|
-
return es.has(t == null ? void 0 : t.type) && n && (ts.has(n.type) || De(e)) ? (Y(n, e), !0) : !1;
|
|
1062
|
-
}
|
|
1063
|
-
function rs({ comment: e, enclosingNode: t, followingNode: n, text: r }) {
|
|
1064
|
-
return !n && ((t == null ? void 0 : t.type) === "TSMethodSignature" || (t == null ? void 0 : t.type) === "TSDeclareFunction" || (t == null ? void 0 : t.type) === "TSAbstractMethodDefinition") && Ae(r, j(e)) === ";" ? ($(t, e), !0) : !1;
|
|
1065
|
-
}
|
|
1066
|
-
function gu({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
1067
|
-
if (Qt(e) && (t == null ? void 0 : t.type) === "TSMappedType" && (n == null ? void 0 : n.type) === "TSTypeParameter" && n.constraint)
|
|
1068
|
-
return t.prettierIgnore = !0, e.unignore = !0, !0;
|
|
1069
|
-
}
|
|
1070
|
-
function us({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
1071
|
-
return (n == null ? void 0 : n.type) !== "TSMappedType" ? !1 : (r == null ? void 0 : r.type) === "TSTypeParameter" && r.name ? (Y(r.name, e), !0) : (t == null ? void 0 : t.type) === "TSTypeParameter" && t.constraint ? ($(t.constraint, e), !0) : !1;
|
|
1072
|
-
}
|
|
1073
|
-
function as({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
1074
|
-
return !t || t.type !== "SwitchCase" || t.test || !n || n !== t.consequent[0] ? !1 : (n.type === "BlockStatement" && Et(e) ? rt(n, e) : ce(t, e), !0);
|
|
1075
|
-
}
|
|
1076
|
-
function os({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
1077
|
-
return _e(t) && ((n.type === "TSArrayType" || n.type === "ArrayTypeAnnotation") && !r || Kn(n)) ? ($(_(!1, t.types, -1), e), !0) : !1;
|
|
1078
|
-
}
|
|
1079
|
-
function is({ comment: e, enclosingNode: t, precedingNode: n, followingNode: r }) {
|
|
1080
|
-
if (((t == null ? void 0 : t.type) === "ObjectPattern" || (t == null ? void 0 : t.type) === "ArrayPattern") && (r == null ? void 0 : r.type) === "TSTypeAnnotation")
|
|
1081
|
-
return n ? $(n, e) : ce(t, e), !0;
|
|
1082
|
-
}
|
|
1083
|
-
function ss({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
1084
|
-
var u;
|
|
1085
|
-
if (!r && (n == null ? void 0 : n.type) === "UnaryExpression" && ((t == null ? void 0 : t.type) === "LogicalExpression" || (t == null ? void 0 : t.type) === "BinaryExpression")) {
|
|
1086
|
-
let a = ((u = n.argument.loc) == null ? void 0 : u.start.line) !== t.right.loc.start.line, o = Et(e) || e.loc.start.line === e.loc.end.line, i = e.loc.start.line === t.right.loc.start.line;
|
|
1087
|
-
if (a && o && i)
|
|
1088
|
-
return $(t.right, e), !0;
|
|
1089
|
-
}
|
|
1090
|
-
return !1;
|
|
1091
|
-
}
|
|
1092
|
-
var xu = J(["ArrowFunctionExpression", "FunctionExpression", "FunctionDeclaration", "ObjectMethod", "ClassMethod", "TSDeclareFunction", "TSCallSignatureDeclaration", "TSConstructSignatureDeclaration", "TSMethodSignature", "TSConstructorType", "TSFunctionType", "TSDeclareMethod"]), ps = /* @__PURE__ */ new Set(["EmptyStatement", "TemplateElement", "TSEmptyBodyFunctionExpression", "ChainExpression"]);
|
|
1093
|
-
function ls(e) {
|
|
1094
|
-
return !ps.has(e.type);
|
|
1095
|
-
}
|
|
1096
|
-
function cs(e, t) {
|
|
1097
|
-
var n;
|
|
1098
|
-
if ((t.parser === "typescript" || t.parser === "flow" || t.parser === "acorn" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree") && e.type === "MethodDefinition" && ((n = e.value) == null ? void 0 : n.type) === "FunctionExpression" && Z(e.value).length === 0 && !e.value.returnType && !O(e.value.typeParameters) && e.value.body)
|
|
1099
|
-
return [...e.decorators || [], e.key, e.value.body];
|
|
1100
|
-
}
|
|
1101
|
-
function hu(e) {
|
|
1102
|
-
let { node: t, parent: n } = e;
|
|
1103
|
-
return (K(t) || n && (n.type === "JSXSpreadAttribute" || n.type === "JSXSpreadChild" || _e(n) || (n.type === "ClassDeclaration" || n.type === "ClassExpression") && n.superClass === t)) && (!un(t) || _e(n));
|
|
1104
|
-
}
|
|
1105
|
-
function Ds(e, { parser: t }) {
|
|
1106
|
-
if (t === "flow" || t === "babel-flow")
|
|
1107
|
-
return e = H(!1, e, /[\s(]/gu, ""), e === "" || e === "/*" || e === "/*::";
|
|
1108
|
-
}
|
|
1109
|
-
function ys(e) {
|
|
1110
|
-
switch (e) {
|
|
1111
|
-
case "cr":
|
|
1112
|
-
return "\r";
|
|
1113
|
-
case "crlf":
|
|
1114
|
-
return `\r
|
|
1115
|
-
`;
|
|
1116
|
-
default:
|
|
1117
|
-
return `
|
|
1118
|
-
`;
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
var re = Symbol("MODE_BREAK"), ge = Symbol("MODE_FLAT"), pt = Symbol("cursor"), Bn = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
1122
|
-
function Cu() {
|
|
1123
|
-
return { value: "", length: 0, queue: [] };
|
|
1124
|
-
}
|
|
1125
|
-
function ds(e, t) {
|
|
1126
|
-
return vn(e, { type: "indent" }, t);
|
|
1127
|
-
}
|
|
1128
|
-
function ms(e, t, n) {
|
|
1129
|
-
return t === Number.NEGATIVE_INFINITY ? e.root || Cu() : t < 0 ? vn(e, { type: "dedent" }, n) : t ? t.type === "root" ? { ...e, root: e } : vn(e, { type: typeof t == "string" ? "stringAlign" : "numberAlign", n: t }, n) : e;
|
|
1130
|
-
}
|
|
1131
|
-
function vn(e, t, n) {
|
|
1132
|
-
let r = t.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, t], u = "", a = 0, o = 0, i = 0;
|
|
1133
|
-
for (let y of r)
|
|
1134
|
-
switch (y.type) {
|
|
1135
|
-
case "indent":
|
|
1136
|
-
d(), n.useTabs ? s(1) : l(n.tabWidth);
|
|
1137
|
-
break;
|
|
1138
|
-
case "stringAlign":
|
|
1139
|
-
d(), u += y.n, a += y.n.length;
|
|
1140
|
-
break;
|
|
1141
|
-
case "numberAlign":
|
|
1142
|
-
o += 1, i += y.n;
|
|
1143
|
-
break;
|
|
1144
|
-
default:
|
|
1145
|
-
throw new Error(`Unexpected type '${y.type}'`);
|
|
1146
|
-
}
|
|
1147
|
-
return D(), { ...e, value: u, length: a, queue: r };
|
|
1148
|
-
function s(y) {
|
|
1149
|
-
u += " ".repeat(y), a += n.tabWidth * y;
|
|
1150
|
-
}
|
|
1151
|
-
function l(y) {
|
|
1152
|
-
u += " ".repeat(y), a += y;
|
|
1153
|
-
}
|
|
1154
|
-
function d() {
|
|
1155
|
-
n.useTabs ? c() : D();
|
|
1156
|
-
}
|
|
1157
|
-
function c() {
|
|
1158
|
-
o > 0 && s(o), p();
|
|
1159
|
-
}
|
|
1160
|
-
function D() {
|
|
1161
|
-
i > 0 && l(i), p();
|
|
1162
|
-
}
|
|
1163
|
-
function p() {
|
|
1164
|
-
o = 0, i = 0;
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
function kn(e) {
|
|
1168
|
-
let t = 0, n = 0, r = e.length;
|
|
1169
|
-
e:
|
|
1170
|
-
for (; r--; ) {
|
|
1171
|
-
let u = e[r];
|
|
1172
|
-
if (u === pt) {
|
|
1173
|
-
n++;
|
|
1174
|
-
continue;
|
|
1175
|
-
}
|
|
1176
|
-
for (let a = u.length - 1; a >= 0; a--) {
|
|
1177
|
-
let o = u[a];
|
|
1178
|
-
if (o === " " || o === " ")
|
|
1179
|
-
t++;
|
|
1180
|
-
else {
|
|
1181
|
-
e[r] = u.slice(0, a + 1);
|
|
1182
|
-
break e;
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
if (t > 0 || n > 0)
|
|
1187
|
-
for (e.length = r + 1; n-- > 0; )
|
|
1188
|
-
e.push(pt);
|
|
1189
|
-
return t;
|
|
1190
|
-
}
|
|
1191
|
-
function Wt(e, t, n, r, u, a) {
|
|
1192
|
-
if (n === Number.POSITIVE_INFINITY)
|
|
1193
|
-
return !0;
|
|
1194
|
-
let o = t.length, i = [e], s = [];
|
|
1195
|
-
for (; n >= 0; ) {
|
|
1196
|
-
if (i.length === 0) {
|
|
1197
|
-
if (o === 0)
|
|
1198
|
-
return !0;
|
|
1199
|
-
i.push(t[--o]);
|
|
1200
|
-
continue;
|
|
1201
|
-
}
|
|
1202
|
-
let { mode: l, doc: d } = i.pop(), c = Ue(d);
|
|
1203
|
-
switch (c) {
|
|
1204
|
-
case Qe:
|
|
1205
|
-
s.push(d), n -= ct(d);
|
|
1206
|
-
break;
|
|
1207
|
-
case ve:
|
|
1208
|
-
case $e: {
|
|
1209
|
-
let D = c === ve ? d : d.parts, p = d[Bn] ?? 0;
|
|
1210
|
-
for (let y = D.length - 1; y >= p; y--)
|
|
1211
|
-
i.push({ mode: l, doc: D[y] });
|
|
1212
|
-
break;
|
|
1213
|
-
}
|
|
1214
|
-
case Ye:
|
|
1215
|
-
case Ze:
|
|
1216
|
-
case tt:
|
|
1217
|
-
case Ie:
|
|
1218
|
-
i.push({ mode: l, doc: d.contents });
|
|
1219
|
-
break;
|
|
1220
|
-
case et:
|
|
1221
|
-
n += kn(s);
|
|
1222
|
-
break;
|
|
1223
|
-
case le: {
|
|
1224
|
-
if (a && d.break)
|
|
1225
|
-
return !1;
|
|
1226
|
-
let D = d.break ? re : l, p = d.expandedStates && D === re ? _(!1, d.expandedStates, -1) : d.contents;
|
|
1227
|
-
i.push({ mode: D, doc: p });
|
|
1228
|
-
break;
|
|
1229
|
-
}
|
|
1230
|
-
case he: {
|
|
1231
|
-
let D = (d.groupId ? u[d.groupId] || ge : l) === re ? d.breakContents : d.flatContents;
|
|
1232
|
-
D && i.push({ mode: l, doc: D });
|
|
1233
|
-
break;
|
|
1234
|
-
}
|
|
1235
|
-
case oe:
|
|
1236
|
-
if (l === re || d.hard)
|
|
1237
|
-
return !0;
|
|
1238
|
-
d.soft || (s.push(" "), n--);
|
|
1239
|
-
break;
|
|
1240
|
-
case nt:
|
|
1241
|
-
r = !0;
|
|
1242
|
-
break;
|
|
1243
|
-
case We:
|
|
1244
|
-
if (r)
|
|
1245
|
-
return !1;
|
|
1246
|
-
break;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
return !1;
|
|
1250
|
-
}
|
|
1251
|
-
function Tu(e, t) {
|
|
1252
|
-
let n = {}, r = t.printWidth, u = ys(t.endOfLine), a = 0, o = [{ ind: Cu(), mode: re, doc: e }], i = [], s = !1, l = [], d = 0;
|
|
1253
|
-
for (mi(e); o.length > 0; ) {
|
|
1254
|
-
let { ind: D, mode: p, doc: y } = o.pop();
|
|
1255
|
-
switch (Ue(y)) {
|
|
1256
|
-
case Qe: {
|
|
1257
|
-
let E = u !== `
|
|
1258
|
-
` ? H(!1, y, `
|
|
1259
|
-
`, u) : y;
|
|
1260
|
-
i.push(E), o.length > 0 && (a += ct(E));
|
|
1261
|
-
break;
|
|
1262
|
-
}
|
|
1263
|
-
case ve:
|
|
1264
|
-
for (let E = y.length - 1; E >= 0; E--)
|
|
1265
|
-
o.push({ ind: D, mode: p, doc: y[E] });
|
|
1266
|
-
break;
|
|
1267
|
-
case Ft:
|
|
1268
|
-
if (d >= 2)
|
|
1269
|
-
throw new Error("There are too many 'cursor' in doc.");
|
|
1270
|
-
i.push(pt), d++;
|
|
1271
|
-
break;
|
|
1272
|
-
case Ye:
|
|
1273
|
-
o.push({ ind: ds(D, t), mode: p, doc: y.contents });
|
|
1274
|
-
break;
|
|
1275
|
-
case Ze:
|
|
1276
|
-
o.push({ ind: ms(D, y.n, t), mode: p, doc: y.contents });
|
|
1277
|
-
break;
|
|
1278
|
-
case et:
|
|
1279
|
-
a -= kn(i);
|
|
1280
|
-
break;
|
|
1281
|
-
case le:
|
|
1282
|
-
switch (p) {
|
|
1283
|
-
case ge:
|
|
1284
|
-
if (!s) {
|
|
1285
|
-
o.push({ ind: D, mode: y.break ? re : ge, doc: y.contents });
|
|
1286
|
-
break;
|
|
1287
|
-
}
|
|
1288
|
-
case re: {
|
|
1289
|
-
s = !1;
|
|
1290
|
-
let E = { ind: D, mode: ge, doc: y.contents }, g = r - a, S = l.length > 0;
|
|
1291
|
-
if (!y.break && Wt(E, o, g, S, n))
|
|
1292
|
-
o.push(E);
|
|
1293
|
-
else if (y.expandedStates) {
|
|
1294
|
-
let B = _(!1, y.expandedStates, -1);
|
|
1295
|
-
if (y.break) {
|
|
1296
|
-
o.push({ ind: D, mode: re, doc: B });
|
|
1297
|
-
break;
|
|
1298
|
-
} else
|
|
1299
|
-
for (let x = 1; x < y.expandedStates.length + 1; x++)
|
|
1300
|
-
if (x >= y.expandedStates.length) {
|
|
1301
|
-
o.push({ ind: D, mode: re, doc: B });
|
|
1302
|
-
break;
|
|
1303
|
-
} else {
|
|
1304
|
-
let N = y.expandedStates[x], b = { ind: D, mode: ge, doc: N };
|
|
1305
|
-
if (Wt(b, o, g, S, n)) {
|
|
1306
|
-
o.push(b);
|
|
1307
|
-
break;
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
} else
|
|
1311
|
-
o.push({ ind: D, mode: re, doc: y.contents });
|
|
1312
|
-
break;
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
y.id && (n[y.id] = _(!1, o, -1).mode);
|
|
1316
|
-
break;
|
|
1317
|
-
case $e: {
|
|
1318
|
-
let E = r - a, g = y[Bn] ?? 0, { parts: S } = y, B = S.length - g;
|
|
1319
|
-
if (B === 0)
|
|
1320
|
-
break;
|
|
1321
|
-
let x = S[g + 0], N = S[g + 1], b = { ind: D, mode: ge, doc: x }, v = { ind: D, mode: re, doc: x }, q = Wt(b, [], E, l.length > 0, n, !0);
|
|
1322
|
-
if (B === 1) {
|
|
1323
|
-
q ? o.push(b) : o.push(v);
|
|
1324
|
-
break;
|
|
1325
|
-
}
|
|
1326
|
-
let k = { ind: D, mode: ge, doc: N }, M = { ind: D, mode: re, doc: N };
|
|
1327
|
-
if (B === 2) {
|
|
1328
|
-
q ? o.push(k, b) : o.push(M, v);
|
|
1329
|
-
break;
|
|
1330
|
-
}
|
|
1331
|
-
let V = S[g + 2], X = { ind: D, mode: p, doc: { ...y, [Bn]: g + 2 } };
|
|
1332
|
-
Wt({ ind: D, mode: ge, doc: [x, N, V] }, [], E, l.length > 0, n, !0) ? o.push(X, k, b) : q ? o.push(X, M, b) : o.push(X, M, v);
|
|
1333
|
-
break;
|
|
1334
|
-
}
|
|
1335
|
-
case he:
|
|
1336
|
-
case tt: {
|
|
1337
|
-
let E = y.groupId ? n[y.groupId] : p;
|
|
1338
|
-
if (E === re) {
|
|
1339
|
-
let g = y.type === he ? y.breakContents : y.negate ? y.contents : A(y.contents);
|
|
1340
|
-
g && o.push({ ind: D, mode: p, doc: g });
|
|
1341
|
-
}
|
|
1342
|
-
if (E === ge) {
|
|
1343
|
-
let g = y.type === he ? y.flatContents : y.negate ? A(y.contents) : y.contents;
|
|
1344
|
-
g && o.push({ ind: D, mode: p, doc: g });
|
|
1345
|
-
}
|
|
1346
|
-
break;
|
|
1347
|
-
}
|
|
1348
|
-
case nt:
|
|
1349
|
-
l.push({ ind: D, mode: p, doc: y.contents });
|
|
1350
|
-
break;
|
|
1351
|
-
case We:
|
|
1352
|
-
l.length > 0 && o.push({ ind: D, mode: p, doc: pu });
|
|
1353
|
-
break;
|
|
1354
|
-
case oe:
|
|
1355
|
-
switch (p) {
|
|
1356
|
-
case ge:
|
|
1357
|
-
if (y.hard)
|
|
1358
|
-
s = !0;
|
|
1359
|
-
else {
|
|
1360
|
-
y.soft || (i.push(" "), a += 1);
|
|
1361
|
-
break;
|
|
1362
|
-
}
|
|
1363
|
-
case re:
|
|
1364
|
-
if (l.length > 0) {
|
|
1365
|
-
o.push({ ind: D, mode: p, doc: y }, ...l.reverse()), l.length = 0;
|
|
1366
|
-
break;
|
|
1367
|
-
}
|
|
1368
|
-
y.literal ? D.root ? (i.push(u, D.root.value), a = D.root.length) : (i.push(u), a = 0) : (a -= kn(i), i.push(u + D.value), a = D.length);
|
|
1369
|
-
break;
|
|
1370
|
-
}
|
|
1371
|
-
break;
|
|
1372
|
-
case Ie:
|
|
1373
|
-
o.push({ ind: D, mode: p, doc: y.contents });
|
|
1374
|
-
break;
|
|
1375
|
-
case je:
|
|
1376
|
-
break;
|
|
1377
|
-
default:
|
|
1378
|
-
throw new Nt(y);
|
|
1379
|
-
}
|
|
1380
|
-
o.length === 0 && l.length > 0 && (o.push(...l.reverse()), l.length = 0);
|
|
1381
|
-
}
|
|
1382
|
-
let c = i.indexOf(pt);
|
|
1383
|
-
if (c !== -1) {
|
|
1384
|
-
let D = i.indexOf(pt, c + 1);
|
|
1385
|
-
if (D === -1)
|
|
1386
|
-
return { formatted: i.filter((g) => g !== pt).join("") };
|
|
1387
|
-
let p = i.slice(0, c).join(""), y = i.slice(c + 1, D).join(""), E = i.slice(D + 1).join("");
|
|
1388
|
-
return { formatted: p + y + E, cursorNodeStart: p.length, cursorNodeText: y };
|
|
1389
|
-
}
|
|
1390
|
-
return { formatted: i.join("") };
|
|
1391
|
-
}
|
|
1392
|
-
function fs(e, t, n = 0) {
|
|
1393
|
-
let r = 0;
|
|
1394
|
-
for (let u = n; u < e.length; ++u)
|
|
1395
|
-
e[u] === " " ? r = r + t - r % t : r++;
|
|
1396
|
-
return r;
|
|
1397
|
-
}
|
|
1398
|
-
var Es = fs;
|
|
1399
|
-
function Fs(e, t) {
|
|
1400
|
-
let n = e.lastIndexOf(`
|
|
1401
|
-
`);
|
|
1402
|
-
return n === -1 ? 0 : Es(e.slice(n + 1).match(/^[\t ]*/u)[0], t);
|
|
1403
|
-
}
|
|
1404
|
-
var As = Fs;
|
|
1405
|
-
function Su(e, t, n) {
|
|
1406
|
-
let { node: r } = e;
|
|
1407
|
-
if (r.type === "TemplateLiteral" && Cs(e)) {
|
|
1408
|
-
let s = xs(e, n, t);
|
|
1409
|
-
if (s)
|
|
1410
|
-
return s;
|
|
1411
|
-
}
|
|
1412
|
-
let u = "expressions";
|
|
1413
|
-
r.type === "TSTemplateLiteralType" && (u = "types");
|
|
1414
|
-
let a = [], o = e.map(t, u);
|
|
1415
|
-
a.push(ke, "`");
|
|
1416
|
-
let i = 0;
|
|
1417
|
-
return e.each(({ index: s, node: l }) => {
|
|
1418
|
-
if (a.push(t()), l.tail)
|
|
1419
|
-
return;
|
|
1420
|
-
let { tabWidth: d } = n, c = l.value.raw, D = c.includes(`
|
|
1421
|
-
`) ? As(c, d) : i;
|
|
1422
|
-
i = D;
|
|
1423
|
-
let p = o[s], y = r[u][s], E = Re(n.originalText, j(l), W(r.quasis[s + 1]));
|
|
1424
|
-
if (!E) {
|
|
1425
|
-
let S = Tu(p, { ...n, printWidth: Number.POSITIVE_INFINITY }).formatted;
|
|
1426
|
-
S.includes(`
|
|
1427
|
-
`) ? E = !0 : p = S;
|
|
1428
|
-
}
|
|
1429
|
-
E && (h(y) || y.type === "Identifier" || U(y) || y.type === "ConditionalExpression" || y.type === "SequenceExpression" || xe(y) || Be(y)) && (p = [A([f, p]), f]);
|
|
1430
|
-
let g = D === 0 && c.endsWith(`
|
|
1431
|
-
`) ? Ce(Number.NEGATIVE_INFINITY, p) : Si(p, D, d);
|
|
1432
|
-
a.push(m(["${", g, ke, "}"]));
|
|
1433
|
-
}, "quasis"), a.push("`"), a;
|
|
1434
|
-
}
|
|
1435
|
-
function gs(e, t) {
|
|
1436
|
-
let n = t("quasi");
|
|
1437
|
-
return Lt(n.label && { tagged: !0, ...n.label }, [t("tag"), t(e.node.typeArguments ? "typeArguments" : "typeParameters"), ke, n]);
|
|
1438
|
-
}
|
|
1439
|
-
function xs(e, t, n) {
|
|
1440
|
-
let { node: r } = e, u = r.quasis[0].value.raw.trim().split(/\s*\|\s*/u);
|
|
1441
|
-
if (u.length > 1 || u.some((a) => a.length > 0)) {
|
|
1442
|
-
t.__inJestEach = !0;
|
|
1443
|
-
let a = e.map(n, "expressions");
|
|
1444
|
-
t.__inJestEach = !1;
|
|
1445
|
-
let o = [], i = a.map((D) => "${" + Tu(D, { ...t, printWidth: Number.POSITIVE_INFINITY, endOfLine: "lf" }).formatted + "}"), s = [{ hasLineBreak: !1, cells: [] }];
|
|
1446
|
-
for (let D = 1; D < r.quasis.length; D++) {
|
|
1447
|
-
let p = _(!1, s, -1), y = i[D - 1];
|
|
1448
|
-
p.cells.push(y), y.includes(`
|
|
1449
|
-
`) && (p.hasLineBreak = !0), r.quasis[D].value.raw.includes(`
|
|
1450
|
-
`) && s.push({ hasLineBreak: !1, cells: [] });
|
|
1451
|
-
}
|
|
1452
|
-
let l = Math.max(u.length, ...s.map((D) => D.cells.length)), d = Array.from({ length: l }).fill(0), c = [{ cells: u }, ...s.filter((D) => D.cells.length > 0)];
|
|
1453
|
-
for (let { cells: D } of c.filter((p) => !p.hasLineBreak))
|
|
1454
|
-
for (let [p, y] of D.entries())
|
|
1455
|
-
d[p] = Math.max(d[p], ct(y));
|
|
1456
|
-
return o.push(ke, "`", A([F, I(F, c.map((D) => I(" | ", D.cells.map((p, y) => D.hasLineBreak ? p : p + " ".repeat(d[y] - ct(p))))))]), F, "`"), o;
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
function hs(e, t) {
|
|
1460
|
-
let { node: n } = e, r = t();
|
|
1461
|
-
return h(n) && (r = m([A([f, r]), f])), ["${", r, ke, "}"];
|
|
1462
|
-
}
|
|
1463
|
-
function nr(e, t) {
|
|
1464
|
-
return e.map((n) => hs(n, t), "expressions");
|
|
1465
|
-
}
|
|
1466
|
-
function bu(e, t) {
|
|
1467
|
-
return At(e, (n) => typeof n == "string" ? t ? H(!1, n, /(\\*)`/gu, "$1$1\\`") : Bu(n) : n);
|
|
1468
|
-
}
|
|
1469
|
-
function Bu(e) {
|
|
1470
|
-
return H(!1, e, /([\\`]|\$\{)/gu, String.raw`\$1`);
|
|
1471
|
-
}
|
|
1472
|
-
function Cs({ node: e, parent: t }) {
|
|
1473
|
-
let n = /^[fx]?(?:describe|it|test)$/u;
|
|
1474
|
-
return t.type === "TaggedTemplateExpression" && t.quasi === e && t.tag.type === "MemberExpression" && t.tag.property.type === "Identifier" && t.tag.property.name === "each" && (t.tag.object.type === "Identifier" && n.test(t.tag.object.name) || t.tag.object.type === "MemberExpression" && t.tag.object.property.type === "Identifier" && (t.tag.object.property.name === "only" || t.tag.object.property.name === "skip") && t.tag.object.object.type === "Identifier" && n.test(t.tag.object.object.name));
|
|
1475
|
-
}
|
|
1476
|
-
var Pn = [(e, t) => e.type === "ObjectExpression" && t === "properties", (e, t) => e.type === "CallExpression" && e.callee.type === "Identifier" && e.callee.name === "Component" && t === "arguments", (e, t) => e.type === "Decorator" && t === "expression"];
|
|
1477
|
-
function Ts(e) {
|
|
1478
|
-
let t = (r) => r.type === "TemplateLiteral", n = (r, u) => Ne(r) && !r.computed && r.key.type === "Identifier" && r.key.name === "styles" && u === "value";
|
|
1479
|
-
return e.match(t, (r, u) => Q(r) && u === "elements", n, ...Pn) || e.match(t, n, ...Pn);
|
|
1480
|
-
}
|
|
1481
|
-
function Ss(e) {
|
|
1482
|
-
return e.match((t) => t.type === "TemplateLiteral", (t, n) => Ne(t) && !t.computed && t.key.type === "Identifier" && t.key.name === "template" && n === "value", ...Pn);
|
|
1483
|
-
}
|
|
1484
|
-
function dn(e, t) {
|
|
1485
|
-
return h(e, T.Block | T.Leading, ({ value: n }) => n === ` ${t} `);
|
|
1486
|
-
}
|
|
1487
|
-
function vu({ node: e, parent: t }, n) {
|
|
1488
|
-
return dn(e, n) || bs(t) && dn(t, n) || t.type === "ExpressionStatement" && dn(t, n);
|
|
1489
|
-
}
|
|
1490
|
-
function bs(e) {
|
|
1491
|
-
return e.type === "AsConstExpression" || e.type === "TSAsExpression" && e.typeAnnotation.type === "TSTypeReference" && e.typeAnnotation.typeName.type === "Identifier" && e.typeAnnotation.typeName.name === "const";
|
|
1492
|
-
}
|
|
1493
|
-
async function Bs(e, t, n) {
|
|
1494
|
-
let { node: r } = n, u = r.quasis.map((d) => d.value.raw), a = 0, o = u.reduce((d, c, D) => D === 0 ? c : d + "@prettier-placeholder-" + a++ + "-id" + c, ""), i = await e(o, { parser: "scss" }), s = nr(n, t), l = vs(i, s);
|
|
1495
|
-
if (!l)
|
|
1496
|
-
throw new Error("Couldn't insert all the expressions");
|
|
1497
|
-
return ["`", A([F, l]), f, "`"];
|
|
1498
|
-
}
|
|
1499
|
-
function vs(e, t) {
|
|
1500
|
-
if (!O(t))
|
|
1501
|
-
return e;
|
|
1502
|
-
let n = 0, r = At(zn(e), (u) => typeof u != "string" || !u.includes("@prettier-placeholder") ? u : u.split(/@prettier-placeholder-(\d+)-id/u).map((a, o) => o % 2 === 0 ? He(a) : (n++, t[a])));
|
|
1503
|
-
return t.length === n ? r : null;
|
|
1504
|
-
}
|
|
1505
|
-
function ks({ node: e, parent: t, grandparent: n }) {
|
|
1506
|
-
return n && e.quasis && t.type === "JSXExpressionContainer" && n.type === "JSXElement" && n.openingElement.name.name === "style" && n.openingElement.attributes.some((r) => r.type === "JSXAttribute" && r.name.name === "jsx") || (t == null ? void 0 : t.type) === "TaggedTemplateExpression" && t.tag.type === "Identifier" && t.tag.name === "css" || (t == null ? void 0 : t.type) === "TaggedTemplateExpression" && t.tag.type === "MemberExpression" && t.tag.object.name === "css" && (t.tag.property.name === "global" || t.tag.property.name === "resolve");
|
|
1507
|
-
}
|
|
1508
|
-
function Ut(e) {
|
|
1509
|
-
return e.type === "Identifier" && e.name === "styled";
|
|
1510
|
-
}
|
|
1511
|
-
function xr(e) {
|
|
1512
|
-
return /^[A-Z]/u.test(e.object.name) && e.property.name === "extend";
|
|
1513
|
-
}
|
|
1514
|
-
function Ps({ parent: e }) {
|
|
1515
|
-
if (!e || e.type !== "TaggedTemplateExpression")
|
|
1516
|
-
return !1;
|
|
1517
|
-
let t = e.tag.type === "ParenthesizedExpression" ? e.tag.expression : e.tag;
|
|
1518
|
-
switch (t.type) {
|
|
1519
|
-
case "MemberExpression":
|
|
1520
|
-
return Ut(t.object) || xr(t);
|
|
1521
|
-
case "CallExpression":
|
|
1522
|
-
return Ut(t.callee) || t.callee.type === "MemberExpression" && (t.callee.object.type === "MemberExpression" && (Ut(t.callee.object.object) || xr(t.callee.object)) || t.callee.object.type === "CallExpression" && Ut(t.callee.object.callee));
|
|
1523
|
-
case "Identifier":
|
|
1524
|
-
return t.name === "css";
|
|
1525
|
-
default:
|
|
1526
|
-
return !1;
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
function ws({ parent: e, grandparent: t }) {
|
|
1530
|
-
return (t == null ? void 0 : t.type) === "JSXAttribute" && e.type === "JSXExpressionContainer" && t.name.type === "JSXIdentifier" && t.name.name === "css";
|
|
1531
|
-
}
|
|
1532
|
-
function Ns(e) {
|
|
1533
|
-
if (ks(e) || Ps(e) || ws(e) || Ts(e))
|
|
1534
|
-
return Bs;
|
|
1535
|
-
}
|
|
1536
|
-
var Is = Ns;
|
|
1537
|
-
async function js(e, t, n) {
|
|
1538
|
-
let { node: r } = n, u = r.quasis.length, a = nr(n, t), o = [];
|
|
1539
|
-
for (let i = 0; i < u; i++) {
|
|
1540
|
-
let s = r.quasis[i], l = i === 0, d = i === u - 1, c = s.value.cooked, D = c.split(`
|
|
1541
|
-
`), p = D.length, y = a[i], E = p > 2 && D[0].trim() === "" && D[1].trim() === "", g = p > 2 && D[p - 1].trim() === "" && D[p - 2].trim() === "", S = D.every((x) => /^\s*(?:#[^\n\r]*)?$/u.test(x));
|
|
1542
|
-
if (!d && /#[^\n\r]*$/u.test(D[p - 1]))
|
|
1543
|
-
return null;
|
|
1544
|
-
let B = null;
|
|
1545
|
-
S ? B = Ls(D) : B = await e(c, { parser: "graphql" }), B ? (B = bu(B, !1), !l && E && o.push(""), o.push(B), !d && g && o.push("")) : !l && !d && E && o.push(""), y && o.push(y);
|
|
1546
|
-
}
|
|
1547
|
-
return ["`", A([F, I(F, o)]), F, "`"];
|
|
1548
|
-
}
|
|
1549
|
-
function Ls(e) {
|
|
1550
|
-
let t = [], n = !1, r = e.map((u) => u.trim());
|
|
1551
|
-
for (let [u, a] of r.entries())
|
|
1552
|
-
a !== "" && (r[u - 1] === "" && n ? t.push([F, a]) : t.push(a), n = !0);
|
|
1553
|
-
return t.length === 0 ? null : I(F, t);
|
|
1554
|
-
}
|
|
1555
|
-
function Ms({ node: e, parent: t }) {
|
|
1556
|
-
return vu({ node: e, parent: t }, "GraphQL") || t && (t.type === "TaggedTemplateExpression" && (t.tag.type === "MemberExpression" && t.tag.object.name === "graphql" && t.tag.property.name === "experimental" || t.tag.type === "Identifier" && (t.tag.name === "gql" || t.tag.name === "graphql")) || t.type === "CallExpression" && t.callee.type === "Identifier" && t.callee.name === "graphql");
|
|
1557
|
-
}
|
|
1558
|
-
function Os(e) {
|
|
1559
|
-
if (Ms(e))
|
|
1560
|
-
return js;
|
|
1561
|
-
}
|
|
1562
|
-
var Js = Os, mn = 0;
|
|
1563
|
-
async function ku(e, t, n, r, u) {
|
|
1564
|
-
let { node: a } = r, o = mn;
|
|
1565
|
-
mn = mn + 1 >>> 0;
|
|
1566
|
-
let i = (S) => `PRETTIER_HTML_PLACEHOLDER_${S}_${o}_IN_JS`, s = a.quasis.map((S, B, x) => B === x.length - 1 ? S.value.cooked : S.value.cooked + i(B)).join(""), l = nr(r, n), d = new RegExp(i(String.raw`(\d+)`), "gu"), c = 0, D = await t(s, { parser: e, __onHtmlRoot(S) {
|
|
1567
|
-
c = S.children.length;
|
|
1568
|
-
} }), p = At(D, (S) => {
|
|
1569
|
-
if (typeof S != "string")
|
|
1570
|
-
return S;
|
|
1571
|
-
let B = [], x = S.split(d);
|
|
1572
|
-
for (let N = 0; N < x.length; N++) {
|
|
1573
|
-
let b = x[N];
|
|
1574
|
-
if (N % 2 === 0) {
|
|
1575
|
-
b && (b = Bu(b), u.__embeddedInHtml && (b = H(!1, b, /<\/(?=script\b)/giu, String.raw`<\/`)), B.push(b));
|
|
1576
|
-
continue;
|
|
1577
|
-
}
|
|
1578
|
-
let v = Number(b);
|
|
1579
|
-
B.push(l[v]);
|
|
1580
|
-
}
|
|
1581
|
-
return B;
|
|
1582
|
-
}), y = /^\s/u.test(s) ? " " : "", E = /\s$/u.test(s) ? " " : "", g = u.htmlWhitespaceSensitivity === "ignore" ? F : y && E ? C : null;
|
|
1583
|
-
return g ? m(["`", A([g, m(p)]), g, "`"]) : Lt({ hug: !1 }, m(["`", y, c > 1 ? A(m(p)) : m(p), E, "`"]));
|
|
1584
|
-
}
|
|
1585
|
-
function qs(e) {
|
|
1586
|
-
return vu(e, "HTML") || e.match((t) => t.type === "TemplateLiteral", (t, n) => t.type === "TaggedTemplateExpression" && t.tag.type === "Identifier" && t.tag.name === "html" && n === "quasi");
|
|
1587
|
-
}
|
|
1588
|
-
var _s = ku.bind(void 0, "html"), Xs = ku.bind(void 0, "angular");
|
|
1589
|
-
function Rs(e) {
|
|
1590
|
-
if (qs(e))
|
|
1591
|
-
return _s;
|
|
1592
|
-
if (Ss(e))
|
|
1593
|
-
return Xs;
|
|
1594
|
-
}
|
|
1595
|
-
var $s = Rs;
|
|
1596
|
-
async function Ws(e, t, n) {
|
|
1597
|
-
let { node: r } = n, u = H(!1, r.quasis[0].value.raw, /((?:\\\\)*)\\`/gu, (s, l) => "\\".repeat(l.length / 2) + "`"), a = Us(u), o = a !== "";
|
|
1598
|
-
o && (u = H(!1, u, new RegExp(`^${a}`, "gmu"), ""));
|
|
1599
|
-
let i = bu(await e(u, { parser: "markdown", __inJsTemplate: !0 }), !0);
|
|
1600
|
-
return ["`", o ? A([f, i]) : [lu, Ci(i)], f, "`"];
|
|
1601
|
-
}
|
|
1602
|
-
function Us(e) {
|
|
1603
|
-
let t = e.match(/^([^\S\n]*)\S/mu);
|
|
1604
|
-
return t === null ? "" : t[1];
|
|
1605
|
-
}
|
|
1606
|
-
function Gs(e) {
|
|
1607
|
-
if (Vs(e))
|
|
1608
|
-
return Ws;
|
|
1609
|
-
}
|
|
1610
|
-
function Vs({ node: e, parent: t }) {
|
|
1611
|
-
return (t == null ? void 0 : t.type) === "TaggedTemplateExpression" && e.quasis.length === 1 && t.tag.type === "Identifier" && (t.tag.name === "md" || t.tag.name === "markdown");
|
|
1612
|
-
}
|
|
1613
|
-
var Ks = Gs;
|
|
1614
|
-
function Hs(e) {
|
|
1615
|
-
let { node: t } = e;
|
|
1616
|
-
if (t.type !== "TemplateLiteral" || zs(t))
|
|
1617
|
-
return;
|
|
1618
|
-
let n;
|
|
1619
|
-
for (let r of [Is, Js, $s, Ks])
|
|
1620
|
-
if (n = r(e), !!n)
|
|
1621
|
-
return t.quasis.length === 1 && t.quasis[0].value.raw.trim() === "" ? "``" : async (...u) => {
|
|
1622
|
-
let a = await n(...u);
|
|
1623
|
-
return a && Lt({ embed: !0, ...a.label }, a);
|
|
1624
|
-
};
|
|
1625
|
-
}
|
|
1626
|
-
function zs({ quasis: e }) {
|
|
1627
|
-
return e.some(({ value: { cooked: t } }) => t === null);
|
|
1628
|
-
}
|
|
1629
|
-
var Qs = Hs, Ys = /\*\/$/, Zs = /^\/\*\*?/, Pu = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/, ep = /(^|\s+)\/\/([^\n\r]*)/g, hr = /^(\r?\n)+/, tp = /(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g, Cr = /(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g, np = /(\r?\n|^) *\* ?/g, wu = [];
|
|
1630
|
-
function rp(e) {
|
|
1631
|
-
let t = e.match(Pu);
|
|
1632
|
-
return t ? t[0].trimStart() : "";
|
|
1633
|
-
}
|
|
1634
|
-
function up(e) {
|
|
1635
|
-
let t = e.match(Pu), n = t == null ? void 0 : t[0];
|
|
1636
|
-
return n == null ? e : e.slice(n.length);
|
|
1637
|
-
}
|
|
1638
|
-
function ap(e) {
|
|
1639
|
-
let t = `
|
|
1640
|
-
`;
|
|
1641
|
-
e = H(!1, e.replace(Zs, "").replace(Ys, ""), np, "$1");
|
|
1642
|
-
let n = "";
|
|
1643
|
-
for (; n !== e; )
|
|
1644
|
-
n = e, e = H(!1, e, tp, `${t}$1 $2${t}`);
|
|
1645
|
-
e = e.replace(hr, "").trimEnd();
|
|
1646
|
-
let r = /* @__PURE__ */ Object.create(null), u = H(!1, e, Cr, "").replace(hr, "").trimEnd(), a;
|
|
1647
|
-
for (; a = Cr.exec(e); ) {
|
|
1648
|
-
let o = H(!1, a[2], ep, "");
|
|
1649
|
-
if (typeof r[a[1]] == "string" || Array.isArray(r[a[1]])) {
|
|
1650
|
-
let i = r[a[1]];
|
|
1651
|
-
r[a[1]] = [...wu, ...Array.isArray(i) ? i : [i], o];
|
|
1652
|
-
} else
|
|
1653
|
-
r[a[1]] = o;
|
|
1654
|
-
}
|
|
1655
|
-
return { comments: u, pragmas: r };
|
|
1656
|
-
}
|
|
1657
|
-
function op({ comments: e = "", pragmas: t = {} }) {
|
|
1658
|
-
let n = `
|
|
1659
|
-
`, r = "/**", u = " *", a = " */", o = Object.keys(t), i = o.flatMap((l) => Tr(l, t[l])).map((l) => `${u} ${l}${n}`).join("");
|
|
1660
|
-
if (!e) {
|
|
1661
|
-
if (o.length === 0)
|
|
1662
|
-
return "";
|
|
1663
|
-
if (o.length === 1 && !Array.isArray(t[o[0]])) {
|
|
1664
|
-
let l = t[o[0]];
|
|
1665
|
-
return `${r} ${Tr(o[0], l)[0]}${a}`;
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
let s = e.split(n).map((l) => `${u} ${l}`).join(n) + n;
|
|
1669
|
-
return r + n + (e ? s : "") + (e && o.length > 0 ? u + n : "") + i + a;
|
|
1670
|
-
}
|
|
1671
|
-
function Tr(e, t) {
|
|
1672
|
-
return [...wu, ...Array.isArray(t) ? t : [t]].map((n) => `@${e} ${n}`.trim());
|
|
1673
|
-
}
|
|
1674
|
-
function ip(e) {
|
|
1675
|
-
if (!e.startsWith("#!"))
|
|
1676
|
-
return "";
|
|
1677
|
-
let t = e.indexOf(`
|
|
1678
|
-
`);
|
|
1679
|
-
return t === -1 ? e : e.slice(0, t);
|
|
1680
|
-
}
|
|
1681
|
-
var sp = ip;
|
|
1682
|
-
function pp(e) {
|
|
1683
|
-
let t = sp(e);
|
|
1684
|
-
t && (e = e.slice(t.length + 1));
|
|
1685
|
-
let n = rp(e), { pragmas: r, comments: u } = ap(n);
|
|
1686
|
-
return { shebang: t, text: e, pragmas: r, comments: u };
|
|
1687
|
-
}
|
|
1688
|
-
function lp(e) {
|
|
1689
|
-
let { shebang: t, text: n, pragmas: r, comments: u } = pp(e), a = up(n), o = op({ pragmas: { format: "", ...r }, comments: u.trimStart() });
|
|
1690
|
-
return (t ? `${t}
|
|
1691
|
-
` : "") + o + (a.startsWith(`
|
|
1692
|
-
`) ? `
|
|
1693
|
-
` : `
|
|
1694
|
-
|
|
1695
|
-
`) + a;
|
|
1696
|
-
}
|
|
1697
|
-
function cp(e, t) {
|
|
1698
|
-
let { originalText: n, [Symbol.for("comments")]: r, locStart: u, locEnd: a, [Symbol.for("printedComments")]: o } = t, { node: i } = e, s = u(i), l = a(i);
|
|
1699
|
-
for (let d of r)
|
|
1700
|
-
u(d) >= s && a(d) <= l && o.add(d);
|
|
1701
|
-
return n.slice(s, l);
|
|
1702
|
-
}
|
|
1703
|
-
var Dp = cp;
|
|
1704
|
-
function wn(e, t) {
|
|
1705
|
-
var n, r, u, a, o, i, s, l, d;
|
|
1706
|
-
if (e.isRoot)
|
|
1707
|
-
return !1;
|
|
1708
|
-
let { node: c, key: D, parent: p } = e;
|
|
1709
|
-
if (t.__isInHtmlInterpolation && !t.bracketSpacing && fp(c) && Bt(e))
|
|
1710
|
-
return !0;
|
|
1711
|
-
if (yp(c))
|
|
1712
|
-
return !1;
|
|
1713
|
-
if (c.type === "Identifier") {
|
|
1714
|
-
if ((n = c.extra) != null && n.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(c.name) || D === "left" && (c.name === "async" && !p.await || c.name === "let") && p.type === "ForOfStatement")
|
|
1715
|
-
return !0;
|
|
1716
|
-
if (c.name === "let") {
|
|
1717
|
-
let y = (r = e.findAncestor((E) => E.type === "ForOfStatement")) == null ? void 0 : r.left;
|
|
1718
|
-
if (y && ee(y, (E) => E === c))
|
|
1719
|
-
return !0;
|
|
1720
|
-
}
|
|
1721
|
-
if (D === "object" && c.name === "let" && p.type === "MemberExpression" && p.computed && !p.optional) {
|
|
1722
|
-
let y = e.findAncestor((g) => g.type === "ExpressionStatement" || g.type === "ForStatement" || g.type === "ForInStatement"), E = y ? y.type === "ExpressionStatement" ? y.expression : y.type === "ForStatement" ? y.init : y.left : void 0;
|
|
1723
|
-
if (E && ee(E, (g) => g === c))
|
|
1724
|
-
return !0;
|
|
1725
|
-
}
|
|
1726
|
-
if (D === "expression")
|
|
1727
|
-
switch (c.name) {
|
|
1728
|
-
case "await":
|
|
1729
|
-
case "interface":
|
|
1730
|
-
case "module":
|
|
1731
|
-
case "using":
|
|
1732
|
-
case "yield":
|
|
1733
|
-
case "let":
|
|
1734
|
-
case "component":
|
|
1735
|
-
case "hook":
|
|
1736
|
-
case "type": {
|
|
1737
|
-
let y = e.findAncestor((E) => !xe(E));
|
|
1738
|
-
if (y !== p && y.type === "ExpressionStatement")
|
|
1739
|
-
return !0;
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
return !1;
|
|
1743
|
-
}
|
|
1744
|
-
if (c.type === "ObjectExpression" || c.type === "FunctionExpression" || c.type === "ClassExpression" || c.type === "DoExpression") {
|
|
1745
|
-
let y = (u = e.findAncestor((E) => E.type === "ExpressionStatement")) == null ? void 0 : u.expression;
|
|
1746
|
-
if (y && ee(y, (E) => E === c))
|
|
1747
|
-
return !0;
|
|
1748
|
-
}
|
|
1749
|
-
if (c.type === "ObjectExpression") {
|
|
1750
|
-
let y = (a = e.findAncestor((E) => E.type === "ArrowFunctionExpression")) == null ? void 0 : a.body;
|
|
1751
|
-
if (y && y.type !== "SequenceExpression" && y.type !== "AssignmentExpression" && ee(y, (E) => E === c))
|
|
1752
|
-
return !0;
|
|
1753
|
-
}
|
|
1754
|
-
switch (p.type) {
|
|
1755
|
-
case "ParenthesizedExpression":
|
|
1756
|
-
return !1;
|
|
1757
|
-
case "ClassDeclaration":
|
|
1758
|
-
case "ClassExpression":
|
|
1759
|
-
if (D === "superClass" && (c.type === "ArrowFunctionExpression" || c.type === "AssignmentExpression" || c.type === "AwaitExpression" || c.type === "BinaryExpression" || c.type === "ConditionalExpression" || c.type === "LogicalExpression" || c.type === "NewExpression" || c.type === "ObjectExpression" || c.type === "SequenceExpression" || c.type === "TaggedTemplateExpression" || c.type === "UnaryExpression" || c.type === "UpdateExpression" || c.type === "YieldExpression" || c.type === "TSNonNullExpression" || c.type === "ClassExpression" && O(c.decorators)))
|
|
1760
|
-
return !0;
|
|
1761
|
-
break;
|
|
1762
|
-
case "ExportDefaultDeclaration":
|
|
1763
|
-
return Nu(e, t) || c.type === "SequenceExpression";
|
|
1764
|
-
case "Decorator":
|
|
1765
|
-
if (D === "expression" && !Fp(c))
|
|
1766
|
-
return !0;
|
|
1767
|
-
break;
|
|
1768
|
-
case "TypeAnnotation":
|
|
1769
|
-
if (e.match(void 0, void 0, (y, E) => E === "returnType" && y.type === "ArrowFunctionExpression") && mp(c))
|
|
1770
|
-
return !0;
|
|
1771
|
-
break;
|
|
1772
|
-
case "BinaryExpression":
|
|
1773
|
-
if (D === "left" && (p.operator === "in" || p.operator === "instanceof") && c.type === "UnaryExpression")
|
|
1774
|
-
return !0;
|
|
1775
|
-
break;
|
|
1776
|
-
case "VariableDeclarator":
|
|
1777
|
-
if (D === "init" && e.match(void 0, void 0, (y, E) => E === "declarations" && y.type === "VariableDeclaration", (y, E) => E === "left" && y.type === "ForInStatement"))
|
|
1778
|
-
return !0;
|
|
1779
|
-
break;
|
|
1780
|
-
}
|
|
1781
|
-
switch (c.type) {
|
|
1782
|
-
case "UpdateExpression":
|
|
1783
|
-
if (p.type === "UnaryExpression")
|
|
1784
|
-
return c.prefix && (c.operator === "++" && p.operator === "+" || c.operator === "--" && p.operator === "-");
|
|
1785
|
-
case "UnaryExpression":
|
|
1786
|
-
switch (p.type) {
|
|
1787
|
-
case "UnaryExpression":
|
|
1788
|
-
return c.operator === p.operator && (c.operator === "+" || c.operator === "-");
|
|
1789
|
-
case "BindExpression":
|
|
1790
|
-
return !0;
|
|
1791
|
-
case "MemberExpression":
|
|
1792
|
-
case "OptionalMemberExpression":
|
|
1793
|
-
return D === "object";
|
|
1794
|
-
case "TaggedTemplateExpression":
|
|
1795
|
-
return !0;
|
|
1796
|
-
case "NewExpression":
|
|
1797
|
-
case "CallExpression":
|
|
1798
|
-
case "OptionalCallExpression":
|
|
1799
|
-
return D === "callee";
|
|
1800
|
-
case "BinaryExpression":
|
|
1801
|
-
return D === "left" && p.operator === "**";
|
|
1802
|
-
case "TSNonNullExpression":
|
|
1803
|
-
return !0;
|
|
1804
|
-
default:
|
|
1805
|
-
return !1;
|
|
1806
|
-
}
|
|
1807
|
-
case "BinaryExpression":
|
|
1808
|
-
if (p.type === "UpdateExpression" || c.operator === "in" && dp(e))
|
|
1809
|
-
return !0;
|
|
1810
|
-
if (c.operator === "|>" && (o = c.extra) != null && o.parenthesized) {
|
|
1811
|
-
let y = e.grandparent;
|
|
1812
|
-
if (y.type === "BinaryExpression" && y.operator === "|>")
|
|
1813
|
-
return !0;
|
|
1814
|
-
}
|
|
1815
|
-
case "TSTypeAssertion":
|
|
1816
|
-
case "TSAsExpression":
|
|
1817
|
-
case "TSSatisfiesExpression":
|
|
1818
|
-
case "AsExpression":
|
|
1819
|
-
case "AsConstExpression":
|
|
1820
|
-
case "SatisfiesExpression":
|
|
1821
|
-
case "LogicalExpression":
|
|
1822
|
-
switch (p.type) {
|
|
1823
|
-
case "TSAsExpression":
|
|
1824
|
-
case "TSSatisfiesExpression":
|
|
1825
|
-
case "AsExpression":
|
|
1826
|
-
case "AsConstExpression":
|
|
1827
|
-
case "SatisfiesExpression":
|
|
1828
|
-
return !xe(c);
|
|
1829
|
-
case "ConditionalExpression":
|
|
1830
|
-
return xe(c) || Uo(c);
|
|
1831
|
-
case "CallExpression":
|
|
1832
|
-
case "NewExpression":
|
|
1833
|
-
case "OptionalCallExpression":
|
|
1834
|
-
return D === "callee";
|
|
1835
|
-
case "ClassExpression":
|
|
1836
|
-
case "ClassDeclaration":
|
|
1837
|
-
return D === "superClass";
|
|
1838
|
-
case "TSTypeAssertion":
|
|
1839
|
-
case "TaggedTemplateExpression":
|
|
1840
|
-
case "UnaryExpression":
|
|
1841
|
-
case "JSXSpreadAttribute":
|
|
1842
|
-
case "SpreadElement":
|
|
1843
|
-
case "BindExpression":
|
|
1844
|
-
case "AwaitExpression":
|
|
1845
|
-
case "TSNonNullExpression":
|
|
1846
|
-
case "UpdateExpression":
|
|
1847
|
-
return !0;
|
|
1848
|
-
case "MemberExpression":
|
|
1849
|
-
case "OptionalMemberExpression":
|
|
1850
|
-
return D === "object";
|
|
1851
|
-
case "AssignmentExpression":
|
|
1852
|
-
case "AssignmentPattern":
|
|
1853
|
-
return D === "left" && (c.type === "TSTypeAssertion" || xe(c));
|
|
1854
|
-
case "LogicalExpression":
|
|
1855
|
-
if (c.type === "LogicalExpression")
|
|
1856
|
-
return p.operator !== c.operator;
|
|
1857
|
-
case "BinaryExpression": {
|
|
1858
|
-
let { operator: y, type: E } = c;
|
|
1859
|
-
if (!y && E !== "TSTypeAssertion")
|
|
1860
|
-
return !0;
|
|
1861
|
-
let g = Ht(y), S = p.operator, B = Ht(S);
|
|
1862
|
-
return B > g || D === "right" && B === g || B === g && !Vn(S, y) ? !0 : B < g && y === "%" ? S === "+" || S === "-" : !!ui(S);
|
|
1863
|
-
}
|
|
1864
|
-
default:
|
|
1865
|
-
return !1;
|
|
1866
|
-
}
|
|
1867
|
-
case "SequenceExpression":
|
|
1868
|
-
switch (p.type) {
|
|
1869
|
-
case "ReturnStatement":
|
|
1870
|
-
return !1;
|
|
1871
|
-
case "ForStatement":
|
|
1872
|
-
return !1;
|
|
1873
|
-
case "ExpressionStatement":
|
|
1874
|
-
return D !== "expression";
|
|
1875
|
-
case "ArrowFunctionExpression":
|
|
1876
|
-
return D !== "body";
|
|
1877
|
-
default:
|
|
1878
|
-
return !0;
|
|
1879
|
-
}
|
|
1880
|
-
case "YieldExpression":
|
|
1881
|
-
if (p.type === "AwaitExpression" || p.type === "TSTypeAssertion")
|
|
1882
|
-
return !0;
|
|
1883
|
-
case "AwaitExpression":
|
|
1884
|
-
switch (p.type) {
|
|
1885
|
-
case "TaggedTemplateExpression":
|
|
1886
|
-
case "UnaryExpression":
|
|
1887
|
-
case "LogicalExpression":
|
|
1888
|
-
case "SpreadElement":
|
|
1889
|
-
case "TSAsExpression":
|
|
1890
|
-
case "TSSatisfiesExpression":
|
|
1891
|
-
case "TSNonNullExpression":
|
|
1892
|
-
case "AsExpression":
|
|
1893
|
-
case "AsConstExpression":
|
|
1894
|
-
case "SatisfiesExpression":
|
|
1895
|
-
case "BindExpression":
|
|
1896
|
-
return !0;
|
|
1897
|
-
case "MemberExpression":
|
|
1898
|
-
case "OptionalMemberExpression":
|
|
1899
|
-
return D === "object";
|
|
1900
|
-
case "NewExpression":
|
|
1901
|
-
case "CallExpression":
|
|
1902
|
-
case "OptionalCallExpression":
|
|
1903
|
-
return D === "callee";
|
|
1904
|
-
case "ConditionalExpression":
|
|
1905
|
-
return D === "test";
|
|
1906
|
-
case "BinaryExpression":
|
|
1907
|
-
return !(!c.argument && p.operator === "|>");
|
|
1908
|
-
default:
|
|
1909
|
-
return !1;
|
|
1910
|
-
}
|
|
1911
|
-
case "TSFunctionType":
|
|
1912
|
-
if (e.match((y) => y.type === "TSFunctionType", (y, E) => E === "typeAnnotation" && y.type === "TSTypeAnnotation", (y, E) => E === "returnType" && y.type === "ArrowFunctionExpression"))
|
|
1913
|
-
return !0;
|
|
1914
|
-
case "TSConditionalType":
|
|
1915
|
-
case "TSConstructorType":
|
|
1916
|
-
case "ConditionalTypeAnnotation":
|
|
1917
|
-
if (D === "extendsType" && Xe(c) && p.type === c.type || D === "checkType" && Xe(p))
|
|
1918
|
-
return !0;
|
|
1919
|
-
if (D === "extendsType" && p.type === "TSConditionalType") {
|
|
1920
|
-
let { typeAnnotation: y } = c.returnType || c.typeAnnotation;
|
|
1921
|
-
if (y.type === "TSTypePredicate" && y.typeAnnotation && (y = y.typeAnnotation.typeAnnotation), y.type === "TSInferType" && y.typeParameter.constraint)
|
|
1922
|
-
return !0;
|
|
1923
|
-
}
|
|
1924
|
-
case "TSUnionType":
|
|
1925
|
-
case "TSIntersectionType":
|
|
1926
|
-
if ((_e(p) || Kn(p)) && p.types.length > 1 && (!c.types || c.types.length > 1))
|
|
1927
|
-
return !0;
|
|
1928
|
-
case "TSInferType":
|
|
1929
|
-
if (c.type === "TSInferType") {
|
|
1930
|
-
if (p.type === "TSRestType")
|
|
1931
|
-
return !1;
|
|
1932
|
-
if (D === "types" && (p.type === "TSUnionType" || p.type === "TSIntersectionType") && c.typeParameter.type === "TSTypeParameter" && c.typeParameter.constraint)
|
|
1933
|
-
return !0;
|
|
1934
|
-
}
|
|
1935
|
-
case "TSTypeOperator":
|
|
1936
|
-
return p.type === "TSArrayType" || p.type === "TSOptionalType" || p.type === "TSRestType" || D === "objectType" && p.type === "TSIndexedAccessType" || p.type === "TSTypeOperator" || p.type === "TSTypeAnnotation" && e.grandparent.type.startsWith("TSJSDoc");
|
|
1937
|
-
case "TSTypeQuery":
|
|
1938
|
-
return D === "objectType" && p.type === "TSIndexedAccessType" || D === "elementType" && p.type === "TSArrayType";
|
|
1939
|
-
case "TypeOperator":
|
|
1940
|
-
return p.type === "ArrayTypeAnnotation" || p.type === "NullableTypeAnnotation" || D === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType") || p.type === "TypeOperator";
|
|
1941
|
-
case "TypeofTypeAnnotation":
|
|
1942
|
-
return D === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType") || D === "elementType" && p.type === "ArrayTypeAnnotation";
|
|
1943
|
-
case "ArrayTypeAnnotation":
|
|
1944
|
-
return p.type === "NullableTypeAnnotation";
|
|
1945
|
-
case "IntersectionTypeAnnotation":
|
|
1946
|
-
case "UnionTypeAnnotation":
|
|
1947
|
-
return p.type === "TypeOperator" || p.type === "ArrayTypeAnnotation" || p.type === "NullableTypeAnnotation" || p.type === "IntersectionTypeAnnotation" || p.type === "UnionTypeAnnotation" || D === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType");
|
|
1948
|
-
case "InferTypeAnnotation":
|
|
1949
|
-
case "NullableTypeAnnotation":
|
|
1950
|
-
return p.type === "ArrayTypeAnnotation" || D === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType");
|
|
1951
|
-
case "ComponentTypeAnnotation":
|
|
1952
|
-
case "FunctionTypeAnnotation": {
|
|
1953
|
-
if (c.type === "ComponentTypeAnnotation" && (c.rendersType === null || c.rendersType === void 0))
|
|
1954
|
-
return !1;
|
|
1955
|
-
if (e.match(void 0, (E, g) => g === "typeAnnotation" && E.type === "TypeAnnotation", (E, g) => g === "returnType" && E.type === "ArrowFunctionExpression") || e.match(void 0, (E, g) => g === "typeAnnotation" && E.type === "TypePredicate", (E, g) => g === "typeAnnotation" && E.type === "TypeAnnotation", (E, g) => g === "returnType" && E.type === "ArrowFunctionExpression"))
|
|
1956
|
-
return !0;
|
|
1957
|
-
let y = p.type === "NullableTypeAnnotation" ? e.grandparent : p;
|
|
1958
|
-
return y.type === "UnionTypeAnnotation" || y.type === "IntersectionTypeAnnotation" || y.type === "ArrayTypeAnnotation" || D === "objectType" && (y.type === "IndexedAccessType" || y.type === "OptionalIndexedAccessType") || D === "checkType" && p.type === "ConditionalTypeAnnotation" || D === "extendsType" && p.type === "ConditionalTypeAnnotation" && ((i = c.returnType) == null ? void 0 : i.type) === "InferTypeAnnotation" && ((s = c.returnType) == null ? void 0 : s.typeParameter.bound) || y.type === "NullableTypeAnnotation" || p.type === "FunctionTypeParam" && p.name === null && Z(c).some((E) => {
|
|
1959
|
-
var g;
|
|
1960
|
-
return ((g = E.typeAnnotation) == null ? void 0 : g.type) === "NullableTypeAnnotation";
|
|
1961
|
-
});
|
|
1962
|
-
}
|
|
1963
|
-
case "OptionalIndexedAccessType":
|
|
1964
|
-
return D === "objectType" && p.type === "IndexedAccessType";
|
|
1965
|
-
case "StringLiteral":
|
|
1966
|
-
case "NumericLiteral":
|
|
1967
|
-
case "Literal":
|
|
1968
|
-
if (typeof c.value == "string" && p.type === "ExpressionStatement" && !p.directive) {
|
|
1969
|
-
let y = e.grandparent;
|
|
1970
|
-
return y.type === "Program" || y.type === "BlockStatement";
|
|
1971
|
-
}
|
|
1972
|
-
return D === "object" && p.type === "MemberExpression" && typeof c.value == "number";
|
|
1973
|
-
case "AssignmentExpression": {
|
|
1974
|
-
let y = e.grandparent;
|
|
1975
|
-
return D === "body" && p.type === "ArrowFunctionExpression" ? !0 : D === "key" && (p.type === "ClassProperty" || p.type === "PropertyDefinition") && p.computed || (D === "init" || D === "update") && p.type === "ForStatement" ? !1 : p.type === "ExpressionStatement" ? c.left.type === "ObjectPattern" : !(D === "key" && p.type === "TSPropertySignature" || p.type === "AssignmentExpression" || p.type === "SequenceExpression" && y.type === "ForStatement" && (y.init === p || y.update === p) || D === "value" && p.type === "Property" && y.type === "ObjectPattern" && y.properties.includes(p) || p.type === "NGChainedExpression" || D === "node" && p.type === "JsExpressionRoot");
|
|
1976
|
-
}
|
|
1977
|
-
case "ConditionalExpression":
|
|
1978
|
-
switch (p.type) {
|
|
1979
|
-
case "TaggedTemplateExpression":
|
|
1980
|
-
case "UnaryExpression":
|
|
1981
|
-
case "SpreadElement":
|
|
1982
|
-
case "BinaryExpression":
|
|
1983
|
-
case "LogicalExpression":
|
|
1984
|
-
case "NGPipeExpression":
|
|
1985
|
-
case "ExportDefaultDeclaration":
|
|
1986
|
-
case "AwaitExpression":
|
|
1987
|
-
case "JSXSpreadAttribute":
|
|
1988
|
-
case "TSTypeAssertion":
|
|
1989
|
-
case "TypeCastExpression":
|
|
1990
|
-
case "TSAsExpression":
|
|
1991
|
-
case "TSSatisfiesExpression":
|
|
1992
|
-
case "AsExpression":
|
|
1993
|
-
case "AsConstExpression":
|
|
1994
|
-
case "SatisfiesExpression":
|
|
1995
|
-
case "TSNonNullExpression":
|
|
1996
|
-
return !0;
|
|
1997
|
-
case "NewExpression":
|
|
1998
|
-
case "CallExpression":
|
|
1999
|
-
case "OptionalCallExpression":
|
|
2000
|
-
return D === "callee";
|
|
2001
|
-
case "ConditionalExpression":
|
|
2002
|
-
return t.experimentalTernaries ? !1 : D === "test";
|
|
2003
|
-
case "MemberExpression":
|
|
2004
|
-
case "OptionalMemberExpression":
|
|
2005
|
-
return D === "object";
|
|
2006
|
-
default:
|
|
2007
|
-
return !1;
|
|
2008
|
-
}
|
|
2009
|
-
case "FunctionExpression":
|
|
2010
|
-
switch (p.type) {
|
|
2011
|
-
case "NewExpression":
|
|
2012
|
-
case "CallExpression":
|
|
2013
|
-
case "OptionalCallExpression":
|
|
2014
|
-
return D === "callee";
|
|
2015
|
-
case "TaggedTemplateExpression":
|
|
2016
|
-
return !0;
|
|
2017
|
-
default:
|
|
2018
|
-
return !1;
|
|
2019
|
-
}
|
|
2020
|
-
case "ArrowFunctionExpression":
|
|
2021
|
-
switch (p.type) {
|
|
2022
|
-
case "BinaryExpression":
|
|
2023
|
-
return p.operator !== "|>" || ((l = c.extra) == null ? void 0 : l.parenthesized);
|
|
2024
|
-
case "NewExpression":
|
|
2025
|
-
case "CallExpression":
|
|
2026
|
-
case "OptionalCallExpression":
|
|
2027
|
-
return D === "callee";
|
|
2028
|
-
case "MemberExpression":
|
|
2029
|
-
case "OptionalMemberExpression":
|
|
2030
|
-
return D === "object";
|
|
2031
|
-
case "TSAsExpression":
|
|
2032
|
-
case "TSSatisfiesExpression":
|
|
2033
|
-
case "AsExpression":
|
|
2034
|
-
case "AsConstExpression":
|
|
2035
|
-
case "SatisfiesExpression":
|
|
2036
|
-
case "TSNonNullExpression":
|
|
2037
|
-
case "BindExpression":
|
|
2038
|
-
case "TaggedTemplateExpression":
|
|
2039
|
-
case "UnaryExpression":
|
|
2040
|
-
case "LogicalExpression":
|
|
2041
|
-
case "AwaitExpression":
|
|
2042
|
-
case "TSTypeAssertion":
|
|
2043
|
-
return !0;
|
|
2044
|
-
case "ConditionalExpression":
|
|
2045
|
-
return D === "test";
|
|
2046
|
-
default:
|
|
2047
|
-
return !1;
|
|
2048
|
-
}
|
|
2049
|
-
case "ClassExpression":
|
|
2050
|
-
switch (p.type) {
|
|
2051
|
-
case "NewExpression":
|
|
2052
|
-
return D === "callee";
|
|
2053
|
-
default:
|
|
2054
|
-
return !1;
|
|
2055
|
-
}
|
|
2056
|
-
case "OptionalMemberExpression":
|
|
2057
|
-
case "OptionalCallExpression":
|
|
2058
|
-
case "CallExpression":
|
|
2059
|
-
case "MemberExpression":
|
|
2060
|
-
if (Ep(e))
|
|
2061
|
-
return !0;
|
|
2062
|
-
case "TaggedTemplateExpression":
|
|
2063
|
-
case "TSNonNullExpression":
|
|
2064
|
-
if (D === "callee" && (p.type === "BindExpression" || p.type === "NewExpression")) {
|
|
2065
|
-
let y = c;
|
|
2066
|
-
for (; y; )
|
|
2067
|
-
switch (y.type) {
|
|
2068
|
-
case "CallExpression":
|
|
2069
|
-
case "OptionalCallExpression":
|
|
2070
|
-
return !0;
|
|
2071
|
-
case "MemberExpression":
|
|
2072
|
-
case "OptionalMemberExpression":
|
|
2073
|
-
case "BindExpression":
|
|
2074
|
-
y = y.object;
|
|
2075
|
-
break;
|
|
2076
|
-
case "TaggedTemplateExpression":
|
|
2077
|
-
y = y.tag;
|
|
2078
|
-
break;
|
|
2079
|
-
case "TSNonNullExpression":
|
|
2080
|
-
y = y.expression;
|
|
2081
|
-
break;
|
|
2082
|
-
default:
|
|
2083
|
-
return !1;
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
return !1;
|
|
2087
|
-
case "BindExpression":
|
|
2088
|
-
return D === "callee" && (p.type === "BindExpression" || p.type === "NewExpression") || D === "object" && U(p);
|
|
2089
|
-
case "NGPipeExpression":
|
|
2090
|
-
return !(p.type === "NGRoot" || p.type === "NGMicrosyntaxExpression" || p.type === "ObjectProperty" && !((d = c.extra) != null && d.parenthesized) || Q(p) || D === "arguments" && L(p) || D === "right" && p.type === "NGPipeExpression" || D === "property" && p.type === "MemberExpression" || p.type === "AssignmentExpression");
|
|
2091
|
-
case "JSXFragment":
|
|
2092
|
-
case "JSXElement":
|
|
2093
|
-
return D === "callee" || D === "left" && p.type === "BinaryExpression" && p.operator === "<" || !Q(p) && p.type !== "ArrowFunctionExpression" && p.type !== "AssignmentExpression" && p.type !== "AssignmentPattern" && p.type !== "BinaryExpression" && p.type !== "NewExpression" && p.type !== "ConditionalExpression" && p.type !== "ExpressionStatement" && p.type !== "JsExpressionRoot" && p.type !== "JSXAttribute" && p.type !== "JSXElement" && p.type !== "JSXExpressionContainer" && p.type !== "JSXFragment" && p.type !== "LogicalExpression" && !L(p) && !Ne(p) && p.type !== "ReturnStatement" && p.type !== "ThrowStatement" && p.type !== "TypeCastExpression" && p.type !== "VariableDeclarator" && p.type !== "YieldExpression";
|
|
2094
|
-
case "TSInstantiationExpression":
|
|
2095
|
-
return D === "object" && U(p);
|
|
2096
|
-
}
|
|
2097
|
-
return !1;
|
|
2098
|
-
}
|
|
2099
|
-
var yp = J(["BlockStatement", "BreakStatement", "ComponentDeclaration", "ClassBody", "ClassDeclaration", "ClassMethod", "ClassProperty", "PropertyDefinition", "ClassPrivateProperty", "ContinueStatement", "DebuggerStatement", "DeclareComponent", "DeclareClass", "DeclareExportAllDeclaration", "DeclareExportDeclaration", "DeclareFunction", "DeclareHook", "DeclareInterface", "DeclareModule", "DeclareModuleExports", "DeclareNamespace", "DeclareVariable", "DeclareEnum", "DoWhileStatement", "EnumDeclaration", "ExportAllDeclaration", "ExportDefaultDeclaration", "ExportNamedDeclaration", "ExpressionStatement", "ForInStatement", "ForOfStatement", "ForStatement", "FunctionDeclaration", "HookDeclaration", "IfStatement", "ImportDeclaration", "InterfaceDeclaration", "LabeledStatement", "MethodDefinition", "ReturnStatement", "SwitchStatement", "ThrowStatement", "TryStatement", "TSDeclareFunction", "TSEnumDeclaration", "TSImportEqualsDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSNamespaceExportDeclaration", "TypeAlias", "VariableDeclaration", "WhileStatement", "WithStatement"]);
|
|
2100
|
-
function dp(e) {
|
|
2101
|
-
let t = 0, { node: n } = e;
|
|
2102
|
-
for (; n; ) {
|
|
2103
|
-
let r = e.getParentNode(t++);
|
|
2104
|
-
if ((r == null ? void 0 : r.type) === "ForStatement" && r.init === n)
|
|
2105
|
-
return !0;
|
|
2106
|
-
n = r;
|
|
2107
|
-
}
|
|
2108
|
-
return !1;
|
|
2109
|
-
}
|
|
2110
|
-
function mp(e) {
|
|
2111
|
-
return hn(e, (t) => t.type === "ObjectTypeAnnotation" && hn(t, (n) => n.type === "FunctionTypeAnnotation"));
|
|
2112
|
-
}
|
|
2113
|
-
function fp(e) {
|
|
2114
|
-
return Fe(e);
|
|
2115
|
-
}
|
|
2116
|
-
function Bt(e) {
|
|
2117
|
-
let { parent: t, key: n } = e;
|
|
2118
|
-
switch (t.type) {
|
|
2119
|
-
case "NGPipeExpression":
|
|
2120
|
-
if (n === "arguments" && e.isLast)
|
|
2121
|
-
return e.callParent(Bt);
|
|
2122
|
-
break;
|
|
2123
|
-
case "ObjectProperty":
|
|
2124
|
-
if (n === "value")
|
|
2125
|
-
return e.callParent(() => e.key === "properties" && e.isLast);
|
|
2126
|
-
break;
|
|
2127
|
-
case "BinaryExpression":
|
|
2128
|
-
case "LogicalExpression":
|
|
2129
|
-
if (n === "right")
|
|
2130
|
-
return e.callParent(Bt);
|
|
2131
|
-
break;
|
|
2132
|
-
case "ConditionalExpression":
|
|
2133
|
-
if (n === "alternate")
|
|
2134
|
-
return e.callParent(Bt);
|
|
2135
|
-
break;
|
|
2136
|
-
case "UnaryExpression":
|
|
2137
|
-
if (t.prefix)
|
|
2138
|
-
return e.callParent(Bt);
|
|
2139
|
-
break;
|
|
2140
|
-
}
|
|
2141
|
-
return !1;
|
|
2142
|
-
}
|
|
2143
|
-
function Nu(e, t) {
|
|
2144
|
-
let { node: n, parent: r } = e;
|
|
2145
|
-
return n.type === "FunctionExpression" || n.type === "ClassExpression" ? r.type === "ExportDefaultDeclaration" || !wn(e, t) : !$n(n) || r.type !== "ExportDefaultDeclaration" && wn(e, t) ? !1 : e.call(() => Nu(e, t), ...Kr(n));
|
|
2146
|
-
}
|
|
2147
|
-
function Ep(e) {
|
|
2148
|
-
return !!(e.match(void 0, (t, n) => n === "expression" && t.type === "ChainExpression", (t, n) => n === "tag" && t.type === "TaggedTemplateExpression") || e.match((t) => t.type === "OptionalCallExpression" || t.type === "OptionalMemberExpression", (t, n) => n === "tag" && t.type === "TaggedTemplateExpression") || e.match((t) => t.type === "OptionalCallExpression" || t.type === "OptionalMemberExpression", (t, n) => n === "expression" && t.type === "TSNonNullExpression", (t, n) => n === "tag" && t.type === "TaggedTemplateExpression") || e.match(void 0, (t, n) => n === "expression" && t.type === "ChainExpression", (t, n) => n === "expression" && t.type === "TSNonNullExpression", (t, n) => n === "tag" && t.type === "TaggedTemplateExpression") || e.match(void 0, (t, n) => n === "expression" && t.type === "TSNonNullExpression", (t, n) => n === "expression" && t.type === "ChainExpression", (t, n) => n === "tag" && t.type === "TaggedTemplateExpression") || e.match((t) => t.type === "OptionalMemberExpression" || t.type === "OptionalCallExpression", (t, n) => n === "object" && t.type === "MemberExpression" || n === "callee" && (t.type === "CallExpression" || t.type === "NewExpression")) || e.match((t) => t.type === "OptionalMemberExpression" || t.type === "OptionalCallExpression", (t, n) => n === "expression" && t.type === "TSNonNullExpression", (t, n) => n === "object" && t.type === "MemberExpression" || n === "callee" && t.type === "CallExpression") || e.match((t) => t.type === "CallExpression" || t.type === "MemberExpression", (t, n) => n === "expression" && t.type === "ChainExpression") && (e.match(void 0, void 0, (t, n) => n === "callee" && (t.type === "CallExpression" && !t.optional || t.type === "NewExpression") || n === "object" && t.type === "MemberExpression" && !t.optional) || e.match(void 0, void 0, (t, n) => n === "expression" && t.type === "TSNonNullExpression", (t, n) => n === "object" && t.type === "MemberExpression" || n === "callee" && t.type === "CallExpression")) || e.match((t) => t.type === "CallExpression" || t.type === "MemberExpression", (t, n) => n === "expression" && t.type === "TSNonNullExpression", (t, n) => n === "expression" && t.type === "ChainExpression", (t, n) => n === "object" && t.type === "MemberExpression" || n === "callee" && t.type === "CallExpression"));
|
|
2149
|
-
}
|
|
2150
|
-
function Nn(e) {
|
|
2151
|
-
return e.type === "Identifier" ? !0 : U(e) ? !e.computed && !e.optional && e.property.type === "Identifier" && Nn(e.object) : !1;
|
|
2152
|
-
}
|
|
2153
|
-
function Fp(e) {
|
|
2154
|
-
return e.type === "ChainExpression" && (e = e.expression), Nn(e) || L(e) && !e.optional && Nn(e.callee);
|
|
2155
|
-
}
|
|
2156
|
-
var ut = wn;
|
|
2157
|
-
function Ap(e, t) {
|
|
2158
|
-
let n = t - 1;
|
|
2159
|
-
n = Dt(e, n, { backwards: !0 }), n = yt(e, n, { backwards: !0 }), n = Dt(e, n, { backwards: !0 });
|
|
2160
|
-
let r = yt(e, n, { backwards: !0 });
|
|
2161
|
-
return n !== r;
|
|
2162
|
-
}
|
|
2163
|
-
var gp = Ap, xp = () => !0;
|
|
2164
|
-
function rr(e, t) {
|
|
2165
|
-
let n = e.node;
|
|
2166
|
-
return n.printed = !0, t.printer.printComment(e, t);
|
|
2167
|
-
}
|
|
2168
|
-
function hp(e, t) {
|
|
2169
|
-
var n;
|
|
2170
|
-
let r = e.node, u = [rr(e, t)], { printer: a, originalText: o, locStart: i, locEnd: s } = t;
|
|
2171
|
-
if ((n = a.isBlockComment) != null && n.call(a, r)) {
|
|
2172
|
-
let d = se(o, s(r)) ? se(o, i(r), { backwards: !0 }) ? F : C : " ";
|
|
2173
|
-
u.push(d);
|
|
2174
|
-
} else
|
|
2175
|
-
u.push(F);
|
|
2176
|
-
let l = yt(o, Dt(o, s(r)));
|
|
2177
|
-
return l !== !1 && se(o, l) && u.push(F), u;
|
|
2178
|
-
}
|
|
2179
|
-
function Cp(e, t, n) {
|
|
2180
|
-
var r;
|
|
2181
|
-
let u = e.node, a = rr(e, t), { printer: o, originalText: i, locStart: s } = t, l = (r = o.isBlockComment) == null ? void 0 : r.call(o, u);
|
|
2182
|
-
if (n != null && n.hasLineSuffix && !(n != null && n.isBlock) || se(i, s(u), { backwards: !0 })) {
|
|
2183
|
-
let d = gp(i, s(u));
|
|
2184
|
-
return { doc: gr([F, d ? F : "", a]), isBlock: l, hasLineSuffix: !0 };
|
|
2185
|
-
}
|
|
2186
|
-
return !l || n != null && n.hasLineSuffix ? { doc: [gr([" ", a]), Te], isBlock: l, hasLineSuffix: !0 } : { doc: [" ", a], isBlock: l, hasLineSuffix: !1 };
|
|
2187
|
-
}
|
|
2188
|
-
function R(e, t, n = {}) {
|
|
2189
|
-
let { node: r } = e;
|
|
2190
|
-
if (!O(r == null ? void 0 : r.comments))
|
|
2191
|
-
return "";
|
|
2192
|
-
let { indent: u = !1, marker: a, filter: o = xp } = n, i = [];
|
|
2193
|
-
if (e.each(({ node: l }) => {
|
|
2194
|
-
l.leading || l.trailing || l.marker !== a || !o(l) || i.push(rr(e, t));
|
|
2195
|
-
}, "comments"), i.length === 0)
|
|
2196
|
-
return "";
|
|
2197
|
-
let s = I(F, i);
|
|
2198
|
-
return u ? A([F, s]) : s;
|
|
2199
|
-
}
|
|
2200
|
-
function Iu(e, t) {
|
|
2201
|
-
let n = e.node;
|
|
2202
|
-
if (!n)
|
|
2203
|
-
return {};
|
|
2204
|
-
let r = t[Symbol.for("printedComments")];
|
|
2205
|
-
if ((n.comments || []).filter((i) => !r.has(i)).length === 0)
|
|
2206
|
-
return { leading: "", trailing: "" };
|
|
2207
|
-
let u = [], a = [], o;
|
|
2208
|
-
return e.each(() => {
|
|
2209
|
-
let i = e.node;
|
|
2210
|
-
if (r != null && r.has(i))
|
|
2211
|
-
return;
|
|
2212
|
-
let { leading: s, trailing: l } = i;
|
|
2213
|
-
s ? u.push(hp(e, t)) : l && (o = Cp(e, t, o), a.push(o.doc));
|
|
2214
|
-
}, "comments"), { leading: u, trailing: a };
|
|
2215
|
-
}
|
|
2216
|
-
function Ee(e, t, n) {
|
|
2217
|
-
let { leading: r, trailing: u } = Iu(e, n);
|
|
2218
|
-
return !r && !u ? t : Sn(t, (a) => [r, a, u]);
|
|
2219
|
-
}
|
|
2220
|
-
var Tp = class extends Error {
|
|
2221
|
-
constructor(t, n, r = "type") {
|
|
2222
|
-
super(`Unexpected ${n} node ${r}: ${JSON.stringify(t[r])}.`);
|
|
2223
|
-
_t(this, "name", "UnexpectedNodeError");
|
|
2224
|
-
this.node = t;
|
|
2225
|
-
}
|
|
2226
|
-
}, xt = Tp;
|
|
2227
|
-
function Sp(e) {
|
|
2228
|
-
if (typeof e != "string")
|
|
2229
|
-
throw new TypeError("Expected a string");
|
|
2230
|
-
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2231
|
-
}
|
|
2232
|
-
var me, bp = class {
|
|
2233
|
-
constructor(e) {
|
|
2234
|
-
eo(this, me), to(this, me, new Set(e));
|
|
2235
|
-
}
|
|
2236
|
-
getLeadingWhitespaceCount(e) {
|
|
2237
|
-
let t = Le(this, me), n = 0;
|
|
2238
|
-
for (let r = 0; r < e.length && t.has(e.charAt(r)); r++)
|
|
2239
|
-
n++;
|
|
2240
|
-
return n;
|
|
2241
|
-
}
|
|
2242
|
-
getTrailingWhitespaceCount(e) {
|
|
2243
|
-
let t = Le(this, me), n = 0;
|
|
2244
|
-
for (let r = e.length - 1; r >= 0 && t.has(e.charAt(r)); r--)
|
|
2245
|
-
n++;
|
|
2246
|
-
return n;
|
|
2247
|
-
}
|
|
2248
|
-
getLeadingWhitespace(e) {
|
|
2249
|
-
let t = this.getLeadingWhitespaceCount(e);
|
|
2250
|
-
return e.slice(0, t);
|
|
2251
|
-
}
|
|
2252
|
-
getTrailingWhitespace(e) {
|
|
2253
|
-
let t = this.getTrailingWhitespaceCount(e);
|
|
2254
|
-
return e.slice(e.length - t);
|
|
2255
|
-
}
|
|
2256
|
-
hasLeadingWhitespace(e) {
|
|
2257
|
-
return Le(this, me).has(e.charAt(0));
|
|
2258
|
-
}
|
|
2259
|
-
hasTrailingWhitespace(e) {
|
|
2260
|
-
return Le(this, me).has(_(!1, e, -1));
|
|
2261
|
-
}
|
|
2262
|
-
trimStart(e) {
|
|
2263
|
-
let t = this.getLeadingWhitespaceCount(e);
|
|
2264
|
-
return e.slice(t);
|
|
2265
|
-
}
|
|
2266
|
-
trimEnd(e) {
|
|
2267
|
-
let t = this.getTrailingWhitespaceCount(e);
|
|
2268
|
-
return e.slice(0, e.length - t);
|
|
2269
|
-
}
|
|
2270
|
-
trim(e) {
|
|
2271
|
-
return this.trimEnd(this.trimStart(e));
|
|
2272
|
-
}
|
|
2273
|
-
split(e, t = !1) {
|
|
2274
|
-
let n = `[${Sp([...Le(this, me)].join(""))}]+`, r = new RegExp(t ? `(${n})` : n, "u");
|
|
2275
|
-
return e.split(r);
|
|
2276
|
-
}
|
|
2277
|
-
hasWhitespaceCharacter(e) {
|
|
2278
|
-
let t = Le(this, me);
|
|
2279
|
-
return Array.prototype.some.call(e, (n) => t.has(n));
|
|
2280
|
-
}
|
|
2281
|
-
hasNonWhitespaceCharacter(e) {
|
|
2282
|
-
let t = Le(this, me);
|
|
2283
|
-
return Array.prototype.some.call(e, (n) => !t.has(n));
|
|
2284
|
-
}
|
|
2285
|
-
isWhitespaceOnly(e) {
|
|
2286
|
-
let t = Le(this, me);
|
|
2287
|
-
return Array.prototype.every.call(e, (n) => t.has(n));
|
|
2288
|
-
}
|
|
2289
|
-
};
|
|
2290
|
-
me = /* @__PURE__ */ new WeakMap();
|
|
2291
|
-
var Bp = bp, Gt = new Bp(`
|
|
2292
|
-
\r `), fn = (e) => e === "" || e === C || e === F || e === f;
|
|
2293
|
-
function vp(e, t, n) {
|
|
2294
|
-
var r, u, a, o, i;
|
|
2295
|
-
let { node: s } = e;
|
|
2296
|
-
if (s.type === "JSXElement" && $p(s))
|
|
2297
|
-
return [n("openingElement"), n("closingElement")];
|
|
2298
|
-
let l = s.type === "JSXElement" ? n("openingElement") : n("openingFragment"), d = s.type === "JSXElement" ? n("closingElement") : n("closingFragment");
|
|
2299
|
-
if (s.children.length === 1 && s.children[0].type === "JSXExpressionContainer" && (s.children[0].expression.type === "TemplateLiteral" || s.children[0].expression.type === "TaggedTemplateExpression"))
|
|
2300
|
-
return [l, ...e.map(n, "children"), d];
|
|
2301
|
-
s.children = s.children.map((k) => Wp(k) ? { type: "JSXText", value: " ", raw: " " } : k);
|
|
2302
|
-
let c = s.children.some(K), D = s.children.filter((k) => k.type === "JSXExpressionContainer").length > 1, p = s.type === "JSXElement" && s.openingElement.attributes.length > 1, y = te(l) || c || p || D, E = e.parent.rootMarker === "mdx", g = t.singleQuote ? "{' '}" : '{" "}', S = E ? C : w([g, f], " "), B = ((u = (r = s.openingElement) == null ? void 0 : r.name) == null ? void 0 : u.name) === "fbt", x = kp(e, t, n, S, B), N = s.children.some((k) => It(k));
|
|
2303
|
-
for (let k = x.length - 2; k >= 0; k--) {
|
|
2304
|
-
let M = x[k] === "" && x[k + 1] === "", V = x[k] === F && x[k + 1] === "" && x[k + 2] === F, X = (x[k] === f || x[k] === F) && x[k + 1] === "" && x[k + 2] === S, ot = x[k] === S && x[k + 1] === "" && (x[k + 2] === f || x[k + 2] === F), Ge = x[k] === S && x[k + 1] === "" && x[k + 2] === S, P = x[k] === f && x[k + 1] === "" && x[k + 2] === F || x[k] === F && x[k + 1] === "" && x[k + 2] === f;
|
|
2305
|
-
V && N || M || X || Ge || P ? x.splice(k, 2) : ot && x.splice(k + 1, 2);
|
|
2306
|
-
}
|
|
2307
|
-
for (; x.length > 0 && fn(_(!1, x, -1)); )
|
|
2308
|
-
x.pop();
|
|
2309
|
-
for (; x.length > 1 && fn(x[0]) && fn(x[1]); )
|
|
2310
|
-
x.shift(), x.shift();
|
|
2311
|
-
let b = [""];
|
|
2312
|
-
for (let [k, M] of x.entries()) {
|
|
2313
|
-
if (M === S) {
|
|
2314
|
-
if (k === 1 && gi(x[k - 1])) {
|
|
2315
|
-
if (x.length === 2) {
|
|
2316
|
-
b.push([b.pop(), g]);
|
|
2317
|
-
continue;
|
|
2318
|
-
}
|
|
2319
|
-
b.push([g, F], "");
|
|
2320
|
-
continue;
|
|
2321
|
-
} else if (k === x.length - 1) {
|
|
2322
|
-
b.push([b.pop(), g]);
|
|
2323
|
-
continue;
|
|
2324
|
-
} else if (x[k - 1] === "" && x[k - 2] === F) {
|
|
2325
|
-
b.push([b.pop(), g]);
|
|
2326
|
-
continue;
|
|
2327
|
-
}
|
|
2328
|
-
}
|
|
2329
|
-
k % 2 === 0 ? b.push([b.pop(), M]) : b.push(M, ""), te(M) && (y = !0);
|
|
2330
|
-
}
|
|
2331
|
-
let v = N ? su(b) : m(b, { shouldBreak: !0 });
|
|
2332
|
-
if (((a = t.cursorNode) == null ? void 0 : a.type) === "JSXText" && s.children.includes(t.cursorNode) ? v = [$t, v, $t] : ((o = t.nodeBeforeCursor) == null ? void 0 : o.type) === "JSXText" && s.children.includes(t.nodeBeforeCursor) ? v = [$t, v] : ((i = t.nodeAfterCursor) == null ? void 0 : i.type) === "JSXText" && s.children.includes(t.nodeAfterCursor) && (v = [v, $t]), E)
|
|
2333
|
-
return v;
|
|
2334
|
-
let q = m([l, A([F, v]), F, d]);
|
|
2335
|
-
return y ? q : Ke([m([l, ...x, d]), q]);
|
|
2336
|
-
}
|
|
2337
|
-
function kp(e, t, n, r, u) {
|
|
2338
|
-
let a = "", o = [a];
|
|
2339
|
-
function i(l) {
|
|
2340
|
-
a = l, o.push([o.pop(), l]);
|
|
2341
|
-
}
|
|
2342
|
-
function s(l) {
|
|
2343
|
-
l !== "" && (a = l, o.push(l, ""));
|
|
2344
|
-
}
|
|
2345
|
-
return e.each(({ node: l, next: d }) => {
|
|
2346
|
-
if (l.type === "JSXText") {
|
|
2347
|
-
let c = pe(l);
|
|
2348
|
-
if (It(l)) {
|
|
2349
|
-
let D = Gt.split(c, !0);
|
|
2350
|
-
D[0] === "" && (D.shift(), /\n/u.test(D[0]) ? s(br(u, D[1], l, d)) : s(r), D.shift());
|
|
2351
|
-
let p;
|
|
2352
|
-
if (_(!1, D, -1) === "" && (D.pop(), p = D.pop()), D.length === 0)
|
|
2353
|
-
return;
|
|
2354
|
-
for (let [y, E] of D.entries())
|
|
2355
|
-
y % 2 === 1 ? s(C) : i(E);
|
|
2356
|
-
p !== void 0 ? /\n/u.test(p) ? s(br(u, a, l, d)) : s(r) : s(Sr(u, a, l, d));
|
|
2357
|
-
} else
|
|
2358
|
-
/\n/u.test(c) ? c.match(/\n/gu).length > 1 && s(F) : s(r);
|
|
2359
|
-
} else {
|
|
2360
|
-
let c = n();
|
|
2361
|
-
if (i(c), d && It(d)) {
|
|
2362
|
-
let D = Gt.trim(pe(d)), [p] = Gt.split(D);
|
|
2363
|
-
s(Sr(u, p, l, d));
|
|
2364
|
-
} else
|
|
2365
|
-
s(F);
|
|
2366
|
-
}
|
|
2367
|
-
}, "children"), o;
|
|
2368
|
-
}
|
|
2369
|
-
function Sr(e, t, n, r) {
|
|
2370
|
-
return e ? "" : n.type === "JSXElement" && !n.closingElement || (r == null ? void 0 : r.type) === "JSXElement" && !r.closingElement ? t.length === 1 ? f : F : f;
|
|
2371
|
-
}
|
|
2372
|
-
function br(e, t, n, r) {
|
|
2373
|
-
return e ? F : t.length === 1 ? n.type === "JSXElement" && !n.closingElement || (r == null ? void 0 : r.type) === "JSXElement" && !r.closingElement ? F : f : F;
|
|
2374
|
-
}
|
|
2375
|
-
var Pp = /* @__PURE__ */ new Set(["ArrayExpression", "TupleExpression", "JSXAttribute", "JSXElement", "JSXExpressionContainer", "JSXFragment", "ExpressionStatement", "CallExpression", "OptionalCallExpression", "ConditionalExpression", "JsExpressionRoot"]);
|
|
2376
|
-
function wp(e, t, n) {
|
|
2377
|
-
let { parent: r } = e;
|
|
2378
|
-
if (Pp.has(r.type))
|
|
2379
|
-
return t;
|
|
2380
|
-
let u = e.match(void 0, (o) => o.type === "ArrowFunctionExpression", L, (o) => o.type === "JSXExpressionContainer"), a = ut(e, n);
|
|
2381
|
-
return m([a ? "" : w("("), A([f, t]), f, a ? "" : w(")")], { shouldBreak: u });
|
|
2382
|
-
}
|
|
2383
|
-
function Np(e, t, n) {
|
|
2384
|
-
let { node: r } = e, u = [];
|
|
2385
|
-
if (u.push(n("name")), r.value) {
|
|
2386
|
-
let a;
|
|
2387
|
-
if (ue(r.value)) {
|
|
2388
|
-
let o = pe(r.value), i = H(!1, H(!1, o.slice(1, -1), "'", "'"), """, '"'), s = $r(i, t.jsxSingleQuote);
|
|
2389
|
-
i = s === '"' ? H(!1, i, '"', """) : H(!1, i, "'", "'"), a = e.call(() => Ee(e, He(s + i + s), t), "value");
|
|
2390
|
-
} else
|
|
2391
|
-
a = n("value");
|
|
2392
|
-
u.push("=", a);
|
|
2393
|
-
}
|
|
2394
|
-
return u;
|
|
2395
|
-
}
|
|
2396
|
-
function Ip(e, t, n) {
|
|
2397
|
-
let { node: r } = e, u = (a, o) => a.type === "JSXEmptyExpression" || !h(a) && (Q(a) || Fe(a) || a.type === "ArrowFunctionExpression" || a.type === "AwaitExpression" && (u(a.argument, a) || a.argument.type === "JSXElement") || L(a) || a.type === "ChainExpression" && L(a.expression) || a.type === "FunctionExpression" || a.type === "TemplateLiteral" || a.type === "TaggedTemplateExpression" || a.type === "DoExpression" || K(o) && (a.type === "ConditionalExpression" || Be(a)));
|
|
2398
|
-
return u(r.expression, e.parent) ? m(["{", n("expression"), ke, "}"]) : m(["{", A([f, n("expression")]), f, ke, "}"]);
|
|
2399
|
-
}
|
|
2400
|
-
function jp(e, t, n) {
|
|
2401
|
-
var r, u;
|
|
2402
|
-
let { node: a } = e, o = h(a.name) || h(a.typeParameters) || h(a.typeArguments);
|
|
2403
|
-
if (a.selfClosing && a.attributes.length === 0 && !o)
|
|
2404
|
-
return ["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " />"];
|
|
2405
|
-
if (((r = a.attributes) == null ? void 0 : r.length) === 1 && ue(a.attributes[0].value) && !a.attributes[0].value.value.includes(`
|
|
2406
|
-
`) && !o && !h(a.attributes[0]))
|
|
2407
|
-
return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " ", ...e.map(n, "attributes"), a.selfClosing ? " />" : ">"]);
|
|
2408
|
-
let i = (u = a.attributes) == null ? void 0 : u.some((l) => ue(l.value) && l.value.value.includes(`
|
|
2409
|
-
`)), s = t.singleAttributePerLine && a.attributes.length > 1 ? F : C;
|
|
2410
|
-
return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), A(e.map(() => [s, n()], "attributes")), ...Lp(a, t, o)], { shouldBreak: i });
|
|
2411
|
-
}
|
|
2412
|
-
function Lp(e, t, n) {
|
|
2413
|
-
return e.selfClosing ? [C, "/>"] : Mp(e, t, n) ? [">"] : [f, ">"];
|
|
2414
|
-
}
|
|
2415
|
-
function Mp(e, t, n) {
|
|
2416
|
-
let r = e.attributes.length > 0 && h(_(!1, e.attributes, -1), T.Trailing);
|
|
2417
|
-
return e.attributes.length === 0 && !n || (t.bracketSameLine || t.jsxBracketSameLine) && (!n || e.attributes.length > 0) && !r;
|
|
2418
|
-
}
|
|
2419
|
-
function Op(e, t, n) {
|
|
2420
|
-
let { node: r } = e, u = [];
|
|
2421
|
-
u.push("</");
|
|
2422
|
-
let a = n("name");
|
|
2423
|
-
return h(r.name, T.Leading | T.Line) ? u.push(A([F, a]), F) : h(r.name, T.Leading | T.Block) ? u.push(" ", a) : u.push(a), u.push(">"), u;
|
|
2424
|
-
}
|
|
2425
|
-
function Jp(e, t) {
|
|
2426
|
-
let { node: n } = e, r = h(n), u = h(n, T.Line), a = n.type === "JSXOpeningFragment";
|
|
2427
|
-
return [a ? "<" : "</", A([u ? F : r && !a ? " " : "", R(e, t)]), u ? F : "", ">"];
|
|
2428
|
-
}
|
|
2429
|
-
function qp(e, t, n) {
|
|
2430
|
-
let r = Ee(e, vp(e, t, n), t);
|
|
2431
|
-
return wp(e, r, t);
|
|
2432
|
-
}
|
|
2433
|
-
function _p(e, t) {
|
|
2434
|
-
let { node: n } = e, r = h(n, T.Line);
|
|
2435
|
-
return [R(e, t, { indent: r }), r ? F : ""];
|
|
2436
|
-
}
|
|
2437
|
-
function Xp(e, t, n) {
|
|
2438
|
-
let { node: r } = e;
|
|
2439
|
-
return ["{", e.call(({ node: u }) => {
|
|
2440
|
-
let a = ["...", n()];
|
|
2441
|
-
return !h(u) || !hu(e) ? a : [A([f, Ee(e, a, t)]), f];
|
|
2442
|
-
}, r.type === "JSXSpreadAttribute" ? "argument" : "expression"), "}"];
|
|
2443
|
-
}
|
|
2444
|
-
function Rp(e, t, n) {
|
|
2445
|
-
let { node: r } = e;
|
|
2446
|
-
if (r.type.startsWith("JSX"))
|
|
2447
|
-
switch (r.type) {
|
|
2448
|
-
case "JSXAttribute":
|
|
2449
|
-
return Np(e, t, n);
|
|
2450
|
-
case "JSXIdentifier":
|
|
2451
|
-
return r.name;
|
|
2452
|
-
case "JSXNamespacedName":
|
|
2453
|
-
return I(":", [n("namespace"), n("name")]);
|
|
2454
|
-
case "JSXMemberExpression":
|
|
2455
|
-
return I(".", [n("object"), n("property")]);
|
|
2456
|
-
case "JSXSpreadAttribute":
|
|
2457
|
-
case "JSXSpreadChild":
|
|
2458
|
-
return Xp(e, t, n);
|
|
2459
|
-
case "JSXExpressionContainer":
|
|
2460
|
-
return Ip(e, t, n);
|
|
2461
|
-
case "JSXFragment":
|
|
2462
|
-
case "JSXElement":
|
|
2463
|
-
return qp(e, t, n);
|
|
2464
|
-
case "JSXOpeningElement":
|
|
2465
|
-
return jp(e, t, n);
|
|
2466
|
-
case "JSXClosingElement":
|
|
2467
|
-
return Op(e, t, n);
|
|
2468
|
-
case "JSXOpeningFragment":
|
|
2469
|
-
case "JSXClosingFragment":
|
|
2470
|
-
return Jp(e, t);
|
|
2471
|
-
case "JSXEmptyExpression":
|
|
2472
|
-
return _p(e, t);
|
|
2473
|
-
case "JSXText":
|
|
2474
|
-
throw new Error("JSXText should be handled by JSXElement");
|
|
2475
|
-
default:
|
|
2476
|
-
throw new xt(r, "JSX");
|
|
2477
|
-
}
|
|
2478
|
-
}
|
|
2479
|
-
function $p(e) {
|
|
2480
|
-
if (e.children.length === 0)
|
|
2481
|
-
return !0;
|
|
2482
|
-
if (e.children.length > 1)
|
|
2483
|
-
return !1;
|
|
2484
|
-
let t = e.children[0];
|
|
2485
|
-
return t.type === "JSXText" && !It(t);
|
|
2486
|
-
}
|
|
2487
|
-
function It(e) {
|
|
2488
|
-
return e.type === "JSXText" && (Gt.hasNonWhitespaceCharacter(pe(e)) || !/\n/u.test(pe(e)));
|
|
2489
|
-
}
|
|
2490
|
-
function Wp(e) {
|
|
2491
|
-
return e.type === "JSXExpressionContainer" && ue(e.expression) && e.expression.value === " " && !h(e.expression);
|
|
2492
|
-
}
|
|
2493
|
-
function Up(e) {
|
|
2494
|
-
let { node: t, parent: n } = e;
|
|
2495
|
-
if (!K(t) || !K(n))
|
|
2496
|
-
return !1;
|
|
2497
|
-
let { index: r, siblings: u } = e, a;
|
|
2498
|
-
for (let o = r; o > 0; o--) {
|
|
2499
|
-
let i = u[o - 1];
|
|
2500
|
-
if (!(i.type === "JSXText" && !It(i))) {
|
|
2501
|
-
a = i;
|
|
2502
|
-
break;
|
|
2503
|
-
}
|
|
2504
|
-
}
|
|
2505
|
-
return (a == null ? void 0 : a.type) === "JSXExpressionContainer" && a.expression.type === "JSXEmptyExpression" && un(a.expression);
|
|
2506
|
-
}
|
|
2507
|
-
function Gp(e) {
|
|
2508
|
-
return un(e.node) || Up(e);
|
|
2509
|
-
}
|
|
2510
|
-
var ju = Gp, Vp = 0;
|
|
2511
|
-
function Lu(e, t, n) {
|
|
2512
|
-
var r;
|
|
2513
|
-
let { node: u, parent: a, grandparent: o, key: i } = e, s = i !== "body" && (a.type === "IfStatement" || a.type === "WhileStatement" || a.type === "SwitchStatement" || a.type === "DoWhileStatement"), l = u.operator === "|>" && ((r = e.root.extra) == null ? void 0 : r.__isUsingHackPipeline), d = In(e, n, t, !1, s);
|
|
2514
|
-
if (s)
|
|
2515
|
-
return d;
|
|
2516
|
-
if (l)
|
|
2517
|
-
return m(d);
|
|
2518
|
-
if (L(a) && a.callee === u || a.type === "UnaryExpression" || U(a) && !a.computed)
|
|
2519
|
-
return m([A([f, ...d]), f]);
|
|
2520
|
-
let c = a.type === "ReturnStatement" || a.type === "ThrowStatement" || a.type === "JSXExpressionContainer" && o.type === "JSXAttribute" || u.operator !== "|" && a.type === "JsExpressionRoot" || u.type !== "NGPipeExpression" && (a.type === "NGRoot" && t.parser === "__ng_binding" || a.type === "NGMicrosyntaxExpression" && o.type === "NGMicrosyntax" && o.body.length === 1) || u === a.body && a.type === "ArrowFunctionExpression" || u !== a.body && a.type === "ForStatement" || a.type === "ConditionalExpression" && o.type !== "ReturnStatement" && o.type !== "ThrowStatement" && !L(o) || a.type === "TemplateLiteral", D = a.type === "AssignmentExpression" || a.type === "VariableDeclarator" || a.type === "ClassProperty" || a.type === "PropertyDefinition" || a.type === "TSAbstractPropertyDefinition" || a.type === "ClassPrivateProperty" || Ne(a), p = Be(u.left) && Vn(u.operator, u.left.operator);
|
|
2521
|
-
if (c || jt(u) && !p || !jt(u) && D)
|
|
2522
|
-
return m(d);
|
|
2523
|
-
if (d.length === 0)
|
|
2524
|
-
return "";
|
|
2525
|
-
let y = K(u.right), E = d.findIndex((b) => typeof b != "string" && !Array.isArray(b) && b.type === le), g = d.slice(0, E === -1 ? 1 : E + 1), S = d.slice(g.length, y ? -1 : void 0), B = Symbol("logicalChain-" + ++Vp), x = m([...g, A(S)], { id: B });
|
|
2526
|
-
if (!y)
|
|
2527
|
-
return x;
|
|
2528
|
-
let N = _(!1, d, -1);
|
|
2529
|
-
return m([x, an(N, { groupId: B })]);
|
|
2530
|
-
}
|
|
2531
|
-
function In(e, t, n, r, u) {
|
|
2532
|
-
var a;
|
|
2533
|
-
let { node: o } = e;
|
|
2534
|
-
if (!Be(o))
|
|
2535
|
-
return [m(t())];
|
|
2536
|
-
let i = [];
|
|
2537
|
-
Vn(o.operator, o.left.operator) ? i = e.call((g) => In(g, t, n, !0, u), "left") : i.push(m(t("left")));
|
|
2538
|
-
let s = jt(o), l = (o.operator === "|>" || o.type === "NGPipeExpression" || Kp(e, n)) && !qe(n.originalText, o.right), d = !h(o.right, T.Leading, Du) && qe(n.originalText, o.right), c = o.type === "NGPipeExpression" ? "|" : o.operator, D = o.type === "NGPipeExpression" && o.arguments.length > 0 ? m(A([f, ": ", I([C, ": "], e.map(() => Ce(2, m(t())), "arguments"))])) : "", p;
|
|
2539
|
-
if (s)
|
|
2540
|
-
p = [c, " ", t("right"), D];
|
|
2541
|
-
else {
|
|
2542
|
-
let g = c === "|>" && ((a = e.root.extra) != null && a.__isUsingHackPipeline) ? e.call((S) => In(S, t, n, !0, u), "right") : t("right");
|
|
2543
|
-
if (n.experimentalOperatorPosition === "start") {
|
|
2544
|
-
let S = "";
|
|
2545
|
-
if (d)
|
|
2546
|
-
switch (Ue(g)) {
|
|
2547
|
-
case ve:
|
|
2548
|
-
S = g.splice(0, 1)[0];
|
|
2549
|
-
break;
|
|
2550
|
-
case Ie:
|
|
2551
|
-
S = g.contents.splice(0, 1)[0];
|
|
2552
|
-
break;
|
|
2553
|
-
}
|
|
2554
|
-
p = [C, S, c, " ", g, D];
|
|
2555
|
-
} else
|
|
2556
|
-
p = [l ? C : "", c, l ? " " : C, g, D];
|
|
2557
|
-
}
|
|
2558
|
-
let { parent: y } = e, E = h(o.left, T.Trailing | T.Line);
|
|
2559
|
-
if ((E || !(u && o.type === "LogicalExpression") && y.type !== o.type && o.left.type !== o.type && o.right.type !== o.type) && (p = m(p, { shouldBreak: E })), n.experimentalOperatorPosition === "start" ? i.push(s || d ? " " : "", p) : i.push(l ? "" : " ", p), r && h(o)) {
|
|
2560
|
-
let g = zn(Ee(e, i, n));
|
|
2561
|
-
return g.type === $e ? g.parts : Array.isArray(g) ? g : [g];
|
|
2562
|
-
}
|
|
2563
|
-
return i;
|
|
2564
|
-
}
|
|
2565
|
-
function jt(e) {
|
|
2566
|
-
return e.type !== "LogicalExpression" ? !1 : !!(Fe(e.right) && e.right.properties.length > 0 || Q(e.right) && e.right.elements.length > 0 || K(e.right));
|
|
2567
|
-
}
|
|
2568
|
-
var Br = (e) => e.type === "BinaryExpression" && e.operator === "|";
|
|
2569
|
-
function Kp(e, t) {
|
|
2570
|
-
return (t.parser === "__vue_expression" || t.parser === "__vue_ts_expression") && Br(e.node) && !e.hasAncestor((n) => !Br(n) && n.type !== "JsExpressionRoot");
|
|
2571
|
-
}
|
|
2572
|
-
function Hp(e, t, n) {
|
|
2573
|
-
let { node: r } = e;
|
|
2574
|
-
if (r.type.startsWith("NG"))
|
|
2575
|
-
switch (r.type) {
|
|
2576
|
-
case "NGRoot":
|
|
2577
|
-
return [n("node"), h(r.node) ? " //" + lt(r.node)[0].value.trimEnd() : ""];
|
|
2578
|
-
case "NGPipeExpression":
|
|
2579
|
-
return Lu(e, t, n);
|
|
2580
|
-
case "NGChainedExpression":
|
|
2581
|
-
return m(I([";", C], e.map(() => Qp(e) ? n() : ["(", n(), ")"], "expressions")));
|
|
2582
|
-
case "NGEmptyExpression":
|
|
2583
|
-
return "";
|
|
2584
|
-
case "NGMicrosyntax":
|
|
2585
|
-
return e.map(() => [e.isFirst ? "" : vr(e) ? " " : [";", C], n()], "body");
|
|
2586
|
-
case "NGMicrosyntaxKey":
|
|
2587
|
-
return /^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(r.name) ? r.name : JSON.stringify(r.name);
|
|
2588
|
-
case "NGMicrosyntaxExpression":
|
|
2589
|
-
return [n("expression"), r.alias === null ? "" : [" as ", n("alias")]];
|
|
2590
|
-
case "NGMicrosyntaxKeyedExpression": {
|
|
2591
|
-
let { index: u, parent: a } = e, o = vr(e) || (u === 1 && (r.key.name === "then" || r.key.name === "else" || r.key.name === "as") || (u === 2 || u === 3) && (r.key.name === "else" && a.body[u - 1].type === "NGMicrosyntaxKeyedExpression" && a.body[u - 1].key.name === "then" || r.key.name === "track")) && a.body[0].type === "NGMicrosyntaxExpression";
|
|
2592
|
-
return [n("key"), o ? " " : ": ", n("expression")];
|
|
2593
|
-
}
|
|
2594
|
-
case "NGMicrosyntaxLet":
|
|
2595
|
-
return ["let ", n("key"), r.value === null ? "" : [" = ", n("value")]];
|
|
2596
|
-
case "NGMicrosyntaxAs":
|
|
2597
|
-
return [n("key"), " as ", n("alias")];
|
|
2598
|
-
default:
|
|
2599
|
-
throw new xt(r, "Angular");
|
|
2600
|
-
}
|
|
2601
|
-
}
|
|
2602
|
-
function vr({ node: e, index: t }) {
|
|
2603
|
-
return e.type === "NGMicrosyntaxKeyedExpression" && e.key.name === "of" && t === 1;
|
|
2604
|
-
}
|
|
2605
|
-
var zp = J(["CallExpression", "OptionalCallExpression", "AssignmentExpression"]);
|
|
2606
|
-
function Qp({ node: e }) {
|
|
2607
|
-
return hn(e, zp);
|
|
2608
|
-
}
|
|
2609
|
-
function Mu(e, t, n) {
|
|
2610
|
-
let { node: r } = e;
|
|
2611
|
-
return m([I(C, e.map(n, "decorators")), Ou(r, t) ? F : C]);
|
|
2612
|
-
}
|
|
2613
|
-
function Yp(e, t, n) {
|
|
2614
|
-
return Ju(e.node) ? [I(F, e.map(n, "declaration", "decorators")), F] : "";
|
|
2615
|
-
}
|
|
2616
|
-
function Zp(e, t, n) {
|
|
2617
|
-
let { node: r, parent: u } = e, { decorators: a } = r;
|
|
2618
|
-
if (!O(a) || Ju(u) || ju(e))
|
|
2619
|
-
return "";
|
|
2620
|
-
let o = r.type === "ClassExpression" || r.type === "ClassDeclaration" || Ou(r, t);
|
|
2621
|
-
return [e.key === "declaration" && Wo(u) ? F : o ? Te : "", I(C, e.map(n, "decorators")), C];
|
|
2622
|
-
}
|
|
2623
|
-
function Ou(e, t) {
|
|
2624
|
-
return e.decorators.some((n) => se(t.originalText, j(n)));
|
|
2625
|
-
}
|
|
2626
|
-
function Ju(e) {
|
|
2627
|
-
var t;
|
|
2628
|
-
if (e.type !== "ExportDefaultDeclaration" && e.type !== "ExportNamedDeclaration" && e.type !== "DeclareExportDeclaration")
|
|
2629
|
-
return !1;
|
|
2630
|
-
let n = (t = e.declaration) == null ? void 0 : t.decorators;
|
|
2631
|
-
return O(n) && tn(e, n[0]);
|
|
2632
|
-
}
|
|
2633
|
-
var Yt = class extends Error {
|
|
2634
|
-
constructor() {
|
|
2635
|
-
super(...arguments);
|
|
2636
|
-
_t(this, "name", "ArgExpansionBailout");
|
|
2637
|
-
}
|
|
2638
|
-
};
|
|
2639
|
-
function el(e, t, n) {
|
|
2640
|
-
let { node: r } = e, u = ye(r);
|
|
2641
|
-
if (u.length === 0)
|
|
2642
|
-
return ["(", R(e, t), ")"];
|
|
2643
|
-
let a = u.length - 1;
|
|
2644
|
-
if (rl(u)) {
|
|
2645
|
-
let c = ["("];
|
|
2646
|
-
return zt(e, (D, p) => {
|
|
2647
|
-
c.push(n()), p !== a && c.push(", ");
|
|
2648
|
-
}), c.push(")"), c;
|
|
2649
|
-
}
|
|
2650
|
-
let o = !1, i = [];
|
|
2651
|
-
zt(e, ({ node: c }, D) => {
|
|
2652
|
-
let p = n();
|
|
2653
|
-
D === a || (we(c, t) ? (o = !0, p = [p, ",", F, F]) : p = [p, ",", C]), i.push(p);
|
|
2654
|
-
});
|
|
2655
|
-
let s = !t.parser.startsWith("__ng_") && r.type !== "ImportExpression" && Pe(t, "all") ? "," : "";
|
|
2656
|
-
function l() {
|
|
2657
|
-
return m(["(", A([C, ...i]), s, C, ")"], { shouldBreak: !0 });
|
|
2658
|
-
}
|
|
2659
|
-
if (o || e.parent.type !== "Decorator" && ei(u))
|
|
2660
|
-
return l();
|
|
2661
|
-
if (nl(u)) {
|
|
2662
|
-
let c = i.slice(1);
|
|
2663
|
-
if (c.some(te))
|
|
2664
|
-
return l();
|
|
2665
|
-
let D;
|
|
2666
|
-
try {
|
|
2667
|
-
D = n(Er(r, 0), { expandFirstArg: !0 });
|
|
2668
|
-
} catch (p) {
|
|
2669
|
-
if (p instanceof Yt)
|
|
2670
|
-
return l();
|
|
2671
|
-
throw p;
|
|
2672
|
-
}
|
|
2673
|
-
return te(D) ? [Te, Ke([["(", m(D, { shouldBreak: !0 }), ", ", ...c, ")"], l()])] : Ke([["(", D, ", ", ...c, ")"], ["(", m(D, { shouldBreak: !0 }), ", ", ...c, ")"], l()]);
|
|
2674
|
-
}
|
|
2675
|
-
if (tl(u, i, t)) {
|
|
2676
|
-
let c = i.slice(0, -1);
|
|
2677
|
-
if (c.some(te))
|
|
2678
|
-
return l();
|
|
2679
|
-
let D;
|
|
2680
|
-
try {
|
|
2681
|
-
D = n(Er(r, -1), { expandLastArg: !0 });
|
|
2682
|
-
} catch (p) {
|
|
2683
|
-
if (p instanceof Yt)
|
|
2684
|
-
return l();
|
|
2685
|
-
throw p;
|
|
2686
|
-
}
|
|
2687
|
-
return te(D) ? [Te, Ke([["(", ...c, m(D, { shouldBreak: !0 }), ")"], l()])] : Ke([["(", ...c, D, ")"], ["(", ...c, m(D, { shouldBreak: !0 }), ")"], l()]);
|
|
2688
|
-
}
|
|
2689
|
-
let d = ["(", A([f, ...i]), w(s), f, ")"];
|
|
2690
|
-
return nu(e) ? d : m(d, { shouldBreak: i.some(te) || o });
|
|
2691
|
-
}
|
|
2692
|
-
function kt(e, t = !1) {
|
|
2693
|
-
return Fe(e) && (e.properties.length > 0 || h(e)) || Q(e) && (e.elements.length > 0 || h(e)) || e.type === "TSTypeAssertion" && kt(e.expression) || xe(e) && kt(e.expression) || e.type === "FunctionExpression" || e.type === "ArrowFunctionExpression" && (!e.returnType || !e.returnType.typeAnnotation || e.returnType.typeAnnotation.type !== "TSTypeReference" || ul(e.body)) && (e.body.type === "BlockStatement" || e.body.type === "ArrowFunctionExpression" && kt(e.body, !0) || Fe(e.body) || Q(e.body) || !t && (L(e.body) || e.body.type === "ConditionalExpression") || K(e.body)) || e.type === "DoExpression" || e.type === "ModuleExpression";
|
|
2694
|
-
}
|
|
2695
|
-
function tl(e, t, n) {
|
|
2696
|
-
var r, u;
|
|
2697
|
-
let a = _(!1, e, -1);
|
|
2698
|
-
if (e.length === 1) {
|
|
2699
|
-
let i = _(!1, t, -1);
|
|
2700
|
-
if ((r = i.label) != null && r.embed && ((u = i.label) == null ? void 0 : u.hug) !== !1)
|
|
2701
|
-
return !0;
|
|
2702
|
-
}
|
|
2703
|
-
let o = _(!1, e, -2);
|
|
2704
|
-
return !h(a, T.Leading) && !h(a, T.Trailing) && kt(a) && (!o || o.type !== a.type) && (e.length !== 2 || o.type !== "ArrowFunctionExpression" || !Q(a)) && !(e.length > 1 && la(a, n));
|
|
2705
|
-
}
|
|
2706
|
-
function nl(e) {
|
|
2707
|
-
if (e.length !== 2)
|
|
2708
|
-
return !1;
|
|
2709
|
-
let [t, n] = e;
|
|
2710
|
-
return t.type === "ModuleExpression" && al(n) ? !0 : !h(t) && (t.type === "FunctionExpression" || t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement") && n.type !== "FunctionExpression" && n.type !== "ArrowFunctionExpression" && n.type !== "ConditionalExpression" && qu(n) && !kt(n);
|
|
2711
|
-
}
|
|
2712
|
-
function qu(e) {
|
|
2713
|
-
if (e.type === "ParenthesizedExpression")
|
|
2714
|
-
return qu(e.expression);
|
|
2715
|
-
if (xe(e) || e.type === "TypeCastExpression") {
|
|
2716
|
-
let { typeAnnotation: t } = e;
|
|
2717
|
-
if (t.type === "TypeAnnotation" && (t = t.typeAnnotation), t.type === "TSArrayType" && (t = t.elementType, t.type === "TSArrayType" && (t = t.elementType)), t.type === "GenericTypeAnnotation" || t.type === "TSTypeReference") {
|
|
2718
|
-
let n = t.typeArguments ?? t.typeParameters;
|
|
2719
|
-
(n == null ? void 0 : n.params.length) === 1 && (t = n.params[0]);
|
|
2720
|
-
}
|
|
2721
|
-
return Un(t) && fe(e.expression, 1);
|
|
2722
|
-
}
|
|
2723
|
-
return mt(e) && ye(e).length > 1 ? !1 : Be(e) ? fe(e.left, 1) && fe(e.right, 1) : zr(e) || fe(e);
|
|
2724
|
-
}
|
|
2725
|
-
function rl(e) {
|
|
2726
|
-
return e.length === 2 ? kr(e, 0) : e.length === 3 ? e[0].type === "Identifier" && kr(e, 1) : !1;
|
|
2727
|
-
}
|
|
2728
|
-
function kr(e, t) {
|
|
2729
|
-
let n = e[t], r = e[t + 1];
|
|
2730
|
-
return n.type === "ArrowFunctionExpression" && Z(n).length === 0 && n.body.type === "BlockStatement" && r.type === "ArrayExpression" && !e.some((u) => h(u));
|
|
2731
|
-
}
|
|
2732
|
-
function ul(e) {
|
|
2733
|
-
return e.type === "BlockStatement" && (e.body.some((t) => t.type !== "EmptyStatement") || h(e, T.Dangling));
|
|
2734
|
-
}
|
|
2735
|
-
function al(e) {
|
|
2736
|
-
return e.type === "ObjectExpression" && e.properties.length === 1 && Ne(e.properties[0]) && e.properties[0].key.type === "Identifier" && e.properties[0].key.name === "type" && ue(e.properties[0].value) && e.properties[0].value.value === "module";
|
|
2737
|
-
}
|
|
2738
|
-
var jn = el, ol = (e) => ((e.type === "ChainExpression" || e.type === "TSNonNullExpression") && (e = e.expression), L(e) && ye(e).length > 0);
|
|
2739
|
-
function il(e, t, n) {
|
|
2740
|
-
var r;
|
|
2741
|
-
let u = n("object"), a = _u(e, t, n), { node: o } = e, i = e.findAncestor((d) => !(U(d) || d.type === "TSNonNullExpression")), s = e.findAncestor((d) => !(d.type === "ChainExpression" || d.type === "TSNonNullExpression")), l = i && (i.type === "NewExpression" || i.type === "BindExpression" || i.type === "AssignmentExpression" && i.left.type !== "Identifier") || o.computed || o.object.type === "Identifier" && o.property.type === "Identifier" && !U(s) || (s.type === "AssignmentExpression" || s.type === "VariableDeclarator") && (ol(o.object) || ((r = u.label) == null ? void 0 : r.memberChain));
|
|
2742
|
-
return Lt(u.label, [u, l ? a : m(A([f, a]))]);
|
|
2743
|
-
}
|
|
2744
|
-
function _u(e, t, n) {
|
|
2745
|
-
let r = n("property"), { node: u } = e, a = ne(e);
|
|
2746
|
-
return u.computed ? !u.property || be(u.property) ? [a, "[", r, "]"] : m([a, "[", A([f, r]), f, "]"]) : [a, ".", r];
|
|
2747
|
-
}
|
|
2748
|
-
function Xu(e, t, n) {
|
|
2749
|
-
if (e.node.type === "ChainExpression")
|
|
2750
|
-
return e.call(() => Xu(e, t, n), "expression");
|
|
2751
|
-
let { parent: r } = e, u = !r || r.type === "ExpressionStatement", a = [];
|
|
2752
|
-
function o(P) {
|
|
2753
|
-
let { originalText: G } = t, ie = gt(G, j(P));
|
|
2754
|
-
return G.charAt(ie) === ")" ? ie !== !1 && Xn(G, ie + 1) : we(P, t);
|
|
2755
|
-
}
|
|
2756
|
-
function i() {
|
|
2757
|
-
let { node: P } = e;
|
|
2758
|
-
if (P.type === "ChainExpression")
|
|
2759
|
-
return e.call(i, "expression");
|
|
2760
|
-
if (L(P) && (st(P.callee) || L(P.callee))) {
|
|
2761
|
-
let G = o(P);
|
|
2762
|
-
a.unshift({ node: P, hasTrailingEmptyLine: G, printed: [Ee(e, [ne(e), ze(e, t, n), jn(e, t, n)], t), G ? F : ""] }), e.call(i, "callee");
|
|
2763
|
-
} else
|
|
2764
|
-
st(P) ? (a.unshift({ node: P, needsParens: ut(e, t), printed: Ee(e, U(P) ? _u(e, t, n) : sa(e, t, n), t) }), e.call(i, "object")) : P.type === "TSNonNullExpression" ? (a.unshift({ node: P, printed: Ee(e, "!", t) }), e.call(i, "expression")) : a.unshift({ node: P, printed: n() });
|
|
2765
|
-
}
|
|
2766
|
-
let { node: s } = e;
|
|
2767
|
-
a.unshift({ node: s, printed: [ne(e), ze(e, t, n), jn(e, t, n)] }), s.callee && e.call(i, "callee");
|
|
2768
|
-
let l = [], d = [a[0]], c = 1;
|
|
2769
|
-
for (; c < a.length && (a[c].node.type === "TSNonNullExpression" || L(a[c].node) || U(a[c].node) && a[c].node.computed && be(a[c].node.property)); ++c)
|
|
2770
|
-
d.push(a[c]);
|
|
2771
|
-
if (!L(a[0].node))
|
|
2772
|
-
for (; c + 1 < a.length && st(a[c].node) && st(a[c + 1].node); ++c)
|
|
2773
|
-
d.push(a[c]);
|
|
2774
|
-
l.push(d), d = [];
|
|
2775
|
-
let D = !1;
|
|
2776
|
-
for (; c < a.length; ++c) {
|
|
2777
|
-
if (D && st(a[c].node)) {
|
|
2778
|
-
if (a[c].node.computed && be(a[c].node.property)) {
|
|
2779
|
-
d.push(a[c]);
|
|
2780
|
-
continue;
|
|
2781
|
-
}
|
|
2782
|
-
l.push(d), d = [], D = !1;
|
|
2783
|
-
}
|
|
2784
|
-
(L(a[c].node) || a[c].node.type === "ImportExpression") && (D = !0), d.push(a[c]), h(a[c].node, T.Trailing) && (l.push(d), d = [], D = !1);
|
|
2785
|
-
}
|
|
2786
|
-
d.length > 0 && l.push(d);
|
|
2787
|
-
function p(P) {
|
|
2788
|
-
return /^[A-Z]|^[$_]+$/u.test(P);
|
|
2789
|
-
}
|
|
2790
|
-
function y(P) {
|
|
2791
|
-
return P.length <= t.tabWidth;
|
|
2792
|
-
}
|
|
2793
|
-
function E(P) {
|
|
2794
|
-
var G;
|
|
2795
|
-
let ie = (G = P[1][0]) == null ? void 0 : G.node.computed;
|
|
2796
|
-
if (P[0].length === 1) {
|
|
2797
|
-
let Ve = P[0][0].node;
|
|
2798
|
-
return Ve.type === "ThisExpression" || Ve.type === "Identifier" && (p(Ve.name) || u && y(Ve.name) || ie);
|
|
2799
|
-
}
|
|
2800
|
-
let Se = _(!1, P[0], -1).node;
|
|
2801
|
-
return U(Se) && Se.property.type === "Identifier" && (p(Se.property.name) || ie);
|
|
2802
|
-
}
|
|
2803
|
-
let g = l.length >= 2 && !h(l[1][0].node) && E(l);
|
|
2804
|
-
function S(P) {
|
|
2805
|
-
let G = P.map((ie) => ie.printed);
|
|
2806
|
-
return P.length > 0 && _(!1, P, -1).needsParens ? ["(", ...G, ")"] : G;
|
|
2807
|
-
}
|
|
2808
|
-
function B(P) {
|
|
2809
|
-
return P.length === 0 ? "" : A([F, I(F, P.map(S))]);
|
|
2810
|
-
}
|
|
2811
|
-
let x = l.map(S), N = x, b = g ? 3 : 2, v = l.flat(), q = v.slice(1, -1).some((P) => h(P.node, T.Leading)) || v.slice(0, -1).some((P) => h(P.node, T.Trailing)) || l[b] && h(l[b][0].node, T.Leading);
|
|
2812
|
-
if (l.length <= b && !q && !l.some((P) => _(!1, P, -1).hasTrailingEmptyLine))
|
|
2813
|
-
return nu(e) ? N : m(N);
|
|
2814
|
-
let k = _(!1, l[g ? 1 : 0], -1).node, M = !L(k) && o(k), V = [S(l[0]), g ? l.slice(1, 2).map(S) : "", M ? F : "", B(l.slice(g ? 2 : 1))], X = a.map(({ node: P }) => P).filter(L);
|
|
2815
|
-
function ot() {
|
|
2816
|
-
let P = _(!1, _(!1, l, -1), -1).node, G = _(!1, x, -1);
|
|
2817
|
-
return L(P) && te(G) && X.slice(0, -1).some((ie) => ie.arguments.some(wt));
|
|
2818
|
-
}
|
|
2819
|
-
let Ge;
|
|
2820
|
-
return q || X.length > 2 && X.some((P) => !P.arguments.every((G) => fe(G))) || x.slice(0, -1).some(te) || ot() ? Ge = m(V) : Ge = [te(N) || M ? Te : "", Ke([N, V])], Lt({ memberChain: !0 }, Ge);
|
|
2821
|
-
}
|
|
2822
|
-
var sl = Xu;
|
|
2823
|
-
function Ru(e, t, n) {
|
|
2824
|
-
var r;
|
|
2825
|
-
let { node: u } = e, a = u.type === "NewExpression", o = u.type === "ImportExpression", i = ne(e), s = ye(u), l = s.length === 1 && eu(s[0], t.originalText);
|
|
2826
|
-
if (l || pl(e) || rn(u, e.parent)) {
|
|
2827
|
-
let c = [];
|
|
2828
|
-
if (zt(e, () => {
|
|
2829
|
-
c.push(n());
|
|
2830
|
-
}), !(l && (r = c[0].label) != null && r.embed))
|
|
2831
|
-
return [a ? "new " : "", Pr(e, n), i, ze(e, t, n), "(", I(", ", c), ")"];
|
|
2832
|
-
}
|
|
2833
|
-
if (!o && !a && st(u.callee) && !e.call((c) => ut(c, t), "callee", ...u.callee.type === "ChainExpression" ? ["expression"] : []))
|
|
2834
|
-
return sl(e, t, n);
|
|
2835
|
-
let d = [a ? "new " : "", Pr(e, n), i, ze(e, t, n), jn(e, t, n)];
|
|
2836
|
-
return o || L(u.callee) ? m(d) : d;
|
|
2837
|
-
}
|
|
2838
|
-
function Pr(e, t) {
|
|
2839
|
-
let { node: n } = e;
|
|
2840
|
-
return n.type === "ImportExpression" ? `import${n.phase ? `.${n.phase}` : ""}` : t("callee");
|
|
2841
|
-
}
|
|
2842
|
-
function pl(e) {
|
|
2843
|
-
let { node: t } = e;
|
|
2844
|
-
if (t.type !== "CallExpression" || t.optional || t.callee.type !== "Identifier")
|
|
2845
|
-
return !1;
|
|
2846
|
-
let n = ye(t);
|
|
2847
|
-
return t.callee.name === "require" ? n.length === 1 && ue(n[0]) || n.length > 1 : t.callee.name === "define" && e.parent.type === "ExpressionStatement" ? n.length === 1 || n.length === 2 && n[0].type === "ArrayExpression" || n.length === 3 && ue(n[0]) && n[1].type === "ArrayExpression" : !1;
|
|
2848
|
-
}
|
|
2849
|
-
function Mt(e, t, n, r, u, a) {
|
|
2850
|
-
let o = Dl(e, t, n, r, a), i = a ? n(a, { assignmentLayout: o }) : "";
|
|
2851
|
-
switch (o) {
|
|
2852
|
-
case "break-after-operator":
|
|
2853
|
-
return m([m(r), u, m(A([C, i]))]);
|
|
2854
|
-
case "never-break-after-operator":
|
|
2855
|
-
return m([m(r), u, " ", i]);
|
|
2856
|
-
case "fluid": {
|
|
2857
|
-
let s = Symbol("assignment");
|
|
2858
|
-
return m([m(r), u, m(A(C), { id: s }), ke, an(i, { groupId: s })]);
|
|
2859
|
-
}
|
|
2860
|
-
case "break-lhs":
|
|
2861
|
-
return m([r, u, " ", m(i)]);
|
|
2862
|
-
case "chain":
|
|
2863
|
-
return [m(r), u, C, i];
|
|
2864
|
-
case "chain-tail":
|
|
2865
|
-
return [m(r), u, A([C, i])];
|
|
2866
|
-
case "chain-tail-arrow-chain":
|
|
2867
|
-
return [m(r), u, i];
|
|
2868
|
-
case "only-left":
|
|
2869
|
-
return r;
|
|
2870
|
-
}
|
|
2871
|
-
}
|
|
2872
|
-
function ll(e, t, n) {
|
|
2873
|
-
let { node: r } = e;
|
|
2874
|
-
return Mt(e, t, n, n("left"), [" ", r.operator], "right");
|
|
2875
|
-
}
|
|
2876
|
-
function cl(e, t, n) {
|
|
2877
|
-
return Mt(e, t, n, n("id"), " =", "init");
|
|
2878
|
-
}
|
|
2879
|
-
function Dl(e, t, n, r, u) {
|
|
2880
|
-
let { node: a } = e, o = a[u];
|
|
2881
|
-
if (!o)
|
|
2882
|
-
return "only-left";
|
|
2883
|
-
let i = !Vt(o);
|
|
2884
|
-
if (e.match(Vt, $u, (d) => !i || d.type !== "ExpressionStatement" && d.type !== "VariableDeclaration"))
|
|
2885
|
-
return i ? o.type === "ArrowFunctionExpression" && o.body.type === "ArrowFunctionExpression" ? "chain-tail-arrow-chain" : "chain-tail" : "chain";
|
|
2886
|
-
if (!i && Vt(o.right) || qe(t.originalText, o))
|
|
2887
|
-
return "break-after-operator";
|
|
2888
|
-
if (a.type === "ImportAttribute" || o.type === "CallExpression" && o.callee.name === "require" || t.parser === "json5" || t.parser === "jsonc" || t.parser === "json")
|
|
2889
|
-
return "never-break-after-operator";
|
|
2890
|
-
let s = Ai(r);
|
|
2891
|
-
if (dl(a) || Fl(a) || Wu(a) && s)
|
|
2892
|
-
return "break-lhs";
|
|
2893
|
-
let l = gl(a, r, t);
|
|
2894
|
-
return e.call(() => yl(e, t, n, l), u) ? "break-after-operator" : ml(a) ? "break-lhs" : !s && (l || o.type === "TemplateLiteral" || o.type === "TaggedTemplateExpression" || o.type === "BooleanLiteral" || be(o) || o.type === "ClassExpression") ? "never-break-after-operator" : "fluid";
|
|
2895
|
-
}
|
|
2896
|
-
function yl(e, t, n, r) {
|
|
2897
|
-
let u = e.node;
|
|
2898
|
-
if (Be(u) && !jt(u))
|
|
2899
|
-
return !0;
|
|
2900
|
-
switch (u.type) {
|
|
2901
|
-
case "StringLiteralTypeAnnotation":
|
|
2902
|
-
case "SequenceExpression":
|
|
2903
|
-
return !0;
|
|
2904
|
-
case "TSConditionalType":
|
|
2905
|
-
case "ConditionalTypeAnnotation":
|
|
2906
|
-
if (!t.experimentalTernaries && !Cl(u))
|
|
2907
|
-
break;
|
|
2908
|
-
return !0;
|
|
2909
|
-
case "ConditionalExpression": {
|
|
2910
|
-
if (!t.experimentalTernaries) {
|
|
2911
|
-
let { test: l } = u;
|
|
2912
|
-
return Be(l) && !jt(l);
|
|
2913
|
-
}
|
|
2914
|
-
let { consequent: i, alternate: s } = u;
|
|
2915
|
-
return i.type === "ConditionalExpression" || s.type === "ConditionalExpression";
|
|
2916
|
-
}
|
|
2917
|
-
case "ClassExpression":
|
|
2918
|
-
return O(u.decorators);
|
|
2919
|
-
}
|
|
2920
|
-
if (r)
|
|
2921
|
-
return !1;
|
|
2922
|
-
let a = u, o = [];
|
|
2923
|
-
for (; ; )
|
|
2924
|
-
if (a.type === "UnaryExpression" || a.type === "AwaitExpression" || a.type === "YieldExpression" && a.argument !== null)
|
|
2925
|
-
a = a.argument, o.push("argument");
|
|
2926
|
-
else if (a.type === "TSNonNullExpression")
|
|
2927
|
-
a = a.expression, o.push("expression");
|
|
2928
|
-
else
|
|
2929
|
-
break;
|
|
2930
|
-
return !!(ue(a) || e.call(() => Uu(e, t, n), ...o));
|
|
2931
|
-
}
|
|
2932
|
-
function dl(e) {
|
|
2933
|
-
if ($u(e)) {
|
|
2934
|
-
let t = e.left || e.id;
|
|
2935
|
-
return t.type === "ObjectPattern" && t.properties.length > 2 && t.properties.some((n) => {
|
|
2936
|
-
var r;
|
|
2937
|
-
return Ne(n) && (!n.shorthand || ((r = n.value) == null ? void 0 : r.type) === "AssignmentPattern");
|
|
2938
|
-
});
|
|
2939
|
-
}
|
|
2940
|
-
return !1;
|
|
2941
|
-
}
|
|
2942
|
-
function Vt(e) {
|
|
2943
|
-
return e.type === "AssignmentExpression";
|
|
2944
|
-
}
|
|
2945
|
-
function $u(e) {
|
|
2946
|
-
return Vt(e) || e.type === "VariableDeclarator";
|
|
2947
|
-
}
|
|
2948
|
-
function ml(e) {
|
|
2949
|
-
let t = El(e);
|
|
2950
|
-
if (O(t)) {
|
|
2951
|
-
let n = e.type === "TSTypeAliasDeclaration" ? "constraint" : "bound";
|
|
2952
|
-
if (t.length > 1 && t.some((r) => r[n] || r.default))
|
|
2953
|
-
return !0;
|
|
2954
|
-
}
|
|
2955
|
-
return !1;
|
|
2956
|
-
}
|
|
2957
|
-
var fl = J(["TSTypeAliasDeclaration", "TypeAlias"]);
|
|
2958
|
-
function El(e) {
|
|
2959
|
-
var t;
|
|
2960
|
-
if (fl(e))
|
|
2961
|
-
return (t = e.typeParameters) == null ? void 0 : t.params;
|
|
2962
|
-
}
|
|
2963
|
-
function Fl(e) {
|
|
2964
|
-
if (e.type !== "VariableDeclarator")
|
|
2965
|
-
return !1;
|
|
2966
|
-
let { typeAnnotation: t } = e.id;
|
|
2967
|
-
if (!t || !t.typeAnnotation)
|
|
2968
|
-
return !1;
|
|
2969
|
-
let n = wr(t.typeAnnotation);
|
|
2970
|
-
return O(n) && n.length > 1 && n.some((r) => O(wr(r)) || r.type === "TSConditionalType");
|
|
2971
|
-
}
|
|
2972
|
-
function Wu(e) {
|
|
2973
|
-
var t;
|
|
2974
|
-
return e.type === "VariableDeclarator" && ((t = e.init) == null ? void 0 : t.type) === "ArrowFunctionExpression";
|
|
2975
|
-
}
|
|
2976
|
-
var Al = J(["TSTypeReference", "GenericTypeAnnotation"]);
|
|
2977
|
-
function wr(e) {
|
|
2978
|
-
var t;
|
|
2979
|
-
if (Al(e))
|
|
2980
|
-
return (t = e.typeArguments ?? e.typeParameters) == null ? void 0 : t.params;
|
|
2981
|
-
}
|
|
2982
|
-
function Uu(e, t, n, r = !1) {
|
|
2983
|
-
var u;
|
|
2984
|
-
let { node: a } = e, o = () => Uu(e, t, n, !0);
|
|
2985
|
-
if (a.type === "ChainExpression" || a.type === "TSNonNullExpression")
|
|
2986
|
-
return e.call(o, "expression");
|
|
2987
|
-
if (L(a)) {
|
|
2988
|
-
if ((u = Ru(e, t, n).label) != null && u.memberChain)
|
|
2989
|
-
return !1;
|
|
2990
|
-
let i = ye(a);
|
|
2991
|
-
return !(i.length === 0 || i.length === 1 && Gn(i[0], t)) || xl(a, n) ? !1 : e.call(o, "callee");
|
|
2992
|
-
}
|
|
2993
|
-
return U(a) ? e.call(o, "object") : r && (a.type === "Identifier" || a.type === "ThisExpression");
|
|
2994
|
-
}
|
|
2995
|
-
function gl(e, t, n) {
|
|
2996
|
-
return Ne(e) ? (t = zn(t), typeof t == "string" && ct(t) < n.tabWidth + 3) : !1;
|
|
2997
|
-
}
|
|
2998
|
-
function xl(e, t) {
|
|
2999
|
-
let n = hl(e);
|
|
3000
|
-
if (O(n)) {
|
|
3001
|
-
if (n.length > 1)
|
|
3002
|
-
return !0;
|
|
3003
|
-
if (n.length === 1) {
|
|
3004
|
-
let u = n[0];
|
|
3005
|
-
if (_e(u) || Kn(u) || u.type === "TSTypeLiteral" || u.type === "ObjectTypeAnnotation")
|
|
3006
|
-
return !0;
|
|
3007
|
-
}
|
|
3008
|
-
let r = e.typeParameters ? "typeParameters" : "typeArguments";
|
|
3009
|
-
if (te(t(r)))
|
|
3010
|
-
return !0;
|
|
3011
|
-
}
|
|
3012
|
-
return !1;
|
|
3013
|
-
}
|
|
3014
|
-
function hl(e) {
|
|
3015
|
-
var t;
|
|
3016
|
-
return (t = e.typeParameters ?? e.typeArguments) == null ? void 0 : t.params;
|
|
3017
|
-
}
|
|
3018
|
-
function Cl(e) {
|
|
3019
|
-
function t(n) {
|
|
3020
|
-
switch (n.type) {
|
|
3021
|
-
case "FunctionTypeAnnotation":
|
|
3022
|
-
case "GenericTypeAnnotation":
|
|
3023
|
-
case "TSFunctionType":
|
|
3024
|
-
return !!n.typeParameters;
|
|
3025
|
-
case "TSTypeReference":
|
|
3026
|
-
return !!(n.typeArguments ?? n.typeParameters);
|
|
3027
|
-
default:
|
|
3028
|
-
return !1;
|
|
3029
|
-
}
|
|
3030
|
-
}
|
|
3031
|
-
return t(e.checkType) || t(e.extendsType);
|
|
3032
|
-
}
|
|
3033
|
-
function at(e, t, n, r, u) {
|
|
3034
|
-
let a = e.node, o = Z(a), i = u ? ze(e, n, t) : "";
|
|
3035
|
-
if (o.length === 0)
|
|
3036
|
-
return [i, "(", R(e, n, { filter: (p) => Ae(n.originalText, j(p)) === ")" }), ")"];
|
|
3037
|
-
let { parent: s } = e, l = rn(s), d = Gu(a), c = [];
|
|
3038
|
-
if (oi(e, (p, y) => {
|
|
3039
|
-
let E = y === o.length - 1;
|
|
3040
|
-
E && a.rest && c.push("..."), c.push(t()), !E && (c.push(","), l || d ? c.push(" ") : we(o[y], n) ? c.push(F, F) : c.push(C));
|
|
3041
|
-
}), r && !Sl(e)) {
|
|
3042
|
-
if (te(i) || te(c))
|
|
3043
|
-
throw new Yt();
|
|
3044
|
-
return m([Tn(i), "(", Tn(c), ")"]);
|
|
3045
|
-
}
|
|
3046
|
-
let D = o.every((p) => !O(p.decorators));
|
|
3047
|
-
return d && D ? [i, "(", ...c, ")"] : l ? [i, "(", ...c, ")"] : (Qr(s) || Ko(s) || s.type === "TypeAlias" || s.type === "UnionTypeAnnotation" || s.type === "IntersectionTypeAnnotation" || s.type === "FunctionTypeAnnotation" && s.returnType === a) && o.length === 1 && o[0].name === null && a.this !== o[0] && o[0].typeAnnotation && a.typeParameters === null && Un(o[0].typeAnnotation) && !a.rest ? n.arrowParens === "always" || a.type === "HookTypeAnnotation" ? ["(", ...c, ")"] : c : [i, "(", A([f, ...c]), w(!ai(a) && Pe(n, "all") ? "," : ""), f, ")"];
|
|
3048
|
-
}
|
|
3049
|
-
function Gu(e) {
|
|
3050
|
-
if (!e)
|
|
3051
|
-
return !1;
|
|
3052
|
-
let t = Z(e);
|
|
3053
|
-
if (t.length !== 1)
|
|
3054
|
-
return !1;
|
|
3055
|
-
let [n] = t;
|
|
3056
|
-
return !h(n) && (n.type === "ObjectPattern" || n.type === "ArrayPattern" || n.type === "Identifier" && n.typeAnnotation && (n.typeAnnotation.type === "TypeAnnotation" || n.typeAnnotation.type === "TSTypeAnnotation") && Je(n.typeAnnotation.typeAnnotation) || n.type === "FunctionTypeParam" && Je(n.typeAnnotation) && n !== e.rest || n.type === "AssignmentPattern" && (n.left.type === "ObjectPattern" || n.left.type === "ArrayPattern") && (n.right.type === "Identifier" || Fe(n.right) && n.right.properties.length === 0 || Q(n.right) && n.right.elements.length === 0));
|
|
3057
|
-
}
|
|
3058
|
-
function Tl(e) {
|
|
3059
|
-
let t;
|
|
3060
|
-
return e.returnType ? (t = e.returnType, t.typeAnnotation && (t = t.typeAnnotation)) : e.typeAnnotation && (t = e.typeAnnotation), t;
|
|
3061
|
-
}
|
|
3062
|
-
function ht(e, t) {
|
|
3063
|
-
var n;
|
|
3064
|
-
let r = Tl(e);
|
|
3065
|
-
if (!r)
|
|
3066
|
-
return !1;
|
|
3067
|
-
let u = (n = e.typeParameters) == null ? void 0 : n.params;
|
|
3068
|
-
if (u) {
|
|
3069
|
-
if (u.length > 1)
|
|
3070
|
-
return !1;
|
|
3071
|
-
if (u.length === 1) {
|
|
3072
|
-
let a = u[0];
|
|
3073
|
-
if (a.constraint || a.default)
|
|
3074
|
-
return !1;
|
|
3075
|
-
}
|
|
3076
|
-
}
|
|
3077
|
-
return Z(e).length === 1 && (Je(r) || te(t));
|
|
3078
|
-
}
|
|
3079
|
-
function Sl(e) {
|
|
3080
|
-
return e.match((t) => t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement", (t, n) => {
|
|
3081
|
-
if (t.type === "CallExpression" && n === "arguments" && t.arguments.length === 1 && t.callee.type === "CallExpression") {
|
|
3082
|
-
let r = t.callee.callee;
|
|
3083
|
-
return r.type === "Identifier" || r.type === "MemberExpression" && !r.computed && r.object.type === "Identifier" && r.property.type === "Identifier";
|
|
3084
|
-
}
|
|
3085
|
-
return !1;
|
|
3086
|
-
}, (t, n) => t.type === "VariableDeclarator" && n === "init" || t.type === "ExportDefaultDeclaration" && n === "declaration" || t.type === "TSExportAssignment" && n === "expression" || t.type === "AssignmentExpression" && n === "right" && t.left.type === "MemberExpression" && t.left.object.type === "Identifier" && t.left.object.name === "module" && t.left.property.type === "Identifier" && t.left.property.name === "exports", (t) => t.type !== "VariableDeclaration" || t.kind === "const" && t.declarations.length === 1);
|
|
3087
|
-
}
|
|
3088
|
-
function bl(e) {
|
|
3089
|
-
let t = Z(e);
|
|
3090
|
-
return t.length > 1 && t.some((n) => n.type === "TSParameterProperty");
|
|
3091
|
-
}
|
|
3092
|
-
var Bl = J(["VoidTypeAnnotation", "TSVoidKeyword", "NullLiteralTypeAnnotation", "TSNullKeyword"]), vl = J(["ObjectTypeAnnotation", "TSTypeLiteral", "GenericTypeAnnotation", "TSTypeReference"]);
|
|
3093
|
-
function kl(e) {
|
|
3094
|
-
let { types: t } = e;
|
|
3095
|
-
if (t.some((r) => h(r)))
|
|
3096
|
-
return !1;
|
|
3097
|
-
let n = t.find((r) => vl(r));
|
|
3098
|
-
return n ? t.every((r) => r === n || Bl(r)) : !1;
|
|
3099
|
-
}
|
|
3100
|
-
function Vu(e) {
|
|
3101
|
-
return Un(e) || Je(e) ? !0 : _e(e) ? kl(e) : !1;
|
|
3102
|
-
}
|
|
3103
|
-
function Pl(e, t, n) {
|
|
3104
|
-
let r = t.semi ? ";" : "", { node: u } = e, a = [ae(e), "opaque type ", n("id"), n("typeParameters")];
|
|
3105
|
-
return u.supertype && a.push(": ", n("supertype")), u.impltype && a.push(" = ", n("impltype")), a.push(r), a;
|
|
3106
|
-
}
|
|
3107
|
-
function Ku(e, t, n) {
|
|
3108
|
-
let r = t.semi ? ";" : "", { node: u } = e, a = [ae(e)];
|
|
3109
|
-
a.push("type ", n("id"), n("typeParameters"));
|
|
3110
|
-
let o = u.type === "TSTypeAliasDeclaration" ? "typeAnnotation" : "right";
|
|
3111
|
-
return [Mt(e, t, n, a, " =", o), r];
|
|
3112
|
-
}
|
|
3113
|
-
function Hu(e, t, n) {
|
|
3114
|
-
let r = !1;
|
|
3115
|
-
return m(e.map(({ isFirst: u, previous: a, node: o, index: i }) => {
|
|
3116
|
-
let s = n();
|
|
3117
|
-
if (u)
|
|
3118
|
-
return s;
|
|
3119
|
-
let l = Je(o), d = Je(a);
|
|
3120
|
-
return d && l ? [" & ", r ? A(s) : s] : !d && !l ? t.experimentalOperatorPosition === "start" ? A([C, "& ", s]) : A([" &", C, s]) : (i > 1 && (r = !0), [" & ", i > 1 ? A(s) : s]);
|
|
3121
|
-
}, "types"));
|
|
3122
|
-
}
|
|
3123
|
-
function zu(e, t, n) {
|
|
3124
|
-
let { node: r } = e, { parent: u } = e, a = u.type !== "TypeParameterInstantiation" && (!Xe(u) || !t.experimentalTernaries) && u.type !== "TSTypeParameterInstantiation" && u.type !== "GenericTypeAnnotation" && u.type !== "TSTypeReference" && u.type !== "TSTypeAssertion" && u.type !== "TupleTypeAnnotation" && u.type !== "TSTupleType" && !(u.type === "FunctionTypeParam" && !u.name && e.grandparent.this !== u) && !((u.type === "TypeAlias" || u.type === "VariableDeclarator" || u.type === "TSTypeAliasDeclaration") && qe(t.originalText, r)), o = Vu(r), i = e.map((d) => {
|
|
3125
|
-
let c = n();
|
|
3126
|
-
return o || (c = Ce(2, c)), Ee(d, c, t);
|
|
3127
|
-
}, "types");
|
|
3128
|
-
if (o)
|
|
3129
|
-
return I(" | ", i);
|
|
3130
|
-
let s = a && !qe(t.originalText, r), l = [w([s ? C : "", "| "]), I([C, "| "], i)];
|
|
3131
|
-
return ut(e, t) ? m([A(l), f]) : (u.type === "TupleTypeAnnotation" || u.type === "TSTupleType") && u[u.type === "TupleTypeAnnotation" && u.types ? "types" : "elementTypes"].length > 1 ? m([A([w(["(", f]), l]), f, w(")")]) : m(a ? A(l) : l);
|
|
3132
|
-
}
|
|
3133
|
-
function wl(e) {
|
|
3134
|
-
var t;
|
|
3135
|
-
let { node: n, parent: r } = e;
|
|
3136
|
-
return n.type === "FunctionTypeAnnotation" && (Qr(r) || !((r.type === "ObjectTypeProperty" || r.type === "ObjectTypeInternalSlot") && !r.variance && !r.optional && tn(r, n) || r.type === "ObjectTypeCallProperty" || ((t = e.getParentNode(2)) == null ? void 0 : t.type) === "DeclareFunction"));
|
|
3137
|
-
}
|
|
3138
|
-
function Qu(e, t, n) {
|
|
3139
|
-
let { node: r } = e, u = [on(e)];
|
|
3140
|
-
(r.type === "TSConstructorType" || r.type === "TSConstructSignatureDeclaration") && u.push("new ");
|
|
3141
|
-
let a = at(e, n, t, !1, !0), o = [];
|
|
3142
|
-
return r.type === "FunctionTypeAnnotation" ? o.push(wl(e) ? " => " : ": ", n("returnType")) : o.push(z(e, n, r.returnType ? "returnType" : "typeAnnotation")), ht(r, o) && (a = m(a)), u.push(a, o), m(u);
|
|
3143
|
-
}
|
|
3144
|
-
function Yu(e, t, n) {
|
|
3145
|
-
return [n("objectType"), ne(e), "[", n("indexType"), "]"];
|
|
3146
|
-
}
|
|
3147
|
-
function Zu(e, t, n) {
|
|
3148
|
-
return ["infer ", n("typeParameter")];
|
|
3149
|
-
}
|
|
3150
|
-
function Nr(e, t, n) {
|
|
3151
|
-
let { node: r } = e;
|
|
3152
|
-
return [r.postfix ? "" : n, z(e, t), r.postfix ? n : ""];
|
|
3153
|
-
}
|
|
3154
|
-
function ea(e, t, n) {
|
|
3155
|
-
let { node: r } = e;
|
|
3156
|
-
return ["...", ...r.type === "TupleTypeSpreadElement" && r.label ? [n("label"), ": "] : [], n("typeAnnotation")];
|
|
3157
|
-
}
|
|
3158
|
-
function ta(e, t, n) {
|
|
3159
|
-
let { node: r } = e;
|
|
3160
|
-
return [r.variance ? n("variance") : "", n("label"), r.optional ? "?" : "", ": ", n("elementType")];
|
|
3161
|
-
}
|
|
3162
|
-
var Nl = /* @__PURE__ */ new WeakSet();
|
|
3163
|
-
function z(e, t, n = "typeAnnotation") {
|
|
3164
|
-
let { node: { [n]: r } } = e;
|
|
3165
|
-
if (!r)
|
|
3166
|
-
return "";
|
|
3167
|
-
let u = !1;
|
|
3168
|
-
if (r.type === "TSTypeAnnotation" || r.type === "TypeAnnotation") {
|
|
3169
|
-
let a = e.call(na, n);
|
|
3170
|
-
(a === "=>" || a === ":" && h(r, T.Leading)) && (u = !0), Nl.add(r);
|
|
3171
|
-
}
|
|
3172
|
-
return u ? [" ", t(n)] : t(n);
|
|
3173
|
-
}
|
|
3174
|
-
var na = (e) => e.match((t) => t.type === "TSTypeAnnotation", (t, n) => (n === "returnType" || n === "typeAnnotation") && (t.type === "TSFunctionType" || t.type === "TSConstructorType")) ? "=>" : e.match((t) => t.type === "TSTypeAnnotation", (t, n) => n === "typeAnnotation" && (t.type === "TSJSDocNullableType" || t.type === "TSJSDocNonNullableType" || t.type === "TSTypePredicate")) || e.match((t) => t.type === "TypeAnnotation", (t, n) => n === "typeAnnotation" && t.type === "Identifier", (t, n) => n === "id" && t.type === "DeclareFunction") || e.match((t) => t.type === "TypeAnnotation", (t, n) => n === "typeAnnotation" && t.type === "Identifier", (t, n) => n === "id" && t.type === "DeclareHook") || e.match((t) => t.type === "TypeAnnotation", (t, n) => n === "bound" && t.type === "TypeParameter" && t.usesExtendsBound) ? "" : ":";
|
|
3175
|
-
function ra(e, t, n) {
|
|
3176
|
-
let r = na(e);
|
|
3177
|
-
return r ? [r, " ", n("typeAnnotation")] : n("typeAnnotation");
|
|
3178
|
-
}
|
|
3179
|
-
function ua(e) {
|
|
3180
|
-
return [e("elementType"), "[]"];
|
|
3181
|
-
}
|
|
3182
|
-
function aa({ node: e }, t) {
|
|
3183
|
-
let n = e.type === "TSTypeQuery" ? "exprName" : "argument", r = e.type === "TypeofTypeAnnotation" || e.typeArguments ? "typeArguments" : "typeParameters";
|
|
3184
|
-
return ["typeof ", t(n), t(r)];
|
|
3185
|
-
}
|
|
3186
|
-
function oa(e, t) {
|
|
3187
|
-
let { node: n } = e;
|
|
3188
|
-
return [n.type === "TSTypePredicate" && n.asserts ? "asserts " : n.type === "TypePredicate" && n.kind ? `${n.kind} ` : "", t("parameterName"), n.typeAnnotation ? [" is ", z(e, t)] : ""];
|
|
3189
|
-
}
|
|
3190
|
-
function ne(e) {
|
|
3191
|
-
let { node: t } = e;
|
|
3192
|
-
return !t.optional || t.type === "Identifier" && t === e.parent.key ? "" : L(t) || U(t) && t.computed || t.type === "OptionalIndexedAccessType" ? "?." : "?";
|
|
3193
|
-
}
|
|
3194
|
-
function ia(e) {
|
|
3195
|
-
return e.node.definite || e.match(void 0, (t, n) => n === "id" && t.type === "VariableDeclarator" && t.definite) ? "!" : "";
|
|
3196
|
-
}
|
|
3197
|
-
var Il = /* @__PURE__ */ new Set(["DeclareClass", "DeclareComponent", "DeclareFunction", "DeclareHook", "DeclareVariable", "DeclareExportDeclaration", "DeclareExportAllDeclaration", "DeclareOpaqueType", "DeclareTypeAlias", "DeclareEnum", "DeclareInterface"]);
|
|
3198
|
-
function ae(e) {
|
|
3199
|
-
let { node: t } = e;
|
|
3200
|
-
return t.declare || Il.has(t.type) && e.parent.type !== "DeclareExportDeclaration" ? "declare " : "";
|
|
3201
|
-
}
|
|
3202
|
-
var jl = /* @__PURE__ */ new Set(["TSAbstractMethodDefinition", "TSAbstractPropertyDefinition", "TSAbstractAccessorProperty"]);
|
|
3203
|
-
function on({ node: e }) {
|
|
3204
|
-
return e.abstract || jl.has(e.type) ? "abstract " : "";
|
|
3205
|
-
}
|
|
3206
|
-
function ze(e, t, n) {
|
|
3207
|
-
let r = e.node;
|
|
3208
|
-
return r.typeArguments ? n("typeArguments") : r.typeParameters ? n("typeParameters") : "";
|
|
3209
|
-
}
|
|
3210
|
-
function sa(e, t, n) {
|
|
3211
|
-
return ["::", n("callee")];
|
|
3212
|
-
}
|
|
3213
|
-
function Me(e, t, n) {
|
|
3214
|
-
return e.type === "EmptyStatement" ? ";" : e.type === "BlockStatement" || n ? [" ", t] : A([C, t]);
|
|
3215
|
-
}
|
|
3216
|
-
function pa(e, t) {
|
|
3217
|
-
return ["...", t("argument"), z(e, t)];
|
|
3218
|
-
}
|
|
3219
|
-
function Zt(e) {
|
|
3220
|
-
return e.accessibility ? e.accessibility + " " : "";
|
|
3221
|
-
}
|
|
3222
|
-
function Ll(e, t, n, r) {
|
|
3223
|
-
let { node: u } = e, a = u.inexact ? "..." : "";
|
|
3224
|
-
return h(u, T.Dangling) ? m([n, a, R(e, t, { indent: !0 }), f, r]) : [n, a, r];
|
|
3225
|
-
}
|
|
3226
|
-
function ur(e, t, n) {
|
|
3227
|
-
let { node: r } = e, u = [], a = r.type === "TupleExpression" ? "#[" : "[", o = "]", i = r.type === "TupleTypeAnnotation" && r.types ? "types" : r.type === "TSTupleType" || r.type === "TupleTypeAnnotation" ? "elementTypes" : "elements", s = r[i];
|
|
3228
|
-
if (s.length === 0)
|
|
3229
|
-
u.push(Ll(e, t, a, o));
|
|
3230
|
-
else {
|
|
3231
|
-
let l = _(!1, s, -1), d = (l == null ? void 0 : l.type) !== "RestElement" && !r.inexact, c = l === null, D = Symbol("array"), p = !t.__inJestEach && s.length > 1 && s.every((g, S, B) => {
|
|
3232
|
-
let x = g == null ? void 0 : g.type;
|
|
3233
|
-
if (!Q(g) && !Fe(g))
|
|
3234
|
-
return !1;
|
|
3235
|
-
let N = B[S + 1];
|
|
3236
|
-
if (N && x !== N.type)
|
|
3237
|
-
return !1;
|
|
3238
|
-
let b = Q(g) ? "elements" : "properties";
|
|
3239
|
-
return g[b] && g[b].length > 1;
|
|
3240
|
-
}), y = la(r, t), E = d ? c ? "," : Pe(t) ? y ? w(",", "", { groupId: D }) : w(",") : "" : "";
|
|
3241
|
-
u.push(m([a, A([f, y ? Ol(e, t, n, E) : [Ml(e, t, i, r.inexact, n), E], R(e, t)]), f, o], { shouldBreak: p, id: D }));
|
|
3242
|
-
}
|
|
3243
|
-
return u.push(ne(e), z(e, n)), u;
|
|
3244
|
-
}
|
|
3245
|
-
function la(e, t) {
|
|
3246
|
-
return Q(e) && e.elements.length > 1 && e.elements.every((n) => n && (be(n) || Hr(n) && !h(n.argument)) && !h(n, T.Trailing | T.Line, (r) => !se(t.originalText, W(r), { backwards: !0 })));
|
|
3247
|
-
}
|
|
3248
|
-
function ca({ node: e }, { originalText: t }) {
|
|
3249
|
-
let n = (u) => qn(t, _n(t, u)), r = (u) => t[u] === "," ? u : r(n(u + 1));
|
|
3250
|
-
return Xn(t, r(j(e)));
|
|
3251
|
-
}
|
|
3252
|
-
function Ml(e, t, n, r, u) {
|
|
3253
|
-
let a = [];
|
|
3254
|
-
return e.each(({ node: o, isLast: i }) => {
|
|
3255
|
-
a.push(o ? m(u()) : ""), (!i || r) && a.push([",", C, o && ca(e, t) ? f : ""]);
|
|
3256
|
-
}, n), r && a.push("..."), a;
|
|
3257
|
-
}
|
|
3258
|
-
function Ol(e, t, n, r) {
|
|
3259
|
-
let u = [];
|
|
3260
|
-
return e.each(({ isLast: a, next: o }) => {
|
|
3261
|
-
u.push([n(), a ? r : ","]), a || u.push(ca(e, t) ? [F, F] : h(o, T.Leading | T.Line) ? F : C);
|
|
3262
|
-
}, "elements"), su(u);
|
|
3263
|
-
}
|
|
3264
|
-
var Jl = /^[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/, ql = (e) => Jl.test(e), _l = ql;
|
|
3265
|
-
function Xl(e) {
|
|
3266
|
-
return e.length === 1 ? e : e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u, "$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u, "$1").replace(/^([+-])?\./u, "$10.").replace(/(\.\d+?)0+(?=e|$)/u, "$1").replace(/\.(?=e|$)/u, "");
|
|
3267
|
-
}
|
|
3268
|
-
var ft = Xl, Kt = /* @__PURE__ */ new WeakMap();
|
|
3269
|
-
function Da(e) {
|
|
3270
|
-
return /^(?:\d+|\d+\.\d+)$/u.test(e);
|
|
3271
|
-
}
|
|
3272
|
-
function Ir(e, t) {
|
|
3273
|
-
return t.parser === "json" || t.parser === "jsonc" || !ue(e.key) || dt(pe(e.key), t).slice(1, -1) !== e.key.value ? !1 : !!(_l(e.key.value) && !(t.parser === "babel-ts" && e.type === "ClassProperty" || t.parser === "typescript" && e.type === "PropertyDefinition") || Da(e.key.value) && String(Number(e.key.value)) === e.key.value && e.type !== "ImportAttribute" && (t.parser === "babel" || t.parser === "acorn" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree"));
|
|
3274
|
-
}
|
|
3275
|
-
function Rl(e, t) {
|
|
3276
|
-
let { key: n } = e.node;
|
|
3277
|
-
return (n.type === "Identifier" || be(n) && Da(ft(pe(n))) && String(n.value) === ft(pe(n)) && !(t.parser === "typescript" || t.parser === "babel-ts")) && (t.parser === "json" || t.parser === "jsonc" || t.quoteProps === "consistent" && Kt.get(e.parent));
|
|
3278
|
-
}
|
|
3279
|
-
function Ot(e, t, n) {
|
|
3280
|
-
let { node: r } = e;
|
|
3281
|
-
if (r.computed)
|
|
3282
|
-
return ["[", n("key"), "]"];
|
|
3283
|
-
let { parent: u } = e, { key: a } = r;
|
|
3284
|
-
if (t.quoteProps === "consistent" && !Kt.has(u)) {
|
|
3285
|
-
let o = e.siblings.some((i) => !i.computed && ue(i.key) && !Ir(i, t));
|
|
3286
|
-
Kt.set(u, o);
|
|
3287
|
-
}
|
|
3288
|
-
if (Rl(e, t)) {
|
|
3289
|
-
let o = dt(JSON.stringify(a.type === "Identifier" ? a.name : a.value.toString()), t);
|
|
3290
|
-
return e.call((i) => Ee(i, o, t), "key");
|
|
3291
|
-
}
|
|
3292
|
-
return Ir(r, t) && (t.quoteProps === "as-needed" || t.quoteProps === "consistent" && !Kt.get(u)) ? e.call((o) => Ee(o, /^\d/u.test(a.value) ? ft(a.value) : a.value, t), "key") : n("key");
|
|
3293
|
-
}
|
|
3294
|
-
function En(e, t, n) {
|
|
3295
|
-
let { node: r } = e;
|
|
3296
|
-
return r.shorthand ? n("value") : Mt(e, t, n, Ot(e, t, n), ":", "value");
|
|
3297
|
-
}
|
|
3298
|
-
var $l = ({ node: e, key: t, parent: n }) => t === "value" && e.type === "FunctionExpression" && (n.type === "ObjectMethod" || n.type === "ClassMethod" || n.type === "ClassPrivateMethod" || n.type === "MethodDefinition" || n.type === "TSAbstractMethodDefinition" || n.type === "TSDeclareMethod" || n.type === "Property" && nn(n));
|
|
3299
|
-
function ya(e, t, n, r) {
|
|
3300
|
-
if ($l(e))
|
|
3301
|
-
return ar(e, n, t);
|
|
3302
|
-
let { node: u } = e, a = !1;
|
|
3303
|
-
if ((u.type === "FunctionDeclaration" || u.type === "FunctionExpression") && r != null && r.expandLastArg) {
|
|
3304
|
-
let { parent: d } = e;
|
|
3305
|
-
L(d) && (ye(d).length > 1 || Z(u).every((c) => c.type === "Identifier" && !c.typeAnnotation)) && (a = !0);
|
|
3306
|
-
}
|
|
3307
|
-
let o = [ae(e), u.async ? "async " : "", `function${u.generator ? "*" : ""} `, u.id ? t("id") : ""], i = at(e, t, n, a), s = sn(e, t), l = ht(u, s);
|
|
3308
|
-
return o.push(ze(e, n, t), m([l ? m(i) : i, s]), u.body ? " " : "", t("body")), n.semi && (u.declare || !u.body) && o.push(";"), o;
|
|
3309
|
-
}
|
|
3310
|
-
function Ln(e, t, n) {
|
|
3311
|
-
let { node: r } = e, { kind: u } = r, a = r.value || r, o = [];
|
|
3312
|
-
return !u || u === "init" || u === "method" || u === "constructor" ? a.async && o.push("async ") : (Rn.ok(u === "get" || u === "set"), o.push(u, " ")), a.generator && o.push("*"), o.push(Ot(e, t, n), r.optional || r.key.optional ? "?" : "", r === a ? ar(e, t, n) : n("value")), o;
|
|
3313
|
-
}
|
|
3314
|
-
function ar(e, t, n) {
|
|
3315
|
-
let { node: r } = e, u = at(e, n, t), a = sn(e, n), o = bl(r), i = ht(r, a), s = [ze(e, t, n), m([o ? m(u, { shouldBreak: !0 }) : i ? m(u) : u, a])];
|
|
3316
|
-
return r.body ? s.push(" ", n("body")) : s.push(t.semi ? ";" : ""), s;
|
|
3317
|
-
}
|
|
3318
|
-
function Wl(e) {
|
|
3319
|
-
let t = Z(e);
|
|
3320
|
-
return t.length === 1 && !e.typeParameters && !h(e, T.Dangling) && t[0].type === "Identifier" && !t[0].typeAnnotation && !h(t[0]) && !t[0].optional && !e.predicate && !e.returnType;
|
|
3321
|
-
}
|
|
3322
|
-
function da(e, t) {
|
|
3323
|
-
if (t.arrowParens === "always")
|
|
3324
|
-
return !1;
|
|
3325
|
-
if (t.arrowParens === "avoid") {
|
|
3326
|
-
let { node: n } = e;
|
|
3327
|
-
return Wl(n);
|
|
3328
|
-
}
|
|
3329
|
-
return !1;
|
|
3330
|
-
}
|
|
3331
|
-
function sn(e, t) {
|
|
3332
|
-
let { node: n } = e, r = [z(e, t, "returnType")];
|
|
3333
|
-
return n.predicate && r.push(t("predicate")), r;
|
|
3334
|
-
}
|
|
3335
|
-
function ma(e, t, n) {
|
|
3336
|
-
let { node: r } = e, u = t.semi ? ";" : "", a = [];
|
|
3337
|
-
if (r.argument) {
|
|
3338
|
-
let s = n("argument");
|
|
3339
|
-
Vl(t, r.argument) ? s = ["(", A([F, s]), F, ")"] : (Be(r.argument) || r.argument.type === "SequenceExpression" || t.experimentalTernaries && r.argument.type === "ConditionalExpression" && (r.argument.consequent.type === "ConditionalExpression" || r.argument.alternate.type === "ConditionalExpression")) && (s = m([w("("), A([f, s]), f, w(")")])), a.push(" ", s);
|
|
3340
|
-
}
|
|
3341
|
-
let o = h(r, T.Dangling), i = u && o && h(r, T.Last | T.Line);
|
|
3342
|
-
return i && a.push(u), o && a.push(" ", R(e, t)), i || a.push(u), a;
|
|
3343
|
-
}
|
|
3344
|
-
function Ul(e, t, n) {
|
|
3345
|
-
return ["return", ma(e, t, n)];
|
|
3346
|
-
}
|
|
3347
|
-
function Gl(e, t, n) {
|
|
3348
|
-
return ["throw", ma(e, t, n)];
|
|
3349
|
-
}
|
|
3350
|
-
function Vl(e, t) {
|
|
3351
|
-
if (qe(e.originalText, t) || h(t, T.Leading, (n) => Re(e.originalText, W(n), j(n))) && !K(t))
|
|
3352
|
-
return !0;
|
|
3353
|
-
if ($n(t)) {
|
|
3354
|
-
let n = t, r;
|
|
3355
|
-
for (; r = $o(n); )
|
|
3356
|
-
if (n = r, qe(e.originalText, n))
|
|
3357
|
-
return !0;
|
|
3358
|
-
}
|
|
3359
|
-
return !1;
|
|
3360
|
-
}
|
|
3361
|
-
var Fn = /* @__PURE__ */ new WeakMap();
|
|
3362
|
-
function fa(e) {
|
|
3363
|
-
return Fn.has(e) || Fn.set(e, e.type === "ConditionalExpression" && !ee(e, (t) => t.type === "ObjectExpression")), Fn.get(e);
|
|
3364
|
-
}
|
|
3365
|
-
var Ea = (e) => e.type === "SequenceExpression";
|
|
3366
|
-
function Kl(e, t, n, r = {}) {
|
|
3367
|
-
let u = [], a, o = [], i = !1, s = !r.expandLastArg && e.node.body.type === "ArrowFunctionExpression", l;
|
|
3368
|
-
(function S() {
|
|
3369
|
-
let { node: B } = e, x = Hl(e, t, n, r);
|
|
3370
|
-
if (u.length === 0)
|
|
3371
|
-
u.push(x);
|
|
3372
|
-
else {
|
|
3373
|
-
let { leading: N, trailing: b } = Iu(e, t);
|
|
3374
|
-
u.push([N, x]), o.unshift(b);
|
|
3375
|
-
}
|
|
3376
|
-
s && (i || (i = B.returnType && Z(B).length > 0 || B.typeParameters || Z(B).some((N) => N.type !== "Identifier"))), !s || B.body.type !== "ArrowFunctionExpression" ? (a = n("body", r), l = B.body) : e.call(S, "body");
|
|
3377
|
-
})();
|
|
3378
|
-
let d = !qe(t.originalText, l) && (Ea(l) || zl(l, a, t) || !i && fa(l)), c = e.key === "callee" && mt(e.parent), D = Symbol("arrow-chain"), p = Ql(e, r, { signatureDocs: u, shouldBreak: i }), y = !1, E = !1, g = !1;
|
|
3379
|
-
return s && (c || r.assignmentLayout) && (E = !0, g = !h(e.node, T.Leading & T.Line), y = r.assignmentLayout === "chain-tail-arrow-chain" || c && !d), a = Yl(e, t, r, { bodyDoc: a, bodyComments: o, functionBody: l, shouldPutBodyOnSameLine: d }), m([m(E ? A([g ? f : "", p]) : p, { shouldBreak: y, id: D }), " =>", s ? an(a, { groupId: D }) : m(a), s && c ? w(f, "", { groupId: D }) : ""]);
|
|
3380
|
-
}
|
|
3381
|
-
function Hl(e, t, n, r) {
|
|
3382
|
-
let { node: u } = e, a = [];
|
|
3383
|
-
if (u.async && a.push("async "), da(e, t))
|
|
3384
|
-
a.push(n(["params", 0]));
|
|
3385
|
-
else {
|
|
3386
|
-
let i = r.expandLastArg || r.expandFirstArg, s = sn(e, n);
|
|
3387
|
-
if (i) {
|
|
3388
|
-
if (te(s))
|
|
3389
|
-
throw new Yt();
|
|
3390
|
-
s = m(Tn(s));
|
|
3391
|
-
}
|
|
3392
|
-
a.push(m([at(e, n, t, i, !0), s]));
|
|
3393
|
-
}
|
|
3394
|
-
let o = R(e, t, { filter(i) {
|
|
3395
|
-
let s = gt(t.originalText, j(i));
|
|
3396
|
-
return s !== !1 && t.originalText.slice(s, s + 2) === "=>";
|
|
3397
|
-
} });
|
|
3398
|
-
return o && a.push(" ", o), a;
|
|
3399
|
-
}
|
|
3400
|
-
function zl(e, t, n) {
|
|
3401
|
-
var r, u;
|
|
3402
|
-
return Q(e) || Fe(e) || e.type === "ArrowFunctionExpression" || e.type === "DoExpression" || e.type === "BlockStatement" || K(e) || ((r = t.label) == null ? void 0 : r.hug) !== !1 && (((u = t.label) == null ? void 0 : u.embed) || eu(e, n.originalText));
|
|
3403
|
-
}
|
|
3404
|
-
function Ql(e, t, { signatureDocs: n, shouldBreak: r }) {
|
|
3405
|
-
if (n.length === 1)
|
|
3406
|
-
return n[0];
|
|
3407
|
-
let { parent: u, key: a } = e;
|
|
3408
|
-
return a !== "callee" && mt(u) || Be(u) ? m([n[0], " =>", A([C, I([" =>", C], n.slice(1))])], { shouldBreak: r }) : a === "callee" && mt(u) || t.assignmentLayout ? m(I([" =>", C], n), { shouldBreak: r }) : m(A(I([" =>", C], n)), { shouldBreak: r });
|
|
3409
|
-
}
|
|
3410
|
-
function Yl(e, t, n, { bodyDoc: r, bodyComments: u, functionBody: a, shouldPutBodyOnSameLine: o }) {
|
|
3411
|
-
let { node: i, parent: s } = e, l = n.expandLastArg && Pe(t, "all") ? w(",") : "", d = (n.expandLastArg || s.type === "JSXExpressionContainer") && !h(i) ? f : "";
|
|
3412
|
-
return o && fa(a) ? [" ", m([w("", "("), A([f, r]), w("", ")"), l, d]), u] : (Ea(a) && (r = m(["(", A([f, r]), f, ")"])), o ? [" ", r, u] : [A([C, r, u]), l, d]);
|
|
3413
|
-
}
|
|
3414
|
-
var Zl = (e, t, n) => {
|
|
3415
|
-
if (!(e && t == null)) {
|
|
3416
|
-
if (t.findLast)
|
|
3417
|
-
return t.findLast(n);
|
|
3418
|
-
for (let r = t.length - 1; r >= 0; r--) {
|
|
3419
|
-
let u = t[r];
|
|
3420
|
-
if (n(u, r, t))
|
|
3421
|
-
return u;
|
|
3422
|
-
}
|
|
3423
|
-
}
|
|
3424
|
-
}, ec = Zl;
|
|
3425
|
-
function Mn(e, t, n, r) {
|
|
3426
|
-
let { node: u } = e, a = [], o = ec(!1, u[r], (i) => i.type !== "EmptyStatement");
|
|
3427
|
-
return e.each(({ node: i }) => {
|
|
3428
|
-
i.type !== "EmptyStatement" && (a.push(n()), i !== o && (a.push(F), we(i, t) && a.push(F)));
|
|
3429
|
-
}, r), a;
|
|
3430
|
-
}
|
|
3431
|
-
function Fa(e, t, n) {
|
|
3432
|
-
let r = tc(e, t, n), { node: u, parent: a } = e;
|
|
3433
|
-
if (u.type === "Program" && (a == null ? void 0 : a.type) !== "ModuleExpression")
|
|
3434
|
-
return r ? [r, F] : "";
|
|
3435
|
-
let o = [];
|
|
3436
|
-
if (u.type === "StaticBlock" && o.push("static "), o.push("{"), r)
|
|
3437
|
-
o.push(A([F, r]), F);
|
|
3438
|
-
else {
|
|
3439
|
-
let i = e.grandparent;
|
|
3440
|
-
a.type === "ArrowFunctionExpression" || a.type === "FunctionExpression" || a.type === "FunctionDeclaration" || a.type === "ComponentDeclaration" || a.type === "HookDeclaration" || a.type === "ObjectMethod" || a.type === "ClassMethod" || a.type === "ClassPrivateMethod" || a.type === "ForStatement" || a.type === "WhileStatement" || a.type === "DoWhileStatement" || a.type === "DoExpression" || a.type === "ModuleExpression" || a.type === "CatchClause" && !i.finalizer || a.type === "TSModuleDeclaration" || u.type === "StaticBlock" || o.push(F);
|
|
3441
|
-
}
|
|
3442
|
-
return o.push("}"), o;
|
|
3443
|
-
}
|
|
3444
|
-
function tc(e, t, n) {
|
|
3445
|
-
let { node: r } = e, u = O(r.directives), a = r.body.some((s) => s.type !== "EmptyStatement"), o = h(r, T.Dangling);
|
|
3446
|
-
if (!u && !a && !o)
|
|
3447
|
-
return "";
|
|
3448
|
-
let i = [];
|
|
3449
|
-
return u && (i.push(Mn(e, t, n, "directives")), (a || o) && (i.push(F), we(_(!1, r.directives, -1), t) && i.push(F))), a && i.push(Mn(e, t, n, "body")), o && i.push(R(e, t)), i;
|
|
3450
|
-
}
|
|
3451
|
-
function nc(e) {
|
|
3452
|
-
let t = /* @__PURE__ */ new WeakMap();
|
|
3453
|
-
return function(n) {
|
|
3454
|
-
return t.has(n) || t.set(n, Symbol(e)), t.get(n);
|
|
3455
|
-
};
|
|
3456
|
-
}
|
|
3457
|
-
var Aa = nc;
|
|
3458
|
-
function rc(e) {
|
|
3459
|
-
switch (e) {
|
|
3460
|
-
case null:
|
|
3461
|
-
return "";
|
|
3462
|
-
case "PlusOptional":
|
|
3463
|
-
return "+?";
|
|
3464
|
-
case "MinusOptional":
|
|
3465
|
-
return "-?";
|
|
3466
|
-
case "Optional":
|
|
3467
|
-
return "?";
|
|
3468
|
-
}
|
|
3469
|
-
}
|
|
3470
|
-
function uc(e, t, n) {
|
|
3471
|
-
let { node: r } = e;
|
|
3472
|
-
return m([r.variance ? n("variance") : "", "[", A([n("keyTparam"), " in ", n("sourceType")]), "]", rc(r.optional), ": ", n("propType")]);
|
|
3473
|
-
}
|
|
3474
|
-
function ga(e, t) {
|
|
3475
|
-
return e === "+" || e === "-" ? e + t : t;
|
|
3476
|
-
}
|
|
3477
|
-
function ac(e, t, n) {
|
|
3478
|
-
let { node: r } = e, u = t.objectWrap === "preserve" && Re(t.originalText, W(r), W(r.typeParameter));
|
|
3479
|
-
return m(["{", A([t.bracketSpacing ? C : f, m([n("typeParameter"), r.optional ? ga(r.optional, "?") : "", r.typeAnnotation ? ": " : "", n("typeAnnotation")]), t.semi ? w(";") : ""]), R(e, t), t.bracketSpacing ? C : f, "}"], { shouldBreak: u });
|
|
3480
|
-
}
|
|
3481
|
-
var or = Aa("typeParameters");
|
|
3482
|
-
function oc(e, t, n) {
|
|
3483
|
-
let { node: r } = e;
|
|
3484
|
-
return Z(r).length === 1 && r.type.startsWith("TS") && !r[n][0].constraint && e.parent.type === "ArrowFunctionExpression" && !(t.filepath && /\.ts$/u.test(t.filepath));
|
|
3485
|
-
}
|
|
3486
|
-
function Pt(e, t, n, r) {
|
|
3487
|
-
let { node: u } = e;
|
|
3488
|
-
if (!u[r])
|
|
3489
|
-
return "";
|
|
3490
|
-
if (!Array.isArray(u[r]))
|
|
3491
|
-
return n(r);
|
|
3492
|
-
let a = rn(e.grandparent), o = e.match((s) => !(s[r].length === 1 && Je(s[r][0])), void 0, (s, l) => l === "typeAnnotation", (s) => s.type === "Identifier", Wu);
|
|
3493
|
-
if (u[r].length === 0 || !o && (a || u[r].length === 1 && (u[r][0].type === "NullableTypeAnnotation" || Vu(u[r][0]))))
|
|
3494
|
-
return ["<", I(", ", e.map(n, r)), ic(e, t), ">"];
|
|
3495
|
-
let i = u.type === "TSTypeParameterInstantiation" ? "" : oc(e, t, r) ? "," : Pe(t) ? w(",") : "";
|
|
3496
|
-
return m(["<", A([f, I([",", C], e.map(n, r))]), i, f, ">"], { id: or(u) });
|
|
3497
|
-
}
|
|
3498
|
-
function ic(e, t) {
|
|
3499
|
-
let { node: n } = e;
|
|
3500
|
-
if (!h(n, T.Dangling))
|
|
3501
|
-
return "";
|
|
3502
|
-
let r = !h(n, T.Line), u = R(e, t, { indent: !r });
|
|
3503
|
-
return r ? u : [u, F];
|
|
3504
|
-
}
|
|
3505
|
-
function xa(e, t, n) {
|
|
3506
|
-
let { node: r, parent: u } = e, a = [r.const ? "const " : ""], o = r.type === "TSTypeParameter" ? n("name") : r.name;
|
|
3507
|
-
if (u.type === "TSMappedType")
|
|
3508
|
-
return u.readonly && a.push(ga(u.readonly, "readonly"), " "), a.push("[", o), r.constraint && a.push(" in ", n("constraint")), u.nameType && a.push(" as ", e.callParent(() => n("nameType"))), a.push("]"), a;
|
|
3509
|
-
if (r.variance && a.push(n("variance")), r.in && a.push("in "), r.out && a.push("out "), a.push(o), r.bound && (r.usesExtendsBound && a.push(" extends "), a.push(z(e, n, "bound"))), r.constraint) {
|
|
3510
|
-
let i = Symbol("constraint");
|
|
3511
|
-
a.push(" extends", m(A(C), { id: i }), ke, an(n("constraint"), { groupId: i }));
|
|
3512
|
-
}
|
|
3513
|
-
return r.default && a.push(" = ", n("default")), m(a);
|
|
3514
|
-
}
|
|
3515
|
-
var ha = J(["ClassProperty", "PropertyDefinition", "ClassPrivateProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractPropertyDefinition", "TSAbstractAccessorProperty"]);
|
|
3516
|
-
function Ca(e, t, n) {
|
|
3517
|
-
let { node: r } = e, u = [ae(e), on(e), "class"], a = h(r.id, T.Trailing) || h(r.typeParameters, T.Trailing) || h(r.superClass) || O(r.extends) || O(r.mixins) || O(r.implements), o = [], i = [];
|
|
3518
|
-
if (r.id && o.push(" ", n("id")), o.push(n("typeParameters")), r.superClass) {
|
|
3519
|
-
let d = [lc(e, t, n), n(r.superTypeArguments ? "superTypeArguments" : "superTypeParameters")], c = e.call((D) => ["extends ", Ee(D, d, t)], "superClass");
|
|
3520
|
-
a ? i.push(C, m(c)) : i.push(" ", c);
|
|
3521
|
-
} else
|
|
3522
|
-
i.push(An(e, t, n, "extends"));
|
|
3523
|
-
i.push(An(e, t, n, "mixins"), An(e, t, n, "implements"));
|
|
3524
|
-
let s;
|
|
3525
|
-
if (a) {
|
|
3526
|
-
let d;
|
|
3527
|
-
Sa(r) ? d = [...o, A(i)] : d = A([...o, i]), s = Ta(r), u.push(m(d, { id: s }));
|
|
3528
|
-
} else
|
|
3529
|
-
u.push(...o, ...i);
|
|
3530
|
-
let l = r.body;
|
|
3531
|
-
return a && O(l.body) ? u.push(w(F, " ", { groupId: s })) : u.push(" "), u.push(n("body")), u;
|
|
3532
|
-
}
|
|
3533
|
-
var Ta = Aa("heritageGroup");
|
|
3534
|
-
function sc(e) {
|
|
3535
|
-
return w(F, "", { groupId: Ta(e) });
|
|
3536
|
-
}
|
|
3537
|
-
function pc(e) {
|
|
3538
|
-
return ["extends", "mixins", "implements"].reduce((t, n) => t + (Array.isArray(e[n]) ? e[n].length : 0), e.superClass ? 1 : 0) > 1;
|
|
3539
|
-
}
|
|
3540
|
-
function Sa(e) {
|
|
3541
|
-
return e.typeParameters && !h(e.typeParameters, T.Trailing | T.Line) && !pc(e);
|
|
3542
|
-
}
|
|
3543
|
-
function An(e, t, n, r) {
|
|
3544
|
-
let { node: u } = e;
|
|
3545
|
-
if (!O(u[r]))
|
|
3546
|
-
return "";
|
|
3547
|
-
let a = R(e, t, { marker: r });
|
|
3548
|
-
return [Sa(u) ? w(" ", C, { groupId: or(u.typeParameters) }) : C, a, a && F, r, m(A([C, I([",", C], e.map(n, r))]))];
|
|
3549
|
-
}
|
|
3550
|
-
function lc(e, t, n) {
|
|
3551
|
-
let r = n("superClass"), { parent: u } = e;
|
|
3552
|
-
return u.type === "AssignmentExpression" ? m(w(["(", A([f, r]), f, ")"], r)) : r;
|
|
3553
|
-
}
|
|
3554
|
-
function ba(e, t, n) {
|
|
3555
|
-
let { node: r } = e, u = [];
|
|
3556
|
-
return O(r.decorators) && u.push(Mu(e, t, n)), u.push(Zt(r)), r.static && u.push("static "), u.push(on(e)), r.override && u.push("override "), u.push(Ln(e, t, n)), u;
|
|
3557
|
-
}
|
|
3558
|
-
function Ba(e, t, n) {
|
|
3559
|
-
let { node: r } = e, u = [], a = t.semi ? ";" : "";
|
|
3560
|
-
O(r.decorators) && u.push(Mu(e, t, n)), u.push(ae(e), Zt(r)), r.static && u.push("static "), u.push(on(e)), r.override && u.push("override "), r.readonly && u.push("readonly "), r.variance && u.push(n("variance")), (r.type === "ClassAccessorProperty" || r.type === "AccessorProperty" || r.type === "TSAbstractAccessorProperty") && u.push("accessor "), u.push(Ot(e, t, n), ne(e), ia(e), z(e, n));
|
|
3561
|
-
let o = r.type === "TSAbstractPropertyDefinition" || r.type === "TSAbstractAccessorProperty";
|
|
3562
|
-
return [Mt(e, t, n, u, " =", o ? void 0 : "value"), a];
|
|
3563
|
-
}
|
|
3564
|
-
function cc(e, t, n) {
|
|
3565
|
-
let { node: r } = e, u = [];
|
|
3566
|
-
return e.each(({ node: a, next: o, isLast: i }) => {
|
|
3567
|
-
u.push(n()), !t.semi && ha(a) && Dc(a, o) && u.push(";"), i || (u.push(F), we(a, t) && u.push(F));
|
|
3568
|
-
}, "body"), h(r, T.Dangling) && u.push(R(e, t)), ["{", u.length > 0 ? [A([F, u]), F] : "", "}"];
|
|
3569
|
-
}
|
|
3570
|
-
function Dc(e, t) {
|
|
3571
|
-
var n;
|
|
3572
|
-
let { type: r, name: u } = e.key;
|
|
3573
|
-
if (!e.computed && r === "Identifier" && (u === "static" || u === "get" || u === "set") && !e.value && !e.typeAnnotation)
|
|
3574
|
-
return !0;
|
|
3575
|
-
if (!t || t.static || t.accessibility || t.readonly)
|
|
3576
|
-
return !1;
|
|
3577
|
-
if (!t.computed) {
|
|
3578
|
-
let a = (n = t.key) == null ? void 0 : n.name;
|
|
3579
|
-
if (a === "in" || a === "instanceof")
|
|
3580
|
-
return !0;
|
|
3581
|
-
}
|
|
3582
|
-
if (ha(t) && t.variance && !t.static && !t.declare)
|
|
3583
|
-
return !0;
|
|
3584
|
-
switch (t.type) {
|
|
3585
|
-
case "ClassProperty":
|
|
3586
|
-
case "PropertyDefinition":
|
|
3587
|
-
case "TSAbstractPropertyDefinition":
|
|
3588
|
-
return t.computed;
|
|
3589
|
-
case "MethodDefinition":
|
|
3590
|
-
case "TSAbstractMethodDefinition":
|
|
3591
|
-
case "ClassMethod":
|
|
3592
|
-
case "ClassPrivateMethod": {
|
|
3593
|
-
if ((t.value ? t.value.async : t.async) || t.kind === "get" || t.kind === "set")
|
|
3594
|
-
return !1;
|
|
3595
|
-
let a = t.value ? t.value.generator : t.generator;
|
|
3596
|
-
return !!(t.computed || a);
|
|
3597
|
-
}
|
|
3598
|
-
case "TSIndexSignature":
|
|
3599
|
-
return !0;
|
|
3600
|
-
}
|
|
3601
|
-
return !1;
|
|
3602
|
-
}
|
|
3603
|
-
var yc = J(["TSAsExpression", "TSTypeAssertion", "TSNonNullExpression", "TSInstantiationExpression", "TSSatisfiesExpression"]);
|
|
3604
|
-
function va(e) {
|
|
3605
|
-
return yc(e) ? va(e.expression) : e;
|
|
3606
|
-
}
|
|
3607
|
-
var dc = J(["FunctionExpression", "ArrowFunctionExpression"]);
|
|
3608
|
-
function mc(e) {
|
|
3609
|
-
return e.type === "MemberExpression" || e.type === "OptionalMemberExpression" || e.type === "Identifier" && e.name !== "undefined";
|
|
3610
|
-
}
|
|
3611
|
-
function fc(e, t) {
|
|
3612
|
-
if (t.semi || Pa(e, t) || wa(e, t))
|
|
3613
|
-
return !1;
|
|
3614
|
-
let { node: n, key: r, parent: u } = e;
|
|
3615
|
-
return !!(n.type === "ExpressionStatement" && (r === "body" && (u.type === "Program" || u.type === "BlockStatement" || u.type === "StaticBlock" || u.type === "TSModuleBlock") || r === "consequent" && u.type === "SwitchCase") && e.call(() => ka(e, t), "expression"));
|
|
3616
|
-
}
|
|
3617
|
-
function ka(e, t) {
|
|
3618
|
-
let { node: n } = e;
|
|
3619
|
-
switch (n.type) {
|
|
3620
|
-
case "ParenthesizedExpression":
|
|
3621
|
-
case "TypeCastExpression":
|
|
3622
|
-
case "ArrayExpression":
|
|
3623
|
-
case "ArrayPattern":
|
|
3624
|
-
case "TemplateLiteral":
|
|
3625
|
-
case "TemplateElement":
|
|
3626
|
-
case "RegExpLiteral":
|
|
3627
|
-
return !0;
|
|
3628
|
-
case "ArrowFunctionExpression":
|
|
3629
|
-
if (!da(e, t))
|
|
3630
|
-
return !0;
|
|
3631
|
-
break;
|
|
3632
|
-
case "UnaryExpression": {
|
|
3633
|
-
let { prefix: r, operator: u } = n;
|
|
3634
|
-
if (r && (u === "+" || u === "-"))
|
|
3635
|
-
return !0;
|
|
3636
|
-
break;
|
|
3637
|
-
}
|
|
3638
|
-
case "BindExpression":
|
|
3639
|
-
if (!n.object)
|
|
3640
|
-
return !0;
|
|
3641
|
-
break;
|
|
3642
|
-
case "Literal":
|
|
3643
|
-
if (n.regex)
|
|
3644
|
-
return !0;
|
|
3645
|
-
break;
|
|
3646
|
-
default:
|
|
3647
|
-
if (K(n))
|
|
3648
|
-
return !0;
|
|
3649
|
-
}
|
|
3650
|
-
return ut(e, t) ? !0 : $n(n) ? e.call(() => ka(e, t), ...Kr(n)) : !1;
|
|
3651
|
-
}
|
|
3652
|
-
function Pa({ node: e, parent: t }, n) {
|
|
3653
|
-
return (n.parentParser === "markdown" || n.parentParser === "mdx") && e.type === "ExpressionStatement" && K(e.expression) && t.type === "Program" && t.body.length === 1;
|
|
3654
|
-
}
|
|
3655
|
-
function wa({ node: e, parent: t }, n) {
|
|
3656
|
-
return (n.parser === "__vue_event_binding" || n.parser === "__vue_ts_event_binding") && e.type === "ExpressionStatement" && t.type === "Program" && t.body.length === 1;
|
|
3657
|
-
}
|
|
3658
|
-
function Ec(e, t, n) {
|
|
3659
|
-
let r = [n("expression")];
|
|
3660
|
-
if (wa(e, t)) {
|
|
3661
|
-
let u = va(e.node.expression);
|
|
3662
|
-
(dc(u) || mc(u)) && r.push(";");
|
|
3663
|
-
} else
|
|
3664
|
-
Pa(e, t) || t.semi && r.push(";");
|
|
3665
|
-
return r;
|
|
3666
|
-
}
|
|
3667
|
-
function Fc(e, t, n) {
|
|
3668
|
-
if (t.__isVueBindings || t.__isVueForBindingLeft) {
|
|
3669
|
-
let r = e.map(n, "program", "body", 0, "params");
|
|
3670
|
-
if (r.length === 1)
|
|
3671
|
-
return r[0];
|
|
3672
|
-
let u = I([",", C], r);
|
|
3673
|
-
return t.__isVueForBindingLeft ? ["(", A([f, m(u)]), f, ")"] : u;
|
|
3674
|
-
}
|
|
3675
|
-
if (t.__isEmbeddedTypescriptGenericParameters) {
|
|
3676
|
-
let r = e.map(n, "program", "body", 0, "typeParameters", "params");
|
|
3677
|
-
return I([",", C], r);
|
|
3678
|
-
}
|
|
3679
|
-
}
|
|
3680
|
-
function Ac(e, t) {
|
|
3681
|
-
let { node: n } = e;
|
|
3682
|
-
switch (n.type) {
|
|
3683
|
-
case "RegExpLiteral":
|
|
3684
|
-
return jr(n);
|
|
3685
|
-
case "BigIntLiteral":
|
|
3686
|
-
return On(n.extra.raw);
|
|
3687
|
-
case "NumericLiteral":
|
|
3688
|
-
return ft(n.extra.raw);
|
|
3689
|
-
case "StringLiteral":
|
|
3690
|
-
return He(dt(n.extra.raw, t));
|
|
3691
|
-
case "NullLiteral":
|
|
3692
|
-
return "null";
|
|
3693
|
-
case "BooleanLiteral":
|
|
3694
|
-
return String(n.value);
|
|
3695
|
-
case "DirectiveLiteral":
|
|
3696
|
-
return Lr(n.extra.raw, t);
|
|
3697
|
-
case "Literal": {
|
|
3698
|
-
if (n.regex)
|
|
3699
|
-
return jr(n.regex);
|
|
3700
|
-
if (n.bigint)
|
|
3701
|
-
return On(n.raw);
|
|
3702
|
-
let { value: r } = n;
|
|
3703
|
-
return typeof r == "number" ? ft(n.raw) : typeof r == "string" ? gc(e) ? Lr(n.raw, t) : He(dt(n.raw, t)) : String(r);
|
|
3704
|
-
}
|
|
3705
|
-
}
|
|
3706
|
-
}
|
|
3707
|
-
function gc(e) {
|
|
3708
|
-
if (e.key !== "expression")
|
|
3709
|
-
return;
|
|
3710
|
-
let { parent: t } = e;
|
|
3711
|
-
return t.type === "ExpressionStatement" && t.directive;
|
|
3712
|
-
}
|
|
3713
|
-
function On(e) {
|
|
3714
|
-
return e.toLowerCase();
|
|
3715
|
-
}
|
|
3716
|
-
function jr({ pattern: e, flags: t }) {
|
|
3717
|
-
return t = [...t].sort().join(""), `/${e}/${t}`;
|
|
3718
|
-
}
|
|
3719
|
-
function Lr(e, t) {
|
|
3720
|
-
let n = e.slice(1, -1);
|
|
3721
|
-
if (n.includes('"') || n.includes("'"))
|
|
3722
|
-
return e;
|
|
3723
|
-
let r = t.singleQuote ? "'" : '"';
|
|
3724
|
-
return r + n + r;
|
|
3725
|
-
}
|
|
3726
|
-
function xc(e, t, n) {
|
|
3727
|
-
let r = e.originalText.slice(t, n);
|
|
3728
|
-
for (let u of e[Symbol.for("comments")]) {
|
|
3729
|
-
let a = W(u);
|
|
3730
|
-
if (a > n)
|
|
3731
|
-
break;
|
|
3732
|
-
let o = j(u);
|
|
3733
|
-
if (o < t)
|
|
3734
|
-
continue;
|
|
3735
|
-
let i = o - a;
|
|
3736
|
-
r = r.slice(0, a - t) + " ".repeat(i) + r.slice(o - t);
|
|
3737
|
-
}
|
|
3738
|
-
return r;
|
|
3739
|
-
}
|
|
3740
|
-
var Na = xc;
|
|
3741
|
-
function hc(e, t, n) {
|
|
3742
|
-
let { node: r } = e;
|
|
3743
|
-
return ["import", r.phase ? ` ${r.phase}` : "", La(r), Oa(e, t, n), Ma(e, t, n), qa(e, t, n), t.semi ? ";" : ""];
|
|
3744
|
-
}
|
|
3745
|
-
var Ia = (e) => e.type === "ExportDefaultDeclaration" || e.type === "DeclareExportDeclaration" && e.default;
|
|
3746
|
-
function ja(e, t, n) {
|
|
3747
|
-
let { node: r } = e, u = [Yp(e, t, n), ae(e), "export", Ia(r) ? " default" : ""], { declaration: a, exported: o } = r;
|
|
3748
|
-
return h(r, T.Dangling) && (u.push(" ", R(e, t)), tu(r) && u.push(F)), a ? u.push(" ", n("declaration")) : (u.push(Sc(r)), r.type === "ExportAllDeclaration" || r.type === "DeclareExportAllDeclaration" ? (u.push(" *"), o && u.push(" as ", n("exported"))) : u.push(Oa(e, t, n)), u.push(Ma(e, t, n), qa(e, t, n))), u.push(Tc(r, t)), u;
|
|
3749
|
-
}
|
|
3750
|
-
var Cc = J(["ClassDeclaration", "ComponentDeclaration", "FunctionDeclaration", "TSInterfaceDeclaration", "DeclareClass", "DeclareComponent", "DeclareFunction", "DeclareHook", "HookDeclaration", "TSDeclareFunction", "EnumDeclaration"]);
|
|
3751
|
-
function Tc(e, t) {
|
|
3752
|
-
return t.semi && (!e.declaration || Ia(e) && !Cc(e.declaration)) ? ";" : "";
|
|
3753
|
-
}
|
|
3754
|
-
function ir(e, t = !0) {
|
|
3755
|
-
return e && e !== "value" ? `${t ? " " : ""}${e}${t ? "" : " "}` : "";
|
|
3756
|
-
}
|
|
3757
|
-
function La(e, t) {
|
|
3758
|
-
return ir(e.importKind, t);
|
|
3759
|
-
}
|
|
3760
|
-
function Sc(e) {
|
|
3761
|
-
return ir(e.exportKind);
|
|
3762
|
-
}
|
|
3763
|
-
function Ma(e, t, n) {
|
|
3764
|
-
let { node: r } = e;
|
|
3765
|
-
if (!r.source)
|
|
3766
|
-
return "";
|
|
3767
|
-
let u = [];
|
|
3768
|
-
return Ja(r, t) && u.push(" from"), u.push(" ", n("source")), u;
|
|
3769
|
-
}
|
|
3770
|
-
function Oa(e, t, n) {
|
|
3771
|
-
let { node: r } = e;
|
|
3772
|
-
if (!Ja(r, t))
|
|
3773
|
-
return "";
|
|
3774
|
-
let u = [" "];
|
|
3775
|
-
if (O(r.specifiers)) {
|
|
3776
|
-
let a = [], o = [];
|
|
3777
|
-
e.each(() => {
|
|
3778
|
-
let i = e.node.type;
|
|
3779
|
-
if (i === "ExportNamespaceSpecifier" || i === "ExportDefaultSpecifier" || i === "ImportNamespaceSpecifier" || i === "ImportDefaultSpecifier")
|
|
3780
|
-
a.push(n());
|
|
3781
|
-
else if (i === "ExportSpecifier" || i === "ImportSpecifier")
|
|
3782
|
-
o.push(n());
|
|
3783
|
-
else
|
|
3784
|
-
throw new xt(r, "specifier");
|
|
3785
|
-
}, "specifiers"), u.push(I(", ", a)), o.length > 0 && (a.length > 0 && u.push(", "), o.length > 1 || a.length > 0 || r.specifiers.some((i) => h(i)) ? u.push(m(["{", A([t.bracketSpacing ? C : f, I([",", C], o)]), w(Pe(t) ? "," : ""), t.bracketSpacing ? C : f, "}"])) : u.push(["{", t.bracketSpacing ? " " : "", ...o, t.bracketSpacing ? " " : "", "}"]));
|
|
3786
|
-
} else
|
|
3787
|
-
u.push("{}");
|
|
3788
|
-
return u;
|
|
3789
|
-
}
|
|
3790
|
-
function Ja(e, t) {
|
|
3791
|
-
return e.type !== "ImportDeclaration" || O(e.specifiers) || e.importKind === "type" ? !0 : Na(t, W(e), W(e.source)).trimEnd().endsWith("from");
|
|
3792
|
-
}
|
|
3793
|
-
function bc(e, t) {
|
|
3794
|
-
var n, r;
|
|
3795
|
-
if ((n = e.extra) != null && n.deprecatedAssertSyntax)
|
|
3796
|
-
return "assert";
|
|
3797
|
-
let u = Na(t, j(e.source), (r = e.attributes) != null && r[0] ? W(e.attributes[0]) : j(e)).trimStart();
|
|
3798
|
-
return u.startsWith("assert") ? "assert" : u.startsWith("with") || O(e.attributes) ? "with" : void 0;
|
|
3799
|
-
}
|
|
3800
|
-
function qa(e, t, n) {
|
|
3801
|
-
let { node: r } = e;
|
|
3802
|
-
if (!r.source)
|
|
3803
|
-
return "";
|
|
3804
|
-
let u = bc(r, t);
|
|
3805
|
-
if (!u)
|
|
3806
|
-
return "";
|
|
3807
|
-
let a = [` ${u} {`];
|
|
3808
|
-
return O(r.attributes) && (t.bracketSpacing && a.push(" "), a.push(I(", ", e.map(n, "attributes"))), t.bracketSpacing && a.push(" ")), a.push("}"), a;
|
|
3809
|
-
}
|
|
3810
|
-
function Bc(e, t, n) {
|
|
3811
|
-
let { node: r } = e, { type: u } = r, a = u.startsWith("Import"), o = a ? "imported" : "local", i = a ? "local" : "exported", s = r[o], l = r[i], d = "", c = "";
|
|
3812
|
-
return u === "ExportNamespaceSpecifier" || u === "ImportNamespaceSpecifier" ? d = "*" : s && (d = n(o)), l && !vc(r) && (c = n(i)), [ir(u === "ImportSpecifier" ? r.importKind : r.exportKind, !1), d, d && c ? " as " : "", c];
|
|
3813
|
-
}
|
|
3814
|
-
function vc(e) {
|
|
3815
|
-
if (e.type !== "ImportSpecifier" && e.type !== "ExportSpecifier")
|
|
3816
|
-
return !1;
|
|
3817
|
-
let { local: t, [e.type === "ImportSpecifier" ? "imported" : "exported"]: n } = e;
|
|
3818
|
-
if (t.type !== n.type || !Po(t, n))
|
|
3819
|
-
return !1;
|
|
3820
|
-
if (ue(t))
|
|
3821
|
-
return t.value === n.value && pe(t) === pe(n);
|
|
3822
|
-
switch (t.type) {
|
|
3823
|
-
case "Identifier":
|
|
3824
|
-
return t.name === n.name;
|
|
3825
|
-
default:
|
|
3826
|
-
return !1;
|
|
3827
|
-
}
|
|
3828
|
-
}
|
|
3829
|
-
function pn(e, t, n) {
|
|
3830
|
-
var r;
|
|
3831
|
-
let u = t.semi ? ";" : "", { node: a } = e, o = a.type === "ObjectTypeAnnotation", i = a.type === "TSEnumDeclaration" || a.type === "EnumBooleanBody" || a.type === "EnumNumberBody" || a.type === "EnumBigIntBody" || a.type === "EnumStringBody" || a.type === "EnumSymbolBody", s = [a.type === "TSTypeLiteral" || i ? "members" : a.type === "TSInterfaceBody" ? "body" : "properties"];
|
|
3832
|
-
o && s.push("indexers", "callProperties", "internalSlots");
|
|
3833
|
-
let l = s.flatMap((v) => e.map(({ node: q }) => ({ node: q, printed: n(), loc: W(q) }), v));
|
|
3834
|
-
s.length > 1 && l.sort((v, q) => v.loc - q.loc);
|
|
3835
|
-
let { parent: d, key: c } = e, D = o && c === "body" && (d.type === "InterfaceDeclaration" || d.type === "DeclareInterface" || d.type === "DeclareClass"), p = a.type === "TSInterfaceBody" || i || D || a.type === "ObjectPattern" && d.type !== "FunctionDeclaration" && d.type !== "FunctionExpression" && d.type !== "ArrowFunctionExpression" && d.type !== "ObjectMethod" && d.type !== "ClassMethod" && d.type !== "ClassPrivateMethod" && d.type !== "AssignmentPattern" && d.type !== "CatchClause" && a.properties.some((v) => v.value && (v.value.type === "ObjectPattern" || v.value.type === "ArrayPattern")) || a.type !== "ObjectPattern" && t.objectWrap === "preserve" && l.length > 0 && Re(t.originalText, W(a), l[0].loc), y = D ? ";" : a.type === "TSInterfaceBody" || a.type === "TSTypeLiteral" ? w(u, ";") : ",", E = a.type === "RecordExpression" ? "#{" : a.exact ? "{|" : "{", g = a.exact ? "|}" : "}", S = [], B = l.map((v) => {
|
|
3836
|
-
let q = [...S, m(v.printed)];
|
|
3837
|
-
return S = [y, C], (v.node.type === "TSPropertySignature" || v.node.type === "TSMethodSignature" || v.node.type === "TSConstructSignatureDeclaration" || v.node.type === "TSCallSignatureDeclaration") && h(v.node, T.PrettierIgnore) && S.shift(), we(v.node, t) && S.push(F), q;
|
|
3838
|
-
});
|
|
3839
|
-
if (a.inexact || a.hasUnknownMembers) {
|
|
3840
|
-
let v;
|
|
3841
|
-
if (h(a, T.Dangling)) {
|
|
3842
|
-
let q = h(a, T.Line);
|
|
3843
|
-
v = [R(e, t), q || se(t.originalText, j(_(!1, lt(a), -1))) ? F : C, "..."];
|
|
3844
|
-
} else
|
|
3845
|
-
v = ["..."];
|
|
3846
|
-
B.push([...S, ...v]);
|
|
3847
|
-
}
|
|
3848
|
-
let x = (r = _(!1, l, -1)) == null ? void 0 : r.node, N = !(a.inexact || a.hasUnknownMembers || x && (x.type === "RestElement" || (x.type === "TSPropertySignature" || x.type === "TSCallSignatureDeclaration" || x.type === "TSMethodSignature" || x.type === "TSConstructSignatureDeclaration") && h(x, T.PrettierIgnore))), b;
|
|
3849
|
-
if (B.length === 0) {
|
|
3850
|
-
if (!h(a, T.Dangling))
|
|
3851
|
-
return [E, g, z(e, n)];
|
|
3852
|
-
b = m([E, R(e, t, { indent: !0 }), f, g, ne(e), z(e, n)]);
|
|
3853
|
-
} else
|
|
3854
|
-
b = [D && O(a.properties) ? sc(d) : "", E, A([t.bracketSpacing ? C : f, ...B]), w(N && (y !== "," || Pe(t)) ? y : ""), t.bracketSpacing ? C : f, g, ne(e), z(e, n)];
|
|
3855
|
-
return e.match((v) => v.type === "ObjectPattern" && !O(v.decorators), gn) || Je(a) && (e.match(void 0, (v, q) => q === "typeAnnotation", (v, q) => q === "typeAnnotation", gn) || e.match(void 0, (v, q) => v.type === "FunctionTypeParam" && q === "typeAnnotation", gn)) || !p && e.match((v) => v.type === "ObjectPattern", (v) => v.type === "AssignmentExpression" || v.type === "VariableDeclarator") ? b : m(b, { shouldBreak: p });
|
|
3856
|
-
}
|
|
3857
|
-
function gn(e, t) {
|
|
3858
|
-
return (t === "params" || t === "parameters" || t === "this" || t === "rest") && Gu(e);
|
|
3859
|
-
}
|
|
3860
|
-
function kc(e) {
|
|
3861
|
-
let t = [e];
|
|
3862
|
-
for (let n = 0; n < t.length; n++) {
|
|
3863
|
-
let r = t[n];
|
|
3864
|
-
for (let u of ["test", "consequent", "alternate"]) {
|
|
3865
|
-
let a = r[u];
|
|
3866
|
-
if (K(a))
|
|
3867
|
-
return !0;
|
|
3868
|
-
a.type === "ConditionalExpression" && t.push(a);
|
|
3869
|
-
}
|
|
3870
|
-
}
|
|
3871
|
-
return !1;
|
|
3872
|
-
}
|
|
3873
|
-
function Pc(e, t, n) {
|
|
3874
|
-
let { node: r } = e, u = r.type === "ConditionalExpression", a = u ? "alternate" : "falseType", { parent: o } = e, i = u ? n("test") : [n("checkType"), " ", "extends", " ", n("extendsType")];
|
|
3875
|
-
return o.type === r.type && o[a] === r ? Ce(2, i) : i;
|
|
3876
|
-
}
|
|
3877
|
-
var wc = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
|
|
3878
|
-
function Nc(e) {
|
|
3879
|
-
let { node: t } = e;
|
|
3880
|
-
if (t.type !== "ConditionalExpression")
|
|
3881
|
-
return !1;
|
|
3882
|
-
let n, r = t;
|
|
3883
|
-
for (let u = 0; !n; u++) {
|
|
3884
|
-
let a = e.getParentNode(u);
|
|
3885
|
-
if (a.type === "ChainExpression" && a.expression === r || L(a) && a.callee === r || U(a) && a.object === r || a.type === "TSNonNullExpression" && a.expression === r) {
|
|
3886
|
-
r = a;
|
|
3887
|
-
continue;
|
|
3888
|
-
}
|
|
3889
|
-
a.type === "NewExpression" && a.callee === r || xe(a) && a.expression === r ? (n = e.getParentNode(u + 1), r = a) : n = a;
|
|
3890
|
-
}
|
|
3891
|
-
return r === t ? !1 : n[wc.get(n.type)] === r;
|
|
3892
|
-
}
|
|
3893
|
-
function Ic(e, t, n) {
|
|
3894
|
-
let { node: r } = e, u = r.type === "ConditionalExpression", a = u ? "consequent" : "trueType", o = u ? "alternate" : "falseType", i = u ? ["test"] : ["checkType", "extendsType"], s = r[a], l = r[o], d = [], c = !1, { parent: D } = e, p = D.type === r.type && i.some((M) => D[M] === r), y = D.type === r.type && !p, E, g, S = 0;
|
|
3895
|
-
do
|
|
3896
|
-
g = E || r, E = e.getParentNode(S), S++;
|
|
3897
|
-
while (E && E.type === r.type && i.every((M) => E[M] !== g));
|
|
3898
|
-
let B = E || D, x = g;
|
|
3899
|
-
if (u && (K(r[i[0]]) || K(s) || K(l) || kc(x))) {
|
|
3900
|
-
c = !0, y = !0;
|
|
3901
|
-
let M = (X) => [w("("), A([f, X]), f, w(")")], V = (X) => X.type === "NullLiteral" || X.type === "Literal" && X.value === null || X.type === "Identifier" && X.name === "undefined";
|
|
3902
|
-
d.push(" ? ", V(s) ? n(a) : M(n(a)), " : ", l.type === r.type || V(l) ? n(o) : M(n(o)));
|
|
3903
|
-
} else {
|
|
3904
|
-
let M = (X) => t.useTabs ? A(n(X)) : Ce(2, n(X)), V = [C, "? ", s.type === r.type ? w("", "(") : "", M(a), s.type === r.type ? w("", ")") : "", C, ": ", M(o)];
|
|
3905
|
-
d.push(D.type !== r.type || D[o] === r || p ? V : t.useTabs ? iu(A(V)) : Ce(Math.max(0, t.tabWidth - 2), V));
|
|
3906
|
-
}
|
|
3907
|
-
let N = [a, o, ...i].some((M) => h(r[M], (V) => De(V) && Re(t.originalText, W(V), j(V)))), b = (M) => D === B ? m(M, { shouldBreak: N }) : N ? [M, Te] : M, v = !c && (U(D) || D.type === "NGPipeExpression" && D.left === r) && !D.computed, q = Nc(e), k = b([Pc(e, t, n), y ? d : A(d), u && v && !q ? f : ""]);
|
|
3908
|
-
return p || q ? m([A([f, k]), f]) : k;
|
|
3909
|
-
}
|
|
3910
|
-
function jc(e, t) {
|
|
3911
|
-
return (U(t) || t.type === "NGPipeExpression" && t.left === e) && !t.computed;
|
|
3912
|
-
}
|
|
3913
|
-
function Lc(e, t, n, r) {
|
|
3914
|
-
return [...e.map((u) => lt(u)), lt(t), lt(n)].flat().some((u) => De(u) && Re(r.originalText, W(u), j(u)));
|
|
3915
|
-
}
|
|
3916
|
-
var Mc = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
|
|
3917
|
-
function Oc(e) {
|
|
3918
|
-
let { node: t } = e;
|
|
3919
|
-
if (t.type !== "ConditionalExpression")
|
|
3920
|
-
return !1;
|
|
3921
|
-
let n, r = t;
|
|
3922
|
-
for (let u = 0; !n; u++) {
|
|
3923
|
-
let a = e.getParentNode(u);
|
|
3924
|
-
if (a.type === "ChainExpression" && a.expression === r || L(a) && a.callee === r || U(a) && a.object === r || a.type === "TSNonNullExpression" && a.expression === r) {
|
|
3925
|
-
r = a;
|
|
3926
|
-
continue;
|
|
3927
|
-
}
|
|
3928
|
-
a.type === "NewExpression" && a.callee === r || xe(a) && a.expression === r ? (n = e.getParentNode(u + 1), r = a) : n = a;
|
|
3929
|
-
}
|
|
3930
|
-
return r === t ? !1 : n[Mc.get(n.type)] === r;
|
|
3931
|
-
}
|
|
3932
|
-
var xn = (e) => [w("("), A([f, e]), f, w(")")];
|
|
3933
|
-
function sr(e, t, n, r) {
|
|
3934
|
-
if (!t.experimentalTernaries)
|
|
3935
|
-
return Ic(e, t, n);
|
|
3936
|
-
let { node: u } = e, a = u.type === "ConditionalExpression", o = Xe(u), i = a ? "consequent" : "trueType", s = a ? "alternate" : "falseType", l = a ? ["test"] : ["checkType", "extendsType"], d = u[i], c = u[s], D = l.map((de) => u[de]), { parent: p } = e, y = p.type === u.type, E = y && l.some((de) => p[de] === u), g = y && p[s] === u, S = d.type === u.type, B = c.type === u.type, x = B || g, N = t.tabWidth > 2 || t.useTabs, b, v, q = 0;
|
|
3937
|
-
do
|
|
3938
|
-
v = b || u, b = e.getParentNode(q), q++;
|
|
3939
|
-
while (b && b.type === u.type && l.every((de) => b[de] !== v));
|
|
3940
|
-
let k = b || p, M = r && r.assignmentLayout && r.assignmentLayout !== "break-after-operator" && (p.type === "AssignmentExpression" || p.type === "VariableDeclarator" || p.type === "ClassProperty" || p.type === "PropertyDefinition" || p.type === "ClassPrivateProperty" || p.type === "ObjectProperty" || p.type === "Property"), V = (p.type === "ReturnStatement" || p.type === "ThrowStatement") && !(S || B), X = a && k.type === "JSXExpressionContainer" && e.grandparent.type !== "JSXAttribute", ot = Oc(e), Ge = jc(u, p), P = o && ut(e, t), G = N ? t.useTabs ? " " : " ".repeat(t.tabWidth - 1) : "", ie = Lc(D, d, c, t) || S || B, Se = !x && !y && !o && (X ? d.type === "NullLiteral" || d.type === "Literal" && d.value === null : Gn(d, t) && dr(u.test, 3)), Ve = x || g || o && !y || y && a && dr(u.test, 1) || Se, pr = [];
|
|
3941
|
-
!S && h(d, T.Dangling) && e.call((de) => {
|
|
3942
|
-
pr.push(R(de, t), F);
|
|
3943
|
-
}, "consequent");
|
|
3944
|
-
let Ct = [];
|
|
3945
|
-
h(u.test, T.Dangling) && e.call((de) => {
|
|
3946
|
-
Ct.push(R(de, t));
|
|
3947
|
-
}, "test"), !B && h(c, T.Dangling) && e.call((de) => {
|
|
3948
|
-
Ct.push(R(de, t));
|
|
3949
|
-
}, "alternate"), h(u, T.Dangling) && Ct.push(R(e, t));
|
|
3950
|
-
let lr = Symbol("test"), Va = Symbol("consequent"), Jt = Symbol("test-and-consequent"), Ka = a ? [xn(n("test")), u.test.type === "ConditionalExpression" ? Te : ""] : [n("checkType"), " ", "extends", " ", Xe(u.extendsType) || u.extendsType.type === "TSMappedType" ? n("extendsType") : m(xn(n("extendsType")))], cr = m([Ka, " ?"], { id: lr }), Ha = n(i), qt = A([S || X && (K(d) || y || x) ? F : C, pr, Ha]), za = Ve ? m([cr, x ? qt : w(qt, m(qt, { id: Va }), { groupId: lr })], { id: Jt }) : [cr, qt], ln = n(s), Dr = Se ? w(ln, iu(xn(ln)), { groupId: Jt }) : ln, Tt = [za, Ct.length > 0 ? [A([F, Ct]), F] : B ? F : Se ? w(C, " ", { groupId: Jt }) : C, ":", B ? " " : N ? Ve ? w(G, w(x || Se ? " " : G, " "), { groupId: Jt }) : w(G, " ") : " ", B ? Dr : m([A(Dr), X && !Se ? f : ""]), Ge && !ot ? f : "", ie ? Te : ""];
|
|
3951
|
-
return M && !ie ? m(A([f, m(Tt)])) : M || V ? m(A(Tt)) : ot || o && E ? m([A([f, Tt]), P ? f : ""]) : p === k ? m(Tt) : Tt;
|
|
3952
|
-
}
|
|
3953
|
-
function Jc(e, t, n, r) {
|
|
3954
|
-
let { node: u } = e;
|
|
3955
|
-
if (Wn(u))
|
|
3956
|
-
return Ac(e, t);
|
|
3957
|
-
let a = t.semi ? ";" : "", o = [];
|
|
3958
|
-
switch (u.type) {
|
|
3959
|
-
case "JsExpressionRoot":
|
|
3960
|
-
return n("node");
|
|
3961
|
-
case "JsonRoot":
|
|
3962
|
-
return [n("node"), F];
|
|
3963
|
-
case "File":
|
|
3964
|
-
return Fc(e, t, n) ?? n("program");
|
|
3965
|
-
case "EmptyStatement":
|
|
3966
|
-
return "";
|
|
3967
|
-
case "ExpressionStatement":
|
|
3968
|
-
return Ec(e, t, n);
|
|
3969
|
-
case "ChainExpression":
|
|
3970
|
-
return n("expression");
|
|
3971
|
-
case "ParenthesizedExpression":
|
|
3972
|
-
return !h(u.expression) && (Fe(u.expression) || Q(u.expression)) ? ["(", n("expression"), ")"] : m(["(", A([f, n("expression")]), f, ")"]);
|
|
3973
|
-
case "AssignmentExpression":
|
|
3974
|
-
return ll(e, t, n);
|
|
3975
|
-
case "VariableDeclarator":
|
|
3976
|
-
return cl(e, t, n);
|
|
3977
|
-
case "BinaryExpression":
|
|
3978
|
-
case "LogicalExpression":
|
|
3979
|
-
return Lu(e, t, n);
|
|
3980
|
-
case "AssignmentPattern":
|
|
3981
|
-
return [n("left"), " = ", n("right")];
|
|
3982
|
-
case "OptionalMemberExpression":
|
|
3983
|
-
case "MemberExpression":
|
|
3984
|
-
return il(e, t, n);
|
|
3985
|
-
case "MetaProperty":
|
|
3986
|
-
return [n("meta"), ".", n("property")];
|
|
3987
|
-
case "BindExpression":
|
|
3988
|
-
return u.object && o.push(n("object")), o.push(m(A([f, sa(e, t, n)]))), o;
|
|
3989
|
-
case "Identifier":
|
|
3990
|
-
return [u.name, ne(e), ia(e), z(e, n)];
|
|
3991
|
-
case "V8IntrinsicIdentifier":
|
|
3992
|
-
return ["%", u.name];
|
|
3993
|
-
case "SpreadElement":
|
|
3994
|
-
case "SpreadElementPattern":
|
|
3995
|
-
case "SpreadPropertyPattern":
|
|
3996
|
-
case "RestElement":
|
|
3997
|
-
return pa(e, n);
|
|
3998
|
-
case "FunctionDeclaration":
|
|
3999
|
-
case "FunctionExpression":
|
|
4000
|
-
return ya(e, n, t, r);
|
|
4001
|
-
case "ArrowFunctionExpression":
|
|
4002
|
-
return Kl(e, t, n, r);
|
|
4003
|
-
case "YieldExpression":
|
|
4004
|
-
return o.push("yield"), u.delegate && o.push("*"), u.argument && o.push(" ", n("argument")), o;
|
|
4005
|
-
case "AwaitExpression":
|
|
4006
|
-
if (o.push("await"), u.argument) {
|
|
4007
|
-
o.push(" ", n("argument"));
|
|
4008
|
-
let { parent: i } = e;
|
|
4009
|
-
if (L(i) && i.callee === u || U(i) && i.object === u) {
|
|
4010
|
-
o = [A([f, ...o]), f];
|
|
4011
|
-
let s = e.findAncestor((l) => l.type === "AwaitExpression" || l.type === "BlockStatement");
|
|
4012
|
-
if ((s == null ? void 0 : s.type) !== "AwaitExpression" || !ee(s.argument, (l) => l === u))
|
|
4013
|
-
return m(o);
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
return o;
|
|
4017
|
-
case "ExportDefaultDeclaration":
|
|
4018
|
-
case "ExportNamedDeclaration":
|
|
4019
|
-
case "ExportAllDeclaration":
|
|
4020
|
-
return ja(e, t, n);
|
|
4021
|
-
case "ImportDeclaration":
|
|
4022
|
-
return hc(e, t, n);
|
|
4023
|
-
case "ImportSpecifier":
|
|
4024
|
-
case "ExportSpecifier":
|
|
4025
|
-
case "ImportNamespaceSpecifier":
|
|
4026
|
-
case "ExportNamespaceSpecifier":
|
|
4027
|
-
case "ImportDefaultSpecifier":
|
|
4028
|
-
case "ExportDefaultSpecifier":
|
|
4029
|
-
return Bc(e, t, n);
|
|
4030
|
-
case "ImportAttribute":
|
|
4031
|
-
return En(e, t, n);
|
|
4032
|
-
case "Program":
|
|
4033
|
-
case "BlockStatement":
|
|
4034
|
-
case "StaticBlock":
|
|
4035
|
-
return Fa(e, t, n);
|
|
4036
|
-
case "ClassBody":
|
|
4037
|
-
return cc(e, t, n);
|
|
4038
|
-
case "ThrowStatement":
|
|
4039
|
-
return Gl(e, t, n);
|
|
4040
|
-
case "ReturnStatement":
|
|
4041
|
-
return Ul(e, t, n);
|
|
4042
|
-
case "NewExpression":
|
|
4043
|
-
case "ImportExpression":
|
|
4044
|
-
case "OptionalCallExpression":
|
|
4045
|
-
case "CallExpression":
|
|
4046
|
-
return Ru(e, t, n);
|
|
4047
|
-
case "ObjectExpression":
|
|
4048
|
-
case "ObjectPattern":
|
|
4049
|
-
case "RecordExpression":
|
|
4050
|
-
return pn(e, t, n);
|
|
4051
|
-
case "Property":
|
|
4052
|
-
return nn(u) ? Ln(e, t, n) : En(e, t, n);
|
|
4053
|
-
case "ObjectProperty":
|
|
4054
|
-
return En(e, t, n);
|
|
4055
|
-
case "ObjectMethod":
|
|
4056
|
-
return Ln(e, t, n);
|
|
4057
|
-
case "Decorator":
|
|
4058
|
-
return ["@", n("expression")];
|
|
4059
|
-
case "ArrayExpression":
|
|
4060
|
-
case "ArrayPattern":
|
|
4061
|
-
case "TupleExpression":
|
|
4062
|
-
return ur(e, t, n);
|
|
4063
|
-
case "SequenceExpression": {
|
|
4064
|
-
let { parent: i } = e;
|
|
4065
|
-
if (i.type === "ExpressionStatement" || i.type === "ForStatement") {
|
|
4066
|
-
let s = [];
|
|
4067
|
-
return e.each(({ isFirst: l }) => {
|
|
4068
|
-
l ? s.push(n()) : s.push(",", A([C, n()]));
|
|
4069
|
-
}, "expressions"), m(s);
|
|
4070
|
-
}
|
|
4071
|
-
return m(I([",", C], e.map(n, "expressions")));
|
|
4072
|
-
}
|
|
4073
|
-
case "ThisExpression":
|
|
4074
|
-
return "this";
|
|
4075
|
-
case "Super":
|
|
4076
|
-
return "super";
|
|
4077
|
-
case "Directive":
|
|
4078
|
-
return [n("value"), a];
|
|
4079
|
-
case "UnaryExpression":
|
|
4080
|
-
return o.push(u.operator), /[a-z]$/u.test(u.operator) && o.push(" "), h(u.argument) ? o.push(m(["(", A([f, n("argument")]), f, ")"])) : o.push(n("argument")), o;
|
|
4081
|
-
case "UpdateExpression":
|
|
4082
|
-
return [u.prefix ? u.operator : "", n("argument"), u.prefix ? "" : u.operator];
|
|
4083
|
-
case "ConditionalExpression":
|
|
4084
|
-
return sr(e, t, n, r);
|
|
4085
|
-
case "VariableDeclaration": {
|
|
4086
|
-
let i = e.map(n, "declarations"), s = e.parent, l = s.type === "ForStatement" || s.type === "ForInStatement" || s.type === "ForOfStatement", d = u.declarations.some((D) => D.init), c;
|
|
4087
|
-
return i.length === 1 && !h(u.declarations[0]) ? c = i[0] : i.length > 0 && (c = A(i[0])), o = [ae(e), u.kind, c ? [" ", c] : "", A(i.slice(1).map((D) => [",", d && !l ? F : C, D]))], l && s.body !== u || o.push(a), m(o);
|
|
4088
|
-
}
|
|
4089
|
-
case "WithStatement":
|
|
4090
|
-
return m(["with (", n("object"), ")", Me(u.body, n("body"))]);
|
|
4091
|
-
case "IfStatement": {
|
|
4092
|
-
let i = Me(u.consequent, n("consequent")), s = m(["if (", m([A([f, n("test")]), f]), ")", i]);
|
|
4093
|
-
if (o.push(s), u.alternate) {
|
|
4094
|
-
let l = h(u.consequent, T.Trailing | T.Line) || tu(u), d = u.consequent.type === "BlockStatement" && !l;
|
|
4095
|
-
o.push(d ? " " : F), h(u, T.Dangling) && o.push(R(e, t), l ? F : " "), o.push("else", m(Me(u.alternate, n("alternate"), u.alternate.type === "IfStatement")));
|
|
4096
|
-
}
|
|
4097
|
-
return o;
|
|
4098
|
-
}
|
|
4099
|
-
case "ForStatement": {
|
|
4100
|
-
let i = Me(u.body, n("body")), s = R(e, t), l = s ? [s, f] : "";
|
|
4101
|
-
return !u.init && !u.test && !u.update ? [l, m(["for (;;)", i])] : [l, m(["for (", m([A([f, n("init"), ";", C, n("test"), ";", C, n("update")]), f]), ")", i])];
|
|
4102
|
-
}
|
|
4103
|
-
case "WhileStatement":
|
|
4104
|
-
return m(["while (", m([A([f, n("test")]), f]), ")", Me(u.body, n("body"))]);
|
|
4105
|
-
case "ForInStatement":
|
|
4106
|
-
return m(["for (", n("left"), " in ", n("right"), ")", Me(u.body, n("body"))]);
|
|
4107
|
-
case "ForOfStatement":
|
|
4108
|
-
return m(["for", u.await ? " await" : "", " (", n("left"), " of ", n("right"), ")", Me(u.body, n("body"))]);
|
|
4109
|
-
case "DoWhileStatement": {
|
|
4110
|
-
let i = Me(u.body, n("body"));
|
|
4111
|
-
return o = [m(["do", i])], u.body.type === "BlockStatement" ? o.push(" ") : o.push(F), o.push("while (", m([A([f, n("test")]), f]), ")", a), o;
|
|
4112
|
-
}
|
|
4113
|
-
case "DoExpression":
|
|
4114
|
-
return [u.async ? "async " : "", "do ", n("body")];
|
|
4115
|
-
case "BreakStatement":
|
|
4116
|
-
case "ContinueStatement":
|
|
4117
|
-
return o.push(u.type === "BreakStatement" ? "break" : "continue"), u.label && o.push(" ", n("label")), o.push(a), o;
|
|
4118
|
-
case "LabeledStatement":
|
|
4119
|
-
return u.body.type === "EmptyStatement" ? [n("label"), ":;"] : [n("label"), ": ", n("body")];
|
|
4120
|
-
case "TryStatement":
|
|
4121
|
-
return ["try ", n("block"), u.handler ? [" ", n("handler")] : "", u.finalizer ? [" finally ", n("finalizer")] : ""];
|
|
4122
|
-
case "CatchClause":
|
|
4123
|
-
if (u.param) {
|
|
4124
|
-
let i = h(u.param, (l) => !De(l) || l.leading && se(t.originalText, j(l)) || l.trailing && se(t.originalText, W(l), { backwards: !0 })), s = n("param");
|
|
4125
|
-
return ["catch ", i ? ["(", A([f, s]), f, ") "] : ["(", s, ") "], n("body")];
|
|
4126
|
-
}
|
|
4127
|
-
return ["catch ", n("body")];
|
|
4128
|
-
case "SwitchStatement":
|
|
4129
|
-
return [m(["switch (", A([f, n("discriminant")]), f, ")"]), " {", u.cases.length > 0 ? A([F, I(F, e.map(({ node: i, isLast: s }) => [n(), !s && we(i, t) ? F : ""], "cases"))]) : "", F, "}"];
|
|
4130
|
-
case "SwitchCase": {
|
|
4131
|
-
u.test ? o.push("case ", n("test"), ":") : o.push("default:"), h(u, T.Dangling) && o.push(" ", R(e, t));
|
|
4132
|
-
let i = u.consequent.filter((s) => s.type !== "EmptyStatement");
|
|
4133
|
-
if (i.length > 0) {
|
|
4134
|
-
let s = Mn(e, t, n, "consequent");
|
|
4135
|
-
o.push(i.length === 1 && i[0].type === "BlockStatement" ? [" ", s] : A([F, s]));
|
|
4136
|
-
}
|
|
4137
|
-
return o;
|
|
4138
|
-
}
|
|
4139
|
-
case "DebuggerStatement":
|
|
4140
|
-
return ["debugger", a];
|
|
4141
|
-
case "ClassDeclaration":
|
|
4142
|
-
case "ClassExpression":
|
|
4143
|
-
return Ca(e, t, n);
|
|
4144
|
-
case "ClassMethod":
|
|
4145
|
-
case "ClassPrivateMethod":
|
|
4146
|
-
case "MethodDefinition":
|
|
4147
|
-
return ba(e, t, n);
|
|
4148
|
-
case "ClassProperty":
|
|
4149
|
-
case "PropertyDefinition":
|
|
4150
|
-
case "ClassPrivateProperty":
|
|
4151
|
-
case "ClassAccessorProperty":
|
|
4152
|
-
case "AccessorProperty":
|
|
4153
|
-
return Ba(e, t, n);
|
|
4154
|
-
case "TemplateElement":
|
|
4155
|
-
return He(u.value.raw);
|
|
4156
|
-
case "TemplateLiteral":
|
|
4157
|
-
return Su(e, n, t);
|
|
4158
|
-
case "TaggedTemplateExpression":
|
|
4159
|
-
return gs(e, n);
|
|
4160
|
-
case "PrivateIdentifier":
|
|
4161
|
-
return ["#", u.name];
|
|
4162
|
-
case "PrivateName":
|
|
4163
|
-
return ["#", n("id")];
|
|
4164
|
-
case "TopicReference":
|
|
4165
|
-
return "%";
|
|
4166
|
-
case "ArgumentPlaceholder":
|
|
4167
|
-
return "?";
|
|
4168
|
-
case "ModuleExpression":
|
|
4169
|
-
return ["module ", n("body")];
|
|
4170
|
-
case "InterpreterDirective":
|
|
4171
|
-
default:
|
|
4172
|
-
throw new xt(u, "ESTree");
|
|
4173
|
-
}
|
|
4174
|
-
}
|
|
4175
|
-
function _a(e, t, n) {
|
|
4176
|
-
let { parent: r, node: u, key: a } = e, o = [n("expression")];
|
|
4177
|
-
switch (u.type) {
|
|
4178
|
-
case "AsConstExpression":
|
|
4179
|
-
o.push(" as const");
|
|
4180
|
-
break;
|
|
4181
|
-
case "AsExpression":
|
|
4182
|
-
case "TSAsExpression":
|
|
4183
|
-
o.push(" as ", n("typeAnnotation"));
|
|
4184
|
-
break;
|
|
4185
|
-
case "SatisfiesExpression":
|
|
4186
|
-
case "TSSatisfiesExpression":
|
|
4187
|
-
o.push(" satisfies ", n("typeAnnotation"));
|
|
4188
|
-
break;
|
|
4189
|
-
}
|
|
4190
|
-
return a === "callee" && L(r) || a === "object" && U(r) ? m([A([f, ...o]), f]) : o;
|
|
4191
|
-
}
|
|
4192
|
-
function qc(e, t, n) {
|
|
4193
|
-
let { node: r } = e, u = [ae(e), "component"];
|
|
4194
|
-
r.id && u.push(" ", n("id")), u.push(n("typeParameters"));
|
|
4195
|
-
let a = _c(e, n, t);
|
|
4196
|
-
return r.rendersType ? u.push(m([a, " ", n("rendersType")])) : u.push(m([a])), r.body && u.push(" ", n("body")), t.semi && r.type === "DeclareComponent" && u.push(";"), u;
|
|
4197
|
-
}
|
|
4198
|
-
function _c(e, t, n) {
|
|
4199
|
-
let { node: r } = e, u = r.params;
|
|
4200
|
-
if (r.rest && (u = [...u, r.rest]), u.length === 0)
|
|
4201
|
-
return ["(", R(e, n, { filter: (o) => Ae(n.originalText, j(o)) === ")" }), ")"];
|
|
4202
|
-
let a = [];
|
|
4203
|
-
return Rc(e, (o, i) => {
|
|
4204
|
-
let s = i === u.length - 1;
|
|
4205
|
-
s && r.rest && a.push("..."), a.push(t()), !s && (a.push(","), we(u[i], n) ? a.push(F, F) : a.push(C));
|
|
4206
|
-
}), ["(", A([f, ...a]), w(Pe(n, "all") && !Xc(r, u) ? "," : ""), f, ")"];
|
|
4207
|
-
}
|
|
4208
|
-
function Xc(e, t) {
|
|
4209
|
-
var n;
|
|
4210
|
-
return e.rest || ((n = _(!1, t, -1)) == null ? void 0 : n.type) === "RestElement";
|
|
4211
|
-
}
|
|
4212
|
-
function Rc(e, t) {
|
|
4213
|
-
let { node: n } = e, r = 0, u = (a) => t(a, r++);
|
|
4214
|
-
e.each(u, "params"), n.rest && e.call(u, "rest");
|
|
4215
|
-
}
|
|
4216
|
-
function $c(e, t, n) {
|
|
4217
|
-
let { node: r } = e;
|
|
4218
|
-
return r.shorthand ? n("local") : [n("name"), " as ", n("local")];
|
|
4219
|
-
}
|
|
4220
|
-
function Wc(e, t, n) {
|
|
4221
|
-
let { node: r } = e, u = [];
|
|
4222
|
-
return r.name && u.push(n("name"), r.optional ? "?: " : ": "), u.push(n("typeAnnotation")), u;
|
|
4223
|
-
}
|
|
4224
|
-
function Xa(e, t, n) {
|
|
4225
|
-
return pn(e, n, t);
|
|
4226
|
-
}
|
|
4227
|
-
function Ra(e, t) {
|
|
4228
|
-
let { node: n } = e, r = t("id");
|
|
4229
|
-
n.computed && (r = ["[", r, "]"]);
|
|
4230
|
-
let u = "";
|
|
4231
|
-
return n.initializer && (u = t("initializer")), n.init && (u = t("init")), u ? [r, " = ", u] : r;
|
|
4232
|
-
}
|
|
4233
|
-
function Uc(e, t, n) {
|
|
4234
|
-
let { node: r } = e, u;
|
|
4235
|
-
if (r.type === "EnumSymbolBody" || r.explicitType)
|
|
4236
|
-
switch (r.type) {
|
|
4237
|
-
case "EnumBooleanBody":
|
|
4238
|
-
u = "boolean";
|
|
4239
|
-
break;
|
|
4240
|
-
case "EnumNumberBody":
|
|
4241
|
-
u = "number";
|
|
4242
|
-
break;
|
|
4243
|
-
case "EnumBigIntBody":
|
|
4244
|
-
u = "bigint";
|
|
4245
|
-
break;
|
|
4246
|
-
case "EnumStringBody":
|
|
4247
|
-
u = "string";
|
|
4248
|
-
break;
|
|
4249
|
-
case "EnumSymbolBody":
|
|
4250
|
-
u = "symbol";
|
|
4251
|
-
break;
|
|
4252
|
-
}
|
|
4253
|
-
return [u ? `of ${u} ` : "", Xa(e, t, n)];
|
|
4254
|
-
}
|
|
4255
|
-
function $a(e, t, n) {
|
|
4256
|
-
let { node: r } = e;
|
|
4257
|
-
return [ae(e), r.const ? "const " : "", "enum ", t("id"), " ", r.type === "TSEnumDeclaration" ? Xa(e, t, n) : t("body")];
|
|
4258
|
-
}
|
|
4259
|
-
function Gc(e, t, n) {
|
|
4260
|
-
let { node: r } = e, u = ["hook"];
|
|
4261
|
-
r.id && u.push(" ", n("id"));
|
|
4262
|
-
let a = at(e, n, t, !1, !0), o = sn(e, n), i = ht(r, o);
|
|
4263
|
-
return u.push(m([i ? m(a) : a, o]), r.body ? " " : "", n("body")), u;
|
|
4264
|
-
}
|
|
4265
|
-
function Vc(e, t, n) {
|
|
4266
|
-
let { node: r } = e, u = [ae(e), "hook"];
|
|
4267
|
-
return r.id && u.push(" ", n("id")), t.semi && u.push(";"), u;
|
|
4268
|
-
}
|
|
4269
|
-
function Mr(e) {
|
|
4270
|
-
var t;
|
|
4271
|
-
let { node: n } = e;
|
|
4272
|
-
return n.type === "HookTypeAnnotation" && ((t = e.getParentNode(2)) == null ? void 0 : t.type) === "DeclareHook";
|
|
4273
|
-
}
|
|
4274
|
-
function Kc(e, t, n) {
|
|
4275
|
-
let { node: r } = e, u = [];
|
|
4276
|
-
u.push(Mr(e) ? "" : "hook ");
|
|
4277
|
-
let a = at(e, n, t, !1, !0), o = [];
|
|
4278
|
-
return o.push(Mr(e) ? ": " : " => ", n("returnType")), ht(r, o) && (a = m(a)), u.push(a, o), m(u);
|
|
4279
|
-
}
|
|
4280
|
-
function Wa(e, t, n) {
|
|
4281
|
-
let { node: r } = e, u = [ae(e), "interface"], a = [], o = [];
|
|
4282
|
-
r.type !== "InterfaceTypeAnnotation" && a.push(" ", n("id"), n("typeParameters"));
|
|
4283
|
-
let i = r.typeParameters && !h(r.typeParameters, T.Trailing | T.Line);
|
|
4284
|
-
return O(r.extends) && o.push(i ? w(" ", C, { groupId: or(r.typeParameters) }) : C, "extends ", (r.extends.length === 1 ? ni : A)(I([",", C], e.map(n, "extends")))), h(r.id, T.Trailing) || O(r.extends) ? i ? u.push(m([...a, A(o)])) : u.push(m(A([...a, ...o]))) : u.push(...a, ...o), u.push(" ", n("body")), m(u);
|
|
4285
|
-
}
|
|
4286
|
-
function Hc(e, t, n) {
|
|
4287
|
-
let { node: r } = e;
|
|
4288
|
-
if (Gr(r))
|
|
4289
|
-
return r.type.slice(0, -14).toLowerCase();
|
|
4290
|
-
let u = t.semi ? ";" : "";
|
|
4291
|
-
switch (r.type) {
|
|
4292
|
-
case "ComponentDeclaration":
|
|
4293
|
-
case "DeclareComponent":
|
|
4294
|
-
case "ComponentTypeAnnotation":
|
|
4295
|
-
return qc(e, t, n);
|
|
4296
|
-
case "ComponentParameter":
|
|
4297
|
-
return $c(e, t, n);
|
|
4298
|
-
case "ComponentTypeParameter":
|
|
4299
|
-
return Wc(e, t, n);
|
|
4300
|
-
case "HookDeclaration":
|
|
4301
|
-
return Gc(e, t, n);
|
|
4302
|
-
case "DeclareHook":
|
|
4303
|
-
return Vc(e, t, n);
|
|
4304
|
-
case "HookTypeAnnotation":
|
|
4305
|
-
return Kc(e, t, n);
|
|
4306
|
-
case "DeclareClass":
|
|
4307
|
-
return Ca(e, t, n);
|
|
4308
|
-
case "DeclareFunction":
|
|
4309
|
-
return [ae(e), "function ", n("id"), n("predicate"), u];
|
|
4310
|
-
case "DeclareModule":
|
|
4311
|
-
return ["declare module ", n("id"), " ", n("body")];
|
|
4312
|
-
case "DeclareModuleExports":
|
|
4313
|
-
return ["declare module.exports", z(e, n), u];
|
|
4314
|
-
case "DeclareNamespace":
|
|
4315
|
-
return ["declare namespace ", n("id"), " ", n("body")];
|
|
4316
|
-
case "DeclareVariable":
|
|
4317
|
-
return [ae(e), r.kind ?? "var", " ", n("id"), u];
|
|
4318
|
-
case "DeclareExportDeclaration":
|
|
4319
|
-
case "DeclareExportAllDeclaration":
|
|
4320
|
-
return ja(e, t, n);
|
|
4321
|
-
case "DeclareOpaqueType":
|
|
4322
|
-
case "OpaqueType":
|
|
4323
|
-
return Pl(e, t, n);
|
|
4324
|
-
case "DeclareTypeAlias":
|
|
4325
|
-
case "TypeAlias":
|
|
4326
|
-
return Ku(e, t, n);
|
|
4327
|
-
case "IntersectionTypeAnnotation":
|
|
4328
|
-
return Hu(e, t, n);
|
|
4329
|
-
case "UnionTypeAnnotation":
|
|
4330
|
-
return zu(e, t, n);
|
|
4331
|
-
case "ConditionalTypeAnnotation":
|
|
4332
|
-
return sr(e, t, n);
|
|
4333
|
-
case "InferTypeAnnotation":
|
|
4334
|
-
return Zu(e, t, n);
|
|
4335
|
-
case "FunctionTypeAnnotation":
|
|
4336
|
-
return Qu(e, t, n);
|
|
4337
|
-
case "TupleTypeAnnotation":
|
|
4338
|
-
return ur(e, t, n);
|
|
4339
|
-
case "TupleTypeLabeledElement":
|
|
4340
|
-
return ta(e, t, n);
|
|
4341
|
-
case "TupleTypeSpreadElement":
|
|
4342
|
-
return ea(e, t, n);
|
|
4343
|
-
case "GenericTypeAnnotation":
|
|
4344
|
-
return [n("id"), Pt(e, t, n, "typeParameters")];
|
|
4345
|
-
case "IndexedAccessType":
|
|
4346
|
-
case "OptionalIndexedAccessType":
|
|
4347
|
-
return Yu(e, t, n);
|
|
4348
|
-
case "TypeAnnotation":
|
|
4349
|
-
return ra(e, t, n);
|
|
4350
|
-
case "TypeParameter":
|
|
4351
|
-
return xa(e, t, n);
|
|
4352
|
-
case "TypeofTypeAnnotation":
|
|
4353
|
-
return aa(e, n);
|
|
4354
|
-
case "ExistsTypeAnnotation":
|
|
4355
|
-
return "*";
|
|
4356
|
-
case "ArrayTypeAnnotation":
|
|
4357
|
-
return ua(n);
|
|
4358
|
-
case "DeclareEnum":
|
|
4359
|
-
case "EnumDeclaration":
|
|
4360
|
-
return $a(e, n, t);
|
|
4361
|
-
case "EnumBooleanBody":
|
|
4362
|
-
case "EnumNumberBody":
|
|
4363
|
-
case "EnumBigIntBody":
|
|
4364
|
-
case "EnumStringBody":
|
|
4365
|
-
case "EnumSymbolBody":
|
|
4366
|
-
return Uc(e, n, t);
|
|
4367
|
-
case "EnumBooleanMember":
|
|
4368
|
-
case "EnumNumberMember":
|
|
4369
|
-
case "EnumBigIntMember":
|
|
4370
|
-
case "EnumStringMember":
|
|
4371
|
-
case "EnumDefaultedMember":
|
|
4372
|
-
return Ra(e, n);
|
|
4373
|
-
case "FunctionTypeParam": {
|
|
4374
|
-
let a = r.name ? n("name") : e.parent.this === r ? "this" : "";
|
|
4375
|
-
return [a, ne(e), a ? ": " : "", n("typeAnnotation")];
|
|
4376
|
-
}
|
|
4377
|
-
case "DeclareInterface":
|
|
4378
|
-
case "InterfaceDeclaration":
|
|
4379
|
-
case "InterfaceTypeAnnotation":
|
|
4380
|
-
return Wa(e, t, n);
|
|
4381
|
-
case "ClassImplements":
|
|
4382
|
-
case "InterfaceExtends":
|
|
4383
|
-
return [n("id"), n("typeParameters")];
|
|
4384
|
-
case "NullableTypeAnnotation":
|
|
4385
|
-
return ["?", n("typeAnnotation")];
|
|
4386
|
-
case "Variance": {
|
|
4387
|
-
let { kind: a } = r;
|
|
4388
|
-
return Rn.ok(a === "plus" || a === "minus"), a === "plus" ? "+" : "-";
|
|
4389
|
-
}
|
|
4390
|
-
case "KeyofTypeAnnotation":
|
|
4391
|
-
return ["keyof ", n("argument")];
|
|
4392
|
-
case "ObjectTypeCallProperty":
|
|
4393
|
-
return [r.static ? "static " : "", n("value")];
|
|
4394
|
-
case "ObjectTypeMappedTypeProperty":
|
|
4395
|
-
return uc(e, t, n);
|
|
4396
|
-
case "ObjectTypeIndexer":
|
|
4397
|
-
return [r.static ? "static " : "", r.variance ? n("variance") : "", "[", n("id"), r.id ? ": " : "", n("key"), "]: ", n("value")];
|
|
4398
|
-
case "ObjectTypeProperty": {
|
|
4399
|
-
let a = "";
|
|
4400
|
-
return r.proto ? a = "proto " : r.static && (a = "static "), [a, r.kind !== "init" ? r.kind + " " : "", r.variance ? n("variance") : "", Ot(e, t, n), ne(e), nn(r) ? "" : ": ", n("value")];
|
|
4401
|
-
}
|
|
4402
|
-
case "ObjectTypeAnnotation":
|
|
4403
|
-
return pn(e, t, n);
|
|
4404
|
-
case "ObjectTypeInternalSlot":
|
|
4405
|
-
return [r.static ? "static " : "", "[[", n("id"), "]]", ne(e), r.method ? "" : ": ", n("value")];
|
|
4406
|
-
case "ObjectTypeSpreadProperty":
|
|
4407
|
-
return pa(e, n);
|
|
4408
|
-
case "QualifiedTypeofIdentifier":
|
|
4409
|
-
case "QualifiedTypeIdentifier":
|
|
4410
|
-
return [n("qualification"), ".", n("id")];
|
|
4411
|
-
case "NullLiteralTypeAnnotation":
|
|
4412
|
-
return "null";
|
|
4413
|
-
case "BooleanLiteralTypeAnnotation":
|
|
4414
|
-
return String(r.value);
|
|
4415
|
-
case "StringLiteralTypeAnnotation":
|
|
4416
|
-
return He(dt(pe(r), t));
|
|
4417
|
-
case "NumberLiteralTypeAnnotation":
|
|
4418
|
-
return ft(r.raw ?? r.extra.raw);
|
|
4419
|
-
case "BigIntLiteralTypeAnnotation":
|
|
4420
|
-
return On(r.raw ?? r.extra.raw);
|
|
4421
|
-
case "TypeCastExpression":
|
|
4422
|
-
return ["(", n("expression"), z(e, n), ")"];
|
|
4423
|
-
case "TypePredicate":
|
|
4424
|
-
return oa(e, n);
|
|
4425
|
-
case "TypeOperator":
|
|
4426
|
-
return [r.operator, " ", n("typeAnnotation")];
|
|
4427
|
-
case "TypeParameterDeclaration":
|
|
4428
|
-
case "TypeParameterInstantiation":
|
|
4429
|
-
return Pt(e, t, n, "params");
|
|
4430
|
-
case "InferredPredicate":
|
|
4431
|
-
case "DeclaredPredicate":
|
|
4432
|
-
return [e.key === "predicate" && e.parent.type !== "DeclareFunction" && !e.parent.returnType ? ": " : " ", "%checks", ...r.type === "DeclaredPredicate" ? ["(", n("value"), ")"] : []];
|
|
4433
|
-
case "AsExpression":
|
|
4434
|
-
case "AsConstExpression":
|
|
4435
|
-
case "SatisfiesExpression":
|
|
4436
|
-
return _a(e, t, n);
|
|
4437
|
-
}
|
|
4438
|
-
}
|
|
4439
|
-
function zc(e, t, n) {
|
|
4440
|
-
var r;
|
|
4441
|
-
let { node: u } = e;
|
|
4442
|
-
if (!u.type.startsWith("TS"))
|
|
4443
|
-
return;
|
|
4444
|
-
if (Vr(u))
|
|
4445
|
-
return u.type.slice(2, -7).toLowerCase();
|
|
4446
|
-
let a = t.semi ? ";" : "", o = [];
|
|
4447
|
-
switch (u.type) {
|
|
4448
|
-
case "TSThisType":
|
|
4449
|
-
return "this";
|
|
4450
|
-
case "TSTypeAssertion": {
|
|
4451
|
-
let i = !(Q(u.expression) || Fe(u.expression)), s = m(["<", A([f, n("typeAnnotation")]), f, ">"]), l = [w("("), A([f, n("expression")]), f, w(")")];
|
|
4452
|
-
return i ? Ke([[s, n("expression")], [s, m(l, { shouldBreak: !0 })], [s, n("expression")]]) : m([s, n("expression")]);
|
|
4453
|
-
}
|
|
4454
|
-
case "TSDeclareFunction":
|
|
4455
|
-
return ya(e, n, t);
|
|
4456
|
-
case "TSExportAssignment":
|
|
4457
|
-
return ["export = ", n("expression"), a];
|
|
4458
|
-
case "TSModuleBlock":
|
|
4459
|
-
return Fa(e, t, n);
|
|
4460
|
-
case "TSInterfaceBody":
|
|
4461
|
-
case "TSTypeLiteral":
|
|
4462
|
-
return pn(e, t, n);
|
|
4463
|
-
case "TSTypeAliasDeclaration":
|
|
4464
|
-
return Ku(e, t, n);
|
|
4465
|
-
case "TSQualifiedName":
|
|
4466
|
-
return [n("left"), ".", n("right")];
|
|
4467
|
-
case "TSAbstractMethodDefinition":
|
|
4468
|
-
case "TSDeclareMethod":
|
|
4469
|
-
return ba(e, t, n);
|
|
4470
|
-
case "TSAbstractAccessorProperty":
|
|
4471
|
-
case "TSAbstractPropertyDefinition":
|
|
4472
|
-
return Ba(e, t, n);
|
|
4473
|
-
case "TSInterfaceHeritage":
|
|
4474
|
-
case "TSClassImplements":
|
|
4475
|
-
case "TSExpressionWithTypeArguments":
|
|
4476
|
-
case "TSInstantiationExpression":
|
|
4477
|
-
return [n("expression"), n(u.typeArguments ? "typeArguments" : "typeParameters")];
|
|
4478
|
-
case "TSTemplateLiteralType":
|
|
4479
|
-
return Su(e, n, t);
|
|
4480
|
-
case "TSNamedTupleMember":
|
|
4481
|
-
return ta(e, t, n);
|
|
4482
|
-
case "TSRestType":
|
|
4483
|
-
return ea(e, t, n);
|
|
4484
|
-
case "TSOptionalType":
|
|
4485
|
-
return [n("typeAnnotation"), "?"];
|
|
4486
|
-
case "TSInterfaceDeclaration":
|
|
4487
|
-
return Wa(e, t, n);
|
|
4488
|
-
case "TSTypeParameterDeclaration":
|
|
4489
|
-
case "TSTypeParameterInstantiation":
|
|
4490
|
-
return Pt(e, t, n, "params");
|
|
4491
|
-
case "TSTypeParameter":
|
|
4492
|
-
return xa(e, t, n);
|
|
4493
|
-
case "TSAsExpression":
|
|
4494
|
-
case "TSSatisfiesExpression":
|
|
4495
|
-
return _a(e, t, n);
|
|
4496
|
-
case "TSArrayType":
|
|
4497
|
-
return ua(n);
|
|
4498
|
-
case "TSPropertySignature":
|
|
4499
|
-
return [u.readonly ? "readonly " : "", Ot(e, t, n), ne(e), z(e, n)];
|
|
4500
|
-
case "TSParameterProperty":
|
|
4501
|
-
return [Zt(u), u.static ? "static " : "", u.override ? "override " : "", u.readonly ? "readonly " : "", n("parameter")];
|
|
4502
|
-
case "TSTypeQuery":
|
|
4503
|
-
return aa(e, n);
|
|
4504
|
-
case "TSIndexSignature": {
|
|
4505
|
-
let i = u.parameters.length > 1 ? w(Pe(t) ? "," : "") : "", s = m([A([f, I([", ", f], e.map(n, "parameters"))]), i, f]), l = e.parent.type === "ClassBody" && e.key === "body";
|
|
4506
|
-
return [l && u.static ? "static " : "", u.readonly ? "readonly " : "", "[", u.parameters ? s : "", "]", z(e, n), l ? a : ""];
|
|
4507
|
-
}
|
|
4508
|
-
case "TSTypePredicate":
|
|
4509
|
-
return oa(e, n);
|
|
4510
|
-
case "TSNonNullExpression":
|
|
4511
|
-
return [n("expression"), "!"];
|
|
4512
|
-
case "TSImportType":
|
|
4513
|
-
return ["import(", n("argument"), ")", u.qualifier ? [".", n("qualifier")] : "", Pt(e, t, n, u.typeArguments ? "typeArguments" : "typeParameters")];
|
|
4514
|
-
case "TSLiteralType":
|
|
4515
|
-
return n("literal");
|
|
4516
|
-
case "TSIndexedAccessType":
|
|
4517
|
-
return Yu(e, t, n);
|
|
4518
|
-
case "TSTypeOperator":
|
|
4519
|
-
return [u.operator, " ", n("typeAnnotation")];
|
|
4520
|
-
case "TSMappedType":
|
|
4521
|
-
return ac(e, t, n);
|
|
4522
|
-
case "TSMethodSignature": {
|
|
4523
|
-
let i = u.kind && u.kind !== "method" ? `${u.kind} ` : "";
|
|
4524
|
-
o.push(Zt(u), i, u.computed ? "[" : "", n("key"), u.computed ? "]" : "", ne(e));
|
|
4525
|
-
let s = at(e, n, t, !1, !0), l = u.returnType ? "returnType" : "typeAnnotation", d = u[l], c = d ? z(e, n, l) : "", D = ht(u, c);
|
|
4526
|
-
return o.push(D ? m(s) : s), d && o.push(m(c)), m(o);
|
|
4527
|
-
}
|
|
4528
|
-
case "TSNamespaceExportDeclaration":
|
|
4529
|
-
return ["export as namespace ", n("id"), t.semi ? ";" : ""];
|
|
4530
|
-
case "TSEnumDeclaration":
|
|
4531
|
-
return $a(e, n, t);
|
|
4532
|
-
case "TSEnumMember":
|
|
4533
|
-
return Ra(e, n);
|
|
4534
|
-
case "TSImportEqualsDeclaration":
|
|
4535
|
-
return [u.isExport ? "export " : "", "import ", La(u, !1), n("id"), " = ", n("moduleReference"), t.semi ? ";" : ""];
|
|
4536
|
-
case "TSExternalModuleReference":
|
|
4537
|
-
return ["require(", n("expression"), ")"];
|
|
4538
|
-
case "TSModuleDeclaration": {
|
|
4539
|
-
let { parent: i } = e, s = i.type === "TSModuleDeclaration", l = ((r = u.body) == null ? void 0 : r.type) === "TSModuleDeclaration";
|
|
4540
|
-
return s ? o.push(".") : (o.push(ae(e)), u.kind !== "global" && o.push(u.kind, " ")), o.push(n("id")), l ? o.push(n("body")) : u.body ? o.push(" ", m(n("body"))) : o.push(a), o;
|
|
4541
|
-
}
|
|
4542
|
-
case "TSConditionalType":
|
|
4543
|
-
return sr(e, t, n);
|
|
4544
|
-
case "TSInferType":
|
|
4545
|
-
return Zu(e, t, n);
|
|
4546
|
-
case "TSIntersectionType":
|
|
4547
|
-
return Hu(e, t, n);
|
|
4548
|
-
case "TSUnionType":
|
|
4549
|
-
return zu(e, t, n);
|
|
4550
|
-
case "TSFunctionType":
|
|
4551
|
-
case "TSCallSignatureDeclaration":
|
|
4552
|
-
case "TSConstructorType":
|
|
4553
|
-
case "TSConstructSignatureDeclaration":
|
|
4554
|
-
return Qu(e, t, n);
|
|
4555
|
-
case "TSTupleType":
|
|
4556
|
-
return ur(e, t, n);
|
|
4557
|
-
case "TSTypeReference":
|
|
4558
|
-
return [n("typeName"), Pt(e, t, n, u.typeArguments ? "typeArguments" : "typeParameters")];
|
|
4559
|
-
case "TSTypeAnnotation":
|
|
4560
|
-
return ra(e, t, n);
|
|
4561
|
-
case "TSEmptyBodyFunctionExpression":
|
|
4562
|
-
return ar(e, t, n);
|
|
4563
|
-
case "TSJSDocAllType":
|
|
4564
|
-
return "*";
|
|
4565
|
-
case "TSJSDocUnknownType":
|
|
4566
|
-
return "?";
|
|
4567
|
-
case "TSJSDocNullableType":
|
|
4568
|
-
return Nr(e, n, "?");
|
|
4569
|
-
case "TSJSDocNonNullableType":
|
|
4570
|
-
return Nr(e, n, "!");
|
|
4571
|
-
case "TSParenthesizedType":
|
|
4572
|
-
default:
|
|
4573
|
-
throw new xt(u, "TypeScript");
|
|
4574
|
-
}
|
|
4575
|
-
}
|
|
4576
|
-
function Qc(e, t, n, r) {
|
|
4577
|
-
if (ju(e))
|
|
4578
|
-
return Dp(e, t);
|
|
4579
|
-
for (let u of [Hp, Rp, Hc, zc, Jc]) {
|
|
4580
|
-
let a = u(e, t, n, r);
|
|
4581
|
-
if (a !== void 0)
|
|
4582
|
-
return a;
|
|
4583
|
-
}
|
|
4584
|
-
}
|
|
4585
|
-
var Yc = J(["ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "ClassPrivateProperty", "MethodDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod"]);
|
|
4586
|
-
function Zc(e, t, n, r) {
|
|
4587
|
-
var u;
|
|
4588
|
-
e.isRoot && ((u = t.__onHtmlBindingRoot) == null || u.call(t, e.node, t));
|
|
4589
|
-
let a = Qc(e, t, n, r);
|
|
4590
|
-
if (!a)
|
|
4591
|
-
return "";
|
|
4592
|
-
let { node: o } = e;
|
|
4593
|
-
if (Yc(o))
|
|
4594
|
-
return a;
|
|
4595
|
-
let i = O(o.decorators), s = Zp(e, t, n), l = o.type === "ClassExpression";
|
|
4596
|
-
if (i && !l)
|
|
4597
|
-
return Sn(a, (D) => m([s, D]));
|
|
4598
|
-
let d = ut(e, t), c = fc(e, t);
|
|
4599
|
-
return !s && !d && !c ? a : Sn(a, (D) => [c ? ";" : "", d ? "(" : "", d && l && i ? [A([C, s, D]), C] : [s, D], d ? ")" : ""]);
|
|
4600
|
-
}
|
|
4601
|
-
var eD = Zc, tD = { avoidAstMutation: !0 }, nD = [{ linguistLanguageId: 174, name: "JSON.stringify", type: "data", color: "#292929", tmScope: "source.json", aceMode: "json", codemirrorMode: "javascript", codemirrorMimeType: "application/json", aliases: ["geojson", "jsonl", "topojson"], extensions: [".importmap"], filenames: ["package.json", "package-lock.json", "composer.json"], parsers: ["json-stringify"], vscodeLanguageIds: ["json"] }, { linguistLanguageId: 174, name: "JSON", type: "data", color: "#292929", tmScope: "source.json", aceMode: "json", codemirrorMode: "javascript", codemirrorMimeType: "application/json", aliases: ["geojson", "jsonl", "topojson"], extensions: [".json", ".4DForm", ".4DProject", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".JSON-tmLanguage", ".mcmeta", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"], filenames: [".all-contributorsrc", ".arcconfig", ".auto-changelog", ".c8rc", ".htmlhintrc", ".imgbotconfig", ".nycrc", ".tern-config", ".tern-project", ".watchmanconfig", "Pipfile.lock", "composer.lock", "flake.lock", "mcmod.info", ".babelrc", ".jscsrc", ".jshintrc", ".jslintrc", ".swcrc"], parsers: ["json"], vscodeLanguageIds: ["json"] }, { linguistLanguageId: 423, name: "JSON with Comments", type: "data", color: "#292929", group: "JSON", tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", aliases: ["jsonc"], extensions: [".jsonc", ".code-snippets", ".code-workspace", ".sublime-build", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"], filenames: [], parsers: ["jsonc"], vscodeLanguageIds: ["jsonc"] }, { linguistLanguageId: 175, name: "JSON5", type: "data", color: "#267CB9", extensions: [".json5"], tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "application/json", parsers: ["json5"], vscodeLanguageIds: ["json5"] }], Ua = {};
|
|
4602
|
-
en(Ua, { getVisitorKeys: () => oD, massageAstNode: () => Ga, print: () => iD });
|
|
4603
|
-
var rD = { JsonRoot: ["node"], ArrayExpression: ["elements"], ObjectExpression: ["properties"], ObjectProperty: ["key", "value"], UnaryExpression: ["argument"], NullLiteral: [], BooleanLiteral: [], StringLiteral: [], NumericLiteral: [], Identifier: [], TemplateLiteral: ["quasis"], TemplateElement: [] }, uD = rD, aD = Wr(uD), oD = aD;
|
|
4604
|
-
function iD(e, t, n) {
|
|
4605
|
-
let { node: r } = e;
|
|
4606
|
-
switch (r.type) {
|
|
4607
|
-
case "JsonRoot":
|
|
4608
|
-
return [n("node"), F];
|
|
4609
|
-
case "ArrayExpression": {
|
|
4610
|
-
if (r.elements.length === 0)
|
|
4611
|
-
return "[]";
|
|
4612
|
-
let u = e.map(() => e.node === null ? "null" : n(), "elements");
|
|
4613
|
-
return ["[", A([F, I([",", F], u)]), F, "]"];
|
|
4614
|
-
}
|
|
4615
|
-
case "ObjectExpression":
|
|
4616
|
-
return r.properties.length === 0 ? "{}" : ["{", A([F, I([",", F], e.map(n, "properties"))]), F, "}"];
|
|
4617
|
-
case "ObjectProperty":
|
|
4618
|
-
return [n("key"), ": ", n("value")];
|
|
4619
|
-
case "UnaryExpression":
|
|
4620
|
-
return [r.operator === "+" ? "" : r.operator, n("argument")];
|
|
4621
|
-
case "NullLiteral":
|
|
4622
|
-
return "null";
|
|
4623
|
-
case "BooleanLiteral":
|
|
4624
|
-
return r.value ? "true" : "false";
|
|
4625
|
-
case "StringLiteral":
|
|
4626
|
-
return JSON.stringify(r.value);
|
|
4627
|
-
case "NumericLiteral":
|
|
4628
|
-
return Or(e) ? JSON.stringify(String(r.value)) : JSON.stringify(r.value);
|
|
4629
|
-
case "Identifier":
|
|
4630
|
-
return Or(e) ? JSON.stringify(r.name) : r.name;
|
|
4631
|
-
case "TemplateLiteral":
|
|
4632
|
-
return n(["quasis", 0]);
|
|
4633
|
-
case "TemplateElement":
|
|
4634
|
-
return JSON.stringify(r.value.cooked);
|
|
4635
|
-
default:
|
|
4636
|
-
throw new xt(r, "JSON");
|
|
4637
|
-
}
|
|
4638
|
-
}
|
|
4639
|
-
function Or(e) {
|
|
4640
|
-
return e.key === "key" && e.parent.type === "ObjectProperty";
|
|
4641
|
-
}
|
|
4642
|
-
var sD = /* @__PURE__ */ new Set(["start", "end", "extra", "loc", "comments", "leadingComments", "trailingComments", "innerComments", "errors", "range", "tokens"]);
|
|
4643
|
-
function Ga(e, t) {
|
|
4644
|
-
let { type: n } = e;
|
|
4645
|
-
if (n === "ObjectProperty") {
|
|
4646
|
-
let { key: r } = e;
|
|
4647
|
-
r.type === "Identifier" ? t.key = { type: "StringLiteral", value: r.name } : r.type === "NumericLiteral" && (t.key = { type: "StringLiteral", value: String(r.value) });
|
|
4648
|
-
return;
|
|
4649
|
-
}
|
|
4650
|
-
if (n === "UnaryExpression" && e.operator === "+")
|
|
4651
|
-
return t.argument;
|
|
4652
|
-
if (n === "ArrayExpression") {
|
|
4653
|
-
for (let [r, u] of e.elements.entries())
|
|
4654
|
-
u === null && t.elements.splice(r, 0, { type: "NullLiteral" });
|
|
4655
|
-
return;
|
|
4656
|
-
}
|
|
4657
|
-
if (n === "TemplateLiteral")
|
|
4658
|
-
return { type: "StringLiteral", value: e.quasis[0].value.cooked };
|
|
4659
|
-
}
|
|
4660
|
-
Ga.ignoredProperties = sD;
|
|
4661
|
-
var bt = { bracketSpacing: { category: "Common", type: "boolean", default: !0, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, objectWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap object literals.", choices: [{ value: "preserve", description: "Keep as multi-line, if there is a newline between the opening brace and first property." }, { value: "collapse", description: "Fit to a single line when possible." }] }, singleQuote: { category: "Common", type: "boolean", default: !1, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: !1, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: !1, description: "Enforce single attribute per line in HTML, Vue and JSX." } }, Oe = "JavaScript", pD = { arrowParens: { category: Oe, type: "choice", default: "always", description: "Include parentheses around a sole arrow function parameter.", choices: [{ value: "always", description: "Always include parens. Example: `(x) => x`" }, { value: "avoid", description: "Omit parens when possible. Example: `x => x`" }] }, bracketSameLine: bt.bracketSameLine, objectWrap: bt.objectWrap, bracketSpacing: bt.bracketSpacing, jsxBracketSameLine: { category: Oe, type: "boolean", description: "Put > on the last line instead of at a new line.", deprecated: "2.4.0" }, semi: { category: Oe, type: "boolean", default: !0, description: "Print semicolons.", oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." }, experimentalOperatorPosition: { category: Oe, type: "choice", default: "end", description: "Where to print operators when binary expressions wrap lines.", choices: [{ value: "start", description: "Print operators at the start of new lines." }, { value: "end", description: "Print operators at the end of previous lines." }] }, experimentalTernaries: { category: Oe, type: "boolean", default: !1, description: "Use curious ternaries, with the question mark after the condition.", oppositeDescription: "Default behavior of ternaries; keep question marks on the same line as the consequent." }, singleQuote: bt.singleQuote, jsxSingleQuote: { category: Oe, type: "boolean", default: !1, description: "Use single quotes in JSX." }, quoteProps: { category: Oe, type: "choice", default: "as-needed", description: "Change when properties in objects are quoted.", choices: [{ value: "as-needed", description: "Only add quotes around object properties where required." }, { value: "consistent", description: "If at least one property in an object requires quotes, quote all properties." }, { value: "preserve", description: "Respect the input use of quotes in object properties." }] }, trailingComma: { category: Oe, type: "choice", default: "all", description: "Print trailing commas wherever possible when multi-line.", choices: [{ value: "all", description: "Trailing commas wherever possible (including function arguments)." }, { value: "es5", description: "Trailing commas where valid in ES5 (objects, arrays, etc.)" }, { value: "none", description: "No trailing commas." }] }, singleAttributePerLine: bt.singleAttributePerLine }, lD = pD, cD = { estree: Xr, "estree-json": Ua }, DD = [...no, ...nD], dD = _r;
|
|
4662
|
-
export {
|
|
4663
|
-
dD as default,
|
|
4664
|
-
DD as languages,
|
|
4665
|
-
lD as options,
|
|
4666
|
-
cD as printers
|
|
4667
|
-
};
|
|
4668
|
-
//# sourceMappingURL=estree-2cbea43c.js.map
|