eddyter 1.3.44 → 1.3.51
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/LICENSE +24 -0
- package/README.md +489 -483
- package/dist/App.d.ts +2 -3
- package/dist/Provider/EditorProvider.d.ts +31 -32
- package/dist/Provider/LexicalProvider.d.ts +5 -6
- package/dist/api/ai/index.d.ts +83 -83
- package/dist/api/analytics.d.ts +21 -21
- package/dist/api/auth.d.ts +108 -108
- package/dist/api/bugReport.d.ts +27 -27
- package/dist/api/config/axios.d.ts +1 -2
- package/dist/api/config/endpoints.d.ts +24 -24
- package/dist/api/featureSuggestion.d.ts +23 -23
- package/dist/api/feedback.d.ts +26 -26
- package/dist/api/linkPreview.d.ts +15 -15
- package/dist/api/transcript/index.d.ts +21 -21
- package/dist/assets/style.css +1 -7989
- package/dist/{babel-d155920e.js → babel-44680aef.js} +4343 -4102
- package/dist/components/AiPlugin/index.d.ts +6 -6
- package/dist/components/AlignMenu/AlignMenu.d.ts +8 -9
- package/dist/components/AlignMenu/AlignMenuDrop.d.ts +2 -3
- package/dist/components/AlignMenu/index.d.ts +1 -1
- package/dist/components/AutoExpandingDemo.d.ts +5 -6
- package/dist/components/BlockFormatMenu/BlockFormatMenu.d.ts +2 -3
- package/dist/components/BlockFormatMenu/constants.d.ts +14 -14
- package/dist/components/BlockFormatMenu/index.d.ts +1 -1
- package/dist/components/BugReportDialog/index.d.ts +6 -6
- package/dist/components/ChartEditDialog.d.ts +8 -9
- package/dist/components/ChartInsertDialog.d.ts +7 -8
- package/dist/components/CodeActionMenuPlugin/components/CopyButton/index.d.ts +6 -7
- package/dist/components/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +8 -9
- package/dist/components/CodeActionMenuPlugin/index.d.ts +4 -5
- package/dist/components/CodeActionMenuPlugin/utils.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +2 -3
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/CommentSidebar/CommentSidebar.d.ts +7 -8
- package/dist/components/CommentSidebar/index.d.ts +1 -1
- package/dist/components/CommentToggle/CommentToggle.d.ts +7 -8
- package/dist/components/CommentToggle/index.d.ts +1 -1
- package/dist/components/CommentView/CommentView.d.ts +8 -9
- package/dist/components/CommentView/index.d.ts +1 -1
- package/dist/components/ConfigurableEditorWithAuth.d.ts +34 -35
- package/dist/components/ContentPreview/index.d.ts +36 -37
- package/dist/components/DatePicker/DatePickerWidget.d.ts +6 -7
- package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +2 -3
- package/dist/components/EmojiPickerWidget/index.d.ts +1 -1
- package/dist/components/FeatureSuggestionDialog/index.d.ts +6 -6
- package/dist/components/FeedbackDialog/index.d.ts +7 -7
- package/dist/components/FileUpload/InsertFileDialog.d.ts +7 -7
- package/dist/components/FileUpload/InsertFileUploadedDialogBody.d.ts +4 -5
- package/dist/components/FileView/index.d.ts +8 -9
- package/dist/components/FontFamilySelect/FontFamilyMenu.d.ts +6 -7
- package/dist/components/FontSizePicker/FontSizeControl.d.ts +2 -3
- package/dist/components/FormatTextMenu/FormatTextMenu.d.ts +2 -3
- package/dist/components/FormatTextMenu/FormatTextMenuDrop.d.ts +2 -3
- package/dist/components/FormatTextMenu/index.d.ts +1 -1
- package/dist/components/HighlightColorPicker/HighlightColorPicker.d.ts +6 -7
- package/dist/components/HtmlViewDisplay.d.ts +2 -3
- package/dist/components/ImageComparisonDialog/index.d.ts +10 -11
- package/dist/components/ImageGenerationDialog/ImageGenerationManager.d.ts +10 -11
- package/dist/components/ImageGenerationDialog/index.d.ts +10 -11
- package/dist/components/ImageInsertTest.d.ts +2 -3
- package/dist/components/ImageView/ImageDialog/ImageUploadDialogBody.d.ts +8 -9
- package/dist/components/ImageView/ImageDialog/index.d.ts +5 -6
- package/dist/components/ImageView/ImageResizer.d.ts +15 -16
- package/dist/components/ImageView/index.d.ts +16 -17
- package/dist/components/InsertMenu/InsertMenu.d.ts +8 -9
- package/dist/components/InsertMenu/InsertMenuDrop.d.ts +8 -9
- package/dist/components/InsertMenu/index.d.ts +1 -1
- package/dist/components/LanguageSelectorDialog/index.d.ts +7 -8
- package/dist/components/LinkPreviewHover/index.d.ts +40 -40
- package/dist/components/NotePanelMenu/NotePanelMenu.d.ts +5 -6
- package/dist/components/NotePanelMenu/index.d.ts +1 -1
- package/dist/components/NotePanelView/NotePanelView.d.ts +8 -9
- package/dist/components/NotePanelView/index.d.ts +1 -1
- package/dist/components/Placeholder/Placeholder.d.ts +2 -3
- package/dist/components/Placeholder/index.d.ts +1 -1
- package/dist/components/Placeholder/styles.d.ts +1 -1
- package/dist/components/ScopedEditor.d.ts +8 -8
- package/dist/components/SignatureCaption/index.d.ts +5 -6
- package/dist/components/TableColorPicker/index.d.ts +7 -8
- package/dist/components/TableModal/TableModal.d.ts +9 -10
- package/dist/components/TextEnhanceDialog/index.d.ts +9 -10
- package/dist/components/ToneAdjustDialog/index.d.ts +7 -8
- package/dist/components/Toolbar/Toolbar.d.ts +2 -3
- package/dist/components/Toolbar/index.d.ts +1 -1
- package/dist/components/Toolbar/styles.d.ts +6 -6
- package/dist/components/VoiceTranscriptIcon/VoiceTranscriptIcon.d.ts +1 -2
- package/dist/components/VoiceTranscriptIcon/index.d.ts +1 -1
- package/dist/components/ui/avatar.d.ts +6 -6
- package/dist/components/ui/badge.d.ts +8 -9
- package/dist/components/ui/button.d.ts +10 -11
- package/dist/components/ui/calendar.d.ts +7 -8
- package/dist/components/ui/card.d.ts +8 -8
- package/dist/components/ui/checkbox.d.ts +4 -4
- package/dist/components/ui/dialog.d.ts +19 -19
- package/dist/components/ui/dropdown-menu.d.ts +27 -27
- package/dist/components/ui/input.d.ts +3 -3
- package/dist/components/ui/label.d.ts +4 -4
- package/dist/components/ui/popover.d.ts +7 -7
- package/dist/components/ui/select.d.ts +13 -13
- package/dist/components/ui/separator.d.ts +4 -4
- package/dist/components/ui/sheet.d.ts +24 -24
- package/dist/components/ui/skeleton.d.ts +3 -3
- package/dist/components/ui/tabs.d.ts +7 -7
- package/dist/components/ui/textarea.d.ts +3 -3
- package/dist/components/ui/tooltip.d.ts +7 -7
- package/dist/constants.d.ts +21 -22
- package/dist/context/CommentContext.d.ts +42 -43
- package/dist/context/HtmlViewContext.d.ts +16 -17
- package/dist/context/ToolbarContext.d.ts +55 -56
- package/dist/editorConfig.d.ts +70 -70
- package/dist/estree-a7dc9ac5.js +4647 -0
- package/dist/hooks/useAutoExpandingHeight.d.ts +15 -15
- package/dist/hooks/useBlockFormat.d.ts +16 -17
- package/dist/hooks/useColorPicker.d.ts +6 -6
- package/dist/hooks/useCustomCommands.d.ts +2 -3
- package/dist/hooks/useDebounce.d.ts +1 -1
- package/dist/hooks/useEditorToolbar.d.ts +9 -10
- package/dist/hooks/useFeedbackEligibility.d.ts +18 -18
- package/dist/hooks/useInsertMenu.d.ts +9 -9
- package/dist/hooks/useModal.d.ts +5 -5
- package/dist/hooks/useReactNativeBridge.d.ts +54 -54
- package/dist/hooks/useS3Uploader.d.ts +21 -21
- package/dist/hooks/useVoiceToText.d.ts +20 -20
- package/dist/html-f2fcab26.js +2882 -0
- package/dist/html2pdf.bundle-09e49a74.js +34001 -0
- package/dist/html2pdf.bundle.min-5c629a1a.js +21964 -0
- package/dist/index-1cd4fd49.js +1002 -0
- package/dist/index-269df0bf.js +35387 -0
- package/dist/index-28f8506d.js +111 -0
- package/dist/index.d.ts +14 -14
- package/dist/index.js +13 -14
- package/dist/lib/utils.d.ts +1 -2
- package/dist/main.d.ts +0 -1
- package/dist/markdown-48d2f5f1.js +3592 -0
- package/dist/nodes/ChartNode.d.ts +40 -41
- package/dist/nodes/CommentNode.d.ts +33 -34
- package/dist/nodes/CommentedTextNode.d.ts +28 -29
- package/dist/nodes/EmbedNode.d.ts +31 -32
- package/dist/nodes/FileNode.d.ts +31 -32
- package/dist/nodes/ImageNode.d.ts +64 -65
- package/dist/nodes/MentionNode.d.ts +74 -75
- package/dist/nodes/NotePanelNode.d.ts +30 -31
- package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +24 -25
- package/dist/pages/ConfigurableEditor/index.d.ts +2 -2
- package/dist/pages/NotFound.d.ts +2 -2
- package/dist/pages/RichTextEditor.d.ts +6 -6
- package/dist/pages/TextareaEditor.d.ts +6 -6
- package/dist/pages/styles.d.ts +5 -5
- package/dist/plugins/AIChatPlugin.d.ts +10 -11
- package/dist/plugins/AndroidKeyboardFixPlugin.d.ts +16 -16
- package/dist/plugins/AutocompletePlugin.d.ts +22 -22
- package/dist/plugins/CodeBlockNormalizerPlugin.d.ts +8 -8
- package/dist/plugins/CodeBlockSelectAllPlugin.d.ts +8 -8
- package/dist/plugins/CodeHighlightPlugin.d.ts +2 -3
- package/dist/plugins/CombinedAutocompletGrammarPlugin.d.ts +20 -21
- package/dist/plugins/CommentBubblePlugin.d.ts +2 -3
- package/dist/plugins/CommentPlugin.d.ts +6 -7
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +28 -29
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +3 -3
- package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +6 -7
- package/dist/plugins/CustomHorizontalRulePlugin/index.d.ts +3 -3
- package/dist/plugins/DragDropPastePlugin/index.d.ts +8 -8
- package/dist/plugins/EmbedPreviewPlugin/FloatingEmbedMenuPlugin.d.ts +3 -4
- package/dist/plugins/EmbedPreviewPlugin/index.d.ts +5 -6
- package/dist/plugins/FilePlugin.d.ts +7 -8
- package/dist/plugins/FloatingLinkEditorPlugin/index.d.ts +5 -6
- package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +26 -27
- package/dist/plugins/GrammarCheckPlugin.d.ts +1 -2
- package/dist/plugins/HtmlCodeViewPlugin/index.d.ts +2 -2
- package/dist/plugins/HtmlImportPlugin.d.ts +5 -5
- package/dist/plugins/HtmlSyncPlugin.d.ts +3 -3
- package/dist/plugins/ImagePlugin.d.ts +6 -7
- package/dist/plugins/LinkPlugin/index.d.ts +5 -6
- package/dist/plugins/LinkPreviewPlugin/index.d.ts +4 -4
- package/dist/plugins/LocalStoragePlugin.d.ts +6 -7
- package/dist/plugins/MarkdownShortcutsPlugin/index.d.ts +20 -20
- package/dist/plugins/MentionsPlugin/index.d.ts +6 -7
- package/dist/plugins/NotePanelPlugin.d.ts +6 -7
- package/dist/plugins/PasteOptionsPlugin/index.d.ts +17 -17
- package/dist/plugins/RichTextPastePlugin/index.d.ts +5 -6
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasDialog.d.ts +5 -6
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +9 -9
- package/dist/plugins/SignatureCanvasPlugin/index.d.ts +2 -2
- package/dist/plugins/SlashCommandPlugin/index.d.ts +2 -2
- package/dist/plugins/TableActionMenuPlugin/index.d.ts +5 -6
- package/dist/plugins/TableCellResizer/index.d.ts +1 -2
- package/dist/plugins/TableHoverActionsPlugin/index.d.ts +4 -4
- package/dist/plugins/TablePlugin.d.ts +4 -5
- package/dist/plugins/Tableimageautoresizeplugin.d.ts +1 -1
- package/dist/plugins/TextEnhancePlugin.d.ts +6 -6
- package/dist/plugins/TreeViewPlugin.d.ts +2 -3
- package/dist/plugins/UsageTrackingPlugin.d.ts +15 -15
- package/dist/plugins/VoiceTranscriptPlugin.d.ts +22 -22
- package/dist/plugins/WordCountPlugin.d.ts +2 -3
- package/dist/postcss-9ac167c3.js +5172 -0
- package/dist/services/chartService.d.ts +18 -19
- package/dist/standalone-2029bc8b.js +2467 -0
- package/dist/styles/PlaygroundEditorTheme.d.ts +2 -3
- package/dist/types.d.ts +201 -202
- package/dist/typescript-bd1bb88f.js +13632 -0
- package/dist/ui/ColorPicker.d.ts +13 -14
- package/dist/ui/Icons.d.ts +80 -80
- package/dist/ui/TextInput.d.ts +10 -11
- package/dist/utils/dateFormats.d.ts +33 -33
- package/dist/utils/debounce.d.ts +5 -6
- package/dist/utils/editorStyleConverter.d.ts +16 -17
- package/dist/utils/export.d.ts +1 -2
- package/dist/utils/getDOMRangeRect.d.ts +13 -13
- package/dist/utils/getSelectedNode.d.ts +2 -3
- package/dist/utils/helper.d.ts +3 -3
- package/dist/utils/index.d.ts +3 -4
- package/dist/utils/invarient.d.ts +1 -1
- package/dist/utils/setFloatingElemPosition.d.ts +8 -8
- package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -1
- package/dist/utils/url.d.ts +9 -9
- package/package.json +150 -149
- package/dist/babel-d155920e.js.map +0 -1
- package/dist/estree-b1fff53b.js +0 -4706
- package/dist/estree-b1fff53b.js.map +0 -1
- package/dist/html-f95ee5dc.js +0 -2885
- package/dist/html-f95ee5dc.js.map +0 -1
- package/dist/html2pdf.bundle-71c6840e.js +0 -46128
- package/dist/html2pdf.bundle-71c6840e.js.map +0 -1
- package/dist/html2pdf.bundle.min-570c9085.js +0 -21987
- package/dist/html2pdf.bundle.min-570c9085.js.map +0 -1
- package/dist/index-6eb4d179.js +0 -46618
- package/dist/index-6eb4d179.js.map +0 -1
- package/dist/index-92744040.js +0 -1282
- package/dist/index-92744040.js.map +0 -1
- package/dist/index-bb293cb2.js +0 -161
- package/dist/index-bb293cb2.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-1d9e6c3f.js +0 -3759
- package/dist/markdown-1d9e6c3f.js.map +0 -1
- package/dist/postcss-c2592f3f.js +0 -5399
- package/dist/postcss-c2592f3f.js.map +0 -1
- package/dist/standalone-bcc7f37a.js +0 -2649
- package/dist/standalone-bcc7f37a.js.map +0 -1
- package/dist/typescript-48c10f50.js +0 -13601
- package/dist/typescript-48c10f50.js.map +0 -1
|
@@ -0,0 +1,4647 @@
|
|
|
1
|
+
var to = Object.defineProperty;
|
|
2
|
+
var no = (e, t, n) => t in e ? to(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var qt = (e, t, n) => (no(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
var ro = Object.defineProperty, $r = (e) => {
|
|
5
|
+
throw TypeError(e);
|
|
6
|
+
}, en = (e, t) => {
|
|
7
|
+
for (var n in t)
|
|
8
|
+
ro(e, n, { get: t[n], enumerable: !0 });
|
|
9
|
+
}, Wr = (e, t, n) => t.has(e) || $r("Cannot " + n), Je = (e, t, n) => (Wr(e, t, "read from private field"), n ? n.call(e) : t.get(e)), uo = (e, t, n) => t.has(e) ? $r("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ao = (e, t, n, r) => (Wr(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), Rr = {};
|
|
10
|
+
en(Rr, { languages: () => hD, options: () => gD, printers: () => xD });
|
|
11
|
+
var oo = [{ name: "JavaScript", type: "programming", extensions: [".js", "._js", ".bones", ".cjs", ".es", ".es6", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib", ".start.frag", ".end.frag", ".wxs"], tmScope: "source.js", aceMode: "javascript", aliases: ["js", "node"], codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell", "zx"], filenames: ["Jakefile", "start.frag", "end.frag"], parsers: ["babel", "acorn", "espree", "meriyah", "babel-flow", "babel-ts", "flow", "typescript"], vscodeLanguageIds: ["javascript", "mongo"], linguistLanguageId: 183 }, { name: "Flow", type: "programming", extensions: [".js.flow"], tmScope: "source.js", aceMode: "javascript", aliases: [], codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell"], filenames: [], parsers: ["flow", "babel-flow"], vscodeLanguageIds: ["javascript"], linguistLanguageId: 183 }, { name: "JSX", type: "programming", extensions: [".jsx"], tmScope: "source.js.jsx", aceMode: "javascript", aliases: void 0, codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", interpreters: void 0, filenames: void 0, parsers: ["babel", "babel-flow", "babel-ts", "flow", "typescript", "espree", "meriyah"], vscodeLanguageIds: ["javascriptreact"], group: "JavaScript", linguistLanguageId: 183 }, { name: "TypeScript", type: "programming", extensions: [".ts", ".cts", ".mts"], tmScope: "source.ts", aceMode: "typescript", aliases: ["ts"], codemirrorMode: "javascript", codemirrorMimeType: "application/typescript", interpreters: ["bun", "deno", "ts-node", "tsx"], parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescript"], linguistLanguageId: 378 }, { name: "TSX", type: "programming", extensions: [".tsx"], tmScope: "source.tsx", aceMode: "javascript", codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", group: "TypeScript", parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescriptreact"], linguistLanguageId: 94901924 }], Ur = {};
|
|
12
|
+
en(Ur, { canAttachComment: () => Es, embed: () => up, experimentalFeatures: () => cD, getCommentChildNodes: () => Fs, getVisitorKeys: () => zr, handleComments: () => fu, insertPragma: () => Fp, isBlockComment: () => ye, isGap: () => As, massageAstNode: () => mi, print: () => lD, printComment: () => Mi, willPrintOwnComments: () => ku });
|
|
13
|
+
var io = (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 = io, so = (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
|
+
}, X = so;
|
|
20
|
+
function po(e) {
|
|
21
|
+
return e !== null && typeof e == "object";
|
|
22
|
+
}
|
|
23
|
+
var lo = po;
|
|
24
|
+
function* co(e, t) {
|
|
25
|
+
let { getVisitorKeys: n, filter: r = () => !0 } = t, u = (a) => lo(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* Do(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 co(u, t))
|
|
40
|
+
yield a, n.push(a);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function yo(e, { getVisitorKeys: t, predicate: n }) {
|
|
44
|
+
for (let r of Do(e, { getVisitorKeys: t }))
|
|
45
|
+
if (n(r))
|
|
46
|
+
return !0;
|
|
47
|
+
return !1;
|
|
48
|
+
}
|
|
49
|
+
var mo = () => /[#*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 fo(e) {
|
|
51
|
+
return e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
|
|
52
|
+
}
|
|
53
|
+
function Eo(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 Fo = (e) => !(fo(e) || Eo(e)), Ao = /[^\x20-\x7F]/u;
|
|
57
|
+
function go(e) {
|
|
58
|
+
if (!e)
|
|
59
|
+
return 0;
|
|
60
|
+
if (!Ao.test(e))
|
|
61
|
+
return e.length;
|
|
62
|
+
e = e.replace(mo(), " ");
|
|
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 += Fo(r) ? 1 : 2);
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}
|
|
70
|
+
var lt = go;
|
|
71
|
+
function qn(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 ct = qn(" "), xo = qn(",; "), ho = qn(/[^\n\r]/u);
|
|
90
|
+
function Co(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 Dt = Co;
|
|
113
|
+
function To(e, t, n = {}) {
|
|
114
|
+
let r = ct(e, n.backwards ? t - 1 : t, n), u = Dt(e, r, n);
|
|
115
|
+
return r !== u;
|
|
116
|
+
}
|
|
117
|
+
var pe = To;
|
|
118
|
+
function So(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 _n = So;
|
|
129
|
+
function bo(e, t) {
|
|
130
|
+
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? ho(e, t) : t;
|
|
131
|
+
}
|
|
132
|
+
var Xn = bo;
|
|
133
|
+
function Bo(e, t) {
|
|
134
|
+
let n = null, r = t;
|
|
135
|
+
for (; r !== n; )
|
|
136
|
+
n = r, r = xo(e, r), r = _n(e, r), r = ct(e, r);
|
|
137
|
+
return r = Xn(e, r), r = Dt(e, r), r !== !1 && pe(e, r);
|
|
138
|
+
}
|
|
139
|
+
var $n = Bo;
|
|
140
|
+
function vo(e) {
|
|
141
|
+
return Array.isArray(e) && e.length > 0;
|
|
142
|
+
}
|
|
143
|
+
var J = vo, Gr = new Proxy(() => {
|
|
144
|
+
}, { get: () => Gr }), Wn = Gr, _t = "'", fr = '"';
|
|
145
|
+
function ko(e, t) {
|
|
146
|
+
let n = t === !0 || t === _t ? _t : fr, r = n === _t ? fr : _t, 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 Vr = ko;
|
|
152
|
+
function Po(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 wo = Po;
|
|
157
|
+
function Io(e, t) {
|
|
158
|
+
Wn.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 ? "'" : Vr(n, t.singleQuote);
|
|
160
|
+
return e.charAt(0) === r ? e : wo(n, r, !1);
|
|
161
|
+
}
|
|
162
|
+
var yt = Io, Kr = (e) => Number.isInteger(e) && e >= 0;
|
|
163
|
+
function q(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(q(a), u) : u;
|
|
167
|
+
}
|
|
168
|
+
function I(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 = q(e);
|
|
174
|
+
return Kr(n) && n === q(t);
|
|
175
|
+
}
|
|
176
|
+
function No(e, t) {
|
|
177
|
+
let n = I(e);
|
|
178
|
+
return Kr(n) && n === I(t);
|
|
179
|
+
}
|
|
180
|
+
function jo(e, t) {
|
|
181
|
+
return tn(e, t) && No(e, t);
|
|
182
|
+
}
|
|
183
|
+
var Ct = null;
|
|
184
|
+
function bt(e) {
|
|
185
|
+
if (Ct !== null && typeof Ct.property) {
|
|
186
|
+
let t = Ct;
|
|
187
|
+
return Ct = bt.prototype = null, t;
|
|
188
|
+
}
|
|
189
|
+
return Ct = bt.prototype = e ?? /* @__PURE__ */ Object.create(null), new bt();
|
|
190
|
+
}
|
|
191
|
+
var Lo = 10;
|
|
192
|
+
for (let e = 0; e <= Lo; e++)
|
|
193
|
+
bt();
|
|
194
|
+
function Mo(e) {
|
|
195
|
+
return bt(e);
|
|
196
|
+
}
|
|
197
|
+
function Oo(e, t = "type") {
|
|
198
|
+
Mo(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 Hr = Oo, Jo = { ArrayExpression: ["elements"], AssignmentExpression: ["left", "right"], BinaryExpression: ["left", "right"], InterpreterDirective: [], Directive: ["value"], DirectiveLiteral: [], BlockStatement: ["directives", "body"], BreakStatement: ["label"], CallExpression: ["callee", "typeParameters", "typeArguments", "arguments"], 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", "typeParameters", "typeArguments", "arguments"], Program: ["directives", "body"], ObjectExpression: ["properties"], ObjectMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], ObjectProperty: ["decorators", "key", "value"], 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: ["decorators", "properties", "typeAnnotation"], SpreadElement: ["argument"], Super: [], TaggedTemplateExpression: ["tag", "typeParameters", "quasi", "typeArguments"], TemplateElement: [], TemplateLiteral: ["quasis", "expressions"], YieldExpression: ["argument"], AwaitExpression: ["argument"], BigIntLiteral: [], ExportNamespaceSpecifier: ["exported"], OptionalMemberExpression: ["object", "property"], OptionalCallExpression: ["callee", "typeParameters", "typeArguments", "arguments"], 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"], ImportAttribute: ["key", "value"], 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"], Decorator: ["expression"], DoExpression: ["body"], ExportDefaultSpecifier: ["exported"], 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: ["nameType", "typeAnnotation", "key", "constraint"], 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", "body"], 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"], NGChainedExpression: ["expressions"], NGEmptyExpression: [], NGPipeExpression: ["left", "right", "arguments"], NGMicrosyntax: ["body"], NGMicrosyntaxAs: ["key", "alias"], NGMicrosyntaxExpression: ["expression", "alias"], NGMicrosyntaxKey: [], NGMicrosyntaxKeyedExpression: ["key", "expression"], NGMicrosyntaxLet: ["key", "value"], NGRoot: ["node"], JsExpressionRoot: ["node"], JsonRoot: ["node"], TSJSDocAllType: [], TSJSDocUnknownType: [], TSJSDocNullableType: ["typeAnnotation"], TSJSDocNonNullableType: ["typeAnnotation"], NeverTypeAnnotation: [], SatisfiesExpression: ["expression", "typeAnnotation"], UndefinedTypeAnnotation: [], UnknownTypeAnnotation: [] }, qo = Hr(Jo), zr = qo;
|
|
208
|
+
function _o(e) {
|
|
209
|
+
let t = new Set(e);
|
|
210
|
+
return (n) => t.has(n == null ? void 0 : n.type);
|
|
211
|
+
}
|
|
212
|
+
var _ = _o;
|
|
213
|
+
function Xo(e) {
|
|
214
|
+
var t;
|
|
215
|
+
return ((t = e.extra) == null ? void 0 : t.raw) ?? e.raw;
|
|
216
|
+
}
|
|
217
|
+
var oe = Xo, $o = _(["Block", "CommentBlock", "MultiLine"]), ye = $o, Wo = _(["AnyTypeAnnotation", "ThisTypeAnnotation", "NumberTypeAnnotation", "VoidTypeAnnotation", "BooleanTypeAnnotation", "BigIntTypeAnnotation", "SymbolTypeAnnotation", "StringTypeAnnotation", "NeverTypeAnnotation", "UndefinedTypeAnnotation", "UnknownTypeAnnotation", "EmptyTypeAnnotation", "MixedTypeAnnotation"]), Qr = Wo, Ro = _(["Line", "CommentLine", "SingleLine", "HashbangComment", "HTMLOpen", "HTMLClose", "Hashbang", "InterpreterDirective"]), Nt = Ro;
|
|
218
|
+
function Uo(e, t) {
|
|
219
|
+
let n = t.split(".");
|
|
220
|
+
for (let r = n.length - 1; r >= 0; r--) {
|
|
221
|
+
let u = n[r];
|
|
222
|
+
if (r === 0)
|
|
223
|
+
return e.type === "Identifier" && e.name === u;
|
|
224
|
+
if (e.type !== "MemberExpression" || e.optional || e.computed || e.property.type !== "Identifier" || e.property.name !== u)
|
|
225
|
+
return !1;
|
|
226
|
+
e = e.object;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function Go(e, t) {
|
|
230
|
+
return t.some((n) => Uo(e, n));
|
|
231
|
+
}
|
|
232
|
+
var Vo = Go;
|
|
233
|
+
function Ko({ type: e }) {
|
|
234
|
+
return e.startsWith("TS") && e.endsWith("Keyword");
|
|
235
|
+
}
|
|
236
|
+
var Yr = Ko;
|
|
237
|
+
function Tn(e, t) {
|
|
238
|
+
return t(e) || yo(e, { getVisitorKeys: zr, predicate: t });
|
|
239
|
+
}
|
|
240
|
+
function Rn(e) {
|
|
241
|
+
return e.type === "AssignmentExpression" || e.type === "BinaryExpression" || e.type === "LogicalExpression" || e.type === "NGPipeExpression" || e.type === "ConditionalExpression" || L(e) || W(e) || e.type === "SequenceExpression" || e.type === "TaggedTemplateExpression" || e.type === "BindExpression" || e.type === "UpdateExpression" && !e.prefix || Ce(e) || e.type === "TSNonNullExpression" || e.type === "ChainExpression";
|
|
242
|
+
}
|
|
243
|
+
function Ho(e) {
|
|
244
|
+
return e.expressions ? e.expressions[0] : e.left ?? e.test ?? e.callee ?? e.object ?? e.tag ?? e.argument ?? e.expression;
|
|
245
|
+
}
|
|
246
|
+
function Zr(e) {
|
|
247
|
+
if (e.expressions)
|
|
248
|
+
return ["expressions", 0];
|
|
249
|
+
if (e.left)
|
|
250
|
+
return ["left"];
|
|
251
|
+
if (e.test)
|
|
252
|
+
return ["test"];
|
|
253
|
+
if (e.object)
|
|
254
|
+
return ["object"];
|
|
255
|
+
if (e.callee)
|
|
256
|
+
return ["callee"];
|
|
257
|
+
if (e.tag)
|
|
258
|
+
return ["tag"];
|
|
259
|
+
if (e.argument)
|
|
260
|
+
return ["argument"];
|
|
261
|
+
if (e.expression)
|
|
262
|
+
return ["expression"];
|
|
263
|
+
throw new Error("Unexpected node has no left side.");
|
|
264
|
+
}
|
|
265
|
+
var zo = _(["ExportDefaultDeclaration", "DeclareExportDeclaration", "ExportNamedDeclaration", "ExportAllDeclaration", "DeclareExportAllDeclaration"]), Q = _(["ArrayExpression"]), Ae = _(["ObjectExpression"]);
|
|
266
|
+
function Qo(e) {
|
|
267
|
+
return e.type === "LogicalExpression" && e.operator === "??";
|
|
268
|
+
}
|
|
269
|
+
function be(e) {
|
|
270
|
+
return e.type === "NumericLiteral" || e.type === "Literal" && typeof e.value == "number";
|
|
271
|
+
}
|
|
272
|
+
function Yo(e) {
|
|
273
|
+
return e.type === "BooleanLiteral" || e.type === "Literal" && typeof e.value == "boolean";
|
|
274
|
+
}
|
|
275
|
+
function eu(e) {
|
|
276
|
+
return e.type === "UnaryExpression" && (e.operator === "+" || e.operator === "-") && be(e.argument);
|
|
277
|
+
}
|
|
278
|
+
function Y(e) {
|
|
279
|
+
return !!(e && (e.type === "StringLiteral" || e.type === "Literal" && typeof e.value == "string"));
|
|
280
|
+
}
|
|
281
|
+
function tu(e) {
|
|
282
|
+
return e.type === "RegExpLiteral" || e.type === "Literal" && !!e.regex;
|
|
283
|
+
}
|
|
284
|
+
var Un = _(["Literal", "BooleanLiteral", "BigIntLiteral", "DirectiveLiteral", "NullLiteral", "NumericLiteral", "RegExpLiteral", "StringLiteral"]), Zo = _(["Identifier", "ThisExpression", "Super", "PrivateName", "PrivateIdentifier"]), Xe = _(["ObjectTypeAnnotation", "TSTypeLiteral", "TSMappedType"]), kt = _(["FunctionExpression", "ArrowFunctionExpression"]);
|
|
285
|
+
function ei(e) {
|
|
286
|
+
return e.type === "FunctionExpression" || e.type === "ArrowFunctionExpression" && e.body.type === "BlockStatement";
|
|
287
|
+
}
|
|
288
|
+
function cn(e) {
|
|
289
|
+
return L(e) && e.callee.type === "Identifier" && ["async", "inject", "fakeAsync", "waitForAsync"].includes(e.callee.name);
|
|
290
|
+
}
|
|
291
|
+
var K = _(["JSXElement", "JSXFragment"]);
|
|
292
|
+
function nn(e) {
|
|
293
|
+
return e.method && e.kind === "init" || e.kind === "get" || e.kind === "set";
|
|
294
|
+
}
|
|
295
|
+
function nu(e) {
|
|
296
|
+
return (e.type === "ObjectTypeProperty" || e.type === "ObjectTypeInternalSlot") && !e.static && !e.method && e.kind !== "get" && e.kind !== "set" && e.value.type === "FunctionTypeAnnotation";
|
|
297
|
+
}
|
|
298
|
+
function ti(e) {
|
|
299
|
+
return (e.type === "TypeAnnotation" || e.type === "TSTypeAnnotation") && e.typeAnnotation.type === "FunctionTypeAnnotation" && !e.static && !tn(e, e.typeAnnotation);
|
|
300
|
+
}
|
|
301
|
+
var ke = _(["BinaryExpression", "LogicalExpression", "NGPipeExpression"]);
|
|
302
|
+
function st(e) {
|
|
303
|
+
return W(e) || e.type === "BindExpression" && !!e.object;
|
|
304
|
+
}
|
|
305
|
+
var ni = _(["TSThisType", "NullLiteralTypeAnnotation", "BooleanLiteralTypeAnnotation", "StringLiteralTypeAnnotation", "BigIntLiteralTypeAnnotation", "NumberLiteralTypeAnnotation", "TSLiteralType", "TSTemplateLiteralType"]);
|
|
306
|
+
function Gn(e) {
|
|
307
|
+
return Yr(e) || Qr(e) || ni(e) || (e.type === "GenericTypeAnnotation" || e.type === "TSTypeReference") && !e.typeParameters && !e.typeArguments;
|
|
308
|
+
}
|
|
309
|
+
function ri(e) {
|
|
310
|
+
return e.type === "Identifier" && (e.name === "beforeEach" || e.name === "beforeAll" || e.name === "afterEach" || e.name === "afterAll");
|
|
311
|
+
}
|
|
312
|
+
var ui = ["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"];
|
|
313
|
+
function ai(e) {
|
|
314
|
+
return Vo(e, ui);
|
|
315
|
+
}
|
|
316
|
+
function rn(e, t) {
|
|
317
|
+
if ((e == null ? void 0 : e.type) !== "CallExpression" || e.optional)
|
|
318
|
+
return !1;
|
|
319
|
+
let n = de(e);
|
|
320
|
+
if (n.length === 1) {
|
|
321
|
+
if (cn(e) && rn(t))
|
|
322
|
+
return kt(n[0]);
|
|
323
|
+
if (ri(e.callee))
|
|
324
|
+
return cn(n[0]);
|
|
325
|
+
} else if ((n.length === 2 || n.length === 3) && (n[0].type === "TemplateLiteral" || Y(n[0])) && ai(e.callee))
|
|
326
|
+
return n[2] && !be(n[2]) ? !1 : (n.length === 2 ? kt(n[1]) : ei(n[1]) && Z(n[1]).length <= 1) || cn(n[1]);
|
|
327
|
+
return !1;
|
|
328
|
+
}
|
|
329
|
+
var ru = (e) => (t) => ((t == null ? void 0 : t.type) === "ChainExpression" && (t = t.expression), e(t)), L = ru(_(["CallExpression", "OptionalCallExpression"])), W = ru(_(["MemberExpression", "OptionalMemberExpression"]));
|
|
330
|
+
function Er(e, t = 5) {
|
|
331
|
+
return uu(e, t) <= t;
|
|
332
|
+
}
|
|
333
|
+
function uu(e, t) {
|
|
334
|
+
let n = 0;
|
|
335
|
+
for (let r in e) {
|
|
336
|
+
let u = e[r];
|
|
337
|
+
if (u && typeof u == "object" && typeof u.type == "string" && (n++, n += uu(u, t - n)), n > t)
|
|
338
|
+
return n;
|
|
339
|
+
}
|
|
340
|
+
return n;
|
|
341
|
+
}
|
|
342
|
+
var oi = 0.25;
|
|
343
|
+
function Vn(e, t) {
|
|
344
|
+
let { printWidth: n } = t;
|
|
345
|
+
if (h(e))
|
|
346
|
+
return !1;
|
|
347
|
+
let r = n * oi;
|
|
348
|
+
if (e.type === "ThisExpression" || e.type === "Identifier" && e.name.length <= r || eu(e) && !h(e.argument))
|
|
349
|
+
return !0;
|
|
350
|
+
let u = e.type === "Literal" && "regex" in e && e.regex.pattern || e.type === "RegExpLiteral" && e.pattern;
|
|
351
|
+
return u ? u.length <= r : Y(e) ? yt(oe(e), t).length <= r : e.type === "TemplateLiteral" ? e.expressions.length === 0 && e.quasis[0].value.raw.length <= r && !e.quasis[0].value.raw.includes(`
|
|
352
|
+
`) : e.type === "UnaryExpression" ? Vn(e.argument, { printWidth: n }) : e.type === "CallExpression" && e.arguments.length === 0 && e.callee.type === "Identifier" ? e.callee.name.length <= r - 2 : Un(e);
|
|
353
|
+
}
|
|
354
|
+
function Te(e, t) {
|
|
355
|
+
return K(t) ? un(t) : h(t, T.Leading, (n) => pe(e, I(n)));
|
|
356
|
+
}
|
|
357
|
+
function Fr(e) {
|
|
358
|
+
return e.quasis.some((t) => t.value.raw.includes(`
|
|
359
|
+
`));
|
|
360
|
+
}
|
|
361
|
+
function au(e, t) {
|
|
362
|
+
return (e.type === "TemplateLiteral" && Fr(e) || e.type === "TaggedTemplateExpression" && Fr(e.quasi)) && !pe(t, q(e), { backwards: !0 });
|
|
363
|
+
}
|
|
364
|
+
function ou(e) {
|
|
365
|
+
if (!h(e))
|
|
366
|
+
return !1;
|
|
367
|
+
let t = X(!1, Ke(e, T.Dangling), -1);
|
|
368
|
+
return t && !ye(t);
|
|
369
|
+
}
|
|
370
|
+
function ii(e) {
|
|
371
|
+
if (e.length <= 1)
|
|
372
|
+
return !1;
|
|
373
|
+
let t = 0;
|
|
374
|
+
for (let n of e)
|
|
375
|
+
if (kt(n)) {
|
|
376
|
+
if (t += 1, t > 1)
|
|
377
|
+
return !0;
|
|
378
|
+
} else if (L(n)) {
|
|
379
|
+
for (let r of de(n))
|
|
380
|
+
if (kt(r))
|
|
381
|
+
return !0;
|
|
382
|
+
}
|
|
383
|
+
return !1;
|
|
384
|
+
}
|
|
385
|
+
function iu(e) {
|
|
386
|
+
let { node: t, parent: n, key: r } = e;
|
|
387
|
+
return r === "callee" && L(t) && L(n) && n.arguments.length > 0 && t.arguments.length > n.arguments.length;
|
|
388
|
+
}
|
|
389
|
+
var si = /* @__PURE__ */ new Set(["!", "-", "+", "~"]);
|
|
390
|
+
function Ee(e, t = 2) {
|
|
391
|
+
if (t <= 0)
|
|
392
|
+
return !1;
|
|
393
|
+
if (e.type === "ChainExpression" || e.type === "TSNonNullExpression")
|
|
394
|
+
return Ee(e.expression, t);
|
|
395
|
+
let n = (r) => Ee(r, t - 1);
|
|
396
|
+
if (tu(e))
|
|
397
|
+
return lt(e.pattern ?? e.regex.pattern) <= 5;
|
|
398
|
+
if (Un(e) || Zo(e) || e.type === "ArgumentPlaceholder")
|
|
399
|
+
return !0;
|
|
400
|
+
if (e.type === "TemplateLiteral")
|
|
401
|
+
return e.quasis.every((r) => !r.value.raw.includes(`
|
|
402
|
+
`)) && e.expressions.every(n);
|
|
403
|
+
if (Ae(e))
|
|
404
|
+
return e.properties.every((r) => !r.computed && (r.shorthand || r.value && n(r.value)));
|
|
405
|
+
if (Q(e))
|
|
406
|
+
return e.elements.every((r) => r === null || n(r));
|
|
407
|
+
if (dt(e)) {
|
|
408
|
+
if (e.type === "ImportExpression" || Ee(e.callee, t)) {
|
|
409
|
+
let r = de(e);
|
|
410
|
+
return r.length <= t && r.every(n);
|
|
411
|
+
}
|
|
412
|
+
return !1;
|
|
413
|
+
}
|
|
414
|
+
return W(e) ? Ee(e.object, t) && Ee(e.property, t) : e.type === "UnaryExpression" && si.has(e.operator) || e.type === "UpdateExpression" ? Ee(e.argument, t) : !1;
|
|
415
|
+
}
|
|
416
|
+
function pi(e) {
|
|
417
|
+
return e;
|
|
418
|
+
}
|
|
419
|
+
function Ie(e, t = "es5") {
|
|
420
|
+
return e.trailingComma === "es5" && t === "es5" || e.trailingComma === "all" && (t === "all" || t === "es5");
|
|
421
|
+
}
|
|
422
|
+
function te(e, t) {
|
|
423
|
+
switch (e.type) {
|
|
424
|
+
case "BinaryExpression":
|
|
425
|
+
case "LogicalExpression":
|
|
426
|
+
case "AssignmentExpression":
|
|
427
|
+
case "NGPipeExpression":
|
|
428
|
+
return te(e.left, t);
|
|
429
|
+
case "MemberExpression":
|
|
430
|
+
case "OptionalMemberExpression":
|
|
431
|
+
return te(e.object, t);
|
|
432
|
+
case "TaggedTemplateExpression":
|
|
433
|
+
return e.tag.type === "FunctionExpression" ? !1 : te(e.tag, t);
|
|
434
|
+
case "CallExpression":
|
|
435
|
+
case "OptionalCallExpression":
|
|
436
|
+
return e.callee.type === "FunctionExpression" ? !1 : te(e.callee, t);
|
|
437
|
+
case "ConditionalExpression":
|
|
438
|
+
return te(e.test, t);
|
|
439
|
+
case "UpdateExpression":
|
|
440
|
+
return !e.prefix && te(e.argument, t);
|
|
441
|
+
case "BindExpression":
|
|
442
|
+
return e.object && te(e.object, t);
|
|
443
|
+
case "SequenceExpression":
|
|
444
|
+
return te(e.expressions[0], t);
|
|
445
|
+
case "ChainExpression":
|
|
446
|
+
case "TSSatisfiesExpression":
|
|
447
|
+
case "TSAsExpression":
|
|
448
|
+
case "TSNonNullExpression":
|
|
449
|
+
case "AsExpression":
|
|
450
|
+
case "AsConstExpression":
|
|
451
|
+
case "SatisfiesExpression":
|
|
452
|
+
return te(e.expression, t);
|
|
453
|
+
default:
|
|
454
|
+
return t(e);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
var Ar = { "==": !0, "!=": !0, "===": !0, "!==": !0 }, Xt = { "*": !0, "/": !0, "%": !0 }, Sn = { ">>": !0, ">>>": !0, "<<": !0 };
|
|
458
|
+
function Kn(e, t) {
|
|
459
|
+
return !(Kt(t) !== Kt(e) || e === "**" || Ar[e] && Ar[t] || t === "%" && Xt[e] || e === "%" && Xt[t] || t !== e && Xt[t] && Xt[e] || Sn[e] && Sn[t]);
|
|
460
|
+
}
|
|
461
|
+
var li = new Map([["|>"], ["??"], ["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"], ["**"]].flatMap((e, t) => e.map((n) => [n, t])));
|
|
462
|
+
function Kt(e) {
|
|
463
|
+
return li.get(e);
|
|
464
|
+
}
|
|
465
|
+
function ci(e) {
|
|
466
|
+
return !!Sn[e] || e === "|" || e === "^" || e === "&";
|
|
467
|
+
}
|
|
468
|
+
function Di(e) {
|
|
469
|
+
var t;
|
|
470
|
+
if (e.rest)
|
|
471
|
+
return !0;
|
|
472
|
+
let n = Z(e);
|
|
473
|
+
return ((t = X(!1, n, -1)) == null ? void 0 : t.type) === "RestElement";
|
|
474
|
+
}
|
|
475
|
+
var Dn = /* @__PURE__ */ new WeakMap();
|
|
476
|
+
function Z(e) {
|
|
477
|
+
if (Dn.has(e))
|
|
478
|
+
return Dn.get(e);
|
|
479
|
+
let t = [];
|
|
480
|
+
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;
|
|
481
|
+
}
|
|
482
|
+
function yi(e, t) {
|
|
483
|
+
let { node: n } = e, r = 0, u = (a) => t(a, r++);
|
|
484
|
+
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");
|
|
485
|
+
}
|
|
486
|
+
var yn = /* @__PURE__ */ new WeakMap();
|
|
487
|
+
function de(e) {
|
|
488
|
+
if (yn.has(e))
|
|
489
|
+
return yn.get(e);
|
|
490
|
+
if (e.type === "ChainExpression")
|
|
491
|
+
return de(e.expression);
|
|
492
|
+
let t = e.arguments;
|
|
493
|
+
return (e.type === "ImportExpression" || e.type === "TSImportType") && (t = [e.type === "ImportExpression" ? e.source : e.argument], e.options && t.push(e.options)), yn.set(e, t), t;
|
|
494
|
+
}
|
|
495
|
+
function Ht(e, t) {
|
|
496
|
+
let { node: n } = e;
|
|
497
|
+
if (n.type === "ChainExpression")
|
|
498
|
+
return e.call(() => Ht(e, t), "expression");
|
|
499
|
+
n.type === "ImportExpression" || n.type === "TSImportType" ? (e.call((r) => t(r, 0), n.type === "ImportExpression" ? "source" : "argument"), n.options && e.call((r) => t(r, 1), "options")) : e.each(t, "arguments");
|
|
500
|
+
}
|
|
501
|
+
function gr(e, t) {
|
|
502
|
+
let n = [];
|
|
503
|
+
if (e.type === "ChainExpression" && (e = e.expression, n.push("expression")), e.type === "ImportExpression" || e.type === "TSImportType") {
|
|
504
|
+
if (t === 0 || t === (e.options ? -2 : -1))
|
|
505
|
+
return [...n, e.type === "ImportExpression" ? "source" : "argument"];
|
|
506
|
+
if (e.options && (t === 1 || t === -1))
|
|
507
|
+
return [...n, "options"];
|
|
508
|
+
throw new RangeError("Invalid argument index");
|
|
509
|
+
}
|
|
510
|
+
if (t < 0 && (t = e.arguments.length + t), t < 0 || t >= e.arguments.length)
|
|
511
|
+
throw new RangeError("Invalid argument index");
|
|
512
|
+
return [...n, "arguments", t];
|
|
513
|
+
}
|
|
514
|
+
function zt(e) {
|
|
515
|
+
return e.value.trim() === "prettier-ignore" && !e.unignore;
|
|
516
|
+
}
|
|
517
|
+
function un(e) {
|
|
518
|
+
return (e == null ? void 0 : e.prettierIgnore) || h(e, T.PrettierIgnore);
|
|
519
|
+
}
|
|
520
|
+
var T = { Leading: 2, Trailing: 4, Dangling: 8, Block: 16, Line: 32, PrettierIgnore: 64, First: 128, Last: 256 }, su = (e, t) => {
|
|
521
|
+
if (typeof e == "function" && (t = e, e = 0), e || t)
|
|
522
|
+
return (n, r, u) => !(e & T.Leading && !n.leading || e & T.Trailing && !n.trailing || e & T.Dangling && (n.leading || n.trailing) || e & T.Block && !ye(n) || e & T.Line && !Nt(n) || e & T.First && r !== 0 || e & T.Last && r !== u.length - 1 || e & T.PrettierIgnore && !zt(n) || t && !t(n));
|
|
523
|
+
};
|
|
524
|
+
function h(e, t, n) {
|
|
525
|
+
if (!J(e == null ? void 0 : e.comments))
|
|
526
|
+
return !1;
|
|
527
|
+
let r = su(t, n);
|
|
528
|
+
return r ? e.comments.some(r) : !0;
|
|
529
|
+
}
|
|
530
|
+
function Ke(e, t, n) {
|
|
531
|
+
if (!Array.isArray(e == null ? void 0 : e.comments))
|
|
532
|
+
return [];
|
|
533
|
+
let r = su(t, n);
|
|
534
|
+
return r ? e.comments.filter(r) : e.comments;
|
|
535
|
+
}
|
|
536
|
+
var Ne = (e, { originalText: t }) => $n(t, I(e));
|
|
537
|
+
function dt(e) {
|
|
538
|
+
return L(e) || e.type === "NewExpression" || e.type === "ImportExpression";
|
|
539
|
+
}
|
|
540
|
+
function je(e) {
|
|
541
|
+
return e && (e.type === "ObjectProperty" || e.type === "Property" && !nn(e));
|
|
542
|
+
}
|
|
543
|
+
var Ce = _(["TSAsExpression", "TSSatisfiesExpression", "AsExpression", "AsConstExpression", "SatisfiesExpression"]), $e = _(["TSUnionType", "UnionTypeAnnotation"]), Hn = _(["TSIntersectionType", "IntersectionTypeAnnotation"]), We = _(["TSConditionalType", "ConditionalTypeAnnotation"]), di = /* @__PURE__ */ new Set(["range", "raw", "comments", "leadingComments", "trailingComments", "innerComments", "extra", "start", "end", "loc", "flags", "errors", "tokens"]), it = (e) => {
|
|
544
|
+
for (let t of e.quasis)
|
|
545
|
+
delete t.value;
|
|
546
|
+
};
|
|
547
|
+
function pu(e, t) {
|
|
548
|
+
var n;
|
|
549
|
+
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 === " ")
|
|
550
|
+
return null;
|
|
551
|
+
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) {
|
|
552
|
+
let { key: u } = e;
|
|
553
|
+
Y(u) || be(u) ? t.key = String(u.value) : u.type === "Identifier" && (t.key = u.name);
|
|
554
|
+
}
|
|
555
|
+
if (e.type === "JSXElement" && e.openingElement.name.name === "style" && e.openingElement.attributes.some((u) => u.type === "JSXAttribute" && u.name.name === "jsx"))
|
|
556
|
+
for (let { type: u, expression: a } of t.children)
|
|
557
|
+
u === "JSXExpressionContainer" && a.type === "TemplateLiteral" && it(a);
|
|
558
|
+
e.type === "JSXAttribute" && e.name.name === "css" && e.value.type === "JSXExpressionContainer" && e.value.expression.type === "TemplateLiteral" && it(t.value.expression), e.type === "JSXAttribute" && ((n = e.value) == null ? void 0 : n.type) === "Literal" && /["']|"|'/u.test(e.value.value) && (t.value.value = H(!1, e.value.value, /["']|"|'/gu, '"'));
|
|
559
|
+
let r = e.expression || e.callee;
|
|
560
|
+
if (e.type === "Decorator" && r.type === "CallExpression" && r.callee.name === "Component" && r.arguments.length === 1) {
|
|
561
|
+
let u = e.expression.arguments[0].properties;
|
|
562
|
+
for (let [a, o] of t.expression.arguments[0].properties.entries())
|
|
563
|
+
switch (u[a].key.name) {
|
|
564
|
+
case "styles":
|
|
565
|
+
Q(o.value) && it(o.value.elements[0]);
|
|
566
|
+
break;
|
|
567
|
+
case "template":
|
|
568
|
+
o.value.type === "TemplateLiteral" && it(o.value);
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
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" && it(t), e.type === "ChainExpression" && e.expression.type === "TSNonNullExpression" && (t.type = "TSNonNullExpression", t.expression.type = "ChainExpression");
|
|
573
|
+
}
|
|
574
|
+
pu.ignoredProperties = di;
|
|
575
|
+
var mi = pu, Qe = "string", Pe = "array", ft = "cursor", Ye = "indent", Ze = "align", et = "trim", De = "group", Re = "fill", Se = "if-break", tt = "indent-if-break", nt = "line-suffix", Ue = "line-suffix-boundary", se = "line", Le = "label", Me = "break-parent", lu = /* @__PURE__ */ new Set([ft, Ye, Ze, et, De, Re, Se, tt, nt, Ue, se, Le, Me]);
|
|
576
|
+
function fi(e) {
|
|
577
|
+
if (typeof e == "string")
|
|
578
|
+
return Qe;
|
|
579
|
+
if (Array.isArray(e))
|
|
580
|
+
return Pe;
|
|
581
|
+
if (!e)
|
|
582
|
+
return;
|
|
583
|
+
let { type: t } = e;
|
|
584
|
+
if (lu.has(t))
|
|
585
|
+
return t;
|
|
586
|
+
}
|
|
587
|
+
var Ge = fi, Ei = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
|
|
588
|
+
function Fi(e) {
|
|
589
|
+
let t = e === null ? "null" : typeof e;
|
|
590
|
+
if (t !== "string" && t !== "object")
|
|
591
|
+
return `Unexpected doc '${t}',
|
|
592
|
+
Expected it to be 'string' or 'object'.`;
|
|
593
|
+
if (Ge(e))
|
|
594
|
+
throw new Error("doc is valid.");
|
|
595
|
+
let n = Object.prototype.toString.call(e);
|
|
596
|
+
if (n !== "[object Object]")
|
|
597
|
+
return `Unexpected doc '${n}'.`;
|
|
598
|
+
let r = Ei([...lu].map((u) => `'${u}'`));
|
|
599
|
+
return `Unexpected doc.type '${e.type}'.
|
|
600
|
+
Expected it to be ${r}.`;
|
|
601
|
+
}
|
|
602
|
+
var Ai = class extends Error {
|
|
603
|
+
constructor(t) {
|
|
604
|
+
super(Fi(t));
|
|
605
|
+
qt(this, "name", "InvalidDocError");
|
|
606
|
+
this.doc = t;
|
|
607
|
+
}
|
|
608
|
+
}, Pt = Ai, xr = {};
|
|
609
|
+
function gi(e, t, n, r) {
|
|
610
|
+
let u = [e];
|
|
611
|
+
for (; u.length > 0; ) {
|
|
612
|
+
let a = u.pop();
|
|
613
|
+
if (a === xr) {
|
|
614
|
+
n(u.pop());
|
|
615
|
+
continue;
|
|
616
|
+
}
|
|
617
|
+
n && u.push(a, xr);
|
|
618
|
+
let o = Ge(a);
|
|
619
|
+
if (!o)
|
|
620
|
+
throw new Pt(a);
|
|
621
|
+
if ((t == null ? void 0 : t(a)) !== !1)
|
|
622
|
+
switch (o) {
|
|
623
|
+
case Pe:
|
|
624
|
+
case Re: {
|
|
625
|
+
let i = o === Pe ? a : a.parts;
|
|
626
|
+
for (let s = i.length, l = s - 1; l >= 0; --l)
|
|
627
|
+
u.push(i[l]);
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
case Se:
|
|
631
|
+
u.push(a.flatContents, a.breakContents);
|
|
632
|
+
break;
|
|
633
|
+
case De:
|
|
634
|
+
if (r && a.expandedStates)
|
|
635
|
+
for (let i = a.expandedStates.length, s = i - 1; s >= 0; --s)
|
|
636
|
+
u.push(a.expandedStates[s]);
|
|
637
|
+
else
|
|
638
|
+
u.push(a.contents);
|
|
639
|
+
break;
|
|
640
|
+
case Ze:
|
|
641
|
+
case Ye:
|
|
642
|
+
case tt:
|
|
643
|
+
case Le:
|
|
644
|
+
case nt:
|
|
645
|
+
u.push(a.contents);
|
|
646
|
+
break;
|
|
647
|
+
case Qe:
|
|
648
|
+
case ft:
|
|
649
|
+
case et:
|
|
650
|
+
case Ue:
|
|
651
|
+
case se:
|
|
652
|
+
case Me:
|
|
653
|
+
break;
|
|
654
|
+
default:
|
|
655
|
+
throw new Pt(a);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
var zn = gi;
|
|
660
|
+
function Et(e, t) {
|
|
661
|
+
if (typeof e == "string")
|
|
662
|
+
return t(e);
|
|
663
|
+
let n = /* @__PURE__ */ new Map();
|
|
664
|
+
return r(e);
|
|
665
|
+
function r(a) {
|
|
666
|
+
if (n.has(a))
|
|
667
|
+
return n.get(a);
|
|
668
|
+
let o = u(a);
|
|
669
|
+
return n.set(a, o), o;
|
|
670
|
+
}
|
|
671
|
+
function u(a) {
|
|
672
|
+
switch (Ge(a)) {
|
|
673
|
+
case Pe:
|
|
674
|
+
return t(a.map(r));
|
|
675
|
+
case Re:
|
|
676
|
+
return t({ ...a, parts: a.parts.map(r) });
|
|
677
|
+
case Se:
|
|
678
|
+
return t({ ...a, breakContents: r(a.breakContents), flatContents: r(a.flatContents) });
|
|
679
|
+
case De: {
|
|
680
|
+
let { expandedStates: o, contents: i } = a;
|
|
681
|
+
return o ? (o = o.map(r), i = o[0]) : i = r(i), t({ ...a, contents: i, expandedStates: o });
|
|
682
|
+
}
|
|
683
|
+
case Ze:
|
|
684
|
+
case Ye:
|
|
685
|
+
case tt:
|
|
686
|
+
case Le:
|
|
687
|
+
case nt:
|
|
688
|
+
return t({ ...a, contents: r(a.contents) });
|
|
689
|
+
case Qe:
|
|
690
|
+
case ft:
|
|
691
|
+
case et:
|
|
692
|
+
case Ue:
|
|
693
|
+
case se:
|
|
694
|
+
case Me:
|
|
695
|
+
return t(a);
|
|
696
|
+
default:
|
|
697
|
+
throw new Pt(a);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
function cu(e, t, n) {
|
|
702
|
+
let r = n, u = !1;
|
|
703
|
+
function a(o) {
|
|
704
|
+
if (u)
|
|
705
|
+
return !1;
|
|
706
|
+
let i = t(o);
|
|
707
|
+
i !== void 0 && (u = !0, r = i);
|
|
708
|
+
}
|
|
709
|
+
return zn(e, a), r;
|
|
710
|
+
}
|
|
711
|
+
function xi(e) {
|
|
712
|
+
if (e.type === De && e.break || e.type === se && e.hard || e.type === Me)
|
|
713
|
+
return !0;
|
|
714
|
+
}
|
|
715
|
+
function ne(e) {
|
|
716
|
+
return cu(e, xi, !1);
|
|
717
|
+
}
|
|
718
|
+
function hr(e) {
|
|
719
|
+
if (e.length > 0) {
|
|
720
|
+
let t = X(!1, e, -1);
|
|
721
|
+
!t.expandedStates && !t.break && (t.break = "propagated");
|
|
722
|
+
}
|
|
723
|
+
return null;
|
|
724
|
+
}
|
|
725
|
+
function hi(e) {
|
|
726
|
+
let t = /* @__PURE__ */ new Set(), n = [];
|
|
727
|
+
function r(a) {
|
|
728
|
+
if (a.type === Me && hr(n), a.type === De) {
|
|
729
|
+
if (n.push(a), t.has(a))
|
|
730
|
+
return !1;
|
|
731
|
+
t.add(a);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
function u(a) {
|
|
735
|
+
a.type === De && n.pop().break && hr(n);
|
|
736
|
+
}
|
|
737
|
+
zn(e, r, u, !0);
|
|
738
|
+
}
|
|
739
|
+
function Ci(e) {
|
|
740
|
+
return e.type === se && !e.hard ? e.soft ? "" : " " : e.type === Se ? e.flatContents : e;
|
|
741
|
+
}
|
|
742
|
+
function bn(e) {
|
|
743
|
+
return Et(e, Ci);
|
|
744
|
+
}
|
|
745
|
+
function Ti(e) {
|
|
746
|
+
switch (Ge(e)) {
|
|
747
|
+
case Re:
|
|
748
|
+
if (e.parts.every((t) => t === ""))
|
|
749
|
+
return "";
|
|
750
|
+
break;
|
|
751
|
+
case De:
|
|
752
|
+
if (!e.contents && !e.id && !e.break && !e.expandedStates)
|
|
753
|
+
return "";
|
|
754
|
+
if (e.contents.type === De && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates)
|
|
755
|
+
return e.contents;
|
|
756
|
+
break;
|
|
757
|
+
case Ze:
|
|
758
|
+
case Ye:
|
|
759
|
+
case tt:
|
|
760
|
+
case nt:
|
|
761
|
+
if (!e.contents)
|
|
762
|
+
return "";
|
|
763
|
+
break;
|
|
764
|
+
case Se:
|
|
765
|
+
if (!e.flatContents && !e.breakContents)
|
|
766
|
+
return "";
|
|
767
|
+
break;
|
|
768
|
+
case Pe: {
|
|
769
|
+
let t = [];
|
|
770
|
+
for (let n of e) {
|
|
771
|
+
if (!n)
|
|
772
|
+
continue;
|
|
773
|
+
let [r, ...u] = Array.isArray(n) ? n : [n];
|
|
774
|
+
typeof r == "string" && typeof X(!1, t, -1) == "string" ? t[t.length - 1] += r : t.push(r), t.push(...u);
|
|
775
|
+
}
|
|
776
|
+
return t.length === 0 ? "" : t.length === 1 ? t[0] : t;
|
|
777
|
+
}
|
|
778
|
+
case Qe:
|
|
779
|
+
case ft:
|
|
780
|
+
case et:
|
|
781
|
+
case Ue:
|
|
782
|
+
case se:
|
|
783
|
+
case Le:
|
|
784
|
+
case Me:
|
|
785
|
+
break;
|
|
786
|
+
default:
|
|
787
|
+
throw new Pt(e);
|
|
788
|
+
}
|
|
789
|
+
return e;
|
|
790
|
+
}
|
|
791
|
+
function Qn(e) {
|
|
792
|
+
return Et(e, (t) => Ti(t));
|
|
793
|
+
}
|
|
794
|
+
function He(e, t = mu) {
|
|
795
|
+
return Et(e, (n) => typeof n == "string" ? N(t, n.split(`
|
|
796
|
+
`)) : n);
|
|
797
|
+
}
|
|
798
|
+
function Si(e) {
|
|
799
|
+
if (e.type === se)
|
|
800
|
+
return !0;
|
|
801
|
+
}
|
|
802
|
+
function bi(e) {
|
|
803
|
+
return cu(e, Si, !1);
|
|
804
|
+
}
|
|
805
|
+
function Bn(e, t) {
|
|
806
|
+
return e.type === Le ? { ...e, contents: t(e.contents) } : t(e);
|
|
807
|
+
}
|
|
808
|
+
function Bi(e) {
|
|
809
|
+
let t = !0;
|
|
810
|
+
return zn(e, (n) => {
|
|
811
|
+
switch (Ge(n)) {
|
|
812
|
+
case Qe:
|
|
813
|
+
if (n === "")
|
|
814
|
+
break;
|
|
815
|
+
case et:
|
|
816
|
+
case Ue:
|
|
817
|
+
case se:
|
|
818
|
+
case Me:
|
|
819
|
+
return t = !1, !1;
|
|
820
|
+
}
|
|
821
|
+
}), t;
|
|
822
|
+
}
|
|
823
|
+
var vi = () => {
|
|
824
|
+
}, ki = vi;
|
|
825
|
+
function A(e) {
|
|
826
|
+
return { type: Ye, contents: e };
|
|
827
|
+
}
|
|
828
|
+
function Be(e, t) {
|
|
829
|
+
return { type: Ze, contents: t, n: e };
|
|
830
|
+
}
|
|
831
|
+
function m(e, t = {}) {
|
|
832
|
+
return ki(t.expandedStates), { type: De, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
|
|
833
|
+
}
|
|
834
|
+
function Pi(e) {
|
|
835
|
+
return Be(Number.NEGATIVE_INFINITY, e);
|
|
836
|
+
}
|
|
837
|
+
function Du(e) {
|
|
838
|
+
return Be(-1, e);
|
|
839
|
+
}
|
|
840
|
+
function Ve(e, t) {
|
|
841
|
+
return m(e[0], { ...t, expandedStates: e });
|
|
842
|
+
}
|
|
843
|
+
function yu(e) {
|
|
844
|
+
return { type: Re, parts: e };
|
|
845
|
+
}
|
|
846
|
+
function w(e, t = "", n = {}) {
|
|
847
|
+
return { type: Se, breakContents: e, flatContents: t, groupId: n.groupId };
|
|
848
|
+
}
|
|
849
|
+
function an(e, t) {
|
|
850
|
+
return { type: tt, contents: e, groupId: t.groupId, negate: t.negate };
|
|
851
|
+
}
|
|
852
|
+
function Cr(e) {
|
|
853
|
+
return { type: nt, contents: e };
|
|
854
|
+
}
|
|
855
|
+
var we = { type: Ue }, ve = { type: Me }, du = { type: se, hard: !0 }, wi = { type: se, hard: !0, literal: !0 }, C = { type: se }, E = { type: se, soft: !0 }, F = [du, ve], mu = [wi, ve], $t = { type: ft };
|
|
856
|
+
function N(e, t) {
|
|
857
|
+
let n = [];
|
|
858
|
+
for (let r = 0; r < t.length; r++)
|
|
859
|
+
r !== 0 && n.push(e), n.push(t[r]);
|
|
860
|
+
return n;
|
|
861
|
+
}
|
|
862
|
+
function Ii(e, t, n) {
|
|
863
|
+
let r = e;
|
|
864
|
+
if (t > 0) {
|
|
865
|
+
for (let u = 0; u < Math.floor(t / n); ++u)
|
|
866
|
+
r = A(r);
|
|
867
|
+
r = Be(t % n, r), r = Be(Number.NEGATIVE_INFINITY, r);
|
|
868
|
+
}
|
|
869
|
+
return r;
|
|
870
|
+
}
|
|
871
|
+
function jt(e, t) {
|
|
872
|
+
return e ? { type: Le, label: e, contents: t } : t;
|
|
873
|
+
}
|
|
874
|
+
function Ni(e) {
|
|
875
|
+
if (!ye(e))
|
|
876
|
+
return !1;
|
|
877
|
+
let t = `*${e.value}*`.split(`
|
|
878
|
+
`);
|
|
879
|
+
return t.length > 1 && t.every((n) => n.trimStart()[0] === "*");
|
|
880
|
+
}
|
|
881
|
+
var dn = /* @__PURE__ */ new WeakMap();
|
|
882
|
+
function ji(e) {
|
|
883
|
+
return dn.has(e) || dn.set(e, Ni(e)), dn.get(e);
|
|
884
|
+
}
|
|
885
|
+
var Li = ji;
|
|
886
|
+
function Mi(e, t) {
|
|
887
|
+
let n = e.node;
|
|
888
|
+
if (Nt(n))
|
|
889
|
+
return t.originalText.slice(q(n), I(n)).trimEnd();
|
|
890
|
+
if (Li(n))
|
|
891
|
+
return Oi(n);
|
|
892
|
+
if (ye(n))
|
|
893
|
+
return ["/*", He(n.value), "*/"];
|
|
894
|
+
throw new Error("Not a comment: " + JSON.stringify(n));
|
|
895
|
+
}
|
|
896
|
+
function Oi(e) {
|
|
897
|
+
let t = e.value.split(`
|
|
898
|
+
`);
|
|
899
|
+
return ["/*", N(F, t.map((n, r) => r === 0 ? n.trimEnd() : " " + (r < t.length - 1 ? n.trim() : n.trimStart()))), "*/"];
|
|
900
|
+
}
|
|
901
|
+
var fu = {};
|
|
902
|
+
en(fu, { endOfLine: () => Ri, ownLine: () => Wi, remaining: () => Ui });
|
|
903
|
+
function Ji(e) {
|
|
904
|
+
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 || "");
|
|
905
|
+
return n.length > 20 && (n = n.slice(0, 19) + "…"), t + (n ? " " + n : "");
|
|
906
|
+
}
|
|
907
|
+
function Yn(e, t) {
|
|
908
|
+
(e.comments ?? (e.comments = [])).push(t), t.printed = !1, t.nodeDescription = Ji(e);
|
|
909
|
+
}
|
|
910
|
+
function ee(e, t) {
|
|
911
|
+
t.leading = !0, t.trailing = !1, Yn(e, t);
|
|
912
|
+
}
|
|
913
|
+
function le(e, t, n) {
|
|
914
|
+
t.leading = !1, t.trailing = !1, n && (t.marker = n), Yn(e, t);
|
|
915
|
+
}
|
|
916
|
+
function R(e, t) {
|
|
917
|
+
t.leading = !1, t.trailing = !0, Yn(e, t);
|
|
918
|
+
}
|
|
919
|
+
function qi(e, t) {
|
|
920
|
+
let n = null, r = t;
|
|
921
|
+
for (; r !== n; )
|
|
922
|
+
n = r, r = ct(e, r), r = _n(e, r), r = Xn(e, r), r = Dt(e, r);
|
|
923
|
+
return r;
|
|
924
|
+
}
|
|
925
|
+
var Ft = qi;
|
|
926
|
+
function _i(e, t) {
|
|
927
|
+
let n = Ft(e, t);
|
|
928
|
+
return n === !1 ? "" : e.charAt(n);
|
|
929
|
+
}
|
|
930
|
+
var ge = _i;
|
|
931
|
+
function Xi(e, t, n) {
|
|
932
|
+
for (let r = t; r < n; ++r)
|
|
933
|
+
if (e.charAt(r) === `
|
|
934
|
+
`)
|
|
935
|
+
return !0;
|
|
936
|
+
return !1;
|
|
937
|
+
}
|
|
938
|
+
var ce = Xi, mn = /* @__PURE__ */ new WeakMap();
|
|
939
|
+
function $i(e) {
|
|
940
|
+
return mn.has(e) || mn.set(e, ye(e) && e.value[0] === "*" && /@(?:type|satisfies)\b/u.test(e.value)), mn.get(e);
|
|
941
|
+
}
|
|
942
|
+
var Eu = $i, Fu = (e, t) => Nt(e) || !ce(t, q(e), I(e));
|
|
943
|
+
function Wi(e) {
|
|
944
|
+
return [bu, gu, Cu, ns, Vi, Zn, er, Au, xu, os, us, nr, Su, is, hu, Tu, tr, Ki, ds, Bu].some((t) => t(e));
|
|
945
|
+
}
|
|
946
|
+
function Ri(e) {
|
|
947
|
+
return [Gi, Cu, gu, Su, Zn, er, Au, xu, Tu, rs, as, nr, ls, tr, Ds, ys, ms, Bu].some((t) => t(e));
|
|
948
|
+
}
|
|
949
|
+
function Ui(e) {
|
|
950
|
+
return [bu, Zn, er, Hi, ts, hu, nr, es, Zi, tr, cs].some((t) => t(e));
|
|
951
|
+
}
|
|
952
|
+
function rt(e, t) {
|
|
953
|
+
let n = (e.body || e.properties).find(({ type: r }) => r !== "EmptyStatement");
|
|
954
|
+
n ? ee(n, t) : le(e, t);
|
|
955
|
+
}
|
|
956
|
+
function vn(e, t) {
|
|
957
|
+
e.type === "BlockStatement" ? rt(e, t) : ee(e, t);
|
|
958
|
+
}
|
|
959
|
+
function Gi({ comment: e, followingNode: t }) {
|
|
960
|
+
return t && Eu(e) ? (ee(t, e), !0) : !1;
|
|
961
|
+
}
|
|
962
|
+
function Zn({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
963
|
+
if ((n == null ? void 0 : n.type) !== "IfStatement" || !r)
|
|
964
|
+
return !1;
|
|
965
|
+
if (ge(u, I(e)) === ")")
|
|
966
|
+
return R(t, e), !0;
|
|
967
|
+
if (t === n.consequent && r === n.alternate) {
|
|
968
|
+
let a = Ft(u, I(n.consequent));
|
|
969
|
+
if (q(e) < a || n.alternate.type === "BlockStatement")
|
|
970
|
+
return t.type === "BlockStatement" || Fu(e, u) && !ce(u, q(t), q(e)) ? (R(t, e), !0) : (le(n, e), !0);
|
|
971
|
+
}
|
|
972
|
+
return r.type === "BlockStatement" ? (rt(r, e), !0) : r.type === "IfStatement" ? (vn(r.consequent, e), !0) : n.consequent === r ? (ee(r, e), !0) : !1;
|
|
973
|
+
}
|
|
974
|
+
function er({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
975
|
+
return (n == null ? void 0 : n.type) !== "WhileStatement" || !r ? !1 : ge(u, I(e)) === ")" ? (R(t, e), !0) : r.type === "BlockStatement" ? (rt(r, e), !0) : n.body === r ? (ee(r, e), !0) : !1;
|
|
976
|
+
}
|
|
977
|
+
function Au({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
978
|
+
return (n == null ? void 0 : n.type) !== "TryStatement" && (n == null ? void 0 : n.type) !== "CatchClause" || !r ? !1 : n.type === "CatchClause" && t ? (R(t, e), !0) : r.type === "BlockStatement" ? (rt(r, e), !0) : r.type === "TryStatement" ? (vn(r.finalizer, e), !0) : r.type === "CatchClause" ? (vn(r.body, e), !0) : !1;
|
|
979
|
+
}
|
|
980
|
+
function Vi({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
981
|
+
return W(t) && (n == null ? void 0 : n.type) === "Identifier" ? (ee(t, e), !0) : !1;
|
|
982
|
+
}
|
|
983
|
+
function Ki({ comment: e, enclosingNode: t, followingNode: n, options: r }) {
|
|
984
|
+
return !r.experimentalTernaries || !((t == null ? void 0 : t.type) === "ConditionalExpression" || We(t)) ? !1 : (n == null ? void 0 : n.type) === "ConditionalExpression" || We(n) ? (le(t, e), !0) : !1;
|
|
985
|
+
}
|
|
986
|
+
function gu({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u, options: a }) {
|
|
987
|
+
let o = t && !ce(u, I(t), q(e));
|
|
988
|
+
return (!t || !o) && ((n == null ? void 0 : n.type) === "ConditionalExpression" || We(n)) && r ? a.experimentalTernaries && n.alternate === r && !(ye(e) && !ce(a.originalText, q(e), I(e))) ? (le(n, e), !0) : (ee(r, e), !0) : !1;
|
|
989
|
+
}
|
|
990
|
+
function Hi({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
991
|
+
return je(n) && n.shorthand && n.key === t && n.value.type === "AssignmentPattern" ? (R(n.value.left, e), !0) : !1;
|
|
992
|
+
}
|
|
993
|
+
var zi = /* @__PURE__ */ new Set(["ClassDeclaration", "ClassExpression", "DeclareClass", "DeclareInterface", "InterfaceDeclaration", "TSInterfaceDeclaration"]);
|
|
994
|
+
function xu({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
995
|
+
if (zi.has(n == null ? void 0 : n.type)) {
|
|
996
|
+
if (J(n.decorators) && (r == null ? void 0 : r.type) !== "Decorator")
|
|
997
|
+
return R(X(!1, n.decorators, -1), e), !0;
|
|
998
|
+
if (n.body && r === n.body)
|
|
999
|
+
return rt(n.body, e), !0;
|
|
1000
|
+
if (r) {
|
|
1001
|
+
if (n.superClass && r === n.superClass && t && (t === n.id || t === n.typeParameters))
|
|
1002
|
+
return R(t, e), !0;
|
|
1003
|
+
for (let u of ["implements", "extends", "mixins"])
|
|
1004
|
+
if (n[u] && r === n[u][0])
|
|
1005
|
+
return t && (t === n.id || t === n.typeParameters || t === n.superClass) ? R(t, e) : le(n, e, u), !0;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return !1;
|
|
1009
|
+
}
|
|
1010
|
+
var Qi = /* @__PURE__ */ new Set(["ClassMethod", "ClassProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod", "MethodDefinition", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "TSParameterProperty"]);
|
|
1011
|
+
function hu({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
1012
|
+
return n && t && ge(r, I(e)) === "(" && (n.type === "Property" || n.type === "TSDeclareMethod" || n.type === "TSAbstractMethodDefinition") && t.type === "Identifier" && n.key === t && ge(r, I(t)) !== ":" || (t == null ? void 0 : t.type) === "Decorator" && Qi.has(n == null ? void 0 : n.type) && (Nt(e) || e.placement === "ownLine") ? (R(t, e), !0) : !1;
|
|
1013
|
+
}
|
|
1014
|
+
var Yi = /* @__PURE__ */ new Set(["FunctionDeclaration", "FunctionExpression", "ClassMethod", "MethodDefinition", "ObjectMethod"]);
|
|
1015
|
+
function Zi({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
1016
|
+
return ge(r, I(e)) !== "(" ? !1 : t && Yi.has(n == null ? void 0 : n.type) ? (R(t, e), !0) : !1;
|
|
1017
|
+
}
|
|
1018
|
+
function es({ comment: e, enclosingNode: t, text: n }) {
|
|
1019
|
+
if ((t == null ? void 0 : t.type) !== "ArrowFunctionExpression")
|
|
1020
|
+
return !1;
|
|
1021
|
+
let r = Ft(n, I(e));
|
|
1022
|
+
return r !== !1 && n.slice(r, r + 2) === "=>" ? (le(t, e), !0) : !1;
|
|
1023
|
+
}
|
|
1024
|
+
function ts({ comment: e, enclosingNode: t, text: n }) {
|
|
1025
|
+
return ge(n, I(e)) !== ")" ? !1 : t && (vu(t) && Z(t).length === 0 || dt(t) && de(t).length === 0) ? (le(t, e), !0) : ((t == null ? void 0 : t.type) === "MethodDefinition" || (t == null ? void 0 : t.type) === "TSAbstractMethodDefinition") && Z(t.value).length === 0 ? (le(t.value, e), !0) : !1;
|
|
1026
|
+
}
|
|
1027
|
+
function ns({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
1028
|
+
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" && ge(u, I(e)) === ")" ? (R(t, e), !0) : !1;
|
|
1029
|
+
}
|
|
1030
|
+
function Cu({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
1031
|
+
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") && vu(n) && ge(u, I(e)) === ")" ? (R(t, e), !0) : !ye(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 && Ft(u, I(e)) === q(r) ? (rt(r, e), !0) : !1;
|
|
1032
|
+
}
|
|
1033
|
+
function Tu({ comment: e, enclosingNode: t }) {
|
|
1034
|
+
return (t == null ? void 0 : t.type) === "LabeledStatement" ? (ee(t, e), !0) : !1;
|
|
1035
|
+
}
|
|
1036
|
+
function tr({ comment: e, enclosingNode: t }) {
|
|
1037
|
+
return ((t == null ? void 0 : t.type) === "ContinueStatement" || (t == null ? void 0 : t.type) === "BreakStatement") && !t.label ? (R(t, e), !0) : !1;
|
|
1038
|
+
}
|
|
1039
|
+
function rs({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
1040
|
+
return L(n) && t && n.callee === t && n.arguments.length > 0 ? (ee(n.arguments[0], e), !0) : !1;
|
|
1041
|
+
}
|
|
1042
|
+
function us({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
1043
|
+
return $e(n) ? (zt(e) && (r.prettierIgnore = !0, e.unignore = !0), t ? (R(t, e), !0) : !1) : ($e(r) && zt(e) && (r.types[0].prettierIgnore = !0, e.unignore = !0), !1);
|
|
1044
|
+
}
|
|
1045
|
+
function as({ comment: e, enclosingNode: t }) {
|
|
1046
|
+
return je(t) ? (ee(t, e), !0) : !1;
|
|
1047
|
+
}
|
|
1048
|
+
function nr({ comment: e, enclosingNode: t, ast: n, isLastComment: r }) {
|
|
1049
|
+
var u;
|
|
1050
|
+
return ((u = n == null ? void 0 : n.body) == null ? void 0 : u.length) === 0 ? (r ? le(n, e) : ee(n, e), !0) : (t == null ? void 0 : t.type) === "Program" && t.body.length === 0 && !J(t.directives) ? (r ? le(t, e) : ee(t, e), !0) : !1;
|
|
1051
|
+
}
|
|
1052
|
+
function os({ comment: e, enclosingNode: t }) {
|
|
1053
|
+
return (t == null ? void 0 : t.type) === "ForInStatement" || (t == null ? void 0 : t.type) === "ForOfStatement" ? (ee(t, e), !0) : !1;
|
|
1054
|
+
}
|
|
1055
|
+
function Su({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
1056
|
+
if ((n == null ? void 0 : n.type) === "ImportSpecifier" || (n == null ? void 0 : n.type) === "ExportSpecifier")
|
|
1057
|
+
return ee(n, e), !0;
|
|
1058
|
+
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";
|
|
1059
|
+
return (u || a) && pe(r, I(e)) ? (R(t, e), !0) : !1;
|
|
1060
|
+
}
|
|
1061
|
+
function is({ comment: e, enclosingNode: t }) {
|
|
1062
|
+
return (t == null ? void 0 : t.type) === "AssignmentPattern" ? (ee(t, e), !0) : !1;
|
|
1063
|
+
}
|
|
1064
|
+
var ss = /* @__PURE__ */ new Set(["VariableDeclarator", "AssignmentExpression", "TypeAlias", "TSTypeAliasDeclaration"]), ps = /* @__PURE__ */ new Set(["ObjectExpression", "ArrayExpression", "TemplateLiteral", "TaggedTemplateExpression", "ObjectTypeAnnotation", "TSTypeLiteral"]);
|
|
1065
|
+
function ls({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
1066
|
+
return ss.has(t == null ? void 0 : t.type) && n && (ps.has(n.type) || ye(e)) ? (ee(n, e), !0) : !1;
|
|
1067
|
+
}
|
|
1068
|
+
function cs({ comment: e, enclosingNode: t, followingNode: n, text: r }) {
|
|
1069
|
+
return !n && ((t == null ? void 0 : t.type) === "TSMethodSignature" || (t == null ? void 0 : t.type) === "TSDeclareFunction" || (t == null ? void 0 : t.type) === "TSAbstractMethodDefinition") && ge(r, I(e)) === ";" ? (R(t, e), !0) : !1;
|
|
1070
|
+
}
|
|
1071
|
+
function bu({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
1072
|
+
if (zt(e) && (t == null ? void 0 : t.type) === "TSMappedType" && n === t.key)
|
|
1073
|
+
return t.prettierIgnore = !0, e.unignore = !0, !0;
|
|
1074
|
+
}
|
|
1075
|
+
function Bu({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
1076
|
+
if ((n == null ? void 0 : n.type) === "TSMappedType" && !t)
|
|
1077
|
+
return le(n, e), !0;
|
|
1078
|
+
}
|
|
1079
|
+
function Ds({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
1080
|
+
return !t || t.type !== "SwitchCase" || t.test || !n || n !== t.consequent[0] ? !1 : (n.type === "BlockStatement" && Nt(e) ? rt(n, e) : le(t, e), !0);
|
|
1081
|
+
}
|
|
1082
|
+
function ys({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
1083
|
+
return $e(t) && ((n.type === "TSArrayType" || n.type === "ArrayTypeAnnotation") && !r || Hn(n)) ? (R(X(!1, t.types, -1), e), !0) : !1;
|
|
1084
|
+
}
|
|
1085
|
+
function ds({ comment: e, enclosingNode: t, precedingNode: n, followingNode: r }) {
|
|
1086
|
+
if (((t == null ? void 0 : t.type) === "ObjectPattern" || (t == null ? void 0 : t.type) === "ArrayPattern") && (r == null ? void 0 : r.type) === "TSTypeAnnotation")
|
|
1087
|
+
return n ? R(n, e) : le(t, e), !0;
|
|
1088
|
+
}
|
|
1089
|
+
function ms({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
1090
|
+
return !r && (n == null ? void 0 : n.type) === "UnaryExpression" && ((t == null ? void 0 : t.type) === "LogicalExpression" || (t == null ? void 0 : t.type) === "BinaryExpression") && ce(u, q(n.argument), q(t.right)) && Fu(e, u) && !ce(u, q(t.right), q(e)) ? (R(t.right, e), !0) : !1;
|
|
1091
|
+
}
|
|
1092
|
+
var vu = _(["ArrowFunctionExpression", "FunctionExpression", "FunctionDeclaration", "ObjectMethod", "ClassMethod", "TSDeclareFunction", "TSCallSignatureDeclaration", "TSConstructSignatureDeclaration", "TSMethodSignature", "TSConstructorType", "TSFunctionType", "TSDeclareMethod"]), fs = /* @__PURE__ */ new Set(["EmptyStatement", "TemplateElement", "TSEmptyBodyFunctionExpression", "ChainExpression"]);
|
|
1093
|
+
function Es(e) {
|
|
1094
|
+
return !fs.has(e.type);
|
|
1095
|
+
}
|
|
1096
|
+
function Fs(e, t) {
|
|
1097
|
+
var n;
|
|
1098
|
+
if ((t.parser === "typescript" || t.parser === "flow" || t.parser === "hermes" || t.parser === "acorn" || t.parser === "oxc" || t.parser === "oxc-ts" || 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 && !J(e.value.typeParameters) && e.value.body)
|
|
1099
|
+
return [...e.decorators || [], e.key, e.value.body];
|
|
1100
|
+
}
|
|
1101
|
+
function ku(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 As(e, { parser: t }) {
|
|
1106
|
+
if (t === "flow" || t === "hermes" || t === "babel-flow")
|
|
1107
|
+
return e = H(!1, e, /[\s(]/gu, ""), e === "" || e === "/*" || e === "/*::";
|
|
1108
|
+
}
|
|
1109
|
+
function gs(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 ae = Symbol("MODE_BREAK"), he = Symbol("MODE_FLAT"), pt = Symbol("cursor"), kn = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
1122
|
+
function Pu() {
|
|
1123
|
+
return { value: "", length: 0, queue: [] };
|
|
1124
|
+
}
|
|
1125
|
+
function xs(e, t) {
|
|
1126
|
+
return Pn(e, { type: "indent" }, t);
|
|
1127
|
+
}
|
|
1128
|
+
function hs(e, t, n) {
|
|
1129
|
+
return t === Number.NEGATIVE_INFINITY ? e.root || Pu() : t < 0 ? Pn(e, { type: "dedent" }, n) : t ? t.type === "root" ? { ...e, root: e } : Pn(e, { type: typeof t == "string" ? "stringAlign" : "numberAlign", n: t }, n) : e;
|
|
1130
|
+
}
|
|
1131
|
+
function Pn(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 c(), { ...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 ? D() : c();
|
|
1156
|
+
}
|
|
1157
|
+
function D() {
|
|
1158
|
+
o > 0 && s(o), p();
|
|
1159
|
+
}
|
|
1160
|
+
function c() {
|
|
1161
|
+
i > 0 && l(i), p();
|
|
1162
|
+
}
|
|
1163
|
+
function p() {
|
|
1164
|
+
o = 0, i = 0;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
function wn(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(), D = Ge(d);
|
|
1203
|
+
switch (D) {
|
|
1204
|
+
case Qe:
|
|
1205
|
+
s.push(d), n -= lt(d);
|
|
1206
|
+
break;
|
|
1207
|
+
case Pe:
|
|
1208
|
+
case Re: {
|
|
1209
|
+
let c = D === Pe ? d : d.parts, p = d[kn] ?? 0;
|
|
1210
|
+
for (let y = c.length - 1; y >= p; y--)
|
|
1211
|
+
i.push({ mode: l, doc: c[y] });
|
|
1212
|
+
break;
|
|
1213
|
+
}
|
|
1214
|
+
case Ye:
|
|
1215
|
+
case Ze:
|
|
1216
|
+
case tt:
|
|
1217
|
+
case Le:
|
|
1218
|
+
i.push({ mode: l, doc: d.contents });
|
|
1219
|
+
break;
|
|
1220
|
+
case et:
|
|
1221
|
+
n += wn(s);
|
|
1222
|
+
break;
|
|
1223
|
+
case De: {
|
|
1224
|
+
if (a && d.break)
|
|
1225
|
+
return !1;
|
|
1226
|
+
let c = d.break ? ae : l, p = d.expandedStates && c === ae ? X(!1, d.expandedStates, -1) : d.contents;
|
|
1227
|
+
i.push({ mode: c, doc: p });
|
|
1228
|
+
break;
|
|
1229
|
+
}
|
|
1230
|
+
case Se: {
|
|
1231
|
+
let c = (d.groupId ? u[d.groupId] || he : l) === ae ? d.breakContents : d.flatContents;
|
|
1232
|
+
c && i.push({ mode: l, doc: c });
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
case se:
|
|
1236
|
+
if (l === ae || d.hard)
|
|
1237
|
+
return !0;
|
|
1238
|
+
d.soft || (s.push(" "), n--);
|
|
1239
|
+
break;
|
|
1240
|
+
case nt:
|
|
1241
|
+
r = !0;
|
|
1242
|
+
break;
|
|
1243
|
+
case Ue:
|
|
1244
|
+
if (r)
|
|
1245
|
+
return !1;
|
|
1246
|
+
break;
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
return !1;
|
|
1250
|
+
}
|
|
1251
|
+
function wu(e, t) {
|
|
1252
|
+
let n = {}, r = t.printWidth, u = gs(t.endOfLine), a = 0, o = [{ ind: Pu(), mode: ae, doc: e }], i = [], s = !1, l = [], d = 0;
|
|
1253
|
+
for (hi(e); o.length > 0; ) {
|
|
1254
|
+
let { ind: c, mode: p, doc: y } = o.pop();
|
|
1255
|
+
switch (Ge(y)) {
|
|
1256
|
+
case Qe: {
|
|
1257
|
+
let f = u !== `
|
|
1258
|
+
` ? H(!1, y, `
|
|
1259
|
+
`, u) : y;
|
|
1260
|
+
i.push(f), o.length > 0 && (a += lt(f));
|
|
1261
|
+
break;
|
|
1262
|
+
}
|
|
1263
|
+
case Pe:
|
|
1264
|
+
for (let f = y.length - 1; f >= 0; f--)
|
|
1265
|
+
o.push({ ind: c, mode: p, doc: y[f] });
|
|
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: xs(c, t), mode: p, doc: y.contents });
|
|
1274
|
+
break;
|
|
1275
|
+
case Ze:
|
|
1276
|
+
o.push({ ind: hs(c, y.n, t), mode: p, doc: y.contents });
|
|
1277
|
+
break;
|
|
1278
|
+
case et:
|
|
1279
|
+
a -= wn(i);
|
|
1280
|
+
break;
|
|
1281
|
+
case De:
|
|
1282
|
+
switch (p) {
|
|
1283
|
+
case he:
|
|
1284
|
+
if (!s) {
|
|
1285
|
+
o.push({ ind: c, mode: y.break ? ae : he, doc: y.contents });
|
|
1286
|
+
break;
|
|
1287
|
+
}
|
|
1288
|
+
case ae: {
|
|
1289
|
+
s = !1;
|
|
1290
|
+
let f = { ind: c, mode: he, doc: y.contents }, g = r - a, S = l.length > 0;
|
|
1291
|
+
if (!y.break && Wt(f, o, g, S, n))
|
|
1292
|
+
o.push(f);
|
|
1293
|
+
else if (y.expandedStates) {
|
|
1294
|
+
let b = X(!1, y.expandedStates, -1);
|
|
1295
|
+
if (y.break) {
|
|
1296
|
+
o.push({ ind: c, mode: ae, 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: c, mode: ae, doc: b });
|
|
1302
|
+
break;
|
|
1303
|
+
} else {
|
|
1304
|
+
let j = y.expandedStates[x], v = { ind: c, mode: he, doc: j };
|
|
1305
|
+
if (Wt(v, o, g, S, n)) {
|
|
1306
|
+
o.push(v);
|
|
1307
|
+
break;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
} else
|
|
1311
|
+
o.push({ ind: c, mode: ae, doc: y.contents });
|
|
1312
|
+
break;
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
y.id && (n[y.id] = X(!1, o, -1).mode);
|
|
1316
|
+
break;
|
|
1317
|
+
case Re: {
|
|
1318
|
+
let f = r - a, g = y[kn] ?? 0, { parts: S } = y, b = S.length - g;
|
|
1319
|
+
if (b === 0)
|
|
1320
|
+
break;
|
|
1321
|
+
let x = S[g + 0], j = S[g + 1], v = { ind: c, mode: he, doc: x }, B = { ind: c, mode: ae, doc: x }, M = Wt(v, [], f, l.length > 0, n, !0);
|
|
1322
|
+
if (b === 1) {
|
|
1323
|
+
M ? o.push(v) : o.push(B);
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
1326
|
+
let k = { ind: c, mode: he, doc: j }, O = { ind: c, mode: ae, doc: j };
|
|
1327
|
+
if (b === 2) {
|
|
1328
|
+
M ? o.push(k, v) : o.push(O, B);
|
|
1329
|
+
break;
|
|
1330
|
+
}
|
|
1331
|
+
let G = S[g + 2], U = { ind: c, mode: p, doc: { ...y, [kn]: g + 2 } };
|
|
1332
|
+
Wt({ ind: c, mode: he, doc: [x, j, G] }, [], f, l.length > 0, n, !0) ? o.push(U, k, v) : M ? o.push(U, O, v) : o.push(U, O, B);
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
case Se:
|
|
1336
|
+
case tt: {
|
|
1337
|
+
let f = y.groupId ? n[y.groupId] : p;
|
|
1338
|
+
if (f === ae) {
|
|
1339
|
+
let g = y.type === Se ? y.breakContents : y.negate ? y.contents : A(y.contents);
|
|
1340
|
+
g && o.push({ ind: c, mode: p, doc: g });
|
|
1341
|
+
}
|
|
1342
|
+
if (f === he) {
|
|
1343
|
+
let g = y.type === Se ? y.flatContents : y.negate ? A(y.contents) : y.contents;
|
|
1344
|
+
g && o.push({ ind: c, mode: p, doc: g });
|
|
1345
|
+
}
|
|
1346
|
+
break;
|
|
1347
|
+
}
|
|
1348
|
+
case nt:
|
|
1349
|
+
l.push({ ind: c, mode: p, doc: y.contents });
|
|
1350
|
+
break;
|
|
1351
|
+
case Ue:
|
|
1352
|
+
l.length > 0 && o.push({ ind: c, mode: p, doc: du });
|
|
1353
|
+
break;
|
|
1354
|
+
case se:
|
|
1355
|
+
switch (p) {
|
|
1356
|
+
case he:
|
|
1357
|
+
if (y.hard)
|
|
1358
|
+
s = !0;
|
|
1359
|
+
else {
|
|
1360
|
+
y.soft || (i.push(" "), a += 1);
|
|
1361
|
+
break;
|
|
1362
|
+
}
|
|
1363
|
+
case ae:
|
|
1364
|
+
if (l.length > 0) {
|
|
1365
|
+
o.push({ ind: c, mode: p, doc: y }, ...l.reverse()), l.length = 0;
|
|
1366
|
+
break;
|
|
1367
|
+
}
|
|
1368
|
+
y.literal ? c.root ? (i.push(u, c.root.value), a = c.root.length) : (i.push(u), a = 0) : (a -= wn(i), i.push(u + c.value), a = c.length);
|
|
1369
|
+
break;
|
|
1370
|
+
}
|
|
1371
|
+
break;
|
|
1372
|
+
case Le:
|
|
1373
|
+
o.push({ ind: c, mode: p, doc: y.contents });
|
|
1374
|
+
break;
|
|
1375
|
+
case Me:
|
|
1376
|
+
break;
|
|
1377
|
+
default:
|
|
1378
|
+
throw new Pt(y);
|
|
1379
|
+
}
|
|
1380
|
+
o.length === 0 && l.length > 0 && (o.push(...l.reverse()), l.length = 0);
|
|
1381
|
+
}
|
|
1382
|
+
let D = i.indexOf(pt);
|
|
1383
|
+
if (D !== -1) {
|
|
1384
|
+
let c = i.indexOf(pt, D + 1);
|
|
1385
|
+
if (c === -1)
|
|
1386
|
+
return { formatted: i.filter((g) => g !== pt).join("") };
|
|
1387
|
+
let p = i.slice(0, D).join(""), y = i.slice(D + 1, c).join(""), f = i.slice(c + 1).join("");
|
|
1388
|
+
return { formatted: p + y + f, cursorNodeStart: p.length, cursorNodeText: y };
|
|
1389
|
+
}
|
|
1390
|
+
return { formatted: i.join("") };
|
|
1391
|
+
}
|
|
1392
|
+
function Cs(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 Ts = Cs;
|
|
1399
|
+
function Ss(e, t) {
|
|
1400
|
+
let n = e.lastIndexOf(`
|
|
1401
|
+
`);
|
|
1402
|
+
return n === -1 ? 0 : Ts(e.slice(n + 1).match(/^[\t ]*/u)[0], t);
|
|
1403
|
+
}
|
|
1404
|
+
var bs = Ss;
|
|
1405
|
+
function Iu(e, t, n) {
|
|
1406
|
+
let { node: r } = e;
|
|
1407
|
+
if (r.type === "TemplateLiteral" && Ps(e)) {
|
|
1408
|
+
let s = vs(e, t, n);
|
|
1409
|
+
if (s)
|
|
1410
|
+
return s;
|
|
1411
|
+
}
|
|
1412
|
+
let u = "expressions";
|
|
1413
|
+
r.type === "TSTemplateLiteralType" && (u = "types");
|
|
1414
|
+
let a = [], o = e.map(n, u);
|
|
1415
|
+
a.push(we, "`");
|
|
1416
|
+
let i = 0;
|
|
1417
|
+
return e.each(({ index: s, node: l }) => {
|
|
1418
|
+
if (a.push(n()), l.tail)
|
|
1419
|
+
return;
|
|
1420
|
+
let { tabWidth: d } = t, D = l.value.raw, c = D.includes(`
|
|
1421
|
+
`) ? bs(D, d) : i;
|
|
1422
|
+
i = c;
|
|
1423
|
+
let p = o[s], y = r[u][s], f = ce(t.originalText, I(l), q(r.quasis[s + 1]));
|
|
1424
|
+
if (!f) {
|
|
1425
|
+
let S = wu(p, { ...t, printWidth: Number.POSITIVE_INFINITY }).formatted;
|
|
1426
|
+
S.includes(`
|
|
1427
|
+
`) ? f = !0 : p = S;
|
|
1428
|
+
}
|
|
1429
|
+
f && (h(y) || y.type === "Identifier" || W(y) || y.type === "ConditionalExpression" || y.type === "SequenceExpression" || Ce(y) || ke(y)) && (p = [A([E, p]), E]);
|
|
1430
|
+
let g = c === 0 && D.endsWith(`
|
|
1431
|
+
`) ? Be(Number.NEGATIVE_INFINITY, p) : Ii(p, c, d);
|
|
1432
|
+
a.push(m(["${", g, we, "}"]));
|
|
1433
|
+
}, "quasis"), a.push("`"), a;
|
|
1434
|
+
}
|
|
1435
|
+
function Bs(e, t, n) {
|
|
1436
|
+
let r = n("quasi"), { node: u } = e, a = "", o = Ke(u.quasi, T.Leading)[0];
|
|
1437
|
+
return o && (ce(t.originalText, I(u.typeArguments ?? u.typeParameters ?? u.tag), q(o)) ? a = E : a = " "), jt(r.label && { tagged: !0, ...r.label }, [n("tag"), n(u.typeArguments ? "typeArguments" : "typeParameters"), a, we, r]);
|
|
1438
|
+
}
|
|
1439
|
+
function vs(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((c) => "${" + wu(c, { ...t, printWidth: Number.POSITIVE_INFINITY, endOfLine: "lf" }).formatted + "}"), s = [{ hasLineBreak: !1, cells: [] }];
|
|
1446
|
+
for (let c = 1; c < r.quasis.length; c++) {
|
|
1447
|
+
let p = X(!1, s, -1), y = i[c - 1];
|
|
1448
|
+
p.cells.push(y), y.includes(`
|
|
1449
|
+
`) && (p.hasLineBreak = !0), r.quasis[c].value.raw.includes(`
|
|
1450
|
+
`) && s.push({ hasLineBreak: !1, cells: [] });
|
|
1451
|
+
}
|
|
1452
|
+
let l = Math.max(u.length, ...s.map((c) => c.cells.length)), d = Array.from({ length: l }).fill(0), D = [{ cells: u }, ...s.filter((c) => c.cells.length > 0)];
|
|
1453
|
+
for (let { cells: c } of D.filter((p) => !p.hasLineBreak))
|
|
1454
|
+
for (let [p, y] of c.entries())
|
|
1455
|
+
d[p] = Math.max(d[p], lt(y));
|
|
1456
|
+
return o.push(we, "`", A([F, N(F, D.map((c) => N(" | ", c.cells.map((p, y) => c.hasLineBreak ? p : p + " ".repeat(d[y] - lt(p))))))]), F, "`"), o;
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
function ks(e, t) {
|
|
1460
|
+
let { node: n } = e, r = t();
|
|
1461
|
+
return h(n) && (r = m([A([E, r]), E])), ["${", r, we, "}"];
|
|
1462
|
+
}
|
|
1463
|
+
function rr(e, t) {
|
|
1464
|
+
return e.map((n) => ks(n, t), "expressions");
|
|
1465
|
+
}
|
|
1466
|
+
function Nu(e, t) {
|
|
1467
|
+
return Et(e, (n) => typeof n == "string" ? t ? H(!1, n, /(\\*)`/gu, "$1$1\\`") : ju(n) : n);
|
|
1468
|
+
}
|
|
1469
|
+
function ju(e) {
|
|
1470
|
+
return H(!1, e, /([\\`]|\$\{)/gu, String.raw`\$1`);
|
|
1471
|
+
}
|
|
1472
|
+
function Ps({ 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 In = [(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 ws(e) {
|
|
1478
|
+
let t = (r) => r.type === "TemplateLiteral", n = (r, u) => je(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, ...In) || e.match(t, n, ...In);
|
|
1480
|
+
}
|
|
1481
|
+
function Is(e) {
|
|
1482
|
+
return e.match((t) => t.type === "TemplateLiteral", (t, n) => je(t) && !t.computed && t.key.type === "Identifier" && t.key.name === "template" && n === "value", ...In);
|
|
1483
|
+
}
|
|
1484
|
+
function fn(e, t) {
|
|
1485
|
+
return h(e, T.Block | T.Leading, ({ value: n }) => n === ` ${t} `);
|
|
1486
|
+
}
|
|
1487
|
+
function Lu({ node: e, parent: t }, n) {
|
|
1488
|
+
return fn(e, n) || Ns(t) && fn(t, n) || t.type === "ExpressionStatement" && fn(t, n);
|
|
1489
|
+
}
|
|
1490
|
+
function Ns(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 js(e, t, n) {
|
|
1494
|
+
let { node: r } = n, u = r.quasis.map((d) => d.value.raw), a = 0, o = u.reduce((d, D, c) => c === 0 ? D : d + "@prettier-placeholder-" + a++ + "-id" + D, ""), i = await e(o, { parser: "scss" }), s = rr(n, t), l = Ls(i, s);
|
|
1495
|
+
if (!l)
|
|
1496
|
+
throw new Error("Couldn't insert all the expressions");
|
|
1497
|
+
return ["`", A([F, l]), E, "`"];
|
|
1498
|
+
}
|
|
1499
|
+
function Ls(e, t) {
|
|
1500
|
+
if (!J(t))
|
|
1501
|
+
return e;
|
|
1502
|
+
let n = 0, r = Et(Qn(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 Ms({ 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 Rt(e) {
|
|
1509
|
+
return e.type === "Identifier" && e.name === "styled";
|
|
1510
|
+
}
|
|
1511
|
+
function Tr(e) {
|
|
1512
|
+
return /^[A-Z]/u.test(e.object.name) && e.property.name === "extend";
|
|
1513
|
+
}
|
|
1514
|
+
function Os({ 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 Rt(t.object) || Tr(t);
|
|
1521
|
+
case "CallExpression":
|
|
1522
|
+
return Rt(t.callee) || t.callee.type === "MemberExpression" && (t.callee.object.type === "MemberExpression" && (Rt(t.callee.object.object) || Tr(t.callee.object)) || t.callee.object.type === "CallExpression" && Rt(t.callee.object.callee));
|
|
1523
|
+
case "Identifier":
|
|
1524
|
+
return t.name === "css";
|
|
1525
|
+
default:
|
|
1526
|
+
return !1;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
function Js({ 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 qs(e) {
|
|
1533
|
+
if (Ms(e) || Os(e) || Js(e) || ws(e))
|
|
1534
|
+
return js;
|
|
1535
|
+
}
|
|
1536
|
+
var _s = qs;
|
|
1537
|
+
async function Xs(e, t, n) {
|
|
1538
|
+
let { node: r } = n, u = r.quasis.length, a = rr(n, t), o = [];
|
|
1539
|
+
for (let i = 0; i < u; i++) {
|
|
1540
|
+
let s = r.quasis[i], l = i === 0, d = i === u - 1, D = s.value.cooked, c = D.split(`
|
|
1541
|
+
`), p = c.length, y = a[i], f = p > 2 && c[0].trim() === "" && c[1].trim() === "", g = p > 2 && c[p - 1].trim() === "" && c[p - 2].trim() === "", S = c.every((x) => /^\s*(?:#[^\n\r]*)?$/u.test(x));
|
|
1542
|
+
if (!d && /#[^\n\r]*$/u.test(c[p - 1]))
|
|
1543
|
+
return null;
|
|
1544
|
+
let b = null;
|
|
1545
|
+
S ? b = $s(c) : b = await e(D, { parser: "graphql" }), b ? (b = Nu(b, !1), !l && f && o.push(""), o.push(b), !d && g && o.push("")) : !l && !d && f && o.push(""), y && o.push(y);
|
|
1546
|
+
}
|
|
1547
|
+
return ["`", A([F, N(F, o)]), F, "`"];
|
|
1548
|
+
}
|
|
1549
|
+
function $s(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 : N(F, t);
|
|
1554
|
+
}
|
|
1555
|
+
function Ws({ node: e, parent: t }) {
|
|
1556
|
+
return Lu({ 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 Rs(e) {
|
|
1559
|
+
if (Ws(e))
|
|
1560
|
+
return Xs;
|
|
1561
|
+
}
|
|
1562
|
+
var Us = Rs, En = 0;
|
|
1563
|
+
async function Mu(e, t, n, r, u) {
|
|
1564
|
+
let { node: a } = r, o = En;
|
|
1565
|
+
En = En + 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 = rr(r, n), d = new RegExp(i(String.raw`(\d+)`), "gu"), D = 0, c = await t(s, { parser: e, __onHtmlRoot(S) {
|
|
1567
|
+
D = S.children.length;
|
|
1568
|
+
} }), p = Et(c, (S) => {
|
|
1569
|
+
if (typeof S != "string")
|
|
1570
|
+
return S;
|
|
1571
|
+
let b = [], x = S.split(d);
|
|
1572
|
+
for (let j = 0; j < x.length; j++) {
|
|
1573
|
+
let v = x[j];
|
|
1574
|
+
if (j % 2 === 0) {
|
|
1575
|
+
v && (v = ju(v), u.__embeddedInHtml && (v = H(!1, v, /<\/(?=script\b)/giu, String.raw`<\/`)), b.push(v));
|
|
1576
|
+
continue;
|
|
1577
|
+
}
|
|
1578
|
+
let B = Number(v);
|
|
1579
|
+
b.push(l[B]);
|
|
1580
|
+
}
|
|
1581
|
+
return b;
|
|
1582
|
+
}), y = /^\s/u.test(s) ? " " : "", f = /\s$/u.test(s) ? " " : "", g = u.htmlWhitespaceSensitivity === "ignore" ? F : y && f ? C : null;
|
|
1583
|
+
return g ? m(["`", A([g, m(p)]), g, "`"]) : jt({ hug: !1 }, m(["`", y, D > 1 ? A(m(p)) : m(p), f, "`"]));
|
|
1584
|
+
}
|
|
1585
|
+
function Gs(e) {
|
|
1586
|
+
return Lu(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 Vs = Mu.bind(void 0, "html"), Ks = Mu.bind(void 0, "angular");
|
|
1589
|
+
function Hs(e) {
|
|
1590
|
+
if (Gs(e))
|
|
1591
|
+
return Vs;
|
|
1592
|
+
if (Is(e))
|
|
1593
|
+
return Ks;
|
|
1594
|
+
}
|
|
1595
|
+
var zs = Hs;
|
|
1596
|
+
async function Qs(e, t, n) {
|
|
1597
|
+
let { node: r } = n, u = H(!1, r.quasis[0].value.raw, /((?:\\\\)*)\\`/gu, (s, l) => "\\".repeat(l.length / 2) + "`"), a = Ys(u), o = a !== "";
|
|
1598
|
+
o && (u = H(!1, u, new RegExp(`^${a}`, "gmu"), ""));
|
|
1599
|
+
let i = Nu(await e(u, { parser: "markdown", __inJsTemplate: !0 }), !0);
|
|
1600
|
+
return ["`", o ? A([E, i]) : [mu, Pi(i)], E, "`"];
|
|
1601
|
+
}
|
|
1602
|
+
function Ys(e) {
|
|
1603
|
+
let t = e.match(/^([^\S\n]*)\S/mu);
|
|
1604
|
+
return t === null ? "" : t[1];
|
|
1605
|
+
}
|
|
1606
|
+
function Zs(e) {
|
|
1607
|
+
if (ep(e))
|
|
1608
|
+
return Qs;
|
|
1609
|
+
}
|
|
1610
|
+
function ep({ 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 tp = Zs;
|
|
1614
|
+
function np(e) {
|
|
1615
|
+
let { node: t } = e;
|
|
1616
|
+
if (t.type !== "TemplateLiteral" || rp(t))
|
|
1617
|
+
return;
|
|
1618
|
+
let n;
|
|
1619
|
+
for (let r of [_s, Us, zs, tp])
|
|
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 && jt({ embed: !0, ...a.label }, a);
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
function rp({ quasis: e }) {
|
|
1627
|
+
return e.some(({ value: { cooked: t } }) => t === null);
|
|
1628
|
+
}
|
|
1629
|
+
var up = np, ap = /\*\/$/, op = /^\/\*\*?/, Ou = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/, ip = /(^|\s+)\/\/([^\n\r]*)/g, Sr = /^(\r?\n)+/, sp = /(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g, br = /(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g, pp = /(\r?\n|^) *\* ?/g, Ju = [];
|
|
1630
|
+
function lp(e) {
|
|
1631
|
+
let t = e.match(Ou);
|
|
1632
|
+
return t ? t[0].trimStart() : "";
|
|
1633
|
+
}
|
|
1634
|
+
function cp(e) {
|
|
1635
|
+
let t = e.match(Ou), n = t == null ? void 0 : t[0];
|
|
1636
|
+
return n == null ? e : e.slice(n.length);
|
|
1637
|
+
}
|
|
1638
|
+
function Dp(e) {
|
|
1639
|
+
let t = `
|
|
1640
|
+
`;
|
|
1641
|
+
e = H(!1, e.replace(op, "").replace(ap, ""), pp, "$1");
|
|
1642
|
+
let n = "";
|
|
1643
|
+
for (; n !== e; )
|
|
1644
|
+
n = e, e = H(!1, e, sp, `${t}$1 $2${t}`);
|
|
1645
|
+
e = e.replace(Sr, "").trimEnd();
|
|
1646
|
+
let r = /* @__PURE__ */ Object.create(null), u = H(!1, e, br, "").replace(Sr, "").trimEnd(), a;
|
|
1647
|
+
for (; a = br.exec(e); ) {
|
|
1648
|
+
let o = H(!1, a[2], ip, "");
|
|
1649
|
+
if (typeof r[a[1]] == "string" || Array.isArray(r[a[1]])) {
|
|
1650
|
+
let i = r[a[1]];
|
|
1651
|
+
r[a[1]] = [...Ju, ...Array.isArray(i) ? i : [i], o];
|
|
1652
|
+
} else
|
|
1653
|
+
r[a[1]] = o;
|
|
1654
|
+
}
|
|
1655
|
+
return { comments: u, pragmas: r };
|
|
1656
|
+
}
|
|
1657
|
+
function yp({ comments: e = "", pragmas: t = {} }) {
|
|
1658
|
+
let n = `
|
|
1659
|
+
`, r = "/**", u = " *", a = " */", o = Object.keys(t), i = o.flatMap((l) => Br(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} ${Br(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 Br(e, t) {
|
|
1672
|
+
return [...Ju, ...Array.isArray(t) ? t : [t]].map((n) => `@${e} ${n}`.trim());
|
|
1673
|
+
}
|
|
1674
|
+
var dp = "format";
|
|
1675
|
+
function mp(e) {
|
|
1676
|
+
if (!e.startsWith("#!"))
|
|
1677
|
+
return "";
|
|
1678
|
+
let t = e.indexOf(`
|
|
1679
|
+
`);
|
|
1680
|
+
return t === -1 ? e : e.slice(0, t);
|
|
1681
|
+
}
|
|
1682
|
+
var fp = mp;
|
|
1683
|
+
function Ep(e) {
|
|
1684
|
+
let t = fp(e);
|
|
1685
|
+
t && (e = e.slice(t.length + 1));
|
|
1686
|
+
let n = lp(e), { pragmas: r, comments: u } = Dp(n);
|
|
1687
|
+
return { shebang: t, text: e, pragmas: r, comments: u };
|
|
1688
|
+
}
|
|
1689
|
+
function Fp(e) {
|
|
1690
|
+
let { shebang: t, text: n, pragmas: r, comments: u } = Ep(e), a = cp(n), o = yp({ pragmas: { [dp]: "", ...r }, comments: u.trimStart() });
|
|
1691
|
+
return (t ? `${t}
|
|
1692
|
+
` : "") + o + (a.startsWith(`
|
|
1693
|
+
`) ? `
|
|
1694
|
+
` : `
|
|
1695
|
+
|
|
1696
|
+
`) + a;
|
|
1697
|
+
}
|
|
1698
|
+
function Ap(e, t) {
|
|
1699
|
+
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);
|
|
1700
|
+
for (let d of r)
|
|
1701
|
+
u(d) >= s && a(d) <= l && o.add(d);
|
|
1702
|
+
return n.slice(s, l);
|
|
1703
|
+
}
|
|
1704
|
+
var gp = Ap;
|
|
1705
|
+
function Nn(e, t) {
|
|
1706
|
+
var n, r, u, a, o, i, s, l, d;
|
|
1707
|
+
if (e.isRoot)
|
|
1708
|
+
return !1;
|
|
1709
|
+
let { node: D, key: c, parent: p } = e;
|
|
1710
|
+
if (t.__isInHtmlInterpolation && !t.bracketSpacing && Tp(D) && St(e))
|
|
1711
|
+
return !0;
|
|
1712
|
+
if (xp(D))
|
|
1713
|
+
return !1;
|
|
1714
|
+
if (D.type === "Identifier") {
|
|
1715
|
+
if ((n = D.extra) != null && n.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(D.name) || c === "left" && (D.name === "async" && !p.await || D.name === "let") && p.type === "ForOfStatement")
|
|
1716
|
+
return !0;
|
|
1717
|
+
if (D.name === "let") {
|
|
1718
|
+
let y = (r = e.findAncestor((f) => f.type === "ForOfStatement")) == null ? void 0 : r.left;
|
|
1719
|
+
if (y && te(y, (f) => f === D))
|
|
1720
|
+
return !0;
|
|
1721
|
+
}
|
|
1722
|
+
if (c === "object" && D.name === "let" && p.type === "MemberExpression" && p.computed && !p.optional) {
|
|
1723
|
+
let y = e.findAncestor((g) => g.type === "ExpressionStatement" || g.type === "ForStatement" || g.type === "ForInStatement"), f = y ? y.type === "ExpressionStatement" ? y.expression : y.type === "ForStatement" ? y.init : y.left : void 0;
|
|
1724
|
+
if (f && te(f, (g) => g === D))
|
|
1725
|
+
return !0;
|
|
1726
|
+
}
|
|
1727
|
+
if (c === "expression")
|
|
1728
|
+
switch (D.name) {
|
|
1729
|
+
case "await":
|
|
1730
|
+
case "interface":
|
|
1731
|
+
case "module":
|
|
1732
|
+
case "using":
|
|
1733
|
+
case "yield":
|
|
1734
|
+
case "let":
|
|
1735
|
+
case "component":
|
|
1736
|
+
case "hook":
|
|
1737
|
+
case "type": {
|
|
1738
|
+
let y = e.findAncestor((f) => !Ce(f));
|
|
1739
|
+
if (y !== p && y.type === "ExpressionStatement")
|
|
1740
|
+
return !0;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
return !1;
|
|
1744
|
+
}
|
|
1745
|
+
if (D.type === "ObjectExpression" || D.type === "FunctionExpression" || D.type === "ClassExpression" || D.type === "DoExpression") {
|
|
1746
|
+
let y = (u = e.findAncestor((f) => f.type === "ExpressionStatement")) == null ? void 0 : u.expression;
|
|
1747
|
+
if (y && te(y, (f) => f === D))
|
|
1748
|
+
return !0;
|
|
1749
|
+
}
|
|
1750
|
+
if (D.type === "ObjectExpression") {
|
|
1751
|
+
let y = (a = e.findAncestor((f) => f.type === "ArrowFunctionExpression")) == null ? void 0 : a.body;
|
|
1752
|
+
if (y && y.type !== "SequenceExpression" && y.type !== "AssignmentExpression" && te(y, (f) => f === D))
|
|
1753
|
+
return !0;
|
|
1754
|
+
}
|
|
1755
|
+
switch (p.type) {
|
|
1756
|
+
case "ParenthesizedExpression":
|
|
1757
|
+
return !1;
|
|
1758
|
+
case "ClassDeclaration":
|
|
1759
|
+
case "ClassExpression":
|
|
1760
|
+
if (c === "superClass" && (D.type === "ArrowFunctionExpression" || D.type === "AssignmentExpression" || D.type === "AwaitExpression" || D.type === "BinaryExpression" || D.type === "ConditionalExpression" || D.type === "LogicalExpression" || D.type === "NewExpression" || D.type === "ObjectExpression" || D.type === "SequenceExpression" || D.type === "TaggedTemplateExpression" || D.type === "UnaryExpression" || D.type === "UpdateExpression" || D.type === "YieldExpression" || D.type === "TSNonNullExpression" || D.type === "ClassExpression" && J(D.decorators)))
|
|
1761
|
+
return !0;
|
|
1762
|
+
break;
|
|
1763
|
+
case "ExportDefaultDeclaration":
|
|
1764
|
+
return qu(e, t) || D.type === "SequenceExpression";
|
|
1765
|
+
case "Decorator":
|
|
1766
|
+
if (c === "expression" && !bp(D))
|
|
1767
|
+
return !0;
|
|
1768
|
+
break;
|
|
1769
|
+
case "TypeAnnotation":
|
|
1770
|
+
if (e.match(void 0, void 0, (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression") && Cp(D))
|
|
1771
|
+
return !0;
|
|
1772
|
+
break;
|
|
1773
|
+
case "BinaryExpression":
|
|
1774
|
+
if (c === "left" && (p.operator === "in" || p.operator === "instanceof") && D.type === "UnaryExpression")
|
|
1775
|
+
return !0;
|
|
1776
|
+
break;
|
|
1777
|
+
case "VariableDeclarator":
|
|
1778
|
+
if (c === "init" && e.match(void 0, void 0, (y, f) => f === "declarations" && y.type === "VariableDeclaration", (y, f) => f === "left" && y.type === "ForInStatement"))
|
|
1779
|
+
return !0;
|
|
1780
|
+
break;
|
|
1781
|
+
}
|
|
1782
|
+
switch (D.type) {
|
|
1783
|
+
case "UpdateExpression":
|
|
1784
|
+
if (p.type === "UnaryExpression")
|
|
1785
|
+
return D.prefix && (D.operator === "++" && p.operator === "+" || D.operator === "--" && p.operator === "-");
|
|
1786
|
+
case "UnaryExpression":
|
|
1787
|
+
switch (p.type) {
|
|
1788
|
+
case "UnaryExpression":
|
|
1789
|
+
return D.operator === p.operator && (D.operator === "+" || D.operator === "-");
|
|
1790
|
+
case "BindExpression":
|
|
1791
|
+
return !0;
|
|
1792
|
+
case "MemberExpression":
|
|
1793
|
+
case "OptionalMemberExpression":
|
|
1794
|
+
return c === "object";
|
|
1795
|
+
case "TaggedTemplateExpression":
|
|
1796
|
+
return !0;
|
|
1797
|
+
case "NewExpression":
|
|
1798
|
+
case "CallExpression":
|
|
1799
|
+
case "OptionalCallExpression":
|
|
1800
|
+
return c === "callee";
|
|
1801
|
+
case "BinaryExpression":
|
|
1802
|
+
return c === "left" && p.operator === "**";
|
|
1803
|
+
case "TSNonNullExpression":
|
|
1804
|
+
return !0;
|
|
1805
|
+
default:
|
|
1806
|
+
return !1;
|
|
1807
|
+
}
|
|
1808
|
+
case "BinaryExpression":
|
|
1809
|
+
if (p.type === "UpdateExpression" || D.operator === "in" && hp(e))
|
|
1810
|
+
return !0;
|
|
1811
|
+
if (D.operator === "|>" && (o = D.extra) != null && o.parenthesized) {
|
|
1812
|
+
let y = e.grandparent;
|
|
1813
|
+
if (y.type === "BinaryExpression" && y.operator === "|>")
|
|
1814
|
+
return !0;
|
|
1815
|
+
}
|
|
1816
|
+
case "TSTypeAssertion":
|
|
1817
|
+
case "TSAsExpression":
|
|
1818
|
+
case "TSSatisfiesExpression":
|
|
1819
|
+
case "AsExpression":
|
|
1820
|
+
case "AsConstExpression":
|
|
1821
|
+
case "SatisfiesExpression":
|
|
1822
|
+
case "LogicalExpression":
|
|
1823
|
+
switch (p.type) {
|
|
1824
|
+
case "TSAsExpression":
|
|
1825
|
+
case "TSSatisfiesExpression":
|
|
1826
|
+
case "AsExpression":
|
|
1827
|
+
case "AsConstExpression":
|
|
1828
|
+
case "SatisfiesExpression":
|
|
1829
|
+
return !Ce(D);
|
|
1830
|
+
case "ConditionalExpression":
|
|
1831
|
+
return Ce(D) || Qo(D);
|
|
1832
|
+
case "CallExpression":
|
|
1833
|
+
case "NewExpression":
|
|
1834
|
+
case "OptionalCallExpression":
|
|
1835
|
+
return c === "callee";
|
|
1836
|
+
case "ClassExpression":
|
|
1837
|
+
case "ClassDeclaration":
|
|
1838
|
+
return c === "superClass";
|
|
1839
|
+
case "TSTypeAssertion":
|
|
1840
|
+
case "TaggedTemplateExpression":
|
|
1841
|
+
case "UnaryExpression":
|
|
1842
|
+
case "JSXSpreadAttribute":
|
|
1843
|
+
case "SpreadElement":
|
|
1844
|
+
case "BindExpression":
|
|
1845
|
+
case "AwaitExpression":
|
|
1846
|
+
case "TSNonNullExpression":
|
|
1847
|
+
case "UpdateExpression":
|
|
1848
|
+
return !0;
|
|
1849
|
+
case "MemberExpression":
|
|
1850
|
+
case "OptionalMemberExpression":
|
|
1851
|
+
return c === "object";
|
|
1852
|
+
case "AssignmentExpression":
|
|
1853
|
+
case "AssignmentPattern":
|
|
1854
|
+
return c === "left" && (D.type === "TSTypeAssertion" || Ce(D));
|
|
1855
|
+
case "LogicalExpression":
|
|
1856
|
+
if (D.type === "LogicalExpression")
|
|
1857
|
+
return p.operator !== D.operator;
|
|
1858
|
+
case "BinaryExpression": {
|
|
1859
|
+
let { operator: y, type: f } = D;
|
|
1860
|
+
if (!y && f !== "TSTypeAssertion")
|
|
1861
|
+
return !0;
|
|
1862
|
+
let g = Kt(y), S = p.operator, b = Kt(S);
|
|
1863
|
+
return b > g || c === "right" && b === g || b === g && !Kn(S, y) ? !0 : b < g && y === "%" ? S === "+" || S === "-" : !!ci(S);
|
|
1864
|
+
}
|
|
1865
|
+
default:
|
|
1866
|
+
return !1;
|
|
1867
|
+
}
|
|
1868
|
+
case "SequenceExpression":
|
|
1869
|
+
return p.type !== "ForStatement";
|
|
1870
|
+
case "YieldExpression":
|
|
1871
|
+
if (p.type === "AwaitExpression" || p.type === "TSTypeAssertion")
|
|
1872
|
+
return !0;
|
|
1873
|
+
case "AwaitExpression":
|
|
1874
|
+
switch (p.type) {
|
|
1875
|
+
case "TaggedTemplateExpression":
|
|
1876
|
+
case "UnaryExpression":
|
|
1877
|
+
case "LogicalExpression":
|
|
1878
|
+
case "SpreadElement":
|
|
1879
|
+
case "TSAsExpression":
|
|
1880
|
+
case "TSSatisfiesExpression":
|
|
1881
|
+
case "TSNonNullExpression":
|
|
1882
|
+
case "AsExpression":
|
|
1883
|
+
case "AsConstExpression":
|
|
1884
|
+
case "SatisfiesExpression":
|
|
1885
|
+
case "BindExpression":
|
|
1886
|
+
return !0;
|
|
1887
|
+
case "MemberExpression":
|
|
1888
|
+
case "OptionalMemberExpression":
|
|
1889
|
+
return c === "object";
|
|
1890
|
+
case "NewExpression":
|
|
1891
|
+
case "CallExpression":
|
|
1892
|
+
case "OptionalCallExpression":
|
|
1893
|
+
return c === "callee";
|
|
1894
|
+
case "ConditionalExpression":
|
|
1895
|
+
return c === "test";
|
|
1896
|
+
case "BinaryExpression":
|
|
1897
|
+
return !(!D.argument && p.operator === "|>");
|
|
1898
|
+
default:
|
|
1899
|
+
return !1;
|
|
1900
|
+
}
|
|
1901
|
+
case "TSFunctionType":
|
|
1902
|
+
if (e.match((y) => y.type === "TSFunctionType", (y, f) => f === "typeAnnotation" && y.type === "TSTypeAnnotation", (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression"))
|
|
1903
|
+
return !0;
|
|
1904
|
+
case "TSConditionalType":
|
|
1905
|
+
case "TSConstructorType":
|
|
1906
|
+
case "ConditionalTypeAnnotation":
|
|
1907
|
+
if (c === "extendsType" && We(D) && p.type === D.type || c === "checkType" && We(p))
|
|
1908
|
+
return !0;
|
|
1909
|
+
if (c === "extendsType" && p.type === "TSConditionalType") {
|
|
1910
|
+
let { typeAnnotation: y } = D.returnType || D.typeAnnotation;
|
|
1911
|
+
if (y.type === "TSTypePredicate" && y.typeAnnotation && (y = y.typeAnnotation.typeAnnotation), y.type === "TSInferType" && y.typeParameter.constraint)
|
|
1912
|
+
return !0;
|
|
1913
|
+
}
|
|
1914
|
+
case "TSUnionType":
|
|
1915
|
+
case "TSIntersectionType":
|
|
1916
|
+
if (($e(p) || Hn(p)) && p.types.length > 1 && (!D.types || D.types.length > 1))
|
|
1917
|
+
return !0;
|
|
1918
|
+
case "TSInferType":
|
|
1919
|
+
if (D.type === "TSInferType") {
|
|
1920
|
+
if (p.type === "TSRestType")
|
|
1921
|
+
return !1;
|
|
1922
|
+
if (c === "types" && (p.type === "TSUnionType" || p.type === "TSIntersectionType") && D.typeParameter.type === "TSTypeParameter" && D.typeParameter.constraint)
|
|
1923
|
+
return !0;
|
|
1924
|
+
}
|
|
1925
|
+
case "TSTypeOperator":
|
|
1926
|
+
return p.type === "TSArrayType" || p.type === "TSOptionalType" || p.type === "TSRestType" || c === "objectType" && p.type === "TSIndexedAccessType" || p.type === "TSTypeOperator" || p.type === "TSTypeAnnotation" && e.grandparent.type.startsWith("TSJSDoc");
|
|
1927
|
+
case "TSTypeQuery":
|
|
1928
|
+
return c === "objectType" && p.type === "TSIndexedAccessType" || c === "elementType" && p.type === "TSArrayType";
|
|
1929
|
+
case "TypeOperator":
|
|
1930
|
+
return p.type === "ArrayTypeAnnotation" || p.type === "NullableTypeAnnotation" || c === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType") || p.type === "TypeOperator";
|
|
1931
|
+
case "TypeofTypeAnnotation":
|
|
1932
|
+
return c === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType") || c === "elementType" && p.type === "ArrayTypeAnnotation";
|
|
1933
|
+
case "ArrayTypeAnnotation":
|
|
1934
|
+
return p.type === "NullableTypeAnnotation";
|
|
1935
|
+
case "IntersectionTypeAnnotation":
|
|
1936
|
+
case "UnionTypeAnnotation":
|
|
1937
|
+
return p.type === "TypeOperator" || p.type === "ArrayTypeAnnotation" || p.type === "NullableTypeAnnotation" || p.type === "IntersectionTypeAnnotation" || p.type === "UnionTypeAnnotation" || c === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType");
|
|
1938
|
+
case "InferTypeAnnotation":
|
|
1939
|
+
case "NullableTypeAnnotation":
|
|
1940
|
+
return p.type === "ArrayTypeAnnotation" || c === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType");
|
|
1941
|
+
case "ComponentTypeAnnotation":
|
|
1942
|
+
case "FunctionTypeAnnotation": {
|
|
1943
|
+
if (D.type === "ComponentTypeAnnotation" && (D.rendersType === null || D.rendersType === void 0))
|
|
1944
|
+
return !1;
|
|
1945
|
+
if (e.match(void 0, (f, g) => g === "typeAnnotation" && f.type === "TypeAnnotation", (f, g) => g === "returnType" && f.type === "ArrowFunctionExpression") || e.match(void 0, (f, g) => g === "typeAnnotation" && f.type === "TypePredicate", (f, g) => g === "typeAnnotation" && f.type === "TypeAnnotation", (f, g) => g === "returnType" && f.type === "ArrowFunctionExpression"))
|
|
1946
|
+
return !0;
|
|
1947
|
+
let y = p.type === "NullableTypeAnnotation" ? e.grandparent : p;
|
|
1948
|
+
return y.type === "UnionTypeAnnotation" || y.type === "IntersectionTypeAnnotation" || y.type === "ArrayTypeAnnotation" || c === "objectType" && (y.type === "IndexedAccessType" || y.type === "OptionalIndexedAccessType") || c === "checkType" && p.type === "ConditionalTypeAnnotation" || c === "extendsType" && p.type === "ConditionalTypeAnnotation" && ((i = D.returnType) == null ? void 0 : i.type) === "InferTypeAnnotation" && ((s = D.returnType) == null ? void 0 : s.typeParameter.bound) || y.type === "NullableTypeAnnotation" || p.type === "FunctionTypeParam" && p.name === null && Z(D).some((f) => {
|
|
1949
|
+
var g;
|
|
1950
|
+
return ((g = f.typeAnnotation) == null ? void 0 : g.type) === "NullableTypeAnnotation";
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
case "OptionalIndexedAccessType":
|
|
1954
|
+
return c === "objectType" && p.type === "IndexedAccessType";
|
|
1955
|
+
case "StringLiteral":
|
|
1956
|
+
case "NumericLiteral":
|
|
1957
|
+
case "Literal":
|
|
1958
|
+
if (typeof D.value == "string" && p.type === "ExpressionStatement" && typeof p.directive != "string") {
|
|
1959
|
+
let y = e.grandparent;
|
|
1960
|
+
return y.type === "Program" || y.type === "BlockStatement";
|
|
1961
|
+
}
|
|
1962
|
+
return c === "object" && W(p) && be(D);
|
|
1963
|
+
case "AssignmentExpression":
|
|
1964
|
+
return !((c === "init" || c === "update") && p.type === "ForStatement" || c === "expression" && D.left.type !== "ObjectPattern" && p.type === "ExpressionStatement" || c === "key" && p.type === "TSPropertySignature" || p.type === "AssignmentExpression" || c === "expressions" && p.type === "SequenceExpression" && e.match(void 0, void 0, (y, f) => (f === "init" || f === "update") && y.type === "ForStatement") || c === "value" && p.type === "Property" && e.match(void 0, void 0, (y, f) => f === "properties" && y.type === "ObjectPattern") || p.type === "NGChainedExpression" || c === "node" && p.type === "JsExpressionRoot");
|
|
1965
|
+
case "ConditionalExpression":
|
|
1966
|
+
switch (p.type) {
|
|
1967
|
+
case "TaggedTemplateExpression":
|
|
1968
|
+
case "UnaryExpression":
|
|
1969
|
+
case "SpreadElement":
|
|
1970
|
+
case "BinaryExpression":
|
|
1971
|
+
case "LogicalExpression":
|
|
1972
|
+
case "NGPipeExpression":
|
|
1973
|
+
case "ExportDefaultDeclaration":
|
|
1974
|
+
case "AwaitExpression":
|
|
1975
|
+
case "JSXSpreadAttribute":
|
|
1976
|
+
case "TSTypeAssertion":
|
|
1977
|
+
case "TypeCastExpression":
|
|
1978
|
+
case "TSAsExpression":
|
|
1979
|
+
case "TSSatisfiesExpression":
|
|
1980
|
+
case "AsExpression":
|
|
1981
|
+
case "AsConstExpression":
|
|
1982
|
+
case "SatisfiesExpression":
|
|
1983
|
+
case "TSNonNullExpression":
|
|
1984
|
+
return !0;
|
|
1985
|
+
case "NewExpression":
|
|
1986
|
+
case "CallExpression":
|
|
1987
|
+
case "OptionalCallExpression":
|
|
1988
|
+
return c === "callee";
|
|
1989
|
+
case "ConditionalExpression":
|
|
1990
|
+
return t.experimentalTernaries ? !1 : c === "test";
|
|
1991
|
+
case "MemberExpression":
|
|
1992
|
+
case "OptionalMemberExpression":
|
|
1993
|
+
return c === "object";
|
|
1994
|
+
default:
|
|
1995
|
+
return !1;
|
|
1996
|
+
}
|
|
1997
|
+
case "FunctionExpression":
|
|
1998
|
+
switch (p.type) {
|
|
1999
|
+
case "NewExpression":
|
|
2000
|
+
case "CallExpression":
|
|
2001
|
+
case "OptionalCallExpression":
|
|
2002
|
+
return c === "callee";
|
|
2003
|
+
case "TaggedTemplateExpression":
|
|
2004
|
+
return !0;
|
|
2005
|
+
default:
|
|
2006
|
+
return !1;
|
|
2007
|
+
}
|
|
2008
|
+
case "ArrowFunctionExpression":
|
|
2009
|
+
switch (p.type) {
|
|
2010
|
+
case "BinaryExpression":
|
|
2011
|
+
return p.operator !== "|>" || ((l = D.extra) == null ? void 0 : l.parenthesized);
|
|
2012
|
+
case "NewExpression":
|
|
2013
|
+
case "CallExpression":
|
|
2014
|
+
case "OptionalCallExpression":
|
|
2015
|
+
return c === "callee";
|
|
2016
|
+
case "MemberExpression":
|
|
2017
|
+
case "OptionalMemberExpression":
|
|
2018
|
+
return c === "object";
|
|
2019
|
+
case "TSAsExpression":
|
|
2020
|
+
case "TSSatisfiesExpression":
|
|
2021
|
+
case "AsExpression":
|
|
2022
|
+
case "AsConstExpression":
|
|
2023
|
+
case "SatisfiesExpression":
|
|
2024
|
+
case "TSNonNullExpression":
|
|
2025
|
+
case "BindExpression":
|
|
2026
|
+
case "TaggedTemplateExpression":
|
|
2027
|
+
case "UnaryExpression":
|
|
2028
|
+
case "LogicalExpression":
|
|
2029
|
+
case "AwaitExpression":
|
|
2030
|
+
case "TSTypeAssertion":
|
|
2031
|
+
return !0;
|
|
2032
|
+
case "ConditionalExpression":
|
|
2033
|
+
return c === "test";
|
|
2034
|
+
default:
|
|
2035
|
+
return !1;
|
|
2036
|
+
}
|
|
2037
|
+
case "ClassExpression":
|
|
2038
|
+
switch (p.type) {
|
|
2039
|
+
case "NewExpression":
|
|
2040
|
+
return c === "callee";
|
|
2041
|
+
default:
|
|
2042
|
+
return !1;
|
|
2043
|
+
}
|
|
2044
|
+
case "OptionalMemberExpression":
|
|
2045
|
+
case "OptionalCallExpression":
|
|
2046
|
+
case "CallExpression":
|
|
2047
|
+
case "MemberExpression":
|
|
2048
|
+
if (Sp(e))
|
|
2049
|
+
return !0;
|
|
2050
|
+
case "TaggedTemplateExpression":
|
|
2051
|
+
case "TSNonNullExpression":
|
|
2052
|
+
if (c === "callee" && (p.type === "BindExpression" || p.type === "NewExpression")) {
|
|
2053
|
+
let y = D;
|
|
2054
|
+
for (; y; )
|
|
2055
|
+
switch (y.type) {
|
|
2056
|
+
case "CallExpression":
|
|
2057
|
+
case "OptionalCallExpression":
|
|
2058
|
+
return !0;
|
|
2059
|
+
case "MemberExpression":
|
|
2060
|
+
case "OptionalMemberExpression":
|
|
2061
|
+
case "BindExpression":
|
|
2062
|
+
y = y.object;
|
|
2063
|
+
break;
|
|
2064
|
+
case "TaggedTemplateExpression":
|
|
2065
|
+
y = y.tag;
|
|
2066
|
+
break;
|
|
2067
|
+
case "TSNonNullExpression":
|
|
2068
|
+
y = y.expression;
|
|
2069
|
+
break;
|
|
2070
|
+
default:
|
|
2071
|
+
return !1;
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
return !1;
|
|
2075
|
+
case "BindExpression":
|
|
2076
|
+
return c === "callee" && (p.type === "BindExpression" || p.type === "NewExpression") || c === "object" && W(p);
|
|
2077
|
+
case "NGPipeExpression":
|
|
2078
|
+
return !(p.type === "NGRoot" || p.type === "NGMicrosyntaxExpression" || p.type === "ObjectProperty" && !((d = D.extra) != null && d.parenthesized) || Q(p) || c === "arguments" && L(p) || c === "right" && p.type === "NGPipeExpression" || c === "property" && p.type === "MemberExpression" || p.type === "AssignmentExpression");
|
|
2079
|
+
case "JSXFragment":
|
|
2080
|
+
case "JSXElement":
|
|
2081
|
+
return c === "callee" || c === "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) && !je(p) && p.type !== "ReturnStatement" && p.type !== "ThrowStatement" && p.type !== "TypeCastExpression" && p.type !== "VariableDeclarator" && p.type !== "YieldExpression";
|
|
2082
|
+
case "TSInstantiationExpression":
|
|
2083
|
+
return c === "object" && W(p);
|
|
2084
|
+
}
|
|
2085
|
+
return !1;
|
|
2086
|
+
}
|
|
2087
|
+
var xp = _(["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"]);
|
|
2088
|
+
function hp(e) {
|
|
2089
|
+
let t = 0, { node: n } = e;
|
|
2090
|
+
for (; n; ) {
|
|
2091
|
+
let r = e.getParentNode(t++);
|
|
2092
|
+
if ((r == null ? void 0 : r.type) === "ForStatement" && r.init === n)
|
|
2093
|
+
return !0;
|
|
2094
|
+
n = r;
|
|
2095
|
+
}
|
|
2096
|
+
return !1;
|
|
2097
|
+
}
|
|
2098
|
+
function Cp(e) {
|
|
2099
|
+
return Tn(e, (t) => t.type === "ObjectTypeAnnotation" && Tn(t, (n) => n.type === "FunctionTypeAnnotation"));
|
|
2100
|
+
}
|
|
2101
|
+
function Tp(e) {
|
|
2102
|
+
return Ae(e);
|
|
2103
|
+
}
|
|
2104
|
+
function St(e) {
|
|
2105
|
+
let { parent: t, key: n } = e;
|
|
2106
|
+
switch (t.type) {
|
|
2107
|
+
case "NGPipeExpression":
|
|
2108
|
+
if (n === "arguments" && e.isLast)
|
|
2109
|
+
return e.callParent(St);
|
|
2110
|
+
break;
|
|
2111
|
+
case "ObjectProperty":
|
|
2112
|
+
if (n === "value")
|
|
2113
|
+
return e.callParent(() => e.key === "properties" && e.isLast);
|
|
2114
|
+
break;
|
|
2115
|
+
case "BinaryExpression":
|
|
2116
|
+
case "LogicalExpression":
|
|
2117
|
+
if (n === "right")
|
|
2118
|
+
return e.callParent(St);
|
|
2119
|
+
break;
|
|
2120
|
+
case "ConditionalExpression":
|
|
2121
|
+
if (n === "alternate")
|
|
2122
|
+
return e.callParent(St);
|
|
2123
|
+
break;
|
|
2124
|
+
case "UnaryExpression":
|
|
2125
|
+
if (t.prefix)
|
|
2126
|
+
return e.callParent(St);
|
|
2127
|
+
break;
|
|
2128
|
+
}
|
|
2129
|
+
return !1;
|
|
2130
|
+
}
|
|
2131
|
+
function qu(e, t) {
|
|
2132
|
+
let { node: n, parent: r } = e;
|
|
2133
|
+
return n.type === "FunctionExpression" || n.type === "ClassExpression" ? r.type === "ExportDefaultDeclaration" || !Nn(e, t) : !Rn(n) || r.type !== "ExportDefaultDeclaration" && Nn(e, t) ? !1 : e.call(() => qu(e, t), ...Zr(n));
|
|
2134
|
+
}
|
|
2135
|
+
function Sp(e) {
|
|
2136
|
+
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"));
|
|
2137
|
+
}
|
|
2138
|
+
function jn(e) {
|
|
2139
|
+
return e.type === "Identifier" ? !0 : W(e) ? !e.computed && !e.optional && e.property.type === "Identifier" && jn(e.object) : !1;
|
|
2140
|
+
}
|
|
2141
|
+
function bp(e) {
|
|
2142
|
+
return e.type === "ChainExpression" && (e = e.expression), jn(e) || L(e) && !e.optional && jn(e.callee);
|
|
2143
|
+
}
|
|
2144
|
+
var ut = Nn;
|
|
2145
|
+
function Bp(e, t) {
|
|
2146
|
+
let n = t - 1;
|
|
2147
|
+
n = ct(e, n, { backwards: !0 }), n = Dt(e, n, { backwards: !0 }), n = ct(e, n, { backwards: !0 });
|
|
2148
|
+
let r = Dt(e, n, { backwards: !0 });
|
|
2149
|
+
return n !== r;
|
|
2150
|
+
}
|
|
2151
|
+
var vp = Bp, kp = () => !0;
|
|
2152
|
+
function ur(e, t) {
|
|
2153
|
+
let n = e.node;
|
|
2154
|
+
return n.printed = !0, t.printer.printComment(e, t);
|
|
2155
|
+
}
|
|
2156
|
+
function Pp(e, t) {
|
|
2157
|
+
var n;
|
|
2158
|
+
let r = e.node, u = [ur(e, t)], { printer: a, originalText: o, locStart: i, locEnd: s } = t;
|
|
2159
|
+
if ((n = a.isBlockComment) != null && n.call(a, r)) {
|
|
2160
|
+
let d = pe(o, s(r)) ? pe(o, i(r), { backwards: !0 }) ? F : C : " ";
|
|
2161
|
+
u.push(d);
|
|
2162
|
+
} else
|
|
2163
|
+
u.push(F);
|
|
2164
|
+
let l = Dt(o, ct(o, s(r)));
|
|
2165
|
+
return l !== !1 && pe(o, l) && u.push(F), u;
|
|
2166
|
+
}
|
|
2167
|
+
function wp(e, t, n) {
|
|
2168
|
+
var r;
|
|
2169
|
+
let u = e.node, a = ur(e, t), { printer: o, originalText: i, locStart: s } = t, l = (r = o.isBlockComment) == null ? void 0 : r.call(o, u);
|
|
2170
|
+
if (n != null && n.hasLineSuffix && !(n != null && n.isBlock) || pe(i, s(u), { backwards: !0 })) {
|
|
2171
|
+
let d = vp(i, s(u));
|
|
2172
|
+
return { doc: Cr([F, d ? F : "", a]), isBlock: l, hasLineSuffix: !0 };
|
|
2173
|
+
}
|
|
2174
|
+
return !l || n != null && n.hasLineSuffix ? { doc: [Cr([" ", a]), ve], isBlock: l, hasLineSuffix: !0 } : { doc: [" ", a], isBlock: l, hasLineSuffix: !1 };
|
|
2175
|
+
}
|
|
2176
|
+
function $(e, t, n = {}) {
|
|
2177
|
+
let { node: r } = e;
|
|
2178
|
+
if (!J(r == null ? void 0 : r.comments))
|
|
2179
|
+
return "";
|
|
2180
|
+
let { indent: u = !1, marker: a, filter: o = kp } = n, i = [];
|
|
2181
|
+
if (e.each(({ node: l }) => {
|
|
2182
|
+
l.leading || l.trailing || l.marker !== a || !o(l) || i.push(ur(e, t));
|
|
2183
|
+
}, "comments"), i.length === 0)
|
|
2184
|
+
return "";
|
|
2185
|
+
let s = N(F, i);
|
|
2186
|
+
return u ? A([F, s]) : s;
|
|
2187
|
+
}
|
|
2188
|
+
function _u(e, t) {
|
|
2189
|
+
let n = e.node;
|
|
2190
|
+
if (!n)
|
|
2191
|
+
return {};
|
|
2192
|
+
let r = t[Symbol.for("printedComments")];
|
|
2193
|
+
if ((n.comments || []).filter((i) => !r.has(i)).length === 0)
|
|
2194
|
+
return { leading: "", trailing: "" };
|
|
2195
|
+
let u = [], a = [], o;
|
|
2196
|
+
return e.each(() => {
|
|
2197
|
+
let i = e.node;
|
|
2198
|
+
if (r != null && r.has(i))
|
|
2199
|
+
return;
|
|
2200
|
+
let { leading: s, trailing: l } = i;
|
|
2201
|
+
s ? u.push(Pp(e, t)) : l && (o = wp(e, t, o), a.push(o.doc));
|
|
2202
|
+
}, "comments"), { leading: u, trailing: a };
|
|
2203
|
+
}
|
|
2204
|
+
function Fe(e, t, n) {
|
|
2205
|
+
let { leading: r, trailing: u } = _u(e, n);
|
|
2206
|
+
return !r && !u ? t : Bn(t, (a) => [r, a, u]);
|
|
2207
|
+
}
|
|
2208
|
+
var Ip = class extends Error {
|
|
2209
|
+
constructor(t, n, r = "type") {
|
|
2210
|
+
super(`Unexpected ${n} node ${r}: ${JSON.stringify(t[r])}.`);
|
|
2211
|
+
qt(this, "name", "UnexpectedNodeError");
|
|
2212
|
+
this.node = t;
|
|
2213
|
+
}
|
|
2214
|
+
}, At = Ip;
|
|
2215
|
+
function Np(e) {
|
|
2216
|
+
if (typeof e != "string")
|
|
2217
|
+
throw new TypeError("Expected a string");
|
|
2218
|
+
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2219
|
+
}
|
|
2220
|
+
var fe, jp = class {
|
|
2221
|
+
constructor(e) {
|
|
2222
|
+
uo(this, fe), ao(this, fe, new Set(e));
|
|
2223
|
+
}
|
|
2224
|
+
getLeadingWhitespaceCount(e) {
|
|
2225
|
+
let t = Je(this, fe), n = 0;
|
|
2226
|
+
for (let r = 0; r < e.length && t.has(e.charAt(r)); r++)
|
|
2227
|
+
n++;
|
|
2228
|
+
return n;
|
|
2229
|
+
}
|
|
2230
|
+
getTrailingWhitespaceCount(e) {
|
|
2231
|
+
let t = Je(this, fe), n = 0;
|
|
2232
|
+
for (let r = e.length - 1; r >= 0 && t.has(e.charAt(r)); r--)
|
|
2233
|
+
n++;
|
|
2234
|
+
return n;
|
|
2235
|
+
}
|
|
2236
|
+
getLeadingWhitespace(e) {
|
|
2237
|
+
let t = this.getLeadingWhitespaceCount(e);
|
|
2238
|
+
return e.slice(0, t);
|
|
2239
|
+
}
|
|
2240
|
+
getTrailingWhitespace(e) {
|
|
2241
|
+
let t = this.getTrailingWhitespaceCount(e);
|
|
2242
|
+
return e.slice(e.length - t);
|
|
2243
|
+
}
|
|
2244
|
+
hasLeadingWhitespace(e) {
|
|
2245
|
+
return Je(this, fe).has(e.charAt(0));
|
|
2246
|
+
}
|
|
2247
|
+
hasTrailingWhitespace(e) {
|
|
2248
|
+
return Je(this, fe).has(X(!1, e, -1));
|
|
2249
|
+
}
|
|
2250
|
+
trimStart(e) {
|
|
2251
|
+
let t = this.getLeadingWhitespaceCount(e);
|
|
2252
|
+
return e.slice(t);
|
|
2253
|
+
}
|
|
2254
|
+
trimEnd(e) {
|
|
2255
|
+
let t = this.getTrailingWhitespaceCount(e);
|
|
2256
|
+
return e.slice(0, e.length - t);
|
|
2257
|
+
}
|
|
2258
|
+
trim(e) {
|
|
2259
|
+
return this.trimEnd(this.trimStart(e));
|
|
2260
|
+
}
|
|
2261
|
+
split(e, t = !1) {
|
|
2262
|
+
let n = `[${Np([...Je(this, fe)].join(""))}]+`, r = new RegExp(t ? `(${n})` : n, "u");
|
|
2263
|
+
return e.split(r);
|
|
2264
|
+
}
|
|
2265
|
+
hasWhitespaceCharacter(e) {
|
|
2266
|
+
let t = Je(this, fe);
|
|
2267
|
+
return Array.prototype.some.call(e, (n) => t.has(n));
|
|
2268
|
+
}
|
|
2269
|
+
hasNonWhitespaceCharacter(e) {
|
|
2270
|
+
let t = Je(this, fe);
|
|
2271
|
+
return Array.prototype.some.call(e, (n) => !t.has(n));
|
|
2272
|
+
}
|
|
2273
|
+
isWhitespaceOnly(e) {
|
|
2274
|
+
let t = Je(this, fe);
|
|
2275
|
+
return Array.prototype.every.call(e, (n) => t.has(n));
|
|
2276
|
+
}
|
|
2277
|
+
};
|
|
2278
|
+
fe = /* @__PURE__ */ new WeakMap();
|
|
2279
|
+
var Lp = jp, Ut = new Lp(`
|
|
2280
|
+
\r `), Fn = (e) => e === "" || e === C || e === F || e === E;
|
|
2281
|
+
function Mp(e, t, n) {
|
|
2282
|
+
var r, u, a, o, i;
|
|
2283
|
+
let { node: s } = e;
|
|
2284
|
+
if (s.type === "JSXElement" && Yp(s))
|
|
2285
|
+
return [n("openingElement"), n("closingElement")];
|
|
2286
|
+
let l = s.type === "JSXElement" ? n("openingElement") : n("openingFragment"), d = s.type === "JSXElement" ? n("closingElement") : n("closingFragment");
|
|
2287
|
+
if (s.children.length === 1 && s.children[0].type === "JSXExpressionContainer" && (s.children[0].expression.type === "TemplateLiteral" || s.children[0].expression.type === "TaggedTemplateExpression"))
|
|
2288
|
+
return [l, ...e.map(n, "children"), d];
|
|
2289
|
+
s.children = s.children.map((k) => Zp(k) ? { type: "JSXText", value: " ", raw: " " } : k);
|
|
2290
|
+
let D = s.children.some(K), c = s.children.filter((k) => k.type === "JSXExpressionContainer").length > 1, p = s.type === "JSXElement" && s.openingElement.attributes.length > 1, y = ne(l) || D || p || c, f = e.parent.rootMarker === "mdx", g = t.singleQuote ? "{' '}" : '{" "}', S = f ? C : w([g, E], " "), b = ((u = (r = s.openingElement) == null ? void 0 : r.name) == null ? void 0 : u.name) === "fbt", x = Op(e, t, n, S, b), j = s.children.some((k) => wt(k));
|
|
2291
|
+
for (let k = x.length - 2; k >= 0; k--) {
|
|
2292
|
+
let O = x[k] === "" && x[k + 1] === "", G = x[k] === F && x[k + 1] === "" && x[k + 2] === F, U = (x[k] === E || x[k] === F) && x[k + 1] === "" && x[k + 2] === S, Oe = x[k] === S && x[k + 1] === "" && (x[k + 2] === E || x[k + 2] === F), P = x[k] === S && x[k + 1] === "" && x[k + 2] === S, V = x[k] === E && x[k + 1] === "" && x[k + 2] === F || x[k] === F && x[k + 1] === "" && x[k + 2] === E;
|
|
2293
|
+
G && j || O || U || P || V ? x.splice(k, 2) : Oe && x.splice(k + 1, 2);
|
|
2294
|
+
}
|
|
2295
|
+
for (; x.length > 0 && Fn(X(!1, x, -1)); )
|
|
2296
|
+
x.pop();
|
|
2297
|
+
for (; x.length > 1 && Fn(x[0]) && Fn(x[1]); )
|
|
2298
|
+
x.shift(), x.shift();
|
|
2299
|
+
let v = [""];
|
|
2300
|
+
for (let [k, O] of x.entries()) {
|
|
2301
|
+
if (O === S) {
|
|
2302
|
+
if (k === 1 && Bi(x[k - 1])) {
|
|
2303
|
+
if (x.length === 2) {
|
|
2304
|
+
v.push([v.pop(), g]);
|
|
2305
|
+
continue;
|
|
2306
|
+
}
|
|
2307
|
+
v.push([g, F], "");
|
|
2308
|
+
continue;
|
|
2309
|
+
} else if (k === x.length - 1) {
|
|
2310
|
+
v.push([v.pop(), g]);
|
|
2311
|
+
continue;
|
|
2312
|
+
} else if (x[k - 1] === "" && x[k - 2] === F) {
|
|
2313
|
+
v.push([v.pop(), g]);
|
|
2314
|
+
continue;
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
k % 2 === 0 ? v.push([v.pop(), O]) : v.push(O, ""), ne(O) && (y = !0);
|
|
2318
|
+
}
|
|
2319
|
+
let B = j ? yu(v) : m(v, { shouldBreak: !0 });
|
|
2320
|
+
if (((a = t.cursorNode) == null ? void 0 : a.type) === "JSXText" && s.children.includes(t.cursorNode) ? B = [$t, B, $t] : ((o = t.nodeBeforeCursor) == null ? void 0 : o.type) === "JSXText" && s.children.includes(t.nodeBeforeCursor) ? B = [$t, B] : ((i = t.nodeAfterCursor) == null ? void 0 : i.type) === "JSXText" && s.children.includes(t.nodeAfterCursor) && (B = [B, $t]), f)
|
|
2321
|
+
return B;
|
|
2322
|
+
let M = m([l, A([F, B]), F, d]);
|
|
2323
|
+
return y ? M : Ve([m([l, ...x, d]), M]);
|
|
2324
|
+
}
|
|
2325
|
+
function Op(e, t, n, r, u) {
|
|
2326
|
+
let a = "", o = [a];
|
|
2327
|
+
function i(l) {
|
|
2328
|
+
a = l, o.push([o.pop(), l]);
|
|
2329
|
+
}
|
|
2330
|
+
function s(l) {
|
|
2331
|
+
l !== "" && (a = l, o.push(l, ""));
|
|
2332
|
+
}
|
|
2333
|
+
return e.each(({ node: l, next: d }) => {
|
|
2334
|
+
if (l.type === "JSXText") {
|
|
2335
|
+
let D = oe(l);
|
|
2336
|
+
if (wt(l)) {
|
|
2337
|
+
let c = Ut.split(D, !0);
|
|
2338
|
+
c[0] === "" && (c.shift(), /\n/u.test(c[0]) ? s(kr(u, c[1], l, d)) : s(r), c.shift());
|
|
2339
|
+
let p;
|
|
2340
|
+
if (X(!1, c, -1) === "" && (c.pop(), p = c.pop()), c.length === 0)
|
|
2341
|
+
return;
|
|
2342
|
+
for (let [y, f] of c.entries())
|
|
2343
|
+
y % 2 === 1 ? s(C) : i(f);
|
|
2344
|
+
p !== void 0 ? /\n/u.test(p) ? s(kr(u, a, l, d)) : s(r) : s(vr(u, a, l, d));
|
|
2345
|
+
} else
|
|
2346
|
+
/\n/u.test(D) ? D.match(/\n/gu).length > 1 && s(F) : s(r);
|
|
2347
|
+
} else {
|
|
2348
|
+
let D = n();
|
|
2349
|
+
if (i(D), d && wt(d)) {
|
|
2350
|
+
let c = Ut.trim(oe(d)), [p] = Ut.split(c);
|
|
2351
|
+
s(vr(u, p, l, d));
|
|
2352
|
+
} else
|
|
2353
|
+
s(F);
|
|
2354
|
+
}
|
|
2355
|
+
}, "children"), o;
|
|
2356
|
+
}
|
|
2357
|
+
function vr(e, t, n, r) {
|
|
2358
|
+
return e ? "" : n.type === "JSXElement" && !n.closingElement || (r == null ? void 0 : r.type) === "JSXElement" && !r.closingElement ? t.length === 1 ? E : F : E;
|
|
2359
|
+
}
|
|
2360
|
+
function kr(e, t, n, r) {
|
|
2361
|
+
return e ? F : t.length === 1 ? n.type === "JSXElement" && !n.closingElement || (r == null ? void 0 : r.type) === "JSXElement" && !r.closingElement ? F : E : F;
|
|
2362
|
+
}
|
|
2363
|
+
var Jp = /* @__PURE__ */ new Set(["ArrayExpression", "JSXAttribute", "JSXElement", "JSXExpressionContainer", "JSXFragment", "ExpressionStatement", "CallExpression", "OptionalCallExpression", "ConditionalExpression", "JsExpressionRoot"]);
|
|
2364
|
+
function qp(e, t, n) {
|
|
2365
|
+
let { parent: r } = e;
|
|
2366
|
+
if (Jp.has(r.type))
|
|
2367
|
+
return t;
|
|
2368
|
+
let u = _p(e), a = ut(e, n);
|
|
2369
|
+
return m([a ? "" : w("("), A([E, t]), E, a ? "" : w(")")], { shouldBreak: u });
|
|
2370
|
+
}
|
|
2371
|
+
function _p(e) {
|
|
2372
|
+
return e.match(void 0, (t) => t.type === "ArrowFunctionExpression", L) && (e.match(void 0, void 0, void 0, (t) => t.type === "JSXExpressionContainer") || e.match(void 0, void 0, void 0, (t) => t.type === "ChainExpression", (t) => t.type === "JSXExpressionContainer"));
|
|
2373
|
+
}
|
|
2374
|
+
function Xp(e, t, n) {
|
|
2375
|
+
let { node: r } = e, u = [];
|
|
2376
|
+
if (u.push(n("name")), r.value) {
|
|
2377
|
+
let a;
|
|
2378
|
+
if (Y(r.value)) {
|
|
2379
|
+
let o = oe(r.value), i = H(!1, H(!1, o.slice(1, -1), "'", "'"), """, '"'), s = Vr(i, t.jsxSingleQuote);
|
|
2380
|
+
i = s === '"' ? H(!1, i, '"', """) : H(!1, i, "'", "'"), a = e.call(() => Fe(e, He(s + i + s), t), "value");
|
|
2381
|
+
} else
|
|
2382
|
+
a = n("value");
|
|
2383
|
+
u.push("=", a);
|
|
2384
|
+
}
|
|
2385
|
+
return u;
|
|
2386
|
+
}
|
|
2387
|
+
function $p(e, t, n) {
|
|
2388
|
+
let { node: r } = e, u = (a, o) => a.type === "JSXEmptyExpression" || !h(a) && (Q(a) || Ae(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" || ke(a)));
|
|
2389
|
+
return u(r.expression, e.parent) ? m(["{", n("expression"), we, "}"]) : m(["{", A([E, n("expression")]), E, we, "}"]);
|
|
2390
|
+
}
|
|
2391
|
+
function Wp(e, t, n) {
|
|
2392
|
+
var r, u;
|
|
2393
|
+
let { node: a } = e, o = h(a.name) || h(a.typeParameters) || h(a.typeArguments);
|
|
2394
|
+
if (a.selfClosing && a.attributes.length === 0 && !o)
|
|
2395
|
+
return ["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " />"];
|
|
2396
|
+
if (((r = a.attributes) == null ? void 0 : r.length) === 1 && Y(a.attributes[0].value) && !a.attributes[0].value.value.includes(`
|
|
2397
|
+
`) && !o && !h(a.attributes[0]))
|
|
2398
|
+
return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " ", ...e.map(n, "attributes"), a.selfClosing ? " />" : ">"]);
|
|
2399
|
+
let i = (u = a.attributes) == null ? void 0 : u.some((l) => Y(l.value) && l.value.value.includes(`
|
|
2400
|
+
`)), s = t.singleAttributePerLine && a.attributes.length > 1 ? F : C;
|
|
2401
|
+
return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), A(e.map(() => [s, n()], "attributes")), ...Rp(a, t, o)], { shouldBreak: i });
|
|
2402
|
+
}
|
|
2403
|
+
function Rp(e, t, n) {
|
|
2404
|
+
return e.selfClosing ? [C, "/>"] : Up(e, t, n) ? [">"] : [E, ">"];
|
|
2405
|
+
}
|
|
2406
|
+
function Up(e, t, n) {
|
|
2407
|
+
let r = e.attributes.length > 0 && h(X(!1, e.attributes, -1), T.Trailing);
|
|
2408
|
+
return e.attributes.length === 0 && !n || (t.bracketSameLine || t.jsxBracketSameLine) && (!n || e.attributes.length > 0) && !r;
|
|
2409
|
+
}
|
|
2410
|
+
function Gp(e, t, n) {
|
|
2411
|
+
let { node: r } = e, u = [];
|
|
2412
|
+
u.push("</");
|
|
2413
|
+
let a = n("name");
|
|
2414
|
+
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;
|
|
2415
|
+
}
|
|
2416
|
+
function Vp(e, t) {
|
|
2417
|
+
let { node: n } = e, r = h(n), u = h(n, T.Line), a = n.type === "JSXOpeningFragment";
|
|
2418
|
+
return [a ? "<" : "</", A([u ? F : r && !a ? " " : "", $(e, t)]), u ? F : "", ">"];
|
|
2419
|
+
}
|
|
2420
|
+
function Kp(e, t, n) {
|
|
2421
|
+
let r = Fe(e, Mp(e, t, n), t);
|
|
2422
|
+
return qp(e, r, t);
|
|
2423
|
+
}
|
|
2424
|
+
function Hp(e, t) {
|
|
2425
|
+
let { node: n } = e, r = h(n, T.Line);
|
|
2426
|
+
return [$(e, t, { indent: r }), r ? F : ""];
|
|
2427
|
+
}
|
|
2428
|
+
function zp(e, t, n) {
|
|
2429
|
+
let { node: r } = e;
|
|
2430
|
+
return ["{", e.call(({ node: u }) => {
|
|
2431
|
+
let a = ["...", n()];
|
|
2432
|
+
return !h(u) || !ku(e) ? a : [A([E, Fe(e, a, t)]), E];
|
|
2433
|
+
}, r.type === "JSXSpreadAttribute" ? "argument" : "expression"), "}"];
|
|
2434
|
+
}
|
|
2435
|
+
function Qp(e, t, n) {
|
|
2436
|
+
let { node: r } = e;
|
|
2437
|
+
if (r.type.startsWith("JSX"))
|
|
2438
|
+
switch (r.type) {
|
|
2439
|
+
case "JSXAttribute":
|
|
2440
|
+
return Xp(e, t, n);
|
|
2441
|
+
case "JSXIdentifier":
|
|
2442
|
+
return r.name;
|
|
2443
|
+
case "JSXNamespacedName":
|
|
2444
|
+
return N(":", [n("namespace"), n("name")]);
|
|
2445
|
+
case "JSXMemberExpression":
|
|
2446
|
+
return N(".", [n("object"), n("property")]);
|
|
2447
|
+
case "JSXSpreadAttribute":
|
|
2448
|
+
case "JSXSpreadChild":
|
|
2449
|
+
return zp(e, t, n);
|
|
2450
|
+
case "JSXExpressionContainer":
|
|
2451
|
+
return $p(e, t, n);
|
|
2452
|
+
case "JSXFragment":
|
|
2453
|
+
case "JSXElement":
|
|
2454
|
+
return Kp(e, t, n);
|
|
2455
|
+
case "JSXOpeningElement":
|
|
2456
|
+
return Wp(e, t, n);
|
|
2457
|
+
case "JSXClosingElement":
|
|
2458
|
+
return Gp(e, t, n);
|
|
2459
|
+
case "JSXOpeningFragment":
|
|
2460
|
+
case "JSXClosingFragment":
|
|
2461
|
+
return Vp(e, t);
|
|
2462
|
+
case "JSXEmptyExpression":
|
|
2463
|
+
return Hp(e, t);
|
|
2464
|
+
case "JSXText":
|
|
2465
|
+
throw new Error("JSXText should be handled by JSXElement");
|
|
2466
|
+
default:
|
|
2467
|
+
throw new At(r, "JSX");
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
function Yp(e) {
|
|
2471
|
+
if (e.children.length === 0)
|
|
2472
|
+
return !0;
|
|
2473
|
+
if (e.children.length > 1)
|
|
2474
|
+
return !1;
|
|
2475
|
+
let t = e.children[0];
|
|
2476
|
+
return t.type === "JSXText" && !wt(t);
|
|
2477
|
+
}
|
|
2478
|
+
function wt(e) {
|
|
2479
|
+
return e.type === "JSXText" && (Ut.hasNonWhitespaceCharacter(oe(e)) || !/\n/u.test(oe(e)));
|
|
2480
|
+
}
|
|
2481
|
+
function Zp(e) {
|
|
2482
|
+
return e.type === "JSXExpressionContainer" && Y(e.expression) && e.expression.value === " " && !h(e.expression);
|
|
2483
|
+
}
|
|
2484
|
+
function el(e) {
|
|
2485
|
+
let { node: t, parent: n } = e;
|
|
2486
|
+
if (!K(t) || !K(n))
|
|
2487
|
+
return !1;
|
|
2488
|
+
let { index: r, siblings: u } = e, a;
|
|
2489
|
+
for (let o = r; o > 0; o--) {
|
|
2490
|
+
let i = u[o - 1];
|
|
2491
|
+
if (!(i.type === "JSXText" && !wt(i))) {
|
|
2492
|
+
a = i;
|
|
2493
|
+
break;
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
return (a == null ? void 0 : a.type) === "JSXExpressionContainer" && a.expression.type === "JSXEmptyExpression" && un(a.expression);
|
|
2497
|
+
}
|
|
2498
|
+
function tl(e) {
|
|
2499
|
+
return un(e.node) || el(e);
|
|
2500
|
+
}
|
|
2501
|
+
var Xu = tl, nl = 0;
|
|
2502
|
+
function $u(e, t, n) {
|
|
2503
|
+
var r;
|
|
2504
|
+
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 = Ln(e, t, n, !1, s);
|
|
2505
|
+
if (s)
|
|
2506
|
+
return d;
|
|
2507
|
+
if (l)
|
|
2508
|
+
return m(d);
|
|
2509
|
+
if (L(a) && a.callee === u || a.type === "UnaryExpression" || W(a) && !a.computed)
|
|
2510
|
+
return m([A([E, ...d]), E]);
|
|
2511
|
+
let D = 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", c = a.type === "AssignmentExpression" || a.type === "VariableDeclarator" || a.type === "ClassProperty" || a.type === "PropertyDefinition" || a.type === "TSAbstractPropertyDefinition" || a.type === "ClassPrivateProperty" || je(a), p = ke(u.left) && Kn(u.operator, u.left.operator);
|
|
2512
|
+
if (D || It(u) && !p || !It(u) && c)
|
|
2513
|
+
return m(d);
|
|
2514
|
+
if (d.length === 0)
|
|
2515
|
+
return "";
|
|
2516
|
+
let y = K(u.right), f = d.findIndex((v) => typeof v != "string" && !Array.isArray(v) && v.type === De), g = d.slice(0, f === -1 ? 1 : f + 1), S = d.slice(g.length, y ? -1 : void 0), b = Symbol("logicalChain-" + ++nl), x = m([...g, A(S)], { id: b });
|
|
2517
|
+
if (!y)
|
|
2518
|
+
return x;
|
|
2519
|
+
let j = X(!1, d, -1);
|
|
2520
|
+
return m([x, an(j, { groupId: b })]);
|
|
2521
|
+
}
|
|
2522
|
+
function Ln(e, t, n, r, u) {
|
|
2523
|
+
var a;
|
|
2524
|
+
let { node: o } = e;
|
|
2525
|
+
if (!ke(o))
|
|
2526
|
+
return [m(n())];
|
|
2527
|
+
let i = [];
|
|
2528
|
+
Kn(o.operator, o.left.operator) ? i = e.call((g) => Ln(g, t, n, !0, u), "left") : i.push(m(n("left")));
|
|
2529
|
+
let s = It(o), l = (o.operator === "|>" || o.type === "NGPipeExpression" || rl(e, t)) && !Te(t.originalText, o.right), d = !h(o.right, T.Leading, Eu) && Te(t.originalText, o.right), D = o.type === "NGPipeExpression" ? "|" : o.operator, c = o.type === "NGPipeExpression" && o.arguments.length > 0 ? m(A([E, ": ", N([C, ": "], e.map(() => Be(2, m(n())), "arguments"))])) : "", p;
|
|
2530
|
+
if (s)
|
|
2531
|
+
p = [D, Te(t.originalText, o.right) ? A([C, n("right"), c]) : [" ", n("right"), c]];
|
|
2532
|
+
else {
|
|
2533
|
+
let g = D === "|>" && ((a = e.root.extra) != null && a.__isUsingHackPipeline) ? e.call((S) => Ln(S, t, n, !0, u), "right") : n("right");
|
|
2534
|
+
if (t.experimentalOperatorPosition === "start") {
|
|
2535
|
+
let S = "";
|
|
2536
|
+
if (d)
|
|
2537
|
+
switch (Ge(g)) {
|
|
2538
|
+
case Pe:
|
|
2539
|
+
S = g.splice(0, 1)[0];
|
|
2540
|
+
break;
|
|
2541
|
+
case Le:
|
|
2542
|
+
S = g.contents.splice(0, 1)[0];
|
|
2543
|
+
break;
|
|
2544
|
+
}
|
|
2545
|
+
p = [C, S, D, " ", g, c];
|
|
2546
|
+
} else
|
|
2547
|
+
p = [l ? C : "", D, l ? " " : C, g, c];
|
|
2548
|
+
}
|
|
2549
|
+
let { parent: y } = e, f = h(o.left, T.Trailing | T.Line);
|
|
2550
|
+
if ((f || !(u && o.type === "LogicalExpression") && y.type !== o.type && o.left.type !== o.type && o.right.type !== o.type) && (p = m(p, { shouldBreak: f })), t.experimentalOperatorPosition === "start" ? i.push(s || d ? " " : "", p) : i.push(l ? "" : " ", p), r && h(o)) {
|
|
2551
|
+
let g = Qn(Fe(e, i, t));
|
|
2552
|
+
return g.type === Re ? g.parts : Array.isArray(g) ? g : [g];
|
|
2553
|
+
}
|
|
2554
|
+
return i;
|
|
2555
|
+
}
|
|
2556
|
+
function It(e) {
|
|
2557
|
+
return e.type !== "LogicalExpression" ? !1 : !!(Ae(e.right) && e.right.properties.length > 0 || Q(e.right) && e.right.elements.length > 0 || K(e.right));
|
|
2558
|
+
}
|
|
2559
|
+
var Pr = (e) => e.type === "BinaryExpression" && e.operator === "|";
|
|
2560
|
+
function rl(e, t) {
|
|
2561
|
+
return (t.parser === "__vue_expression" || t.parser === "__vue_ts_expression") && Pr(e.node) && !e.hasAncestor((n) => !Pr(n) && n.type !== "JsExpressionRoot");
|
|
2562
|
+
}
|
|
2563
|
+
function ul(e, t, n) {
|
|
2564
|
+
let { node: r } = e;
|
|
2565
|
+
if (r.type.startsWith("NG"))
|
|
2566
|
+
switch (r.type) {
|
|
2567
|
+
case "NGRoot":
|
|
2568
|
+
return [n("node"), h(r.node) ? " //" + Ke(r.node)[0].value.trimEnd() : ""];
|
|
2569
|
+
case "NGPipeExpression":
|
|
2570
|
+
return $u(e, t, n);
|
|
2571
|
+
case "NGChainedExpression":
|
|
2572
|
+
return m(N([";", C], e.map(() => il(e) ? n() : ["(", n(), ")"], "expressions")));
|
|
2573
|
+
case "NGEmptyExpression":
|
|
2574
|
+
return "";
|
|
2575
|
+
case "NGMicrosyntax":
|
|
2576
|
+
return e.map(() => [e.isFirst ? "" : wr(e) ? " " : [";", C], n()], "body");
|
|
2577
|
+
case "NGMicrosyntaxKey":
|
|
2578
|
+
return /^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(r.name) ? r.name : JSON.stringify(r.name);
|
|
2579
|
+
case "NGMicrosyntaxExpression":
|
|
2580
|
+
return [n("expression"), r.alias === null ? "" : [" as ", n("alias")]];
|
|
2581
|
+
case "NGMicrosyntaxKeyedExpression": {
|
|
2582
|
+
let { index: u, parent: a } = e, o = wr(e) || al(e) || (u === 1 && (r.key.name === "then" || r.key.name === "else" || r.key.name === "as") || u === 2 && (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";
|
|
2583
|
+
return [n("key"), o ? " " : ": ", n("expression")];
|
|
2584
|
+
}
|
|
2585
|
+
case "NGMicrosyntaxLet":
|
|
2586
|
+
return ["let ", n("key"), r.value === null ? "" : [" = ", n("value")]];
|
|
2587
|
+
case "NGMicrosyntaxAs":
|
|
2588
|
+
return [n("key"), " as ", n("alias")];
|
|
2589
|
+
default:
|
|
2590
|
+
throw new At(r, "Angular");
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
function wr({ node: e, index: t }) {
|
|
2594
|
+
return e.type === "NGMicrosyntaxKeyedExpression" && e.key.name === "of" && t === 1;
|
|
2595
|
+
}
|
|
2596
|
+
function al(e) {
|
|
2597
|
+
let { node: t } = e;
|
|
2598
|
+
return e.parent.body[1].key.name === "of" && t.type === "NGMicrosyntaxKeyedExpression" && t.key.name === "track" && t.key.type === "NGMicrosyntaxKey";
|
|
2599
|
+
}
|
|
2600
|
+
var ol = _(["CallExpression", "OptionalCallExpression", "AssignmentExpression"]);
|
|
2601
|
+
function il({ node: e }) {
|
|
2602
|
+
return Tn(e, ol);
|
|
2603
|
+
}
|
|
2604
|
+
function Wu(e, t, n) {
|
|
2605
|
+
let { node: r } = e;
|
|
2606
|
+
return m([N(C, e.map(n, "decorators")), Ru(r, t) ? F : C]);
|
|
2607
|
+
}
|
|
2608
|
+
function sl(e, t, n) {
|
|
2609
|
+
return Uu(e.node) ? [N(F, e.map(n, "declaration", "decorators")), F] : "";
|
|
2610
|
+
}
|
|
2611
|
+
function pl(e, t, n) {
|
|
2612
|
+
let { node: r, parent: u } = e, { decorators: a } = r;
|
|
2613
|
+
if (!J(a) || Uu(u) || Xu(e))
|
|
2614
|
+
return "";
|
|
2615
|
+
let o = r.type === "ClassExpression" || r.type === "ClassDeclaration" || Ru(r, t);
|
|
2616
|
+
return [e.key === "declaration" && zo(u) ? F : o ? ve : "", N(C, e.map(n, "decorators")), C];
|
|
2617
|
+
}
|
|
2618
|
+
function Ru(e, t) {
|
|
2619
|
+
return e.decorators.some((n) => pe(t.originalText, I(n)));
|
|
2620
|
+
}
|
|
2621
|
+
function Uu(e) {
|
|
2622
|
+
var t;
|
|
2623
|
+
if (e.type !== "ExportDefaultDeclaration" && e.type !== "ExportNamedDeclaration" && e.type !== "DeclareExportDeclaration")
|
|
2624
|
+
return !1;
|
|
2625
|
+
let n = (t = e.declaration) == null ? void 0 : t.decorators;
|
|
2626
|
+
return J(n) && tn(e, n[0]);
|
|
2627
|
+
}
|
|
2628
|
+
var Qt = class extends Error {
|
|
2629
|
+
constructor() {
|
|
2630
|
+
super(...arguments);
|
|
2631
|
+
qt(this, "name", "ArgExpansionBailout");
|
|
2632
|
+
}
|
|
2633
|
+
};
|
|
2634
|
+
function ll(e, t, n) {
|
|
2635
|
+
let { node: r } = e, u = de(r);
|
|
2636
|
+
if (u.length === 0)
|
|
2637
|
+
return ["(", $(e, t), ")"];
|
|
2638
|
+
let a = u.length - 1;
|
|
2639
|
+
if (yl(u)) {
|
|
2640
|
+
let D = ["("];
|
|
2641
|
+
return Ht(e, (c, p) => {
|
|
2642
|
+
D.push(n()), p !== a && D.push(", ");
|
|
2643
|
+
}), D.push(")"), D;
|
|
2644
|
+
}
|
|
2645
|
+
let o = !1, i = [];
|
|
2646
|
+
Ht(e, ({ node: D }, c) => {
|
|
2647
|
+
let p = n();
|
|
2648
|
+
c === a || (Ne(D, t) ? (o = !0, p = [p, ",", F, F]) : p = [p, ",", C]), i.push(p);
|
|
2649
|
+
});
|
|
2650
|
+
let s = !t.parser.startsWith("__ng_") && r.type !== "ImportExpression" && r.type !== "TSImportType" && Ie(t, "all") ? "," : "";
|
|
2651
|
+
if (r.type === "TSImportType" && u.length === 1 && (u[0].type === "TSLiteralType" && Y(u[0].literal) || Y(u[0])) && !h(u[0]))
|
|
2652
|
+
return m(["(", ...i, w(s), ")"]);
|
|
2653
|
+
function l() {
|
|
2654
|
+
return m(["(", A([C, ...i]), s, C, ")"], { shouldBreak: !0 });
|
|
2655
|
+
}
|
|
2656
|
+
if (o || e.parent.type !== "Decorator" && ii(u))
|
|
2657
|
+
return l();
|
|
2658
|
+
if (Dl(u)) {
|
|
2659
|
+
let D = i.slice(1);
|
|
2660
|
+
if (D.some(ne))
|
|
2661
|
+
return l();
|
|
2662
|
+
let c;
|
|
2663
|
+
try {
|
|
2664
|
+
c = n(gr(r, 0), { expandFirstArg: !0 });
|
|
2665
|
+
} catch (p) {
|
|
2666
|
+
if (p instanceof Qt)
|
|
2667
|
+
return l();
|
|
2668
|
+
throw p;
|
|
2669
|
+
}
|
|
2670
|
+
return ne(c) ? [ve, Ve([["(", m(c, { shouldBreak: !0 }), ", ", ...D, ")"], l()])] : Ve([["(", c, ", ", ...D, ")"], ["(", m(c, { shouldBreak: !0 }), ", ", ...D, ")"], l()]);
|
|
2671
|
+
}
|
|
2672
|
+
if (cl(u, i, t)) {
|
|
2673
|
+
let D = i.slice(0, -1);
|
|
2674
|
+
if (D.some(ne))
|
|
2675
|
+
return l();
|
|
2676
|
+
let c;
|
|
2677
|
+
try {
|
|
2678
|
+
c = n(gr(r, -1), { expandLastArg: !0 });
|
|
2679
|
+
} catch (p) {
|
|
2680
|
+
if (p instanceof Qt)
|
|
2681
|
+
return l();
|
|
2682
|
+
throw p;
|
|
2683
|
+
}
|
|
2684
|
+
return ne(c) ? [ve, Ve([["(", ...D, m(c, { shouldBreak: !0 }), ")"], l()])] : Ve([["(", ...D, c, ")"], ["(", ...D, m(c, { shouldBreak: !0 }), ")"], l()]);
|
|
2685
|
+
}
|
|
2686
|
+
let d = ["(", A([E, ...i]), w(s), E, ")"];
|
|
2687
|
+
return iu(e) ? d : m(d, { shouldBreak: i.some(ne) || o });
|
|
2688
|
+
}
|
|
2689
|
+
function Bt(e, t = !1) {
|
|
2690
|
+
return Ae(e) && (e.properties.length > 0 || h(e)) || Q(e) && (e.elements.length > 0 || h(e)) || e.type === "TSTypeAssertion" && Bt(e.expression) || Ce(e) && Bt(e.expression) || e.type === "FunctionExpression" || e.type === "ArrowFunctionExpression" && (!e.returnType || !e.returnType.typeAnnotation || e.returnType.typeAnnotation.type !== "TSTypeReference" || dl(e.body)) && (e.body.type === "BlockStatement" || e.body.type === "ArrowFunctionExpression" && Bt(e.body, !0) || Ae(e.body) || Q(e.body) || !t && (L(e.body) || e.body.type === "ConditionalExpression") || K(e.body)) || e.type === "DoExpression" || e.type === "ModuleExpression";
|
|
2691
|
+
}
|
|
2692
|
+
function cl(e, t, n) {
|
|
2693
|
+
var r, u;
|
|
2694
|
+
let a = X(!1, e, -1);
|
|
2695
|
+
if (e.length === 1) {
|
|
2696
|
+
let i = X(!1, t, -1);
|
|
2697
|
+
if ((r = i.label) != null && r.embed && ((u = i.label) == null ? void 0 : u.hug) !== !1)
|
|
2698
|
+
return !0;
|
|
2699
|
+
}
|
|
2700
|
+
let o = X(!1, e, -2);
|
|
2701
|
+
return !h(a, T.Leading) && !h(a, T.Trailing) && Bt(a) && (!o || o.type !== a.type) && (e.length !== 2 || o.type !== "ArrowFunctionExpression" || !Q(a)) && !(e.length > 1 && Ea(a, n));
|
|
2702
|
+
}
|
|
2703
|
+
function Dl(e) {
|
|
2704
|
+
if (e.length !== 2)
|
|
2705
|
+
return !1;
|
|
2706
|
+
let [t, n] = e;
|
|
2707
|
+
return t.type === "ModuleExpression" && ml(n) ? !0 : !h(t) && (t.type === "FunctionExpression" || t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement") && n.type !== "FunctionExpression" && n.type !== "ArrowFunctionExpression" && n.type !== "ConditionalExpression" && Gu(n) && !Bt(n);
|
|
2708
|
+
}
|
|
2709
|
+
function Gu(e) {
|
|
2710
|
+
if (e.type === "ParenthesizedExpression")
|
|
2711
|
+
return Gu(e.expression);
|
|
2712
|
+
if (Ce(e) || e.type === "TypeCastExpression") {
|
|
2713
|
+
let { typeAnnotation: t } = e;
|
|
2714
|
+
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") {
|
|
2715
|
+
let n = t.typeArguments ?? t.typeParameters;
|
|
2716
|
+
(n == null ? void 0 : n.params.length) === 1 && (t = n.params[0]);
|
|
2717
|
+
}
|
|
2718
|
+
return Gn(t) && Ee(e.expression, 1);
|
|
2719
|
+
}
|
|
2720
|
+
return dt(e) && de(e).length > 1 ? !1 : ke(e) ? Ee(e.left, 1) && Ee(e.right, 1) : tu(e) || Ee(e);
|
|
2721
|
+
}
|
|
2722
|
+
function yl(e) {
|
|
2723
|
+
return e.length === 2 ? Ir(e, 0) : e.length === 3 ? e[0].type === "Identifier" && Ir(e, 1) : !1;
|
|
2724
|
+
}
|
|
2725
|
+
function Ir(e, t) {
|
|
2726
|
+
let n = e[t], r = e[t + 1];
|
|
2727
|
+
return n.type === "ArrowFunctionExpression" && Z(n).length === 0 && n.body.type === "BlockStatement" && r.type === "ArrayExpression" && !e.some((u) => h(u));
|
|
2728
|
+
}
|
|
2729
|
+
function dl(e) {
|
|
2730
|
+
return e.type === "BlockStatement" && (e.body.some((t) => t.type !== "EmptyStatement") || h(e, T.Dangling));
|
|
2731
|
+
}
|
|
2732
|
+
function ml(e) {
|
|
2733
|
+
if (!(e.type === "ObjectExpression" && e.properties.length === 1))
|
|
2734
|
+
return !1;
|
|
2735
|
+
let [t] = e.properties;
|
|
2736
|
+
return je(t) ? !t.computed && (t.key.type === "Identifier" && t.key.name === "type" || Y(t.key) && t.key.value === "type") && Y(t.value) && t.value.value === "module" : !1;
|
|
2737
|
+
}
|
|
2738
|
+
var Yt = ll, fl = (e) => ((e.type === "ChainExpression" || e.type === "TSNonNullExpression") && (e = e.expression), L(e) && de(e).length > 0);
|
|
2739
|
+
function El(e, t, n) {
|
|
2740
|
+
var r;
|
|
2741
|
+
let u = n("object"), a = Vu(e, t, n), { node: o } = e, i = e.findAncestor((d) => !(W(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" && !W(s) || (s.type === "AssignmentExpression" || s.type === "VariableDeclarator") && (fl(o.object) || ((r = u.label) == null ? void 0 : r.memberChain));
|
|
2742
|
+
return jt(u.label, [u, l ? a : m(A([E, a]))]);
|
|
2743
|
+
}
|
|
2744
|
+
function Vu(e, t, n) {
|
|
2745
|
+
let r = n("property"), { node: u } = e, a = re(e);
|
|
2746
|
+
return u.computed ? !u.property || be(u.property) ? [a, "[", r, "]"] : m([a, "[", A([E, r]), E, "]"]) : [a, ".", r];
|
|
2747
|
+
}
|
|
2748
|
+
function Ku(e, t, n) {
|
|
2749
|
+
if (e.node.type === "ChainExpression")
|
|
2750
|
+
return e.call(() => Ku(e, t, n), "expression");
|
|
2751
|
+
let r = (e.parent.type === "ChainExpression" ? e.grandparent : e.parent).type === "ExpressionStatement", u = [];
|
|
2752
|
+
function a(P) {
|
|
2753
|
+
let { originalText: V } = t, ue = Ft(V, I(P));
|
|
2754
|
+
return V.charAt(ue) === ")" ? ue !== !1 && $n(V, ue + 1) : Ne(P, t);
|
|
2755
|
+
}
|
|
2756
|
+
function o() {
|
|
2757
|
+
let { node: P } = e;
|
|
2758
|
+
if (P.type === "ChainExpression")
|
|
2759
|
+
return e.call(o, "expression");
|
|
2760
|
+
if (L(P) && (st(P.callee) || L(P.callee))) {
|
|
2761
|
+
let V = a(P);
|
|
2762
|
+
u.unshift({ node: P, hasTrailingEmptyLine: V, printed: [Fe(e, [re(e), ze(e, t, n), Yt(e, t, n)], t), V ? F : ""] }), e.call(o, "callee");
|
|
2763
|
+
} else
|
|
2764
|
+
st(P) ? (u.unshift({ node: P, needsParens: ut(e, t), printed: Fe(e, W(P) ? Vu(e, t, n) : ma(e, t, n), t) }), e.call(o, "object")) : P.type === "TSNonNullExpression" ? (u.unshift({ node: P, printed: Fe(e, "!", t) }), e.call(o, "expression")) : u.unshift({ node: P, printed: n() });
|
|
2765
|
+
}
|
|
2766
|
+
let { node: i } = e;
|
|
2767
|
+
u.unshift({ node: i, printed: [re(e), ze(e, t, n), Yt(e, t, n)] }), i.callee && e.call(o, "callee");
|
|
2768
|
+
let s = [], l = [u[0]], d = 1;
|
|
2769
|
+
for (; d < u.length && (u[d].node.type === "TSNonNullExpression" || L(u[d].node) || W(u[d].node) && u[d].node.computed && be(u[d].node.property)); ++d)
|
|
2770
|
+
l.push(u[d]);
|
|
2771
|
+
if (!L(u[0].node))
|
|
2772
|
+
for (; d + 1 < u.length && st(u[d].node) && st(u[d + 1].node); ++d)
|
|
2773
|
+
l.push(u[d]);
|
|
2774
|
+
s.push(l), l = [];
|
|
2775
|
+
let D = !1;
|
|
2776
|
+
for (; d < u.length; ++d) {
|
|
2777
|
+
if (D && st(u[d].node)) {
|
|
2778
|
+
if (u[d].node.computed && be(u[d].node.property)) {
|
|
2779
|
+
l.push(u[d]);
|
|
2780
|
+
continue;
|
|
2781
|
+
}
|
|
2782
|
+
s.push(l), l = [], D = !1;
|
|
2783
|
+
}
|
|
2784
|
+
(L(u[d].node) || u[d].node.type === "ImportExpression") && (D = !0), l.push(u[d]), h(u[d].node, T.Trailing) && (s.push(l), l = [], D = !1);
|
|
2785
|
+
}
|
|
2786
|
+
l.length > 0 && s.push(l);
|
|
2787
|
+
function c(P) {
|
|
2788
|
+
return /^[A-Z]|^[$_]+$/u.test(P);
|
|
2789
|
+
}
|
|
2790
|
+
function p(P) {
|
|
2791
|
+
return P.length <= t.tabWidth;
|
|
2792
|
+
}
|
|
2793
|
+
function y(P) {
|
|
2794
|
+
var V;
|
|
2795
|
+
let ue = (V = P[1][0]) == null ? void 0 : V.node.computed;
|
|
2796
|
+
if (P[0].length === 1) {
|
|
2797
|
+
let xe = P[0][0].node;
|
|
2798
|
+
return xe.type === "ThisExpression" || xe.type === "Identifier" && (c(xe.name) || r && p(xe.name) || ue);
|
|
2799
|
+
}
|
|
2800
|
+
let ot = X(!1, P[0], -1).node;
|
|
2801
|
+
return W(ot) && ot.property.type === "Identifier" && (c(ot.property.name) || ue);
|
|
2802
|
+
}
|
|
2803
|
+
let f = s.length >= 2 && !h(s[1][0].node) && y(s);
|
|
2804
|
+
function g(P) {
|
|
2805
|
+
let V = P.map((ue) => ue.printed);
|
|
2806
|
+
return P.length > 0 && X(!1, P, -1).needsParens ? ["(", ...V, ")"] : V;
|
|
2807
|
+
}
|
|
2808
|
+
function S(P) {
|
|
2809
|
+
return P.length === 0 ? "" : A([F, N(F, P.map(g))]);
|
|
2810
|
+
}
|
|
2811
|
+
let b = s.map(g), x = b, j = f ? 3 : 2, v = s.flat(), B = v.slice(1, -1).some((P) => h(P.node, T.Leading)) || v.slice(0, -1).some((P) => h(P.node, T.Trailing)) || s[j] && h(s[j][0].node, T.Leading);
|
|
2812
|
+
if (s.length <= j && !B && !s.some((P) => X(!1, P, -1).hasTrailingEmptyLine))
|
|
2813
|
+
return iu(e) ? x : m(x);
|
|
2814
|
+
let M = X(!1, s[f ? 1 : 0], -1).node, k = !L(M) && a(M), O = [g(s[0]), f ? s.slice(1, 2).map(g) : "", k ? F : "", S(s.slice(f ? 2 : 1))], G = u.map(({ node: P }) => P).filter(L);
|
|
2815
|
+
function U() {
|
|
2816
|
+
let P = X(!1, X(!1, s, -1), -1).node, V = X(!1, b, -1);
|
|
2817
|
+
return L(P) && ne(V) && G.slice(0, -1).some((ue) => ue.arguments.some(kt));
|
|
2818
|
+
}
|
|
2819
|
+
let Oe;
|
|
2820
|
+
return B || G.length > 2 && G.some((P) => !P.arguments.every((V) => Ee(V))) || b.slice(0, -1).some(ne) || U() ? Oe = m(O) : Oe = [ne(x) || k ? ve : "", Ve([x, O])], jt({ memberChain: !0 }, Oe);
|
|
2821
|
+
}
|
|
2822
|
+
var Fl = Ku;
|
|
2823
|
+
function Hu(e, t, n) {
|
|
2824
|
+
var r;
|
|
2825
|
+
let { node: u } = e, a = u.type === "NewExpression", o = u.type === "ImportExpression", i = re(e), s = de(u), l = s.length === 1 && au(s[0], t.originalText);
|
|
2826
|
+
if (l || Al(e) || rn(u, e.parent)) {
|
|
2827
|
+
let D = [];
|
|
2828
|
+
if (Ht(e, () => {
|
|
2829
|
+
D.push(n());
|
|
2830
|
+
}), !(l && (r = D[0].label) != null && r.embed))
|
|
2831
|
+
return [a ? "new " : "", Nr(e, n), i, ze(e, t, n), "(", N(", ", D), ")"];
|
|
2832
|
+
}
|
|
2833
|
+
if (!o && !a && st(u.callee) && !e.call((D) => ut(D, t), "callee", ...u.callee.type === "ChainExpression" ? ["expression"] : []))
|
|
2834
|
+
return Fl(e, t, n);
|
|
2835
|
+
let d = [a ? "new " : "", Nr(e, n), i, ze(e, t, n), Yt(e, t, n)];
|
|
2836
|
+
return o || L(u.callee) ? m(d) : d;
|
|
2837
|
+
}
|
|
2838
|
+
function Nr(e, t) {
|
|
2839
|
+
let { node: n } = e;
|
|
2840
|
+
return n.type === "ImportExpression" ? `import${n.phase ? `.${n.phase}` : ""}` : t("callee");
|
|
2841
|
+
}
|
|
2842
|
+
function Al(e) {
|
|
2843
|
+
let { node: t } = e;
|
|
2844
|
+
if (t.type !== "CallExpression" || t.optional || t.callee.type !== "Identifier")
|
|
2845
|
+
return !1;
|
|
2846
|
+
let n = de(t);
|
|
2847
|
+
return t.callee.name === "require" ? n.length === 1 && Y(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 && Y(n[0]) && n[1].type === "ArrayExpression" : !1;
|
|
2848
|
+
}
|
|
2849
|
+
function Lt(e, t, n, r, u, a) {
|
|
2850
|
+
let o = hl(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 }), we, 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 gl(e, t, n) {
|
|
2873
|
+
let { node: r } = e;
|
|
2874
|
+
return Lt(e, t, n, n("left"), [" ", r.operator], "right");
|
|
2875
|
+
}
|
|
2876
|
+
function xl(e, t, n) {
|
|
2877
|
+
return Lt(e, t, n, n("id"), " =", "init");
|
|
2878
|
+
}
|
|
2879
|
+
function hl(e, t, n, r, u) {
|
|
2880
|
+
let { node: a } = e, o = a[u];
|
|
2881
|
+
if (!o)
|
|
2882
|
+
return "only-left";
|
|
2883
|
+
let i = !Gt(o);
|
|
2884
|
+
if (e.match(Gt, zu, (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 && Gt(o.right) || Te(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 = bi(r);
|
|
2891
|
+
if (Tl(a) || vl(a) || Qu(a) && s)
|
|
2892
|
+
return "break-lhs";
|
|
2893
|
+
let l = Pl(a, r, t);
|
|
2894
|
+
return e.call(() => Cl(e, t, n, l), u) ? "break-after-operator" : Sl(a) ? "break-lhs" : !s && (l || o.type === "TemplateLiteral" || o.type === "TaggedTemplateExpression" || Yo(o) || be(o) || o.type === "ClassExpression") ? "never-break-after-operator" : "fluid";
|
|
2895
|
+
}
|
|
2896
|
+
function Cl(e, t, n, r) {
|
|
2897
|
+
let u = e.node;
|
|
2898
|
+
if (ke(u) && !It(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 && !Nl(u))
|
|
2907
|
+
break;
|
|
2908
|
+
return !0;
|
|
2909
|
+
case "ConditionalExpression": {
|
|
2910
|
+
if (!t.experimentalTernaries) {
|
|
2911
|
+
let { test: l } = u;
|
|
2912
|
+
return ke(l) && !It(l);
|
|
2913
|
+
}
|
|
2914
|
+
let { consequent: i, alternate: s } = u;
|
|
2915
|
+
return i.type === "ConditionalExpression" || s.type === "ConditionalExpression";
|
|
2916
|
+
}
|
|
2917
|
+
case "ClassExpression":
|
|
2918
|
+
return J(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 !!(Y(a) || e.call(() => Yu(e, t, n), ...o));
|
|
2931
|
+
}
|
|
2932
|
+
function Tl(e) {
|
|
2933
|
+
if (zu(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 je(n) && (!n.shorthand || ((r = n.value) == null ? void 0 : r.type) === "AssignmentPattern");
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2940
|
+
return !1;
|
|
2941
|
+
}
|
|
2942
|
+
function Gt(e) {
|
|
2943
|
+
return e.type === "AssignmentExpression";
|
|
2944
|
+
}
|
|
2945
|
+
function zu(e) {
|
|
2946
|
+
return Gt(e) || e.type === "VariableDeclarator";
|
|
2947
|
+
}
|
|
2948
|
+
function Sl(e) {
|
|
2949
|
+
let t = Bl(e);
|
|
2950
|
+
if (J(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 bl = _(["TSTypeAliasDeclaration", "TypeAlias"]);
|
|
2958
|
+
function Bl(e) {
|
|
2959
|
+
var t;
|
|
2960
|
+
if (bl(e))
|
|
2961
|
+
return (t = e.typeParameters) == null ? void 0 : t.params;
|
|
2962
|
+
}
|
|
2963
|
+
function vl(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 = jr(t.typeAnnotation);
|
|
2970
|
+
return J(n) && n.length > 1 && n.some((r) => J(jr(r)) || r.type === "TSConditionalType");
|
|
2971
|
+
}
|
|
2972
|
+
function Qu(e) {
|
|
2973
|
+
var t;
|
|
2974
|
+
return e.type === "VariableDeclarator" && ((t = e.init) == null ? void 0 : t.type) === "ArrowFunctionExpression";
|
|
2975
|
+
}
|
|
2976
|
+
var kl = _(["TSTypeReference", "GenericTypeAnnotation"]);
|
|
2977
|
+
function jr(e) {
|
|
2978
|
+
var t;
|
|
2979
|
+
if (kl(e))
|
|
2980
|
+
return (t = e.typeArguments ?? e.typeParameters) == null ? void 0 : t.params;
|
|
2981
|
+
}
|
|
2982
|
+
function Yu(e, t, n, r = !1) {
|
|
2983
|
+
var u;
|
|
2984
|
+
let { node: a } = e, o = () => Yu(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 = Hu(e, t, n).label) != null && u.memberChain)
|
|
2989
|
+
return !1;
|
|
2990
|
+
let i = de(a);
|
|
2991
|
+
return !(i.length === 0 || i.length === 1 && Vn(i[0], t)) || wl(a, n) ? !1 : e.call(o, "callee");
|
|
2992
|
+
}
|
|
2993
|
+
return W(a) ? e.call(o, "object") : r && (a.type === "Identifier" || a.type === "ThisExpression");
|
|
2994
|
+
}
|
|
2995
|
+
function Pl(e, t, n) {
|
|
2996
|
+
return je(e) ? (t = Qn(t), typeof t == "string" && lt(t) < n.tabWidth + 3) : !1;
|
|
2997
|
+
}
|
|
2998
|
+
function wl(e, t) {
|
|
2999
|
+
let n = Il(e);
|
|
3000
|
+
if (J(n)) {
|
|
3001
|
+
if (n.length > 1)
|
|
3002
|
+
return !0;
|
|
3003
|
+
if (n.length === 1) {
|
|
3004
|
+
let u = n[0];
|
|
3005
|
+
if ($e(u) || Hn(u) || u.type === "TSTypeLiteral" || u.type === "ObjectTypeAnnotation")
|
|
3006
|
+
return !0;
|
|
3007
|
+
}
|
|
3008
|
+
let r = e.typeParameters ? "typeParameters" : "typeArguments";
|
|
3009
|
+
if (ne(t(r)))
|
|
3010
|
+
return !0;
|
|
3011
|
+
}
|
|
3012
|
+
return !1;
|
|
3013
|
+
}
|
|
3014
|
+
function Il(e) {
|
|
3015
|
+
var t;
|
|
3016
|
+
return (t = e.typeParameters ?? e.typeArguments) == null ? void 0 : t.params;
|
|
3017
|
+
}
|
|
3018
|
+
function Nl(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, t, n) : "";
|
|
3035
|
+
if (o.length === 0)
|
|
3036
|
+
return [i, "(", $(e, t, { filter: (p) => ge(t.originalText, I(p)) === ")" }), ")"];
|
|
3037
|
+
let { parent: s } = e, l = rn(s), d = Zu(a), D = [];
|
|
3038
|
+
if (yi(e, (p, y) => {
|
|
3039
|
+
let f = y === o.length - 1;
|
|
3040
|
+
f && a.rest && D.push("..."), D.push(n()), !f && (D.push(","), l || d ? D.push(" ") : Ne(o[y], t) ? D.push(F, F) : D.push(C));
|
|
3041
|
+
}), r && !Ll(e)) {
|
|
3042
|
+
if (ne(i) || ne(D))
|
|
3043
|
+
throw new Qt();
|
|
3044
|
+
return m([bn(i), "(", bn(D), ")"]);
|
|
3045
|
+
}
|
|
3046
|
+
let c = o.every((p) => !J(p.decorators));
|
|
3047
|
+
return d && c ? [i, "(", ...D, ")"] : l ? [i, "(", ...D, ")"] : (nu(s) || ti(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 && Gn(o[0].typeAnnotation) && !a.rest ? t.arrowParens === "always" || a.type === "HookTypeAnnotation" ? ["(", ...D, ")"] : D : [i, "(", A([E, ...D]), w(!Di(a) && Ie(t, "all") ? "," : ""), E, ")"];
|
|
3048
|
+
}
|
|
3049
|
+
function Zu(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") && Xe(n.typeAnnotation.typeAnnotation) || n.type === "FunctionTypeParam" && Xe(n.typeAnnotation) && n !== e.rest || n.type === "AssignmentPattern" && (n.left.type === "ObjectPattern" || n.left.type === "ArrayPattern") && (n.right.type === "Identifier" || Ae(n.right) && n.right.properties.length === 0 || Q(n.right) && n.right.elements.length === 0));
|
|
3057
|
+
}
|
|
3058
|
+
function jl(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 gt(e, t) {
|
|
3063
|
+
var n;
|
|
3064
|
+
let r = jl(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 && (Xe(r) || ne(t));
|
|
3078
|
+
}
|
|
3079
|
+
function Ll(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 Ml(e) {
|
|
3089
|
+
let t = Z(e);
|
|
3090
|
+
return t.length > 1 && t.some((n) => n.type === "TSParameterProperty");
|
|
3091
|
+
}
|
|
3092
|
+
var Ol = _(["VoidTypeAnnotation", "TSVoidKeyword", "NullLiteralTypeAnnotation", "TSNullKeyword"]), Jl = _(["ObjectTypeAnnotation", "TSTypeLiteral", "GenericTypeAnnotation", "TSTypeReference"]);
|
|
3093
|
+
function ql(e) {
|
|
3094
|
+
let { types: t } = e;
|
|
3095
|
+
if (t.some((r) => h(r)))
|
|
3096
|
+
return !1;
|
|
3097
|
+
let n = t.find((r) => Jl(r));
|
|
3098
|
+
return n ? t.every((r) => r === n || Ol(r)) : !1;
|
|
3099
|
+
}
|
|
3100
|
+
function ea(e) {
|
|
3101
|
+
return Gn(e) || Xe(e) ? !0 : $e(e) ? ql(e) : !1;
|
|
3102
|
+
}
|
|
3103
|
+
function _l(e, t, n) {
|
|
3104
|
+
let r = t.semi ? ";" : "", { node: u } = e, a = [ie(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 ta(e, t, n) {
|
|
3108
|
+
let r = t.semi ? ";" : "", { node: u } = e, a = [ie(e)];
|
|
3109
|
+
a.push("type ", n("id"), n("typeParameters"));
|
|
3110
|
+
let o = u.type === "TSTypeAliasDeclaration" ? "typeAnnotation" : "right";
|
|
3111
|
+
return [Lt(e, t, n, a, " =", o), r];
|
|
3112
|
+
}
|
|
3113
|
+
function na(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 = Xe(o), d = Xe(a);
|
|
3120
|
+
return d && l ? [" & ", r ? A(s) : s] : !d && !l || Te(t.originalText, o) ? t.experimentalOperatorPosition === "start" ? A([C, "& ", s]) : A([" &", C, s]) : (i > 1 && (r = !0), [" & ", i > 1 ? A(s) : s]);
|
|
3121
|
+
}, "types"));
|
|
3122
|
+
}
|
|
3123
|
+
function ra(e, t, n) {
|
|
3124
|
+
let { node: r } = e, { parent: u } = e, a = u.type !== "TypeParameterInstantiation" && (!We(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") && Te(t.originalText, r)), o = ea(r), i = e.map((d) => {
|
|
3125
|
+
let D = n();
|
|
3126
|
+
return o || (D = Be(2, D)), Fe(d, D, t);
|
|
3127
|
+
}, "types");
|
|
3128
|
+
if (o)
|
|
3129
|
+
return N(" | ", i);
|
|
3130
|
+
let s = a && !Te(t.originalText, r), l = [w([s ? C : "", "| "]), N([C, "| "], i)];
|
|
3131
|
+
return ut(e, t) ? m([A(l), E]) : (u.type === "TupleTypeAnnotation" || u.type === "TSTupleType") && u[u.type === "TupleTypeAnnotation" && u.types ? "types" : "elementTypes"].length > 1 ? m([A([w(["(", E]), l]), E, w(")")]) : m(a ? A(l) : l);
|
|
3132
|
+
}
|
|
3133
|
+
function Xl(e) {
|
|
3134
|
+
var t;
|
|
3135
|
+
let { node: n, parent: r } = e;
|
|
3136
|
+
return n.type === "FunctionTypeAnnotation" && (nu(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 ua(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, t, n, !1, !0), o = [];
|
|
3142
|
+
return r.type === "FunctionTypeAnnotation" ? o.push(Xl(e) ? " => " : ": ", n("returnType")) : o.push(z(e, n, r.returnType ? "returnType" : "typeAnnotation")), gt(r, o) && (a = m(a)), u.push(a, o), m(u);
|
|
3143
|
+
}
|
|
3144
|
+
function aa(e, t, n) {
|
|
3145
|
+
return [n("objectType"), re(e), "[", n("indexType"), "]"];
|
|
3146
|
+
}
|
|
3147
|
+
function oa(e, t, n) {
|
|
3148
|
+
return ["infer ", n("typeParameter")];
|
|
3149
|
+
}
|
|
3150
|
+
function Lr(e, t, n) {
|
|
3151
|
+
let { node: r } = e;
|
|
3152
|
+
return [r.postfix ? "" : n, z(e, t), r.postfix ? n : ""];
|
|
3153
|
+
}
|
|
3154
|
+
function ia(e, t, n) {
|
|
3155
|
+
let { node: r } = e;
|
|
3156
|
+
return ["...", ...r.type === "TupleTypeSpreadElement" && r.label ? [n("label"), ": "] : [], n("typeAnnotation")];
|
|
3157
|
+
}
|
|
3158
|
+
function sa(e, t, n) {
|
|
3159
|
+
let { node: r } = e;
|
|
3160
|
+
return [r.variance ? n("variance") : "", n("label"), r.optional ? "?" : "", ": ", n("elementType")];
|
|
3161
|
+
}
|
|
3162
|
+
var $l = /* @__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(pa, n);
|
|
3170
|
+
(a === "=>" || a === ":" && h(r, T.Leading)) && (u = !0), $l.add(r);
|
|
3171
|
+
}
|
|
3172
|
+
return u ? [" ", t(n)] : t(n);
|
|
3173
|
+
}
|
|
3174
|
+
var pa = (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 la(e, t, n) {
|
|
3176
|
+
let r = pa(e);
|
|
3177
|
+
return r ? [r, " ", n("typeAnnotation")] : n("typeAnnotation");
|
|
3178
|
+
}
|
|
3179
|
+
function ca(e) {
|
|
3180
|
+
return [e("elementType"), "[]"];
|
|
3181
|
+
}
|
|
3182
|
+
function Da({ 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 ya(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 re(e) {
|
|
3191
|
+
let { node: t } = e;
|
|
3192
|
+
return !t.optional || t.type === "Identifier" && t === e.parent.key ? "" : L(t) || W(t) && t.computed || t.type === "OptionalIndexedAccessType" ? "?." : "?";
|
|
3193
|
+
}
|
|
3194
|
+
function da(e) {
|
|
3195
|
+
return e.node.definite || e.match(void 0, (t, n) => n === "id" && t.type === "VariableDeclarator" && t.definite) ? "!" : "";
|
|
3196
|
+
}
|
|
3197
|
+
var Wl = /* @__PURE__ */ new Set(["DeclareClass", "DeclareComponent", "DeclareFunction", "DeclareHook", "DeclareVariable", "DeclareExportDeclaration", "DeclareExportAllDeclaration", "DeclareOpaqueType", "DeclareTypeAlias", "DeclareEnum", "DeclareInterface"]);
|
|
3198
|
+
function ie(e) {
|
|
3199
|
+
let { node: t } = e;
|
|
3200
|
+
return t.declare || Wl.has(t.type) && e.parent.type !== "DeclareExportDeclaration" ? "declare " : "";
|
|
3201
|
+
}
|
|
3202
|
+
var Rl = /* @__PURE__ */ new Set(["TSAbstractMethodDefinition", "TSAbstractPropertyDefinition", "TSAbstractAccessorProperty"]);
|
|
3203
|
+
function on({ node: e }) {
|
|
3204
|
+
return e.abstract || Rl.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 ma(e, t, n) {
|
|
3211
|
+
return ["::", n("callee")];
|
|
3212
|
+
}
|
|
3213
|
+
function qe(e, t, n) {
|
|
3214
|
+
return e.type === "EmptyStatement" ? ";" : e.type === "BlockStatement" || n ? [" ", t] : A([C, t]);
|
|
3215
|
+
}
|
|
3216
|
+
function fa(e, t) {
|
|
3217
|
+
return ["...", t("argument"), z(e, t)];
|
|
3218
|
+
}
|
|
3219
|
+
function Zt(e) {
|
|
3220
|
+
return e.accessibility ? e.accessibility + " " : "";
|
|
3221
|
+
}
|
|
3222
|
+
function Ul(e, t, n, r) {
|
|
3223
|
+
let { node: u } = e, a = u.inexact ? "..." : "";
|
|
3224
|
+
return h(u, T.Dangling) ? m([n, a, $(e, t, { indent: !0 }), E, r]) : [n, a, r];
|
|
3225
|
+
}
|
|
3226
|
+
function ar(e, t, n) {
|
|
3227
|
+
let { node: r } = e, u = [], a = "[", 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(Ul(e, t, a, o));
|
|
3230
|
+
else {
|
|
3231
|
+
let l = X(!1, s, -1), d = (l == null ? void 0 : l.type) !== "RestElement" && !r.inexact, D = l === null, c = 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) && !Ae(g))
|
|
3234
|
+
return !1;
|
|
3235
|
+
let j = b[S + 1];
|
|
3236
|
+
if (j && x !== j.type)
|
|
3237
|
+
return !1;
|
|
3238
|
+
let v = Q(g) ? "elements" : "properties";
|
|
3239
|
+
return g[v] && g[v].length > 1;
|
|
3240
|
+
}), y = Ea(r, t), f = d ? D ? "," : Ie(t) ? y ? w(",", "", { groupId: c }) : w(",") : "" : "";
|
|
3241
|
+
u.push(m([a, A([E, y ? Vl(e, t, n, f) : [Gl(e, t, n, i, r.inexact), f], $(e, t)]), E, o], { shouldBreak: p, id: c }));
|
|
3242
|
+
}
|
|
3243
|
+
return u.push(re(e), z(e, n)), u;
|
|
3244
|
+
}
|
|
3245
|
+
function Ea(e, t) {
|
|
3246
|
+
return Q(e) && e.elements.length > 1 && e.elements.every((n) => n && (be(n) || eu(n) && !h(n.argument)) && !h(n, T.Trailing | T.Line, (r) => !pe(t.originalText, q(r), { backwards: !0 })));
|
|
3247
|
+
}
|
|
3248
|
+
function Fa({ node: e }, { originalText: t }) {
|
|
3249
|
+
let n = (u) => _n(t, Xn(t, u)), r = (u) => t[u] === "," ? u : r(n(u + 1));
|
|
3250
|
+
return $n(t, r(I(e)));
|
|
3251
|
+
}
|
|
3252
|
+
function Gl(e, t, n, r, u) {
|
|
3253
|
+
let a = [];
|
|
3254
|
+
return e.each(({ node: o, isLast: i }) => {
|
|
3255
|
+
a.push(o ? m(n()) : ""), (!i || u) && a.push([",", C, o && Fa(e, t) ? E : ""]);
|
|
3256
|
+
}, r), u && a.push("..."), a;
|
|
3257
|
+
}
|
|
3258
|
+
function Vl(e, t, n, r) {
|
|
3259
|
+
let u = [];
|
|
3260
|
+
return e.each(({ isLast: a, next: o }) => {
|
|
3261
|
+
u.push([n(), a ? r : ","]), a || u.push(Fa(e, t) ? [F, F] : h(o, T.Leading | T.Line) ? F : C);
|
|
3262
|
+
}, "elements"), yu(u);
|
|
3263
|
+
}
|
|
3264
|
+
var Kl = /^[\$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]*$/, Hl = (e) => Kl.test(e), zl = Hl;
|
|
3265
|
+
function Ql(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 mt = Ql, Vt = /* @__PURE__ */ new WeakMap();
|
|
3269
|
+
function Aa(e) {
|
|
3270
|
+
return /^(?:\d+|\d+\.\d+)$/u.test(e);
|
|
3271
|
+
}
|
|
3272
|
+
function Mr(e, t) {
|
|
3273
|
+
return t.parser === "json" || t.parser === "jsonc" || !Y(e.key) || yt(oe(e.key), t).slice(1, -1) !== e.key.value ? !1 : !!(zl(e.key.value) && !(t.parser === "babel-ts" && e.type === "ClassProperty" || (t.parser === "typescript" || t.parser === "oxc-ts") && e.type === "PropertyDefinition") || Aa(e.key.value) && String(Number(e.key.value)) === e.key.value && e.type !== "ImportAttribute" && (t.parser === "babel" || t.parser === "acorn" || t.parser === "oxc" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree"));
|
|
3274
|
+
}
|
|
3275
|
+
function Yl(e, t) {
|
|
3276
|
+
let { key: n } = e.node;
|
|
3277
|
+
return (n.type === "Identifier" || be(n) && Aa(mt(oe(n))) && String(n.value) === mt(oe(n)) && !(t.parser === "typescript" || t.parser === "babel-ts" || t.parser === "oxc-ts")) && (t.parser === "json" || t.parser === "jsonc" || t.quoteProps === "consistent" && Vt.get(e.parent));
|
|
3278
|
+
}
|
|
3279
|
+
function Mt(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" && !Vt.has(u)) {
|
|
3285
|
+
let o = e.siblings.some((i) => !i.computed && Y(i.key) && !Mr(i, t));
|
|
3286
|
+
Vt.set(u, o);
|
|
3287
|
+
}
|
|
3288
|
+
if (Yl(e, t)) {
|
|
3289
|
+
let o = yt(JSON.stringify(a.type === "Identifier" ? a.name : a.value.toString()), t);
|
|
3290
|
+
return e.call((i) => Fe(i, o, t), "key");
|
|
3291
|
+
}
|
|
3292
|
+
return Mr(r, t) && (t.quoteProps === "as-needed" || t.quoteProps === "consistent" && !Vt.get(u)) ? e.call((o) => Fe(o, /^\d/u.test(a.value) ? mt(a.value) : a.value, t), "key") : n("key");
|
|
3293
|
+
}
|
|
3294
|
+
function An(e, t, n) {
|
|
3295
|
+
let { node: r } = e;
|
|
3296
|
+
return r.shorthand ? n("value") : Lt(e, t, n, Mt(e, t, n), ":", "value");
|
|
3297
|
+
}
|
|
3298
|
+
var Zl = ({ 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 ga(e, t, n, r) {
|
|
3300
|
+
if (Zl(e))
|
|
3301
|
+
return or(e, t, n);
|
|
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) && (de(d).length > 1 || Z(u).every((D) => D.type === "Identifier" && !D.typeAnnotation)) && (a = !0);
|
|
3306
|
+
}
|
|
3307
|
+
let o = [ie(e), u.async ? "async " : "", `function${u.generator ? "*" : ""} `, u.id ? n("id") : ""], i = at(e, t, n, a), s = sn(e, n), l = gt(u, s);
|
|
3308
|
+
return o.push(ze(e, t, n), m([l ? m(i) : i, s]), u.body ? " " : "", n("body")), t.semi && (u.declare || !u.body) && o.push(";"), o;
|
|
3309
|
+
}
|
|
3310
|
+
function Mn(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 ") : (Wn.ok(u === "get" || u === "set"), o.push(u, " ")), a.generator && o.push("*"), o.push(Mt(e, t, n), r.optional ? "?" : "", r === a ? or(e, t, n) : n("value")), o;
|
|
3313
|
+
}
|
|
3314
|
+
function or(e, t, n) {
|
|
3315
|
+
let { node: r } = e, u = at(e, t, n), a = sn(e, n), o = Ml(r), i = gt(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 ec(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 xa(e, t) {
|
|
3323
|
+
if (t.arrowParens === "always")
|
|
3324
|
+
return !1;
|
|
3325
|
+
if (t.arrowParens === "avoid") {
|
|
3326
|
+
let { node: n } = e;
|
|
3327
|
+
return ec(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 ha(e, t, n) {
|
|
3336
|
+
let { node: r } = e, u = t.semi ? ";" : "", a = [];
|
|
3337
|
+
if (r.argument) {
|
|
3338
|
+
let s = n("argument");
|
|
3339
|
+
rc(t, r.argument) ? s = ["(", A([F, s]), F, ")"] : (ke(r.argument) || t.experimentalTernaries && r.argument.type === "ConditionalExpression" && (r.argument.consequent.type === "ConditionalExpression" || r.argument.alternate.type === "ConditionalExpression")) && (s = m([w("("), A([E, s]), E, 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(" ", $(e, t)), i || a.push(u), a;
|
|
3343
|
+
}
|
|
3344
|
+
function tc(e, t, n) {
|
|
3345
|
+
return ["return", ha(e, t, n)];
|
|
3346
|
+
}
|
|
3347
|
+
function nc(e, t, n) {
|
|
3348
|
+
return ["throw", ha(e, t, n)];
|
|
3349
|
+
}
|
|
3350
|
+
function rc(e, t) {
|
|
3351
|
+
if (Te(e.originalText, t) || h(t, T.Leading, (n) => ce(e.originalText, q(n), I(n))) && !K(t))
|
|
3352
|
+
return !0;
|
|
3353
|
+
if (Rn(t)) {
|
|
3354
|
+
let n = t, r;
|
|
3355
|
+
for (; r = Ho(n); )
|
|
3356
|
+
if (n = r, Te(e.originalText, n))
|
|
3357
|
+
return !0;
|
|
3358
|
+
}
|
|
3359
|
+
return !1;
|
|
3360
|
+
}
|
|
3361
|
+
var gn = /* @__PURE__ */ new WeakMap();
|
|
3362
|
+
function Ca(e) {
|
|
3363
|
+
return gn.has(e) || gn.set(e, e.type === "ConditionalExpression" && !te(e, (t) => t.type === "ObjectExpression")), gn.get(e);
|
|
3364
|
+
}
|
|
3365
|
+
var uc = (e) => e.type === "SequenceExpression";
|
|
3366
|
+
function ac(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 = oc(e, t, n, r);
|
|
3370
|
+
if (u.length === 0)
|
|
3371
|
+
u.push(x);
|
|
3372
|
+
else {
|
|
3373
|
+
let { leading: j, trailing: v } = _u(e, t);
|
|
3374
|
+
u.push([j, x]), o.unshift(v);
|
|
3375
|
+
}
|
|
3376
|
+
s && (i || (i = b.returnType && Z(b).length > 0 || b.typeParameters || Z(b).some((j) => j.type !== "Identifier"))), !s || b.body.type !== "ArrowFunctionExpression" ? (a = n("body", r), l = b.body) : e.call(S, "body");
|
|
3377
|
+
})();
|
|
3378
|
+
let d = !Te(t.originalText, l) && (uc(l) || ic(l, a, t) || !i && Ca(l)), D = e.key === "callee" && dt(e.parent), c = Symbol("arrow-chain"), p = sc(e, r, { signatureDocs: u, shouldBreak: i }), y = !1, f = !1, g = !1;
|
|
3379
|
+
return s && (D || r.assignmentLayout) && (f = !0, g = !h(e.node, T.Leading & T.Line), y = r.assignmentLayout === "chain-tail-arrow-chain" || D && !d), a = pc(e, t, r, { bodyDoc: a, bodyComments: o, functionBody: l, shouldPutBodyOnSameLine: d }), m([m(f ? A([g ? E : "", p]) : p, { shouldBreak: y, id: c }), " =>", s ? an(a, { groupId: c }) : m(a), s && D ? w(E, "", { groupId: c }) : ""]);
|
|
3380
|
+
}
|
|
3381
|
+
function oc(e, t, n, r) {
|
|
3382
|
+
let { node: u } = e, a = [];
|
|
3383
|
+
if (u.async && a.push("async "), xa(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 (ne(s))
|
|
3389
|
+
throw new Qt();
|
|
3390
|
+
s = m(bn(s));
|
|
3391
|
+
}
|
|
3392
|
+
a.push(m([at(e, t, n, i, !0), s]));
|
|
3393
|
+
}
|
|
3394
|
+
let o = $(e, t, { filter(i) {
|
|
3395
|
+
let s = Ft(t.originalText, I(i));
|
|
3396
|
+
return s !== !1 && t.originalText.slice(s, s + 2) === "=>";
|
|
3397
|
+
} });
|
|
3398
|
+
return o && a.push(" ", o), a;
|
|
3399
|
+
}
|
|
3400
|
+
function ic(e, t, n) {
|
|
3401
|
+
var r, u;
|
|
3402
|
+
return Q(e) || Ae(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) || au(e, n.originalText));
|
|
3403
|
+
}
|
|
3404
|
+
function sc(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" && dt(u) || ke(u) ? m([n[0], " =>", A([C, N([" =>", C], n.slice(1))])], { shouldBreak: r }) : a === "callee" && dt(u) || t.assignmentLayout ? m(N([" =>", C], n), { shouldBreak: r }) : m(A(N([" =>", C], n)), { shouldBreak: r });
|
|
3409
|
+
}
|
|
3410
|
+
function pc(e, t, n, { bodyDoc: r, bodyComments: u, functionBody: a, shouldPutBodyOnSameLine: o }) {
|
|
3411
|
+
let { node: i, parent: s } = e, l = n.expandLastArg && Ie(t, "all") ? w(",") : "", d = (n.expandLastArg || s.type === "JSXExpressionContainer") && !h(i) ? E : "";
|
|
3412
|
+
return o && Ca(a) ? [" ", m([w("", "("), A([E, r]), w("", ")"), l, d]), u] : o ? [" ", r, u] : [A([C, r, u]), l, d];
|
|
3413
|
+
}
|
|
3414
|
+
var lc = (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
|
+
}, cc = lc;
|
|
3425
|
+
function On(e, t, n, r) {
|
|
3426
|
+
let { node: u } = e, a = [], o = cc(!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), Ne(i, t) && a.push(F)));
|
|
3429
|
+
}, r), a;
|
|
3430
|
+
}
|
|
3431
|
+
function Ta(e, t, n) {
|
|
3432
|
+
let r = Dc(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 Dc(e, t, n) {
|
|
3445
|
+
let { node: r } = e, u = J(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(On(e, t, n, "directives")), (a || o) && (i.push(F), Ne(X(!1, r.directives, -1), t) && i.push(F))), a && i.push(On(e, t, n, "body")), o && i.push($(e, t)), i;
|
|
3450
|
+
}
|
|
3451
|
+
function yc(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 Sa = yc, ir = Sa("typeParameters");
|
|
3458
|
+
function dc(e, t, n) {
|
|
3459
|
+
let { node: r } = e;
|
|
3460
|
+
return Z(r).length === 1 && r.type.startsWith("TS") && !r[n][0].constraint && e.parent.type === "ArrowFunctionExpression" && !(t.filepath && /\.ts$/u.test(t.filepath));
|
|
3461
|
+
}
|
|
3462
|
+
function vt(e, t, n, r) {
|
|
3463
|
+
let { node: u } = e;
|
|
3464
|
+
if (!u[r])
|
|
3465
|
+
return "";
|
|
3466
|
+
if (!Array.isArray(u[r]))
|
|
3467
|
+
return n(r);
|
|
3468
|
+
let a = rn(e.grandparent), o = e.match((s) => !(s[r].length === 1 && Xe(s[r][0])), void 0, (s, l) => l === "typeAnnotation", (s) => s.type === "Identifier", Qu);
|
|
3469
|
+
if (u[r].length === 0 || !o && (a || u[r].length === 1 && (u[r][0].type === "NullableTypeAnnotation" || ea(u[r][0]))))
|
|
3470
|
+
return ["<", N(", ", e.map(n, r)), mc(e, t), ">"];
|
|
3471
|
+
let i = u.type === "TSTypeParameterInstantiation" ? "" : dc(e, t, r) ? "," : Ie(t) ? w(",") : "";
|
|
3472
|
+
return m(["<", A([E, N([",", C], e.map(n, r))]), i, E, ">"], { id: ir(u) });
|
|
3473
|
+
}
|
|
3474
|
+
function mc(e, t) {
|
|
3475
|
+
let { node: n } = e;
|
|
3476
|
+
if (!h(n, T.Dangling))
|
|
3477
|
+
return "";
|
|
3478
|
+
let r = !h(n, T.Line), u = $(e, t, { indent: !r });
|
|
3479
|
+
return r ? u : [u, F];
|
|
3480
|
+
}
|
|
3481
|
+
function ba(e, t, n) {
|
|
3482
|
+
let { node: r } = e, u = [r.const ? "const " : ""], a = r.type === "TSTypeParameter" ? n("name") : r.name;
|
|
3483
|
+
if (r.variance && u.push(n("variance")), r.in && u.push("in "), r.out && u.push("out "), u.push(a), r.bound && (r.usesExtendsBound && u.push(" extends "), u.push(z(e, n, "bound"))), r.constraint) {
|
|
3484
|
+
let o = Symbol("constraint");
|
|
3485
|
+
u.push(" extends", m(A(C), { id: o }), we, an(n("constraint"), { groupId: o }));
|
|
3486
|
+
}
|
|
3487
|
+
return r.default && u.push(" = ", n("default")), m(u);
|
|
3488
|
+
}
|
|
3489
|
+
var Ba = _(["ClassProperty", "PropertyDefinition", "ClassPrivateProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractPropertyDefinition", "TSAbstractAccessorProperty"]);
|
|
3490
|
+
function va(e, t, n) {
|
|
3491
|
+
let { node: r } = e, u = [ie(e), on(e), "class"], a = h(r.id, T.Trailing) || h(r.typeParameters, T.Trailing) || h(r.superClass) || J(r.extends) || J(r.mixins) || J(r.implements), o = [], i = [];
|
|
3492
|
+
if (r.id && o.push(" ", n("id")), o.push(n("typeParameters")), r.superClass) {
|
|
3493
|
+
let d = [Fc(e, t, n), n(r.superTypeArguments ? "superTypeArguments" : "superTypeParameters")], D = e.call((c) => ["extends ", Fe(c, d, t)], "superClass");
|
|
3494
|
+
a ? i.push(C, m(D)) : i.push(" ", D);
|
|
3495
|
+
} else
|
|
3496
|
+
i.push(xn(e, t, n, "extends"));
|
|
3497
|
+
i.push(xn(e, t, n, "mixins"), xn(e, t, n, "implements"));
|
|
3498
|
+
let s;
|
|
3499
|
+
if (a) {
|
|
3500
|
+
let d;
|
|
3501
|
+
Pa(r) ? d = [...o, A(i)] : d = A([...o, i]), s = ka(r), u.push(m(d, { id: s }));
|
|
3502
|
+
} else
|
|
3503
|
+
u.push(...o, ...i);
|
|
3504
|
+
let l = r.body;
|
|
3505
|
+
return a && J(l.body) ? u.push(w(F, " ", { groupId: s })) : u.push(" "), u.push(n("body")), u;
|
|
3506
|
+
}
|
|
3507
|
+
var ka = Sa("heritageGroup");
|
|
3508
|
+
function fc(e) {
|
|
3509
|
+
return w(F, "", { groupId: ka(e) });
|
|
3510
|
+
}
|
|
3511
|
+
function Ec(e) {
|
|
3512
|
+
return ["extends", "mixins", "implements"].reduce((t, n) => t + (Array.isArray(e[n]) ? e[n].length : 0), e.superClass ? 1 : 0) > 1;
|
|
3513
|
+
}
|
|
3514
|
+
function Pa(e) {
|
|
3515
|
+
return e.typeParameters && !h(e.typeParameters, T.Trailing | T.Line) && !Ec(e);
|
|
3516
|
+
}
|
|
3517
|
+
function xn(e, t, n, r) {
|
|
3518
|
+
let { node: u } = e;
|
|
3519
|
+
if (!J(u[r]))
|
|
3520
|
+
return "";
|
|
3521
|
+
let a = $(e, t, { marker: r });
|
|
3522
|
+
return [Pa(u) ? w(" ", C, { groupId: ir(u.typeParameters) }) : C, a, a && F, r, m(A([C, N([",", C], e.map(n, r))]))];
|
|
3523
|
+
}
|
|
3524
|
+
function Fc(e, t, n) {
|
|
3525
|
+
let r = n("superClass"), { parent: u } = e;
|
|
3526
|
+
return u.type === "AssignmentExpression" ? m(w(["(", A([E, r]), E, ")"], r)) : r;
|
|
3527
|
+
}
|
|
3528
|
+
function wa(e, t, n) {
|
|
3529
|
+
let { node: r } = e, u = [];
|
|
3530
|
+
return J(r.decorators) && u.push(Wu(e, t, n)), u.push(Zt(r)), r.static && u.push("static "), u.push(on(e)), r.override && u.push("override "), u.push(Mn(e, t, n)), u;
|
|
3531
|
+
}
|
|
3532
|
+
function Ia(e, t, n) {
|
|
3533
|
+
let { node: r } = e, u = [], a = t.semi ? ";" : "";
|
|
3534
|
+
J(r.decorators) && u.push(Wu(e, t, n)), u.push(ie(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(Mt(e, t, n), re(e), da(e), z(e, n));
|
|
3535
|
+
let o = r.type === "TSAbstractPropertyDefinition" || r.type === "TSAbstractAccessorProperty";
|
|
3536
|
+
return [Lt(e, t, n, u, " =", o ? void 0 : "value"), a];
|
|
3537
|
+
}
|
|
3538
|
+
function Ac(e, t, n) {
|
|
3539
|
+
let { node: r } = e, u = [];
|
|
3540
|
+
return e.each(({ node: a, next: o, isLast: i }) => {
|
|
3541
|
+
u.push(n()), !t.semi && Ba(a) && gc(a, o) && u.push(";"), i || (u.push(F), Ne(a, t) && u.push(F));
|
|
3542
|
+
}, "body"), h(r, T.Dangling) && u.push($(e, t)), ["{", u.length > 0 ? [A([F, u]), F] : "", "}"];
|
|
3543
|
+
}
|
|
3544
|
+
function gc(e, t) {
|
|
3545
|
+
var n;
|
|
3546
|
+
let { type: r, name: u } = e.key;
|
|
3547
|
+
if (!e.computed && r === "Identifier" && (u === "static" || u === "get" || u === "set") && !e.value && !e.typeAnnotation)
|
|
3548
|
+
return !0;
|
|
3549
|
+
if (!t || t.static || t.accessibility || t.readonly)
|
|
3550
|
+
return !1;
|
|
3551
|
+
if (!t.computed) {
|
|
3552
|
+
let a = (n = t.key) == null ? void 0 : n.name;
|
|
3553
|
+
if (a === "in" || a === "instanceof")
|
|
3554
|
+
return !0;
|
|
3555
|
+
}
|
|
3556
|
+
if (Ba(t) && t.variance && !t.static && !t.declare)
|
|
3557
|
+
return !0;
|
|
3558
|
+
switch (t.type) {
|
|
3559
|
+
case "ClassProperty":
|
|
3560
|
+
case "PropertyDefinition":
|
|
3561
|
+
case "TSAbstractPropertyDefinition":
|
|
3562
|
+
return t.computed;
|
|
3563
|
+
case "MethodDefinition":
|
|
3564
|
+
case "TSAbstractMethodDefinition":
|
|
3565
|
+
case "ClassMethod":
|
|
3566
|
+
case "ClassPrivateMethod": {
|
|
3567
|
+
if ((t.value ? t.value.async : t.async) || t.kind === "get" || t.kind === "set")
|
|
3568
|
+
return !1;
|
|
3569
|
+
let a = t.value ? t.value.generator : t.generator;
|
|
3570
|
+
return !!(t.computed || a);
|
|
3571
|
+
}
|
|
3572
|
+
case "TSIndexSignature":
|
|
3573
|
+
return !0;
|
|
3574
|
+
}
|
|
3575
|
+
return !1;
|
|
3576
|
+
}
|
|
3577
|
+
var xc = _(["TSAsExpression", "TSTypeAssertion", "TSNonNullExpression", "TSInstantiationExpression", "TSSatisfiesExpression"]);
|
|
3578
|
+
function Na(e) {
|
|
3579
|
+
return xc(e) ? Na(e.expression) : e;
|
|
3580
|
+
}
|
|
3581
|
+
var hc = _(["FunctionExpression", "ArrowFunctionExpression"]);
|
|
3582
|
+
function Cc(e) {
|
|
3583
|
+
return e.type === "MemberExpression" || e.type === "OptionalMemberExpression" || e.type === "Identifier" && e.name !== "undefined";
|
|
3584
|
+
}
|
|
3585
|
+
function Tc(e, t) {
|
|
3586
|
+
if (t.semi || La(e, t) || Ma(e, t))
|
|
3587
|
+
return !1;
|
|
3588
|
+
let { node: n, key: r, parent: u } = e;
|
|
3589
|
+
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(() => ja(e, t), "expression"));
|
|
3590
|
+
}
|
|
3591
|
+
function ja(e, t) {
|
|
3592
|
+
let { node: n } = e;
|
|
3593
|
+
switch (n.type) {
|
|
3594
|
+
case "ParenthesizedExpression":
|
|
3595
|
+
case "TypeCastExpression":
|
|
3596
|
+
case "ArrayExpression":
|
|
3597
|
+
case "ArrayPattern":
|
|
3598
|
+
case "TemplateLiteral":
|
|
3599
|
+
case "TemplateElement":
|
|
3600
|
+
case "RegExpLiteral":
|
|
3601
|
+
return !0;
|
|
3602
|
+
case "ArrowFunctionExpression":
|
|
3603
|
+
if (!xa(e, t))
|
|
3604
|
+
return !0;
|
|
3605
|
+
break;
|
|
3606
|
+
case "UnaryExpression": {
|
|
3607
|
+
let { prefix: r, operator: u } = n;
|
|
3608
|
+
if (r && (u === "+" || u === "-"))
|
|
3609
|
+
return !0;
|
|
3610
|
+
break;
|
|
3611
|
+
}
|
|
3612
|
+
case "BindExpression":
|
|
3613
|
+
if (!n.object)
|
|
3614
|
+
return !0;
|
|
3615
|
+
break;
|
|
3616
|
+
case "Literal":
|
|
3617
|
+
if (n.regex)
|
|
3618
|
+
return !0;
|
|
3619
|
+
break;
|
|
3620
|
+
default:
|
|
3621
|
+
if (K(n))
|
|
3622
|
+
return !0;
|
|
3623
|
+
}
|
|
3624
|
+
return ut(e, t) ? !0 : Rn(n) ? e.call(() => ja(e, t), ...Zr(n)) : !1;
|
|
3625
|
+
}
|
|
3626
|
+
function La({ node: e, parent: t }, n) {
|
|
3627
|
+
return (n.parentParser === "markdown" || n.parentParser === "mdx") && e.type === "ExpressionStatement" && K(e.expression) && t.type === "Program" && t.body.length === 1;
|
|
3628
|
+
}
|
|
3629
|
+
function Ma({ node: e, parent: t }, n) {
|
|
3630
|
+
return (n.parser === "__vue_event_binding" || n.parser === "__vue_ts_event_binding") && e.type === "ExpressionStatement" && t.type === "Program" && t.body.length === 1;
|
|
3631
|
+
}
|
|
3632
|
+
function Sc(e, t, n) {
|
|
3633
|
+
let r = [n("expression")];
|
|
3634
|
+
if (Ma(e, t)) {
|
|
3635
|
+
let u = Na(e.node.expression);
|
|
3636
|
+
(hc(u) || Cc(u)) && r.push(";");
|
|
3637
|
+
} else
|
|
3638
|
+
La(e, t) || t.semi && r.push(";");
|
|
3639
|
+
return r;
|
|
3640
|
+
}
|
|
3641
|
+
function bc(e, t, n) {
|
|
3642
|
+
if (t.__isVueBindings || t.__isVueForBindingLeft) {
|
|
3643
|
+
let r = e.map(n, "program", "body", 0, "params");
|
|
3644
|
+
if (r.length === 1)
|
|
3645
|
+
return r[0];
|
|
3646
|
+
let u = N([",", C], r);
|
|
3647
|
+
return t.__isVueForBindingLeft ? ["(", A([E, m(u)]), E, ")"] : u;
|
|
3648
|
+
}
|
|
3649
|
+
if (t.__isEmbeddedTypescriptGenericParameters) {
|
|
3650
|
+
let r = e.map(n, "program", "body", 0, "typeParameters", "params");
|
|
3651
|
+
return N([",", C], r);
|
|
3652
|
+
}
|
|
3653
|
+
}
|
|
3654
|
+
function Bc(e, t) {
|
|
3655
|
+
let { node: n } = e;
|
|
3656
|
+
switch (n.type) {
|
|
3657
|
+
case "RegExpLiteral":
|
|
3658
|
+
return Or(n);
|
|
3659
|
+
case "BigIntLiteral":
|
|
3660
|
+
return Jn(n.extra.raw);
|
|
3661
|
+
case "NumericLiteral":
|
|
3662
|
+
return mt(n.extra.raw);
|
|
3663
|
+
case "StringLiteral":
|
|
3664
|
+
return He(yt(n.extra.raw, t));
|
|
3665
|
+
case "NullLiteral":
|
|
3666
|
+
return "null";
|
|
3667
|
+
case "BooleanLiteral":
|
|
3668
|
+
return String(n.value);
|
|
3669
|
+
case "DirectiveLiteral":
|
|
3670
|
+
return Jr(n.extra.raw, t);
|
|
3671
|
+
case "Literal": {
|
|
3672
|
+
if (n.regex)
|
|
3673
|
+
return Or(n.regex);
|
|
3674
|
+
if (n.bigint)
|
|
3675
|
+
return Jn(n.raw);
|
|
3676
|
+
let { value: r } = n;
|
|
3677
|
+
return typeof r == "number" ? mt(n.raw) : typeof r == "string" ? vc(e) ? Jr(n.raw, t) : He(yt(n.raw, t)) : String(r);
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
function vc(e) {
|
|
3682
|
+
if (e.key !== "expression")
|
|
3683
|
+
return;
|
|
3684
|
+
let { parent: t } = e;
|
|
3685
|
+
return t.type === "ExpressionStatement" && typeof t.directive == "string";
|
|
3686
|
+
}
|
|
3687
|
+
function Jn(e) {
|
|
3688
|
+
return e.toLowerCase();
|
|
3689
|
+
}
|
|
3690
|
+
function Or({ pattern: e, flags: t }) {
|
|
3691
|
+
return t = [...t].sort().join(""), `/${e}/${t}`;
|
|
3692
|
+
}
|
|
3693
|
+
function Jr(e, t) {
|
|
3694
|
+
let n = e.slice(1, -1);
|
|
3695
|
+
if (n.includes('"') || n.includes("'"))
|
|
3696
|
+
return e;
|
|
3697
|
+
let r = t.singleQuote ? "'" : '"';
|
|
3698
|
+
return r + n + r;
|
|
3699
|
+
}
|
|
3700
|
+
function kc(e, t, n) {
|
|
3701
|
+
let r = e.originalText.slice(t, n);
|
|
3702
|
+
for (let u of e[Symbol.for("comments")]) {
|
|
3703
|
+
let a = q(u);
|
|
3704
|
+
if (a > n)
|
|
3705
|
+
break;
|
|
3706
|
+
let o = I(u);
|
|
3707
|
+
if (o < t)
|
|
3708
|
+
continue;
|
|
3709
|
+
let i = o - a;
|
|
3710
|
+
r = r.slice(0, a - t) + " ".repeat(i) + r.slice(o - t);
|
|
3711
|
+
}
|
|
3712
|
+
return r;
|
|
3713
|
+
}
|
|
3714
|
+
var sr = kc;
|
|
3715
|
+
function Pc(e, t, n) {
|
|
3716
|
+
let { node: r } = e;
|
|
3717
|
+
return ["import", r.phase ? ` ${r.phase}` : "", qa(r), Xa(e, t, n), _a(e, t, n), Wa(e, t, n), t.semi ? ";" : ""];
|
|
3718
|
+
}
|
|
3719
|
+
var Oa = (e) => e.type === "ExportDefaultDeclaration" || e.type === "DeclareExportDeclaration" && e.default;
|
|
3720
|
+
function Ja(e, t, n) {
|
|
3721
|
+
let { node: r } = e, u = [sl(e, t, n), ie(e), "export", Oa(r) ? " default" : ""], { declaration: a, exported: o } = r;
|
|
3722
|
+
return h(r, T.Dangling) && (u.push(" ", $(e, t)), ou(r) && u.push(F)), a ? u.push(" ", n("declaration")) : (u.push(Nc(r)), r.type === "ExportAllDeclaration" || r.type === "DeclareExportAllDeclaration" ? (u.push(" *"), o && u.push(" as ", n("exported"))) : u.push(Xa(e, t, n)), u.push(_a(e, t, n), Wa(e, t, n))), u.push(Ic(r, t)), u;
|
|
3723
|
+
}
|
|
3724
|
+
var wc = _(["ClassDeclaration", "ComponentDeclaration", "FunctionDeclaration", "TSInterfaceDeclaration", "DeclareClass", "DeclareComponent", "DeclareFunction", "DeclareHook", "HookDeclaration", "TSDeclareFunction", "EnumDeclaration"]);
|
|
3725
|
+
function Ic(e, t) {
|
|
3726
|
+
return t.semi && (!e.declaration || Oa(e) && !wc(e.declaration)) ? ";" : "";
|
|
3727
|
+
}
|
|
3728
|
+
function pr(e, t = !0) {
|
|
3729
|
+
return e && e !== "value" ? `${t ? " " : ""}${e}${t ? "" : " "}` : "";
|
|
3730
|
+
}
|
|
3731
|
+
function qa(e, t) {
|
|
3732
|
+
return pr(e.importKind, t);
|
|
3733
|
+
}
|
|
3734
|
+
function Nc(e) {
|
|
3735
|
+
return pr(e.exportKind);
|
|
3736
|
+
}
|
|
3737
|
+
function _a(e, t, n) {
|
|
3738
|
+
let { node: r } = e;
|
|
3739
|
+
if (!r.source)
|
|
3740
|
+
return "";
|
|
3741
|
+
let u = [];
|
|
3742
|
+
return $a(r, t) && u.push(" from"), u.push(" ", n("source")), u;
|
|
3743
|
+
}
|
|
3744
|
+
function Xa(e, t, n) {
|
|
3745
|
+
let { node: r } = e;
|
|
3746
|
+
if (!$a(r, t))
|
|
3747
|
+
return "";
|
|
3748
|
+
let u = [" "];
|
|
3749
|
+
if (J(r.specifiers)) {
|
|
3750
|
+
let a = [], o = [];
|
|
3751
|
+
e.each(() => {
|
|
3752
|
+
let i = e.node.type;
|
|
3753
|
+
if (i === "ExportNamespaceSpecifier" || i === "ExportDefaultSpecifier" || i === "ImportNamespaceSpecifier" || i === "ImportDefaultSpecifier")
|
|
3754
|
+
a.push(n());
|
|
3755
|
+
else if (i === "ExportSpecifier" || i === "ImportSpecifier")
|
|
3756
|
+
o.push(n());
|
|
3757
|
+
else
|
|
3758
|
+
throw new At(r, "specifier");
|
|
3759
|
+
}, "specifiers"), u.push(N(", ", 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 : E, N([",", C], o)]), w(Ie(t) ? "," : ""), t.bracketSpacing ? C : E, "}"])) : u.push(["{", t.bracketSpacing ? " " : "", ...o, t.bracketSpacing ? " " : "", "}"]));
|
|
3760
|
+
} else
|
|
3761
|
+
u.push("{}");
|
|
3762
|
+
return u;
|
|
3763
|
+
}
|
|
3764
|
+
function $a(e, t) {
|
|
3765
|
+
return e.type !== "ImportDeclaration" || J(e.specifiers) || e.importKind === "type" ? !0 : sr(t, q(e), q(e.source)).trimEnd().endsWith("from");
|
|
3766
|
+
}
|
|
3767
|
+
function jc(e, t) {
|
|
3768
|
+
var n, r;
|
|
3769
|
+
if ((n = e.extra) != null && n.deprecatedAssertSyntax)
|
|
3770
|
+
return "assert";
|
|
3771
|
+
let u = sr(t, I(e.source), (r = e.attributes) != null && r[0] ? q(e.attributes[0]) : I(e)).trimStart();
|
|
3772
|
+
return u.startsWith("assert") ? "assert" : u.startsWith("with") || J(e.attributes) ? "with" : void 0;
|
|
3773
|
+
}
|
|
3774
|
+
function Wa(e, t, n) {
|
|
3775
|
+
let { node: r } = e;
|
|
3776
|
+
if (!r.source)
|
|
3777
|
+
return "";
|
|
3778
|
+
let u = jc(r, t);
|
|
3779
|
+
if (!u)
|
|
3780
|
+
return "";
|
|
3781
|
+
let a = [` ${u} {`];
|
|
3782
|
+
return J(r.attributes) && (t.bracketSpacing && a.push(" "), a.push(N(", ", e.map(n, "attributes"))), t.bracketSpacing && a.push(" ")), a.push("}"), a;
|
|
3783
|
+
}
|
|
3784
|
+
function Lc(e, t, n) {
|
|
3785
|
+
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 = "", D = "";
|
|
3786
|
+
return u === "ExportNamespaceSpecifier" || u === "ImportNamespaceSpecifier" ? d = "*" : s && (d = n(o)), l && !Mc(r) && (D = n(i)), [pr(u === "ImportSpecifier" ? r.importKind : r.exportKind, !1), d, d && D ? " as " : "", D];
|
|
3787
|
+
}
|
|
3788
|
+
function Mc(e) {
|
|
3789
|
+
if (e.type !== "ImportSpecifier" && e.type !== "ExportSpecifier")
|
|
3790
|
+
return !1;
|
|
3791
|
+
let { local: t, [e.type === "ImportSpecifier" ? "imported" : "exported"]: n } = e;
|
|
3792
|
+
if (t.type !== n.type || !jo(t, n))
|
|
3793
|
+
return !1;
|
|
3794
|
+
if (Y(t))
|
|
3795
|
+
return t.value === n.value && oe(t) === oe(n);
|
|
3796
|
+
switch (t.type) {
|
|
3797
|
+
case "Identifier":
|
|
3798
|
+
return t.name === n.name;
|
|
3799
|
+
default:
|
|
3800
|
+
return !1;
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3803
|
+
function pn(e, t, n) {
|
|
3804
|
+
var r;
|
|
3805
|
+
let u = t.semi ? ";" : "", { node: a } = e, o = a.type === "ObjectTypeAnnotation", i = a.type === "TSEnumBody" || 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"];
|
|
3806
|
+
o && s.push("indexers", "callProperties", "internalSlots");
|
|
3807
|
+
let l = s.flatMap((B) => e.map(({ node: M }) => ({ node: M, printed: n(), loc: q(M) }), B));
|
|
3808
|
+
s.length > 1 && l.sort((B, M) => B.loc - M.loc);
|
|
3809
|
+
let { parent: d, key: D } = e, c = o && D === "body" && (d.type === "InterfaceDeclaration" || d.type === "DeclareInterface" || d.type === "DeclareClass"), p = a.type === "TSInterfaceBody" || i || c || 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((B) => B.value && (B.value.type === "ObjectPattern" || B.value.type === "ArrayPattern")) || a.type !== "ObjectPattern" && t.objectWrap === "preserve" && l.length > 0 && ce(t.originalText, q(a), l[0].loc), y = c ? ";" : a.type === "TSInterfaceBody" || a.type === "TSTypeLiteral" ? w(u, ";") : ",", f = a.exact ? "{|" : "{", g = a.exact ? "|}" : "}", S = [], b = l.map((B) => {
|
|
3810
|
+
let M = [...S, m(B.printed)];
|
|
3811
|
+
return S = [y, C], (B.node.type === "TSPropertySignature" || B.node.type === "TSMethodSignature" || B.node.type === "TSConstructSignatureDeclaration" || B.node.type === "TSCallSignatureDeclaration") && h(B.node, T.PrettierIgnore) && S.shift(), Ne(B.node, t) && S.push(F), M;
|
|
3812
|
+
});
|
|
3813
|
+
if (a.inexact || a.hasUnknownMembers) {
|
|
3814
|
+
let B;
|
|
3815
|
+
if (h(a, T.Dangling)) {
|
|
3816
|
+
let M = h(a, T.Line);
|
|
3817
|
+
B = [$(e, t), M || pe(t.originalText, I(X(!1, Ke(a), -1))) ? F : C, "..."];
|
|
3818
|
+
} else
|
|
3819
|
+
B = ["..."];
|
|
3820
|
+
b.push([...S, ...B]);
|
|
3821
|
+
}
|
|
3822
|
+
let x = (r = X(!1, l, -1)) == null ? void 0 : r.node, j = !(a.inexact || a.hasUnknownMembers || x && (x.type === "RestElement" || (x.type === "TSPropertySignature" || x.type === "TSCallSignatureDeclaration" || x.type === "TSMethodSignature" || x.type === "TSConstructSignatureDeclaration" || x.type === "TSIndexSignature") && h(x, T.PrettierIgnore)) || e.match(void 0, (B, M) => B.type === "TSImportType" && M === "options")), v;
|
|
3823
|
+
if (b.length === 0) {
|
|
3824
|
+
if (!h(a, T.Dangling))
|
|
3825
|
+
return [f, g, z(e, n)];
|
|
3826
|
+
v = m([f, $(e, t, { indent: !0 }), E, g, re(e), z(e, n)]);
|
|
3827
|
+
} else
|
|
3828
|
+
v = [c && J(a.properties) ? fc(d) : "", f, A([t.bracketSpacing ? C : E, ...b]), w(j && (y !== "," || Ie(t)) ? y : ""), t.bracketSpacing ? C : E, g, re(e), z(e, n)];
|
|
3829
|
+
return e.match((B) => B.type === "ObjectPattern" && !J(B.decorators), hn) || Xe(a) && (e.match(void 0, (B, M) => M === "typeAnnotation", (B, M) => M === "typeAnnotation", hn) || e.match(void 0, (B, M) => B.type === "FunctionTypeParam" && M === "typeAnnotation", hn)) || !p && e.match((B) => B.type === "ObjectPattern", (B) => B.type === "AssignmentExpression" || B.type === "VariableDeclarator") ? v : m(v, { shouldBreak: p });
|
|
3830
|
+
}
|
|
3831
|
+
function hn(e, t) {
|
|
3832
|
+
return (t === "params" || t === "parameters" || t === "this" || t === "rest") && Zu(e);
|
|
3833
|
+
}
|
|
3834
|
+
function Oc(e) {
|
|
3835
|
+
let t = [e];
|
|
3836
|
+
for (let n = 0; n < t.length; n++) {
|
|
3837
|
+
let r = t[n];
|
|
3838
|
+
for (let u of ["test", "consequent", "alternate"]) {
|
|
3839
|
+
let a = r[u];
|
|
3840
|
+
if (K(a))
|
|
3841
|
+
return !0;
|
|
3842
|
+
a.type === "ConditionalExpression" && t.push(a);
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
return !1;
|
|
3846
|
+
}
|
|
3847
|
+
function Jc(e, t, n) {
|
|
3848
|
+
let { node: r } = e, u = r.type === "ConditionalExpression", a = u ? "alternate" : "falseType", { parent: o } = e, i = u ? n("test") : [n("checkType"), " ", "extends", " ", n("extendsType")];
|
|
3849
|
+
return o.type === r.type && o[a] === r ? Be(2, i) : i;
|
|
3850
|
+
}
|
|
3851
|
+
var qc = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
|
|
3852
|
+
function _c(e) {
|
|
3853
|
+
let { node: t } = e;
|
|
3854
|
+
if (t.type !== "ConditionalExpression")
|
|
3855
|
+
return !1;
|
|
3856
|
+
let n, r = t;
|
|
3857
|
+
for (let u = 0; !n; u++) {
|
|
3858
|
+
let a = e.getParentNode(u);
|
|
3859
|
+
if (a.type === "ChainExpression" && a.expression === r || L(a) && a.callee === r || W(a) && a.object === r || a.type === "TSNonNullExpression" && a.expression === r) {
|
|
3860
|
+
r = a;
|
|
3861
|
+
continue;
|
|
3862
|
+
}
|
|
3863
|
+
a.type === "NewExpression" && a.callee === r || Ce(a) && a.expression === r ? (n = e.getParentNode(u + 1), r = a) : n = a;
|
|
3864
|
+
}
|
|
3865
|
+
return r === t ? !1 : n[qc.get(n.type)] === r;
|
|
3866
|
+
}
|
|
3867
|
+
function Xc(e, t, n) {
|
|
3868
|
+
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 = [], D = !1, { parent: c } = e, p = c.type === r.type && i.some((O) => c[O] === r), y = c.type === r.type && !p, f, g, S = 0;
|
|
3869
|
+
do
|
|
3870
|
+
g = f || r, f = e.getParentNode(S), S++;
|
|
3871
|
+
while (f && f.type === r.type && i.every((O) => f[O] !== g));
|
|
3872
|
+
let b = f || c, x = g;
|
|
3873
|
+
if (u && (K(r[i[0]]) || K(s) || K(l) || Oc(x))) {
|
|
3874
|
+
D = !0, y = !0;
|
|
3875
|
+
let O = (U) => [w("("), A([E, U]), E, w(")")], G = (U) => U.type === "NullLiteral" || U.type === "Literal" && U.value === null || U.type === "Identifier" && U.name === "undefined";
|
|
3876
|
+
d.push(" ? ", G(s) ? n(a) : O(n(a)), " : ", l.type === r.type || G(l) ? n(o) : O(n(o)));
|
|
3877
|
+
} else {
|
|
3878
|
+
let O = (U) => t.useTabs ? A(n(U)) : Be(2, n(U)), G = [C, "? ", s.type === r.type ? w("", "(") : "", O(a), s.type === r.type ? w("", ")") : "", C, ": ", O(o)];
|
|
3879
|
+
d.push(c.type !== r.type || c[o] === r || p ? G : t.useTabs ? Du(A(G)) : Be(Math.max(0, t.tabWidth - 2), G));
|
|
3880
|
+
}
|
|
3881
|
+
let j = [a, o, ...i].some((O) => h(r[O], (G) => ye(G) && ce(t.originalText, q(G), I(G)))), v = (O) => c === b ? m(O, { shouldBreak: j }) : j ? [O, ve] : O, B = !D && (W(c) || c.type === "NGPipeExpression" && c.left === r) && !c.computed, M = _c(e), k = v([Jc(e, t, n), y ? d : A(d), u && B && !M ? E : ""]);
|
|
3882
|
+
return p || M ? m([A([E, k]), E]) : k;
|
|
3883
|
+
}
|
|
3884
|
+
function $c(e, t) {
|
|
3885
|
+
return (W(t) || t.type === "NGPipeExpression" && t.left === e) && !t.computed;
|
|
3886
|
+
}
|
|
3887
|
+
function Wc(e, t, n, r) {
|
|
3888
|
+
return [...e.map((u) => Ke(u)), Ke(t), Ke(n)].flat().some((u) => ye(u) && ce(r.originalText, q(u), I(u)));
|
|
3889
|
+
}
|
|
3890
|
+
var Rc = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
|
|
3891
|
+
function Uc(e) {
|
|
3892
|
+
let { node: t } = e;
|
|
3893
|
+
if (t.type !== "ConditionalExpression")
|
|
3894
|
+
return !1;
|
|
3895
|
+
let n, r = t;
|
|
3896
|
+
for (let u = 0; !n; u++) {
|
|
3897
|
+
let a = e.getParentNode(u);
|
|
3898
|
+
if (a.type === "ChainExpression" && a.expression === r || L(a) && a.callee === r || W(a) && a.object === r || a.type === "TSNonNullExpression" && a.expression === r) {
|
|
3899
|
+
r = a;
|
|
3900
|
+
continue;
|
|
3901
|
+
}
|
|
3902
|
+
a.type === "NewExpression" && a.callee === r || Ce(a) && a.expression === r ? (n = e.getParentNode(u + 1), r = a) : n = a;
|
|
3903
|
+
}
|
|
3904
|
+
return r === t ? !1 : n[Rc.get(n.type)] === r;
|
|
3905
|
+
}
|
|
3906
|
+
var Cn = (e) => [w("("), A([E, e]), E, w(")")];
|
|
3907
|
+
function lr(e, t, n, r) {
|
|
3908
|
+
if (!t.experimentalTernaries)
|
|
3909
|
+
return Xc(e, t, n);
|
|
3910
|
+
let { node: u } = e, a = u.type === "ConditionalExpression", o = We(u), i = a ? "consequent" : "trueType", s = a ? "alternate" : "falseType", l = a ? ["test"] : ["checkType", "extendsType"], d = u[i], D = u[s], c = l.map((me) => u[me]), { parent: p } = e, y = p.type === u.type, f = y && l.some((me) => p[me] === u), g = y && p[s] === u, S = d.type === u.type, b = D.type === u.type, x = b || g, j = t.tabWidth > 2 || t.useTabs, v, B, M = 0;
|
|
3911
|
+
do
|
|
3912
|
+
B = v || u, v = e.getParentNode(M), M++;
|
|
3913
|
+
while (v && v.type === u.type && l.every((me) => v[me] !== B));
|
|
3914
|
+
let k = v || p, O = 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"), G = (p.type === "ReturnStatement" || p.type === "ThrowStatement") && !(S || b), U = a && k.type === "JSXExpressionContainer" && e.grandparent.type !== "JSXAttribute", Oe = Uc(e), P = $c(u, p), V = o && ut(e, t), ue = j ? t.useTabs ? " " : " ".repeat(t.tabWidth - 1) : "", ot = Wc(c, d, D, t) || S || b, xe = !x && !y && !o && (U ? d.type === "NullLiteral" || d.type === "Literal" && d.value === null : Vn(d, t) && Er(u.test, 3)), cr = x || g || o && !y || y && a && Er(u.test, 1) || xe, Dr = [];
|
|
3915
|
+
!S && h(d, T.Dangling) && e.call((me) => {
|
|
3916
|
+
Dr.push($(me, t), F);
|
|
3917
|
+
}, "consequent");
|
|
3918
|
+
let xt = [];
|
|
3919
|
+
h(u.test, T.Dangling) && e.call((me) => {
|
|
3920
|
+
xt.push($(me, t));
|
|
3921
|
+
}, "test"), !b && h(D, T.Dangling) && e.call((me) => {
|
|
3922
|
+
xt.push($(me, t));
|
|
3923
|
+
}, "alternate"), h(u, T.Dangling) && xt.push($(e, t));
|
|
3924
|
+
let yr = Symbol("test"), Qa = Symbol("consequent"), Ot = Symbol("test-and-consequent"), Ya = a ? [Cn(n("test")), u.test.type === "ConditionalExpression" ? ve : ""] : [n("checkType"), " ", "extends", " ", We(u.extendsType) || u.extendsType.type === "TSMappedType" ? n("extendsType") : m(Cn(n("extendsType")))], dr = m([Ya, " ?"], { id: yr }), Za = n(i), Jt = A([S || U && (K(d) || y || x) ? F : C, Dr, Za]), eo = cr ? m([dr, x ? Jt : w(Jt, m(Jt, { id: Qa }), { groupId: yr })], { id: Ot }) : [dr, Jt], ln = n(s), mr = xe ? w(ln, Du(Cn(ln)), { groupId: Ot }) : ln, ht = [eo, xt.length > 0 ? [A([F, xt]), F] : b ? F : xe ? w(C, " ", { groupId: Ot }) : C, ":", b ? " " : j ? cr ? w(ue, w(x || xe ? " " : ue, " "), { groupId: Ot }) : w(ue, " ") : " ", b ? mr : m([A(mr), U && !xe ? E : ""]), P && !Oe ? E : "", ot ? ve : ""];
|
|
3925
|
+
return O && !ot ? m(A([E, m(ht)])) : O || G ? m(A(ht)) : Oe || o && f ? m([A([E, ht]), V ? E : ""]) : p === k ? m(ht) : ht;
|
|
3926
|
+
}
|
|
3927
|
+
function Gc(e, t, n, r) {
|
|
3928
|
+
let { node: u } = e;
|
|
3929
|
+
if (Un(u))
|
|
3930
|
+
return Bc(e, t);
|
|
3931
|
+
let a = t.semi ? ";" : "", o = [];
|
|
3932
|
+
switch (u.type) {
|
|
3933
|
+
case "JsExpressionRoot":
|
|
3934
|
+
return n("node");
|
|
3935
|
+
case "JsonRoot":
|
|
3936
|
+
return [$(e, t), n("node"), F];
|
|
3937
|
+
case "File":
|
|
3938
|
+
return bc(e, t, n) ?? n("program");
|
|
3939
|
+
case "EmptyStatement":
|
|
3940
|
+
return "";
|
|
3941
|
+
case "ExpressionStatement":
|
|
3942
|
+
return Sc(e, t, n);
|
|
3943
|
+
case "ChainExpression":
|
|
3944
|
+
return n("expression");
|
|
3945
|
+
case "ParenthesizedExpression":
|
|
3946
|
+
return !h(u.expression) && (Ae(u.expression) || Q(u.expression)) ? ["(", n("expression"), ")"] : m(["(", A([E, n("expression")]), E, ")"]);
|
|
3947
|
+
case "AssignmentExpression":
|
|
3948
|
+
return gl(e, t, n);
|
|
3949
|
+
case "VariableDeclarator":
|
|
3950
|
+
return xl(e, t, n);
|
|
3951
|
+
case "BinaryExpression":
|
|
3952
|
+
case "LogicalExpression":
|
|
3953
|
+
return $u(e, t, n);
|
|
3954
|
+
case "AssignmentPattern":
|
|
3955
|
+
return [n("left"), " = ", n("right")];
|
|
3956
|
+
case "OptionalMemberExpression":
|
|
3957
|
+
case "MemberExpression":
|
|
3958
|
+
return El(e, t, n);
|
|
3959
|
+
case "MetaProperty":
|
|
3960
|
+
return [n("meta"), ".", n("property")];
|
|
3961
|
+
case "BindExpression":
|
|
3962
|
+
return u.object && o.push(n("object")), o.push(m(A([E, ma(e, t, n)]))), o;
|
|
3963
|
+
case "Identifier":
|
|
3964
|
+
return [u.name, re(e), da(e), z(e, n)];
|
|
3965
|
+
case "V8IntrinsicIdentifier":
|
|
3966
|
+
return ["%", u.name];
|
|
3967
|
+
case "SpreadElement":
|
|
3968
|
+
case "SpreadElementPattern":
|
|
3969
|
+
case "SpreadPropertyPattern":
|
|
3970
|
+
case "RestElement":
|
|
3971
|
+
return fa(e, n);
|
|
3972
|
+
case "FunctionDeclaration":
|
|
3973
|
+
case "FunctionExpression":
|
|
3974
|
+
return ga(e, t, n, r);
|
|
3975
|
+
case "ArrowFunctionExpression":
|
|
3976
|
+
return ac(e, t, n, r);
|
|
3977
|
+
case "YieldExpression":
|
|
3978
|
+
return o.push("yield"), u.delegate && o.push("*"), u.argument && o.push(" ", n("argument")), o;
|
|
3979
|
+
case "AwaitExpression":
|
|
3980
|
+
if (o.push("await"), u.argument) {
|
|
3981
|
+
o.push(" ", n("argument"));
|
|
3982
|
+
let { parent: i } = e;
|
|
3983
|
+
if (L(i) && i.callee === u || W(i) && i.object === u) {
|
|
3984
|
+
o = [A([E, ...o]), E];
|
|
3985
|
+
let s = e.findAncestor((l) => l.type === "AwaitExpression" || l.type === "BlockStatement");
|
|
3986
|
+
if ((s == null ? void 0 : s.type) !== "AwaitExpression" || !te(s.argument, (l) => l === u))
|
|
3987
|
+
return m(o);
|
|
3988
|
+
}
|
|
3989
|
+
}
|
|
3990
|
+
return o;
|
|
3991
|
+
case "ExportDefaultDeclaration":
|
|
3992
|
+
case "ExportNamedDeclaration":
|
|
3993
|
+
case "ExportAllDeclaration":
|
|
3994
|
+
return Ja(e, t, n);
|
|
3995
|
+
case "ImportDeclaration":
|
|
3996
|
+
return Pc(e, t, n);
|
|
3997
|
+
case "ImportSpecifier":
|
|
3998
|
+
case "ExportSpecifier":
|
|
3999
|
+
case "ImportNamespaceSpecifier":
|
|
4000
|
+
case "ExportNamespaceSpecifier":
|
|
4001
|
+
case "ImportDefaultSpecifier":
|
|
4002
|
+
case "ExportDefaultSpecifier":
|
|
4003
|
+
return Lc(e, t, n);
|
|
4004
|
+
case "ImportAttribute":
|
|
4005
|
+
return An(e, t, n);
|
|
4006
|
+
case "Program":
|
|
4007
|
+
case "BlockStatement":
|
|
4008
|
+
case "StaticBlock":
|
|
4009
|
+
return Ta(e, t, n);
|
|
4010
|
+
case "ClassBody":
|
|
4011
|
+
return Ac(e, t, n);
|
|
4012
|
+
case "ThrowStatement":
|
|
4013
|
+
return nc(e, t, n);
|
|
4014
|
+
case "ReturnStatement":
|
|
4015
|
+
return tc(e, t, n);
|
|
4016
|
+
case "NewExpression":
|
|
4017
|
+
case "ImportExpression":
|
|
4018
|
+
case "OptionalCallExpression":
|
|
4019
|
+
case "CallExpression":
|
|
4020
|
+
return Hu(e, t, n);
|
|
4021
|
+
case "ObjectExpression":
|
|
4022
|
+
case "ObjectPattern":
|
|
4023
|
+
return pn(e, t, n);
|
|
4024
|
+
case "Property":
|
|
4025
|
+
return nn(u) ? Mn(e, t, n) : An(e, t, n);
|
|
4026
|
+
case "ObjectProperty":
|
|
4027
|
+
return An(e, t, n);
|
|
4028
|
+
case "ObjectMethod":
|
|
4029
|
+
return Mn(e, t, n);
|
|
4030
|
+
case "Decorator":
|
|
4031
|
+
return ["@", n("expression")];
|
|
4032
|
+
case "ArrayExpression":
|
|
4033
|
+
case "ArrayPattern":
|
|
4034
|
+
return ar(e, t, n);
|
|
4035
|
+
case "SequenceExpression": {
|
|
4036
|
+
let { parent: i } = e;
|
|
4037
|
+
if (i.type === "ExpressionStatement" || i.type === "ForStatement") {
|
|
4038
|
+
let l = [];
|
|
4039
|
+
return e.each(({ isFirst: d }) => {
|
|
4040
|
+
d ? l.push(n()) : l.push(",", A([C, n()]));
|
|
4041
|
+
}, "expressions"), m(l);
|
|
4042
|
+
}
|
|
4043
|
+
let s = N([",", C], e.map(n, "expressions"));
|
|
4044
|
+
return (i.type === "ReturnStatement" || i.type === "ThrowStatement") && e.key === "argument" || i.type === "ArrowFunctionExpression" && e.key === "body" ? m(w([A([E, s]), E], s)) : m(s);
|
|
4045
|
+
}
|
|
4046
|
+
case "ThisExpression":
|
|
4047
|
+
return "this";
|
|
4048
|
+
case "Super":
|
|
4049
|
+
return "super";
|
|
4050
|
+
case "Directive":
|
|
4051
|
+
return [n("value"), a];
|
|
4052
|
+
case "UnaryExpression":
|
|
4053
|
+
return o.push(u.operator), /[a-z]$/u.test(u.operator) && o.push(" "), h(u.argument) ? o.push(m(["(", A([E, n("argument")]), E, ")"])) : o.push(n("argument")), o;
|
|
4054
|
+
case "UpdateExpression":
|
|
4055
|
+
return [u.prefix ? u.operator : "", n("argument"), u.prefix ? "" : u.operator];
|
|
4056
|
+
case "ConditionalExpression":
|
|
4057
|
+
return lr(e, t, n, r);
|
|
4058
|
+
case "VariableDeclaration": {
|
|
4059
|
+
let i = e.map(n, "declarations"), s = e.parent, l = s.type === "ForStatement" || s.type === "ForInStatement" || s.type === "ForOfStatement", d = u.declarations.some((c) => c.init), D;
|
|
4060
|
+
return i.length === 1 && !h(u.declarations[0]) ? D = i[0] : i.length > 0 && (D = A(i[0])), o = [ie(e), u.kind, D ? [" ", D] : "", A(i.slice(1).map((c) => [",", d && !l ? F : C, c]))], l && s.body !== u || o.push(a), m(o);
|
|
4061
|
+
}
|
|
4062
|
+
case "WithStatement":
|
|
4063
|
+
return m(["with (", n("object"), ")", qe(u.body, n("body"))]);
|
|
4064
|
+
case "IfStatement": {
|
|
4065
|
+
let i = qe(u.consequent, n("consequent")), s = m(["if (", m([A([E, n("test")]), E]), ")", i]);
|
|
4066
|
+
if (o.push(s), u.alternate) {
|
|
4067
|
+
let l = h(u.consequent, T.Trailing | T.Line) || ou(u), d = u.consequent.type === "BlockStatement" && !l;
|
|
4068
|
+
o.push(d ? " " : F), h(u, T.Dangling) && o.push($(e, t), l ? F : " "), o.push("else", m(qe(u.alternate, n("alternate"), u.alternate.type === "IfStatement")));
|
|
4069
|
+
}
|
|
4070
|
+
return o;
|
|
4071
|
+
}
|
|
4072
|
+
case "ForStatement": {
|
|
4073
|
+
let i = qe(u.body, n("body")), s = $(e, t), l = s ? [s, E] : "";
|
|
4074
|
+
return !u.init && !u.test && !u.update ? [l, m(["for (;;)", i])] : [l, m(["for (", m([A([E, n("init"), ";", C, n("test"), ";", C, n("update")]), E]), ")", i])];
|
|
4075
|
+
}
|
|
4076
|
+
case "WhileStatement":
|
|
4077
|
+
return m(["while (", m([A([E, n("test")]), E]), ")", qe(u.body, n("body"))]);
|
|
4078
|
+
case "ForInStatement":
|
|
4079
|
+
return m(["for (", n("left"), " in ", n("right"), ")", qe(u.body, n("body"))]);
|
|
4080
|
+
case "ForOfStatement":
|
|
4081
|
+
return m(["for", u.await ? " await" : "", " (", n("left"), " of ", n("right"), ")", qe(u.body, n("body"))]);
|
|
4082
|
+
case "DoWhileStatement": {
|
|
4083
|
+
let i = qe(u.body, n("body"));
|
|
4084
|
+
return o = [m(["do", i])], u.body.type === "BlockStatement" ? o.push(" ") : o.push(F), o.push("while (", m([A([E, n("test")]), E]), ")", a), o;
|
|
4085
|
+
}
|
|
4086
|
+
case "DoExpression":
|
|
4087
|
+
return [u.async ? "async " : "", "do ", n("body")];
|
|
4088
|
+
case "BreakStatement":
|
|
4089
|
+
case "ContinueStatement":
|
|
4090
|
+
return o.push(u.type === "BreakStatement" ? "break" : "continue"), u.label && o.push(" ", n("label")), o.push(a), o;
|
|
4091
|
+
case "LabeledStatement":
|
|
4092
|
+
return u.body.type === "EmptyStatement" ? [n("label"), ":;"] : [n("label"), ": ", n("body")];
|
|
4093
|
+
case "TryStatement":
|
|
4094
|
+
return ["try ", n("block"), u.handler ? [" ", n("handler")] : "", u.finalizer ? [" finally ", n("finalizer")] : ""];
|
|
4095
|
+
case "CatchClause":
|
|
4096
|
+
if (u.param) {
|
|
4097
|
+
let i = h(u.param, (l) => !ye(l) || l.leading && pe(t.originalText, I(l)) || l.trailing && pe(t.originalText, q(l), { backwards: !0 })), s = n("param");
|
|
4098
|
+
return ["catch ", i ? ["(", A([E, s]), E, ") "] : ["(", s, ") "], n("body")];
|
|
4099
|
+
}
|
|
4100
|
+
return ["catch ", n("body")];
|
|
4101
|
+
case "SwitchStatement":
|
|
4102
|
+
return [m(["switch (", A([E, n("discriminant")]), E, ")"]), " {", u.cases.length > 0 ? A([F, N(F, e.map(({ node: i, isLast: s }) => [n(), !s && Ne(i, t) ? F : ""], "cases"))]) : "", F, "}"];
|
|
4103
|
+
case "SwitchCase": {
|
|
4104
|
+
u.test ? o.push("case ", n("test"), ":") : o.push("default:"), h(u, T.Dangling) && o.push(" ", $(e, t));
|
|
4105
|
+
let i = u.consequent.filter((s) => s.type !== "EmptyStatement");
|
|
4106
|
+
if (i.length > 0) {
|
|
4107
|
+
let s = On(e, t, n, "consequent");
|
|
4108
|
+
o.push(i.length === 1 && i[0].type === "BlockStatement" ? [" ", s] : A([F, s]));
|
|
4109
|
+
}
|
|
4110
|
+
return o;
|
|
4111
|
+
}
|
|
4112
|
+
case "DebuggerStatement":
|
|
4113
|
+
return ["debugger", a];
|
|
4114
|
+
case "ClassDeclaration":
|
|
4115
|
+
case "ClassExpression":
|
|
4116
|
+
return va(e, t, n);
|
|
4117
|
+
case "ClassMethod":
|
|
4118
|
+
case "ClassPrivateMethod":
|
|
4119
|
+
case "MethodDefinition":
|
|
4120
|
+
return wa(e, t, n);
|
|
4121
|
+
case "ClassProperty":
|
|
4122
|
+
case "PropertyDefinition":
|
|
4123
|
+
case "ClassPrivateProperty":
|
|
4124
|
+
case "ClassAccessorProperty":
|
|
4125
|
+
case "AccessorProperty":
|
|
4126
|
+
return Ia(e, t, n);
|
|
4127
|
+
case "TemplateElement":
|
|
4128
|
+
return He(u.value.raw);
|
|
4129
|
+
case "TemplateLiteral":
|
|
4130
|
+
return Iu(e, t, n);
|
|
4131
|
+
case "TaggedTemplateExpression":
|
|
4132
|
+
return Bs(e, t, n);
|
|
4133
|
+
case "PrivateIdentifier":
|
|
4134
|
+
return ["#", u.name];
|
|
4135
|
+
case "PrivateName":
|
|
4136
|
+
return ["#", n("id")];
|
|
4137
|
+
case "TopicReference":
|
|
4138
|
+
return "%";
|
|
4139
|
+
case "ArgumentPlaceholder":
|
|
4140
|
+
return "?";
|
|
4141
|
+
case "ModuleExpression":
|
|
4142
|
+
return ["module ", n("body")];
|
|
4143
|
+
case "InterpreterDirective":
|
|
4144
|
+
default:
|
|
4145
|
+
throw new At(u, "ESTree");
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
function Ra(e, t, n) {
|
|
4149
|
+
let { parent: r, node: u, key: a } = e, o = [n("expression")];
|
|
4150
|
+
switch (u.type) {
|
|
4151
|
+
case "AsConstExpression":
|
|
4152
|
+
o.push(" as const");
|
|
4153
|
+
break;
|
|
4154
|
+
case "AsExpression":
|
|
4155
|
+
case "TSAsExpression":
|
|
4156
|
+
o.push(" as ", n("typeAnnotation"));
|
|
4157
|
+
break;
|
|
4158
|
+
case "SatisfiesExpression":
|
|
4159
|
+
case "TSSatisfiesExpression":
|
|
4160
|
+
o.push(" satisfies ", n("typeAnnotation"));
|
|
4161
|
+
break;
|
|
4162
|
+
}
|
|
4163
|
+
return a === "callee" && L(r) || a === "object" && W(r) ? m([A([E, ...o]), E]) : o;
|
|
4164
|
+
}
|
|
4165
|
+
function Vc(e, t, n) {
|
|
4166
|
+
let { node: r } = e, u = [ie(e), "component"];
|
|
4167
|
+
r.id && u.push(" ", n("id")), u.push(n("typeParameters"));
|
|
4168
|
+
let a = Kc(e, t, n);
|
|
4169
|
+
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;
|
|
4170
|
+
}
|
|
4171
|
+
function Kc(e, t, n) {
|
|
4172
|
+
let { node: r } = e, u = r.params;
|
|
4173
|
+
if (r.rest && (u = [...u, r.rest]), u.length === 0)
|
|
4174
|
+
return ["(", $(e, t, { filter: (o) => ge(t.originalText, I(o)) === ")" }), ")"];
|
|
4175
|
+
let a = [];
|
|
4176
|
+
return zc(e, (o, i) => {
|
|
4177
|
+
let s = i === u.length - 1;
|
|
4178
|
+
s && r.rest && a.push("..."), a.push(n()), !s && (a.push(","), Ne(u[i], t) ? a.push(F, F) : a.push(C));
|
|
4179
|
+
}), ["(", A([E, ...a]), w(Ie(t, "all") && !Hc(r, u) ? "," : ""), E, ")"];
|
|
4180
|
+
}
|
|
4181
|
+
function Hc(e, t) {
|
|
4182
|
+
var n;
|
|
4183
|
+
return e.rest || ((n = X(!1, t, -1)) == null ? void 0 : n.type) === "RestElement";
|
|
4184
|
+
}
|
|
4185
|
+
function zc(e, t) {
|
|
4186
|
+
let { node: n } = e, r = 0, u = (a) => t(a, r++);
|
|
4187
|
+
e.each(u, "params"), n.rest && e.call(u, "rest");
|
|
4188
|
+
}
|
|
4189
|
+
function Qc(e, t, n) {
|
|
4190
|
+
let { node: r } = e;
|
|
4191
|
+
return r.shorthand ? n("local") : [n("name"), " as ", n("local")];
|
|
4192
|
+
}
|
|
4193
|
+
function Yc(e, t, n) {
|
|
4194
|
+
let { node: r } = e, u = [];
|
|
4195
|
+
return r.name && u.push(n("name"), r.optional ? "?: " : ": "), u.push(n("typeAnnotation")), u;
|
|
4196
|
+
}
|
|
4197
|
+
function Ua(e, t, n) {
|
|
4198
|
+
return pn(e, t, n);
|
|
4199
|
+
}
|
|
4200
|
+
function Ga(e, t) {
|
|
4201
|
+
let { node: n } = e, r = t("id");
|
|
4202
|
+
n.computed && (r = ["[", r, "]"]);
|
|
4203
|
+
let u = "";
|
|
4204
|
+
return n.initializer && (u = t("initializer")), n.init && (u = t("init")), u ? [r, " = ", u] : r;
|
|
4205
|
+
}
|
|
4206
|
+
function Va(e, t) {
|
|
4207
|
+
let { node: n } = e;
|
|
4208
|
+
return [ie(e), n.const ? "const " : "", "enum ", t("id"), " ", t("body")];
|
|
4209
|
+
}
|
|
4210
|
+
function Zc(e, t, n) {
|
|
4211
|
+
let { node: r } = e, u = ["hook"];
|
|
4212
|
+
r.id && u.push(" ", n("id"));
|
|
4213
|
+
let a = at(e, t, n, !1, !0), o = sn(e, n), i = gt(r, o);
|
|
4214
|
+
return u.push(m([i ? m(a) : a, o]), r.body ? " " : "", n("body")), u;
|
|
4215
|
+
}
|
|
4216
|
+
function eD(e, t, n) {
|
|
4217
|
+
let { node: r } = e, u = [ie(e), "hook"];
|
|
4218
|
+
return r.id && u.push(" ", n("id")), t.semi && u.push(";"), u;
|
|
4219
|
+
}
|
|
4220
|
+
function qr(e) {
|
|
4221
|
+
var t;
|
|
4222
|
+
let { node: n } = e;
|
|
4223
|
+
return n.type === "HookTypeAnnotation" && ((t = e.getParentNode(2)) == null ? void 0 : t.type) === "DeclareHook";
|
|
4224
|
+
}
|
|
4225
|
+
function tD(e, t, n) {
|
|
4226
|
+
let { node: r } = e, u = [];
|
|
4227
|
+
u.push(qr(e) ? "" : "hook ");
|
|
4228
|
+
let a = at(e, t, n, !1, !0), o = [];
|
|
4229
|
+
return o.push(qr(e) ? ": " : " => ", n("returnType")), gt(r, o) && (a = m(a)), u.push(a, o), m(u);
|
|
4230
|
+
}
|
|
4231
|
+
function Ka(e, t, n) {
|
|
4232
|
+
let { node: r } = e, u = [ie(e), "interface"], a = [], o = [];
|
|
4233
|
+
r.type !== "InterfaceTypeAnnotation" && a.push(" ", n("id"), n("typeParameters"));
|
|
4234
|
+
let i = r.typeParameters && !h(r.typeParameters, T.Trailing | T.Line);
|
|
4235
|
+
return J(r.extends) && o.push(i ? w(" ", C, { groupId: ir(r.typeParameters) }) : C, "extends ", (r.extends.length === 1 ? pi : A)(N([",", C], e.map(n, "extends")))), h(r.id, T.Trailing) || J(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);
|
|
4236
|
+
}
|
|
4237
|
+
function nD(e) {
|
|
4238
|
+
switch (e) {
|
|
4239
|
+
case null:
|
|
4240
|
+
return "";
|
|
4241
|
+
case "PlusOptional":
|
|
4242
|
+
return "+?";
|
|
4243
|
+
case "MinusOptional":
|
|
4244
|
+
return "-?";
|
|
4245
|
+
case "Optional":
|
|
4246
|
+
return "?";
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4249
|
+
function rD(e, t, n) {
|
|
4250
|
+
let { node: r } = e;
|
|
4251
|
+
return m([r.variance ? n("variance") : "", "[", A([n("keyTparam"), " in ", n("sourceType")]), "]", nD(r.optional), ": ", n("propType")]);
|
|
4252
|
+
}
|
|
4253
|
+
function _r(e, t) {
|
|
4254
|
+
return e === "+" || e === "-" ? e + t : t;
|
|
4255
|
+
}
|
|
4256
|
+
function uD(e, t, n) {
|
|
4257
|
+
let { node: r } = e, u = !1;
|
|
4258
|
+
if (t.objectWrap === "preserve") {
|
|
4259
|
+
let a = q(r), o = sr(t, a + 1, q(r.key)), i = a + 1 + o.search(/\S/u);
|
|
4260
|
+
ce(t.originalText, a, i) && (u = !0);
|
|
4261
|
+
}
|
|
4262
|
+
return m(["{", A([t.bracketSpacing ? C : E, h(r, T.Dangling) ? m([$(e, t), F]) : "", m([r.readonly ? [_r(r.readonly, "readonly"), " "] : "", "[", n("key"), " in ", n("constraint"), r.nameType ? [" as ", n("nameType")] : "", "]", r.optional ? _r(r.optional, "?") : "", r.typeAnnotation ? ": " : "", n("typeAnnotation")]), t.semi ? w(";") : ""]), t.bracketSpacing ? C : E, "}"], { shouldBreak: u });
|
|
4263
|
+
}
|
|
4264
|
+
function aD(e, t, n) {
|
|
4265
|
+
let { node: r } = e;
|
|
4266
|
+
if (Qr(r))
|
|
4267
|
+
return r.type.slice(0, -14).toLowerCase();
|
|
4268
|
+
let u = t.semi ? ";" : "";
|
|
4269
|
+
switch (r.type) {
|
|
4270
|
+
case "ComponentDeclaration":
|
|
4271
|
+
case "DeclareComponent":
|
|
4272
|
+
case "ComponentTypeAnnotation":
|
|
4273
|
+
return Vc(e, t, n);
|
|
4274
|
+
case "ComponentParameter":
|
|
4275
|
+
return Qc(e, t, n);
|
|
4276
|
+
case "ComponentTypeParameter":
|
|
4277
|
+
return Yc(e, t, n);
|
|
4278
|
+
case "HookDeclaration":
|
|
4279
|
+
return Zc(e, t, n);
|
|
4280
|
+
case "DeclareHook":
|
|
4281
|
+
return eD(e, t, n);
|
|
4282
|
+
case "HookTypeAnnotation":
|
|
4283
|
+
return tD(e, t, n);
|
|
4284
|
+
case "DeclareClass":
|
|
4285
|
+
return va(e, t, n);
|
|
4286
|
+
case "DeclareFunction":
|
|
4287
|
+
return [ie(e), "function ", n("id"), n("predicate"), u];
|
|
4288
|
+
case "DeclareModule":
|
|
4289
|
+
return ["declare module ", n("id"), " ", n("body")];
|
|
4290
|
+
case "DeclareModuleExports":
|
|
4291
|
+
return ["declare module.exports", z(e, n), u];
|
|
4292
|
+
case "DeclareNamespace":
|
|
4293
|
+
return ["declare namespace ", n("id"), " ", n("body")];
|
|
4294
|
+
case "DeclareVariable":
|
|
4295
|
+
return [ie(e), r.kind ?? "var", " ", n("id"), u];
|
|
4296
|
+
case "DeclareExportDeclaration":
|
|
4297
|
+
case "DeclareExportAllDeclaration":
|
|
4298
|
+
return Ja(e, t, n);
|
|
4299
|
+
case "DeclareOpaqueType":
|
|
4300
|
+
case "OpaqueType":
|
|
4301
|
+
return _l(e, t, n);
|
|
4302
|
+
case "DeclareTypeAlias":
|
|
4303
|
+
case "TypeAlias":
|
|
4304
|
+
return ta(e, t, n);
|
|
4305
|
+
case "IntersectionTypeAnnotation":
|
|
4306
|
+
return na(e, t, n);
|
|
4307
|
+
case "UnionTypeAnnotation":
|
|
4308
|
+
return ra(e, t, n);
|
|
4309
|
+
case "ConditionalTypeAnnotation":
|
|
4310
|
+
return lr(e, t, n);
|
|
4311
|
+
case "InferTypeAnnotation":
|
|
4312
|
+
return oa(e, t, n);
|
|
4313
|
+
case "FunctionTypeAnnotation":
|
|
4314
|
+
return ua(e, t, n);
|
|
4315
|
+
case "TupleTypeAnnotation":
|
|
4316
|
+
return ar(e, t, n);
|
|
4317
|
+
case "TupleTypeLabeledElement":
|
|
4318
|
+
return sa(e, t, n);
|
|
4319
|
+
case "TupleTypeSpreadElement":
|
|
4320
|
+
return ia(e, t, n);
|
|
4321
|
+
case "GenericTypeAnnotation":
|
|
4322
|
+
return [n("id"), vt(e, t, n, "typeParameters")];
|
|
4323
|
+
case "IndexedAccessType":
|
|
4324
|
+
case "OptionalIndexedAccessType":
|
|
4325
|
+
return aa(e, t, n);
|
|
4326
|
+
case "TypeAnnotation":
|
|
4327
|
+
return la(e, t, n);
|
|
4328
|
+
case "TypeParameter":
|
|
4329
|
+
return ba(e, t, n);
|
|
4330
|
+
case "TypeofTypeAnnotation":
|
|
4331
|
+
return Da(e, n);
|
|
4332
|
+
case "ExistsTypeAnnotation":
|
|
4333
|
+
return "*";
|
|
4334
|
+
case "ArrayTypeAnnotation":
|
|
4335
|
+
return ca(n);
|
|
4336
|
+
case "DeclareEnum":
|
|
4337
|
+
case "EnumDeclaration":
|
|
4338
|
+
return Va(e, n);
|
|
4339
|
+
case "EnumBooleanBody":
|
|
4340
|
+
case "EnumNumberBody":
|
|
4341
|
+
case "EnumBigIntBody":
|
|
4342
|
+
case "EnumStringBody":
|
|
4343
|
+
case "EnumSymbolBody":
|
|
4344
|
+
return [r.type === "EnumSymbolBody" || r.explicitType ? `of ${r.type.slice(4, -4).toLowerCase()} ` : "", Ua(e, t, n)];
|
|
4345
|
+
case "EnumBooleanMember":
|
|
4346
|
+
case "EnumNumberMember":
|
|
4347
|
+
case "EnumBigIntMember":
|
|
4348
|
+
case "EnumStringMember":
|
|
4349
|
+
case "EnumDefaultedMember":
|
|
4350
|
+
return Ga(e, n);
|
|
4351
|
+
case "FunctionTypeParam": {
|
|
4352
|
+
let a = r.name ? n("name") : e.parent.this === r ? "this" : "";
|
|
4353
|
+
return [a, re(e), a ? ": " : "", n("typeAnnotation")];
|
|
4354
|
+
}
|
|
4355
|
+
case "DeclareInterface":
|
|
4356
|
+
case "InterfaceDeclaration":
|
|
4357
|
+
case "InterfaceTypeAnnotation":
|
|
4358
|
+
return Ka(e, t, n);
|
|
4359
|
+
case "ClassImplements":
|
|
4360
|
+
case "InterfaceExtends":
|
|
4361
|
+
return [n("id"), n("typeParameters")];
|
|
4362
|
+
case "NullableTypeAnnotation":
|
|
4363
|
+
return ["?", n("typeAnnotation")];
|
|
4364
|
+
case "Variance": {
|
|
4365
|
+
let { kind: a } = r;
|
|
4366
|
+
return Wn.ok(a === "plus" || a === "minus"), a === "plus" ? "+" : "-";
|
|
4367
|
+
}
|
|
4368
|
+
case "KeyofTypeAnnotation":
|
|
4369
|
+
return ["keyof ", n("argument")];
|
|
4370
|
+
case "ObjectTypeCallProperty":
|
|
4371
|
+
return [r.static ? "static " : "", n("value")];
|
|
4372
|
+
case "ObjectTypeMappedTypeProperty":
|
|
4373
|
+
return rD(e, t, n);
|
|
4374
|
+
case "ObjectTypeIndexer":
|
|
4375
|
+
return [r.static ? "static " : "", r.variance ? n("variance") : "", "[", n("id"), r.id ? ": " : "", n("key"), "]: ", n("value")];
|
|
4376
|
+
case "ObjectTypeProperty": {
|
|
4377
|
+
let a = "";
|
|
4378
|
+
return r.proto ? a = "proto " : r.static && (a = "static "), [a, r.kind !== "init" ? r.kind + " " : "", r.variance ? n("variance") : "", Mt(e, t, n), re(e), nn(r) ? "" : ": ", n("value")];
|
|
4379
|
+
}
|
|
4380
|
+
case "ObjectTypeAnnotation":
|
|
4381
|
+
return pn(e, t, n);
|
|
4382
|
+
case "ObjectTypeInternalSlot":
|
|
4383
|
+
return [r.static ? "static " : "", "[[", n("id"), "]]", re(e), r.method ? "" : ": ", n("value")];
|
|
4384
|
+
case "ObjectTypeSpreadProperty":
|
|
4385
|
+
return fa(e, n);
|
|
4386
|
+
case "QualifiedTypeofIdentifier":
|
|
4387
|
+
case "QualifiedTypeIdentifier":
|
|
4388
|
+
return [n("qualification"), ".", n("id")];
|
|
4389
|
+
case "NullLiteralTypeAnnotation":
|
|
4390
|
+
return "null";
|
|
4391
|
+
case "BooleanLiteralTypeAnnotation":
|
|
4392
|
+
return String(r.value);
|
|
4393
|
+
case "StringLiteralTypeAnnotation":
|
|
4394
|
+
return He(yt(oe(r), t));
|
|
4395
|
+
case "NumberLiteralTypeAnnotation":
|
|
4396
|
+
return mt(oe(r));
|
|
4397
|
+
case "BigIntLiteralTypeAnnotation":
|
|
4398
|
+
return Jn(oe(r));
|
|
4399
|
+
case "TypeCastExpression":
|
|
4400
|
+
return ["(", n("expression"), z(e, n), ")"];
|
|
4401
|
+
case "TypePredicate":
|
|
4402
|
+
return ya(e, n);
|
|
4403
|
+
case "TypeOperator":
|
|
4404
|
+
return [r.operator, " ", n("typeAnnotation")];
|
|
4405
|
+
case "TypeParameterDeclaration":
|
|
4406
|
+
case "TypeParameterInstantiation":
|
|
4407
|
+
return vt(e, t, n, "params");
|
|
4408
|
+
case "InferredPredicate":
|
|
4409
|
+
case "DeclaredPredicate":
|
|
4410
|
+
return [e.key === "predicate" && e.parent.type !== "DeclareFunction" && !e.parent.returnType ? ": " : " ", "%checks", ...r.type === "DeclaredPredicate" ? ["(", n("value"), ")"] : []];
|
|
4411
|
+
case "AsExpression":
|
|
4412
|
+
case "AsConstExpression":
|
|
4413
|
+
case "SatisfiesExpression":
|
|
4414
|
+
return Ra(e, t, n);
|
|
4415
|
+
}
|
|
4416
|
+
}
|
|
4417
|
+
function oD(e, t, n) {
|
|
4418
|
+
var r;
|
|
4419
|
+
let { node: u } = e;
|
|
4420
|
+
if (!u.type.startsWith("TS"))
|
|
4421
|
+
return;
|
|
4422
|
+
if (Yr(u))
|
|
4423
|
+
return u.type.slice(2, -7).toLowerCase();
|
|
4424
|
+
let a = t.semi ? ";" : "", o = [];
|
|
4425
|
+
switch (u.type) {
|
|
4426
|
+
case "TSThisType":
|
|
4427
|
+
return "this";
|
|
4428
|
+
case "TSTypeAssertion": {
|
|
4429
|
+
let i = !(Q(u.expression) || Ae(u.expression)), s = m(["<", A([E, n("typeAnnotation")]), E, ">"]), l = [w("("), A([E, n("expression")]), E, w(")")];
|
|
4430
|
+
return i ? Ve([[s, n("expression")], [s, m(l, { shouldBreak: !0 })], [s, n("expression")]]) : m([s, n("expression")]);
|
|
4431
|
+
}
|
|
4432
|
+
case "TSDeclareFunction":
|
|
4433
|
+
return ga(e, t, n);
|
|
4434
|
+
case "TSExportAssignment":
|
|
4435
|
+
return ["export = ", n("expression"), a];
|
|
4436
|
+
case "TSModuleBlock":
|
|
4437
|
+
return Ta(e, t, n);
|
|
4438
|
+
case "TSInterfaceBody":
|
|
4439
|
+
case "TSTypeLiteral":
|
|
4440
|
+
return pn(e, t, n);
|
|
4441
|
+
case "TSTypeAliasDeclaration":
|
|
4442
|
+
return ta(e, t, n);
|
|
4443
|
+
case "TSQualifiedName":
|
|
4444
|
+
return [n("left"), ".", n("right")];
|
|
4445
|
+
case "TSAbstractMethodDefinition":
|
|
4446
|
+
case "TSDeclareMethod":
|
|
4447
|
+
return wa(e, t, n);
|
|
4448
|
+
case "TSAbstractAccessorProperty":
|
|
4449
|
+
case "TSAbstractPropertyDefinition":
|
|
4450
|
+
return Ia(e, t, n);
|
|
4451
|
+
case "TSInterfaceHeritage":
|
|
4452
|
+
case "TSClassImplements":
|
|
4453
|
+
case "TSExpressionWithTypeArguments":
|
|
4454
|
+
case "TSInstantiationExpression":
|
|
4455
|
+
return [n("expression"), n(u.typeArguments ? "typeArguments" : "typeParameters")];
|
|
4456
|
+
case "TSTemplateLiteralType":
|
|
4457
|
+
return Iu(e, t, n);
|
|
4458
|
+
case "TSNamedTupleMember":
|
|
4459
|
+
return sa(e, t, n);
|
|
4460
|
+
case "TSRestType":
|
|
4461
|
+
return ia(e, t, n);
|
|
4462
|
+
case "TSOptionalType":
|
|
4463
|
+
return [n("typeAnnotation"), "?"];
|
|
4464
|
+
case "TSInterfaceDeclaration":
|
|
4465
|
+
return Ka(e, t, n);
|
|
4466
|
+
case "TSTypeParameterDeclaration":
|
|
4467
|
+
case "TSTypeParameterInstantiation":
|
|
4468
|
+
return vt(e, t, n, "params");
|
|
4469
|
+
case "TSTypeParameter":
|
|
4470
|
+
return ba(e, t, n);
|
|
4471
|
+
case "TSAsExpression":
|
|
4472
|
+
case "TSSatisfiesExpression":
|
|
4473
|
+
return Ra(e, t, n);
|
|
4474
|
+
case "TSArrayType":
|
|
4475
|
+
return ca(n);
|
|
4476
|
+
case "TSPropertySignature":
|
|
4477
|
+
return [u.readonly ? "readonly " : "", Mt(e, t, n), re(e), z(e, n)];
|
|
4478
|
+
case "TSParameterProperty":
|
|
4479
|
+
return [Zt(u), u.static ? "static " : "", u.override ? "override " : "", u.readonly ? "readonly " : "", n("parameter")];
|
|
4480
|
+
case "TSTypeQuery":
|
|
4481
|
+
return Da(e, n);
|
|
4482
|
+
case "TSIndexSignature": {
|
|
4483
|
+
let i = u.parameters.length > 1 ? w(Ie(t) ? "," : "") : "", s = m([A([E, N([", ", E], e.map(n, "parameters"))]), i, E]), l = e.parent.type === "ClassBody" && e.key === "body";
|
|
4484
|
+
return [l && u.static ? "static " : "", u.readonly ? "readonly " : "", "[", u.parameters ? s : "", "]", z(e, n), l ? a : ""];
|
|
4485
|
+
}
|
|
4486
|
+
case "TSTypePredicate":
|
|
4487
|
+
return ya(e, n);
|
|
4488
|
+
case "TSNonNullExpression":
|
|
4489
|
+
return [n("expression"), "!"];
|
|
4490
|
+
case "TSImportType":
|
|
4491
|
+
return ["import", Yt(e, t, n), u.qualifier ? [".", n("qualifier")] : "", vt(e, t, n, u.typeArguments ? "typeArguments" : "typeParameters")];
|
|
4492
|
+
case "TSLiteralType":
|
|
4493
|
+
return n("literal");
|
|
4494
|
+
case "TSIndexedAccessType":
|
|
4495
|
+
return aa(e, t, n);
|
|
4496
|
+
case "TSTypeOperator":
|
|
4497
|
+
return [u.operator, " ", n("typeAnnotation")];
|
|
4498
|
+
case "TSMappedType":
|
|
4499
|
+
return uD(e, t, n);
|
|
4500
|
+
case "TSMethodSignature": {
|
|
4501
|
+
let i = u.kind && u.kind !== "method" ? `${u.kind} ` : "";
|
|
4502
|
+
o.push(Zt(u), i, u.computed ? "[" : "", n("key"), u.computed ? "]" : "", re(e));
|
|
4503
|
+
let s = at(e, t, n, !1, !0), l = u.returnType ? "returnType" : "typeAnnotation", d = u[l], D = d ? z(e, n, l) : "", c = gt(u, D);
|
|
4504
|
+
return o.push(c ? m(s) : s), d && o.push(m(D)), m(o);
|
|
4505
|
+
}
|
|
4506
|
+
case "TSNamespaceExportDeclaration":
|
|
4507
|
+
return ["export as namespace ", n("id"), t.semi ? ";" : ""];
|
|
4508
|
+
case "TSEnumDeclaration":
|
|
4509
|
+
return Va(e, n);
|
|
4510
|
+
case "TSEnumBody":
|
|
4511
|
+
return Ua(e, t, n);
|
|
4512
|
+
case "TSEnumMember":
|
|
4513
|
+
return Ga(e, n);
|
|
4514
|
+
case "TSImportEqualsDeclaration":
|
|
4515
|
+
return [u.isExport ? "export " : "", "import ", qa(u, !1), n("id"), " = ", n("moduleReference"), t.semi ? ";" : ""];
|
|
4516
|
+
case "TSExternalModuleReference":
|
|
4517
|
+
return ["require(", n("expression"), ")"];
|
|
4518
|
+
case "TSModuleDeclaration": {
|
|
4519
|
+
let { parent: i } = e, s = i.type === "TSModuleDeclaration", l = ((r = u.body) == null ? void 0 : r.type) === "TSModuleDeclaration";
|
|
4520
|
+
return s ? o.push(".") : (o.push(ie(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;
|
|
4521
|
+
}
|
|
4522
|
+
case "TSConditionalType":
|
|
4523
|
+
return lr(e, t, n);
|
|
4524
|
+
case "TSInferType":
|
|
4525
|
+
return oa(e, t, n);
|
|
4526
|
+
case "TSIntersectionType":
|
|
4527
|
+
return na(e, t, n);
|
|
4528
|
+
case "TSUnionType":
|
|
4529
|
+
return ra(e, t, n);
|
|
4530
|
+
case "TSFunctionType":
|
|
4531
|
+
case "TSCallSignatureDeclaration":
|
|
4532
|
+
case "TSConstructorType":
|
|
4533
|
+
case "TSConstructSignatureDeclaration":
|
|
4534
|
+
return ua(e, t, n);
|
|
4535
|
+
case "TSTupleType":
|
|
4536
|
+
return ar(e, t, n);
|
|
4537
|
+
case "TSTypeReference":
|
|
4538
|
+
return [n("typeName"), vt(e, t, n, u.typeArguments ? "typeArguments" : "typeParameters")];
|
|
4539
|
+
case "TSTypeAnnotation":
|
|
4540
|
+
return la(e, t, n);
|
|
4541
|
+
case "TSEmptyBodyFunctionExpression":
|
|
4542
|
+
return or(e, t, n);
|
|
4543
|
+
case "TSJSDocAllType":
|
|
4544
|
+
return "*";
|
|
4545
|
+
case "TSJSDocUnknownType":
|
|
4546
|
+
return "?";
|
|
4547
|
+
case "TSJSDocNullableType":
|
|
4548
|
+
return Lr(e, n, "?");
|
|
4549
|
+
case "TSJSDocNonNullableType":
|
|
4550
|
+
return Lr(e, n, "!");
|
|
4551
|
+
case "TSParenthesizedType":
|
|
4552
|
+
default:
|
|
4553
|
+
throw new At(u, "TypeScript");
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
function iD(e, t, n, r) {
|
|
4557
|
+
if (Xu(e))
|
|
4558
|
+
return gp(e, t);
|
|
4559
|
+
for (let u of [ul, Qp, aD, oD, Gc]) {
|
|
4560
|
+
let a = u(e, t, n, r);
|
|
4561
|
+
if (a !== void 0)
|
|
4562
|
+
return a;
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
var sD = _(["ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "ClassPrivateProperty", "MethodDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod"]);
|
|
4566
|
+
function pD(e, t, n, r) {
|
|
4567
|
+
var u;
|
|
4568
|
+
e.isRoot && ((u = t.__onHtmlBindingRoot) == null || u.call(t, e.node, t));
|
|
4569
|
+
let a = iD(e, t, n, r);
|
|
4570
|
+
if (!a)
|
|
4571
|
+
return "";
|
|
4572
|
+
let { node: o } = e;
|
|
4573
|
+
if (sD(o))
|
|
4574
|
+
return a;
|
|
4575
|
+
let i = J(o.decorators), s = pl(e, t, n), l = o.type === "ClassExpression";
|
|
4576
|
+
if (i && !l)
|
|
4577
|
+
return Bn(a, (c) => m([s, c]));
|
|
4578
|
+
let d = ut(e, t), D = Tc(e, t);
|
|
4579
|
+
return !s && !d && !D ? a : Bn(a, (c) => [D ? ";" : "", d ? "(" : "", d && l && i ? [A([C, s, c]), C] : [s, c], d ? ")" : ""]);
|
|
4580
|
+
}
|
|
4581
|
+
var lD = pD, cD = { avoidAstMutation: !0 }, DD = [{ name: "JSON.stringify", type: "data", extensions: [".importmap"], tmScope: "source.json", aceMode: "json", aliases: ["geojson", "jsonl", "sarif", "topojson"], codemirrorMode: "javascript", codemirrorMimeType: "application/json", filenames: ["package.json", "package-lock.json", "composer.json"], parsers: ["json-stringify"], vscodeLanguageIds: ["json"], linguistLanguageId: 174 }, { name: "JSON", type: "data", extensions: [".json", ".4DForm", ".4DProject", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".JSON-tmLanguage", ".json.example", ".mcmeta", ".sarif", ".tact", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"], tmScope: "source.json", aceMode: "json", aliases: ["geojson", "jsonl", "sarif", "topojson"], codemirrorMode: "javascript", codemirrorMimeType: "application/json", filenames: [".all-contributorsrc", ".arcconfig", ".auto-changelog", ".c8rc", ".htmlhintrc", ".imgbotconfig", ".nycrc", ".tern-config", ".tern-project", ".watchmanconfig", ".babelrc", ".jscsrc", ".jshintrc", ".jslintrc", ".swcrc"], parsers: ["json"], vscodeLanguageIds: ["json"], linguistLanguageId: 174 }, { name: "JSON with Comments", type: "data", extensions: [".jsonc", ".code-snippets", ".code-workspace", ".sublime-build", ".sublime-color-scheme", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"], tmScope: "source.json.comments", aceMode: "javascript", aliases: ["jsonc"], codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", group: "JSON", filenames: [], parsers: ["jsonc"], vscodeLanguageIds: ["jsonc"], linguistLanguageId: 423 }, { name: "JSON5", type: "data", extensions: [".json5"], tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "application/json", parsers: ["json5"], vscodeLanguageIds: ["json5"], linguistLanguageId: 175 }], Ha = {};
|
|
4582
|
+
en(Ha, { getVisitorKeys: () => fD, massageAstNode: () => za, print: () => ED });
|
|
4583
|
+
var yD = { JsonRoot: ["node"], ArrayExpression: ["elements"], ObjectExpression: ["properties"], ObjectProperty: ["key", "value"], UnaryExpression: ["argument"], NullLiteral: [], BooleanLiteral: [], StringLiteral: [], NumericLiteral: [], Identifier: [], TemplateLiteral: ["quasis"], TemplateElement: [] }, dD = yD, mD = Hr(dD), fD = mD;
|
|
4584
|
+
function ED(e, t, n) {
|
|
4585
|
+
let { node: r } = e;
|
|
4586
|
+
switch (r.type) {
|
|
4587
|
+
case "JsonRoot":
|
|
4588
|
+
return [n("node"), F];
|
|
4589
|
+
case "ArrayExpression": {
|
|
4590
|
+
if (r.elements.length === 0)
|
|
4591
|
+
return "[]";
|
|
4592
|
+
let u = e.map(() => e.node === null ? "null" : n(), "elements");
|
|
4593
|
+
return ["[", A([F, N([",", F], u)]), F, "]"];
|
|
4594
|
+
}
|
|
4595
|
+
case "ObjectExpression":
|
|
4596
|
+
return r.properties.length === 0 ? "{}" : ["{", A([F, N([",", F], e.map(n, "properties"))]), F, "}"];
|
|
4597
|
+
case "ObjectProperty":
|
|
4598
|
+
return [n("key"), ": ", n("value")];
|
|
4599
|
+
case "UnaryExpression":
|
|
4600
|
+
return [r.operator === "+" ? "" : r.operator, n("argument")];
|
|
4601
|
+
case "NullLiteral":
|
|
4602
|
+
return "null";
|
|
4603
|
+
case "BooleanLiteral":
|
|
4604
|
+
return r.value ? "true" : "false";
|
|
4605
|
+
case "StringLiteral":
|
|
4606
|
+
return JSON.stringify(r.value);
|
|
4607
|
+
case "NumericLiteral":
|
|
4608
|
+
return Xr(e) ? JSON.stringify(String(r.value)) : JSON.stringify(r.value);
|
|
4609
|
+
case "Identifier":
|
|
4610
|
+
return Xr(e) ? JSON.stringify(r.name) : r.name;
|
|
4611
|
+
case "TemplateLiteral":
|
|
4612
|
+
return n(["quasis", 0]);
|
|
4613
|
+
case "TemplateElement":
|
|
4614
|
+
return JSON.stringify(r.value.cooked);
|
|
4615
|
+
default:
|
|
4616
|
+
throw new At(r, "JSON");
|
|
4617
|
+
}
|
|
4618
|
+
}
|
|
4619
|
+
function Xr(e) {
|
|
4620
|
+
return e.key === "key" && e.parent.type === "ObjectProperty";
|
|
4621
|
+
}
|
|
4622
|
+
var FD = /* @__PURE__ */ new Set(["start", "end", "extra", "loc", "comments", "leadingComments", "trailingComments", "innerComments", "errors", "range", "tokens"]);
|
|
4623
|
+
function za(e, t) {
|
|
4624
|
+
let { type: n } = e;
|
|
4625
|
+
if (n === "ObjectProperty") {
|
|
4626
|
+
let { key: r } = e;
|
|
4627
|
+
r.type === "Identifier" ? t.key = { type: "StringLiteral", value: r.name } : r.type === "NumericLiteral" && (t.key = { type: "StringLiteral", value: String(r.value) });
|
|
4628
|
+
return;
|
|
4629
|
+
}
|
|
4630
|
+
if (n === "UnaryExpression" && e.operator === "+")
|
|
4631
|
+
return t.argument;
|
|
4632
|
+
if (n === "ArrayExpression") {
|
|
4633
|
+
for (let [r, u] of e.elements.entries())
|
|
4634
|
+
u === null && t.elements.splice(r, 0, { type: "NullLiteral" });
|
|
4635
|
+
return;
|
|
4636
|
+
}
|
|
4637
|
+
if (n === "TemplateLiteral")
|
|
4638
|
+
return { type: "StringLiteral", value: e.quasis[0].value.cooked };
|
|
4639
|
+
}
|
|
4640
|
+
za.ignoredProperties = FD;
|
|
4641
|
+
var Tt = { 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." } }, _e = "JavaScript", AD = { arrowParens: { category: _e, 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: Tt.bracketSameLine, objectWrap: Tt.objectWrap, bracketSpacing: Tt.bracketSpacing, jsxBracketSameLine: { category: _e, type: "boolean", description: "Put > on the last line instead of at a new line.", deprecated: "2.4.0" }, semi: { category: _e, type: "boolean", default: !0, description: "Print semicolons.", oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." }, experimentalOperatorPosition: { category: _e, 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: _e, 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: Tt.singleQuote, jsxSingleQuote: { category: _e, type: "boolean", default: !1, description: "Use single quotes in JSX." }, quoteProps: { category: _e, 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: _e, 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: Tt.singleAttributePerLine }, gD = AD, xD = { estree: Ur, "estree-json": Ha }, hD = [...oo, ...DD], TD = Rr;
|
|
4642
|
+
export {
|
|
4643
|
+
TD as default,
|
|
4644
|
+
hD as languages,
|
|
4645
|
+
gD as options,
|
|
4646
|
+
xD as printers
|
|
4647
|
+
};
|