@septkit/ui 0.0.42 → 0.0.44
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/code/code-block.js +7 -0
- package/dist/code/code-block.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/code/diff.js +35 -0
- package/dist/code/highlight.js +30 -0
- package/dist/code/index.js +5 -0
- package/dist/code/xml-diff.js +5 -0
- package/dist/code/xml-diff.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/dialecte/composables/index.js +2 -1
- package/dist/dialecte/composables/use-active-document.js +24 -0
- package/dist/dialecte/create-document-store.js +3 -3
- package/dist/dialecte/index.js +2 -1
- package/dist/dialog/dialog-host.js +5 -0
- package/dist/dialog/dialog-host.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/dialog/dialog.js +5 -0
- package/dist/dialog/dialog.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/dialog/index.js +4 -0
- package/dist/dialog/use-dialog-host.js +32 -0
- package/dist/external/.pnpm/@dialecte_core@0.4.6/node_modules/@dialecte/core/dist/helpers.js +142 -0
- package/dist/external/.pnpm/@dialecte_core@0.4.6/node_modules/@dialecte/core/dist/index.js +3 -0
- package/dist/external/.pnpm/{@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/project-E32sEthh.js → @dialecte_core@0.4.6/node_modules/@dialecte/core/dist/project-wohrish5.js} +3352 -1170
- package/dist/external/.pnpm/{@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/utils-DgKwrT2n.js → @dialecte_core@0.4.6/node_modules/@dialecte/core/dist/utils-C5_11hqg.js} +73 -3
- package/dist/external/.pnpm/@dialecte_scl@0.3.5/node_modules/@dialecte/scl/dist/hooks-abaf9148.js +25264 -0
- package/dist/external/.pnpm/@dialecte_scl@0.3.5/node_modules/@dialecte/scl/dist/v2019C1/index.js +3 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/arrow-right.js +11 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/copy.js +16 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/text-wrap.js +22 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/x.js +11 -0
- package/dist/external/.pnpm/@shikijs_core@3.23.0/node_modules/@shikijs/core/dist/index.js +1299 -0
- package/dist/external/.pnpm/@shikijs_engine-javascript@3.23.0/node_modules/@shikijs/engine-javascript/dist/engine-compile.js +34 -0
- package/dist/external/.pnpm/@shikijs_engine-javascript@3.23.0/node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.hzpS1_41.js +66 -0
- package/dist/external/.pnpm/@shikijs_langs@3.23.0/node_modules/@shikijs/langs/dist/java.js +3 -0
- package/dist/external/.pnpm/@shikijs_langs@3.23.0/node_modules/@shikijs/langs/dist/xml.js +5 -0
- package/dist/external/.pnpm/@shikijs_themes@3.23.0/node_modules/@shikijs/themes/dist/github-dark.js +4 -0
- package/dist/external/.pnpm/@shikijs_types@3.23.0/node_modules/@shikijs/types/dist/index.js +8 -0
- package/dist/external/.pnpm/@shikijs_vscode-textmate@10.0.2/node_modules/@shikijs/vscode-textmate/dist/index.js +1576 -0
- package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +126 -43
- package/dist/external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js +84 -55
- package/dist/external/.pnpm/ccount@2.0.1/node_modules/ccount/index.js +10 -0
- package/dist/external/.pnpm/character-entities-html4@2.1.0/node_modules/character-entities-html4/index.js +257 -0
- package/dist/external/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js +4 -0
- package/dist/external/.pnpm/comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.js +7 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/comment.js +11 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/doctype.js +6 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/element.js +49 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/index.js +28 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/raw.js +7 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/root.js +6 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/text.js +8 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.js +48 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/closing.js +86 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/omission.js +10 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/opening.js +39 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/util/siblings.js +13 -0
- package/dist/external/.pnpm/hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.js +10 -0
- package/dist/external/.pnpm/html-void-elements@3.0.0/node_modules/html-void-elements/index.js +25 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/node-utils.js +23 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js +419 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js +487 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js +84 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js +30 -0
- package/dist/external/.pnpm/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js +970 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/index.js +25 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/aria.js +61 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/find.js +31 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/html.js +326 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/normalize.js +6 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/svg.js +564 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/create.js +14 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/defined-info.js +18 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/info.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/merge.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/schema.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/types.js +16 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xlink.js +19 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xml.js +15 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xmlns.js +14 -0
- package/dist/external/.pnpm/regex-recursion@6.0.2/node_modules/regex-recursion/src/index.js +110 -0
- package/dist/external/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.js +56 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/atomic.js +94 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/internals.js +2 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/utils-internals.js +10 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContent.js +72 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentImpl.js +101 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentModal.js +83 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentNonModal.js +74 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogOverlay.js +48 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogOverlayImpl.js +47 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogPortal.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogRoot.js +61 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogTitle.js +28 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/utils.js +17 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Menu/utils.js +16 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterGroup.js +384 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterPanel.js +136 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterResizeHandle.js +119 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperIndicator.js +27 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperItem.js +67 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperRoot.js +136 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperTitle.js +28 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/composables/useWindowSplitterBehavior.js +37 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/composables/useWindowSplitterPanelGroupBehavior.js +82 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/arrays.js +7 -2
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/browser.js +4 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/assert.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/calculate.js +73 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/callPanelCallbacks.js +19 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/compare.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/debounce.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/dom.js +20 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/events.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/layout.js +103 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/pivot.js +8 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/rects.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/registry.js +106 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/resizePanel.js +15 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/stackingOrder.js +57 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/storage.js +50 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/style.js +35 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/units.js +57 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/validation.js +39 -0
- package/dist/external/.pnpm/space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.js +6 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/constant/dangerous.js +13 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/core.js +23 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/index.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/format-smart.js +14 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-decimal.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-hexadecimal.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-named.js +17 -0
- package/dist/external/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.js +16 -0
- package/dist/index.d.ts +396 -21
- package/dist/index.js +24 -8
- package/dist/merge/build-view-model.js +168 -0
- package/dist/merge/decision-toggle.js +5 -0
- package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/merge/element-detail.js +5 -0
- package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/merge/index.js +6 -0
- package/dist/merge/merge-progress.js +5 -0
- package/dist/merge/merge-progress.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/merge/merge-review.js +5 -0
- package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +305 -0
- package/dist/merge/merge-summary.js +5 -0
- package/dist/merge/merge-summary.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/merge/merge-tree.js +5 -0
- package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/merge/merge.service.js +69 -0
- package/dist/merge/use-document-progress.js +27 -0
- package/dist/merge/use-merge-session.js +151 -0
- package/dist/ui.css +1 -1
- package/package.json +4 -2
- package/dist/external/.pnpm/@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/helpers.js +0 -13
- package/dist/external/.pnpm/@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/index.js +0 -3
package/dist/external/.pnpm/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js
ADDED
|
@@ -0,0 +1,970 @@
|
|
|
1
|
+
import { hasOnlyChild as e } from "../../../../../oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/node-utils.js";
|
|
2
|
+
import { createAlternative as t, createAssertion as n, createBackreference as r, createCapturingGroup as i, createCharacter as a, createCharacterClass as o, createCharacterSet as s, createGroup as c, createLookaroundAssertion as l, createQuantifier as u, createSubroutine as d, createUnicodeProperty as f, parse as p, slug as m } from "../../../../../oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js";
|
|
3
|
+
import { traverse as h } from "../../../../../oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js";
|
|
4
|
+
import { atomic as g, possessive as _ } from "../../../../../regex@6.1.0/node_modules/regex/src/atomic.js";
|
|
5
|
+
import "../../../../../regex@6.1.0/node_modules/regex/src/internals.js";
|
|
6
|
+
import { recursion as ee } from "../../../../../regex-recursion@6.0.2/node_modules/regex-recursion/src/index.js";
|
|
7
|
+
//#region node_modules/.pnpm/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js
|
|
8
|
+
var v = String.fromCodePoint, y = String.raw, b = {}, x = globalThis.RegExp;
|
|
9
|
+
b.flagGroups = (() => {
|
|
10
|
+
try {
|
|
11
|
+
new x("(?i:)");
|
|
12
|
+
} catch {
|
|
13
|
+
return !1;
|
|
14
|
+
}
|
|
15
|
+
return !0;
|
|
16
|
+
})(), b.unicodeSets = (() => {
|
|
17
|
+
try {
|
|
18
|
+
new x("[[]]", "v");
|
|
19
|
+
} catch {
|
|
20
|
+
return !1;
|
|
21
|
+
}
|
|
22
|
+
return !0;
|
|
23
|
+
})(), b.bugFlagVLiteralHyphenIsRange = b.unicodeSets ? (() => {
|
|
24
|
+
try {
|
|
25
|
+
new x(y`[\d\-a]`, "v");
|
|
26
|
+
} catch {
|
|
27
|
+
return !0;
|
|
28
|
+
}
|
|
29
|
+
return !1;
|
|
30
|
+
})() : !1, b.bugNestedClassIgnoresNegation = b.unicodeSets && new x("[[^a]]", "v").test("a");
|
|
31
|
+
function S(e, { enable: t, disable: n }) {
|
|
32
|
+
return {
|
|
33
|
+
dotAll: !n?.dotAll && !!(t?.dotAll || e.dotAll),
|
|
34
|
+
ignoreCase: !n?.ignoreCase && !!(t?.ignoreCase || e.ignoreCase)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function C(e, t, n) {
|
|
38
|
+
return e.has(t) || e.set(t, n), e.get(t);
|
|
39
|
+
}
|
|
40
|
+
function w(e, t) {
|
|
41
|
+
return T[e] >= T[t];
|
|
42
|
+
}
|
|
43
|
+
function te(e, t) {
|
|
44
|
+
if (e == null) throw Error(t ?? "Value expected");
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
47
|
+
var T = {
|
|
48
|
+
ES2025: 2025,
|
|
49
|
+
ES2024: 2024,
|
|
50
|
+
ES2018: 2018
|
|
51
|
+
}, ne = {
|
|
52
|
+
auto: "auto",
|
|
53
|
+
ES2025: "ES2025",
|
|
54
|
+
ES2024: "ES2024",
|
|
55
|
+
ES2018: "ES2018"
|
|
56
|
+
};
|
|
57
|
+
function E(e = {}) {
|
|
58
|
+
if ({}.toString.call(e) !== "[object Object]") throw Error("Unexpected options");
|
|
59
|
+
if (e.target !== void 0 && !ne[e.target]) throw Error(`Unexpected target "${e.target}"`);
|
|
60
|
+
let t = {
|
|
61
|
+
accuracy: "default",
|
|
62
|
+
avoidSubclass: !1,
|
|
63
|
+
flags: "",
|
|
64
|
+
global: !1,
|
|
65
|
+
hasIndices: !1,
|
|
66
|
+
lazyCompileLength: Infinity,
|
|
67
|
+
target: "auto",
|
|
68
|
+
verbose: !1,
|
|
69
|
+
...e,
|
|
70
|
+
rules: {
|
|
71
|
+
allowOrphanBackrefs: !1,
|
|
72
|
+
asciiWordBoundaries: !1,
|
|
73
|
+
captureGroup: !1,
|
|
74
|
+
recursionLimit: 20,
|
|
75
|
+
singleline: !1,
|
|
76
|
+
...e.rules
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return t.target === "auto" && (t.target = b.flagGroups ? "ES2025" : b.unicodeSets ? "ES2024" : "ES2018"), t;
|
|
80
|
+
}
|
|
81
|
+
var re = "[ -\r ]", ie = /* @__PURE__ */ new Set([v(304), v(305)]), D = y`[\p{L}\p{M}\p{N}\p{Pc}]`;
|
|
82
|
+
function O(e) {
|
|
83
|
+
if (ie.has(e)) return [e];
|
|
84
|
+
let t = /* @__PURE__ */ new Set(), n = e.toLowerCase(), r = n.toUpperCase(), i = se.get(n), a = ae.get(n), o = oe.get(n);
|
|
85
|
+
return [...r].length === 1 && t.add(r), o && t.add(o), i && t.add(i), t.add(n), a && t.add(a), [...t];
|
|
86
|
+
}
|
|
87
|
+
var k = /* @__PURE__ */ new Map("C Other\nCc Control cntrl\nCf Format\nCn Unassigned\nCo Private_Use\nCs Surrogate\nL Letter\nLC Cased_Letter\nLl Lowercase_Letter\nLm Modifier_Letter\nLo Other_Letter\nLt Titlecase_Letter\nLu Uppercase_Letter\nM Mark Combining_Mark\nMc Spacing_Mark\nMe Enclosing_Mark\nMn Nonspacing_Mark\nN Number\nNd Decimal_Number digit\nNl Letter_Number\nNo Other_Number\nP Punctuation punct\nPc Connector_Punctuation\nPd Dash_Punctuation\nPe Close_Punctuation\nPf Final_Punctuation\nPi Initial_Punctuation\nPo Other_Punctuation\nPs Open_Punctuation\nS Symbol\nSc Currency_Symbol\nSk Modifier_Symbol\nSm Math_Symbol\nSo Other_Symbol\nZ Separator\nZl Line_Separator\nZp Paragraph_Separator\nZs Space_Separator\nASCII\nASCII_Hex_Digit AHex\nAlphabetic Alpha\nAny\nAssigned\nBidi_Control Bidi_C\nBidi_Mirrored Bidi_M\nCase_Ignorable CI\nCased\nChanges_When_Casefolded CWCF\nChanges_When_Casemapped CWCM\nChanges_When_Lowercased CWL\nChanges_When_NFKC_Casefolded CWKCF\nChanges_When_Titlecased CWT\nChanges_When_Uppercased CWU\nDash\nDefault_Ignorable_Code_Point DI\nDeprecated Dep\nDiacritic Dia\nEmoji\nEmoji_Component EComp\nEmoji_Modifier EMod\nEmoji_Modifier_Base EBase\nEmoji_Presentation EPres\nExtended_Pictographic ExtPict\nExtender Ext\nGrapheme_Base Gr_Base\nGrapheme_Extend Gr_Ext\nHex_Digit Hex\nIDS_Binary_Operator IDSB\nIDS_Trinary_Operator IDST\nID_Continue IDC\nID_Start IDS\nIdeographic Ideo\nJoin_Control Join_C\nLogical_Order_Exception LOE\nLowercase Lower\nMath\nNoncharacter_Code_Point NChar\nPattern_Syntax Pat_Syn\nPattern_White_Space Pat_WS\nQuotation_Mark QMark\nRadical\nRegional_Indicator RI\nSentence_Terminal STerm\nSoft_Dotted SD\nTerminal_Punctuation Term\nUnified_Ideograph UIdeo\nUppercase Upper\nVariation_Selector VS\nWhite_Space space\nXID_Continue XIDC\nXID_Start XIDS".split(/\s/).map((e) => [m(e), e])), ae = /* @__PURE__ */ new Map([["s", v(383)], [v(383), "s"]]), oe = /* @__PURE__ */ new Map([
|
|
88
|
+
[v(223), v(7838)],
|
|
89
|
+
[v(107), v(8490)],
|
|
90
|
+
[v(229), v(8491)],
|
|
91
|
+
[v(969), v(8486)]
|
|
92
|
+
]), se = new Map([
|
|
93
|
+
A(453),
|
|
94
|
+
A(456),
|
|
95
|
+
A(459),
|
|
96
|
+
A(498),
|
|
97
|
+
...j(8072, 8079),
|
|
98
|
+
...j(8088, 8095),
|
|
99
|
+
...j(8104, 8111),
|
|
100
|
+
A(8124),
|
|
101
|
+
A(8140),
|
|
102
|
+
A(8188)
|
|
103
|
+
]), ce = /* @__PURE__ */ new Map([
|
|
104
|
+
["alnum", y`[\p{Alpha}\p{Nd}]`],
|
|
105
|
+
["alpha", y`\p{Alpha}`],
|
|
106
|
+
["ascii", y`\p{ASCII}`],
|
|
107
|
+
["blank", y`[\p{Zs}\t]`],
|
|
108
|
+
["cntrl", y`\p{Cc}`],
|
|
109
|
+
["digit", y`\p{Nd}`],
|
|
110
|
+
["graph", y`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],
|
|
111
|
+
["lower", y`\p{Lower}`],
|
|
112
|
+
["print", y`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],
|
|
113
|
+
["punct", y`[\p{P}\p{S}]`],
|
|
114
|
+
["space", y`\p{space}`],
|
|
115
|
+
["upper", y`\p{Upper}`],
|
|
116
|
+
["word", y`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],
|
|
117
|
+
["xdigit", y`\p{AHex}`]
|
|
118
|
+
]);
|
|
119
|
+
function le(e, t) {
|
|
120
|
+
let n = [];
|
|
121
|
+
for (let r = e; r <= t; r++) n.push(r);
|
|
122
|
+
return n;
|
|
123
|
+
}
|
|
124
|
+
function A(e) {
|
|
125
|
+
let t = v(e);
|
|
126
|
+
return [t.toLowerCase(), t];
|
|
127
|
+
}
|
|
128
|
+
function j(e, t) {
|
|
129
|
+
return le(e, t).map((e) => A(e));
|
|
130
|
+
}
|
|
131
|
+
var M = /* @__PURE__ */ new Set([
|
|
132
|
+
"Lower",
|
|
133
|
+
"Lowercase",
|
|
134
|
+
"Upper",
|
|
135
|
+
"Uppercase",
|
|
136
|
+
"Ll",
|
|
137
|
+
"Lowercase_Letter",
|
|
138
|
+
"Lt",
|
|
139
|
+
"Titlecase_Letter",
|
|
140
|
+
"Lu",
|
|
141
|
+
"Uppercase_Letter"
|
|
142
|
+
]);
|
|
143
|
+
function ue(e, t) {
|
|
144
|
+
let n = {
|
|
145
|
+
accuracy: "default",
|
|
146
|
+
asciiWordBoundaries: !1,
|
|
147
|
+
avoidSubclass: !1,
|
|
148
|
+
bestEffortTarget: "ES2025",
|
|
149
|
+
...t
|
|
150
|
+
};
|
|
151
|
+
N(e);
|
|
152
|
+
let r = {
|
|
153
|
+
accuracy: n.accuracy,
|
|
154
|
+
asciiWordBoundaries: n.asciiWordBoundaries,
|
|
155
|
+
avoidSubclass: n.avoidSubclass,
|
|
156
|
+
flagDirectivesByAlt: /* @__PURE__ */ new Map(),
|
|
157
|
+
jsGroupNameMap: /* @__PURE__ */ new Map(),
|
|
158
|
+
minTargetEs2024: w(n.bestEffortTarget, "ES2024"),
|
|
159
|
+
passedLookbehind: !1,
|
|
160
|
+
strategy: null,
|
|
161
|
+
subroutineRefMap: /* @__PURE__ */ new Map(),
|
|
162
|
+
supportedGNodes: /* @__PURE__ */ new Set(),
|
|
163
|
+
digitIsAscii: e.flags.digitIsAscii,
|
|
164
|
+
spaceIsAscii: e.flags.spaceIsAscii,
|
|
165
|
+
wordIsAscii: e.flags.wordIsAscii
|
|
166
|
+
};
|
|
167
|
+
h(e, de, r);
|
|
168
|
+
let i = {
|
|
169
|
+
dotAll: e.flags.dotAll,
|
|
170
|
+
ignoreCase: e.flags.ignoreCase
|
|
171
|
+
}, a = {
|
|
172
|
+
currentFlags: i,
|
|
173
|
+
prevFlags: null,
|
|
174
|
+
globalFlags: i,
|
|
175
|
+
groupOriginByCopy: /* @__PURE__ */ new Map(),
|
|
176
|
+
groupsByName: /* @__PURE__ */ new Map(),
|
|
177
|
+
multiplexCapturesToLeftByRef: /* @__PURE__ */ new Map(),
|
|
178
|
+
openRefs: /* @__PURE__ */ new Map(),
|
|
179
|
+
reffedNodesByReferencer: /* @__PURE__ */ new Map(),
|
|
180
|
+
subroutineRefMap: r.subroutineRefMap
|
|
181
|
+
};
|
|
182
|
+
return h(e, fe, a), h(e, pe, {
|
|
183
|
+
groupsByName: a.groupsByName,
|
|
184
|
+
highestOrphanBackref: 0,
|
|
185
|
+
numCapturesToLeft: 0,
|
|
186
|
+
reffedNodesByReferencer: a.reffedNodesByReferencer
|
|
187
|
+
}), e._originMap = a.groupOriginByCopy, e._strategy = r.strategy, e;
|
|
188
|
+
}
|
|
189
|
+
var de = {
|
|
190
|
+
AbsenceFunction({ node: e, parent: t, replaceWith: n }) {
|
|
191
|
+
let { body: r, kind: i } = e;
|
|
192
|
+
if (i === "repeater") {
|
|
193
|
+
let e = c();
|
|
194
|
+
e.body[0].body.push(l({
|
|
195
|
+
negate: !0,
|
|
196
|
+
body: r
|
|
197
|
+
}), f("Any"));
|
|
198
|
+
let i = c();
|
|
199
|
+
i.body[0].body.push(u("greedy", 0, Infinity, e)), n(G(i, t), { traverse: !0 });
|
|
200
|
+
} else throw Error("Unsupported absence function \"(?~|\"");
|
|
201
|
+
},
|
|
202
|
+
Alternative: {
|
|
203
|
+
enter({ node: e, parent: t, key: n }, { flagDirectivesByAlt: r }) {
|
|
204
|
+
let i = e.body.filter((e) => e.kind === "flags");
|
|
205
|
+
for (let e = n + 1; e < t.body.length; e++) {
|
|
206
|
+
let n = t.body[e];
|
|
207
|
+
C(r, n, []).push(...i);
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
exit({ node: e }, { flagDirectivesByAlt: t }) {
|
|
211
|
+
if (t.get(e)?.length) {
|
|
212
|
+
let n = L(t.get(e));
|
|
213
|
+
if (n) {
|
|
214
|
+
let t = c({ flags: n });
|
|
215
|
+
t.body[0].body = e.body, e.body = [G(t, e)];
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
Assertion({ node: e, parent: r, key: i, container: o, root: s, remove: c, replaceWith: u }, d) {
|
|
221
|
+
let { kind: f, negate: p } = e, { asciiWordBoundaries: m, avoidSubclass: h, supportedGNodes: g, wordIsAscii: _ } = d;
|
|
222
|
+
if (f === "text_segment_boundary") throw Error(`Unsupported text segment boundary "\\${p ? "Y" : "y"}"`);
|
|
223
|
+
if (f === "line_end") u(G(l({ body: [t({ body: [n("string_end")] }), t({ body: [a(10)] })] }), r));
|
|
224
|
+
else if (f === "line_start") u(G(H(y`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: !0 }), r));
|
|
225
|
+
else if (f === "search_start") if (g.has(e)) s.flags.sticky = !0, c();
|
|
226
|
+
else {
|
|
227
|
+
let e = o[i - 1];
|
|
228
|
+
if (e && ye(e)) u(G(l({ negate: !0 }), r));
|
|
229
|
+
else if (h) throw Error(y`Uses "\G" in a way that requires a subclass`);
|
|
230
|
+
else u(W(n("string_start"), r)), d.strategy = "clip_search";
|
|
231
|
+
}
|
|
232
|
+
else if (!(f === "string_end" || f === "string_start")) if (f === "string_end_newline") u(G(H(y`(?=\n?\z)`), r));
|
|
233
|
+
else if (f === "word_boundary") {
|
|
234
|
+
if (!_ && !m) {
|
|
235
|
+
let e = `(?:(?<=${D})(?!${D})|(?<!${D})(?=${D}))`, t = `(?:(?<=${D})(?=${D})|(?<!${D})(?!${D}))`;
|
|
236
|
+
u(G(H(p ? t : e), r));
|
|
237
|
+
}
|
|
238
|
+
} else throw Error(`Unexpected assertion kind "${f}"`);
|
|
239
|
+
},
|
|
240
|
+
Backreference({ node: e }, { jsGroupNameMap: t }) {
|
|
241
|
+
let { ref: n } = e;
|
|
242
|
+
typeof n == "string" && !V(n) && (n = I(n, t), e.ref = n);
|
|
243
|
+
},
|
|
244
|
+
CapturingGroup({ node: e }, { jsGroupNameMap: t, subroutineRefMap: n }) {
|
|
245
|
+
let { name: r } = e;
|
|
246
|
+
r && !V(r) && (r = I(r, t), e.name = r), n.set(e.number, e), r && n.set(r, e);
|
|
247
|
+
},
|
|
248
|
+
CharacterClassRange({ node: e, parent: t, replaceWith: n }) {
|
|
249
|
+
t.kind === "intersection" && n(G(o({ body: [e] }), t), { traverse: !0 });
|
|
250
|
+
},
|
|
251
|
+
CharacterSet({ node: e, parent: t, replaceWith: n }, { accuracy: r, minTargetEs2024: i, digitIsAscii: a, spaceIsAscii: o, wordIsAscii: c }) {
|
|
252
|
+
let { kind: l, negate: u, value: d } = e;
|
|
253
|
+
if (a && (l === "digit" || d === "digit")) {
|
|
254
|
+
n(W(s("digit", { negate: u }), t));
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (o && (l === "space" || d === "space")) {
|
|
258
|
+
n(G(U(H(re), u), t));
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (c && (l === "word" || d === "word")) {
|
|
262
|
+
n(W(s("word", { negate: u }), t));
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (l === "any") n(W(f("Any"), t));
|
|
266
|
+
else if (l === "digit") n(W(f("Nd", { negate: u }), t));
|
|
267
|
+
else if (l !== "dot") if (l === "text_segment") {
|
|
268
|
+
if (r === "strict") throw Error(y`Use of "\X" requires non-strict accuracy`);
|
|
269
|
+
let e = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?", a = y`\p{RI}{2}|${e}(?:\u200D${e})*`;
|
|
270
|
+
n(G(H(y`(?>\r\n|${i ? y`\p{RGI_Emoji}` : a}|\P{M}\p{M}*)`, { skipPropertyNameValidation: !0 }), t));
|
|
271
|
+
} else if (l === "hex") n(W(f("AHex", { negate: u }), t));
|
|
272
|
+
else if (l === "newline") n(G(H(u ? "[^\n]" : "(?>\r\n?|[\n\v\f
\u2028\u2029])"), t));
|
|
273
|
+
else if (l === "posix") if (!i && (d === "graph" || d === "print")) {
|
|
274
|
+
if (r === "strict") throw Error(`POSIX class "${d}" requires min target ES2024 or non-strict accuracy`);
|
|
275
|
+
let e = {
|
|
276
|
+
graph: "!-~",
|
|
277
|
+
print: " -~"
|
|
278
|
+
}[d];
|
|
279
|
+
u && (e = `\0-${v(e.codePointAt(0) - 1)}${v(e.codePointAt(2) + 1)}-\u{10FFFF}`), n(G(H(`[${e}]`), t));
|
|
280
|
+
} else n(G(U(H(ce.get(d)), u), t));
|
|
281
|
+
else if (l === "property") k.has(m(d)) || (e.key = "sc");
|
|
282
|
+
else if (l === "space") n(W(f("space", { negate: u }), t));
|
|
283
|
+
else if (l === "word") n(G(U(H(D), u), t));
|
|
284
|
+
else throw Error(`Unexpected character set kind "${l}"`);
|
|
285
|
+
},
|
|
286
|
+
Directive({ node: t, parent: n, root: r, remove: i, replaceWith: a, removeAllPrevSiblings: o, removeAllNextSiblings: s }) {
|
|
287
|
+
let { kind: u, flags: d } = t;
|
|
288
|
+
if (u === "flags") if (!d.enable && !d.disable) i();
|
|
289
|
+
else {
|
|
290
|
+
let e = c({ flags: d });
|
|
291
|
+
e.body[0].body = s(), a(G(e, n), { traverse: !0 });
|
|
292
|
+
}
|
|
293
|
+
else if (u === "keep") {
|
|
294
|
+
let t = r.body[0], i = r.body.length === 1 && e(t, { type: "Group" }) && t.body[0].body.length === 1 ? t.body[0] : r;
|
|
295
|
+
if (n.parent !== i || i.body.length > 1) throw Error(y`Uses "\K" in a way that's unsupported`);
|
|
296
|
+
let s = l({ behind: !0 });
|
|
297
|
+
s.body[0].body = o(), a(G(s, n));
|
|
298
|
+
} else throw Error(`Unexpected directive kind "${u}"`);
|
|
299
|
+
},
|
|
300
|
+
Flags({ node: e, parent: t }) {
|
|
301
|
+
if (e.posixIsAscii) throw Error("Unsupported flag \"P\"");
|
|
302
|
+
if (e.textSegmentMode === "word") throw Error("Unsupported flag \"y{w}\"");
|
|
303
|
+
[
|
|
304
|
+
"digitIsAscii",
|
|
305
|
+
"extended",
|
|
306
|
+
"posixIsAscii",
|
|
307
|
+
"spaceIsAscii",
|
|
308
|
+
"wordIsAscii",
|
|
309
|
+
"textSegmentMode"
|
|
310
|
+
].forEach((t) => delete e[t]), Object.assign(e, {
|
|
311
|
+
global: !1,
|
|
312
|
+
hasIndices: !1,
|
|
313
|
+
multiline: !1,
|
|
314
|
+
sticky: e.sticky ?? !1
|
|
315
|
+
}), t.options = {
|
|
316
|
+
disable: {
|
|
317
|
+
x: !0,
|
|
318
|
+
n: !0
|
|
319
|
+
},
|
|
320
|
+
force: { v: !0 }
|
|
321
|
+
};
|
|
322
|
+
},
|
|
323
|
+
Group({ node: e }) {
|
|
324
|
+
if (!e.flags) return;
|
|
325
|
+
let { enable: t, disable: n } = e.flags;
|
|
326
|
+
t?.extended && delete t.extended, n?.extended && delete n.extended, t?.dotAll && n?.dotAll && delete t.dotAll, t?.ignoreCase && n?.ignoreCase && delete t.ignoreCase, t && !Object.keys(t).length && delete e.flags.enable, n && !Object.keys(n).length && delete e.flags.disable, !e.flags.enable && !e.flags.disable && delete e.flags;
|
|
327
|
+
},
|
|
328
|
+
LookaroundAssertion({ node: e }, t) {
|
|
329
|
+
let { kind: n } = e;
|
|
330
|
+
n === "lookbehind" && (t.passedLookbehind = !0);
|
|
331
|
+
},
|
|
332
|
+
NamedCallout({ node: e, parent: t, replaceWith: n }) {
|
|
333
|
+
let { kind: r } = e;
|
|
334
|
+
if (r === "fail") n(G(l({ negate: !0 }), t));
|
|
335
|
+
else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`);
|
|
336
|
+
},
|
|
337
|
+
Quantifier({ node: e }) {
|
|
338
|
+
if (e.body.type === "Quantifier") {
|
|
339
|
+
let t = c();
|
|
340
|
+
t.body[0].body.push(e.body), e.body = G(t, e);
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
Regex: {
|
|
344
|
+
enter({ node: e }, { supportedGNodes: t }) {
|
|
345
|
+
let n = [], r = !1, i = !1;
|
|
346
|
+
for (let t of e.body) if (t.body.length === 1 && t.body[0].kind === "search_start") t.body.pop();
|
|
347
|
+
else {
|
|
348
|
+
let e = z(t.body);
|
|
349
|
+
e ? (r = !0, Array.isArray(e) ? n.push(...e) : n.push(e)) : i = !0;
|
|
350
|
+
}
|
|
351
|
+
r && !i && n.forEach((e) => t.add(e));
|
|
352
|
+
},
|
|
353
|
+
exit(e, { accuracy: t, passedLookbehind: n, strategy: r }) {
|
|
354
|
+
if (t === "strict" && n && r) throw Error(y`Uses "\G" in a way that requires non-strict accuracy`);
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
Subroutine({ node: e }, { jsGroupNameMap: t }) {
|
|
358
|
+
let { ref: n } = e;
|
|
359
|
+
typeof n == "string" && !V(n) && (n = I(n, t), e.ref = n);
|
|
360
|
+
}
|
|
361
|
+
}, fe = {
|
|
362
|
+
Backreference({ node: e }, { multiplexCapturesToLeftByRef: t, reffedNodesByReferencer: n }) {
|
|
363
|
+
let { orphan: r, ref: i } = e;
|
|
364
|
+
r || n.set(e, [...t.get(i).map(({ node: e }) => e)]);
|
|
365
|
+
},
|
|
366
|
+
CapturingGroup: {
|
|
367
|
+
enter({ node: e, parent: t, replaceWith: n, skip: r }, { groupOriginByCopy: i, groupsByName: a, multiplexCapturesToLeftByRef: o, openRefs: s, reffedNodesByReferencer: c }) {
|
|
368
|
+
let l = i.get(e);
|
|
369
|
+
if (l && s.has(e.number)) {
|
|
370
|
+
let r = W(F(e.number), t);
|
|
371
|
+
c.set(r, s.get(e.number)), n(r);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
s.set(e.number, e), o.set(e.number, []), e.name && C(o, e.name, []);
|
|
375
|
+
let u = o.get(e.name ?? e.number);
|
|
376
|
+
for (let t = 0; t < u.length; t++) {
|
|
377
|
+
let n = u[t];
|
|
378
|
+
if (l === n.node || l && l === n.origin || e === n.origin) {
|
|
379
|
+
u.splice(t, 1);
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (o.get(e.number).push({
|
|
384
|
+
node: e,
|
|
385
|
+
origin: l
|
|
386
|
+
}), e.name && o.get(e.name).push({
|
|
387
|
+
node: e,
|
|
388
|
+
origin: l
|
|
389
|
+
}), e.name) {
|
|
390
|
+
let t = C(a, e.name, /* @__PURE__ */ new Map()), n = !1;
|
|
391
|
+
if (l) n = !0;
|
|
392
|
+
else for (let e of t.values()) if (!e.hasDuplicateNameToRemove) {
|
|
393
|
+
n = !0;
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
a.get(e.name).set(e, {
|
|
397
|
+
node: e,
|
|
398
|
+
hasDuplicateNameToRemove: n
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
exit({ node: e }, { openRefs: t }) {
|
|
403
|
+
t.get(e.number) === e && t.delete(e.number);
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
Group: {
|
|
407
|
+
enter({ node: e }, t) {
|
|
408
|
+
t.prevFlags = t.currentFlags, e.flags && (t.currentFlags = S(t.currentFlags, e.flags));
|
|
409
|
+
},
|
|
410
|
+
exit(e, t) {
|
|
411
|
+
t.currentFlags = t.prevFlags;
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
Subroutine({ node: e, parent: t, replaceWith: n }, r) {
|
|
415
|
+
let { isRecursive: i, ref: a } = e;
|
|
416
|
+
if (i) {
|
|
417
|
+
let n = t;
|
|
418
|
+
for (; (n = n.parent) && !(n.type === "CapturingGroup" && (n.name === a || n.number === a)););
|
|
419
|
+
r.reffedNodesByReferencer.set(e, n);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
let o = r.subroutineRefMap.get(a), s = a === 0, l = s ? F(0) : P(o, r.groupOriginByCopy, null), u = l;
|
|
423
|
+
if (!s) {
|
|
424
|
+
let e = L(ge(o, (e) => e.type === "Group" && !!e.flags)), t = e ? S(r.globalFlags, e) : r.globalFlags;
|
|
425
|
+
me(t, r.currentFlags) || (u = c({ flags: _e(t) }), u.body[0].body.push(l));
|
|
426
|
+
}
|
|
427
|
+
n(G(u, t), { traverse: !s });
|
|
428
|
+
}
|
|
429
|
+
}, pe = {
|
|
430
|
+
Backreference({ node: e, parent: n, replaceWith: i }, a) {
|
|
431
|
+
if (e.orphan) {
|
|
432
|
+
a.highestOrphanBackref = Math.max(a.highestOrphanBackref, e.ref);
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
let o = a.reffedNodesByReferencer.get(e).filter((t) => he(t, e));
|
|
436
|
+
o.length ? o.length > 1 ? i(G(c({
|
|
437
|
+
atomic: !0,
|
|
438
|
+
body: o.reverse().map((e) => t({ body: [r(e.number)] }))
|
|
439
|
+
}), n)) : e.ref = o[0].number : i(G(l({ negate: !0 }), n));
|
|
440
|
+
},
|
|
441
|
+
CapturingGroup({ node: e }, t) {
|
|
442
|
+
e.number = ++t.numCapturesToLeft, e.name && t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove && delete e.name;
|
|
443
|
+
},
|
|
444
|
+
Regex: { exit({ node: e }, t) {
|
|
445
|
+
let n = Math.max(t.highestOrphanBackref - t.numCapturesToLeft, 0);
|
|
446
|
+
for (let t = 0; t < n; t++) {
|
|
447
|
+
let t = i();
|
|
448
|
+
e.body.at(-1).body.push(t);
|
|
449
|
+
}
|
|
450
|
+
} },
|
|
451
|
+
Subroutine({ node: e }, t) {
|
|
452
|
+
!e.isRecursive || e.ref === 0 || (e.ref = t.reffedNodesByReferencer.get(e).number);
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
function N(e) {
|
|
456
|
+
h(e, { "*"({ node: e, parent: t }) {
|
|
457
|
+
e.parent = t;
|
|
458
|
+
} });
|
|
459
|
+
}
|
|
460
|
+
function me(e, t) {
|
|
461
|
+
return e.dotAll === t.dotAll && e.ignoreCase === t.ignoreCase;
|
|
462
|
+
}
|
|
463
|
+
function he(e, t) {
|
|
464
|
+
let n = t;
|
|
465
|
+
do {
|
|
466
|
+
if (n.type === "Regex") return !1;
|
|
467
|
+
if (n.type === "Alternative") continue;
|
|
468
|
+
if (n === e) return !1;
|
|
469
|
+
let t = R(n.parent);
|
|
470
|
+
for (let r of t) {
|
|
471
|
+
if (r === n) break;
|
|
472
|
+
if (r === e || B(r, e)) return !0;
|
|
473
|
+
}
|
|
474
|
+
} while (n = n.parent);
|
|
475
|
+
throw Error("Unexpected path");
|
|
476
|
+
}
|
|
477
|
+
function P(e, t, n, r) {
|
|
478
|
+
let i = Array.isArray(e) ? [] : {};
|
|
479
|
+
for (let [a, o] of Object.entries(e)) a === "parent" ? i.parent = Array.isArray(n) ? r : n : o && typeof o == "object" ? i[a] = P(o, t, i, n) : (a === "type" && o === "CapturingGroup" && t.set(i, t.get(e) ?? e), i[a] = o);
|
|
480
|
+
return i;
|
|
481
|
+
}
|
|
482
|
+
function F(e) {
|
|
483
|
+
let t = d(e);
|
|
484
|
+
return t.isRecursive = !0, t;
|
|
485
|
+
}
|
|
486
|
+
function ge(e, t) {
|
|
487
|
+
let n = [];
|
|
488
|
+
for (; e = e.parent;) (!t || t(e)) && n.push(e);
|
|
489
|
+
return n;
|
|
490
|
+
}
|
|
491
|
+
function I(e, t) {
|
|
492
|
+
if (t.has(e)) return t.get(e);
|
|
493
|
+
let n = `$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu, "_")}`;
|
|
494
|
+
return t.set(e, n), n;
|
|
495
|
+
}
|
|
496
|
+
function L(e) {
|
|
497
|
+
let t = ["dotAll", "ignoreCase"], n = {
|
|
498
|
+
enable: {},
|
|
499
|
+
disable: {}
|
|
500
|
+
};
|
|
501
|
+
return e.forEach(({ flags: e }) => {
|
|
502
|
+
t.forEach((t) => {
|
|
503
|
+
e.enable?.[t] && (delete n.disable[t], n.enable[t] = !0), e.disable?.[t] && (n.disable[t] = !0);
|
|
504
|
+
});
|
|
505
|
+
}), Object.keys(n.enable).length || delete n.enable, Object.keys(n.disable).length || delete n.disable, n.enable || n.disable ? n : null;
|
|
506
|
+
}
|
|
507
|
+
function _e({ dotAll: e, ignoreCase: t }) {
|
|
508
|
+
let n = {};
|
|
509
|
+
return (e || t) && (n.enable = {}, e && (n.enable.dotAll = !0), t && (n.enable.ignoreCase = !0)), (!e || !t) && (n.disable = {}, !e && (n.disable.dotAll = !0), !t && (n.disable.ignoreCase = !0)), n;
|
|
510
|
+
}
|
|
511
|
+
function R(e) {
|
|
512
|
+
if (!e) throw Error("Node expected");
|
|
513
|
+
let { body: t } = e;
|
|
514
|
+
return Array.isArray(t) ? t : t ? [t] : null;
|
|
515
|
+
}
|
|
516
|
+
function z(e) {
|
|
517
|
+
let t = e.find((e) => e.kind === "search_start" || be(e, { negate: !1 }) || !ve(e));
|
|
518
|
+
if (!t) return null;
|
|
519
|
+
if (t.kind === "search_start") return t;
|
|
520
|
+
if (t.type === "LookaroundAssertion") return t.body[0].body[0];
|
|
521
|
+
if (t.type === "CapturingGroup" || t.type === "Group") {
|
|
522
|
+
let e = [];
|
|
523
|
+
for (let n of t.body) {
|
|
524
|
+
let t = z(n.body);
|
|
525
|
+
if (!t) return null;
|
|
526
|
+
Array.isArray(t) ? e.push(...t) : e.push(t);
|
|
527
|
+
}
|
|
528
|
+
return e;
|
|
529
|
+
}
|
|
530
|
+
return null;
|
|
531
|
+
}
|
|
532
|
+
function B(e, t) {
|
|
533
|
+
let n = R(e) ?? [];
|
|
534
|
+
for (let e of n) if (e === t || B(e, t)) return !0;
|
|
535
|
+
return !1;
|
|
536
|
+
}
|
|
537
|
+
function ve({ type: e }) {
|
|
538
|
+
return e === "Assertion" || e === "Directive" || e === "LookaroundAssertion";
|
|
539
|
+
}
|
|
540
|
+
function ye(e) {
|
|
541
|
+
let t = [
|
|
542
|
+
"Character",
|
|
543
|
+
"CharacterClass",
|
|
544
|
+
"CharacterSet"
|
|
545
|
+
];
|
|
546
|
+
return t.includes(e.type) || e.type === "Quantifier" && e.min && t.includes(e.body.type);
|
|
547
|
+
}
|
|
548
|
+
function be(t, n) {
|
|
549
|
+
let r = {
|
|
550
|
+
negate: null,
|
|
551
|
+
...n
|
|
552
|
+
};
|
|
553
|
+
return t.type === "LookaroundAssertion" && (r.negate === null || t.negate === r.negate) && t.body.length === 1 && e(t.body[0], {
|
|
554
|
+
type: "Assertion",
|
|
555
|
+
kind: "search_start"
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
function V(e) {
|
|
559
|
+
return /^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e);
|
|
560
|
+
}
|
|
561
|
+
function H(e, t) {
|
|
562
|
+
let n = p(e, {
|
|
563
|
+
...t,
|
|
564
|
+
unicodePropertyMap: k
|
|
565
|
+
}).body;
|
|
566
|
+
return n.length > 1 || n[0].body.length > 1 ? c({ body: n }) : n[0].body[0];
|
|
567
|
+
}
|
|
568
|
+
function U(e, t) {
|
|
569
|
+
return e.negate = t, e;
|
|
570
|
+
}
|
|
571
|
+
function W(e, t) {
|
|
572
|
+
return e.parent = t, e;
|
|
573
|
+
}
|
|
574
|
+
function G(e, t) {
|
|
575
|
+
return N(e), e.parent = t, e;
|
|
576
|
+
}
|
|
577
|
+
function xe(e, t) {
|
|
578
|
+
let n = E(t), r = w(n.target, "ES2024"), i = w(n.target, "ES2025"), a = n.rules.recursionLimit;
|
|
579
|
+
if (!Number.isInteger(a) || a < 2 || a > 20) throw Error("Invalid recursionLimit; use 2-20");
|
|
580
|
+
let o = null, s = null;
|
|
581
|
+
if (!i) {
|
|
582
|
+
let t = [e.flags.ignoreCase];
|
|
583
|
+
h(e, Se, {
|
|
584
|
+
getCurrentModI: () => t.at(-1),
|
|
585
|
+
popModI() {
|
|
586
|
+
t.pop();
|
|
587
|
+
},
|
|
588
|
+
pushModI(e) {
|
|
589
|
+
t.push(e);
|
|
590
|
+
},
|
|
591
|
+
setHasCasedChar() {
|
|
592
|
+
t.at(-1) ? o = !0 : s = !0;
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
let c = {
|
|
597
|
+
dotAll: e.flags.dotAll,
|
|
598
|
+
ignoreCase: !!((e.flags.ignoreCase || o) && !s)
|
|
599
|
+
}, l = e, u = {
|
|
600
|
+
accuracy: n.accuracy,
|
|
601
|
+
appliedGlobalFlags: c,
|
|
602
|
+
captureMap: /* @__PURE__ */ new Map(),
|
|
603
|
+
currentFlags: {
|
|
604
|
+
dotAll: e.flags.dotAll,
|
|
605
|
+
ignoreCase: e.flags.ignoreCase
|
|
606
|
+
},
|
|
607
|
+
inCharClass: !1,
|
|
608
|
+
lastNode: l,
|
|
609
|
+
originMap: e._originMap,
|
|
610
|
+
recursionLimit: a,
|
|
611
|
+
useAppliedIgnoreCase: !!(!i && o && s),
|
|
612
|
+
useFlagMods: i,
|
|
613
|
+
useFlagV: r,
|
|
614
|
+
verbose: n.verbose
|
|
615
|
+
};
|
|
616
|
+
function d(e) {
|
|
617
|
+
return u.lastNode = l, l = e, te(Ce[e.type], `Unexpected node type "${e.type}"`)(e, u, d);
|
|
618
|
+
}
|
|
619
|
+
let f = {
|
|
620
|
+
pattern: e.body.map(d).join("|"),
|
|
621
|
+
flags: d(e.flags),
|
|
622
|
+
options: { ...e.options }
|
|
623
|
+
};
|
|
624
|
+
return r || (delete f.options.force.v, f.options.disable.v = !0, f.options.unicodeSetsPlugin = null), f._captureTransfers = /* @__PURE__ */ new Map(), f._hiddenCaptures = [], u.captureMap.forEach((e, t) => {
|
|
625
|
+
e.hidden && f._hiddenCaptures.push(t), e.transferTo && C(f._captureTransfers, e.transferTo, []).push(t);
|
|
626
|
+
}), f;
|
|
627
|
+
}
|
|
628
|
+
var Se = {
|
|
629
|
+
"*": {
|
|
630
|
+
enter({ node: e }, t) {
|
|
631
|
+
if (X(e)) {
|
|
632
|
+
let n = t.getCurrentModI();
|
|
633
|
+
t.pushModI(e.flags ? S({ ignoreCase: n }, e.flags).ignoreCase : n);
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
exit({ node: e }, t) {
|
|
637
|
+
X(e) && t.popModI();
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
Backreference(e, t) {
|
|
641
|
+
t.setHasCasedChar();
|
|
642
|
+
},
|
|
643
|
+
Character({ node: e }, t) {
|
|
644
|
+
q(v(e.value)) && t.setHasCasedChar();
|
|
645
|
+
},
|
|
646
|
+
CharacterClassRange({ node: e, skip: t }, n) {
|
|
647
|
+
t(), J(e, { firstOnly: !0 }).length && n.setHasCasedChar();
|
|
648
|
+
},
|
|
649
|
+
CharacterSet({ node: e }, t) {
|
|
650
|
+
e.kind === "property" && M.has(e.value) && t.setHasCasedChar();
|
|
651
|
+
}
|
|
652
|
+
}, Ce = {
|
|
653
|
+
Alternative({ body: e }, t, n) {
|
|
654
|
+
return e.map(n).join("");
|
|
655
|
+
},
|
|
656
|
+
Assertion({ kind: e, negate: t }) {
|
|
657
|
+
if (e === "string_end") return "$";
|
|
658
|
+
if (e === "string_start") return "^";
|
|
659
|
+
if (e === "word_boundary") return t ? y`\B` : y`\b`;
|
|
660
|
+
throw Error(`Unexpected assertion kind "${e}"`);
|
|
661
|
+
},
|
|
662
|
+
Backreference({ ref: e }, t) {
|
|
663
|
+
if (typeof e != "number") throw Error("Unexpected named backref in transformed AST");
|
|
664
|
+
if (!t.useFlagMods && t.accuracy === "strict" && t.currentFlags.ignoreCase && !t.captureMap.get(e).ignoreCase) throw Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");
|
|
665
|
+
return "\\" + e;
|
|
666
|
+
},
|
|
667
|
+
CapturingGroup(e, t, n) {
|
|
668
|
+
let { body: r, name: i, number: a } = e, o = { ignoreCase: t.currentFlags.ignoreCase }, s = t.originMap.get(e);
|
|
669
|
+
return s && (o.hidden = !0, a > s.number && (o.transferTo = s.number)), t.captureMap.set(a, o), `(${i ? `?<${i}>` : ""}${r.map(n).join("|")})`;
|
|
670
|
+
},
|
|
671
|
+
Character({ value: e }, t) {
|
|
672
|
+
let n = v(e), r = Y(e, {
|
|
673
|
+
escDigit: t.lastNode.type === "Backreference",
|
|
674
|
+
inCharClass: t.inCharClass,
|
|
675
|
+
useFlagV: t.useFlagV
|
|
676
|
+
});
|
|
677
|
+
if (r !== n) return r;
|
|
678
|
+
if (t.useAppliedIgnoreCase && t.currentFlags.ignoreCase && q(n)) {
|
|
679
|
+
let e = O(n);
|
|
680
|
+
return t.inCharClass ? e.join("") : e.length > 1 ? `[${e.join("")}]` : e[0];
|
|
681
|
+
}
|
|
682
|
+
return n;
|
|
683
|
+
},
|
|
684
|
+
CharacterClass(e, n, r) {
|
|
685
|
+
let { kind: i, negate: o, parent: s } = e, { body: l } = e;
|
|
686
|
+
if (i === "intersection" && !n.useFlagV) throw Error("Use of character class intersection requires min target ES2024");
|
|
687
|
+
b.bugFlagVLiteralHyphenIsRange && n.useFlagV && l.some(Z) && (l = [a(45), ...l.filter((e) => !Z(e))]);
|
|
688
|
+
let u = () => `[${o ? "^" : ""}${l.map(r).join(i === "intersection" ? "&&" : "")}]`;
|
|
689
|
+
if (!n.inCharClass) {
|
|
690
|
+
if ((!n.useFlagV || b.bugNestedClassIgnoresNegation) && !o) {
|
|
691
|
+
let n = l.filter((e) => e.type === "CharacterClass" && e.kind === "union" && e.negate);
|
|
692
|
+
if (n.length) {
|
|
693
|
+
let i = c(), a = i.body[0];
|
|
694
|
+
return i.parent = s, a.parent = i, l = l.filter((e) => !n.includes(e)), e.body = l, l.length ? (e.parent = a, a.body.push(e)) : i.body.pop(), n.forEach((e) => {
|
|
695
|
+
let n = t({ body: [e] });
|
|
696
|
+
e.parent = n, n.parent = i, i.body.push(n);
|
|
697
|
+
}), r(i);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
n.inCharClass = !0;
|
|
701
|
+
let i = u();
|
|
702
|
+
return n.inCharClass = !1, i;
|
|
703
|
+
}
|
|
704
|
+
let d = l[0];
|
|
705
|
+
if (i === "union" && !o && d && ((!n.useFlagV || !n.verbose) && s.kind === "union" && !(b.bugFlagVLiteralHyphenIsRange && n.useFlagV) || !n.verbose && s.kind === "intersection" && l.length === 1 && d.type !== "CharacterClassRange")) return l.map(r).join("");
|
|
706
|
+
if (!n.useFlagV && s.type === "CharacterClass") throw Error("Uses nested character class in a way that requires min target ES2024");
|
|
707
|
+
return u();
|
|
708
|
+
},
|
|
709
|
+
CharacterClassRange(e, t) {
|
|
710
|
+
let n = e.min.value, r = e.max.value, i = {
|
|
711
|
+
escDigit: !1,
|
|
712
|
+
inCharClass: !0,
|
|
713
|
+
useFlagV: t.useFlagV
|
|
714
|
+
}, a = Y(n, i), o = Y(r, i), s = /* @__PURE__ */ new Set();
|
|
715
|
+
return t.useAppliedIgnoreCase && t.currentFlags.ignoreCase && Oe(J(e)).forEach((e) => {
|
|
716
|
+
s.add(Array.isArray(e) ? `${Y(e[0], i)}-${Y(e[1], i)}` : Y(e, i));
|
|
717
|
+
}), `${a}-${o}${[...s].join("")}`;
|
|
718
|
+
},
|
|
719
|
+
CharacterSet({ kind: e, negate: t, value: n, key: r }, i) {
|
|
720
|
+
if (e === "dot") return i.currentFlags.dotAll ? i.appliedGlobalFlags.dotAll || i.useFlagMods ? "." : "[^]" : y`[^\n]`;
|
|
721
|
+
if (e === "digit") return t ? y`\D` : y`\d`;
|
|
722
|
+
if (e === "property") {
|
|
723
|
+
if (i.useAppliedIgnoreCase && i.currentFlags.ignoreCase && M.has(n)) throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);
|
|
724
|
+
return `${t ? y`\P` : y`\p`}{${r ? `${r}=` : ""}${n}}`;
|
|
725
|
+
}
|
|
726
|
+
if (e === "word") return t ? y`\W` : y`\w`;
|
|
727
|
+
throw Error(`Unexpected character set kind "${e}"`);
|
|
728
|
+
},
|
|
729
|
+
Flags(e, t) {
|
|
730
|
+
return (t.appliedGlobalFlags.ignoreCase ? "i" : "") + (e.dotAll ? "s" : "") + (e.sticky ? "y" : "");
|
|
731
|
+
},
|
|
732
|
+
Group({ atomic: e, body: t, flags: n, parent: r }, i, a) {
|
|
733
|
+
let o = i.currentFlags;
|
|
734
|
+
n && (i.currentFlags = S(o, n));
|
|
735
|
+
let s = t.map(a).join("|"), c = !i.verbose && t.length === 1 && r.type !== "Quantifier" && !e && (!i.useFlagMods || !n) ? s : `(?${ke(e, n, i.useFlagMods)}${s})`;
|
|
736
|
+
return i.currentFlags = o, c;
|
|
737
|
+
},
|
|
738
|
+
LookaroundAssertion({ body: e, kind: t, negate: n }, r, i) {
|
|
739
|
+
return `(?${`${t === "lookahead" ? "" : "<"}${n ? "!" : "="}`}${e.map(i).join("|")})`;
|
|
740
|
+
},
|
|
741
|
+
Quantifier(e, t, n) {
|
|
742
|
+
return n(e.body) + Ae(e);
|
|
743
|
+
},
|
|
744
|
+
Subroutine({ isRecursive: e, ref: t }, n) {
|
|
745
|
+
if (!e) throw Error("Unexpected non-recursive subroutine in transformed AST");
|
|
746
|
+
let r = n.recursionLimit;
|
|
747
|
+
return t === 0 ? `(?R=${r})` : y`\g<${t}&R=${r}>`;
|
|
748
|
+
}
|
|
749
|
+
}, we = /* @__PURE__ */ new Set([
|
|
750
|
+
"$",
|
|
751
|
+
"(",
|
|
752
|
+
")",
|
|
753
|
+
"*",
|
|
754
|
+
"+",
|
|
755
|
+
".",
|
|
756
|
+
"?",
|
|
757
|
+
"[",
|
|
758
|
+
"\\",
|
|
759
|
+
"]",
|
|
760
|
+
"^",
|
|
761
|
+
"{",
|
|
762
|
+
"|",
|
|
763
|
+
"}"
|
|
764
|
+
]), Te = /* @__PURE__ */ new Set([
|
|
765
|
+
"-",
|
|
766
|
+
"\\",
|
|
767
|
+
"]",
|
|
768
|
+
"^",
|
|
769
|
+
"["
|
|
770
|
+
]), Ee = /* @__PURE__ */ new Set(/* @__PURE__ */ "()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split("")), K = /* @__PURE__ */ new Map([
|
|
771
|
+
[9, y`\t`],
|
|
772
|
+
[10, y`\n`],
|
|
773
|
+
[11, y`\v`],
|
|
774
|
+
[12, y`\f`],
|
|
775
|
+
[13, y`\r`],
|
|
776
|
+
[8232, y`\u2028`],
|
|
777
|
+
[8233, y`\u2029`],
|
|
778
|
+
[65279, y`\uFEFF`]
|
|
779
|
+
]), De = /^\p{Cased}$/u;
|
|
780
|
+
function q(e) {
|
|
781
|
+
return De.test(e);
|
|
782
|
+
}
|
|
783
|
+
function J(e, t) {
|
|
784
|
+
let n = !!t?.firstOnly, r = e.min.value, i = e.max.value, a = [];
|
|
785
|
+
if (r < 65 && (i === 65535 || i >= 131071) || r === 65536 && i >= 131071) return a;
|
|
786
|
+
for (let e = r; e <= i; e++) {
|
|
787
|
+
let t = v(e);
|
|
788
|
+
if (!q(t)) continue;
|
|
789
|
+
let o = O(t).filter((e) => {
|
|
790
|
+
let t = e.codePointAt(0);
|
|
791
|
+
return t < r || t > i;
|
|
792
|
+
});
|
|
793
|
+
if (o.length && (a.push(...o), n)) break;
|
|
794
|
+
}
|
|
795
|
+
return a;
|
|
796
|
+
}
|
|
797
|
+
function Y(e, { escDigit: t, inCharClass: n, useFlagV: r }) {
|
|
798
|
+
if (K.has(e)) return K.get(e);
|
|
799
|
+
if (e < 32 || e > 126 && e < 160 || e > 262143 || t && je(e)) return e > 255 ? `\\u{${e.toString(16).toUpperCase()}}` : `\\x${e.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
800
|
+
let i = n ? r ? Ee : Te : we, a = v(e);
|
|
801
|
+
return (i.has(a) ? "\\" : "") + a;
|
|
802
|
+
}
|
|
803
|
+
function Oe(e) {
|
|
804
|
+
let t = e.map((e) => e.codePointAt(0)).sort((e, t) => e - t), n = [], r = null;
|
|
805
|
+
for (let e = 0; e < t.length; e++) t[e + 1] === t[e] + 1 ? r ??= t[e] : r === null ? n.push(t[e]) : (n.push([r, t[e]]), r = null);
|
|
806
|
+
return n;
|
|
807
|
+
}
|
|
808
|
+
function ke(e, t, n) {
|
|
809
|
+
if (e) return ">";
|
|
810
|
+
let r = "";
|
|
811
|
+
if (t && n) {
|
|
812
|
+
let { enable: e, disable: n } = t;
|
|
813
|
+
r = (e?.ignoreCase ? "i" : "") + (e?.dotAll ? "s" : "") + (n ? "-" : "") + (n?.ignoreCase ? "i" : "") + (n?.dotAll ? "s" : "");
|
|
814
|
+
}
|
|
815
|
+
return `${r}:`;
|
|
816
|
+
}
|
|
817
|
+
function Ae({ kind: e, max: t, min: n }) {
|
|
818
|
+
let r;
|
|
819
|
+
return r = !n && t === 1 ? "?" : !n && t === Infinity ? "*" : n === 1 && t === Infinity ? "+" : n === t ? `{${n}}` : `{${n},${t === Infinity ? "" : t}}`, r + {
|
|
820
|
+
greedy: "",
|
|
821
|
+
lazy: "?",
|
|
822
|
+
possessive: "+"
|
|
823
|
+
}[e];
|
|
824
|
+
}
|
|
825
|
+
function X({ type: e }) {
|
|
826
|
+
return e === "CapturingGroup" || e === "Group" || e === "LookaroundAssertion";
|
|
827
|
+
}
|
|
828
|
+
function je(e) {
|
|
829
|
+
return e > 47 && e < 58;
|
|
830
|
+
}
|
|
831
|
+
function Z({ type: e, value: t }) {
|
|
832
|
+
return e === "Character" && t === 45;
|
|
833
|
+
}
|
|
834
|
+
var Q = class e extends RegExp {
|
|
835
|
+
#e = /* @__PURE__ */ new Map();
|
|
836
|
+
#t = null;
|
|
837
|
+
#n;
|
|
838
|
+
#r = null;
|
|
839
|
+
#i = null;
|
|
840
|
+
rawOptions = {};
|
|
841
|
+
get source() {
|
|
842
|
+
return this.#n || "(?:)";
|
|
843
|
+
}
|
|
844
|
+
constructor(t, n, r) {
|
|
845
|
+
let i = !!r?.lazyCompile;
|
|
846
|
+
if (t instanceof RegExp) {
|
|
847
|
+
if (r) throw Error("Cannot provide options when copying a regexp");
|
|
848
|
+
let i = t;
|
|
849
|
+
super(i, n), this.#n = i.source, i instanceof e && (this.#e = i.#e, this.#r = i.#r, this.#i = i.#i, this.rawOptions = i.rawOptions);
|
|
850
|
+
} else {
|
|
851
|
+
let e = {
|
|
852
|
+
hiddenCaptures: [],
|
|
853
|
+
strategy: null,
|
|
854
|
+
transfers: [],
|
|
855
|
+
...r
|
|
856
|
+
};
|
|
857
|
+
super(i ? "" : t, n), this.#n = t, this.#e = Ne(e.hiddenCaptures, e.transfers), this.#i = e.strategy, this.rawOptions = r ?? {};
|
|
858
|
+
}
|
|
859
|
+
i || (this.#t = this);
|
|
860
|
+
}
|
|
861
|
+
exec(t) {
|
|
862
|
+
if (!this.#t) {
|
|
863
|
+
let { lazyCompile: t, ...n } = this.rawOptions;
|
|
864
|
+
this.#t = new e(this.#n, this.flags, n);
|
|
865
|
+
}
|
|
866
|
+
let n = this.global || this.sticky, r = this.lastIndex;
|
|
867
|
+
if (this.#i === "clip_search" && n && r) {
|
|
868
|
+
this.lastIndex = 0;
|
|
869
|
+
let e = this.#a(t.slice(r));
|
|
870
|
+
return e && (Me(e, r, t, this.hasIndices), this.lastIndex += r), e;
|
|
871
|
+
}
|
|
872
|
+
return this.#a(t);
|
|
873
|
+
}
|
|
874
|
+
#a(e) {
|
|
875
|
+
this.#t.lastIndex = this.lastIndex;
|
|
876
|
+
let t = super.exec.call(this.#t, e);
|
|
877
|
+
if (this.lastIndex = this.#t.lastIndex, !t || !this.#e.size) return t;
|
|
878
|
+
let n = [...t];
|
|
879
|
+
t.length = 1;
|
|
880
|
+
let r;
|
|
881
|
+
this.hasIndices && (r = [...t.indices], t.indices.length = 1);
|
|
882
|
+
let i = [0];
|
|
883
|
+
for (let e = 1; e < n.length; e++) {
|
|
884
|
+
let { hidden: a, transferTo: o } = this.#e.get(e) ?? {};
|
|
885
|
+
if (a ? i.push(null) : (i.push(t.length), t.push(n[e]), this.hasIndices && t.indices.push(r[e])), o && n[e] !== void 0) {
|
|
886
|
+
let a = i[o];
|
|
887
|
+
if (!a) throw Error(`Invalid capture transfer to "${a}"`);
|
|
888
|
+
if (t[a] = n[e], this.hasIndices && (t.indices[a] = r[e]), t.groups) {
|
|
889
|
+
this.#r ||= Pe(this.source);
|
|
890
|
+
let i = this.#r.get(o);
|
|
891
|
+
i && (t.groups[i] = n[e], this.hasIndices && (t.indices.groups[i] = r[e]));
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
return t;
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
function Me(e, t, n, r) {
|
|
899
|
+
if (e.index += t, e.input = n, r) {
|
|
900
|
+
let n = e.indices;
|
|
901
|
+
for (let e = 0; e < n.length; e++) {
|
|
902
|
+
let r = n[e];
|
|
903
|
+
r && (n[e] = [r[0] + t, r[1] + t]);
|
|
904
|
+
}
|
|
905
|
+
let r = n.groups;
|
|
906
|
+
r && Object.keys(r).forEach((e) => {
|
|
907
|
+
let n = r[e];
|
|
908
|
+
n && (r[e] = [n[0] + t, n[1] + t]);
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
function Ne(e, t) {
|
|
913
|
+
let n = /* @__PURE__ */ new Map();
|
|
914
|
+
for (let t of e) n.set(t, { hidden: !0 });
|
|
915
|
+
for (let [e, r] of t) for (let t of r) C(n, t, {}).transferTo = e;
|
|
916
|
+
return n;
|
|
917
|
+
}
|
|
918
|
+
function Pe(e) {
|
|
919
|
+
let t = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu, n = /* @__PURE__ */ new Map(), r = 0, i = 0, a;
|
|
920
|
+
for (; a = t.exec(e);) {
|
|
921
|
+
let { 0: e, groups: { capture: t, name: o } } = a;
|
|
922
|
+
e === "[" ? r++ : r ? e === "]" && r-- : t && (i++, o && n.set(i, o));
|
|
923
|
+
}
|
|
924
|
+
return n;
|
|
925
|
+
}
|
|
926
|
+
function Fe(e, t) {
|
|
927
|
+
let n = $(e, t);
|
|
928
|
+
return n.options ? new Q(n.pattern, n.flags, n.options) : new RegExp(n.pattern, n.flags);
|
|
929
|
+
}
|
|
930
|
+
function $(e, t) {
|
|
931
|
+
let n = E(t), r = ue(p(e, {
|
|
932
|
+
flags: n.flags,
|
|
933
|
+
normalizeUnknownPropertyNames: !0,
|
|
934
|
+
rules: {
|
|
935
|
+
captureGroup: n.rules.captureGroup,
|
|
936
|
+
singleline: n.rules.singleline
|
|
937
|
+
},
|
|
938
|
+
skipBackrefValidation: n.rules.allowOrphanBackrefs,
|
|
939
|
+
unicodePropertyMap: k
|
|
940
|
+
}), {
|
|
941
|
+
accuracy: n.accuracy,
|
|
942
|
+
asciiWordBoundaries: n.rules.asciiWordBoundaries,
|
|
943
|
+
avoidSubclass: n.avoidSubclass,
|
|
944
|
+
bestEffortTarget: n.target
|
|
945
|
+
}), i = xe(r, n), a = ee(i.pattern, {
|
|
946
|
+
captureTransfers: i._captureTransfers,
|
|
947
|
+
hiddenCaptures: i._hiddenCaptures,
|
|
948
|
+
mode: "external"
|
|
949
|
+
}), o = g(_(a.pattern).pattern, {
|
|
950
|
+
captureTransfers: a.captureTransfers,
|
|
951
|
+
hiddenCaptures: a.hiddenCaptures
|
|
952
|
+
}), s = {
|
|
953
|
+
pattern: o.pattern,
|
|
954
|
+
flags: `${n.hasIndices ? "d" : ""}${n.global ? "g" : ""}${i.flags}${i.options.disable.v ? "u" : "v"}`
|
|
955
|
+
};
|
|
956
|
+
if (n.avoidSubclass) {
|
|
957
|
+
if (n.lazyCompileLength !== Infinity) throw Error("Lazy compilation requires subclass");
|
|
958
|
+
} else {
|
|
959
|
+
let e = o.hiddenCaptures.sort((e, t) => e - t), t = Array.from(o.captureTransfers), i = r._strategy, a = s.pattern.length >= n.lazyCompileLength;
|
|
960
|
+
(e.length || t.length || i || a) && (s.options = {
|
|
961
|
+
...e.length && { hiddenCaptures: e },
|
|
962
|
+
...t.length && { transfers: t },
|
|
963
|
+
...i && { strategy: i },
|
|
964
|
+
...a && { lazyCompile: a }
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
return s;
|
|
968
|
+
}
|
|
969
|
+
//#endregion
|
|
970
|
+
export { Q as EmulatedRegExp, Fe as toRegExp, $ as toRegExpDetails };
|