@vitalityip.ai/shopping-widget 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_baseUniq-BrPGIiMN.js +477 -0
- package/dist/_baseUniq-alF7zzjq.cjs +1 -0
- package/dist/abap-DV7Q1lGP.cjs +1 -0
- package/dist/abap-Y8Dl9g_6.js +6 -0
- package/dist/actionscript-3-9Yo35Ult.cjs +1 -0
- package/dist/actionscript-3-DQVEcJUW.js +6 -0
- package/dist/ada-D46EKCNf.cjs +1 -0
- package/dist/ada-vP6ak0IW.js +6 -0
- package/dist/andromeeda-BbmzSJq1.js +4 -0
- package/dist/andromeeda-Bp3qiXQw.cjs +1 -0
- package/dist/angular-html-DPB4Rf0C.js +32 -0
- package/dist/angular-html-KMf2QdtP.cjs +1 -0
- package/dist/angular-ts-BxIbo3R1.cjs +1 -0
- package/dist/angular-ts-CTOR2ofC.js +21 -0
- package/dist/apache-BUjz-sD2.js +6 -0
- package/dist/apache-DL1xuH1f.cjs +1 -0
- package/dist/apex-6AM9YZbQ.cjs +1 -0
- package/dist/apex-OyTfjCYK.js +6 -0
- package/dist/apl-CjNiDgad.js +16 -0
- package/dist/apl-Dj2G2M9w.cjs +1 -0
- package/dist/applescript-BPx7YFFu.js +6 -0
- package/dist/applescript-COilsSrZ.cjs +1 -0
- package/dist/ara-B6Lpq1YJ.cjs +1 -0
- package/dist/ara-Z2fSOxSw.js +6 -0
- package/dist/arc-BZXJFJLd.cjs +1 -0
- package/dist/arc-DfjXc4VE.js +83 -0
- package/dist/architecture-U656AL7Q-CLKcdwbB.cjs +1 -0
- package/dist/architecture-U656AL7Q-Cioq9PH8.js +5 -0
- package/dist/architectureDiagram-VXUJARFQ-BHZpdcOG.js +4666 -0
- package/dist/architectureDiagram-VXUJARFQ-BiiQyQpY.cjs +36 -0
- package/dist/asciidoc-B-pCoB3G.js +6 -0
- package/dist/asciidoc-DcKqW72n.cjs +1 -0
- package/dist/asm-BTWLY5ym.js +6 -0
- package/dist/asm-DYMFy-sD.cjs +1 -0
- package/dist/astro-CFFExE8Q.js +18 -0
- package/dist/astro-DAOP_Xq6.cjs +1 -0
- package/dist/aurora-x-BwoVEUWZ.js +4 -0
- package/dist/aurora-x-C5IpmIOG.cjs +1 -0
- package/dist/awk-Fb0P9dkn.js +6 -0
- package/dist/awk-IEszImW6.cjs +1 -0
- package/dist/ayu-dark-Dsjk_2Jx.js +4 -0
- package/dist/ayu-dark-JRymEmFM.cjs +1 -0
- package/dist/ayu-light-R7pgdmWq.js +4 -0
- package/dist/ayu-light-n1qYMatp.cjs +1 -0
- package/dist/ayu-mirage-BgyQhQW8.cjs +1 -0
- package/dist/ayu-mirage-DraY-SDX.js +4 -0
- package/dist/ballerina-Dr6dU4hP.cjs +1 -0
- package/dist/ballerina-oZK-YekG.js +6 -0
- package/dist/bat-0FvbqU9S.js +6 -0
- package/dist/bat-DGkUhhn2.cjs +1 -0
- package/dist/beancount-Bv1Sweoy.cjs +1 -0
- package/dist/beancount-DqJEb89h.js +6 -0
- package/dist/berry-DEMs4LK_.cjs +1 -0
- package/dist/berry-DODBq_Ff.js +6 -0
- package/dist/bibtex-BgA36Z3k.cjs +1 -0
- package/dist/bibtex-EULQRLY5.js +6 -0
- package/dist/bicep-BorU73w0.js +6 -0
- package/dist/bicep-DL0zb-7W.cjs +1 -0
- package/dist/blade-D0HyNvCw.js +20 -0
- package/dist/blade-DEjek0u9.cjs +1 -0
- package/dist/blockDiagram-VD42YOAC-C07xwq_v.js +2266 -0
- package/dist/blockDiagram-VD42YOAC-Xma2emt7.cjs +122 -0
- package/dist/bsl-9bVgFeM9.cjs +1 -0
- package/dist/bsl-NkNNwerW.js +8 -0
- package/dist/c-CtlmKnPF.cjs +1 -0
- package/dist/c-eeMepfLm.js +6 -0
- package/dist/c3-Bt581sCe.js +6 -0
- package/dist/c3-DtfRRWXN.cjs +1 -0
- package/dist/c4Diagram-YG6GDRKO-BWGNRAOH.cjs +10 -0
- package/dist/c4Diagram-YG6GDRKO-MVN2KErC.js +1582 -0
- package/dist/cadence-02UX7mW8.js +6 -0
- package/dist/cadence-DcbmM5v3.cjs +1 -0
- package/dist/cairo-DM6WF2e3.js +8 -0
- package/dist/cairo-li7sQsxU.cjs +1 -0
- package/dist/catppuccin-frappe-Bn4lgmUk.cjs +1 -0
- package/dist/catppuccin-frappe-D3cH2rXe.js +4 -0
- package/dist/catppuccin-latte-BPtsb8jD.cjs +1 -0
- package/dist/catppuccin-latte-C0LRGUW4.js +4 -0
- package/dist/catppuccin-macchiato-BLfpQWhT.cjs +1 -0
- package/dist/catppuccin-macchiato-c5wQ11TT.js +4 -0
- package/dist/catppuccin-mocha-COMta283.cjs +1 -0
- package/dist/catppuccin-mocha-WMD6Qvya.js +4 -0
- package/dist/channel-B0nsP99T.cjs +1 -0
- package/dist/channel-DMxAeX3e.js +5 -0
- package/dist/chunk-4BX2VUAB-62fybyiv.js +9 -0
- package/dist/chunk-4BX2VUAB-CJb0N696.cjs +1 -0
- package/dist/chunk-55IACEB6-C2LOaj9p.cjs +1 -0
- package/dist/chunk-55IACEB6-D5hgFp1j.js +9 -0
- package/dist/chunk-B4BG7PRW-BqpoY0bL.cjs +165 -0
- package/dist/chunk-B4BG7PRW-Dvr7jbv-.js +1377 -0
- package/dist/chunk-DI55MBZ5-DraRs0rZ.js +1382 -0
- package/dist/chunk-DI55MBZ5-FsvNi2gp.cjs +220 -0
- package/dist/chunk-FMBD7UC4-CyjyeVkz.cjs +15 -0
- package/dist/chunk-FMBD7UC4-DzF2F7ii.js +19 -0
- package/dist/chunk-QN33PNHL-9eCEuapS.js +20 -0
- package/dist/chunk-QN33PNHL-CnIrbwCU.cjs +1 -0
- package/dist/chunk-QZHKN3VN-B3NhCkgP.cjs +1 -0
- package/dist/chunk-QZHKN3VN-DIkv3pB-.js +15 -0
- package/dist/chunk-TZMSLE5B-CKf1SnTj.js +64 -0
- package/dist/chunk-TZMSLE5B-DwVxNC8t.cjs +1 -0
- package/dist/clarity-PKm5CwqM.js +6 -0
- package/dist/clarity-gPuvqtpF.cjs +1 -0
- package/dist/classDiagram-2ON5EDUG-C2H6YCN8.js +17 -0
- package/dist/classDiagram-2ON5EDUG-D-OMN4Hr.cjs +1 -0
- package/dist/classDiagram-v2-WZHVMYZB-C2H6YCN8.js +17 -0
- package/dist/classDiagram-v2-WZHVMYZB-D-OMN4Hr.cjs +1 -0
- package/dist/clojure-CXJfHrL3.js +6 -0
- package/dist/clojure-OUsr1SUl.cjs +1 -0
- package/dist/clone-BwP8Mlqi.cjs +1 -0
- package/dist/clone-DnQL-27a.js +8 -0
- package/dist/cmake-BJz8BOTU.js +6 -0
- package/dist/cmake-jM6P58qY.cjs +1 -0
- package/dist/cobol-CcrsCSUZ.cjs +1 -0
- package/dist/cobol-HihOMwht.js +10 -0
- package/dist/code-block-IT6T5CEO-BQ7C1br4.js +2693 -0
- package/dist/code-block-IT6T5CEO-BYmYTPge.cjs +142 -0
- package/dist/codeowners-Bt9yU6NX.js +6 -0
- package/dist/codeowners-QhPK6lIJ.cjs +1 -0
- package/dist/codeql-D9-TdUN8.cjs +1 -0
- package/dist/codeql-DHkodjjI.js +6 -0
- package/dist/coffee-DGBR_nr_.js +8 -0
- package/dist/coffee-DycxIFwY.cjs +1 -0
- package/dist/common-lisp-C77gR-8i.cjs +1 -0
- package/dist/common-lisp-EVqT9Zhp.js +6 -0
- package/dist/components/CatalogFallbacks.d.ts +21 -0
- package/dist/components/CatalogMarkdown.d.ts +10 -0
- package/dist/components/ChatBubble.d.ts +6 -0
- package/dist/components/ChatWindow.d.ts +86 -0
- package/dist/components/ConversationHistory.d.ts +13 -0
- package/dist/components/ExpandableRecipeCard.d.ts +14 -0
- package/dist/components/Profile.d.ts +19 -0
- package/dist/components/ShoppingAssistant.d.ts +84 -0
- package/dist/components/ToolCallDisplay.d.ts +9 -0
- package/dist/components/ai-elements/agent.d.ts +27 -0
- package/dist/components/ai-elements/artifact.d.ts +24 -0
- package/dist/components/ai-elements/attachments.d.ts +59 -0
- package/dist/components/ai-elements/audio-player.d.ts +30 -0
- package/dist/components/ai-elements/canvas.d.ts +8 -0
- package/dist/components/ai-elements/chain-of-thought.d.ts +30 -0
- package/dist/components/ai-elements/checkpoint.d.ts +12 -0
- package/dist/components/ai-elements/code-block.d.ts +18 -0
- package/dist/components/ai-elements/commit.d.ts +65 -0
- package/dist/components/ai-elements/confirmation.d.ts +50 -0
- package/dist/components/ai-elements/connection.d.ts +3 -0
- package/dist/components/ai-elements/context.d.ts +33 -0
- package/dist/components/ai-elements/controls.d.ts +5 -0
- package/dist/components/ai-elements/conversation.d.ts +16 -0
- package/dist/components/ai-elements/edge.d.ts +6 -0
- package/dist/components/ai-elements/environment-variables.d.ts +39 -0
- package/dist/components/ai-elements/file-tree.d.ts +27 -0
- package/dist/components/ai-elements/image.d.ts +7 -0
- package/dist/components/ai-elements/index.d.ts +65 -0
- package/dist/components/ai-elements/inline-citation.d.ts +39 -0
- package/dist/components/ai-elements/loader.d.ts +6 -0
- package/dist/components/ai-elements/message.d.ts +47 -0
- package/dist/components/ai-elements/mic-selector.d.ts +46 -0
- package/dist/components/ai-elements/model-selector.d.ts +36 -0
- package/dist/components/ai-elements/node.d.ts +22 -0
- package/dist/components/ai-elements/open-in-chat.d.ts +29 -0
- package/dist/components/ai-elements/package-info.d.ts +30 -0
- package/dist/components/ai-elements/panel.d.ts +6 -0
- package/dist/components/ai-elements/persona.d.ts +49 -0
- package/dist/components/ai-elements/plan.d.ts +26 -0
- package/dist/components/ai-elements/prompt-input.d.ts +188 -0
- package/dist/components/ai-elements/queue.d.ts +62 -0
- package/dist/components/ai-elements/reasoning.d.ts +27 -0
- package/dist/components/ai-elements/sandbox.d.ts +25 -0
- package/dist/components/ai-elements/schema-display.d.ts +58 -0
- package/dist/components/ai-elements/shimmer.d.ts +10 -0
- package/dist/components/ai-elements/snippet.d.ts +19 -0
- package/dist/components/ai-elements/sources.d.ts +13 -0
- package/dist/components/ai-elements/speech-input.d.ts +15 -0
- package/dist/components/ai-elements/stack-trace.d.ts +38 -0
- package/dist/components/ai-elements/suggestion.d.ts +11 -0
- package/dist/components/ai-elements/task.d.ts +15 -0
- package/dist/components/ai-elements/terminal.d.ts +28 -0
- package/dist/components/ai-elements/test-results.d.ts +59 -0
- package/dist/components/ai-elements/tool.d.ts +25 -0
- package/dist/components/ai-elements/toolbar.d.ts +6 -0
- package/dist/components/ai-elements/transcription.d.ts +17 -0
- package/dist/components/ai-elements/voice-selector.d.ts +64 -0
- package/dist/components/ai-elements/web-preview.d.ts +35 -0
- package/dist/components/chat/ChatHeader.d.ts +22 -0
- package/dist/components/chat/ChatInput.d.ts +32 -0
- package/dist/components/chat/ChatMessages.d.ts +18 -0
- package/dist/components/chat/ReasoningBox.d.ts +10 -0
- package/dist/components/chat/TypingIndicator.d.ts +4 -0
- package/dist/components/chat/index.d.ts +15 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts +15 -0
- package/dist/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/coq-B0L9upzn.js +6 -0
- package/dist/coq-vlPdR5hP.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-C-E8FsQJ.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-bUl1r26I.js +2606 -0
- package/dist/cpp-Cj177cuW.js +18 -0
- package/dist/cpp-DvI2Eoso.cjs +1 -0
- package/dist/crystal-B_WXhL2O.cjs +1 -0
- package/dist/crystal-CRJyc4G-.js +18 -0
- package/dist/csharp-BnMEC8KH.cjs +1 -0
- package/dist/csharp-CCgA4A09.js +6 -0
- package/dist/css-CECN5uSL.js +6 -0
- package/dist/css-Do0mp2lm.cjs +1 -0
- package/dist/csv-CmYOceLb.js +6 -0
- package/dist/csv-DiEdJzSJ.cjs +1 -0
- package/dist/cue-D1vJRJEx.cjs +1 -0
- package/dist/cue-ZzumE7IT.js +6 -0
- package/dist/cypher-atSM3NsM.cjs +1 -0
- package/dist/cypher-jpdmjtA6.js +6 -0
- package/dist/cytoscape.esm-DkGgpG6d.cjs +331 -0
- package/dist/cytoscape.esm-ZmItrg9y.js +18731 -0
- package/dist/d-2qe3NhmZ.cjs +1 -0
- package/dist/d-CBagWSwH.js +6 -0
- package/dist/dagre-6UL2VRFP-BNNHUzwi.cjs +4 -0
- package/dist/dagre-6UL2VRFP-CmOlz9tj.js +446 -0
- package/dist/dark-plus-Cd5emcYO.cjs +1 -0
- package/dist/dark-plus-pUHDTVV0.js +4 -0
- package/dist/dart-6ObCrKr9.js +6 -0
- package/dist/dart-Ds0_0fwe.cjs +1 -0
- package/dist/dax-CcDT-8dH.js +6 -0
- package/dist/dax-DbkQa40E.cjs +1 -0
- package/dist/defaultLocale-D7EN2tov.js +171 -0
- package/dist/defaultLocale-DIVzfLaQ.cjs +1 -0
- package/dist/desktop-B93p9R9O.js +6 -0
- package/dist/desktop-tn3MFXCZ.cjs +1 -0
- package/dist/diagram-PSM6KHXK-C1SXb_Xs.js +535 -0
- package/dist/diagram-PSM6KHXK-CMllEr15.cjs +24 -0
- package/dist/diagram-QEK2KX5R-6zp9f5As.cjs +43 -0
- package/dist/diagram-QEK2KX5R-Bx8SjUPy.js +221 -0
- package/dist/diagram-S2PKOQOG-Dt8tkAYV.cjs +24 -0
- package/dist/diagram-S2PKOQOG-ub43sv-s.js +143 -0
- package/dist/diff-BxzP2J8R.js +6 -0
- package/dist/diff-CA31fCOg.cjs +1 -0
- package/dist/docker-CsHqm9tx.js +6 -0
- package/dist/docker-zJpMwmYa.cjs +1 -0
- package/dist/dotenv-BMjVjUL1.js +6 -0
- package/dist/dotenv-DpcNCNek.cjs +1 -0
- package/dist/dracula-BNgwAJ-d.cjs +1 -0
- package/dist/dracula-BtZx2Kac.js +4 -0
- package/dist/dracula-soft-BHZ7sHFu.cjs +1 -0
- package/dist/dracula-soft-BKa-aqBv.js +4 -0
- package/dist/dream-maker-BkijXDkm.cjs +1 -0
- package/dist/dream-maker-PAx17jaB.js +6 -0
- package/dist/edge-BYQkOzbF.js +12 -0
- package/dist/edge-DaIYN5Mx.cjs +1 -0
- package/dist/elixir-BH_wmMK4.cjs +1 -0
- package/dist/elixir-Dh036GMp.js +8 -0
- package/dist/elm-BtNbw_Cd.js +8 -0
- package/dist/elm-Dc4sEBjc.cjs +1 -0
- package/dist/emacs-lisp-C1UCIjUO.cjs +1 -0
- package/dist/emacs-lisp-Cfxdx5D-.js +6 -0
- package/dist/embed/adapters/index.d.ts +35 -0
- package/dist/embed/adapters/schnucks.d.ts +14 -0
- package/dist/embed/index.d.ts +28 -0
- package/dist/embed/types.d.ts +271 -0
- package/dist/erDiagram-Q2GNP2WA-BedCJvPU.js +843 -0
- package/dist/erDiagram-Q2GNP2WA-Br9BJisn.cjs +60 -0
- package/dist/erb-B4nLp42w.cjs +1 -0
- package/dist/erb-BWGJ5tqi.js +10 -0
- package/dist/erlang-CB2cfp6Z.cjs +1 -0
- package/dist/erlang-DNcDT8Hi.js +8 -0
- package/dist/everforest-dark-DMCBqXCK.js +4 -0
- package/dist/everforest-dark-_sBMomR1.cjs +1 -0
- package/dist/everforest-light-BbXl82Em.js +4 -0
- package/dist/everforest-light-H0xoYxl0.cjs +1 -0
- package/dist/fennel-Bz9-EMMc.cjs +1 -0
- package/dist/fennel-N4WcXuKx.js +6 -0
- package/dist/fish-BTDEUgqH.js +6 -0
- package/dist/fish-DwmQKRZi.cjs +1 -0
- package/dist/flowDiagram-NV44I4VS-BmBuMgfl.cjs +162 -0
- package/dist/flowDiagram-NV44I4VS-CBzphqqM.js +1628 -0
- package/dist/fluent-BMXUxfv1.js +6 -0
- package/dist/fluent-CJtpNuaO.cjs +1 -0
- package/dist/fortran-fixed-form-B67KFkXH.js +8 -0
- package/dist/fortran-fixed-form-CcXh5Xzk.cjs +1 -0
- package/dist/fortran-free-form-Cs4ztolN.cjs +1 -0
- package/dist/fortran-free-form-CwqYvCLJ.js +6 -0
- package/dist/fsharp-CYOiIVNx.js +8 -0
- package/dist/fsharp-DVcRF7k-.cjs +1 -0
- package/dist/ganttDiagram-JELNMOA3-Kdup3zfS.cjs +267 -0
- package/dist/ganttDiagram-JELNMOA3-Yo4EIK5K.js +2663 -0
- package/dist/gdresource-CHZmNkgx.cjs +1 -0
- package/dist/gdresource-CvCIUjhi.js +10 -0
- package/dist/gdscript-CfwMGZrG.cjs +1 -0
- package/dist/gdscript-DSAxJ_aS.js +6 -0
- package/dist/gdshader-Bk8fF6yr.js +6 -0
- package/dist/gdshader-DsmqQl4t.cjs +1 -0
- package/dist/genie-Dy2rU8CF.cjs +1 -0
- package/dist/genie-DzUvd7U9.js +6 -0
- package/dist/gherkin-BmiEVBJ1.cjs +1 -0
- package/dist/gherkin-DHRaV0YP.js +6 -0
- package/dist/git-commit-Bd32YZ0K.js +8 -0
- package/dist/git-commit-DlVDzq9L.cjs +1 -0
- package/dist/git-rebase-Bn4RLd7u.cjs +1 -0
- package/dist/git-rebase-ZWUFO_T4.js +8 -0
- package/dist/gitGraph-F6HP7TQM-Btl5lfkQ.js +5 -0
- package/dist/gitGraph-F6HP7TQM-DNBDRDSp.cjs +1 -0
- package/dist/gitGraphDiagram-NY62KEGX-5RaC6i4T.js +713 -0
- package/dist/gitGraphDiagram-NY62KEGX-CJwzQ72s.cjs +65 -0
- package/dist/github-dark-BKL9xNgN.cjs +1 -0
- package/dist/github-dark-DenFmJkN.js +4 -0
- package/dist/github-dark-default-BJPUVz4H.js +4 -0
- package/dist/github-dark-default-Dsv5MuSi.cjs +1 -0
- package/dist/github-dark-dimmed-CtB9hz8U.cjs +1 -0
- package/dist/github-dark-dimmed-DUshB20C.js +4 -0
- package/dist/github-dark-high-contrast-BqZVM-jF.cjs +1 -0
- package/dist/github-dark-high-contrast-D3aGCnF8.js +4 -0
- package/dist/github-light-BFTOhCbz.cjs +1 -0
- package/dist/github-light-JYsPkUQd.js +4 -0
- package/dist/github-light-default-BZoWH9dH.cjs +1 -0
- package/dist/github-light-default-D99KPAby.js +4 -0
- package/dist/github-light-high-contrast-BbmZE-Mp.js +4 -0
- package/dist/github-light-high-contrast-Ks3kPGJU.cjs +1 -0
- package/dist/gleam-Bv284lvN.js +6 -0
- package/dist/gleam-DHVuTCr7.cjs +1 -0
- package/dist/glimmer-js-CzmC7OX8.cjs +1 -0
- package/dist/glimmer-js-DkxNrfPT.js +14 -0
- package/dist/glimmer-ts-D6YZEmK_.js +14 -0
- package/dist/glimmer-ts-DLN2_wRt.cjs +1 -0
- package/dist/glsl-CQekZ3Zq.cjs +1 -0
- package/dist/glsl-CkUcVZNK.js +8 -0
- package/dist/gn-0WGnAyGi.cjs +1 -0
- package/dist/gn-XtJxiLa4.js +6 -0
- package/dist/gnuplot-CDPKvI9X.cjs +1 -0
- package/dist/gnuplot-yPG9-sE_.js +6 -0
- package/dist/go-CvFNMTvu.js +6 -0
- package/dist/go-j_hH531s.cjs +1 -0
- package/dist/graph-Bim_c7e_.js +381 -0
- package/dist/graph-Btxb2SJH.cjs +1 -0
- package/dist/graphql-BnP1YhXQ.cjs +1 -0
- package/dist/graphql-CBu2ehBn.js +14 -0
- package/dist/groovy-CJQTphOW.js +6 -0
- package/dist/groovy-D7VuDBXz.cjs +1 -0
- package/dist/gruvbox-dark-hard-C5HOtKIh.js +4 -0
- package/dist/gruvbox-dark-hard-CUGefKS6.cjs +1 -0
- package/dist/gruvbox-dark-medium-BoKPlKfz.cjs +1 -0
- package/dist/gruvbox-dark-medium-FVgwJHuz.js +4 -0
- package/dist/gruvbox-dark-soft-B46F314v.js +4 -0
- package/dist/gruvbox-dark-soft-DSrhOWeL.cjs +1 -0
- package/dist/gruvbox-light-hard-CJD38wDZ.js +4 -0
- package/dist/gruvbox-light-hard-De4IuseP.cjs +1 -0
- package/dist/gruvbox-light-medium-BlIhMYTA.js +4 -0
- package/dist/gruvbox-light-medium-CzMY3IEJ.cjs +1 -0
- package/dist/gruvbox-light-soft-DoPHyLVZ.js +4 -0
- package/dist/gruvbox-light-soft-U4iAIpWZ.cjs +1 -0
- package/dist/hack-BaDv2o40.cjs +1 -0
- package/dist/hack-ItRNKiEb.js +10 -0
- package/dist/haml-Bk21rGjP.cjs +1 -0
- package/dist/haml-NZLVzu_R.js +10 -0
- package/dist/handlebars-CJJi3lrU.cjs +1 -0
- package/dist/handlebars-mxStpSE7.js +14 -0
- package/dist/haskell-BShesV2P.cjs +1 -0
- package/dist/haskell-WeIwNIP6.js +6 -0
- package/dist/haxe-Bo5XuRS0.cjs +1 -0
- package/dist/haxe-TztHsm5T.js +6 -0
- package/dist/hcl-CrZnvm-1.cjs +1 -0
- package/dist/hcl-D438OF-I.js +6 -0
- package/dist/hjson-CEESwTUP.cjs +1 -0
- package/dist/hjson-DYBUbqOl.js +6 -0
- package/dist/hlsl-Bk8TCZNL.js +6 -0
- package/dist/hlsl-CyvYRIb9.cjs +1 -0
- package/dist/horizon-C2D7KeAq.cjs +1 -0
- package/dist/horizon-CJQ10nlf.js +4 -0
- package/dist/houston-BDYrDoDW.js +4 -0
- package/dist/houston-T57H3gQZ.cjs +1 -0
- package/dist/html-B50bmoVb.js +10 -0
- package/dist/html-C62Zf2h4.cjs +1 -0
- package/dist/html-derivative-C6bxFbFW.js +8 -0
- package/dist/html-derivative-NDb86jON.cjs +1 -0
- package/dist/http-BPlLI56k.cjs +1 -0
- package/dist/http-DLvAkeD-.js +14 -0
- package/dist/hurl-BQGBr8gH.cjs +1 -0
- package/dist/hurl-CgkFN90t.js +12 -0
- package/dist/hxml-GbqSQCLa.js +8 -0
- package/dist/hxml-vnw7fzrV.cjs +1 -0
- package/dist/hy-Brt5EZ7-.js +6 -0
- package/dist/hy-a1E2Ed6P.cjs +1 -0
- package/dist/imba-CR1Q6r17.cjs +1 -0
- package/dist/imba-CimUv-Uh.js +6 -0
- package/dist/index-BKXpmKzQ.cjs +907 -0
- package/dist/index-C3ZGeP_n.js +85028 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +276 -0
- package/dist/info-NVLQJR56-B1iCbwt8.js +5 -0
- package/dist/info-NVLQJR56-Di4GzswL.cjs +1 -0
- package/dist/infoDiagram-WHAUD3N6-C8uj75B1.cjs +2 -0
- package/dist/infoDiagram-WHAUD3N6-O-QlseLM.js +24 -0
- package/dist/ini-BZIuRIvJ.js +6 -0
- package/dist/ini-Dpu3Xy2p.cjs +1 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/java--6gf61wy.cjs +1 -0
- package/dist/java-DY6VlHhP.js +6 -0
- package/dist/javascript-C25yR2R2.js +6 -0
- package/dist/javascript-DgmXW4Ha.cjs +1 -0
- package/dist/jinja-6NmewwV8.cjs +1 -0
- package/dist/jinja-CFW5uAwY.js +11 -0
- package/dist/jison-CD9Qsaj0.cjs +1 -0
- package/dist/jison-DdreslRX.js +8 -0
- package/dist/journeyDiagram-XKPGCS4Q-CRi4O_Ya.cjs +139 -0
- package/dist/journeyDiagram-XKPGCS4Q-Cw0SAmTx.js +837 -0
- package/dist/json-DxJze_jm.js +6 -0
- package/dist/json-YkPizm35.cjs +1 -0
- package/dist/json5-BT4Fjg39.js +6 -0
- package/dist/json5-CCgFZiQn.cjs +1 -0
- package/dist/jsonc-CHjZD8gR.js +6 -0
- package/dist/jsonc-CKPHIcXW.cjs +1 -0
- package/dist/jsonl-BGuvDmy9.js +6 -0
- package/dist/jsonl-Dq56Hab-.cjs +1 -0
- package/dist/jsonnet-Bx2cfsXg.js +6 -0
- package/dist/jsonnet-Csh7E68F.cjs +1 -0
- package/dist/jssm-BcADi6EI.js +6 -0
- package/dist/jssm-D0M9iZPY.cjs +1 -0
- package/dist/jsx-BtKADgXT.js +6 -0
- package/dist/jsx-DLX6UGgg.cjs +1 -0
- package/dist/julia-1BTSV8k5.cjs +1 -0
- package/dist/julia-CZiKXNNP.js +16 -0
- package/dist/kanagawa-dragon-BJZF7xDr.cjs +1 -0
- package/dist/kanagawa-dragon-CiKur4Hl.js +4 -0
- package/dist/kanagawa-lotus-BKu-smKu.js +4 -0
- package/dist/kanagawa-lotus-BhgzmRV4.cjs +1 -0
- package/dist/kanagawa-wave-BgJip59C.cjs +1 -0
- package/dist/kanagawa-wave-CQwozSzG.js +4 -0
- package/dist/kanban-definition-3W4ZIXB7-BTT9x06D.cjs +89 -0
- package/dist/kanban-definition-3W4ZIXB7-BqenV9TH.js +720 -0
- package/dist/kdl-BNOv9TC3.js +6 -0
- package/dist/kdl-CDG1p2Qi.cjs +1 -0
- package/dist/kotlin-BHZjvNqT.cjs +1 -0
- package/dist/kotlin-ByBMgTeR.js +6 -0
- package/dist/kusto-C6kOQWT0.cjs +1 -0
- package/dist/kusto-DH_XitHS.js +6 -0
- package/dist/laserwave--izBLY1I.cjs +1 -0
- package/dist/laserwave-6a00oqik.js +4 -0
- package/dist/latex-B7rk9nsp.cjs +1 -0
- package/dist/latex-DugOA5yb.js +8 -0
- package/dist/layout-D56Krgvh.cjs +1 -0
- package/dist/layout-WY5KNA9e.js +1441 -0
- package/dist/lean-BnVxaZxY.js +6 -0
- package/dist/lean-DvVQmxVK.cjs +1 -0
- package/dist/less-B1GLI2Di.js +6 -0
- package/dist/less-Dtg8mm6P.cjs +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/light-plus-B5D0le0o.cjs +1 -0
- package/dist/light-plus-CZuVqSLX.js +4 -0
- package/dist/linear-DT60NxVS.js +219 -0
- package/dist/linear-DoulcyKt.cjs +1 -0
- package/dist/liquid-CHzkx3jT.js +14 -0
- package/dist/liquid-DjlCV7Vm.cjs +1 -0
- package/dist/llvm-DcRvQ_r8.cjs +1 -0
- package/dist/llvm-co1rIKs3.js +6 -0
- package/dist/log-Al8wyEFV.js +6 -0
- package/dist/log-CjTZ0gSB.cjs +1 -0
- package/dist/logo-BAktp_5i.cjs +1 -0
- package/dist/logo-DBa4JDzV.js +6 -0
- package/dist/lua-Bp3IRv7I.js +8 -0
- package/dist/lua-t8TDI8Os.cjs +1 -0
- package/dist/luau-BMXmwtw0.cjs +1 -0
- package/dist/luau-UQyhudEE.js +6 -0
- package/dist/make-CsMclxtr.js +6 -0
- package/dist/make-NcdIe21U.cjs +1 -0
- package/dist/markdown-Byu9Sdmq.cjs +1 -0
- package/dist/markdown-CrScaQ96.js +6 -0
- package/dist/marko-BAIoWxJR.cjs +1 -0
- package/dist/marko-Ns9BYtDO.js +14 -0
- package/dist/material-theme-D6KBX41T.js +4 -0
- package/dist/material-theme-Dj0-OyRN.cjs +1 -0
- package/dist/material-theme-darker-CkRroheE.js +4 -0
- package/dist/material-theme-darker-Dvfs29ir.cjs +1 -0
- package/dist/material-theme-lighter-BUBw43Yz.js +4 -0
- package/dist/material-theme-lighter-EU3ZGl_r.cjs +1 -0
- package/dist/material-theme-ocean-ClGX14Ja.js +4 -0
- package/dist/material-theme-ocean-px_3Pwqa.cjs +1 -0
- package/dist/material-theme-palenight-38jxvsGX.cjs +1 -0
- package/dist/material-theme-palenight-C1RVm8K1.js +4 -0
- package/dist/matlab-BOAaUVP0.js +6 -0
- package/dist/matlab-CHTOL9Kx.cjs +1 -0
- package/dist/mdc-DEPKJPdx.cjs +1 -0
- package/dist/mdc-uaivvctV.js +12 -0
- package/dist/mdx-BOhZZUJ8.js +6 -0
- package/dist/mdx-CjwI68TB.cjs +1 -0
- package/dist/mermaid-BXSwQYo5.cjs +1 -0
- package/dist/mermaid-C3rz4dYh.js +6 -0
- package/dist/mermaid-VLURNSYL-BFvnL4gG.js +4 -0
- package/dist/mermaid-VLURNSYL-DJRCV7vM.cjs +1 -0
- package/dist/mermaid-parser.core-BCDozT5p.js +15138 -0
- package/dist/mermaid-parser.core-PbXXtTvb.cjs +128 -0
- package/dist/mermaid.core-DBTj9jyI.cjs +196 -0
- package/dist/mermaid.core-DeqGW69S.js +12539 -0
- package/dist/min-B1iq2yfT.cjs +1 -0
- package/dist/min-dark-C7ak0t6c.js +4 -0
- package/dist/min-dark-tt5o_I5e.cjs +1 -0
- package/dist/min-light-CKFxVcPp.js +4 -0
- package/dist/min-light-tmTHl_CQ.cjs +1 -0
- package/dist/min-tayQBuqv.js +38 -0
- package/dist/mindmap-definition-VGOIOE7T-BMuMhK7g.cjs +68 -0
- package/dist/mindmap-definition-VGOIOE7T-CnIvjLot.js +786 -0
- package/dist/mipsasm-BSlRcFIy.cjs +1 -0
- package/dist/mipsasm-CTx18fBl.js +6 -0
- package/dist/mojo-CgKe2b8g.js +6 -0
- package/dist/mojo-D2tXKFxS.cjs +1 -0
- package/dist/monokai-C1KBYcO0.js +4 -0
- package/dist/monokai-DMIxv6MM.cjs +1 -0
- package/dist/moonbit-BweIWWUc.cjs +1 -0
- package/dist/moonbit-NVPuhMCm.js +6 -0
- package/dist/move-CSharPAA.cjs +1 -0
- package/dist/move-Db4ltDq1.js +6 -0
- package/dist/narrat-CBeKHgTl.cjs +1 -0
- package/dist/narrat-DmhDCBs-.js +6 -0
- package/dist/nextflow-CM8Ed358.cjs +1 -0
- package/dist/nextflow-DmSVRGjG.js +6 -0
- package/dist/nginx-C4RNJ7jQ.cjs +1 -0
- package/dist/nginx-D7O4WoB1.js +8 -0
- package/dist/night-owl-BN78kThQ.cjs +1 -0
- package/dist/night-owl-Bm2rzalh.js +4 -0
- package/dist/night-owl-light-CBI5u5kw.js +4 -0
- package/dist/night-owl-light-jQpY3cYP.cjs +1 -0
- package/dist/nim-Bqmp5Of3.cjs +1 -0
- package/dist/nim-QAjRdh9w.js +20 -0
- package/dist/nix-BOiBJUDf.cjs +1 -0
- package/dist/nix-fTRXMGic.js +9 -0
- package/dist/nord-CC5OiUXg.js +4 -0
- package/dist/nord-Ca5AGUWc.cjs +1 -0
- package/dist/nushell-D8j3dhT-.js +6 -0
- package/dist/nushell-nGrB_wpI.cjs +1 -0
- package/dist/objective-c-Itk8tzmv.js +6 -0
- package/dist/objective-c-RjkWwFge.cjs +1 -0
- package/dist/objective-cpp-DGt5UKRO.js +6 -0
- package/dist/objective-cpp-HnfhWwRe.cjs +1 -0
- package/dist/ocaml-Cx8ewW_A.cjs +1 -0
- package/dist/ocaml-eSVK32Eg.js +6 -0
- package/dist/odin-BItnF517.js +6 -0
- package/dist/odin-CKw-zgwf.cjs +1 -0
- package/dist/one-dark-pro-C09VQHwB.cjs +1 -0
- package/dist/one-dark-pro-DTA3VF0_.js +4 -0
- package/dist/one-light-Cwg0lqft.cjs +1 -0
- package/dist/one-light-LkMrt1Cf.js +4 -0
- package/dist/openscad-D7eUrVPv.cjs +1 -0
- package/dist/openscad-Sp5uZ6f2.js +6 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/packet-BFZMPI3H-NtLj0px9.cjs +1 -0
- package/dist/packet-BFZMPI3H-OjJvLifn.js +5 -0
- package/dist/pascal-DBu9vQ2o.cjs +1 -0
- package/dist/pascal-xy8pJNns.js +6 -0
- package/dist/perl-CxWZPeDZ.cjs +1 -0
- package/dist/perl-DkVrgJBg.js +16 -0
- package/dist/php-BIzsF_5x.js +18 -0
- package/dist/php-CwdkidrA.cjs +1 -0
- package/dist/pie-7BOR55EZ-B9U78pdf.js +5 -0
- package/dist/pie-7BOR55EZ-Bbv5AaOa.cjs +1 -0
- package/dist/pieDiagram-ADFJNKIX-Bv7m0-X4.cjs +30 -0
- package/dist/pieDiagram-ADFJNKIX-CUo6edsc.js +162 -0
- package/dist/pkl-C-zSNmaA.js +6 -0
- package/dist/pkl-Dvyry4Rm.cjs +1 -0
- package/dist/plastic-CSTz3KZp.js +4 -0
- package/dist/plastic-r5piqq-S.cjs +1 -0
- package/dist/plsql-IJkoPJ9P.cjs +1 -0
- package/dist/plsql-pVbGZfOv.js +6 -0
- package/dist/po-BNfHvqmm.js +6 -0
- package/dist/po-Rhu6MvnX.cjs +1 -0
- package/dist/poimandres-BLP3NNjc.cjs +1 -0
- package/dist/poimandres-C-VADXHD.js +4 -0
- package/dist/polar-BtWqSUq2.cjs +1 -0
- package/dist/polar-CAZahv3u.js +6 -0
- package/dist/postcss-05aHdL-n.js +6 -0
- package/dist/postcss-Dh97DcaJ.cjs +1 -0
- package/dist/powerquery-BGL6VIw7.cjs +1 -0
- package/dist/powerquery-DI9HkTvs.js +6 -0
- package/dist/powershell-BiEPMjy-.cjs +1 -0
- package/dist/powershell-Clc4ydu-.js +6 -0
- package/dist/prisma-Dp473sn0.cjs +1 -0
- package/dist/prisma-FZjmVtSl.js +6 -0
- package/dist/prolog-C5-yg4TO.js +6 -0
- package/dist/prolog-N1U-3UeF.cjs +1 -0
- package/dist/proto-C7QgialS.js +6 -0
- package/dist/proto-DMjUErYA.cjs +1 -0
- package/dist/pug-DiGNE7sm.cjs +1 -0
- package/dist/pug-XOw9Q1Ho.js +12 -0
- package/dist/puppet-CUJHmnxV.js +6 -0
- package/dist/puppet-cDQP_ZC_.cjs +1 -0
- package/dist/purescript-DMxb59gF.cjs +1 -0
- package/dist/purescript-rUfGld-4.js +6 -0
- package/dist/python-BFNSHbwJ.js +6 -0
- package/dist/python-s9jfVbew.cjs +1 -0
- package/dist/qml-beorq0E4.cjs +1 -0
- package/dist/qml-rTNXsquU.js +8 -0
- package/dist/qmldir-BInDYbpo.js +6 -0
- package/dist/qmldir-DNF9H2ir.cjs +1 -0
- package/dist/qss-AeJTysr_.js +6 -0
- package/dist/qss-DwA_oiAM.cjs +1 -0
- package/dist/quadrantDiagram-AYHSOK5B-DXNOfdUN.cjs +7 -0
- package/dist/quadrantDiagram-AYHSOK5B-Dqg6NqgJ.js +1025 -0
- package/dist/r-CSmzDPi7.js +6 -0
- package/dist/r-DAqIyZhh.cjs +1 -0
- package/dist/racket-B83wSAja.js +6 -0
- package/dist/racket-D4laxZit.cjs +1 -0
- package/dist/radar-NHE76QYJ-BPK3O5AX.cjs +1 -0
- package/dist/radar-NHE76QYJ-Ld9VMP2q.js +5 -0
- package/dist/raku-DHySPsLw.cjs +1 -0
- package/dist/raku-nEQ4ZJJ7.js +6 -0
- package/dist/razor-Bl12i3Gx.cjs +1 -0
- package/dist/razor-Ci8D0dQK.js +10 -0
- package/dist/red-7y8PH7HH.js +4 -0
- package/dist/red-BQGOv1D5.cjs +1 -0
- package/dist/reg-CevkCKuZ.cjs +1 -0
- package/dist/reg-m_s_Kiip.js +6 -0
- package/dist/regexp-BazyLpPg.js +6 -0
- package/dist/regexp-DabTWNLE.cjs +1 -0
- package/dist/rel-BS5APza7.cjs +1 -0
- package/dist/rel-BcRfyd6Q.js +6 -0
- package/dist/requirementDiagram-UZGBJVZJ-Dft87FpO.cjs +64 -0
- package/dist/requirementDiagram-UZGBJVZJ-LNaRwxeO.js +852 -0
- package/dist/riscv-BnGFr6V7.cjs +1 -0
- package/dist/riscv-Ce8MAQLP.js +6 -0
- package/dist/ron-BboLFi1G.js +6 -0
- package/dist/ron-CsbIGKuM.cjs +1 -0
- package/dist/rose-pine-BKc3yVeu.js +4 -0
- package/dist/rose-pine-CfBWm6WX.cjs +1 -0
- package/dist/rose-pine-dawn-BulJcPZT.js +4 -0
- package/dist/rose-pine-dawn-CaZ5I2lt.cjs +1 -0
- package/dist/rose-pine-moon-Cql8LDLp.cjs +1 -0
- package/dist/rose-pine-moon-j6jiXKV8.js +4 -0
- package/dist/rosmsg-C7VSFzUC.cjs +1 -0
- package/dist/rosmsg-Cz0w1km8.js +6 -0
- package/dist/rst-BJB_3FCk.js +22 -0
- package/dist/rst-CSeS1IRe.cjs +1 -0
- package/dist/ruby-Chl-GArK.js +30 -0
- package/dist/ruby-D6NwHIKi.cjs +1 -0
- package/dist/rust-CLzF9zIN.js +6 -0
- package/dist/rust-CNeTMPbB.cjs +1 -0
- package/dist/sankeyDiagram-TZEHDZUN-CT66OJPC.cjs +10 -0
- package/dist/sankeyDiagram-TZEHDZUN-Cee2Zly1.js +811 -0
- package/dist/sas-D5Fn8Q38.cjs +1 -0
- package/dist/sas-fpEvgATw.js +8 -0
- package/dist/sass-DxHp5rTx.js +6 -0
- package/dist/sass-vyo-bUwh.cjs +1 -0
- package/dist/scala-D4grkFkl.js +6 -0
- package/dist/scala-ZSekD-8-.cjs +1 -0
- package/dist/scheme-BCRWuEm4.js +6 -0
- package/dist/scheme-vM0LdD-_.cjs +1 -0
- package/dist/scss-B1FaCqwR.js +8 -0
- package/dist/scss-CKlduTMv.cjs +1 -0
- package/dist/sdbl-B7T8abf4.js +6 -0
- package/dist/sdbl-DeWT5r4i.cjs +1 -0
- package/dist/sequenceDiagram-WL72ISMW-D4GRw_RV.js +2519 -0
- package/dist/sequenceDiagram-WL72ISMW-DWjjmnlZ.cjs +145 -0
- package/dist/shaderlab-Cr62-Wb4.js +8 -0
- package/dist/shaderlab-DGJjQHxC.cjs +1 -0
- package/dist/shellscript-DYWjN7qW.cjs +1 -0
- package/dist/shellscript-InADTalH.js +6 -0
- package/dist/shellsession-DMUSXX8m.cjs +1 -0
- package/dist/shellsession-DiDJNQdy.js +8 -0
- package/dist/slack-dark-akqwQ7ED.cjs +1 -0
- package/dist/slack-dark-i7wN4OET.js +4 -0
- package/dist/slack-ochin-BoQQWmTv.cjs +1 -0
- package/dist/slack-ochin-ndHf0LoP.js +4 -0
- package/dist/smalltalk-BNs6hxu4.cjs +1 -0
- package/dist/smalltalk-BlI1_OkM.js +6 -0
- package/dist/snazzy-light-BlSJXAu4.js +4 -0
- package/dist/snazzy-light-D_IwRieF.cjs +1 -0
- package/dist/solarized-dark-UTmkh7lw.js +4 -0
- package/dist/solarized-dark-gmm-WbDC.cjs +1 -0
- package/dist/solarized-light-BheCkDPT.js +4 -0
- package/dist/solarized-light-DzcxRSZP.cjs +1 -0
- package/dist/solidity-DUWnFhS6.js +6 -0
- package/dist/solidity-uQuzgchP.cjs +1 -0
- package/dist/soy-C1-6njHa.js +8 -0
- package/dist/soy-CDFPDtGX.cjs +1 -0
- package/dist/sparql-6Cg9ppCl.cjs +1 -0
- package/dist/sparql-B0KWFEri.js +8 -0
- package/dist/splunk-CRXR8A9s.js +6 -0
- package/dist/splunk-CWPivao_.cjs +1 -0
- package/dist/sql-Cn_v3PB0.js +6 -0
- package/dist/sql-DhUUVgH1.cjs +1 -0
- package/dist/ssh-config-B93wBIBa.cjs +1 -0
- package/dist/ssh-config-DP-hNVbF.js +6 -0
- package/dist/stata-B8c5fTjX.js +8 -0
- package/dist/stata-DCWFCQQG.cjs +1 -0
- package/dist/stateDiagram-FKZM4ZOC-BQjU7k-s.cjs +1 -0
- package/dist/stateDiagram-FKZM4ZOC-CzEUKDer.js +264 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CBcxnSVT.cjs +1 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CHrcUqtm.js +17 -0
- package/dist/storage.d.ts +11 -0
- package/dist/style.css +1 -0
- package/dist/stylus-B64Bt0D4.cjs +1 -0
- package/dist/stylus-CyKEU1Ej.js +6 -0
- package/dist/surrealql-CQi7GQN7.js +8 -0
- package/dist/surrealql-CYTDVsyo.cjs +1 -0
- package/dist/svelte-CYf4HR3U.js +14 -0
- package/dist/svelte-Do4zIqEL.cjs +1 -0
- package/dist/swift-9UzSvamq.js +6 -0
- package/dist/swift-BMbGdc3j.cjs +1 -0
- package/dist/synthwave-84-BBRLOmNT.cjs +1 -0
- package/dist/synthwave-84-NU3C_KFZ.js +4 -0
- package/dist/system-verilog-BCm7smPJ.js +6 -0
- package/dist/system-verilog-BFclLo9e.cjs +1 -0
- package/dist/systemd-C-4qm6XH.js +6 -0
- package/dist/systemd-Dtw7P4tb.cjs +1 -0
- package/dist/talonscript-CFF3LF_O.js +6 -0
- package/dist/talonscript-D8SvZJVc.cjs +1 -0
- package/dist/tasl--DC4oX-L.cjs +1 -0
- package/dist/tasl-Cg_WBUAe.js +6 -0
- package/dist/tcl-0Q0H86Yn.cjs +1 -0
- package/dist/tcl-DN7buRTF.js +6 -0
- package/dist/templ-Crs9Ui8q.js +12 -0
- package/dist/templ-DOvXA9fa.cjs +1 -0
- package/dist/terraform-C0RDrmWi.cjs +1 -0
- package/dist/terraform-DGvcn9zM.js +6 -0
- package/dist/tex-BvKThJ8p.js +8 -0
- package/dist/tex-Dz7jjuD4.cjs +1 -0
- package/dist/timeline-definition-IT6M3QCI-BRJUMNe5.cjs +61 -0
- package/dist/timeline-definition-IT6M3QCI-u9ntvQge.js +802 -0
- package/dist/tokyo-night-DP4TmcQl.js +4 -0
- package/dist/tokyo-night-GOhjzM5y.cjs +1 -0
- package/dist/toml-DY62mUL_.js +6 -0
- package/dist/toml-Q64DoSvG.cjs +1 -0
- package/dist/treemap-KMMF4GRG-8xzdFZn9.js +5 -0
- package/dist/treemap-KMMF4GRG-d1R9htnC.cjs +1 -0
- package/dist/ts-tags-DILCom6A.cjs +1 -0
- package/dist/ts-tags-ioVe2PKw.js +41 -0
- package/dist/tsv-BtvSkaG0.js +6 -0
- package/dist/tsv-DqNGnuVj.cjs +1 -0
- package/dist/tsx-B8rCNbgL.js +6 -0
- package/dist/tsx-DIpfUf9u.cjs +1 -0
- package/dist/turtle-DipIidr5.cjs +1 -0
- package/dist/turtle-_H59FV7D.js +6 -0
- package/dist/twig-DWdZLOs_.js +18 -0
- package/dist/twig-DenAwVTh.cjs +1 -0
- package/dist/typescript-RycA9KXf.js +6 -0
- package/dist/typescript-b48wo4zk.cjs +1 -0
- package/dist/typespec-DWqp-kUU.js +6 -0
- package/dist/typespec-DqXOE4_L.cjs +1 -0
- package/dist/typst-Cqq4j4V-.cjs +1 -0
- package/dist/typst-D_1QKWns.js +6 -0
- package/dist/v-81C2s01-.cjs +1 -0
- package/dist/v-BPCNiyYe.js +6 -0
- package/dist/vala-CsAYdCD2.cjs +1 -0
- package/dist/vala-uxaPR7d1.js +6 -0
- package/dist/vb-AiTMb16X.cjs +1 -0
- package/dist/vb-D8_c5-KN.js +6 -0
- package/dist/verilog-AMohXZcN.cjs +1 -0
- package/dist/verilog-B-bybjPF.js +6 -0
- package/dist/vesper-B59Iw4gV.cjs +1 -0
- package/dist/vesper-BckBta1U.js +4 -0
- package/dist/vhdl-CUlNa8ac.js +6 -0
- package/dist/vhdl-DIdR1NA5.cjs +1 -0
- package/dist/viml-D01eKeA4.cjs +1 -0
- package/dist/viml-DsfA-sWm.js +6 -0
- package/dist/vitesse-black-BoGvW84i.js +4 -0
- package/dist/vitesse-black-MF-1S1MG.cjs +1 -0
- package/dist/vitesse-dark-Cym-eLtO.js +4 -0
- package/dist/vitesse-dark-SIffJYSe.cjs +1 -0
- package/dist/vitesse-light-CcmG315c.js +4 -0
- package/dist/vitesse-light-U63SkYGT.cjs +1 -0
- package/dist/vue-DXEmyXn9.js +31 -0
- package/dist/vue-S9bl2EgW.cjs +1 -0
- package/dist/vue-html-B2-sfQT7.cjs +1 -0
- package/dist/vue-html-j9xNEdu3.js +8 -0
- package/dist/vue-vine-CpIsWjsQ.cjs +1 -0
- package/dist/vue-vine-D41-N99t.js +18 -0
- package/dist/vyper-CPQuu50u.js +6 -0
- package/dist/vyper-DTzyzn3a.cjs +1 -0
- package/dist/wasm-BBXxrAl7.js +6 -0
- package/dist/wasm-DQxwEHae.js +7 -0
- package/dist/wasm-Dp-QrJpp.cjs +1 -0
- package/dist/wasm-Dw4u1m6u.cjs +1 -0
- package/dist/wenyan-CRNx8UP3.cjs +1 -0
- package/dist/wenyan-pbVjoM9_.js +6 -0
- package/dist/wgsl-DF5qc9dd.cjs +1 -0
- package/dist/wgsl-DY4iK1q1.js +6 -0
- package/dist/wikitext-D7uzEIfK.cjs +1 -0
- package/dist/wikitext-Z-MoUasO.js +6 -0
- package/dist/wit-BjWgLsJj.cjs +1 -0
- package/dist/wit-CQMQOlTg.js +6 -0
- package/dist/wolfram-BR4t3Ffc.cjs +1 -0
- package/dist/wolfram-Dz4KXISs.js +6 -0
- package/dist/xml-BpsKWkuV.cjs +1 -0
- package/dist/xml-C2J0sS9M.js +8 -0
- package/dist/xsl-BmSZphgC.js +8 -0
- package/dist/xsl-D-3VYix6.cjs +1 -0
- package/dist/xychartDiagram-PRI3JC2R-BHJGbZEw.cjs +7 -0
- package/dist/xychartDiagram-PRI3JC2R-SI_96zbi.js +1341 -0
- package/dist/yaml-DaO7k5B1.js +6 -0
- package/dist/yaml-XVBmpKh-.cjs +1 -0
- package/dist/zenscript-CxBjpf9c.js +6 -0
- package/dist/zenscript-fNvwKexi.cjs +1 -0
- package/dist/zig-BAyIAcWK.cjs +1 -0
- package/dist/zig-Vm0PO9wB.js +6 -0
- package/package.json +94 -0
|
@@ -0,0 +1,2693 @@
|
|
|
1
|
+
var Tr = Object.defineProperty;
|
|
2
|
+
var Br = Object.getPrototypeOf;
|
|
3
|
+
var jr = Reflect.get;
|
|
4
|
+
var Ve = (e) => {
|
|
5
|
+
throw TypeError(e);
|
|
6
|
+
};
|
|
7
|
+
var Vr = (e, r, t) => r in e ? Tr(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
8
|
+
var ye = (e, r, t) => Vr(e, typeof r != "symbol" ? r + "" : r, t), Ce = (e, r, t) => r.has(e) || Ve("Cannot " + t);
|
|
9
|
+
var $ = (e, r, t) => (Ce(e, r, "read from private field"), t ? t.call(e) : r.get(e)), z = (e, r, t) => r.has(e) ? Ve("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), M = (e, r, t, n) => (Ce(e, r, "write to private field"), n ? n.call(e, t) : r.set(e, t), t), be = (e, r, t) => (Ce(e, r, "access private method"), t);
|
|
10
|
+
var ze = (e, r, t) => jr(Br(e), t, r);
|
|
11
|
+
import { C as zr, j as v, D as Wr, u as Re, a as Hr, b as Xr } from "./index-C3ZGeP_n.js";
|
|
12
|
+
import { useContext as Zr, useMemo as pr, useState as Qr, useEffect as qr, memo as Jr } from "react";
|
|
13
|
+
function ne(e) {
|
|
14
|
+
if ([...e].length !== 1) throw new Error(`Expected "${e}" to be a single code point`);
|
|
15
|
+
return e.codePointAt(0);
|
|
16
|
+
}
|
|
17
|
+
function Kr(e, r, t) {
|
|
18
|
+
return e.has(r) || e.set(r, t), e.get(r);
|
|
19
|
+
}
|
|
20
|
+
const Ue = /* @__PURE__ */ new Set(["alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "word", "xdigit"]), x = String.raw;
|
|
21
|
+
function se(e, r) {
|
|
22
|
+
if (e == null) throw new Error(r ?? "Value expected");
|
|
23
|
+
return e;
|
|
24
|
+
}
|
|
25
|
+
const dr = x`\[\^?`, gr = `c.? | C(?:-.?)?|${x`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${x`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${x`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${x`o\{[^\}]*\}?`}|${x`\d{1,3}`}`, Oe = /[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/, le = new RegExp(x`
|
|
26
|
+
\\ (?:
|
|
27
|
+
${gr}
|
|
28
|
+
| [gk]<[^>]*>?
|
|
29
|
+
| [gk]'[^']*'?
|
|
30
|
+
| .
|
|
31
|
+
)
|
|
32
|
+
| \( (?:
|
|
33
|
+
\? (?:
|
|
34
|
+
[:=!>({]
|
|
35
|
+
| <[=!]
|
|
36
|
+
| <[^>]*>
|
|
37
|
+
| '[^']*'
|
|
38
|
+
| ~\|?
|
|
39
|
+
| #(?:[^)\\]|\\.?)*
|
|
40
|
+
| [^:)]*[:)]
|
|
41
|
+
)?
|
|
42
|
+
| \*[^\)]*\)?
|
|
43
|
+
)?
|
|
44
|
+
| (?:${Oe.source})+
|
|
45
|
+
| ${dr}
|
|
46
|
+
| .
|
|
47
|
+
`.replace(/\s+/g, ""), "gsu"), xe = new RegExp(x`
|
|
48
|
+
\\ (?:
|
|
49
|
+
${gr}
|
|
50
|
+
| .
|
|
51
|
+
)
|
|
52
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
53
|
+
| ${dr}
|
|
54
|
+
| &&
|
|
55
|
+
| .
|
|
56
|
+
`.replace(/\s+/g, ""), "gsu");
|
|
57
|
+
function Yr(e, r = {}) {
|
|
58
|
+
const t = { flags: "", ...r, rules: { captureGroup: !1, singleline: !1, ...r.rules } };
|
|
59
|
+
if (typeof e != "string") throw new Error("String expected as pattern");
|
|
60
|
+
const n = yt(t.flags), s = [n.extended], o = { captureGroup: t.rules.captureGroup, getCurrentModX() {
|
|
61
|
+
return s.at(-1);
|
|
62
|
+
}, numOpenGroups: 0, popModX() {
|
|
63
|
+
s.pop();
|
|
64
|
+
}, pushModX(f) {
|
|
65
|
+
s.push(f);
|
|
66
|
+
}, replaceCurrentModX(f) {
|
|
67
|
+
s[s.length - 1] = f;
|
|
68
|
+
}, singleline: t.rules.singleline };
|
|
69
|
+
let a = [], i;
|
|
70
|
+
for (le.lastIndex = 0; i = le.exec(e); ) {
|
|
71
|
+
const f = et(o, e, i[0], le.lastIndex);
|
|
72
|
+
f.tokens ? a.push(...f.tokens) : f.token && a.push(f.token), f.lastIndex !== void 0 && (le.lastIndex = f.lastIndex);
|
|
73
|
+
}
|
|
74
|
+
const u = [];
|
|
75
|
+
let c = 0;
|
|
76
|
+
a.filter((f) => f.type === "GroupOpen").forEach((f) => {
|
|
77
|
+
f.kind === "capturing" ? f.number = ++c : f.raw === "(" && u.push(f);
|
|
78
|
+
}), c || u.forEach((f, p) => {
|
|
79
|
+
f.kind = "capturing", f.number = p + 1;
|
|
80
|
+
});
|
|
81
|
+
const l = c || u.length;
|
|
82
|
+
return { tokens: a.map((f) => f.type === "EscapedNumber" ? bt(f, l) : f).flat(), flags: n };
|
|
83
|
+
}
|
|
84
|
+
function et(e, r, t, n) {
|
|
85
|
+
const [s, o] = t;
|
|
86
|
+
if (t === "[" || t === "[^") {
|
|
87
|
+
const a = rt(r, t, n);
|
|
88
|
+
return { tokens: a.tokens, lastIndex: a.lastIndex };
|
|
89
|
+
}
|
|
90
|
+
if (s === "\\") {
|
|
91
|
+
if ("AbBGyYzZ".includes(o)) return { token: We(t, t) };
|
|
92
|
+
if (/^\\g[<']/.test(t)) {
|
|
93
|
+
if (!/^\\g(?:<[^>]+>|'[^']+')$/.test(t)) throw new Error(`Invalid group name "${t}"`);
|
|
94
|
+
return { token: ft(t) };
|
|
95
|
+
}
|
|
96
|
+
if (/^\\k[<']/.test(t)) {
|
|
97
|
+
if (!/^\\k(?:<[^>]+>|'[^']+')$/.test(t)) throw new Error(`Invalid group name "${t}"`);
|
|
98
|
+
return { token: mr(t) };
|
|
99
|
+
}
|
|
100
|
+
if (o === "K") return { token: wr("keep", t) };
|
|
101
|
+
if (o === "N" || o === "R") return { token: X("newline", t, { negate: o === "N" }) };
|
|
102
|
+
if (o === "O") return { token: X("any", t) };
|
|
103
|
+
if (o === "X") return { token: X("text_segment", t) };
|
|
104
|
+
const a = hr(t, { inCharClass: !1 });
|
|
105
|
+
return Array.isArray(a) ? { tokens: a } : { token: a };
|
|
106
|
+
}
|
|
107
|
+
if (s === "(") {
|
|
108
|
+
if (o === "*") return { token: ht(t) };
|
|
109
|
+
if (t === "(?{") throw new Error(`Unsupported callout "${t}"`);
|
|
110
|
+
if (t.startsWith("(?#")) {
|
|
111
|
+
if (r[n] !== ")") throw new Error('Unclosed comment group "(?#"');
|
|
112
|
+
return { lastIndex: n + 1 };
|
|
113
|
+
}
|
|
114
|
+
if (/^\(\?[-imx]+[:)]$/.test(t)) return { token: gt(t, e) };
|
|
115
|
+
if (e.pushModX(e.getCurrentModX()), e.numOpenGroups++, t === "(" && !e.captureGroup || t === "(?:") return { token: re("group", t) };
|
|
116
|
+
if (t === "(?>") return { token: re("atomic", t) };
|
|
117
|
+
if (t === "(?=" || t === "(?!" || t === "(?<=" || t === "(?<!") return { token: re(t[2] === "<" ? "lookbehind" : "lookahead", t, { negate: t.endsWith("!") }) };
|
|
118
|
+
if (t === "(" && e.captureGroup || t.startsWith("(?<") && t.endsWith(">") || t.startsWith("(?'") && t.endsWith("'")) return { token: re("capturing", t, { ...t !== "(" && { name: t.slice(3, -1) } }) };
|
|
119
|
+
if (t.startsWith("(?~")) {
|
|
120
|
+
if (t === "(?~|") throw new Error(`Unsupported absence function kind "${t}"`);
|
|
121
|
+
return { token: re("absence_repeater", t) };
|
|
122
|
+
}
|
|
123
|
+
throw t === "(?(" ? new Error(`Unsupported conditional "${t}"`) : new Error(`Invalid or unsupported group option "${t}"`);
|
|
124
|
+
}
|
|
125
|
+
if (t === ")") {
|
|
126
|
+
if (e.popModX(), e.numOpenGroups--, e.numOpenGroups < 0) throw new Error('Unmatched ")"');
|
|
127
|
+
return { token: ut(t) };
|
|
128
|
+
}
|
|
129
|
+
if (e.getCurrentModX()) {
|
|
130
|
+
if (t === "#") {
|
|
131
|
+
const a = r.indexOf(`
|
|
132
|
+
`, n);
|
|
133
|
+
return { lastIndex: a === -1 ? r.length : a };
|
|
134
|
+
}
|
|
135
|
+
if (/^\s$/.test(t)) {
|
|
136
|
+
const a = /\s+/y;
|
|
137
|
+
return a.lastIndex = n, { lastIndex: a.exec(r) ? a.lastIndex : n };
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (t === ".") return { token: X("dot", t) };
|
|
141
|
+
if (t === "^" || t === "$") {
|
|
142
|
+
const a = e.singleline ? { "^": x`\A`, $: x`\Z` }[t] : t;
|
|
143
|
+
return { token: We(a, t) };
|
|
144
|
+
}
|
|
145
|
+
return t === "|" ? { token: nt(t) } : Oe.test(t) ? { tokens: xt(t) } : { token: R(ne(t), t) };
|
|
146
|
+
}
|
|
147
|
+
function rt(e, r, t) {
|
|
148
|
+
const n = [He(r[1] === "^", r)];
|
|
149
|
+
let s = 1, o;
|
|
150
|
+
for (xe.lastIndex = t; o = xe.exec(e); ) {
|
|
151
|
+
const a = o[0];
|
|
152
|
+
if (a[0] === "[" && a[1] !== ":") s++, n.push(He(a[1] === "^", a));
|
|
153
|
+
else if (a === "]") {
|
|
154
|
+
if (n.at(-1).type === "CharacterClassOpen") n.push(R(93, a));
|
|
155
|
+
else if (s--, n.push(st(a)), !s) break;
|
|
156
|
+
} else {
|
|
157
|
+
const i = tt(a);
|
|
158
|
+
Array.isArray(i) ? n.push(...i) : n.push(i);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return { tokens: n, lastIndex: xe.lastIndex || e.length };
|
|
162
|
+
}
|
|
163
|
+
function tt(e) {
|
|
164
|
+
if (e[0] === "\\") return hr(e, { inCharClass: !0 });
|
|
165
|
+
if (e[0] === "[") {
|
|
166
|
+
const r = /\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);
|
|
167
|
+
if (!r || !Ue.has(r.groups.name)) throw new Error(`Invalid POSIX class "${e}"`);
|
|
168
|
+
return X("posix", e, { value: r.groups.name, negate: !!r.groups.negate });
|
|
169
|
+
}
|
|
170
|
+
return e === "-" ? ot(e) : e === "&&" ? at(e) : R(ne(e), e);
|
|
171
|
+
}
|
|
172
|
+
function hr(e, { inCharClass: r }) {
|
|
173
|
+
const t = e[1];
|
|
174
|
+
if (t === "c" || t === "C") return dt(e);
|
|
175
|
+
if ("dDhHsSwW".includes(t)) return mt(e);
|
|
176
|
+
if (e.startsWith(x`\o{`)) throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);
|
|
177
|
+
if (/^\\[pP]\{/.test(e)) {
|
|
178
|
+
if (e.length === 3) throw new Error(`Incomplete or invalid Unicode property "${e}"`);
|
|
179
|
+
return wt(e);
|
|
180
|
+
}
|
|
181
|
+
if (new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}", "u").test(e)) try {
|
|
182
|
+
const n = e.split(/\\x/).slice(1).map((a) => parseInt(a, 16)), s = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }).decode(new Uint8Array(n)), o = new TextEncoder();
|
|
183
|
+
return [...s].map((a) => {
|
|
184
|
+
const i = [...o.encode(a)].map((u) => `\\x${u.toString(16)}`).join("");
|
|
185
|
+
return R(ne(a), i);
|
|
186
|
+
});
|
|
187
|
+
} catch {
|
|
188
|
+
throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`);
|
|
189
|
+
}
|
|
190
|
+
if (t === "u" || t === "x") return R(Ct(e), e);
|
|
191
|
+
if (Xe.has(t)) return R(Xe.get(t), e);
|
|
192
|
+
if (/\d/.test(t)) return it(r, e);
|
|
193
|
+
if (e === "\\") throw new Error(x`Incomplete escape "\"`);
|
|
194
|
+
if (t === "M") throw new Error(`Unsupported meta "${e}"`);
|
|
195
|
+
if ([...e].length === 2) return R(e.codePointAt(1), e);
|
|
196
|
+
throw new Error(`Unexpected escape "${e}"`);
|
|
197
|
+
}
|
|
198
|
+
function nt(e) {
|
|
199
|
+
return { type: "Alternator", raw: e };
|
|
200
|
+
}
|
|
201
|
+
function We(e, r) {
|
|
202
|
+
return { type: "Assertion", kind: e, raw: r };
|
|
203
|
+
}
|
|
204
|
+
function mr(e) {
|
|
205
|
+
return { type: "Backreference", raw: e };
|
|
206
|
+
}
|
|
207
|
+
function R(e, r) {
|
|
208
|
+
return { type: "Character", value: e, raw: r };
|
|
209
|
+
}
|
|
210
|
+
function st(e) {
|
|
211
|
+
return { type: "CharacterClassClose", raw: e };
|
|
212
|
+
}
|
|
213
|
+
function ot(e) {
|
|
214
|
+
return { type: "CharacterClassHyphen", raw: e };
|
|
215
|
+
}
|
|
216
|
+
function at(e) {
|
|
217
|
+
return { type: "CharacterClassIntersector", raw: e };
|
|
218
|
+
}
|
|
219
|
+
function He(e, r) {
|
|
220
|
+
return { type: "CharacterClassOpen", negate: e, raw: r };
|
|
221
|
+
}
|
|
222
|
+
function X(e, r, t = {}) {
|
|
223
|
+
return { type: "CharacterSet", kind: e, ...t, raw: r };
|
|
224
|
+
}
|
|
225
|
+
function wr(e, r, t = {}) {
|
|
226
|
+
return e === "keep" ? { type: "Directive", kind: e, raw: r } : { type: "Directive", kind: e, flags: se(t.flags), raw: r };
|
|
227
|
+
}
|
|
228
|
+
function it(e, r) {
|
|
229
|
+
return { type: "EscapedNumber", inCharClass: e, raw: r };
|
|
230
|
+
}
|
|
231
|
+
function ut(e) {
|
|
232
|
+
return { type: "GroupClose", raw: e };
|
|
233
|
+
}
|
|
234
|
+
function re(e, r, t = {}) {
|
|
235
|
+
return { type: "GroupOpen", kind: e, ...t, raw: r };
|
|
236
|
+
}
|
|
237
|
+
function ct(e, r, t, n) {
|
|
238
|
+
return { type: "NamedCallout", kind: e, tag: r, arguments: t, raw: n };
|
|
239
|
+
}
|
|
240
|
+
function lt(e, r, t, n) {
|
|
241
|
+
return { type: "Quantifier", kind: e, min: r, max: t, raw: n };
|
|
242
|
+
}
|
|
243
|
+
function ft(e) {
|
|
244
|
+
return { type: "Subroutine", raw: e };
|
|
245
|
+
}
|
|
246
|
+
const pt = /* @__PURE__ */ new Set(["COUNT", "CMP", "ERROR", "FAIL", "MAX", "MISMATCH", "SKIP", "TOTAL_COUNT"]), Xe = /* @__PURE__ */ new Map([["a", 7], ["b", 8], ["e", 27], ["f", 12], ["n", 10], ["r", 13], ["t", 9], ["v", 11]]);
|
|
247
|
+
function dt(e) {
|
|
248
|
+
const r = e[1] === "c" ? e[2] : e[3];
|
|
249
|
+
if (!r || !/[A-Za-z]/.test(r)) throw new Error(`Unsupported control character "${e}"`);
|
|
250
|
+
return R(ne(r.toUpperCase()) - 64, e);
|
|
251
|
+
}
|
|
252
|
+
function gt(e, r) {
|
|
253
|
+
let { on: t, off: n } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;
|
|
254
|
+
n ?? (n = "");
|
|
255
|
+
const s = (r.getCurrentModX() || t.includes("x")) && !n.includes("x"), o = Qe(t), a = Qe(n), i = {};
|
|
256
|
+
if (o && (i.enable = o), a && (i.disable = a), e.endsWith(")")) return r.replaceCurrentModX(s), wr("flags", e, { flags: i });
|
|
257
|
+
if (e.endsWith(":")) return r.pushModX(s), r.numOpenGroups++, re("group", e, { ...(o || a) && { flags: i } });
|
|
258
|
+
throw new Error(`Unexpected flag modifier "${e}"`);
|
|
259
|
+
}
|
|
260
|
+
function ht(e) {
|
|
261
|
+
const r = /\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);
|
|
262
|
+
if (!r) throw new Error(`Incomplete or invalid named callout "${e}"`);
|
|
263
|
+
const { name: t, tag: n, args: s } = r.groups;
|
|
264
|
+
if (!t) throw new Error(`Invalid named callout "${e}"`);
|
|
265
|
+
if (n === "") throw new Error(`Named callout tag with empty value not allowed "${e}"`);
|
|
266
|
+
const o = s ? s.split(",").filter((l) => l !== "").map((l) => /^[+-]?\d+$/.test(l) ? +l : l) : [], [a, i, u] = o, c = pt.has(t) ? t.toLowerCase() : "custom";
|
|
267
|
+
switch (c) {
|
|
268
|
+
case "fail":
|
|
269
|
+
case "mismatch":
|
|
270
|
+
case "skip":
|
|
271
|
+
if (o.length > 0) throw new Error(`Named callout arguments not allowed "${o}"`);
|
|
272
|
+
break;
|
|
273
|
+
case "error":
|
|
274
|
+
if (o.length > 1) throw new Error(`Named callout allows only one argument "${o}"`);
|
|
275
|
+
if (typeof a == "string") throw new Error(`Named callout argument must be a number "${a}"`);
|
|
276
|
+
break;
|
|
277
|
+
case "max":
|
|
278
|
+
if (!o.length || o.length > 2) throw new Error(`Named callout must have one or two arguments "${o}"`);
|
|
279
|
+
if (typeof a == "string" && !/^[A-Za-z_]\w*$/.test(a)) throw new Error(`Named callout argument one must be a tag or number "${a}"`);
|
|
280
|
+
if (o.length === 2 && (typeof i == "number" || !/^[<>X]$/.test(i))) throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i}"`);
|
|
281
|
+
break;
|
|
282
|
+
case "count":
|
|
283
|
+
case "total_count":
|
|
284
|
+
if (o.length > 1) throw new Error(`Named callout allows only one argument "${o}"`);
|
|
285
|
+
if (o.length === 1 && (typeof a == "number" || !/^[<>X]$/.test(a))) throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${a}"`);
|
|
286
|
+
break;
|
|
287
|
+
case "cmp":
|
|
288
|
+
if (o.length !== 3) throw new Error(`Named callout must have three arguments "${o}"`);
|
|
289
|
+
if (typeof a == "string" && !/^[A-Za-z_]\w*$/.test(a)) throw new Error(`Named callout argument one must be a tag or number "${a}"`);
|
|
290
|
+
if (typeof i == "number" || !/^(?:[<>!=]=|[<>])$/.test(i)) throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i}"`);
|
|
291
|
+
if (typeof u == "string" && !/^[A-Za-z_]\w*$/.test(u)) throw new Error(`Named callout argument three must be a tag or number "${u}"`);
|
|
292
|
+
break;
|
|
293
|
+
case "custom":
|
|
294
|
+
throw new Error(`Undefined callout name "${t}"`);
|
|
295
|
+
default:
|
|
296
|
+
throw new Error(`Unexpected named callout kind "${c}"`);
|
|
297
|
+
}
|
|
298
|
+
return ct(c, n ?? null, (s == null ? void 0 : s.split(",")) ?? null, e);
|
|
299
|
+
}
|
|
300
|
+
function Ze(e) {
|
|
301
|
+
let r = null, t, n;
|
|
302
|
+
if (e[0] === "{") {
|
|
303
|
+
const { minStr: s, maxStr: o } = /^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups, a = 1e5;
|
|
304
|
+
if (+s > a || o && +o > a) throw new Error("Quantifier value unsupported in Oniguruma");
|
|
305
|
+
if (t = +s, n = o === void 0 ? +s : o === "" ? 1 / 0 : +o, t > n && (r = "possessive", [t, n] = [n, t]), e.endsWith("?")) {
|
|
306
|
+
if (r === "possessive") throw new Error('Unsupported possessive interval quantifier chain with "?"');
|
|
307
|
+
r = "lazy";
|
|
308
|
+
} else r || (r = "greedy");
|
|
309
|
+
} else t = e[0] === "+" ? 1 : 0, n = e[0] === "?" ? 1 : 1 / 0, r = e[1] === "+" ? "possessive" : e[1] === "?" ? "lazy" : "greedy";
|
|
310
|
+
return lt(r, t, n, e);
|
|
311
|
+
}
|
|
312
|
+
function mt(e) {
|
|
313
|
+
const r = e[1].toLowerCase();
|
|
314
|
+
return X({ d: "digit", h: "hex", s: "space", w: "word" }[r], e, { negate: e[1] !== r });
|
|
315
|
+
}
|
|
316
|
+
function wt(e) {
|
|
317
|
+
const { p: r, neg: t, value: n } = /^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;
|
|
318
|
+
return X("property", e, { value: n, negate: r === "P" && !t || r === "p" && !!t });
|
|
319
|
+
}
|
|
320
|
+
function Qe(e) {
|
|
321
|
+
const r = {};
|
|
322
|
+
return e.includes("i") && (r.ignoreCase = !0), e.includes("m") && (r.dotAll = !0), e.includes("x") && (r.extended = !0), Object.keys(r).length ? r : null;
|
|
323
|
+
}
|
|
324
|
+
function yt(e) {
|
|
325
|
+
const r = { ignoreCase: !1, dotAll: !1, extended: !1, digitIsAscii: !1, posixIsAscii: !1, spaceIsAscii: !1, wordIsAscii: !1, textSegmentMode: null };
|
|
326
|
+
for (let t = 0; t < e.length; t++) {
|
|
327
|
+
const n = e[t];
|
|
328
|
+
if (!"imxDPSWy".includes(n)) throw new Error(`Invalid flag "${n}"`);
|
|
329
|
+
if (n === "y") {
|
|
330
|
+
if (!/^y{[gw]}/.test(e.slice(t))) throw new Error('Invalid or unspecified flag "y" mode');
|
|
331
|
+
r.textSegmentMode = e[t + 2] === "g" ? "grapheme" : "word", t += 3;
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
r[{ i: "ignoreCase", m: "dotAll", x: "extended", D: "digitIsAscii", P: "posixIsAscii", S: "spaceIsAscii", W: "wordIsAscii" }[n]] = !0;
|
|
335
|
+
}
|
|
336
|
+
return r;
|
|
337
|
+
}
|
|
338
|
+
function Ct(e) {
|
|
339
|
+
if (new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))", "u").test(e)) throw new Error(`Incomplete or invalid escape "${e}"`);
|
|
340
|
+
const r = e[2] === "{" ? new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)", "u").exec(e).groups.hex : e.slice(2);
|
|
341
|
+
return parseInt(r, 16);
|
|
342
|
+
}
|
|
343
|
+
function bt(e, r) {
|
|
344
|
+
const { raw: t, inCharClass: n } = e, s = t.slice(1);
|
|
345
|
+
if (!n && (s !== "0" && s.length === 1 || s[0] !== "0" && +s <= r)) return [mr(t)];
|
|
346
|
+
const o = [], a = s.match(/^[0-7]+|\d/g);
|
|
347
|
+
for (let i = 0; i < a.length; i++) {
|
|
348
|
+
const u = a[i];
|
|
349
|
+
let c;
|
|
350
|
+
if (i === 0 && u !== "8" && u !== "9") {
|
|
351
|
+
if (c = parseInt(u, 8), c > 127) throw new Error(x`Octal encoded byte above 177 unsupported "${t}"`);
|
|
352
|
+
} else c = ne(u);
|
|
353
|
+
o.push(R(c, (i === 0 ? "\\" : "") + u));
|
|
354
|
+
}
|
|
355
|
+
return o;
|
|
356
|
+
}
|
|
357
|
+
function xt(e) {
|
|
358
|
+
const r = [], t = new RegExp(Oe, "gy");
|
|
359
|
+
let n;
|
|
360
|
+
for (; n = t.exec(e); ) {
|
|
361
|
+
const s = n[0];
|
|
362
|
+
if (s[0] === "{") {
|
|
363
|
+
const o = /^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);
|
|
364
|
+
if (o) {
|
|
365
|
+
const { min: a, max: i } = o.groups;
|
|
366
|
+
if (+a > +i && s.endsWith("?")) {
|
|
367
|
+
t.lastIndex--, r.push(Ze(s.slice(0, -1)));
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
r.push(Ze(s));
|
|
373
|
+
}
|
|
374
|
+
return r;
|
|
375
|
+
}
|
|
376
|
+
function yr(e, r) {
|
|
377
|
+
if (!Array.isArray(e.body)) throw new Error("Expected node with body array");
|
|
378
|
+
if (e.body.length !== 1) return !1;
|
|
379
|
+
const t = e.body[0];
|
|
380
|
+
return !r || Object.keys(r).every((n) => r[n] === t[n]);
|
|
381
|
+
}
|
|
382
|
+
function kt(e) {
|
|
383
|
+
return $t.has(e.type);
|
|
384
|
+
}
|
|
385
|
+
const $t = /* @__PURE__ */ new Set(["AbsenceFunction", "Backreference", "CapturingGroup", "Character", "CharacterClass", "CharacterSet", "Group", "Quantifier", "Subroutine"]);
|
|
386
|
+
function Cr(e, r = {}) {
|
|
387
|
+
const t = { flags: "", normalizeUnknownPropertyNames: !1, skipBackrefValidation: !1, skipLookbehindValidation: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...r, rules: { captureGroup: !1, singleline: !1, ...r.rules } }, n = Yr(e, { flags: t.flags, rules: { captureGroup: t.rules.captureGroup, singleline: t.rules.singleline } }), s = (p, g) => {
|
|
388
|
+
const d = n.tokens[o.nextIndex];
|
|
389
|
+
switch (o.parent = p, o.nextIndex++, d.type) {
|
|
390
|
+
case "Alternator":
|
|
391
|
+
return q();
|
|
392
|
+
case "Assertion":
|
|
393
|
+
return Et(d);
|
|
394
|
+
case "Backreference":
|
|
395
|
+
return At(d, o);
|
|
396
|
+
case "Character":
|
|
397
|
+
return he(d.value, { useLastValid: !!g.isCheckingRangeEnd });
|
|
398
|
+
case "CharacterClassHyphen":
|
|
399
|
+
return It(d, o, g);
|
|
400
|
+
case "CharacterClassOpen":
|
|
401
|
+
return vt(d, o, g);
|
|
402
|
+
case "CharacterSet":
|
|
403
|
+
return St(d, o);
|
|
404
|
+
case "Directive":
|
|
405
|
+
return Gt(d.kind, { flags: d.flags });
|
|
406
|
+
case "GroupOpen":
|
|
407
|
+
return _t(d, o, g);
|
|
408
|
+
case "NamedCallout":
|
|
409
|
+
return Rt(d.kind, d.tag, d.arguments);
|
|
410
|
+
case "Quantifier":
|
|
411
|
+
return Nt(d, o);
|
|
412
|
+
case "Subroutine":
|
|
413
|
+
return Mt(d, o);
|
|
414
|
+
default:
|
|
415
|
+
throw new Error(`Unexpected token type "${d.type}"`);
|
|
416
|
+
}
|
|
417
|
+
}, o = { capturingGroups: [], hasNumberedRef: !1, namedGroupsByName: /* @__PURE__ */ new Map(), nextIndex: 0, normalizeUnknownPropertyNames: t.normalizeUnknownPropertyNames, parent: null, skipBackrefValidation: t.skipBackrefValidation, skipLookbehindValidation: t.skipLookbehindValidation, skipPropertyNameValidation: t.skipPropertyNameValidation, subroutines: [], tokens: n.tokens, unicodePropertyMap: t.unicodePropertyMap, walk: s }, a = Ot(Pt(n.flags));
|
|
418
|
+
let i = a.body[0];
|
|
419
|
+
for (; o.nextIndex < n.tokens.length; ) {
|
|
420
|
+
const p = s(i, {});
|
|
421
|
+
p.type === "Alternative" ? (a.body.push(p), i = p) : i.body.push(p);
|
|
422
|
+
}
|
|
423
|
+
const { capturingGroups: u, hasNumberedRef: c, namedGroupsByName: l, subroutines: f } = o;
|
|
424
|
+
if (c && l.size && !t.rules.captureGroup) throw new Error("Numbered backref/subroutine not allowed when using named capture");
|
|
425
|
+
for (const { ref: p } of f) if (typeof p == "number") {
|
|
426
|
+
if (p > u.length) throw new Error("Subroutine uses a group number that's not defined");
|
|
427
|
+
p && (u[p - 1].isSubroutined = !0);
|
|
428
|
+
} else if (l.has(p)) {
|
|
429
|
+
if (l.get(p).length > 1) throw new Error(x`Subroutine uses a duplicate group name "\g<${p}>"`);
|
|
430
|
+
l.get(p)[0].isSubroutined = !0;
|
|
431
|
+
} else throw new Error(x`Subroutine uses a group name that's not defined "\g<${p}>"`);
|
|
432
|
+
return a;
|
|
433
|
+
}
|
|
434
|
+
function Et({ kind: e }) {
|
|
435
|
+
return Ne(se({ "^": "line_start", $: "line_end", "\\A": "string_start", "\\b": "word_boundary", "\\B": "word_boundary", "\\G": "search_start", "\\y": "text_segment_boundary", "\\Y": "text_segment_boundary", "\\z": "string_end", "\\Z": "string_end_newline" }[e], `Unexpected assertion kind "${e}"`), { negate: e === x`\B` || e === x`\Y` });
|
|
436
|
+
}
|
|
437
|
+
function At({ raw: e }, r) {
|
|
438
|
+
const t = /^\\k[<']/.test(e), n = t ? e.slice(3, -1) : e.slice(1), s = (o, a = !1) => {
|
|
439
|
+
const i = r.capturingGroups.length;
|
|
440
|
+
let u = !1;
|
|
441
|
+
if (o > i) if (r.skipBackrefValidation) u = !0;
|
|
442
|
+
else throw new Error(`Not enough capturing groups defined to the left "${e}"`);
|
|
443
|
+
return r.hasNumberedRef = !0, Me(a ? i + 1 - o : o, { orphan: u });
|
|
444
|
+
};
|
|
445
|
+
if (t) {
|
|
446
|
+
const o = /^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);
|
|
447
|
+
if (o) return s(+o.groups.num, !!o.groups.sign);
|
|
448
|
+
if (/[-+]/.test(n)) throw new Error(`Invalid backref name "${e}"`);
|
|
449
|
+
if (!r.namedGroupsByName.has(n)) throw new Error(`Group name not defined to the left "${e}"`);
|
|
450
|
+
return Me(n);
|
|
451
|
+
}
|
|
452
|
+
return s(+n);
|
|
453
|
+
}
|
|
454
|
+
function It(e, r, t) {
|
|
455
|
+
const { tokens: n, walk: s } = r, o = r.parent, a = o.body.at(-1), i = n[r.nextIndex];
|
|
456
|
+
if (!t.isCheckingRangeEnd && a && a.type !== "CharacterClass" && a.type !== "CharacterClassRange" && i && i.type !== "CharacterClassOpen" && i.type !== "CharacterClassClose" && i.type !== "CharacterClassIntersector") {
|
|
457
|
+
const u = s(o, { ...t, isCheckingRangeEnd: !0 });
|
|
458
|
+
if (a.type === "Character" && u.type === "Character") return o.body.pop(), Ft(a, u);
|
|
459
|
+
throw new Error("Invalid character class range");
|
|
460
|
+
}
|
|
461
|
+
return he(ne("-"));
|
|
462
|
+
}
|
|
463
|
+
function vt({ negate: e }, r, t) {
|
|
464
|
+
const { tokens: n, walk: s } = r, o = n[r.nextIndex], a = [de()];
|
|
465
|
+
let i = Ke(o);
|
|
466
|
+
for (; i.type !== "CharacterClassClose"; ) {
|
|
467
|
+
if (i.type === "CharacterClassIntersector") a.push(de()), r.nextIndex++;
|
|
468
|
+
else {
|
|
469
|
+
const c = a.at(-1);
|
|
470
|
+
c.body.push(s(c, t));
|
|
471
|
+
}
|
|
472
|
+
i = Ke(n[r.nextIndex], o);
|
|
473
|
+
}
|
|
474
|
+
const u = de({ negate: e });
|
|
475
|
+
return a.length === 1 ? u.body = a[0].body : (u.kind = "intersection", u.body = a.map((c) => c.body.length === 1 ? c.body[0] : c)), r.nextIndex++, u;
|
|
476
|
+
}
|
|
477
|
+
function St({ kind: e, negate: r, value: t }, n) {
|
|
478
|
+
const { normalizeUnknownPropertyNames: s, skipPropertyNameValidation: o, unicodePropertyMap: a } = n;
|
|
479
|
+
if (e === "property") {
|
|
480
|
+
const i = me(t);
|
|
481
|
+
if (Ue.has(i) && !(a != null && a.has(i))) e = "posix", t = i;
|
|
482
|
+
else return te(t, { negate: r, normalizeUnknownPropertyNames: s, skipPropertyNameValidation: o, unicodePropertyMap: a });
|
|
483
|
+
}
|
|
484
|
+
return e === "posix" ? Ut(t, { negate: r }) : Le(e, { negate: r });
|
|
485
|
+
}
|
|
486
|
+
function _t(e, r, t) {
|
|
487
|
+
const { tokens: n, capturingGroups: s, namedGroupsByName: o, skipLookbehindValidation: a, walk: i } = r, u = Dt(e), c = u.type === "AbsenceFunction", l = Je(u), f = l && u.negate;
|
|
488
|
+
if (u.type === "CapturingGroup" && (s.push(u), u.name && Kr(o, u.name, []).push(u)), c && t.isInAbsenceFunction) throw new Error("Nested absence function not supported by Oniguruma");
|
|
489
|
+
let p = Ye(n[r.nextIndex]);
|
|
490
|
+
for (; p.type !== "GroupClose"; ) {
|
|
491
|
+
if (p.type === "Alternator") u.body.push(q()), r.nextIndex++;
|
|
492
|
+
else {
|
|
493
|
+
const g = u.body.at(-1), d = i(g, { ...t, isInAbsenceFunction: t.isInAbsenceFunction || c, isInLookbehind: t.isInLookbehind || l, isInNegLookbehind: t.isInNegLookbehind || f });
|
|
494
|
+
if (g.body.push(d), (l || t.isInLookbehind) && !a) {
|
|
495
|
+
const m = "Lookbehind includes a pattern not allowed by Oniguruma";
|
|
496
|
+
if (f || t.isInNegLookbehind) {
|
|
497
|
+
if (qe(d) || d.type === "CapturingGroup") throw new Error(m);
|
|
498
|
+
} else if (qe(d) || Je(d) && d.negate) throw new Error(m);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
p = Ye(n[r.nextIndex]);
|
|
502
|
+
}
|
|
503
|
+
return r.nextIndex++, u;
|
|
504
|
+
}
|
|
505
|
+
function Nt({ kind: e, min: r, max: t }, n) {
|
|
506
|
+
const s = n.parent, o = s.body.at(-1);
|
|
507
|
+
if (!o || !kt(o)) throw new Error("Quantifier requires a repeatable token");
|
|
508
|
+
const a = xr(e, r, t, o);
|
|
509
|
+
return s.body.pop(), a;
|
|
510
|
+
}
|
|
511
|
+
function Mt({ raw: e }, r) {
|
|
512
|
+
const { capturingGroups: t, subroutines: n } = r;
|
|
513
|
+
let s = e.slice(3, -1);
|
|
514
|
+
const o = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);
|
|
515
|
+
if (o) {
|
|
516
|
+
const i = +o.groups.num, u = t.length;
|
|
517
|
+
if (r.hasNumberedRef = !0, s = { "": i, "+": u + i, "-": u + 1 - i }[o.groups.sign], s < 1) throw new Error("Invalid subroutine number");
|
|
518
|
+
} else s === "0" && (s = 0);
|
|
519
|
+
const a = kr(s);
|
|
520
|
+
return n.push(a), a;
|
|
521
|
+
}
|
|
522
|
+
function Lt(e, r) {
|
|
523
|
+
return { type: "AbsenceFunction", kind: e, body: ce(r == null ? void 0 : r.body) };
|
|
524
|
+
}
|
|
525
|
+
function q(e) {
|
|
526
|
+
return { type: "Alternative", body: $r(e == null ? void 0 : e.body) };
|
|
527
|
+
}
|
|
528
|
+
function Ne(e, r) {
|
|
529
|
+
const t = { type: "Assertion", kind: e };
|
|
530
|
+
return (e === "word_boundary" || e === "text_segment_boundary") && (t.negate = !!(r != null && r.negate)), t;
|
|
531
|
+
}
|
|
532
|
+
function Me(e, r) {
|
|
533
|
+
const t = !!(r != null && r.orphan);
|
|
534
|
+
return { type: "Backreference", ref: e, ...t && { orphan: t } };
|
|
535
|
+
}
|
|
536
|
+
function br(e, r) {
|
|
537
|
+
const t = { name: void 0, isSubroutined: !1, ...r };
|
|
538
|
+
if (t.name !== void 0 && !Tt(t.name)) throw new Error(`Group name "${t.name}" invalid in Oniguruma`);
|
|
539
|
+
return { type: "CapturingGroup", number: e, ...t.name && { name: t.name }, ...t.isSubroutined && { isSubroutined: t.isSubroutined }, body: ce(r == null ? void 0 : r.body) };
|
|
540
|
+
}
|
|
541
|
+
function he(e, r) {
|
|
542
|
+
const t = { useLastValid: !1, ...r };
|
|
543
|
+
if (e > 1114111) {
|
|
544
|
+
const n = e.toString(16);
|
|
545
|
+
if (t.useLastValid) e = 1114111;
|
|
546
|
+
else throw e > 1310719 ? new Error(`Invalid code point out of range "\\x{${n}}"`) : new Error(`Invalid code point out of range in JS "\\x{${n}}"`);
|
|
547
|
+
}
|
|
548
|
+
return { type: "Character", value: e };
|
|
549
|
+
}
|
|
550
|
+
function de(e) {
|
|
551
|
+
const r = { kind: "union", negate: !1, ...e };
|
|
552
|
+
return { type: "CharacterClass", kind: r.kind, negate: r.negate, body: $r(e == null ? void 0 : e.body) };
|
|
553
|
+
}
|
|
554
|
+
function Ft(e, r) {
|
|
555
|
+
if (r.value < e.value) throw new Error("Character class range out of order");
|
|
556
|
+
return { type: "CharacterClassRange", min: e, max: r };
|
|
557
|
+
}
|
|
558
|
+
function Le(e, r) {
|
|
559
|
+
const t = !!(r != null && r.negate), n = { type: "CharacterSet", kind: e };
|
|
560
|
+
return (e === "digit" || e === "hex" || e === "newline" || e === "space" || e === "word") && (n.negate = t), (e === "text_segment" || e === "newline" && !t) && (n.variableLength = !0), n;
|
|
561
|
+
}
|
|
562
|
+
function Gt(e, r = {}) {
|
|
563
|
+
if (e === "keep") return { type: "Directive", kind: e };
|
|
564
|
+
if (e === "flags") return { type: "Directive", kind: e, flags: se(r.flags) };
|
|
565
|
+
throw new Error(`Unexpected directive kind "${e}"`);
|
|
566
|
+
}
|
|
567
|
+
function Pt(e) {
|
|
568
|
+
return { type: "Flags", ...e };
|
|
569
|
+
}
|
|
570
|
+
function L(e) {
|
|
571
|
+
const r = e == null ? void 0 : e.atomic, t = e == null ? void 0 : e.flags;
|
|
572
|
+
if (r && t) throw new Error("Atomic group cannot have flags");
|
|
573
|
+
return { type: "Group", ...r && { atomic: r }, ...t && { flags: t }, body: ce(e == null ? void 0 : e.body) };
|
|
574
|
+
}
|
|
575
|
+
function H(e) {
|
|
576
|
+
const r = { behind: !1, negate: !1, ...e };
|
|
577
|
+
return { type: "LookaroundAssertion", kind: r.behind ? "lookbehind" : "lookahead", negate: r.negate, body: ce(e == null ? void 0 : e.body) };
|
|
578
|
+
}
|
|
579
|
+
function Rt(e, r, t) {
|
|
580
|
+
return { type: "NamedCallout", kind: e, tag: r, arguments: t };
|
|
581
|
+
}
|
|
582
|
+
function Ut(e, r) {
|
|
583
|
+
const t = !!(r != null && r.negate);
|
|
584
|
+
if (!Ue.has(e)) throw new Error(`Invalid POSIX class "${e}"`);
|
|
585
|
+
return { type: "CharacterSet", kind: "posix", value: e, negate: t };
|
|
586
|
+
}
|
|
587
|
+
function xr(e, r, t, n) {
|
|
588
|
+
if (r > t) throw new Error("Invalid reversed quantifier range");
|
|
589
|
+
return { type: "Quantifier", kind: e, min: r, max: t, body: n };
|
|
590
|
+
}
|
|
591
|
+
function Ot(e, r) {
|
|
592
|
+
return { type: "Regex", body: ce(r == null ? void 0 : r.body), flags: e };
|
|
593
|
+
}
|
|
594
|
+
function kr(e) {
|
|
595
|
+
return { type: "Subroutine", ref: e };
|
|
596
|
+
}
|
|
597
|
+
function te(e, r) {
|
|
598
|
+
var s;
|
|
599
|
+
const t = { negate: !1, normalizeUnknownPropertyNames: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...r };
|
|
600
|
+
let n = (s = t.unicodePropertyMap) == null ? void 0 : s.get(me(e));
|
|
601
|
+
if (!n) {
|
|
602
|
+
if (t.normalizeUnknownPropertyNames) n = Bt(e);
|
|
603
|
+
else if (t.unicodePropertyMap && !t.skipPropertyNameValidation) throw new Error(x`Invalid Unicode property "\p{${e}}"`);
|
|
604
|
+
}
|
|
605
|
+
return { type: "CharacterSet", kind: "property", value: n ?? e, negate: t.negate };
|
|
606
|
+
}
|
|
607
|
+
function Dt({ flags: e, kind: r, name: t, negate: n, number: s }) {
|
|
608
|
+
switch (r) {
|
|
609
|
+
case "absence_repeater":
|
|
610
|
+
return Lt("repeater");
|
|
611
|
+
case "atomic":
|
|
612
|
+
return L({ atomic: !0 });
|
|
613
|
+
case "capturing":
|
|
614
|
+
return br(s, { name: t });
|
|
615
|
+
case "group":
|
|
616
|
+
return L({ flags: e });
|
|
617
|
+
case "lookahead":
|
|
618
|
+
case "lookbehind":
|
|
619
|
+
return H({ behind: r === "lookbehind", negate: n });
|
|
620
|
+
default:
|
|
621
|
+
throw new Error(`Unexpected group kind "${r}"`);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
function ce(e) {
|
|
625
|
+
if (e === void 0) e = [q()];
|
|
626
|
+
else if (!Array.isArray(e) || !e.length || !e.every((r) => r.type === "Alternative")) throw new Error("Invalid body; expected array of one or more Alternative nodes");
|
|
627
|
+
return e;
|
|
628
|
+
}
|
|
629
|
+
function $r(e) {
|
|
630
|
+
if (e === void 0) e = [];
|
|
631
|
+
else if (!Array.isArray(e) || !e.every((r) => !!r.type)) throw new Error("Invalid body; expected array of nodes");
|
|
632
|
+
return e;
|
|
633
|
+
}
|
|
634
|
+
function qe(e) {
|
|
635
|
+
return e.type === "LookaroundAssertion" && e.kind === "lookahead";
|
|
636
|
+
}
|
|
637
|
+
function Je(e) {
|
|
638
|
+
return e.type === "LookaroundAssertion" && e.kind === "lookbehind";
|
|
639
|
+
}
|
|
640
|
+
function Tt(e) {
|
|
641
|
+
return /^[\p{Alpha}\p{Pc}][^)]*$/u.test(e);
|
|
642
|
+
}
|
|
643
|
+
function Bt(e) {
|
|
644
|
+
return e.trim().replace(/[- _]+/g, "_").replace(/[A-Z][a-z]+(?=[A-Z])/g, "$&_").replace(/[A-Za-z]+/g, (r) => r[0].toUpperCase() + r.slice(1).toLowerCase());
|
|
645
|
+
}
|
|
646
|
+
function me(e) {
|
|
647
|
+
return e.replace(/[- _]+/g, "").toLowerCase();
|
|
648
|
+
}
|
|
649
|
+
function Ke(e, r) {
|
|
650
|
+
return se(e, `${(r == null ? void 0 : r.type) === "Character" && r.value === 93 ? "Empty" : "Unclosed"} character class`);
|
|
651
|
+
}
|
|
652
|
+
function Ye(e) {
|
|
653
|
+
return se(e, "Unclosed group");
|
|
654
|
+
}
|
|
655
|
+
function ae(e, r, t = null) {
|
|
656
|
+
function n(o, a) {
|
|
657
|
+
for (let i = 0; i < o.length; i++) {
|
|
658
|
+
const u = s(o[i], a, i, o);
|
|
659
|
+
i = Math.max(-1, i + u);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
function s(o, a = null, i = null, u = null) {
|
|
663
|
+
var E, A;
|
|
664
|
+
let c = 0, l = !1;
|
|
665
|
+
const f = { node: o, parent: a, key: i, container: u, root: e, remove() {
|
|
666
|
+
fe(u).splice(Math.max(0, K(i) + c), 1), c--, l = !0;
|
|
667
|
+
}, removeAllNextSiblings() {
|
|
668
|
+
return fe(u).splice(K(i) + 1);
|
|
669
|
+
}, removeAllPrevSiblings() {
|
|
670
|
+
const y = K(i) + c;
|
|
671
|
+
return c -= y, fe(u).splice(0, Math.max(0, y));
|
|
672
|
+
}, replaceWith(y, k = {}) {
|
|
673
|
+
const _ = !!k.traverse;
|
|
674
|
+
u ? u[Math.max(0, K(i) + c)] = y : se(a, "Can't replace root node")[i] = y, _ && s(y, a, i, u), l = !0;
|
|
675
|
+
}, replaceWithMultiple(y, k = {}) {
|
|
676
|
+
const _ = !!k.traverse;
|
|
677
|
+
if (fe(u).splice(Math.max(0, K(i) + c), 1, ...y), c += y.length - 1, _) {
|
|
678
|
+
let V = 0;
|
|
679
|
+
for (let N = 0; N < y.length; N++) V += s(y[N], a, K(i) + N + V, u);
|
|
680
|
+
}
|
|
681
|
+
l = !0;
|
|
682
|
+
}, skip() {
|
|
683
|
+
l = !0;
|
|
684
|
+
} }, { type: p } = o, g = r["*"], d = r[p], m = typeof g == "function" ? g : g == null ? void 0 : g.enter, w = typeof d == "function" ? d : d == null ? void 0 : d.enter;
|
|
685
|
+
if (m == null || m(f, t), w == null || w(f, t), !l) switch (p) {
|
|
686
|
+
case "AbsenceFunction":
|
|
687
|
+
case "CapturingGroup":
|
|
688
|
+
case "Group":
|
|
689
|
+
n(o.body, o);
|
|
690
|
+
break;
|
|
691
|
+
case "Alternative":
|
|
692
|
+
case "CharacterClass":
|
|
693
|
+
n(o.body, o);
|
|
694
|
+
break;
|
|
695
|
+
case "Assertion":
|
|
696
|
+
case "Backreference":
|
|
697
|
+
case "Character":
|
|
698
|
+
case "CharacterSet":
|
|
699
|
+
case "Directive":
|
|
700
|
+
case "Flags":
|
|
701
|
+
case "NamedCallout":
|
|
702
|
+
case "Subroutine":
|
|
703
|
+
break;
|
|
704
|
+
case "CharacterClassRange":
|
|
705
|
+
s(o.min, o, "min"), s(o.max, o, "max");
|
|
706
|
+
break;
|
|
707
|
+
case "LookaroundAssertion":
|
|
708
|
+
n(o.body, o);
|
|
709
|
+
break;
|
|
710
|
+
case "Quantifier":
|
|
711
|
+
s(o.body, o, "body");
|
|
712
|
+
break;
|
|
713
|
+
case "Regex":
|
|
714
|
+
n(o.body, o), s(o.flags, o, "flags");
|
|
715
|
+
break;
|
|
716
|
+
default:
|
|
717
|
+
throw new Error(`Unexpected node type "${p}"`);
|
|
718
|
+
}
|
|
719
|
+
return (E = d == null ? void 0 : d.exit) == null || E.call(d, f, t), (A = g == null ? void 0 : g.exit) == null || A.call(g, f, t), c;
|
|
720
|
+
}
|
|
721
|
+
return s(e), e;
|
|
722
|
+
}
|
|
723
|
+
function fe(e) {
|
|
724
|
+
if (!Array.isArray(e)) throw new Error("Container expected");
|
|
725
|
+
return e;
|
|
726
|
+
}
|
|
727
|
+
function K(e) {
|
|
728
|
+
if (typeof e != "number") throw new Error("Numeric key expected");
|
|
729
|
+
return e;
|
|
730
|
+
}
|
|
731
|
+
const jt = String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;
|
|
732
|
+
function Vt(e, r) {
|
|
733
|
+
for (let t = 0; t < e.length; t++)
|
|
734
|
+
e[t] >= r && e[t]++;
|
|
735
|
+
}
|
|
736
|
+
function zt(e, r, t, n) {
|
|
737
|
+
return e.slice(0, r) + n + e.slice(r + t.length);
|
|
738
|
+
}
|
|
739
|
+
const S = Object.freeze({
|
|
740
|
+
DEFAULT: "DEFAULT",
|
|
741
|
+
CHAR_CLASS: "CHAR_CLASS"
|
|
742
|
+
});
|
|
743
|
+
function De(e, r, t, n) {
|
|
744
|
+
const s = new RegExp(String.raw`${r}|(?<$skip>\[\^?|\\?.)`, "gsu"), o = [!1];
|
|
745
|
+
let a = 0, i = "";
|
|
746
|
+
for (const u of e.matchAll(s)) {
|
|
747
|
+
const { 0: c, groups: { $skip: l } } = u;
|
|
748
|
+
if (!l && (!n || n === S.DEFAULT == !a)) {
|
|
749
|
+
t instanceof Function ? i += t(u, {
|
|
750
|
+
context: a ? S.CHAR_CLASS : S.DEFAULT,
|
|
751
|
+
negated: o[o.length - 1]
|
|
752
|
+
}) : i += t;
|
|
753
|
+
continue;
|
|
754
|
+
}
|
|
755
|
+
c[0] === "[" ? (a++, o.push(c[1] === "^")) : c === "]" && a && (a--, o.pop()), i += c;
|
|
756
|
+
}
|
|
757
|
+
return i;
|
|
758
|
+
}
|
|
759
|
+
function Er(e, r, t, n) {
|
|
760
|
+
De(e, r, t, n);
|
|
761
|
+
}
|
|
762
|
+
function Wt(e, r, t = 0, n) {
|
|
763
|
+
if (!new RegExp(r, "su").test(e))
|
|
764
|
+
return null;
|
|
765
|
+
const s = new RegExp(`${r}|(?<$skip>\\\\?.)`, "gsu");
|
|
766
|
+
s.lastIndex = t;
|
|
767
|
+
let o = 0, a;
|
|
768
|
+
for (; a = s.exec(e); ) {
|
|
769
|
+
const { 0: i, groups: { $skip: u } } = a;
|
|
770
|
+
if (!u && (!n || n === S.DEFAULT == !o))
|
|
771
|
+
return a;
|
|
772
|
+
i === "[" ? o++ : i === "]" && o && o--, s.lastIndex == a.index && s.lastIndex++;
|
|
773
|
+
}
|
|
774
|
+
return null;
|
|
775
|
+
}
|
|
776
|
+
function pe(e, r, t) {
|
|
777
|
+
return !!Wt(e, r, 0, t);
|
|
778
|
+
}
|
|
779
|
+
function Ht(e, r) {
|
|
780
|
+
const t = /\\?./gsu;
|
|
781
|
+
t.lastIndex = r;
|
|
782
|
+
let n = e.length, s = 0, o = 1, a;
|
|
783
|
+
for (; a = t.exec(e); ) {
|
|
784
|
+
const [i] = a;
|
|
785
|
+
if (i === "[")
|
|
786
|
+
s++;
|
|
787
|
+
else if (s)
|
|
788
|
+
i === "]" && s--;
|
|
789
|
+
else if (i === "(")
|
|
790
|
+
o++;
|
|
791
|
+
else if (i === ")" && (o--, !o)) {
|
|
792
|
+
n = a.index;
|
|
793
|
+
break;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
return e.slice(r, n);
|
|
797
|
+
}
|
|
798
|
+
const er = new RegExp(String.raw`(?<noncapturingStart>${jt})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`, "gsu");
|
|
799
|
+
function Xt(e, r) {
|
|
800
|
+
const t = (r == null ? void 0 : r.hiddenCaptures) ?? [];
|
|
801
|
+
let n = (r == null ? void 0 : r.captureTransfers) ?? /* @__PURE__ */ new Map();
|
|
802
|
+
if (!/\(\?>/.test(e))
|
|
803
|
+
return {
|
|
804
|
+
pattern: e,
|
|
805
|
+
captureTransfers: n,
|
|
806
|
+
hiddenCaptures: t
|
|
807
|
+
};
|
|
808
|
+
const s = "(?>", o = "(?:(?=(", a = [0], i = [];
|
|
809
|
+
let u = 0, c = 0, l = NaN, f;
|
|
810
|
+
do {
|
|
811
|
+
f = !1;
|
|
812
|
+
let p = 0, g = 0, d = !1, m;
|
|
813
|
+
for (er.lastIndex = Number.isNaN(l) ? 0 : l + o.length; m = er.exec(e); ) {
|
|
814
|
+
const { 0: w, index: E, groups: { capturingStart: A, noncapturingStart: y } } = m;
|
|
815
|
+
if (w === "[")
|
|
816
|
+
p++;
|
|
817
|
+
else if (p)
|
|
818
|
+
w === "]" && p--;
|
|
819
|
+
else if (w === s && !d)
|
|
820
|
+
l = E, d = !0;
|
|
821
|
+
else if (d && y)
|
|
822
|
+
g++;
|
|
823
|
+
else if (A)
|
|
824
|
+
d ? g++ : (u++, a.push(u + c));
|
|
825
|
+
else if (w === ")" && d) {
|
|
826
|
+
if (!g) {
|
|
827
|
+
c++;
|
|
828
|
+
const k = u + c;
|
|
829
|
+
if (e = `${e.slice(0, l)}${o}${e.slice(l + s.length, E)}))<$$${k}>)${e.slice(E + 1)}`, f = !0, i.push(k), Vt(t, k), n.size) {
|
|
830
|
+
const _ = /* @__PURE__ */ new Map();
|
|
831
|
+
n.forEach((V, N) => {
|
|
832
|
+
_.set(
|
|
833
|
+
N >= k ? N + 1 : N,
|
|
834
|
+
V.map((J) => J >= k ? J + 1 : J)
|
|
835
|
+
);
|
|
836
|
+
}), n = _;
|
|
837
|
+
}
|
|
838
|
+
break;
|
|
839
|
+
}
|
|
840
|
+
g--;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
} while (f);
|
|
844
|
+
return t.push(...i), e = De(
|
|
845
|
+
e,
|
|
846
|
+
String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,
|
|
847
|
+
({ 0: p, groups: { backrefNum: g, wrappedBackrefNum: d } }) => {
|
|
848
|
+
if (g) {
|
|
849
|
+
const m = +g;
|
|
850
|
+
if (m > a.length - 1)
|
|
851
|
+
throw new Error(`Backref "${p}" greater than number of captures`);
|
|
852
|
+
return `\\${a[m]}`;
|
|
853
|
+
}
|
|
854
|
+
return `\\${d}`;
|
|
855
|
+
},
|
|
856
|
+
S.DEFAULT
|
|
857
|
+
), {
|
|
858
|
+
pattern: e,
|
|
859
|
+
captureTransfers: n,
|
|
860
|
+
hiddenCaptures: t
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
const Ar = String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`, ke = new RegExp(String.raw`
|
|
864
|
+
\\(?: \d+
|
|
865
|
+
| c[A-Za-z]
|
|
866
|
+
| [gk]<[^>]+>
|
|
867
|
+
| [pPu]\{[^\}]+\}
|
|
868
|
+
| u[A-Fa-f\d]{4}
|
|
869
|
+
| x[A-Fa-f\d]{2}
|
|
870
|
+
)
|
|
871
|
+
| \((?: \? (?: [:=!>]
|
|
872
|
+
| <(?:[=!]|[^>]+>)
|
|
873
|
+
| [A-Za-z\-]+:
|
|
874
|
+
| \(DEFINE\)
|
|
875
|
+
))?
|
|
876
|
+
| (?<qBase>${Ar})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
877
|
+
| \\?.
|
|
878
|
+
`.replace(/\s+/g, ""), "gsu");
|
|
879
|
+
function Zt(e) {
|
|
880
|
+
if (!new RegExp(`${Ar}\\+`).test(e))
|
|
881
|
+
return {
|
|
882
|
+
pattern: e
|
|
883
|
+
};
|
|
884
|
+
const r = [];
|
|
885
|
+
let t = null, n = null, s = "", o = 0, a;
|
|
886
|
+
for (ke.lastIndex = 0; a = ke.exec(e); ) {
|
|
887
|
+
const { 0: i, index: u, groups: { qBase: c, qMod: l, invalidQ: f } } = a;
|
|
888
|
+
if (i === "[")
|
|
889
|
+
o || (n = u), o++;
|
|
890
|
+
else if (i === "]")
|
|
891
|
+
o ? o-- : n = null;
|
|
892
|
+
else if (!o)
|
|
893
|
+
if (l === "+" && s && !s.startsWith("(")) {
|
|
894
|
+
if (f)
|
|
895
|
+
throw new Error(`Invalid quantifier "${i}"`);
|
|
896
|
+
let p = -1;
|
|
897
|
+
if (/^\{\d+\}$/.test(c))
|
|
898
|
+
e = zt(e, u + c.length, l, "");
|
|
899
|
+
else {
|
|
900
|
+
if (s === ")" || s === "]") {
|
|
901
|
+
const g = s === ")" ? t : n;
|
|
902
|
+
if (g === null)
|
|
903
|
+
throw new Error(`Invalid unmatched "${s}"`);
|
|
904
|
+
e = `${e.slice(0, g)}(?>${e.slice(g, u)}${c})${e.slice(u + i.length)}`;
|
|
905
|
+
} else
|
|
906
|
+
e = `${e.slice(0, u - s.length)}(?>${s}${c})${e.slice(u + i.length)}`;
|
|
907
|
+
p += 4;
|
|
908
|
+
}
|
|
909
|
+
ke.lastIndex += p;
|
|
910
|
+
} else i[0] === "(" ? r.push(u) : i === ")" && (t = r.length ? r.pop() : null);
|
|
911
|
+
s = i;
|
|
912
|
+
}
|
|
913
|
+
return {
|
|
914
|
+
pattern: e
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
const I = String.raw, Qt = I`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`, Fe = I`\(\?R=(?<rDepth>[^\)]+)\)|${Qt}`, we = I`\(\?<(?![=!])(?<captureName>[^>]+)>`, Ir = I`${we}|(?<unnamed>\()(?!\?)`, W = new RegExp(I`${we}|${Fe}|\(\?|\\?.`, "gsu"), $e = "Cannot use multiple overlapping recursions";
|
|
918
|
+
function qt(e, r) {
|
|
919
|
+
const { hiddenCaptures: t, mode: n } = {
|
|
920
|
+
hiddenCaptures: [],
|
|
921
|
+
mode: "plugin",
|
|
922
|
+
...r
|
|
923
|
+
};
|
|
924
|
+
let s = (r == null ? void 0 : r.captureTransfers) ?? /* @__PURE__ */ new Map();
|
|
925
|
+
if (!new RegExp(Fe, "su").test(e))
|
|
926
|
+
return {
|
|
927
|
+
pattern: e,
|
|
928
|
+
captureTransfers: s,
|
|
929
|
+
hiddenCaptures: t
|
|
930
|
+
};
|
|
931
|
+
if (n === "plugin" && pe(e, I`\(\?\(DEFINE\)`, S.DEFAULT))
|
|
932
|
+
throw new Error("DEFINE groups cannot be used with recursion");
|
|
933
|
+
const o = [], a = pe(e, I`\\[1-9]`, S.DEFAULT), i = /* @__PURE__ */ new Map(), u = [];
|
|
934
|
+
let c = !1, l = 0, f = 0, p;
|
|
935
|
+
for (W.lastIndex = 0; p = W.exec(e); ) {
|
|
936
|
+
const { 0: g, groups: { captureName: d, rDepth: m, gRNameOrNum: w, gRDepth: E } } = p;
|
|
937
|
+
if (g === "[")
|
|
938
|
+
l++;
|
|
939
|
+
else if (l)
|
|
940
|
+
g === "]" && l--;
|
|
941
|
+
else if (m) {
|
|
942
|
+
if (rr(m), c)
|
|
943
|
+
throw new Error($e);
|
|
944
|
+
if (a)
|
|
945
|
+
throw new Error(
|
|
946
|
+
// When used in `external` mode by transpilers other than Regex+, backrefs might have
|
|
947
|
+
// gone through conversion from named to numbered, so avoid a misleading error
|
|
948
|
+
`${n === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with global recursion`
|
|
949
|
+
);
|
|
950
|
+
const A = e.slice(0, p.index), y = e.slice(W.lastIndex);
|
|
951
|
+
if (pe(y, Fe, S.DEFAULT))
|
|
952
|
+
throw new Error($e);
|
|
953
|
+
const k = +m - 1;
|
|
954
|
+
e = tr(
|
|
955
|
+
A,
|
|
956
|
+
y,
|
|
957
|
+
k,
|
|
958
|
+
!1,
|
|
959
|
+
t,
|
|
960
|
+
o,
|
|
961
|
+
f
|
|
962
|
+
), s = sr(
|
|
963
|
+
s,
|
|
964
|
+
A,
|
|
965
|
+
k,
|
|
966
|
+
o.length,
|
|
967
|
+
0,
|
|
968
|
+
f
|
|
969
|
+
);
|
|
970
|
+
break;
|
|
971
|
+
} else if (w) {
|
|
972
|
+
rr(E);
|
|
973
|
+
let A = !1;
|
|
974
|
+
for (const oe of u)
|
|
975
|
+
if (oe.name === w || oe.num === +w) {
|
|
976
|
+
if (A = !0, oe.hasRecursedWithin)
|
|
977
|
+
throw new Error($e);
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
if (!A)
|
|
981
|
+
throw new Error(I`Recursive \g cannot be used outside the referenced group "${n === "external" ? w : I`\g<${w}&R=${E}>`}"`);
|
|
982
|
+
const y = i.get(w), k = Ht(e, y);
|
|
983
|
+
if (a && pe(k, I`${we}|\((?!\?)`, S.DEFAULT))
|
|
984
|
+
throw new Error(
|
|
985
|
+
// When used in `external` mode by transpilers other than Regex+, backrefs might have
|
|
986
|
+
// gone through conversion from named to numbered, so avoid a misleading error
|
|
987
|
+
`${n === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with recursion of capturing groups`
|
|
988
|
+
);
|
|
989
|
+
const _ = e.slice(y, p.index), V = k.slice(_.length + g.length), N = o.length, J = +E - 1, je = tr(
|
|
990
|
+
_,
|
|
991
|
+
V,
|
|
992
|
+
J,
|
|
993
|
+
!0,
|
|
994
|
+
t,
|
|
995
|
+
o,
|
|
996
|
+
f
|
|
997
|
+
);
|
|
998
|
+
s = sr(
|
|
999
|
+
s,
|
|
1000
|
+
_,
|
|
1001
|
+
J,
|
|
1002
|
+
o.length - N,
|
|
1003
|
+
N,
|
|
1004
|
+
f
|
|
1005
|
+
);
|
|
1006
|
+
const Or = e.slice(0, y), Dr = e.slice(y + k.length);
|
|
1007
|
+
e = `${Or}${je}${Dr}`, W.lastIndex += je.length - g.length - _.length - V.length, u.forEach((oe) => oe.hasRecursedWithin = !0), c = !0;
|
|
1008
|
+
} else if (d)
|
|
1009
|
+
f++, i.set(String(f), W.lastIndex), i.set(d, W.lastIndex), u.push({
|
|
1010
|
+
num: f,
|
|
1011
|
+
name: d
|
|
1012
|
+
});
|
|
1013
|
+
else if (g[0] === "(") {
|
|
1014
|
+
const A = g === "(";
|
|
1015
|
+
A && (f++, i.set(String(f), W.lastIndex)), u.push(A ? { num: f } : {});
|
|
1016
|
+
} else g === ")" && u.pop();
|
|
1017
|
+
}
|
|
1018
|
+
return t.push(...o), {
|
|
1019
|
+
pattern: e,
|
|
1020
|
+
captureTransfers: s,
|
|
1021
|
+
hiddenCaptures: t
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
function rr(e) {
|
|
1025
|
+
const r = `Max depth must be integer between 2 and 100; used ${e}`;
|
|
1026
|
+
if (!/^[1-9]\d*$/.test(e))
|
|
1027
|
+
throw new Error(r);
|
|
1028
|
+
if (e = +e, e < 2 || e > 100)
|
|
1029
|
+
throw new Error(r);
|
|
1030
|
+
}
|
|
1031
|
+
function tr(e, r, t, n, s, o, a) {
|
|
1032
|
+
const i = /* @__PURE__ */ new Set();
|
|
1033
|
+
n && Er(e + r, we, ({ groups: { captureName: c } }) => {
|
|
1034
|
+
i.add(c);
|
|
1035
|
+
}, S.DEFAULT);
|
|
1036
|
+
const u = [
|
|
1037
|
+
t,
|
|
1038
|
+
n ? i : null,
|
|
1039
|
+
s,
|
|
1040
|
+
o,
|
|
1041
|
+
a
|
|
1042
|
+
];
|
|
1043
|
+
return `${e}${nr(`(?:${e}`, "forward", ...u)}(?:)${nr(`${r})`, "backward", ...u)}${r}`;
|
|
1044
|
+
}
|
|
1045
|
+
function nr(e, r, t, n, s, o, a) {
|
|
1046
|
+
const u = (l) => r === "forward" ? l + 2 : t - l + 2 - 1;
|
|
1047
|
+
let c = "";
|
|
1048
|
+
for (let l = 0; l < t; l++) {
|
|
1049
|
+
const f = u(l);
|
|
1050
|
+
c += De(
|
|
1051
|
+
e,
|
|
1052
|
+
I`${Ir}|\\k<(?<backref>[^>]+)>`,
|
|
1053
|
+
({ 0: p, groups: { captureName: g, unnamed: d, backref: m } }) => {
|
|
1054
|
+
if (m && n && !n.has(m))
|
|
1055
|
+
return p;
|
|
1056
|
+
const w = `_$${f}`;
|
|
1057
|
+
if (d || g) {
|
|
1058
|
+
const E = a + o.length + 1;
|
|
1059
|
+
return o.push(E), Jt(s, E), d ? p : `(?<${g}${w}>`;
|
|
1060
|
+
}
|
|
1061
|
+
return I`\k<${m}${w}>`;
|
|
1062
|
+
},
|
|
1063
|
+
S.DEFAULT
|
|
1064
|
+
);
|
|
1065
|
+
}
|
|
1066
|
+
return c;
|
|
1067
|
+
}
|
|
1068
|
+
function Jt(e, r) {
|
|
1069
|
+
for (let t = 0; t < e.length; t++)
|
|
1070
|
+
e[t] >= r && e[t]++;
|
|
1071
|
+
}
|
|
1072
|
+
function sr(e, r, t, n, s, o) {
|
|
1073
|
+
if (e.size && n) {
|
|
1074
|
+
let a = 0;
|
|
1075
|
+
Er(r, Ir, () => a++, S.DEFAULT);
|
|
1076
|
+
const i = o - a + s, u = /* @__PURE__ */ new Map();
|
|
1077
|
+
return e.forEach((c, l) => {
|
|
1078
|
+
const f = (n - a * t) / t, p = a * t, g = l > i + a ? l + n : l, d = [];
|
|
1079
|
+
for (const m of c)
|
|
1080
|
+
if (m <= i)
|
|
1081
|
+
d.push(m);
|
|
1082
|
+
else if (m > i + a + f)
|
|
1083
|
+
d.push(m + n);
|
|
1084
|
+
else if (m <= i + a)
|
|
1085
|
+
for (let w = 0; w <= t; w++)
|
|
1086
|
+
d.push(m + a * w);
|
|
1087
|
+
else
|
|
1088
|
+
for (let w = 0; w <= t; w++)
|
|
1089
|
+
d.push(m + p + f * w);
|
|
1090
|
+
u.set(g, d);
|
|
1091
|
+
}), u;
|
|
1092
|
+
}
|
|
1093
|
+
return e;
|
|
1094
|
+
}
|
|
1095
|
+
var b = String.fromCodePoint, h = String.raw, U = {
|
|
1096
|
+
flagGroups: (() => {
|
|
1097
|
+
try {
|
|
1098
|
+
new RegExp("(?i:)");
|
|
1099
|
+
} catch {
|
|
1100
|
+
return !1;
|
|
1101
|
+
}
|
|
1102
|
+
return !0;
|
|
1103
|
+
})(),
|
|
1104
|
+
unicodeSets: (() => {
|
|
1105
|
+
try {
|
|
1106
|
+
new RegExp("[[]]", "v");
|
|
1107
|
+
} catch {
|
|
1108
|
+
return !1;
|
|
1109
|
+
}
|
|
1110
|
+
return !0;
|
|
1111
|
+
})()
|
|
1112
|
+
};
|
|
1113
|
+
U.bugFlagVLiteralHyphenIsRange = U.unicodeSets ? (() => {
|
|
1114
|
+
try {
|
|
1115
|
+
new RegExp(h`[\d\-a]`, "v");
|
|
1116
|
+
} catch {
|
|
1117
|
+
return !0;
|
|
1118
|
+
}
|
|
1119
|
+
return !1;
|
|
1120
|
+
})() : !1;
|
|
1121
|
+
U.bugNestedClassIgnoresNegation = U.unicodeSets && new RegExp("[[^a]]", "v").test("a");
|
|
1122
|
+
function ge(e, { enable: r, disable: t }) {
|
|
1123
|
+
return {
|
|
1124
|
+
dotAll: !(t != null && t.dotAll) && !!(r != null && r.dotAll || e.dotAll),
|
|
1125
|
+
ignoreCase: !(t != null && t.ignoreCase) && !!(r != null && r.ignoreCase || e.ignoreCase)
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
function ie(e, r, t) {
|
|
1129
|
+
return e.has(r) || e.set(r, t), e.get(r);
|
|
1130
|
+
}
|
|
1131
|
+
function Ge(e, r) {
|
|
1132
|
+
return or[e] >= or[r];
|
|
1133
|
+
}
|
|
1134
|
+
function Kt(e, r) {
|
|
1135
|
+
if (e == null)
|
|
1136
|
+
throw new Error(r ?? "Value expected");
|
|
1137
|
+
return e;
|
|
1138
|
+
}
|
|
1139
|
+
var or = {
|
|
1140
|
+
ES2025: 2025,
|
|
1141
|
+
ES2024: 2024,
|
|
1142
|
+
ES2018: 2018
|
|
1143
|
+
}, Yt = (
|
|
1144
|
+
/** @type {const} */
|
|
1145
|
+
{
|
|
1146
|
+
auto: "auto",
|
|
1147
|
+
ES2025: "ES2025",
|
|
1148
|
+
ES2024: "ES2024",
|
|
1149
|
+
ES2018: "ES2018"
|
|
1150
|
+
}
|
|
1151
|
+
);
|
|
1152
|
+
function vr(e = {}) {
|
|
1153
|
+
if ({}.toString.call(e) !== "[object Object]")
|
|
1154
|
+
throw new Error("Unexpected options");
|
|
1155
|
+
if (e.target !== void 0 && !Yt[e.target])
|
|
1156
|
+
throw new Error(`Unexpected target "${e.target}"`);
|
|
1157
|
+
const r = {
|
|
1158
|
+
// Sets the level of emulation rigor/strictness.
|
|
1159
|
+
accuracy: "default",
|
|
1160
|
+
// Disables advanced emulation that relies on returning a `RegExp` subclass, resulting in
|
|
1161
|
+
// certain patterns not being emulatable.
|
|
1162
|
+
avoidSubclass: !1,
|
|
1163
|
+
// Oniguruma flags; a string with `i`, `m`, `x`, `D`, `S`, `W`, `y{g}` in any order (all
|
|
1164
|
+
// optional). Oniguruma's `m` is equivalent to JavaScript's `s` (`dotAll`).
|
|
1165
|
+
flags: "",
|
|
1166
|
+
// Include JavaScript flag `g` (`global`) in the result.
|
|
1167
|
+
global: !1,
|
|
1168
|
+
// Include JavaScript flag `d` (`hasIndices`) in the result.
|
|
1169
|
+
hasIndices: !1,
|
|
1170
|
+
// Delay regex construction until first use if the transpiled pattern is at least this length.
|
|
1171
|
+
lazyCompileLength: 1 / 0,
|
|
1172
|
+
// JavaScript version used for generated regexes. Using `auto` detects the best value based on
|
|
1173
|
+
// your environment. Later targets allow faster processing, simpler generated source, and
|
|
1174
|
+
// support for additional features.
|
|
1175
|
+
target: "auto",
|
|
1176
|
+
// Disables minifications that simplify the pattern without changing the meaning.
|
|
1177
|
+
verbose: !1,
|
|
1178
|
+
...e,
|
|
1179
|
+
// Advanced options that override standard behavior, error checking, and flags when enabled.
|
|
1180
|
+
rules: {
|
|
1181
|
+
// Useful with TextMate grammars that merge backreferences across patterns.
|
|
1182
|
+
allowOrphanBackrefs: !1,
|
|
1183
|
+
// Use ASCII `\b` and `\B`, which increases search performance of generated regexes.
|
|
1184
|
+
asciiWordBoundaries: !1,
|
|
1185
|
+
// Allow unnamed captures and numbered calls (backreferences and subroutines) when using
|
|
1186
|
+
// named capture. This is Oniguruma option `ONIG_OPTION_CAPTURE_GROUP`; on by default in
|
|
1187
|
+
// `vscode-oniguruma`.
|
|
1188
|
+
captureGroup: !1,
|
|
1189
|
+
// Change the recursion depth limit from Oniguruma's `20` to an integer `2`–`20`.
|
|
1190
|
+
recursionLimit: 20,
|
|
1191
|
+
// `^` as `\A`; `$` as`\Z`. Improves search performance of generated regexes without changing
|
|
1192
|
+
// the meaning if searching line by line. This is Oniguruma option `ONIG_OPTION_SINGLELINE`.
|
|
1193
|
+
singleline: !1,
|
|
1194
|
+
...e.rules
|
|
1195
|
+
}
|
|
1196
|
+
};
|
|
1197
|
+
return r.target === "auto" && (r.target = U.flagGroups ? "ES2025" : U.unicodeSets ? "ES2024" : "ES2018"), r;
|
|
1198
|
+
}
|
|
1199
|
+
var en = "[ -\r ]", rn = /* @__PURE__ */ new Set([
|
|
1200
|
+
b(304),
|
|
1201
|
+
// İ
|
|
1202
|
+
b(305)
|
|
1203
|
+
// ı
|
|
1204
|
+
]), F = h`[\p{L}\p{M}\p{N}\p{Pc}]`;
|
|
1205
|
+
function Sr(e) {
|
|
1206
|
+
if (rn.has(e))
|
|
1207
|
+
return [e];
|
|
1208
|
+
const r = /* @__PURE__ */ new Set(), t = e.toLowerCase(), n = t.toUpperCase(), s = sn.get(t), o = tn.get(t), a = nn.get(t);
|
|
1209
|
+
return [...n].length === 1 && r.add(n), a && r.add(a), s && r.add(s), r.add(t), o && r.add(o), [...r];
|
|
1210
|
+
}
|
|
1211
|
+
var Te = /* @__PURE__ */ new Map(
|
|
1212
|
+
`C Other
|
|
1213
|
+
Cc Control cntrl
|
|
1214
|
+
Cf Format
|
|
1215
|
+
Cn Unassigned
|
|
1216
|
+
Co Private_Use
|
|
1217
|
+
Cs Surrogate
|
|
1218
|
+
L Letter
|
|
1219
|
+
LC Cased_Letter
|
|
1220
|
+
Ll Lowercase_Letter
|
|
1221
|
+
Lm Modifier_Letter
|
|
1222
|
+
Lo Other_Letter
|
|
1223
|
+
Lt Titlecase_Letter
|
|
1224
|
+
Lu Uppercase_Letter
|
|
1225
|
+
M Mark Combining_Mark
|
|
1226
|
+
Mc Spacing_Mark
|
|
1227
|
+
Me Enclosing_Mark
|
|
1228
|
+
Mn Nonspacing_Mark
|
|
1229
|
+
N Number
|
|
1230
|
+
Nd Decimal_Number digit
|
|
1231
|
+
Nl Letter_Number
|
|
1232
|
+
No Other_Number
|
|
1233
|
+
P Punctuation punct
|
|
1234
|
+
Pc Connector_Punctuation
|
|
1235
|
+
Pd Dash_Punctuation
|
|
1236
|
+
Pe Close_Punctuation
|
|
1237
|
+
Pf Final_Punctuation
|
|
1238
|
+
Pi Initial_Punctuation
|
|
1239
|
+
Po Other_Punctuation
|
|
1240
|
+
Ps Open_Punctuation
|
|
1241
|
+
S Symbol
|
|
1242
|
+
Sc Currency_Symbol
|
|
1243
|
+
Sk Modifier_Symbol
|
|
1244
|
+
Sm Math_Symbol
|
|
1245
|
+
So Other_Symbol
|
|
1246
|
+
Z Separator
|
|
1247
|
+
Zl Line_Separator
|
|
1248
|
+
Zp Paragraph_Separator
|
|
1249
|
+
Zs Space_Separator
|
|
1250
|
+
ASCII
|
|
1251
|
+
ASCII_Hex_Digit AHex
|
|
1252
|
+
Alphabetic Alpha
|
|
1253
|
+
Any
|
|
1254
|
+
Assigned
|
|
1255
|
+
Bidi_Control Bidi_C
|
|
1256
|
+
Bidi_Mirrored Bidi_M
|
|
1257
|
+
Case_Ignorable CI
|
|
1258
|
+
Cased
|
|
1259
|
+
Changes_When_Casefolded CWCF
|
|
1260
|
+
Changes_When_Casemapped CWCM
|
|
1261
|
+
Changes_When_Lowercased CWL
|
|
1262
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
1263
|
+
Changes_When_Titlecased CWT
|
|
1264
|
+
Changes_When_Uppercased CWU
|
|
1265
|
+
Dash
|
|
1266
|
+
Default_Ignorable_Code_Point DI
|
|
1267
|
+
Deprecated Dep
|
|
1268
|
+
Diacritic Dia
|
|
1269
|
+
Emoji
|
|
1270
|
+
Emoji_Component EComp
|
|
1271
|
+
Emoji_Modifier EMod
|
|
1272
|
+
Emoji_Modifier_Base EBase
|
|
1273
|
+
Emoji_Presentation EPres
|
|
1274
|
+
Extended_Pictographic ExtPict
|
|
1275
|
+
Extender Ext
|
|
1276
|
+
Grapheme_Base Gr_Base
|
|
1277
|
+
Grapheme_Extend Gr_Ext
|
|
1278
|
+
Hex_Digit Hex
|
|
1279
|
+
IDS_Binary_Operator IDSB
|
|
1280
|
+
IDS_Trinary_Operator IDST
|
|
1281
|
+
ID_Continue IDC
|
|
1282
|
+
ID_Start IDS
|
|
1283
|
+
Ideographic Ideo
|
|
1284
|
+
Join_Control Join_C
|
|
1285
|
+
Logical_Order_Exception LOE
|
|
1286
|
+
Lowercase Lower
|
|
1287
|
+
Math
|
|
1288
|
+
Noncharacter_Code_Point NChar
|
|
1289
|
+
Pattern_Syntax Pat_Syn
|
|
1290
|
+
Pattern_White_Space Pat_WS
|
|
1291
|
+
Quotation_Mark QMark
|
|
1292
|
+
Radical
|
|
1293
|
+
Regional_Indicator RI
|
|
1294
|
+
Sentence_Terminal STerm
|
|
1295
|
+
Soft_Dotted SD
|
|
1296
|
+
Terminal_Punctuation Term
|
|
1297
|
+
Unified_Ideograph UIdeo
|
|
1298
|
+
Uppercase Upper
|
|
1299
|
+
Variation_Selector VS
|
|
1300
|
+
White_Space space
|
|
1301
|
+
XID_Continue XIDC
|
|
1302
|
+
XID_Start XIDS`.split(/\s/).map((e) => [me(e), e])
|
|
1303
|
+
), tn = /* @__PURE__ */ new Map([
|
|
1304
|
+
["s", b(383)],
|
|
1305
|
+
// s, ſ
|
|
1306
|
+
[b(383), "s"]
|
|
1307
|
+
// ſ, s
|
|
1308
|
+
]), nn = /* @__PURE__ */ new Map([
|
|
1309
|
+
[b(223), b(7838)],
|
|
1310
|
+
// ß, ẞ
|
|
1311
|
+
[b(107), b(8490)],
|
|
1312
|
+
// k, K (Kelvin)
|
|
1313
|
+
[b(229), b(8491)],
|
|
1314
|
+
// å, Å (Angstrom)
|
|
1315
|
+
[b(969), b(8486)]
|
|
1316
|
+
// ω, Ω (Ohm)
|
|
1317
|
+
]), sn = new Map([
|
|
1318
|
+
O(453),
|
|
1319
|
+
O(456),
|
|
1320
|
+
O(459),
|
|
1321
|
+
O(498),
|
|
1322
|
+
...Ee(8072, 8079),
|
|
1323
|
+
...Ee(8088, 8095),
|
|
1324
|
+
...Ee(8104, 8111),
|
|
1325
|
+
O(8124),
|
|
1326
|
+
O(8140),
|
|
1327
|
+
O(8188)
|
|
1328
|
+
]), on = /* @__PURE__ */ new Map([
|
|
1329
|
+
["alnum", h`[\p{Alpha}\p{Nd}]`],
|
|
1330
|
+
["alpha", h`\p{Alpha}`],
|
|
1331
|
+
["ascii", h`\p{ASCII}`],
|
|
1332
|
+
["blank", h`[\p{Zs}\t]`],
|
|
1333
|
+
["cntrl", h`\p{Cc}`],
|
|
1334
|
+
["digit", h`\p{Nd}`],
|
|
1335
|
+
["graph", h`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],
|
|
1336
|
+
["lower", h`\p{Lower}`],
|
|
1337
|
+
["print", h`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],
|
|
1338
|
+
["punct", h`[\p{P}\p{S}]`],
|
|
1339
|
+
// Updated value from Onig 6.9.9; changed from Unicode `\p{punct}`
|
|
1340
|
+
["space", h`\p{space}`],
|
|
1341
|
+
["upper", h`\p{Upper}`],
|
|
1342
|
+
["word", h`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],
|
|
1343
|
+
["xdigit", h`\p{AHex}`]
|
|
1344
|
+
]);
|
|
1345
|
+
function an(e, r) {
|
|
1346
|
+
const t = [];
|
|
1347
|
+
for (let n = e; n <= r; n++)
|
|
1348
|
+
t.push(n);
|
|
1349
|
+
return t;
|
|
1350
|
+
}
|
|
1351
|
+
function O(e) {
|
|
1352
|
+
const r = b(e);
|
|
1353
|
+
return [r.toLowerCase(), r];
|
|
1354
|
+
}
|
|
1355
|
+
function Ee(e, r) {
|
|
1356
|
+
return an(e, r).map((t) => O(t));
|
|
1357
|
+
}
|
|
1358
|
+
var _r = /* @__PURE__ */ new Set([
|
|
1359
|
+
"Lower",
|
|
1360
|
+
"Lowercase",
|
|
1361
|
+
"Upper",
|
|
1362
|
+
"Uppercase",
|
|
1363
|
+
"Ll",
|
|
1364
|
+
"Lowercase_Letter",
|
|
1365
|
+
"Lt",
|
|
1366
|
+
"Titlecase_Letter",
|
|
1367
|
+
"Lu",
|
|
1368
|
+
"Uppercase_Letter"
|
|
1369
|
+
// The `Changes_When_*` properties (and their aliases) could be included, but they're very rare.
|
|
1370
|
+
// Some other properties include a handful of chars with specific cases only, but these chars are
|
|
1371
|
+
// generally extreme edge cases and using such properties case insensitively generally produces
|
|
1372
|
+
// undesired behavior anyway
|
|
1373
|
+
]);
|
|
1374
|
+
function un(e, r) {
|
|
1375
|
+
const t = {
|
|
1376
|
+
// A couple edge cases exist where options `accuracy` and `bestEffortTarget` are used:
|
|
1377
|
+
// - `CharacterSet` kind `text_segment` (`\X`): An exact representation would require heavy
|
|
1378
|
+
// Unicode data; a best-effort approximation requires knowing the target.
|
|
1379
|
+
// - `CharacterSet` kind `posix` with values `graph` and `print`: Their complex Unicode
|
|
1380
|
+
// representations would be hard to change to ASCII versions after the fact in the generator
|
|
1381
|
+
// based on `target`/`accuracy`, so produce the appropriate structure here.
|
|
1382
|
+
accuracy: "default",
|
|
1383
|
+
asciiWordBoundaries: !1,
|
|
1384
|
+
avoidSubclass: !1,
|
|
1385
|
+
bestEffortTarget: "ES2025",
|
|
1386
|
+
...r
|
|
1387
|
+
};
|
|
1388
|
+
Nr(e);
|
|
1389
|
+
const n = {
|
|
1390
|
+
accuracy: t.accuracy,
|
|
1391
|
+
asciiWordBoundaries: t.asciiWordBoundaries,
|
|
1392
|
+
avoidSubclass: t.avoidSubclass,
|
|
1393
|
+
flagDirectivesByAlt: /* @__PURE__ */ new Map(),
|
|
1394
|
+
jsGroupNameMap: /* @__PURE__ */ new Map(),
|
|
1395
|
+
minTargetEs2024: Ge(t.bestEffortTarget, "ES2024"),
|
|
1396
|
+
passedLookbehind: !1,
|
|
1397
|
+
strategy: null,
|
|
1398
|
+
// Subroutines can appear before the groups they ref, so collect reffed nodes for a second pass
|
|
1399
|
+
subroutineRefMap: /* @__PURE__ */ new Map(),
|
|
1400
|
+
supportedGNodes: /* @__PURE__ */ new Set(),
|
|
1401
|
+
digitIsAscii: e.flags.digitIsAscii,
|
|
1402
|
+
spaceIsAscii: e.flags.spaceIsAscii,
|
|
1403
|
+
wordIsAscii: e.flags.wordIsAscii
|
|
1404
|
+
};
|
|
1405
|
+
ae(e, cn, n);
|
|
1406
|
+
const s = {
|
|
1407
|
+
dotAll: e.flags.dotAll,
|
|
1408
|
+
ignoreCase: e.flags.ignoreCase
|
|
1409
|
+
}, o = {
|
|
1410
|
+
currentFlags: s,
|
|
1411
|
+
prevFlags: null,
|
|
1412
|
+
globalFlags: s,
|
|
1413
|
+
groupOriginByCopy: /* @__PURE__ */ new Map(),
|
|
1414
|
+
groupsByName: /* @__PURE__ */ new Map(),
|
|
1415
|
+
multiplexCapturesToLeftByRef: /* @__PURE__ */ new Map(),
|
|
1416
|
+
openRefs: /* @__PURE__ */ new Map(),
|
|
1417
|
+
reffedNodesByReferencer: /* @__PURE__ */ new Map(),
|
|
1418
|
+
subroutineRefMap: n.subroutineRefMap
|
|
1419
|
+
};
|
|
1420
|
+
ae(e, ln, o);
|
|
1421
|
+
const a = {
|
|
1422
|
+
groupsByName: o.groupsByName,
|
|
1423
|
+
highestOrphanBackref: 0,
|
|
1424
|
+
numCapturesToLeft: 0,
|
|
1425
|
+
reffedNodesByReferencer: o.reffedNodesByReferencer
|
|
1426
|
+
};
|
|
1427
|
+
return ae(e, fn, a), e._originMap = o.groupOriginByCopy, e._strategy = n.strategy, e;
|
|
1428
|
+
}
|
|
1429
|
+
var cn = {
|
|
1430
|
+
AbsenceFunction({ node: e, parent: r, replaceWith: t }) {
|
|
1431
|
+
const { body: n, kind: s } = e;
|
|
1432
|
+
if (s === "repeater") {
|
|
1433
|
+
const o = L();
|
|
1434
|
+
o.body[0].body.push(
|
|
1435
|
+
// Insert own alts as `body`
|
|
1436
|
+
H({ negate: !0, body: n }),
|
|
1437
|
+
te("Any")
|
|
1438
|
+
);
|
|
1439
|
+
const a = L();
|
|
1440
|
+
a.body[0].body.push(
|
|
1441
|
+
xr("greedy", 0, 1 / 0, o)
|
|
1442
|
+
), t(C(a, r), { traverse: !0 });
|
|
1443
|
+
} else
|
|
1444
|
+
throw new Error('Unsupported absence function "(?~|"');
|
|
1445
|
+
},
|
|
1446
|
+
Alternative: {
|
|
1447
|
+
enter({ node: e, parent: r, key: t }, { flagDirectivesByAlt: n }) {
|
|
1448
|
+
const s = e.body.filter((o) => o.kind === "flags");
|
|
1449
|
+
for (let o = t + 1; o < r.body.length; o++) {
|
|
1450
|
+
const a = r.body[o];
|
|
1451
|
+
ie(n, a, []).push(...s);
|
|
1452
|
+
}
|
|
1453
|
+
},
|
|
1454
|
+
exit({ node: e }, { flagDirectivesByAlt: r }) {
|
|
1455
|
+
var t;
|
|
1456
|
+
if ((t = r.get(e)) != null && t.length) {
|
|
1457
|
+
const n = Lr(r.get(e));
|
|
1458
|
+
if (n) {
|
|
1459
|
+
const s = L({ flags: n });
|
|
1460
|
+
s.body[0].body = e.body, e.body = [C(s, e)];
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
},
|
|
1465
|
+
Assertion({ node: e, parent: r, key: t, container: n, root: s, remove: o, replaceWith: a }, i) {
|
|
1466
|
+
const { kind: u, negate: c } = e, { asciiWordBoundaries: l, avoidSubclass: f, supportedGNodes: p, wordIsAscii: g } = i;
|
|
1467
|
+
if (u === "text_segment_boundary")
|
|
1468
|
+
throw new Error(`Unsupported text segment boundary "\\${c ? "Y" : "y"}"`);
|
|
1469
|
+
if (u === "line_end")
|
|
1470
|
+
a(C(H({ body: [
|
|
1471
|
+
q({ body: [Ne("string_end")] }),
|
|
1472
|
+
q({ body: [he(10)] })
|
|
1473
|
+
// `\n`
|
|
1474
|
+
] }), r));
|
|
1475
|
+
else if (u === "line_start")
|
|
1476
|
+
a(C(G(h`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: !0 }), r));
|
|
1477
|
+
else if (u === "search_start")
|
|
1478
|
+
if (p.has(e))
|
|
1479
|
+
s.flags.sticky = !0, o();
|
|
1480
|
+
else {
|
|
1481
|
+
const d = n[t - 1];
|
|
1482
|
+
if (d && wn(d))
|
|
1483
|
+
a(C(H({ negate: !0 }), r));
|
|
1484
|
+
else {
|
|
1485
|
+
if (f)
|
|
1486
|
+
throw new Error(h`Uses "\G" in a way that requires a subclass`);
|
|
1487
|
+
a(D(Ne("string_start"), r)), i.strategy = "clip_search";
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
else if (!(u === "string_end" || u === "string_start")) if (u === "string_end_newline")
|
|
1491
|
+
a(C(G(h`(?=\n?\z)`), r));
|
|
1492
|
+
else if (u === "word_boundary") {
|
|
1493
|
+
if (!g && !l) {
|
|
1494
|
+
const d = `(?:(?<=${F})(?!${F})|(?<!${F})(?=${F}))`, m = `(?:(?<=${F})(?=${F})|(?<!${F})(?!${F}))`;
|
|
1495
|
+
a(C(G(c ? m : d), r));
|
|
1496
|
+
}
|
|
1497
|
+
} else
|
|
1498
|
+
throw new Error(`Unexpected assertion kind "${u}"`);
|
|
1499
|
+
},
|
|
1500
|
+
Backreference({ node: e }, { jsGroupNameMap: r }) {
|
|
1501
|
+
let { ref: t } = e;
|
|
1502
|
+
typeof t == "string" && !Ie(t) && (t = Ae(t, r), e.ref = t);
|
|
1503
|
+
},
|
|
1504
|
+
CapturingGroup({ node: e }, { jsGroupNameMap: r, subroutineRefMap: t }) {
|
|
1505
|
+
let { name: n } = e;
|
|
1506
|
+
n && !Ie(n) && (n = Ae(n, r), e.name = n), t.set(e.number, e), n && t.set(n, e);
|
|
1507
|
+
},
|
|
1508
|
+
CharacterClassRange({ node: e, parent: r, replaceWith: t }) {
|
|
1509
|
+
if (r.kind === "intersection") {
|
|
1510
|
+
const n = de({ body: [e] });
|
|
1511
|
+
t(C(n, r), { traverse: !0 });
|
|
1512
|
+
}
|
|
1513
|
+
},
|
|
1514
|
+
CharacterSet({ node: e, parent: r, replaceWith: t }, { accuracy: n, minTargetEs2024: s, digitIsAscii: o, spaceIsAscii: a, wordIsAscii: i }) {
|
|
1515
|
+
const { kind: u, negate: c, value: l } = e;
|
|
1516
|
+
if (o && (u === "digit" || l === "digit")) {
|
|
1517
|
+
t(D(Le("digit", { negate: c }), r));
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
if (a && (u === "space" || l === "space")) {
|
|
1521
|
+
t(C(ve(G(en), c), r));
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
if (i && (u === "word" || l === "word")) {
|
|
1525
|
+
t(D(Le("word", { negate: c }), r));
|
|
1526
|
+
return;
|
|
1527
|
+
}
|
|
1528
|
+
if (u === "any")
|
|
1529
|
+
t(D(te("Any"), r));
|
|
1530
|
+
else if (u === "digit")
|
|
1531
|
+
t(D(te("Nd", { negate: c }), r));
|
|
1532
|
+
else if (u !== "dot") if (u === "text_segment") {
|
|
1533
|
+
if (n === "strict")
|
|
1534
|
+
throw new Error(h`Use of "\X" requires non-strict accuracy`);
|
|
1535
|
+
const f = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?", p = h`\p{RI}{2}|${f}(?:\u200D${f})*`;
|
|
1536
|
+
t(C(G(
|
|
1537
|
+
// Close approximation of an extended grapheme cluster; see <unicode.org/reports/tr29/>
|
|
1538
|
+
h`(?>\r\n|${s ? h`\p{RGI_Emoji}` : p}|\P{M}\p{M}*)`,
|
|
1539
|
+
// Allow JS property `RGI_Emoji` through
|
|
1540
|
+
{ skipPropertyNameValidation: !0 }
|
|
1541
|
+
), r));
|
|
1542
|
+
} else if (u === "hex")
|
|
1543
|
+
t(D(te("AHex", { negate: c }), r));
|
|
1544
|
+
else if (u === "newline")
|
|
1545
|
+
t(C(G(c ? `[^
|
|
1546
|
+
]` : `(?>\r
|
|
1547
|
+
?|[
|
|
1548
|
+
\v\f
\u2028\u2029])`), r));
|
|
1549
|
+
else if (u === "posix")
|
|
1550
|
+
if (!s && (l === "graph" || l === "print")) {
|
|
1551
|
+
if (n === "strict")
|
|
1552
|
+
throw new Error(`POSIX class "${l}" requires min target ES2024 or non-strict accuracy`);
|
|
1553
|
+
let f = {
|
|
1554
|
+
graph: "!-~",
|
|
1555
|
+
print: " -~"
|
|
1556
|
+
}[l];
|
|
1557
|
+
c && (f = `\0-${b(f.codePointAt(0) - 1)}${b(f.codePointAt(2) + 1)}-`), t(C(G(`[${f}]`), r));
|
|
1558
|
+
} else
|
|
1559
|
+
t(C(ve(G(on.get(l)), c), r));
|
|
1560
|
+
else if (u === "property")
|
|
1561
|
+
Te.has(me(l)) || (e.key = "sc");
|
|
1562
|
+
else if (u === "space")
|
|
1563
|
+
t(D(te("space", { negate: c }), r));
|
|
1564
|
+
else if (u === "word")
|
|
1565
|
+
t(C(ve(G(F), c), r));
|
|
1566
|
+
else
|
|
1567
|
+
throw new Error(`Unexpected character set kind "${u}"`);
|
|
1568
|
+
},
|
|
1569
|
+
Directive({ node: e, parent: r, root: t, remove: n, replaceWith: s, removeAllPrevSiblings: o, removeAllNextSiblings: a }) {
|
|
1570
|
+
const { kind: i, flags: u } = e;
|
|
1571
|
+
if (i === "flags")
|
|
1572
|
+
if (!u.enable && !u.disable)
|
|
1573
|
+
n();
|
|
1574
|
+
else {
|
|
1575
|
+
const c = L({ flags: u });
|
|
1576
|
+
c.body[0].body = a(), s(C(c, r), { traverse: !0 });
|
|
1577
|
+
}
|
|
1578
|
+
else if (i === "keep") {
|
|
1579
|
+
const c = t.body[0], f = t.body.length === 1 && // Not emulatable if within a `CapturingGroup`
|
|
1580
|
+
yr(c, { type: "Group" }) && c.body[0].body.length === 1 ? c.body[0] : t;
|
|
1581
|
+
if (r.parent !== f || f.body.length > 1)
|
|
1582
|
+
throw new Error(h`Uses "\K" in a way that's unsupported`);
|
|
1583
|
+
const p = H({ behind: !0 });
|
|
1584
|
+
p.body[0].body = o(), s(C(p, r));
|
|
1585
|
+
} else
|
|
1586
|
+
throw new Error(`Unexpected directive kind "${i}"`);
|
|
1587
|
+
},
|
|
1588
|
+
Flags({ node: e, parent: r }) {
|
|
1589
|
+
if (e.posixIsAscii)
|
|
1590
|
+
throw new Error('Unsupported flag "P"');
|
|
1591
|
+
if (e.textSegmentMode === "word")
|
|
1592
|
+
throw new Error('Unsupported flag "y{w}"');
|
|
1593
|
+
[
|
|
1594
|
+
"digitIsAscii",
|
|
1595
|
+
// Flag D
|
|
1596
|
+
"extended",
|
|
1597
|
+
// Flag x
|
|
1598
|
+
"posixIsAscii",
|
|
1599
|
+
// Flag P
|
|
1600
|
+
"spaceIsAscii",
|
|
1601
|
+
// Flag S
|
|
1602
|
+
"wordIsAscii",
|
|
1603
|
+
// Flag W
|
|
1604
|
+
"textSegmentMode"
|
|
1605
|
+
// Flag y{g} or y{w}
|
|
1606
|
+
].forEach((t) => delete e[t]), Object.assign(e, {
|
|
1607
|
+
// JS flag g; no Onig equiv
|
|
1608
|
+
global: !1,
|
|
1609
|
+
// JS flag d; no Onig equiv
|
|
1610
|
+
hasIndices: !1,
|
|
1611
|
+
// JS flag m; no Onig equiv but its behavior is always on in Onig. Onig's only line break
|
|
1612
|
+
// char is line feed, unlike JS, so this flag isn't used since it would produce inaccurate
|
|
1613
|
+
// results (also allows `^` and `$` to be used in the generator for string start and end)
|
|
1614
|
+
multiline: !1,
|
|
1615
|
+
// JS flag y; no Onig equiv, but used for `\G` emulation
|
|
1616
|
+
sticky: e.sticky ?? !1
|
|
1617
|
+
// Note: Regex+ doesn't allow explicitly adding flags it handles implicitly, so leave out
|
|
1618
|
+
// properties `unicode` (JS flag u) and `unicodeSets` (JS flag v). Keep the existing values
|
|
1619
|
+
// for `ignoreCase` (flag i) and `dotAll` (JS flag s, but Onig flag m)
|
|
1620
|
+
}), r.options = {
|
|
1621
|
+
disable: {
|
|
1622
|
+
// Onig uses different rules for flag x than Regex+, so disable the implicit flag
|
|
1623
|
+
x: !0,
|
|
1624
|
+
// Onig has no flag to control "named capture only" mode but contextually applies its
|
|
1625
|
+
// behavior when named capturing is used, so disable Regex+'s implicit flag for it
|
|
1626
|
+
n: !0
|
|
1627
|
+
},
|
|
1628
|
+
force: {
|
|
1629
|
+
// Always add flag v because we're generating an AST that relies on it (it enables JS
|
|
1630
|
+
// support for Onig features nested classes, intersection, Unicode properties, etc.).
|
|
1631
|
+
// However, the generator might disable flag v based on its `target` option
|
|
1632
|
+
v: !0
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1635
|
+
},
|
|
1636
|
+
Group({ node: e }) {
|
|
1637
|
+
if (!e.flags)
|
|
1638
|
+
return;
|
|
1639
|
+
const { enable: r, disable: t } = e.flags;
|
|
1640
|
+
r != null && r.extended && delete r.extended, t != null && t.extended && delete t.extended, r != null && r.dotAll && (t != null && t.dotAll) && delete r.dotAll, r != null && r.ignoreCase && (t != null && t.ignoreCase) && delete r.ignoreCase, r && !Object.keys(r).length && delete e.flags.enable, t && !Object.keys(t).length && delete e.flags.disable, !e.flags.enable && !e.flags.disable && delete e.flags;
|
|
1641
|
+
},
|
|
1642
|
+
LookaroundAssertion({ node: e }, r) {
|
|
1643
|
+
const { kind: t } = e;
|
|
1644
|
+
t === "lookbehind" && (r.passedLookbehind = !0);
|
|
1645
|
+
},
|
|
1646
|
+
NamedCallout({ node: e, parent: r, replaceWith: t }) {
|
|
1647
|
+
const { kind: n } = e;
|
|
1648
|
+
if (n === "fail")
|
|
1649
|
+
t(C(H({ negate: !0 }), r));
|
|
1650
|
+
else
|
|
1651
|
+
throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`);
|
|
1652
|
+
},
|
|
1653
|
+
Quantifier({ node: e }) {
|
|
1654
|
+
if (e.body.type === "Quantifier") {
|
|
1655
|
+
const r = L();
|
|
1656
|
+
r.body[0].body.push(e.body), e.body = C(r, e);
|
|
1657
|
+
}
|
|
1658
|
+
},
|
|
1659
|
+
Regex: {
|
|
1660
|
+
enter({ node: e }, { supportedGNodes: r }) {
|
|
1661
|
+
const t = [];
|
|
1662
|
+
let n = !1, s = !1;
|
|
1663
|
+
for (const o of e.body)
|
|
1664
|
+
if (o.body.length === 1 && o.body[0].kind === "search_start")
|
|
1665
|
+
o.body.pop();
|
|
1666
|
+
else {
|
|
1667
|
+
const a = Gr(o.body);
|
|
1668
|
+
a ? (n = !0, Array.isArray(a) ? t.push(...a) : t.push(a)) : s = !0;
|
|
1669
|
+
}
|
|
1670
|
+
n && !s && t.forEach((o) => r.add(o));
|
|
1671
|
+
},
|
|
1672
|
+
exit(e, { accuracy: r, passedLookbehind: t, strategy: n }) {
|
|
1673
|
+
if (r === "strict" && t && n)
|
|
1674
|
+
throw new Error(h`Uses "\G" in a way that requires non-strict accuracy`);
|
|
1675
|
+
}
|
|
1676
|
+
},
|
|
1677
|
+
Subroutine({ node: e }, { jsGroupNameMap: r }) {
|
|
1678
|
+
let { ref: t } = e;
|
|
1679
|
+
typeof t == "string" && !Ie(t) && (t = Ae(t, r), e.ref = t);
|
|
1680
|
+
}
|
|
1681
|
+
}, ln = {
|
|
1682
|
+
Backreference({ node: e }, { multiplexCapturesToLeftByRef: r, reffedNodesByReferencer: t }) {
|
|
1683
|
+
const { orphan: n, ref: s } = e;
|
|
1684
|
+
n || t.set(e, [...r.get(s).map(({ node: o }) => o)]);
|
|
1685
|
+
},
|
|
1686
|
+
CapturingGroup: {
|
|
1687
|
+
enter({
|
|
1688
|
+
node: e,
|
|
1689
|
+
parent: r,
|
|
1690
|
+
replaceWith: t,
|
|
1691
|
+
skip: n
|
|
1692
|
+
}, {
|
|
1693
|
+
groupOriginByCopy: s,
|
|
1694
|
+
groupsByName: o,
|
|
1695
|
+
multiplexCapturesToLeftByRef: a,
|
|
1696
|
+
openRefs: i,
|
|
1697
|
+
reffedNodesByReferencer: u
|
|
1698
|
+
}) {
|
|
1699
|
+
const c = s.get(e);
|
|
1700
|
+
if (c && i.has(e.number)) {
|
|
1701
|
+
const f = D(ar(e.number), r);
|
|
1702
|
+
u.set(f, i.get(e.number)), t(f);
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
i.set(e.number, e), a.set(e.number, []), e.name && ie(a, e.name, []);
|
|
1706
|
+
const l = a.get(e.name ?? e.number);
|
|
1707
|
+
for (let f = 0; f < l.length; f++) {
|
|
1708
|
+
const p = l[f];
|
|
1709
|
+
if (
|
|
1710
|
+
// This group is from subroutine expansion, and there's a multiplex value from either the
|
|
1711
|
+
// origin node or a prior subroutine expansion group with the same origin
|
|
1712
|
+
c === p.node || c && c === p.origin || // This group is not from subroutine expansion, and it comes after a subroutine expansion
|
|
1713
|
+
// group that refers to this group
|
|
1714
|
+
e === p.origin
|
|
1715
|
+
) {
|
|
1716
|
+
l.splice(f, 1);
|
|
1717
|
+
break;
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
if (a.get(e.number).push({ node: e, origin: c }), e.name && a.get(e.name).push({ node: e, origin: c }), e.name) {
|
|
1721
|
+
const f = ie(o, e.name, /* @__PURE__ */ new Map());
|
|
1722
|
+
let p = !1;
|
|
1723
|
+
if (c)
|
|
1724
|
+
p = !0;
|
|
1725
|
+
else
|
|
1726
|
+
for (const g of f.values())
|
|
1727
|
+
if (!g.hasDuplicateNameToRemove) {
|
|
1728
|
+
p = !0;
|
|
1729
|
+
break;
|
|
1730
|
+
}
|
|
1731
|
+
o.get(e.name).set(e, { node: e, hasDuplicateNameToRemove: p });
|
|
1732
|
+
}
|
|
1733
|
+
},
|
|
1734
|
+
exit({ node: e }, { openRefs: r }) {
|
|
1735
|
+
r.delete(e.number);
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
Group: {
|
|
1739
|
+
enter({ node: e }, r) {
|
|
1740
|
+
r.prevFlags = r.currentFlags, e.flags && (r.currentFlags = ge(r.currentFlags, e.flags));
|
|
1741
|
+
},
|
|
1742
|
+
exit(e, r) {
|
|
1743
|
+
r.currentFlags = r.prevFlags;
|
|
1744
|
+
}
|
|
1745
|
+
},
|
|
1746
|
+
Subroutine({ node: e, parent: r, replaceWith: t }, n) {
|
|
1747
|
+
const { isRecursive: s, ref: o } = e;
|
|
1748
|
+
if (s) {
|
|
1749
|
+
let l = r;
|
|
1750
|
+
for (; (l = l.parent) && !(l.type === "CapturingGroup" && (l.name === o || l.number === o)); )
|
|
1751
|
+
;
|
|
1752
|
+
n.reffedNodesByReferencer.set(e, l);
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
const a = n.subroutineRefMap.get(o), i = o === 0, u = i ? ar(0) : (
|
|
1756
|
+
// The reffed group might itself contain subroutines, which are expanded during sub-traversal
|
|
1757
|
+
Mr(a, n.groupOriginByCopy, null)
|
|
1758
|
+
);
|
|
1759
|
+
let c = u;
|
|
1760
|
+
if (!i) {
|
|
1761
|
+
const l = Lr(gn(
|
|
1762
|
+
a,
|
|
1763
|
+
(p) => p.type === "Group" && !!p.flags
|
|
1764
|
+
)), f = l ? ge(n.globalFlags, l) : n.globalFlags;
|
|
1765
|
+
pn(f, n.currentFlags) || (c = L({
|
|
1766
|
+
flags: hn(f)
|
|
1767
|
+
}), c.body[0].body.push(u));
|
|
1768
|
+
}
|
|
1769
|
+
t(C(c, r), { traverse: !i });
|
|
1770
|
+
}
|
|
1771
|
+
}, fn = {
|
|
1772
|
+
Backreference({ node: e, parent: r, replaceWith: t }, n) {
|
|
1773
|
+
if (e.orphan) {
|
|
1774
|
+
n.highestOrphanBackref = Math.max(n.highestOrphanBackref, e.ref);
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
const o = n.reffedNodesByReferencer.get(e).filter((a) => dn(a, e));
|
|
1778
|
+
if (!o.length)
|
|
1779
|
+
t(C(H({ negate: !0 }), r));
|
|
1780
|
+
else if (o.length > 1) {
|
|
1781
|
+
const a = L({
|
|
1782
|
+
atomic: !0,
|
|
1783
|
+
body: o.reverse().map((i) => q({
|
|
1784
|
+
body: [Me(i.number)]
|
|
1785
|
+
}))
|
|
1786
|
+
});
|
|
1787
|
+
t(C(a, r));
|
|
1788
|
+
} else
|
|
1789
|
+
e.ref = o[0].number;
|
|
1790
|
+
},
|
|
1791
|
+
CapturingGroup({ node: e }, r) {
|
|
1792
|
+
e.number = ++r.numCapturesToLeft, e.name && r.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove && delete e.name;
|
|
1793
|
+
},
|
|
1794
|
+
Regex: {
|
|
1795
|
+
exit({ node: e }, r) {
|
|
1796
|
+
const t = Math.max(r.highestOrphanBackref - r.numCapturesToLeft, 0);
|
|
1797
|
+
for (let n = 0; n < t; n++) {
|
|
1798
|
+
const s = br();
|
|
1799
|
+
e.body.at(-1).body.push(s);
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
},
|
|
1803
|
+
Subroutine({ node: e }, r) {
|
|
1804
|
+
!e.isRecursive || e.ref === 0 || (e.ref = r.reffedNodesByReferencer.get(e).number);
|
|
1805
|
+
}
|
|
1806
|
+
};
|
|
1807
|
+
function Nr(e) {
|
|
1808
|
+
ae(e, {
|
|
1809
|
+
"*"({ node: r, parent: t }) {
|
|
1810
|
+
r.parent = t;
|
|
1811
|
+
}
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
function pn(e, r) {
|
|
1815
|
+
return e.dotAll === r.dotAll && e.ignoreCase === r.ignoreCase;
|
|
1816
|
+
}
|
|
1817
|
+
function dn(e, r) {
|
|
1818
|
+
let t = r;
|
|
1819
|
+
do {
|
|
1820
|
+
if (t.type === "Regex")
|
|
1821
|
+
return !1;
|
|
1822
|
+
if (t.type === "Alternative")
|
|
1823
|
+
continue;
|
|
1824
|
+
if (t === e)
|
|
1825
|
+
return !1;
|
|
1826
|
+
const n = Fr(t.parent);
|
|
1827
|
+
for (const s of n) {
|
|
1828
|
+
if (s === t)
|
|
1829
|
+
break;
|
|
1830
|
+
if (s === e || Pr(s, e))
|
|
1831
|
+
return !0;
|
|
1832
|
+
}
|
|
1833
|
+
} while (t = t.parent);
|
|
1834
|
+
throw new Error("Unexpected path");
|
|
1835
|
+
}
|
|
1836
|
+
function Mr(e, r, t, n) {
|
|
1837
|
+
const s = Array.isArray(e) ? [] : {};
|
|
1838
|
+
for (const [o, a] of Object.entries(e))
|
|
1839
|
+
o === "parent" ? s.parent = Array.isArray(t) ? n : t : a && typeof a == "object" ? s[o] = Mr(a, r, s, t) : (o === "type" && a === "CapturingGroup" && r.set(s, r.get(e) ?? e), s[o] = a);
|
|
1840
|
+
return s;
|
|
1841
|
+
}
|
|
1842
|
+
function ar(e) {
|
|
1843
|
+
const r = kr(e);
|
|
1844
|
+
return r.isRecursive = !0, r;
|
|
1845
|
+
}
|
|
1846
|
+
function gn(e, r) {
|
|
1847
|
+
const t = [];
|
|
1848
|
+
for (; e = e.parent; )
|
|
1849
|
+
(!r || r(e)) && t.push(e);
|
|
1850
|
+
return t;
|
|
1851
|
+
}
|
|
1852
|
+
function Ae(e, r) {
|
|
1853
|
+
if (r.has(e))
|
|
1854
|
+
return r.get(e);
|
|
1855
|
+
const t = `$${r.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug, "_")}`;
|
|
1856
|
+
return r.set(e, t), t;
|
|
1857
|
+
}
|
|
1858
|
+
function Lr(e) {
|
|
1859
|
+
const r = ["dotAll", "ignoreCase"], t = { enable: {}, disable: {} };
|
|
1860
|
+
return e.forEach(({ flags: n }) => {
|
|
1861
|
+
r.forEach((s) => {
|
|
1862
|
+
var o, a;
|
|
1863
|
+
(o = n.enable) != null && o[s] && (delete t.disable[s], t.enable[s] = !0), (a = n.disable) != null && a[s] && (t.disable[s] = !0);
|
|
1864
|
+
});
|
|
1865
|
+
}), Object.keys(t.enable).length || delete t.enable, Object.keys(t.disable).length || delete t.disable, t.enable || t.disable ? t : null;
|
|
1866
|
+
}
|
|
1867
|
+
function hn({ dotAll: e, ignoreCase: r }) {
|
|
1868
|
+
const t = {};
|
|
1869
|
+
return (e || r) && (t.enable = {}, e && (t.enable.dotAll = !0), r && (t.enable.ignoreCase = !0)), (!e || !r) && (t.disable = {}, !e && (t.disable.dotAll = !0), !r && (t.disable.ignoreCase = !0)), t;
|
|
1870
|
+
}
|
|
1871
|
+
function Fr(e) {
|
|
1872
|
+
if (!e)
|
|
1873
|
+
throw new Error("Node expected");
|
|
1874
|
+
const { body: r } = e;
|
|
1875
|
+
return Array.isArray(r) ? r : r ? [r] : null;
|
|
1876
|
+
}
|
|
1877
|
+
function Gr(e) {
|
|
1878
|
+
const r = e.find((t) => t.kind === "search_start" || yn(t, { negate: !1 }) || !mn(t));
|
|
1879
|
+
if (!r)
|
|
1880
|
+
return null;
|
|
1881
|
+
if (r.kind === "search_start")
|
|
1882
|
+
return r;
|
|
1883
|
+
if (r.type === "LookaroundAssertion")
|
|
1884
|
+
return r.body[0].body[0];
|
|
1885
|
+
if (r.type === "CapturingGroup" || r.type === "Group") {
|
|
1886
|
+
const t = [];
|
|
1887
|
+
for (const n of r.body) {
|
|
1888
|
+
const s = Gr(n.body);
|
|
1889
|
+
if (!s)
|
|
1890
|
+
return null;
|
|
1891
|
+
Array.isArray(s) ? t.push(...s) : t.push(s);
|
|
1892
|
+
}
|
|
1893
|
+
return t;
|
|
1894
|
+
}
|
|
1895
|
+
return null;
|
|
1896
|
+
}
|
|
1897
|
+
function Pr(e, r) {
|
|
1898
|
+
const t = Fr(e) ?? [];
|
|
1899
|
+
for (const n of t)
|
|
1900
|
+
if (n === r || Pr(n, r))
|
|
1901
|
+
return !0;
|
|
1902
|
+
return !1;
|
|
1903
|
+
}
|
|
1904
|
+
function mn({ type: e }) {
|
|
1905
|
+
return e === "Assertion" || e === "Directive" || e === "LookaroundAssertion";
|
|
1906
|
+
}
|
|
1907
|
+
function wn(e) {
|
|
1908
|
+
const r = [
|
|
1909
|
+
"Character",
|
|
1910
|
+
"CharacterClass",
|
|
1911
|
+
"CharacterSet"
|
|
1912
|
+
];
|
|
1913
|
+
return r.includes(e.type) || e.type === "Quantifier" && e.min && r.includes(e.body.type);
|
|
1914
|
+
}
|
|
1915
|
+
function yn(e, r) {
|
|
1916
|
+
const t = {
|
|
1917
|
+
negate: null,
|
|
1918
|
+
...r
|
|
1919
|
+
};
|
|
1920
|
+
return e.type === "LookaroundAssertion" && (t.negate === null || e.negate === t.negate) && e.body.length === 1 && yr(e.body[0], {
|
|
1921
|
+
type: "Assertion",
|
|
1922
|
+
kind: "search_start"
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
function Ie(e) {
|
|
1926
|
+
return /^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e);
|
|
1927
|
+
}
|
|
1928
|
+
function G(e, r) {
|
|
1929
|
+
const n = Cr(e, {
|
|
1930
|
+
...r,
|
|
1931
|
+
// Providing a custom set of Unicode property names avoids converting some JS Unicode
|
|
1932
|
+
// properties (ex: `\p{Alpha}`) to Onig POSIX classes
|
|
1933
|
+
unicodePropertyMap: Te
|
|
1934
|
+
}).body;
|
|
1935
|
+
return n.length > 1 || n[0].body.length > 1 ? L({ body: n }) : n[0].body[0];
|
|
1936
|
+
}
|
|
1937
|
+
function ve(e, r) {
|
|
1938
|
+
return e.negate = r, e;
|
|
1939
|
+
}
|
|
1940
|
+
function D(e, r) {
|
|
1941
|
+
return e.parent = r, e;
|
|
1942
|
+
}
|
|
1943
|
+
function C(e, r) {
|
|
1944
|
+
return Nr(e), e.parent = r, e;
|
|
1945
|
+
}
|
|
1946
|
+
function Cn(e, r) {
|
|
1947
|
+
const t = vr(r), n = Ge(t.target, "ES2024"), s = Ge(t.target, "ES2025"), o = t.rules.recursionLimit;
|
|
1948
|
+
if (!Number.isInteger(o) || o < 2 || o > 20)
|
|
1949
|
+
throw new Error("Invalid recursionLimit; use 2-20");
|
|
1950
|
+
let a = null, i = null;
|
|
1951
|
+
if (!s) {
|
|
1952
|
+
const g = [e.flags.ignoreCase];
|
|
1953
|
+
ae(e, bn, {
|
|
1954
|
+
getCurrentModI: () => g.at(-1),
|
|
1955
|
+
popModI() {
|
|
1956
|
+
g.pop();
|
|
1957
|
+
},
|
|
1958
|
+
pushModI(d) {
|
|
1959
|
+
g.push(d);
|
|
1960
|
+
},
|
|
1961
|
+
setHasCasedChar() {
|
|
1962
|
+
g.at(-1) ? a = !0 : i = !0;
|
|
1963
|
+
}
|
|
1964
|
+
});
|
|
1965
|
+
}
|
|
1966
|
+
const u = {
|
|
1967
|
+
dotAll: e.flags.dotAll,
|
|
1968
|
+
// - Turn global flag i on if a case insensitive node was used and no case sensitive nodes were
|
|
1969
|
+
// used (to avoid unnecessary node expansion).
|
|
1970
|
+
// - Turn global flag i off if a case sensitive node was used (since case sensitivity can't be
|
|
1971
|
+
// forced without the use of ES2025 flag groups)
|
|
1972
|
+
ignoreCase: !!((e.flags.ignoreCase || a) && !i)
|
|
1973
|
+
};
|
|
1974
|
+
let c = e;
|
|
1975
|
+
const l = {
|
|
1976
|
+
accuracy: t.accuracy,
|
|
1977
|
+
appliedGlobalFlags: u,
|
|
1978
|
+
captureMap: /* @__PURE__ */ new Map(),
|
|
1979
|
+
currentFlags: {
|
|
1980
|
+
dotAll: e.flags.dotAll,
|
|
1981
|
+
ignoreCase: e.flags.ignoreCase
|
|
1982
|
+
},
|
|
1983
|
+
inCharClass: !1,
|
|
1984
|
+
lastNode: c,
|
|
1985
|
+
originMap: e._originMap,
|
|
1986
|
+
recursionLimit: o,
|
|
1987
|
+
useAppliedIgnoreCase: !!(!s && a && i),
|
|
1988
|
+
useFlagMods: s,
|
|
1989
|
+
useFlagV: n,
|
|
1990
|
+
verbose: t.verbose
|
|
1991
|
+
};
|
|
1992
|
+
function f(g) {
|
|
1993
|
+
return l.lastNode = c, c = g, Kt(xn[g.type], `Unexpected node type "${g.type}"`)(g, l, f);
|
|
1994
|
+
}
|
|
1995
|
+
const p = {
|
|
1996
|
+
pattern: e.body.map(f).join("|"),
|
|
1997
|
+
// Could reset `lastNode` at this point via `lastNode = ast`, but it isn't needed by flags
|
|
1998
|
+
flags: f(e.flags),
|
|
1999
|
+
options: { ...e.options }
|
|
2000
|
+
};
|
|
2001
|
+
return n || (delete p.options.force.v, p.options.disable.v = !0, p.options.unicodeSetsPlugin = null), p._captureTransfers = /* @__PURE__ */ new Map(), p._hiddenCaptures = [], l.captureMap.forEach((g, d) => {
|
|
2002
|
+
g.hidden && p._hiddenCaptures.push(d), g.transferTo && ie(p._captureTransfers, g.transferTo, []).push(d);
|
|
2003
|
+
}), p;
|
|
2004
|
+
}
|
|
2005
|
+
var bn = {
|
|
2006
|
+
"*": {
|
|
2007
|
+
enter({ node: e }, r) {
|
|
2008
|
+
if (ur(e)) {
|
|
2009
|
+
const t = r.getCurrentModI();
|
|
2010
|
+
r.pushModI(
|
|
2011
|
+
e.flags ? ge({ ignoreCase: t }, e.flags).ignoreCase : t
|
|
2012
|
+
);
|
|
2013
|
+
}
|
|
2014
|
+
},
|
|
2015
|
+
exit({ node: e }, r) {
|
|
2016
|
+
ur(e) && r.popModI();
|
|
2017
|
+
}
|
|
2018
|
+
},
|
|
2019
|
+
Backreference(e, r) {
|
|
2020
|
+
r.setHasCasedChar();
|
|
2021
|
+
},
|
|
2022
|
+
Character({ node: e }, r) {
|
|
2023
|
+
Be(b(e.value)) && r.setHasCasedChar();
|
|
2024
|
+
},
|
|
2025
|
+
CharacterClassRange({ node: e, skip: r }, t) {
|
|
2026
|
+
r(), Rr(e, { firstOnly: !0 }).length && t.setHasCasedChar();
|
|
2027
|
+
},
|
|
2028
|
+
CharacterSet({ node: e }, r) {
|
|
2029
|
+
e.kind === "property" && _r.has(e.value) && r.setHasCasedChar();
|
|
2030
|
+
}
|
|
2031
|
+
}, xn = {
|
|
2032
|
+
/**
|
|
2033
|
+
@param {AlternativeNode} node
|
|
2034
|
+
*/
|
|
2035
|
+
Alternative({ body: e }, r, t) {
|
|
2036
|
+
return e.map(t).join("");
|
|
2037
|
+
},
|
|
2038
|
+
/**
|
|
2039
|
+
@param {AssertionNode} node
|
|
2040
|
+
*/
|
|
2041
|
+
Assertion({ kind: e, negate: r }) {
|
|
2042
|
+
if (e === "string_end")
|
|
2043
|
+
return "$";
|
|
2044
|
+
if (e === "string_start")
|
|
2045
|
+
return "^";
|
|
2046
|
+
if (e === "word_boundary")
|
|
2047
|
+
return r ? h`\B` : h`\b`;
|
|
2048
|
+
throw new Error(`Unexpected assertion kind "${e}"`);
|
|
2049
|
+
},
|
|
2050
|
+
/**
|
|
2051
|
+
@param {BackreferenceNode} node
|
|
2052
|
+
*/
|
|
2053
|
+
Backreference({ ref: e }, r) {
|
|
2054
|
+
if (typeof e != "number")
|
|
2055
|
+
throw new Error("Unexpected named backref in transformed AST");
|
|
2056
|
+
if (!r.useFlagMods && r.accuracy === "strict" && r.currentFlags.ignoreCase && !r.captureMap.get(e).ignoreCase)
|
|
2057
|
+
throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");
|
|
2058
|
+
return "\\" + e;
|
|
2059
|
+
},
|
|
2060
|
+
/**
|
|
2061
|
+
@param {CapturingGroupNode} node
|
|
2062
|
+
*/
|
|
2063
|
+
CapturingGroup(e, r, t) {
|
|
2064
|
+
const { body: n, name: s, number: o } = e, a = { ignoreCase: r.currentFlags.ignoreCase }, i = r.originMap.get(e);
|
|
2065
|
+
return i && (a.hidden = !0, o > i.number && (a.transferTo = i.number)), r.captureMap.set(o, a), `(${s ? `?<${s}>` : ""}${n.map(t).join("|")})`;
|
|
2066
|
+
},
|
|
2067
|
+
/**
|
|
2068
|
+
@param {CharacterNode} node
|
|
2069
|
+
*/
|
|
2070
|
+
Character({ value: e }, r) {
|
|
2071
|
+
const t = b(e), n = Y(e, {
|
|
2072
|
+
escDigit: r.lastNode.type === "Backreference",
|
|
2073
|
+
inCharClass: r.inCharClass,
|
|
2074
|
+
useFlagV: r.useFlagV
|
|
2075
|
+
});
|
|
2076
|
+
if (n !== t)
|
|
2077
|
+
return n;
|
|
2078
|
+
if (r.useAppliedIgnoreCase && r.currentFlags.ignoreCase && Be(t)) {
|
|
2079
|
+
const s = Sr(t);
|
|
2080
|
+
return r.inCharClass ? s.join("") : s.length > 1 ? `[${s.join("")}]` : s[0];
|
|
2081
|
+
}
|
|
2082
|
+
return t;
|
|
2083
|
+
},
|
|
2084
|
+
/**
|
|
2085
|
+
@param {CharacterClassNode} node
|
|
2086
|
+
*/
|
|
2087
|
+
CharacterClass(e, r, t) {
|
|
2088
|
+
const { kind: n, negate: s, parent: o } = e;
|
|
2089
|
+
let { body: a } = e;
|
|
2090
|
+
if (n === "intersection" && !r.useFlagV)
|
|
2091
|
+
throw new Error("Use of character class intersection requires min target ES2024");
|
|
2092
|
+
U.bugFlagVLiteralHyphenIsRange && r.useFlagV && a.some(cr) && (a = [he(45), ...a.filter((c) => !cr(c))]);
|
|
2093
|
+
const i = () => `[${s ? "^" : ""}${a.map(t).join(n === "intersection" ? "&&" : "")}]`;
|
|
2094
|
+
if (!r.inCharClass) {
|
|
2095
|
+
if (
|
|
2096
|
+
// Already established `kind !== 'intersection'` if `!state.useFlagV`; don't check again
|
|
2097
|
+
(!r.useFlagV || U.bugNestedClassIgnoresNegation) && !s
|
|
2098
|
+
) {
|
|
2099
|
+
const l = a.filter(
|
|
2100
|
+
(f) => f.type === "CharacterClass" && f.kind === "union" && f.negate
|
|
2101
|
+
);
|
|
2102
|
+
if (l.length) {
|
|
2103
|
+
const f = L(), p = f.body[0];
|
|
2104
|
+
return f.parent = o, p.parent = f, a = a.filter((g) => !l.includes(g)), e.body = a, a.length ? (e.parent = p, p.body.push(e)) : f.body.pop(), l.forEach((g) => {
|
|
2105
|
+
const d = q({ body: [g] });
|
|
2106
|
+
g.parent = d, d.parent = f, f.body.push(d);
|
|
2107
|
+
}), t(f);
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
r.inCharClass = !0;
|
|
2111
|
+
const c = i();
|
|
2112
|
+
return r.inCharClass = !1, c;
|
|
2113
|
+
}
|
|
2114
|
+
const u = a[0];
|
|
2115
|
+
if (
|
|
2116
|
+
// Already established that the parent is a char class via `inCharClass`; don't check again
|
|
2117
|
+
n === "union" && !s && u && // Allows many nested classes to work with `target` ES2018 which doesn't support nesting
|
|
2118
|
+
((!r.useFlagV || !r.verbose) && o.kind === "union" && !(U.bugFlagVLiteralHyphenIsRange && r.useFlagV) || !r.verbose && o.kind === "intersection" && // JS doesn't allow intersection with union or ranges
|
|
2119
|
+
a.length === 1 && u.type !== "CharacterClassRange")
|
|
2120
|
+
)
|
|
2121
|
+
return a.map(t).join("");
|
|
2122
|
+
if (!r.useFlagV && o.type === "CharacterClass")
|
|
2123
|
+
throw new Error("Uses nested character class in a way that requires min target ES2024");
|
|
2124
|
+
return i();
|
|
2125
|
+
},
|
|
2126
|
+
/**
|
|
2127
|
+
@param {CharacterClassRangeNode} node
|
|
2128
|
+
*/
|
|
2129
|
+
CharacterClassRange(e, r) {
|
|
2130
|
+
const t = e.min.value, n = e.max.value, s = {
|
|
2131
|
+
escDigit: !1,
|
|
2132
|
+
inCharClass: !0,
|
|
2133
|
+
useFlagV: r.useFlagV
|
|
2134
|
+
}, o = Y(t, s), a = Y(n, s), i = /* @__PURE__ */ new Set();
|
|
2135
|
+
if (r.useAppliedIgnoreCase && r.currentFlags.ignoreCase) {
|
|
2136
|
+
const u = Rr(e);
|
|
2137
|
+
In(u).forEach((l) => {
|
|
2138
|
+
i.add(
|
|
2139
|
+
Array.isArray(l) ? `${Y(l[0], s)}-${Y(l[1], s)}` : Y(l, s)
|
|
2140
|
+
);
|
|
2141
|
+
});
|
|
2142
|
+
}
|
|
2143
|
+
return `${o}-${a}${[...i].join("")}`;
|
|
2144
|
+
},
|
|
2145
|
+
/**
|
|
2146
|
+
@param {CharacterSetNode} node
|
|
2147
|
+
*/
|
|
2148
|
+
CharacterSet({ kind: e, negate: r, value: t, key: n }, s) {
|
|
2149
|
+
if (e === "dot")
|
|
2150
|
+
return s.currentFlags.dotAll ? s.appliedGlobalFlags.dotAll || s.useFlagMods ? "." : "[^]" : (
|
|
2151
|
+
// Onig's only line break char is line feed, unlike JS
|
|
2152
|
+
h`[^\n]`
|
|
2153
|
+
);
|
|
2154
|
+
if (e === "digit")
|
|
2155
|
+
return r ? h`\D` : h`\d`;
|
|
2156
|
+
if (e === "property") {
|
|
2157
|
+
if (s.useAppliedIgnoreCase && s.currentFlags.ignoreCase && _r.has(t))
|
|
2158
|
+
throw new Error(`Unicode property "${t}" can't be case-insensitive when other chars have specific case`);
|
|
2159
|
+
return `${r ? h`\P` : h`\p`}{${n ? `${n}=` : ""}${t}}`;
|
|
2160
|
+
}
|
|
2161
|
+
if (e === "word")
|
|
2162
|
+
return r ? h`\W` : h`\w`;
|
|
2163
|
+
throw new Error(`Unexpected character set kind "${e}"`);
|
|
2164
|
+
},
|
|
2165
|
+
/**
|
|
2166
|
+
@param {FlagsNode} node
|
|
2167
|
+
*/
|
|
2168
|
+
Flags(e, r) {
|
|
2169
|
+
return (
|
|
2170
|
+
// The transformer should never turn on the properties for flags d, g, m since Onig doesn't
|
|
2171
|
+
// have equivs. Flag m is never used since Onig uses different line break chars than JS
|
|
2172
|
+
// (node.hasIndices ? 'd' : '') +
|
|
2173
|
+
// (node.global ? 'g' : '') +
|
|
2174
|
+
// (node.multiline ? 'm' : '') +
|
|
2175
|
+
(r.appliedGlobalFlags.ignoreCase ? "i" : "") + (e.dotAll ? "s" : "") + (e.sticky ? "y" : "")
|
|
2176
|
+
);
|
|
2177
|
+
},
|
|
2178
|
+
/**
|
|
2179
|
+
@param {GroupNode} node
|
|
2180
|
+
*/
|
|
2181
|
+
Group({ atomic: e, body: r, flags: t, parent: n }, s, o) {
|
|
2182
|
+
const a = s.currentFlags;
|
|
2183
|
+
t && (s.currentFlags = ge(a, t));
|
|
2184
|
+
const i = r.map(o).join("|"), u = !s.verbose && r.length === 1 && // Single alt
|
|
2185
|
+
n.type !== "Quantifier" && !e && (!s.useFlagMods || !t) ? i : `(?${vn(e, t, s.useFlagMods)}${i})`;
|
|
2186
|
+
return s.currentFlags = a, u;
|
|
2187
|
+
},
|
|
2188
|
+
/**
|
|
2189
|
+
@param {LookaroundAssertionNode} node
|
|
2190
|
+
*/
|
|
2191
|
+
LookaroundAssertion({ body: e, kind: r, negate: t }, n, s) {
|
|
2192
|
+
return `(?${`${r === "lookahead" ? "" : "<"}${t ? "!" : "="}`}${e.map(s).join("|")})`;
|
|
2193
|
+
},
|
|
2194
|
+
/**
|
|
2195
|
+
@param {QuantifierNode} node
|
|
2196
|
+
*/
|
|
2197
|
+
Quantifier(e, r, t) {
|
|
2198
|
+
return t(e.body) + Sn(e);
|
|
2199
|
+
},
|
|
2200
|
+
/**
|
|
2201
|
+
@param {SubroutineNode & {isRecursive: true}} node
|
|
2202
|
+
*/
|
|
2203
|
+
Subroutine({ isRecursive: e, ref: r }, t) {
|
|
2204
|
+
if (!e)
|
|
2205
|
+
throw new Error("Unexpected non-recursive subroutine in transformed AST");
|
|
2206
|
+
const n = t.recursionLimit;
|
|
2207
|
+
return r === 0 ? `(?R=${n})` : h`\g<${r}&R=${n}>`;
|
|
2208
|
+
}
|
|
2209
|
+
}, kn = /* @__PURE__ */ new Set([
|
|
2210
|
+
"$",
|
|
2211
|
+
"(",
|
|
2212
|
+
")",
|
|
2213
|
+
"*",
|
|
2214
|
+
"+",
|
|
2215
|
+
".",
|
|
2216
|
+
"?",
|
|
2217
|
+
"[",
|
|
2218
|
+
"\\",
|
|
2219
|
+
"]",
|
|
2220
|
+
"^",
|
|
2221
|
+
"{",
|
|
2222
|
+
"|",
|
|
2223
|
+
"}"
|
|
2224
|
+
]), $n = /* @__PURE__ */ new Set([
|
|
2225
|
+
"-",
|
|
2226
|
+
"\\",
|
|
2227
|
+
"]",
|
|
2228
|
+
"^",
|
|
2229
|
+
// Literal `[` doesn't require escaping with flag u, but this can help work around regex source
|
|
2230
|
+
// linters and regex syntax processors that expect unescaped `[` to create a nested class
|
|
2231
|
+
"["
|
|
2232
|
+
]), En = /* @__PURE__ */ new Set([
|
|
2233
|
+
"(",
|
|
2234
|
+
")",
|
|
2235
|
+
"-",
|
|
2236
|
+
"/",
|
|
2237
|
+
"[",
|
|
2238
|
+
"\\",
|
|
2239
|
+
"]",
|
|
2240
|
+
"^",
|
|
2241
|
+
"{",
|
|
2242
|
+
"|",
|
|
2243
|
+
"}",
|
|
2244
|
+
// Double punctuators; also includes already-listed `-` and `^`
|
|
2245
|
+
"!",
|
|
2246
|
+
"#",
|
|
2247
|
+
"$",
|
|
2248
|
+
"%",
|
|
2249
|
+
"&",
|
|
2250
|
+
"*",
|
|
2251
|
+
"+",
|
|
2252
|
+
",",
|
|
2253
|
+
".",
|
|
2254
|
+
":",
|
|
2255
|
+
";",
|
|
2256
|
+
"<",
|
|
2257
|
+
"=",
|
|
2258
|
+
">",
|
|
2259
|
+
"?",
|
|
2260
|
+
"@",
|
|
2261
|
+
"`",
|
|
2262
|
+
"~"
|
|
2263
|
+
]), ir = /* @__PURE__ */ new Map([
|
|
2264
|
+
[9, h`\t`],
|
|
2265
|
+
// horizontal tab
|
|
2266
|
+
[10, h`\n`],
|
|
2267
|
+
// line feed
|
|
2268
|
+
[11, h`\v`],
|
|
2269
|
+
// vertical tab
|
|
2270
|
+
[12, h`\f`],
|
|
2271
|
+
// form feed
|
|
2272
|
+
[13, h`\r`],
|
|
2273
|
+
// carriage return
|
|
2274
|
+
[8232, h`\u2028`],
|
|
2275
|
+
// line separator
|
|
2276
|
+
[8233, h`\u2029`],
|
|
2277
|
+
// paragraph separator
|
|
2278
|
+
[65279, h`\uFEFF`]
|
|
2279
|
+
// ZWNBSP/BOM
|
|
2280
|
+
]), An = new RegExp("^\\p{Cased}$", "u");
|
|
2281
|
+
function Be(e) {
|
|
2282
|
+
return An.test(e);
|
|
2283
|
+
}
|
|
2284
|
+
function Rr(e, r) {
|
|
2285
|
+
const t = !!(r != null && r.firstOnly), n = e.min.value, s = e.max.value, o = [];
|
|
2286
|
+
if (n < 65 && (s === 65535 || s >= 131071) || n === 65536 && s >= 131071)
|
|
2287
|
+
return o;
|
|
2288
|
+
for (let a = n; a <= s; a++) {
|
|
2289
|
+
const i = b(a);
|
|
2290
|
+
if (!Be(i))
|
|
2291
|
+
continue;
|
|
2292
|
+
const u = Sr(i).filter((c) => {
|
|
2293
|
+
const l = c.codePointAt(0);
|
|
2294
|
+
return l < n || l > s;
|
|
2295
|
+
});
|
|
2296
|
+
if (u.length && (o.push(...u), t))
|
|
2297
|
+
break;
|
|
2298
|
+
}
|
|
2299
|
+
return o;
|
|
2300
|
+
}
|
|
2301
|
+
function Y(e, { escDigit: r, inCharClass: t, useFlagV: n }) {
|
|
2302
|
+
if (ir.has(e))
|
|
2303
|
+
return ir.get(e);
|
|
2304
|
+
if (
|
|
2305
|
+
// Control chars, etc.; condition modeled on the Chrome developer console's display for strings
|
|
2306
|
+
e < 32 || e > 126 && e < 160 || // Unicode planes 4-16; unassigned, special purpose, and private use area
|
|
2307
|
+
e > 262143 || // Avoid corrupting a preceding backref by immediately following it with a literal digit
|
|
2308
|
+
r && _n(e)
|
|
2309
|
+
)
|
|
2310
|
+
return e > 255 ? `\\u{${e.toString(16).toUpperCase()}}` : `\\x${e.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
2311
|
+
const s = t ? n ? En : $n : kn, o = b(e);
|
|
2312
|
+
return (s.has(o) ? "\\" : "") + o;
|
|
2313
|
+
}
|
|
2314
|
+
function In(e) {
|
|
2315
|
+
const r = e.map((s) => s.codePointAt(0)).sort((s, o) => s - o), t = [];
|
|
2316
|
+
let n = null;
|
|
2317
|
+
for (let s = 0; s < r.length; s++)
|
|
2318
|
+
r[s + 1] === r[s] + 1 ? n ?? (n = r[s]) : n === null ? t.push(r[s]) : (t.push([n, r[s]]), n = null);
|
|
2319
|
+
return t;
|
|
2320
|
+
}
|
|
2321
|
+
function vn(e, r, t) {
|
|
2322
|
+
if (e)
|
|
2323
|
+
return ">";
|
|
2324
|
+
let n = "";
|
|
2325
|
+
if (r && t) {
|
|
2326
|
+
const { enable: s, disable: o } = r;
|
|
2327
|
+
n = (s != null && s.ignoreCase ? "i" : "") + (s != null && s.dotAll ? "s" : "") + (o ? "-" : "") + (o != null && o.ignoreCase ? "i" : "") + (o != null && o.dotAll ? "s" : "");
|
|
2328
|
+
}
|
|
2329
|
+
return `${n}:`;
|
|
2330
|
+
}
|
|
2331
|
+
function Sn({ kind: e, max: r, min: t }) {
|
|
2332
|
+
let n;
|
|
2333
|
+
return !t && r === 1 ? n = "?" : !t && r === 1 / 0 ? n = "*" : t === 1 && r === 1 / 0 ? n = "+" : t === r ? n = `{${t}}` : n = `{${t},${r === 1 / 0 ? "" : r}}`, n + {
|
|
2334
|
+
greedy: "",
|
|
2335
|
+
lazy: "?",
|
|
2336
|
+
possessive: "+"
|
|
2337
|
+
}[e];
|
|
2338
|
+
}
|
|
2339
|
+
function ur({ type: e }) {
|
|
2340
|
+
return e === "CapturingGroup" || e === "Group" || e === "LookaroundAssertion";
|
|
2341
|
+
}
|
|
2342
|
+
function _n(e) {
|
|
2343
|
+
return e > 47 && e < 58;
|
|
2344
|
+
}
|
|
2345
|
+
function cr({ type: e, value: r }) {
|
|
2346
|
+
return e === "Character" && r === 45;
|
|
2347
|
+
}
|
|
2348
|
+
var T, P, Z, B, Q, ue, Pe, j, Nn = (j = class extends RegExp {
|
|
2349
|
+
/**
|
|
2350
|
+
@overload
|
|
2351
|
+
@param {string} pattern
|
|
2352
|
+
@param {string} [flags]
|
|
2353
|
+
@param {EmulatedRegExpOptions} [options]
|
|
2354
|
+
*/
|
|
2355
|
+
/**
|
|
2356
|
+
@overload
|
|
2357
|
+
@param {EmulatedRegExp} pattern
|
|
2358
|
+
@param {string} [flags]
|
|
2359
|
+
*/
|
|
2360
|
+
constructor(t, n, s) {
|
|
2361
|
+
var r = (...Kn) => (super(...Kn), z(this, ue), /**
|
|
2362
|
+
@type {Map<number, {
|
|
2363
|
+
hidden?: true;
|
|
2364
|
+
transferTo?: number;
|
|
2365
|
+
}>}
|
|
2366
|
+
*/
|
|
2367
|
+
z(this, T, /* @__PURE__ */ new Map()), /**
|
|
2368
|
+
@type {RegExp | EmulatedRegExp | null}
|
|
2369
|
+
*/
|
|
2370
|
+
z(this, P, null), /**
|
|
2371
|
+
@type {string}
|
|
2372
|
+
*/
|
|
2373
|
+
z(this, Z), /**
|
|
2374
|
+
@type {Map<number, string>?}
|
|
2375
|
+
*/
|
|
2376
|
+
z(this, B, null), /**
|
|
2377
|
+
@type {string?}
|
|
2378
|
+
*/
|
|
2379
|
+
z(this, Q, null), /**
|
|
2380
|
+
Can be used to serialize the instance.
|
|
2381
|
+
@type {EmulatedRegExpOptions}
|
|
2382
|
+
*/
|
|
2383
|
+
ye(this, "rawOptions", {}), this);
|
|
2384
|
+
const o = !!(s != null && s.lazyCompile);
|
|
2385
|
+
if (t instanceof RegExp) {
|
|
2386
|
+
if (s)
|
|
2387
|
+
throw new Error("Cannot provide options when copying a regexp");
|
|
2388
|
+
const a = t;
|
|
2389
|
+
r(a, n), M(this, Z, a.source), a instanceof j && (M(this, T, $(a, T)), M(this, B, $(a, B)), M(this, Q, $(a, Q)), this.rawOptions = a.rawOptions);
|
|
2390
|
+
} else {
|
|
2391
|
+
const a = {
|
|
2392
|
+
hiddenCaptures: [],
|
|
2393
|
+
strategy: null,
|
|
2394
|
+
transfers: [],
|
|
2395
|
+
...s
|
|
2396
|
+
};
|
|
2397
|
+
r(o ? "" : t, n), M(this, Z, t), M(this, T, Ln(a.hiddenCaptures, a.transfers)), M(this, Q, a.strategy), this.rawOptions = s ?? {};
|
|
2398
|
+
}
|
|
2399
|
+
o || M(this, P, this);
|
|
2400
|
+
}
|
|
2401
|
+
// Override the getter with one that works with lazy-compiled regexes
|
|
2402
|
+
get source() {
|
|
2403
|
+
return $(this, Z) || "(?:)";
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
Called internally by all String/RegExp methods that use regexes.
|
|
2407
|
+
@override
|
|
2408
|
+
@param {string} str
|
|
2409
|
+
@returns {RegExpExecArray?}
|
|
2410
|
+
*/
|
|
2411
|
+
exec(t) {
|
|
2412
|
+
if (!$(this, P)) {
|
|
2413
|
+
const { lazyCompile: o, ...a } = this.rawOptions;
|
|
2414
|
+
M(this, P, new j($(this, Z), this.flags, a));
|
|
2415
|
+
}
|
|
2416
|
+
const n = this.global || this.sticky, s = this.lastIndex;
|
|
2417
|
+
if ($(this, Q) === "clip_search" && n && s) {
|
|
2418
|
+
this.lastIndex = 0;
|
|
2419
|
+
const o = be(this, ue, Pe).call(this, t.slice(s));
|
|
2420
|
+
return o && (Mn(o, s, t, this.hasIndices), this.lastIndex += s), o;
|
|
2421
|
+
}
|
|
2422
|
+
return be(this, ue, Pe).call(this, t);
|
|
2423
|
+
}
|
|
2424
|
+
}, T = new WeakMap(), P = new WeakMap(), Z = new WeakMap(), B = new WeakMap(), Q = new WeakMap(), ue = new WeakSet(), /**
|
|
2425
|
+
Adds support for hidden and transfer captures.
|
|
2426
|
+
@param {string} str
|
|
2427
|
+
@returns
|
|
2428
|
+
*/
|
|
2429
|
+
Pe = function(t) {
|
|
2430
|
+
$(this, P).lastIndex = this.lastIndex;
|
|
2431
|
+
const n = ze(j.prototype, this, "exec").call($(this, P), t);
|
|
2432
|
+
if (this.lastIndex = $(this, P).lastIndex, !n || !$(this, T).size)
|
|
2433
|
+
return n;
|
|
2434
|
+
const s = [...n];
|
|
2435
|
+
n.length = 1;
|
|
2436
|
+
let o;
|
|
2437
|
+
this.hasIndices && (o = [...n.indices], n.indices.length = 1);
|
|
2438
|
+
const a = [0];
|
|
2439
|
+
for (let i = 1; i < s.length; i++) {
|
|
2440
|
+
const { hidden: u, transferTo: c } = $(this, T).get(i) ?? {};
|
|
2441
|
+
if (u ? a.push(null) : (a.push(n.length), n.push(s[i]), this.hasIndices && n.indices.push(o[i])), c && s[i] !== void 0) {
|
|
2442
|
+
const l = a[c];
|
|
2443
|
+
if (!l)
|
|
2444
|
+
throw new Error(`Invalid capture transfer to "${l}"`);
|
|
2445
|
+
if (n[l] = s[i], this.hasIndices && (n.indices[l] = o[i]), n.groups) {
|
|
2446
|
+
$(this, B) || M(this, B, Fn(this.source));
|
|
2447
|
+
const f = $(this, B).get(c);
|
|
2448
|
+
f && (n.groups[f] = s[i], this.hasIndices && (n.indices.groups[f] = o[i]));
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
return n;
|
|
2453
|
+
}, j);
|
|
2454
|
+
function Mn(e, r, t, n) {
|
|
2455
|
+
if (e.index += r, e.input = t, n) {
|
|
2456
|
+
const s = e.indices;
|
|
2457
|
+
for (let a = 0; a < s.length; a++) {
|
|
2458
|
+
const i = s[a];
|
|
2459
|
+
i && (s[a] = [i[0] + r, i[1] + r]);
|
|
2460
|
+
}
|
|
2461
|
+
const o = s.groups;
|
|
2462
|
+
o && Object.keys(o).forEach((a) => {
|
|
2463
|
+
const i = o[a];
|
|
2464
|
+
i && (o[a] = [i[0] + r, i[1] + r]);
|
|
2465
|
+
});
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
function Ln(e, r) {
|
|
2469
|
+
const t = /* @__PURE__ */ new Map();
|
|
2470
|
+
for (const n of e)
|
|
2471
|
+
t.set(n, {
|
|
2472
|
+
hidden: !0
|
|
2473
|
+
});
|
|
2474
|
+
for (const [n, s] of r)
|
|
2475
|
+
for (const o of s)
|
|
2476
|
+
ie(t, o, {}).transferTo = n;
|
|
2477
|
+
return t;
|
|
2478
|
+
}
|
|
2479
|
+
function Fn(e) {
|
|
2480
|
+
const r = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu, t = /* @__PURE__ */ new Map();
|
|
2481
|
+
let n = 0, s = 0, o;
|
|
2482
|
+
for (; o = r.exec(e); ) {
|
|
2483
|
+
const { 0: a, groups: { capture: i, name: u } } = o;
|
|
2484
|
+
a === "[" ? n++ : n ? a === "]" && n-- : i && (s++, u && t.set(s, u));
|
|
2485
|
+
}
|
|
2486
|
+
return t;
|
|
2487
|
+
}
|
|
2488
|
+
function Gn(e, r) {
|
|
2489
|
+
const t = Pn(e, r);
|
|
2490
|
+
return t.options ? new Nn(t.pattern, t.flags, t.options) : new RegExp(t.pattern, t.flags);
|
|
2491
|
+
}
|
|
2492
|
+
function Pn(e, r) {
|
|
2493
|
+
const t = vr(r), n = Cr(e, {
|
|
2494
|
+
flags: t.flags,
|
|
2495
|
+
normalizeUnknownPropertyNames: !0,
|
|
2496
|
+
rules: {
|
|
2497
|
+
captureGroup: t.rules.captureGroup,
|
|
2498
|
+
singleline: t.rules.singleline
|
|
2499
|
+
},
|
|
2500
|
+
skipBackrefValidation: t.rules.allowOrphanBackrefs,
|
|
2501
|
+
unicodePropertyMap: Te
|
|
2502
|
+
}), s = un(n, {
|
|
2503
|
+
accuracy: t.accuracy,
|
|
2504
|
+
asciiWordBoundaries: t.rules.asciiWordBoundaries,
|
|
2505
|
+
avoidSubclass: t.avoidSubclass,
|
|
2506
|
+
bestEffortTarget: t.target
|
|
2507
|
+
}), o = Cn(s, t), a = qt(o.pattern, {
|
|
2508
|
+
captureTransfers: o._captureTransfers,
|
|
2509
|
+
hiddenCaptures: o._hiddenCaptures,
|
|
2510
|
+
mode: "external"
|
|
2511
|
+
}), i = Zt(a.pattern), u = Xt(i.pattern, {
|
|
2512
|
+
captureTransfers: a.captureTransfers,
|
|
2513
|
+
hiddenCaptures: a.hiddenCaptures
|
|
2514
|
+
}), c = {
|
|
2515
|
+
pattern: u.pattern,
|
|
2516
|
+
flags: `${t.hasIndices ? "d" : ""}${t.global ? "g" : ""}${o.flags}${o.options.disable.v ? "u" : "v"}`
|
|
2517
|
+
};
|
|
2518
|
+
if (t.avoidSubclass) {
|
|
2519
|
+
if (t.lazyCompileLength !== 1 / 0)
|
|
2520
|
+
throw new Error("Lazy compilation requires subclass");
|
|
2521
|
+
} else {
|
|
2522
|
+
const l = u.hiddenCaptures.sort((d, m) => d - m), f = Array.from(u.captureTransfers), p = s._strategy, g = c.pattern.length >= t.lazyCompileLength;
|
|
2523
|
+
(l.length || f.length || p || g) && (c.options = {
|
|
2524
|
+
...l.length && { hiddenCaptures: l },
|
|
2525
|
+
...f.length && { transfers: f },
|
|
2526
|
+
...p && { strategy: p },
|
|
2527
|
+
...g && { lazyCompile: g }
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
return c;
|
|
2531
|
+
}
|
|
2532
|
+
const lr = 4294967295;
|
|
2533
|
+
class Rn {
|
|
2534
|
+
constructor(r, t = {}) {
|
|
2535
|
+
ye(this, "regexps");
|
|
2536
|
+
this.patterns = r, this.options = t;
|
|
2537
|
+
const {
|
|
2538
|
+
forgiving: n = !1,
|
|
2539
|
+
cache: s,
|
|
2540
|
+
regexConstructor: o
|
|
2541
|
+
} = t;
|
|
2542
|
+
if (!o)
|
|
2543
|
+
throw new Error("Option `regexConstructor` is not provided");
|
|
2544
|
+
this.regexps = r.map((a) => {
|
|
2545
|
+
if (typeof a != "string")
|
|
2546
|
+
return a;
|
|
2547
|
+
const i = s == null ? void 0 : s.get(a);
|
|
2548
|
+
if (i) {
|
|
2549
|
+
if (i instanceof RegExp)
|
|
2550
|
+
return i;
|
|
2551
|
+
if (n)
|
|
2552
|
+
return null;
|
|
2553
|
+
throw i;
|
|
2554
|
+
}
|
|
2555
|
+
try {
|
|
2556
|
+
const u = o(a);
|
|
2557
|
+
return s == null || s.set(a, u), u;
|
|
2558
|
+
} catch (u) {
|
|
2559
|
+
if (s == null || s.set(a, u), n)
|
|
2560
|
+
return null;
|
|
2561
|
+
throw u;
|
|
2562
|
+
}
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2565
|
+
findNextMatchSync(r, t, n) {
|
|
2566
|
+
const s = typeof r == "string" ? r : r.content, o = [];
|
|
2567
|
+
function a(i, u, c = 0) {
|
|
2568
|
+
return {
|
|
2569
|
+
index: i,
|
|
2570
|
+
captureIndices: u.indices.map((l) => l == null ? {
|
|
2571
|
+
start: lr,
|
|
2572
|
+
end: lr,
|
|
2573
|
+
length: 0
|
|
2574
|
+
} : {
|
|
2575
|
+
start: l[0] + c,
|
|
2576
|
+
end: l[1] + c,
|
|
2577
|
+
length: l[1] - l[0]
|
|
2578
|
+
})
|
|
2579
|
+
};
|
|
2580
|
+
}
|
|
2581
|
+
for (let i = 0; i < this.regexps.length; i++) {
|
|
2582
|
+
const u = this.regexps[i];
|
|
2583
|
+
if (u)
|
|
2584
|
+
try {
|
|
2585
|
+
u.lastIndex = t;
|
|
2586
|
+
const c = u.exec(s);
|
|
2587
|
+
if (!c)
|
|
2588
|
+
continue;
|
|
2589
|
+
if (c.index === t)
|
|
2590
|
+
return a(i, c, 0);
|
|
2591
|
+
o.push([i, c, 0]);
|
|
2592
|
+
} catch (c) {
|
|
2593
|
+
if (this.options.forgiving)
|
|
2594
|
+
continue;
|
|
2595
|
+
throw c;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
if (o.length) {
|
|
2599
|
+
const i = Math.min(...o.map((u) => u[1].index));
|
|
2600
|
+
for (const [u, c, l] of o)
|
|
2601
|
+
if (c.index === i)
|
|
2602
|
+
return a(u, c, l);
|
|
2603
|
+
}
|
|
2604
|
+
return null;
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
function Un(e, r) {
|
|
2608
|
+
return Gn(
|
|
2609
|
+
e,
|
|
2610
|
+
{
|
|
2611
|
+
global: !0,
|
|
2612
|
+
hasIndices: !0,
|
|
2613
|
+
// This has no benefit for the standard JS engine, but it avoids a perf penalty for
|
|
2614
|
+
// precompiled grammars when constructing extremely long patterns that aren't always used
|
|
2615
|
+
lazyCompileLength: 3e3,
|
|
2616
|
+
rules: {
|
|
2617
|
+
// Needed since TextMate grammars merge backrefs across patterns
|
|
2618
|
+
allowOrphanBackrefs: !0,
|
|
2619
|
+
// Improves search performance for generated regexes
|
|
2620
|
+
asciiWordBoundaries: !0,
|
|
2621
|
+
// Follow `vscode-oniguruma` which enables this Oniguruma option by default
|
|
2622
|
+
captureGroup: !0,
|
|
2623
|
+
// Oniguruma uses depth limit `20`; lowered here to keep regexes shorter and maybe
|
|
2624
|
+
// sometimes faster, but can be increased if issues reported due to low limit
|
|
2625
|
+
recursionLimit: 5,
|
|
2626
|
+
// Oniguruma option for `^`->`\A`, `$`->`\Z`; improves search performance without any
|
|
2627
|
+
// change in meaning since TM grammars search line by line
|
|
2628
|
+
singleline: !0
|
|
2629
|
+
},
|
|
2630
|
+
...r
|
|
2631
|
+
}
|
|
2632
|
+
);
|
|
2633
|
+
}
|
|
2634
|
+
function On(e = {}) {
|
|
2635
|
+
const r = Object.assign(
|
|
2636
|
+
{
|
|
2637
|
+
target: "auto",
|
|
2638
|
+
cache: /* @__PURE__ */ new Map()
|
|
2639
|
+
},
|
|
2640
|
+
e
|
|
2641
|
+
);
|
|
2642
|
+
return r.regexConstructor || (r.regexConstructor = (t) => Un(t, { target: r.target })), {
|
|
2643
|
+
createScanner(t) {
|
|
2644
|
+
return new Rn(t, r);
|
|
2645
|
+
},
|
|
2646
|
+
createString(t) {
|
|
2647
|
+
return {
|
|
2648
|
+
content: t
|
|
2649
|
+
};
|
|
2650
|
+
}
|
|
2651
|
+
};
|
|
2652
|
+
}
|
|
2653
|
+
var Dn = Re("block", "before:content-[counter(line)]", "before:inline-block", "before:[counter-increment:line]", "before:w-4", "before:mr-4", "before:text-[13px]", "before:text-right", "before:text-muted-foreground/50", "before:font-mono", "before:select-none"), Tn = Jr(({ children: e, result: r, language: t, className: n, ...s }) => {
|
|
2654
|
+
let o = pr(() => ({ backgroundColor: r.bg, color: r.fg }), [r.bg, r.fg]);
|
|
2655
|
+
return v.jsx("pre", { className: Re(n, "p-4 text-sm dark:bg-(--shiki-dark-bg)!"), "data-language": t, "data-streamdown": "code-block-body", style: o, ...s, children: v.jsx("code", { className: "[counter-increment:line_0] [counter-reset:line]", children: r.tokens.map((a, i) => v.jsx("span", { className: Dn, children: a.map((u, c) => v.jsx("span", { className: "dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!", style: { color: u.color, backgroundColor: u.bgColor, ...u.htmlStyle }, ...u.htmlAttrs, children: u.content }, c)) }, i)) }) });
|
|
2656
|
+
}, (e, r) => e.result === r.result && e.language === r.language && e.className === r.className), Bn = ({ className: e, language: r, style: t, ...n }) => v.jsx("div", { className: Re("my-4 w-full overflow-hidden rounded-xl border border-border", e), "data-language": r, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...t }, ...n }), jn = ({ language: e, children: r }) => v.jsxs("div", { className: "flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: [v.jsx("span", { className: "ml-1 font-mono lowercase", children: e }), v.jsx("div", { className: "flex items-center gap-2", children: r })] }), Vn = On({ forgiving: !0 }), Se = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ new Map(), zn = (e, r) => `${e}-${r[0]}-${r[1]}`, Wn = (e, r, t) => {
|
|
2657
|
+
let n = e.slice(0, 100), s = e.length > 100 ? e.slice(-100) : "";
|
|
2658
|
+
return `${r}:${t[0]}:${t[1]}:${e.length}:${n}:${s}`;
|
|
2659
|
+
}, Ur = (e) => Object.hasOwn(Xr, e), Hn = (e, r) => {
|
|
2660
|
+
let t = Ur(e) ? e : "text", n = zn(t, r);
|
|
2661
|
+
if (Se.has(n)) return Se.get(n);
|
|
2662
|
+
let s = Hr({ themes: r, langs: [t], engine: Vn });
|
|
2663
|
+
return Se.set(n, s), s;
|
|
2664
|
+
}, fr = (e, r, t, n) => {
|
|
2665
|
+
let s = Ur(r) ? r : "text", o = Wn(e, s, t);
|
|
2666
|
+
return _e.has(o) ? _e.get(o) : (n && (ee.has(o) || ee.set(o, /* @__PURE__ */ new Set()), ee.get(o).add(n)), Hn(s, t).then((a) => {
|
|
2667
|
+
let i = a.codeToTokens(e, { lang: s, themes: { light: t[0], dark: t[1] } });
|
|
2668
|
+
_e.set(o, i);
|
|
2669
|
+
let u = ee.get(o);
|
|
2670
|
+
if (u) {
|
|
2671
|
+
for (let c of u) c(i);
|
|
2672
|
+
ee.delete(o);
|
|
2673
|
+
}
|
|
2674
|
+
}).catch((a) => {
|
|
2675
|
+
console.error("Failed to highlight code:", a), ee.delete(o);
|
|
2676
|
+
}), null);
|
|
2677
|
+
}, qn = ({ code: e, language: r, className: t, children: n, ...s }) => {
|
|
2678
|
+
let { shikiTheme: o } = Zr(zr), a = pr(() => ({ bg: "transparent", fg: "inherit", tokens: e.split(`
|
|
2679
|
+
`).map((c) => [{ content: c, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [e]), [i, u] = Qr(a);
|
|
2680
|
+
return qr(() => {
|
|
2681
|
+
let c = fr(e, r, o);
|
|
2682
|
+
if (c) {
|
|
2683
|
+
u(c);
|
|
2684
|
+
return;
|
|
2685
|
+
}
|
|
2686
|
+
fr(e, r, o, (l) => {
|
|
2687
|
+
u(l);
|
|
2688
|
+
});
|
|
2689
|
+
}, [e, r, o]), v.jsx(Wr.Provider, { value: { code: e }, children: v.jsxs(Bn, { language: r, children: [v.jsx(jn, { language: r, children: n }), v.jsx(Tn, { className: t, language: r, result: i, ...s })] }) });
|
|
2690
|
+
};
|
|
2691
|
+
export {
|
|
2692
|
+
qn as CodeBlock
|
|
2693
|
+
};
|