ompchamber 2.0.2 → 3.1.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/README.md +31 -11
- package/bunfig.toml +11 -0
- package/dist/client/index.html +16 -5
- package/dist/client/index.js +1393 -0
- package/dist/client/static/js/index-8t70jhyj.js +5149 -0
- package/dist/client/static/js/index-n4wkqj7t.css +1 -0
- package/index.html +54 -0
- package/package.json +9 -10
- package/public/apple-touch-icon.png +0 -0
- package/public/icon-192x192.png +0 -0
- package/public/icon.svg +60 -0
- package/public/manifest.webmanifest +38 -0
- package/src/cli/lib/commands/serve.js +9 -5
- package/src/cli/lib/runtime.js +18 -7
- package/src/client/components/common/code-editor/handler.test.ts +274 -0
- package/src/client/components/common/code-editor/handler.ts +175 -0
- package/src/client/components/common/code-editor/index.tsx +185 -220
- package/src/client/components/common/code-surface/index.tsx +109 -12
- package/src/client/components/common/lazy-panels.tsx +5 -1
- package/src/client/components/common/provider-icon/glyphs.ts +118 -0
- package/src/client/components/common/provider-icon/index.tsx +85 -0
- package/src/client/components/common/viewport.ts +5 -3
- package/src/client/components/layout/RightActivityBar.tsx +2 -1
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +21 -4
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +4 -0
- package/src/client/components/layout/desktop-layout/index.tsx +26 -4
- package/src/client/components/mobile/LayoutWrapper.tsx +16 -0
- package/src/client/components/mobile/RightSidebar.tsx +11 -4
- package/src/client/components/mobile/SessionSidebar.tsx +10 -0
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +0 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +16 -1
- package/src/client/components/mobile/mobile-session-sidebar/List.tsx +3 -0
- package/src/client/components/settings/categories/ProviderSettings.tsx +45 -4
- package/src/client/components/settings/categories/UsageSettings.tsx +22 -7
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +322 -0
- package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +152 -56
- package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +52 -1
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +133 -0
- package/src/client/components/settings/categories/provider-settings/DialectFields.tsx +136 -0
- package/src/client/components/settings/categories/provider-settings/EffortLadder.tsx +89 -0
- package/src/client/components/settings/categories/provider-settings/Header.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/ModelsList.tsx +22 -2
- package/src/client/components/settings/categories/provider-settings/PresetPicker.tsx +82 -0
- package/src/client/components/settings/categories/provider-settings/PriceFields.tsx +107 -0
- package/src/client/components/settings/categories/provider-settings/ReconnectModal.tsx +43 -22
- package/src/client/components/settings/categories/provider-settings/SidebarList.tsx +2 -2
- package/src/client/components/settings/categories/usage-settings/LimitsSection.tsx +115 -0
- package/src/client/components/settings/categories/usage-settings/ProviderCard.tsx +19 -26
- package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +29 -22
- package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +60 -48
- package/src/client/components/settings/categories/usage-settings/format.ts +36 -0
- package/src/client/components/settings/categories/usage-settings/providers.ts +52 -28
- package/src/client/components/workspace/browser-panel/AddressBar.tsx +1 -10
- package/src/client/components/workspace/browser-panel/Screencast.tsx +4 -5
- package/src/client/components/workspace/browser-panel/index.tsx +6 -6
- package/src/client/components/workspace/browser-toolbar/index.tsx +22 -12
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/ToolCallCard.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.tsx +1 -1
- package/src/client/components/workspace/diff-panel/Toolbar.tsx +71 -38
- package/src/client/components/workspace/diff-panel/index.tsx +139 -53
- package/src/client/components/workspace/editor/CommandPalette.test.ts +242 -0
- package/src/client/components/workspace/editor/CommandPalette.tsx +138 -0
- package/src/client/components/workspace/editor/FindWidget.test.ts +261 -0
- package/src/client/components/workspace/editor/FindWidget.tsx +219 -0
- package/src/client/components/workspace/editor/Tabs.tsx +2 -2
- package/src/client/components/workspace/editor/Toolbar.tsx +129 -26
- package/src/client/components/workspace/editor/index.tsx +180 -62
- package/src/client/components/workspace/file-explorer/Modals.tsx +79 -2
- package/src/client/components/workspace/file-explorer/TreeItem.tsx +43 -113
- package/src/client/components/workspace/model-dropdown/Item.tsx +13 -23
- package/src/client/components/workspace/model-dropdown/Panel.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/Section.tsx +13 -4
- package/src/client/components/workspace/model-dropdown/index.tsx +7 -3
- package/src/client/components/workspace/todo-panel/PhaseGroup.tsx +76 -0
- package/src/client/components/workspace/todo-panel/Row.tsx +69 -0
- package/src/client/components/workspace/todo-panel/index.tsx +161 -0
- package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +10 -5
- package/src/client/components/workspace/usage-panel/index.tsx +36 -18
- package/src/client/data/samples/dialogue-session.ts +1 -1
- package/src/client/data/samples/sample-tools/other.ts +1 -1
- package/src/client/data/settings/provider.ts +141 -9
- package/src/client/hooks/editor/find-harness.test-util.ts +170 -0
- package/src/client/hooks/editor/scroll-container.test.ts +102 -0
- package/src/client/hooks/editor/scroll-container.ts +26 -0
- package/src/client/hooks/editor/use-code-window.ts +2 -20
- package/src/client/hooks/editor/use-editor-find-write.test.ts +170 -0
- package/src/client/hooks/editor/use-editor-find.test.ts +118 -0
- package/src/client/hooks/editor/use-editor-find.ts +321 -0
- package/src/client/hooks/editor/use-editor-history.test.ts +216 -0
- package/src/client/hooks/editor/use-editor-history.ts +134 -0
- package/src/client/hooks/editor/use-file-editor.ts +24 -27
- package/src/client/hooks/editor/use-occurrences.test.ts +236 -0
- package/src/client/hooks/editor/use-occurrences.ts +98 -0
- package/src/client/hooks/models/use-provider-names.ts +1 -1
- package/src/client/hooks/settings/providers/actions.ts +337 -0
- package/src/client/hooks/settings/providers/api.ts +69 -0
- package/src/client/hooks/settings/providers/index.ts +138 -0
- package/src/client/hooks/settings/providers/messages.ts +77 -0
- package/src/client/hooks/settings/useUsageReport.ts +8 -3
- package/src/client/hooks/ui/theme.ts +3 -3
- package/src/client/hooks/workspace/file-tabs.ts +62 -11
- package/src/client/hooks/workspace/file-tree-actions.test.ts +348 -0
- package/src/client/hooks/workspace/file-tree-actions.ts +250 -0
- package/src/client/hooks/workspace/session-todos.ts +102 -0
- package/src/client/stubs/elkjs.ts +6 -1
- package/src/client/tailwind.css +30 -0
- package/src/server/index.ts +20 -2
- package/src/server/lib/assets/font-css.server.ts +86 -0
- package/src/server/lib/assets/fonts.server.ts +117 -0
- package/src/server/lib/bundler/css.ts +116 -0
- package/src/server/lib/lifecycle/shell-route.ts +17 -0
- package/src/server/lib/models/provider-listing.server.ts +257 -0
- package/src/server/lib/models/provider-registry.server.test.ts +122 -0
- package/src/server/lib/models/provider-registry.server.ts +76 -25
- package/src/server/lib/omp/config/models-config.ts +11 -0
- package/src/server/lib/omp/config/models-validation.test.ts +137 -0
- package/src/server/lib/omp/config/models-validation.ts +111 -2
- package/src/server/lib/omp/config/provider-seeds.test.ts +167 -0
- package/src/server/lib/omp/config/provider-seeds.ts +176 -0
- package/src/server/lib/omp/config/providers.ts +94 -100
- package/src/server/lib/omp/core/auth-credentials.ts +45 -0
- package/src/server/lib/omp/session/todos.ts +100 -0
- package/src/server/lib/omp/session/{usage.ts → usage/aggregate.ts} +1 -118
- package/src/server/lib/omp/session/usage/shaping.ts +130 -0
- package/src/server/lib/usage/deepseek.ts +4 -5
- package/src/server/lib/usage/kenari.ts +7 -6
- package/src/server/lib/usage/omp-usage.server.test.ts +126 -0
- package/src/server/lib/usage/omp-usage.server.ts +194 -0
- package/src/server/lib/usage/provider-key.ts +81 -3
- package/src/server/lib/usage/providers.server.test.ts +47 -0
- package/src/server/lib/usage/providers.server.ts +208 -0
- package/src/server/lib/usage/vendor-balance.server.test.ts +104 -0
- package/src/server/lib/usage/vendor-balance.server.ts +284 -0
- package/src/server/plugins/shell.server.ts +56 -0
- package/src/server/plugins/ssr.ts +24 -36
- package/src/server/plugins/static.test.ts +26 -29
- package/src/server/plugins/static.ts +40 -19
- package/src/server/routes/fs/action-create.test.ts +90 -0
- package/src/server/routes/fs/action.ts +23 -0
- package/src/server/routes/omp/index.ts +2 -0
- package/src/server/routes/omp/session-todos.ts +80 -0
- package/src/server/routes/settings/index.ts +2 -0
- package/src/server/routes/settings/provider-model.ts +107 -0
- package/src/server/routes/settings/provider-models.ts +65 -202
- package/src/server/routes/settings/providers.ts +22 -7
- package/src/server/routes/settings/usage.ts +125 -45
- package/src/server/routes/telemetry/tokens.ts +2 -1
- package/src/shared/lib/chat/{todo-parser.ts → todo/parser.ts} +17 -0
- package/src/shared/lib/chat/todo/progress.ts +97 -0
- package/src/shared/lib/chat/todo/snapshot.test.ts +156 -0
- package/src/shared/lib/chat/todo/snapshot.ts +215 -0
- package/src/shared/lib/code/editor/commands.test.ts +155 -0
- package/src/shared/lib/code/editor/commands.ts +260 -0
- package/src/shared/lib/code/editor/edits.test.ts +100 -0
- package/src/shared/lib/code/editor/edits.ts +122 -0
- package/src/shared/lib/code/editor/find-status.test.ts +50 -0
- package/src/shared/lib/code/editor/find-status.ts +36 -0
- package/src/shared/lib/code/editor/find.test.ts +203 -0
- package/src/shared/lib/code/editor/find.ts +224 -0
- package/src/{client/components/common/code-editor → shared/lib/code/editor}/history.test.ts +1 -1
- package/src/shared/lib/code/editor/keymap.test.ts +109 -0
- package/src/shared/lib/code/editor/keymap.ts +151 -0
- package/src/shared/lib/code/editor/layers.test.ts +77 -0
- package/src/shared/lib/code/editor/layers.ts +67 -0
- package/src/shared/lib/code/editor/line-edits.test.ts +131 -0
- package/src/shared/lib/code/editor/line-edits.ts +159 -0
- package/src/shared/lib/code/editor/lines.test.ts +81 -0
- package/src/shared/lib/code/editor/lines.ts +83 -0
- package/src/shared/lib/code/editor/marks.test.ts +86 -0
- package/src/shared/lib/code/editor/marks.ts +106 -0
- package/src/shared/lib/code/editor/occurrences.test.ts +117 -0
- package/src/shared/lib/code/editor/occurrences.ts +111 -0
- package/src/shared/lib/code/editor/palette.test.ts +91 -0
- package/src/shared/lib/code/editor/palette.ts +92 -0
- package/src/shared/lib/code/editor/reset-css.test.ts +35 -0
- package/src/shared/lib/code/editor/reset-css.ts +32 -0
- package/src/shared/lib/code/editor/text-commands.test.ts +178 -0
- package/src/shared/lib/code/editor/text-commands.ts +154 -0
- package/src/shared/lib/code/syntax-highlight.test.ts +75 -0
- package/src/shared/lib/code/syntax-highlight.ts +29 -17
- package/src/shared/lib/code/windowed-highlight.ts +52 -1
- package/src/shared/lib/fs/diff-parser.test.ts +116 -0
- package/src/shared/lib/fs/diff-parser.ts +86 -33
- package/src/shared/lib/models/{provider-connection.ts → provider/connection.ts} +37 -0
- package/src/shared/lib/models/provider/dialect.ts +179 -0
- package/src/shared/lib/models/provider/glyph.test.ts +116 -0
- package/src/shared/lib/models/provider/glyph.ts +200 -0
- package/src/shared/lib/models/{provider-models.ts → provider/models.ts} +91 -6
- package/src/shared/lib/models/provider/presets.test.ts +172 -0
- package/src/shared/lib/models/provider/presets.ts +83 -0
- package/src/shared/lib/ui/key-binding.test.ts +115 -0
- package/src/shared/lib/ui/key-binding.ts +143 -0
- package/src/shared/lib/util/platform.test.ts +87 -0
- package/src/shared/lib/util/platform.ts +30 -0
- package/src/shared/lib/workspace/file-tab-id.ts +29 -0
- package/src/shared/lib/workspace/keymap.test.ts +82 -0
- package/src/shared/lib/workspace/keymap.ts +30 -0
- package/src/shared/lib/workspace/refresh-cadence.ts +9 -0
- package/src/shared/lib/workspace/right-panels.ts +8 -0
- package/src/shared/lib/workspace/session-state/store.ts +0 -1
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/settings/provider.ts +81 -0
- package/src/shared/types/settings/usage.ts +88 -14
- package/src/shared/types/todo.ts +108 -0
- package/tsconfig.json +3 -1
- package/dist/client/static/css/index.5f630421b7.css +0 -2
- package/dist/client/static/font/KaTeX_AMS-Regular.a79f1c3119.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Bold.ec17d13264.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Regular.55fac25845.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Bold.d42a5579b0.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Regular.d3c882a649.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Main-Bold.c3fb5ac22f.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Main-BoldItalic.6f2bb1dff2.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Main-Italic.8916142bec.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Main-Regular.0462f03bdf.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Math-BoldItalic.572d331f69.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Math-Italic.f28c23acad.woff2 +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Bold.8c5b5494b6.woff2 +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Italic.3b1e59b3ba.woff2 +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Regular.ba21ed5f84.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Script-Regular.03e9641d6f.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Size1-Regular.eae34984b3.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Size2-Regular.5916a24fa3.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Size4-Regular.10d95fd3a2.woff2 +0 -0
- package/dist/client/static/font/KaTeX_Typewriter-Regular.a8709e3622.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-400-normal.2655b10c55.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-500-normal.92a991f204.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-600-normal.43788eb7f1.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-700-normal.2667215d33.woff2 +0 -0
- package/dist/client/static/js/77.0d81c74cf0.js +0 -139
- package/dist/client/static/js/77.0d81c74cf0.js.LICENSE.txt +0 -8
- package/dist/client/static/js/async/0.8e59f2eb5b.js +0 -1
- package/dist/client/static/js/async/0k.5852e6b4fa.js +0 -1
- package/dist/client/static/js/async/0w.9ed36d5860.js +0 -1
- package/dist/client/static/js/async/1.f387c12b63.js +0 -1
- package/dist/client/static/js/async/12.d091f91c99.js +0 -1
- package/dist/client/static/js/async/13.8f810a8a6c.js +0 -1
- package/dist/client/static/js/async/19.6fe909d55a.js +0 -160
- package/dist/client/static/js/async/1b.23f1141a38.js +0 -1
- package/dist/client/static/js/async/1k.973e8e21fc.js +0 -2
- package/dist/client/static/js/async/1k.973e8e21fc.js.LICENSE.txt +0 -11
- package/dist/client/static/js/async/1p.0d5cddda96.js +0 -1
- package/dist/client/static/js/async/2.b589f1733b.js +0 -1
- package/dist/client/static/js/async/2v.96165101de.js +0 -1
- package/dist/client/static/js/async/3.0cacc08423.js +0 -1
- package/dist/client/static/js/async/37.b28b2f61cd.js +0 -1
- package/dist/client/static/js/async/3d.5085fb913f.js +0 -1
- package/dist/client/static/js/async/3j.357c80ff38.js +0 -2
- package/dist/client/static/js/async/3j.357c80ff38.js.LICENSE.txt +0 -11
- package/dist/client/static/js/async/3p.bcf32a0983.js +0 -1
- package/dist/client/static/js/async/3r.3a69e98ee0.js +0 -64
- package/dist/client/static/js/async/3u.1228460e2a.js +0 -1
- package/dist/client/static/js/async/3y.3530b824ad.js +0 -198
- package/dist/client/static/js/async/3y.3530b824ad.js.LICENSE.txt +0 -5
- package/dist/client/static/js/async/4.9442eeb472.js +0 -1
- package/dist/client/static/js/async/4e.678285ca55.js +0 -1
- package/dist/client/static/js/async/4k.33a0c7eeb4.js +0 -1
- package/dist/client/static/js/async/4m.928a1dde85.js +0 -31
- package/dist/client/static/js/async/4m.928a1dde85.js.LICENSE.txt +0 -11
- package/dist/client/static/js/async/4q.aad20dab25.js +0 -1
- package/dist/client/static/js/async/5.ebaf8b89cc.js +0 -36
- package/dist/client/static/js/async/51.95bcae98af.js +0 -2
- package/dist/client/static/js/async/51.95bcae98af.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/5b.d88304bc13.js +0 -1
- package/dist/client/static/js/async/5j.d6407c4248.js +0 -287
- package/dist/client/static/js/async/5o.88316d4460.js +0 -62
- package/dist/client/static/js/async/6.f034c9b528.js +0 -1
- package/dist/client/static/js/async/66.5dfa29f957.js +0 -93
- package/dist/client/static/js/async/6o.5b1a06a382.js +0 -1
- package/dist/client/static/js/async/7.e4a9288dd0.js +0 -1
- package/dist/client/static/js/async/73.308dff4da8.js +0 -1
- package/dist/client/static/js/async/7e.a1cc9bfd88.js +0 -1
- package/dist/client/static/js/async/7g.a7814350c3.js +0 -1
- package/dist/client/static/js/async/7l.fadbbc0583.js +0 -1
- package/dist/client/static/js/async/8.5067439d8c.js +0 -1
- package/dist/client/static/js/async/8j.ea110663fb.js +0 -1
- package/dist/client/static/js/async/a.bce4542392.js +0 -1
- package/dist/client/static/js/async/aa.65d3852576.js +0 -1
- package/dist/client/static/js/async/ar.9303e5f2e8.js +0 -2
- package/dist/client/static/js/async/ar.9303e5f2e8.js.LICENSE.txt +0 -11
- package/dist/client/static/js/async/az.d656062b0f.js +0 -1
- package/dist/client/static/js/async/b.b4f6f06515.js +0 -1
- package/dist/client/static/js/async/bi.09688ba75c.js +0 -1
- package/dist/client/static/js/async/bq.586bc738d1.js +0 -1
- package/dist/client/static/js/async/c.797d933882.js +0 -1
- package/dist/client/static/js/async/c0.0af1e640d3.js +0 -24
- package/dist/client/static/js/async/ca.8a52cfd447.js +0 -1
- package/dist/client/static/js/async/cf.d34fff5d67.js +0 -1
- package/dist/client/static/js/async/ct.b74928f7a3.js +0 -1
- package/dist/client/static/js/async/cx.3cb0242a3a.js +0 -226
- package/dist/client/static/js/async/d.a5fc8fe1b3.js +0 -1
- package/dist/client/static/js/async/da.f62c70f6c8.js +0 -1
- package/dist/client/static/js/async/dp.1725d6432c.js +0 -1
- package/dist/client/static/js/async/e.93214d622b.js +0 -79
- package/dist/client/static/js/async/f.ab50467719.js +0 -19
- package/dist/client/static/js/async/f.ab50467719.js.LICENSE.txt +0 -12
- package/dist/client/static/js/async/f7.46971e9d6d.js +0 -2
- package/dist/client/static/js/async/f7.46971e9d6d.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/f8.bbf0dbae70.js +0 -1
- package/dist/client/static/js/async/g.cb81980498.js +0 -2
- package/dist/client/static/js/async/g.cb81980498.js.LICENSE.txt +0 -11
- package/dist/client/static/js/async/h.4e790471e4.js +0 -27
- package/dist/client/static/js/async/h1.393f066d09.js +0 -1
- package/dist/client/static/js/async/h3.216e9798ab.js +0 -148
- package/dist/client/static/js/async/hd.0da931b622.js +0 -1
- package/dist/client/static/js/async/hk.ba7fb04d41.js +0 -1
- package/dist/client/static/js/async/hn.b645041e00.js +0 -1
- package/dist/client/static/js/async/ho.475a5e1ae4.js +0 -1
- package/dist/client/static/js/async/hp.e9fe2e395a.js +0 -2
- package/dist/client/static/js/async/hp.e9fe2e395a.js.LICENSE.txt +0 -17
- package/dist/client/static/js/async/hs.e7c59d8090.js +0 -41
- package/dist/client/static/js/async/i.7c148e8440.js +0 -1
- package/dist/client/static/js/async/id.573df20f29.js +0 -1
- package/dist/client/static/js/async/j.ab925882d8.js +0 -1
- package/dist/client/static/js/async/jd.63886a1f09.js +0 -1
- package/dist/client/static/js/async/jg.d86ebd4013.js +0 -86
- package/dist/client/static/js/async/jl.874d352278.js +0 -1
- package/dist/client/static/js/async/jll.11313b455a.js +0 -1
- package/dist/client/static/js/async/js.67182759ef.js +0 -1
- package/dist/client/static/js/async/jsc.23b70d6f40.js +0 -1
- package/dist/client/static/js/async/jse.334588ff5d.js +0 -1
- package/dist/client/static/js/async/jz.72eb929106.js +0 -77
- package/dist/client/static/js/async/k.3210286401.js +0 -217
- package/dist/client/static/js/async/ka.c1990ecaa3.js +0 -115
- package/dist/client/static/js/async/katex-vendor.de6a87c308.js +0 -1
- package/dist/client/static/js/async/ku.29c8a59d0c.js +0 -1
- package/dist/client/static/js/async/ky.8dab1dade0.js +0 -1
- package/dist/client/static/js/async/l.12dd34e1be.js +0 -1
- package/dist/client/static/js/async/l9.949710adaf.js +0 -83
- package/dist/client/static/js/async/l9.949710adaf.js.LICENSE.txt +0 -13
- package/dist/client/static/js/async/ls.9d9a01026c.js +0 -104
- package/dist/client/static/js/async/m.eb2e6752e2.js +0 -28
- package/dist/client/static/js/async/m.eb2e6752e2.js.LICENSE.txt +0 -11
- package/dist/client/static/js/async/m3.d2b05f9604.js +0 -2
- package/dist/client/static/js/async/m3.d2b05f9604.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/ma.2c261b04dd.js +0 -2
- package/dist/client/static/js/async/ma.2c261b04dd.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/me.8ace414f80.js +0 -23
- package/dist/client/static/js/async/ms.98960af4eb.js +0 -67
- package/dist/client/static/js/async/ms.98960af4eb.js.LICENSE.txt +0 -12
- package/dist/client/static/js/async/mt.0352e976d8.js +0 -1
- package/dist/client/static/js/async/n.a9f1c51701.js +0 -1
- package/dist/client/static/js/async/na.a36cd532d6.js +0 -1
- package/dist/client/static/js/async/nk.fc7e58325e.js +0 -1
- package/dist/client/static/js/async/o.36353dfb88.js +0 -1
- package/dist/client/static/js/async/oc.b73042e8bd.js +0 -8
- package/dist/client/static/js/async/og.8eb577893a.js +0 -193
- package/dist/client/static/js/async/p.48ecfcd14e.js +0 -1
- package/dist/client/static/js/async/px.fc6877924b.js +0 -1
- package/dist/client/static/js/async/q.22588845a9.js +0 -21
- package/dist/client/static/js/async/q.22588845a9.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/q5.97dc1481b6.js +0 -286
- package/dist/client/static/js/async/qs.2a9ddb3c72.js +0 -1
- package/dist/client/static/js/async/r.51010ad87c.js +0 -1
- package/dist/client/static/js/async/rd.cb6bf495bb.js +0 -2
- package/dist/client/static/js/async/rd.cb6bf495bb.js.LICENSE.txt +0 -4
- package/dist/client/static/js/async/s.0f395cdda5.js +0 -94
- package/dist/client/static/js/async/t.4dca0e2ba8.js +0 -1
- package/dist/client/static/js/async/t9.d44f57d518.js +0 -1
- package/dist/client/static/js/async/ta.973534bbec.js +0 -1
- package/dist/client/static/js/async/tr.e878658140.js +0 -309
- package/dist/client/static/js/async/u.0871ac5b22.js +0 -1
- package/dist/client/static/js/async/ud.3065bfee31.js +0 -2
- package/dist/client/static/js/async/ud.3065bfee31.js.LICENSE.txt +0 -4
- package/dist/client/static/js/async/up.ea990da0ff.js +0 -32
- package/dist/client/static/js/async/uw.8890abbabc.js +0 -1
- package/dist/client/static/js/async/v.7d28d3c241.js +0 -34
- package/dist/client/static/js/async/vp.9b13bf8610.js +0 -1
- package/dist/client/static/js/async/vt.42416b707d.js +0 -1
- package/dist/client/static/js/async/w.08ac210f60.js +0 -1
- package/dist/client/static/js/async/wt.ad92393a90.js +0 -1
- package/dist/client/static/js/async/x.563f72ca6b.js +0 -1
- package/dist/client/static/js/async/x0.475516418f.js +0 -1
- package/dist/client/static/js/async/x1.da8687159b.js +0 -90
- package/dist/client/static/js/async/xe.da8dcc2015.js +0 -2
- package/dist/client/static/js/async/xe.da8dcc2015.js.LICENSE.txt +0 -11
- package/dist/client/static/js/async/xl.a3c562a58c.js +0 -1
- package/dist/client/static/js/async/xn.6510c0abe2.js +0 -2
- package/dist/client/static/js/async/xn.6510c0abe2.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/xn1.83a7784fe1.js +0 -10
- package/dist/client/static/js/async/xn1.83a7784fe1.js.LICENSE.txt +0 -11
- package/dist/client/static/js/async/xnl.feb0021e50.js +0 -2
- package/dist/client/static/js/async/xnl.feb0021e50.js.LICENSE.txt +0 -12
- package/dist/client/static/js/async/y.1a9ed7a5d8.js +0 -1
- package/dist/client/static/js/async/y6.43c57defe4.js +0 -1
- package/dist/client/static/js/async/yb.8c1342401d.js +0 -1
- package/dist/client/static/js/async/ybq.4491f2f2dc.js +0 -1
- package/dist/client/static/js/async/yg.35bebd6d0c.js +0 -149
- package/dist/client/static/js/async/yq.917ddd7ba2.js +0 -1
- package/dist/client/static/js/async/ys.00687cf82d.js +0 -38
- package/dist/client/static/js/async/yv.d99d829136.js +0 -1
- package/dist/client/static/js/async/z.56f61a4374.js +0 -1
- package/dist/client/static/js/async/zi.5fdb07b86a.js +0 -24
- package/dist/client/static/js/async/zj.654f37e8ff.js +0 -1
- package/dist/client/static/js/async/zn.966d6f1cc6.js +0 -1
- package/dist/client/static/js/async/zo.26213b40c0.js +0 -1
- package/dist/client/static/js/async/zx.e9f4105e00.js +0 -1
- package/dist/client/static/js/index.e6a257402a.js +0 -38
- package/dist/client/static/js/index.e6a257402a.js.LICENSE.txt +0 -4
- package/dist/client/static/js/markdown-vendor.71e43278b3.js +0 -144
- package/dist/client/static/js/shiki-vendor.cb8452ddcd.js +0 -1
- package/src/client/components/settings/categories/provider-settings/Icons.tsx +0 -35
- package/src/client/hooks/settings/providers.ts +0 -326
- package/src/server/plugins/dev-assets.ts +0 -49
- package/src/shared/lib/code/editor-utils.ts +0 -16
- package/src/shared/lib/models/provider-presets.ts +0 -29
- /package/dist/client/{apple-touch-icon.png → static/apple-touch-icon-dskx5sr3.png} +0 -0
- /package/dist/client/{icon-192x192.png → static/icon-192x192-6gn5cr2f.png} +0 -0
- /package/dist/client/{icon.svg → static/icon-d07z9dtz.svg} +0 -0
- /package/dist/client/{manifest.webmanifest → static/manifest-bnyy75kt.webmanifest} +0 -0
- /package/{dist/client → public}/icon-512x512.png +0 -0
- /package/{dist/client → public}/icon-maskable-512x512.png +0 -0
- /package/{dist/client → public}/sw.js +0 -0
- /package/src/{client/components/common/code-editor → shared/lib/code/editor}/history.ts +0 -0
- /package/src/shared/lib/models/{provider-cleanup.ts → provider/cleanup.ts} +0 -0
- /package/src/shared/lib/models/{provider-label.ts → provider/label.ts} +0 -0
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["tr"],{WJ(e,t,n){var r=n("Yr"),i=n("M4"),s=n("Gt"),a=(0,s.K)((e,t,n,s)=>{e.attr("class",n);let{width:a,height:c,x:h,y:u}=o(e,t);(0,r.a$)(e,c,a,s);let d=l(h,u,a,c,t);e.attr("viewBox",d),i.R.debug(`viewBox configured: ${d} with padding: ${t}`)},"setupViewPortForSVG"),o=(0,s.K)((e,t)=>{let n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+2*t,height:n.height+2*t,x:n.x,y:n.y}},"calculateDimensionsWithPadding"),l=(0,s.K)((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,"createViewBox");n.d(t,{P:()=>a})},OT(e,t,n){var r=n("Gt"),i=n("El"),s=(0,r.K)((e,t)=>{let n;return"sandbox"===t&&(n=(0,i.Ltv)("#i"+e)),("sandbox"===t?(0,i.Ltv)(n.nodes()[0].contentDocument.body):(0,i.Ltv)("body")).select(`[id="${e}"]`)},"getDiagramElement");n.d(t,{A:()=>s})},Hk(e,t,n){n.d(t,{diagram:()=>uB});var r,i,s,a,o,l,c,h,u,d,p,f,m,y,g,T,E,A,b,S,L,v,O,R,k,N,_,I,C=n("OT"),x=n("WJ"),w=n("mW");n("Q"),n("ix"),n("LC"),n("bQ"),n("Ut"),n("PF");var U=n("iV");n("h5");var M=n("pK"),P=n("NH"),D=n("Yr"),$=n("M4"),j=n("Gt"),F=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},B=function(e,t,n){for(var r=-1,i=Object(e),s=n(e),a=s.length;a--;){var o=s[++r];if(!1===t(i[o],o,i))break}return e},K=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},G="object"==typeof global&&global&&global.Object===Object&&global,W="object"==typeof self&&self&&self.Object===Object&&self,z=G||W||Function("return this")(),V=z.Symbol,H=Object.prototype,Y=H.hasOwnProperty,X=H.toString,J=V?V.toStringTag:void 0,q=function(e){var t=Y.call(e,J),n=e[J];try{e[J]=void 0;var r=!0}catch(e){}var i=X.call(e);return r&&(t?e[J]=n:delete e[J]),i},Z=Object.prototype.toString,Q=V?V.toStringTag:void 0,ee=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Q&&Q in Object(e)?q(e):Z.call(e)},et=function(e){return null!=e&&"object"==typeof e},en=function(e){return et(e)&&"[object Arguments]"==ee(e)},er=Object.prototype,ei=er.hasOwnProperty,es=er.propertyIsEnumerable,ea=en(function(){return arguments}())?en:function(e){return et(e)&&ei.call(e,"callee")&&!es.call(e,"callee")},eo=Array.isArray,el="object"==typeof exports&&exports&&!exports.nodeType&&exports,ec=el&&"object"==typeof module&&module&&!module.nodeType&&module,eh=ec&&ec.exports===el?z.Buffer:void 0,eu=(eh?eh.isBuffer:void 0)||function(){return!1},ed=/^(?:0|[1-9]\d*)$/,ep=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&ed.test(e))&&e>-1&&e%1==0&&e<t},ef=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff},em={};em["[object Float32Array]"]=em["[object Float64Array]"]=em["[object Int8Array]"]=em["[object Int16Array]"]=em["[object Int32Array]"]=em["[object Uint8Array]"]=em["[object Uint8ClampedArray]"]=em["[object Uint16Array]"]=em["[object Uint32Array]"]=!0,em["[object Arguments]"]=em["[object Array]"]=em["[object ArrayBuffer]"]=em["[object Boolean]"]=em["[object DataView]"]=em["[object Date]"]=em["[object Error]"]=em["[object Function]"]=em["[object Map]"]=em["[object Number]"]=em["[object Object]"]=em["[object RegExp]"]=em["[object Set]"]=em["[object String]"]=em["[object WeakMap]"]=!1;var ey=function(e){return function(t){return e(t)}},eg="object"==typeof exports&&exports&&!exports.nodeType&&exports,eT=eg&&"object"==typeof module&&module&&!module.nodeType&&module,eE=eT&&eT.exports===eg&&G.process,eA=function(){try{var e=eT&&eT.require&&eT.require("util").types;if(e)return e;return eE&&eE.binding&&eE.binding("util")}catch(e){}}(),eb=eA&&eA.isTypedArray,eS=eb?ey(eb):function(e){return et(e)&&ef(e.length)&&!!em[ee(e)]},eL=Object.prototype.hasOwnProperty,ev=function(e,t){var n=eo(e),r=!n&&ea(e),i=!n&&!r&&eu(e),s=!n&&!r&&!i&&eS(e),a=n||r||i||s,o=a?K(e.length,String):[],l=o.length;for(var c in e)(t||eL.call(e,c))&&!(a&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ep(c,l)))&&o.push(c);return o},eO=Object.prototype,eR=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||eO)},ek=function(e,t){return function(n){return e(t(n))}},eN=ek(Object.keys,Object),e_=Object.prototype.hasOwnProperty,eI=function(e){if(!eR(e))return eN(e);var t=[];for(var n in Object(e))e_.call(e,n)&&"constructor"!=n&&t.push(n);return t},eC=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ex=function(e){if(!eC(e))return!1;var t=ee(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ew=function(e){return null!=e&&ef(e.length)&&!ex(e)},eU=function(e){return ew(e)?ev(e):eI(e)},eM=(s=function(e,t){return e&&B(e,t,eU)},function(e,t){if(null==e)return e;if(!ew(e))return s(e,t);for(var n=e.length,r=-1,i=Object(e);++r<n&&!1!==t(i[r],r,i););return e}),eP=function(e){return e},eD=function(e,t){return(eo(e)?F:eM)(e,"function"==typeof t?t:eP)},e$=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},ej=function(e){return null==e?[]:e$(eU(e),function(t){return e[t]})},eF=z["__core-js_shared__"],eB=(a=/[^.]+$/.exec(eF&&eF.keys&&eF.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"",eK=Function.prototype.toString,eG=function(e){if(null!=e){try{return eK.call(e)}catch(e){}try{return e+""}catch(e){}}return""},eW=/^\[object .+?Constructor\]$/,ez=Object.prototype,eV=Function.prototype.toString,eH=ez.hasOwnProperty,eY=RegExp("^"+eV.call(eH).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eX=function(e){return!!eC(e)&&(!eB||!(eB in e))&&(ex(e)?eY:eW).test(eG(e))},eJ=function(e,t){var n=null==e?void 0:e[t];return eX(n)?n:void 0},eq=eJ(z,"DataView"),eZ=eJ(z,"Map"),eQ=eJ(z,"Promise"),e0=eJ(z,"Set"),e1=eJ(z,"WeakMap"),e2="[object Map]",e3="[object Promise]",e6="[object Set]",e5="[object WeakMap]",e4="[object DataView]",e8=eG(eq),e9=eG(eZ),e7=eG(eQ),te=eG(e0),tt=eG(e1),tn=ee;(eq&&tn(new eq(new ArrayBuffer(1)))!=e4||eZ&&tn(new eZ)!=e2||eQ&&tn(eQ.resolve())!=e3||e0&&tn(new e0)!=e6||e1&&tn(new e1)!=e5)&&(tn=function(e){var t=ee(e),n="[object Object]"==t?e.constructor:void 0,r=n?eG(n):"";if(r)switch(r){case e8:return e4;case e9:return e2;case e7:return e3;case te:return e6;case tt:return e5}return t});var tr=tn,ti=Object.prototype.hasOwnProperty,ts=function(e){if(null==e)return!0;if(ew(e)&&(eo(e)||"string"==typeof e||"function"==typeof e.splice||eu(e)||eS(e)||ea(e)))return!e.length;var t=tr(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(eR(e))return!eI(e).length;for(var n in e)if(ti.call(e,n))return!1;return!0},ta=function(e,t){return e===t||e!=e&&t!=t},to=function(e,t){for(var n=e.length;n--;)if(ta(e[n][0],t))return n;return -1},tl=Array.prototype.splice;function tc(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tc.prototype.clear=function(){this.__data__=[],this.size=0},tc.prototype.delete=function(e){var t=this.__data__,n=to(t,e);return!(n<0)&&(n==t.length-1?t.pop():tl.call(t,n,1),--this.size,!0)},tc.prototype.get=function(e){var t=this.__data__,n=to(t,e);return n<0?void 0:t[n][1]},tc.prototype.has=function(e){return to(this.__data__,e)>-1},tc.prototype.set=function(e,t){var n=this.__data__,r=to(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var th=eJ(Object,"create"),tu=Object.prototype.hasOwnProperty,td=Object.prototype.hasOwnProperty;function tp(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tp.prototype.clear=function(){this.__data__=th?th(null):{},this.size=0},tp.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},tp.prototype.get=function(e){var t=this.__data__;if(th){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return tu.call(t,e)?t[e]:void 0},tp.prototype.has=function(e){var t=this.__data__;return th?void 0!==t[e]:td.call(t,e)},tp.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=th&&void 0===t?"__lodash_hash_undefined__":t,this};var tf=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},tm=function(e,t){var n=e.__data__;return tf(t)?n["string"==typeof t?"string":"hash"]:n.map};function ty(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function tg(e){var t=this.__data__=new tc(e);this.size=t.size}function tT(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ty;++t<n;)this.add(e[t])}ty.prototype.clear=function(){this.size=0,this.__data__={hash:new tp,map:new(eZ||tc),string:new tp}},ty.prototype.delete=function(e){var t=tm(this,e).delete(e);return this.size-=!!t,t},ty.prototype.get=function(e){return tm(this,e).get(e)},ty.prototype.has=function(e){return tm(this,e).has(e)},ty.prototype.set=function(e,t){var n=tm(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},tg.prototype.clear=function(){this.__data__=new tc,this.size=0},tg.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},tg.prototype.get=function(e){return this.__data__.get(e)},tg.prototype.has=function(e){return this.__data__.has(e)},tg.prototype.set=function(e,t){var n=this.__data__;if(n instanceof tc){var r=n.__data__;if(!eZ||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ty(r)}return n.set(e,t),this.size=n.size,this},tT.prototype.add=tT.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},tT.prototype.has=function(e){return this.__data__.has(e)};var tE=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},tA=function(e,t){return e.has(t)},tb=function(e,t,n,r,i,s){var a=1&n,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var u=-1,d=!0,p=2&n?new tT:void 0;for(s.set(e,t),s.set(t,e);++u<o;){var f=e[u],m=t[u];if(r)var y=a?r(m,f,u,t,e,s):r(f,m,u,e,t,s);if(void 0!==y){if(y)continue;d=!1;break}if(p){if(!tE(t,function(e,t){if(!tA(p,t)&&(f===e||i(f,e,n,r,s)))return p.push(t)})){d=!1;break}}else if(!(f===m||i(f,m,n,r,s))){d=!1;break}}return s.delete(e),s.delete(t),d},tS=z.Uint8Array,tL=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},tv=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},tO=V?V.prototype:void 0,tR=tO?tO.valueOf:void 0,tk=function(e,t,n,r,i,s,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!s(new tS(e),new tS(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return ta(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=tL;case"[object Set]":var l=1&r;if(o||(o=tv),e.size!=t.size&&!l)break;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var h=tb(o(e),o(t),r,i,s,a);return a.delete(e),h;case"[object Symbol]":if(tR)return tR.call(e)==tR.call(t)}return!1},tN=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},t_=function(e,t,n){var r=t(e);return eo(e)?r:tN(r,n(e))},tI=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s},tC=function(){return[]},tx=Object.prototype.propertyIsEnumerable,tw=Object.getOwnPropertySymbols,tU=tw?function(e){return null==e?[]:tI(tw(e=Object(e)),function(t){return tx.call(e,t)})}:tC,tM=function(e){return t_(e,eU,tU)},tP=Object.prototype.hasOwnProperty,tD=function(e,t,n,r,i,s){var a=1&n,o=tM(e),l=o.length;if(l!=tM(t).length&&!a)return!1;for(var c=l;c--;){var h=o[c];if(!(a?h in t:tP.call(t,h)))return!1}var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var f=a;++c<l;){var m=e[h=o[c]],y=t[h];if(r)var g=a?r(y,m,h,t,e,s):r(m,y,h,e,t,s);if(!(void 0===g?m===y||i(m,y,n,r,s):g)){p=!1;break}f||(f="constructor"==h)}if(p&&!f){var T=e.constructor,E=t.constructor;T!=E&&"constructor"in e&&"constructor"in t&&!("function"==typeof T&&T instanceof T&&"function"==typeof E&&E instanceof E)&&(p=!1)}return s.delete(e),s.delete(t),p},t$="[object Arguments]",tj="[object Array]",tF="[object Object]",tB=Object.prototype.hasOwnProperty,tK=function(e,t,n,r,i,s){var a=eo(e),o=eo(t),l=a?tj:tr(e),c=o?tj:tr(t);l=l==t$?tF:l,c=c==t$?tF:c;var h=l==tF,u=c==tF,d=l==c;if(d&&eu(e)){if(!eu(t))return!1;a=!0,h=!1}if(d&&!h)return s||(s=new tg),a||eS(e)?tb(e,t,n,r,i,s):tk(e,t,l,n,r,i,s);if(!(1&n)){var p=h&&tB.call(e,"__wrapped__"),f=u&&tB.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,y=f?t.value():t;return s||(s=new tg),i(m,y,n,r,s)}}return!!d&&(s||(s=new tg),tD(e,t,n,r,i,s))},tG=function e(t,n,r,i,s){return t===n||(null!=t&&null!=n&&(et(t)||et(n))?tK(t,n,r,i,e,s):t!=t&&n!=n)},tW=function(e,t,n,r){var i=n.length,s=i,a=!r;if(null==e)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){var l=(o=n[i])[0],c=e[l],h=o[1];if(a&&o[2]){if(void 0===c&&!(l in e))return!1}else{var u=new tg;if(r)var d=r(c,h,l,e,t,u);if(!(void 0===d?tG(h,c,3,r,u):d))return!1}}return!0},tz=function(e){return e==e&&!eC(e)},tV=function(e){for(var t=eU(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,tz(i)]}return t},tH=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},tY=function(e){var t=tV(e);return 1==t.length&&t[0][2]?tH(t[0][0],t[0][1]):function(n){return n===e||tW(n,e,t)}},tX=function(e){return"symbol"==typeof e||et(e)&&"[object Symbol]"==ee(e)},tJ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tq=/^\w*$/,tZ=function(e,t){if(eo(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||tX(e))||tq.test(e)||!tJ.test(e)||null!=t&&e in Object(t)};function tQ(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(tQ.Cache||ty),n}tQ.Cache=ty;var t0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t1=/\\(\\)?/g,t2=(l=(o=tQ(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(t0,function(e,n,r,i){t.push(r?i.replace(t1,"$1"):n||e)}),t},function(e){return 500===l.size&&l.clear(),e})).cache,o),t3=V?V.prototype:void 0,t6=t3?t3.toString:void 0,t5=function e(t){if("string"==typeof t)return t;if(eo(t))return e$(t,e)+"";if(tX(t))return t6?t6.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},t4=function(e,t){return eo(e)?e:tZ(e,t)?[e]:t2(null==e?"":t5(e))},t8=function(e){if("string"==typeof e||tX(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},t9=function(e,t){t=t4(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[t8(t[n++])];return n&&n==r?e:void 0},t7=function(e,t,n){var r=null==e?void 0:t9(e,t);return void 0===r?n:r},ne=function(e,t){return null!=e&&t in Object(e)},nt=function(e,t,n){t=t4(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=t8(t[r]);if(!(s=null!=e&&n(e,a)))break;e=e[a]}return s||++r!=i?s:!!(i=null==e?0:e.length)&&ef(i)&&ep(a,i)&&(eo(e)||ea(e))},nn=function(e){var t;return tZ(e)?(t=t8(e),function(e){return null==e?void 0:e[t]}):function(t){return t9(t,e)}},nr=function(e){if("function"==typeof e)return e;if(null==e)return eP;if("object"==typeof e){var t,n;return eo(e)?(t=e[0],n=e[1],tZ(t)&&tz(n)?tH(t8(t),n):function(e){var r=t7(e,t);return void 0===r&&r===n?null!=e&&nt(e,t,ne):tG(n,r,3)}):tY(e)}return nn(e)},ni=function(e,t){var n=-1,r=ew(e)?Array(e.length):[];return eM(e,function(e,i,s){r[++n]=t(e,i,s)}),r},ns=function(e,t){return(eo(e)?e$:ni)(e,nr(t))},na=Object.prototype.hasOwnProperty,no=function(e,t){return null!=e&&na.call(e,t)},nl=function(e,t){return null!=e&&nt(e,t,no)},nc=function(){try{var e=eJ(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),nh=function(e,t,n){"__proto__"==t&&nc?nc(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},nu=Object.prototype.hasOwnProperty,nd=function(e,t,n){var r=e[t];nu.call(e,t)&&ta(r,n)&&(void 0!==n||t in e)||nh(e,t,n)},np=function(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;void 0===l&&(l=e[o]),i?nh(n,o,l):nd(n,o,l)}return n},nf=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},nm=Object.prototype.hasOwnProperty,ny=function(e){if(!eC(e))return nf(e);var t=eR(e),n=[];for(var r in e)"constructor"==r&&(t||!nm.call(e,r))||n.push(r);return n},ng=function(e){return ew(e)?ev(e,!0):ny(e)},nT="object"==typeof exports&&exports&&!exports.nodeType&&exports,nE=nT&&"object"==typeof module&&module&&!module.nodeType&&module,nA=nE&&nE.exports===nT?z.Buffer:void 0,nb=nA?nA.allocUnsafe:void 0,nS=function(e,t){if(t)return e.slice();var n=e.length,r=nb?nb(n):new e.constructor(n);return e.copy(r),r},nL=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},nv=ek(Object.getPrototypeOf,Object),nO=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)tN(t,tU(e)),e=nv(e);return t}:tC,nR=function(e){return t_(e,ng,nO)},nk=Object.prototype.hasOwnProperty,nN=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&nk.call(e,"index")&&(n.index=e.index,n.input=e.input),n},n_=function(e){var t=new e.constructor(e.byteLength);return new tS(t).set(new tS(e)),t},nI=function(e,t){var n=t?n_(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},nC=/\w*$/,nx=function(e){var t=new e.constructor(e.source,nC.exec(e));return t.lastIndex=e.lastIndex,t},nw=V?V.prototype:void 0,nU=nw?nw.valueOf:void 0,nM=function(e,t){var n=t?n_(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},nP=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return n_(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return nI(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return nM(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return nx(e);case"[object Symbol]":return nU?Object(nU.call(e)):{}}},nD=Object.create,n$=function(){function e(){}return function(t){if(!eC(t))return{};if(nD)return nD(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),nj=eA&&eA.isMap,nF=nj?ey(nj):function(e){return et(e)&&"[object Map]"==tr(e)},nB=eA&&eA.isSet,nK=nB?ey(nB):function(e){return et(e)&&"[object Set]"==tr(e)},nG="[object Arguments]",nW="[object Function]",nz="[object Object]",nV={};nV[nG]=nV["[object Array]"]=nV["[object ArrayBuffer]"]=nV["[object DataView]"]=nV["[object Boolean]"]=nV["[object Date]"]=nV["[object Float32Array]"]=nV["[object Float64Array]"]=nV["[object Int8Array]"]=nV["[object Int16Array]"]=nV["[object Int32Array]"]=nV["[object Map]"]=nV["[object Number]"]=nV[nz]=nV["[object RegExp]"]=nV["[object Set]"]=nV["[object String]"]=nV["[object Symbol]"]=nV["[object Uint8Array]"]=nV["[object Uint8ClampedArray]"]=nV["[object Uint16Array]"]=nV["[object Uint32Array]"]=!0,nV["[object Error]"]=nV[nW]=nV["[object WeakMap]"]=!1;var nH=function e(t,n,r,i,s,a){var o,l=1&n,c=2&n,h=4&n;if(r&&(o=s?r(t,i,s,a):r(t)),void 0!==o)return o;if(!eC(t))return t;var u=eo(t);if(u){if(o=nN(t),!l)return nL(t,o)}else{var d,p,f,m,y,g=tr(t),T=g==nW||"[object GeneratorFunction]"==g;if(eu(t))return nS(t,l);if(g==nz||g==nG||T&&!s){if(o=c||T||"function"!=typeof(d=t).constructor||eR(d)?{}:n$(nv(d)),!l)return c?(f=(p=o)&&np(t,ng(t),p),np(t,nO(t),f)):(y=(m=o)&&np(t,eU(t),m),np(t,tU(t),y))}else{if(!nV[g])return s?t:{};o=nP(t,g,l)}}a||(a=new tg);var E=a.get(t);if(E)return E;a.set(t,o),nK(t)?t.forEach(function(i){o.add(e(i,n,r,i,t,a))}):nF(t)&&t.forEach(function(i,s){o.set(s,e(i,n,r,s,t,a))});var A=h?c?nR:tM:c?ng:eU,b=u?void 0:A(t);return F(b||t,function(i,s){b&&(i=t[s=i]),nd(o,s,e(i,n,r,s,t,a))}),o},nY=function(e){return nH(e,4)};function nX(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e}var nJ=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s},nq=/\s/,nZ=function(e){for(var t=e.length;t--&&nq.test(e.charAt(t)););return t},nQ=/^\s+/,n0=/^[-+]0x[0-9a-f]+$/i,n1=/^0b[01]+$/i,n2=/^0o[0-7]+$/i,n3=parseInt,n6=function(e){if("number"==typeof e)return e;if(tX(e))return 0/0;if(eC(e)){var t,n="function"==typeof e.valueOf?e.valueOf():e;e=eC(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,nZ(t)+1).replace(nQ,""):t;var r=n1.test(e);return r||n2.test(e)?n3(e.slice(2),r?2:8):n0.test(e)?0/0:+e},n5=function(e){var t,n=(t=e)?1/0===(t=n6(t))||-1/0===t?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0,r=n%1;return n==n?r?n-r:n:0},n4=function(e,t,n){var r=null==e?0:e.length;return r?nJ(e,(t=n||void 0===t?1:n5(t))<0?0:t,r):[]},n8="object"==typeof global&&global&&global.Object===Object&&global,n9="object"==typeof self&&self&&self.Object===Object&&self,n7=n8||n9||Function("return this")(),re=n7.Symbol,rt=Object.prototype,rn=rt.hasOwnProperty,rr=rt.toString,ri=re?re.toStringTag:void 0,rs=function(e){var t=rn.call(e,ri),n=e[ri];try{e[ri]=void 0;var r=!0}catch(e){}var i=rr.call(e);return r&&(t?e[ri]=n:delete e[ri]),i},ra=Object.prototype.toString,ro=re?re.toStringTag:void 0,rl=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ro&&ro in Object(e)?rs(e):ra.call(e)},rc=Array.isArray,rh=function(e){return null!=e&&"object"==typeof e},ru=function(e){return"string"==typeof e||!rc(e)&&rh(e)&&"[object String]"==rl(e)},rd=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},rp=function(e,t,n){for(var r=-1,i=Object(e),s=n(e),a=s.length;a--;){var o=s[++r];if(!1===t(i[o],o,i))break}return e},rf=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},rm=function(e){return rh(e)&&"[object Arguments]"==rl(e)},ry=Object.prototype,rg=ry.hasOwnProperty,rT=ry.propertyIsEnumerable,rE=rm(function(){return arguments}())?rm:function(e){return rh(e)&&rg.call(e,"callee")&&!rT.call(e,"callee")},rA="object"==typeof exports&&exports&&!exports.nodeType&&exports,rb=rA&&"object"==typeof module&&module&&!module.nodeType&&module,rS=rb&&rb.exports===rA?n7.Buffer:void 0,rL=(rS?rS.isBuffer:void 0)||function(){return!1},rv=/^(?:0|[1-9]\d*)$/,rO=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&rv.test(e))&&e>-1&&e%1==0&&e<t},rR=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff},rk={};rk["[object Float32Array]"]=rk["[object Float64Array]"]=rk["[object Int8Array]"]=rk["[object Int16Array]"]=rk["[object Int32Array]"]=rk["[object Uint8Array]"]=rk["[object Uint8ClampedArray]"]=rk["[object Uint16Array]"]=rk["[object Uint32Array]"]=!0,rk["[object Arguments]"]=rk["[object Array]"]=rk["[object ArrayBuffer]"]=rk["[object Boolean]"]=rk["[object DataView]"]=rk["[object Date]"]=rk["[object Error]"]=rk["[object Function]"]=rk["[object Map]"]=rk["[object Number]"]=rk["[object Object]"]=rk["[object RegExp]"]=rk["[object Set]"]=rk["[object String]"]=rk["[object WeakMap]"]=!1;var rN=function(e){return function(t){return e(t)}},r_="object"==typeof exports&&exports&&!exports.nodeType&&exports,rI=r_&&"object"==typeof module&&module&&!module.nodeType&&module,rC=rI&&rI.exports===r_&&n8.process,rx=function(){try{var e=rI&&rI.require&&rI.require("util").types;if(e)return e;return rC&&rC.binding&&rC.binding("util")}catch(e){}}(),rw=rx&&rx.isTypedArray,rU=rw?rN(rw):function(e){return rh(e)&&rR(e.length)&&!!rk[rl(e)]},rM=Object.prototype.hasOwnProperty,rP=function(e,t){var n=rc(e),r=!n&&rE(e),i=!n&&!r&&rL(e),s=!n&&!r&&!i&&rU(e),a=n||r||i||s,o=a?rf(e.length,String):[],l=o.length;for(var c in e)(t||rM.call(e,c))&&!(a&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||rO(c,l)))&&o.push(c);return o},rD=Object.prototype,r$=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||rD)},rj=function(e,t){return function(n){return e(t(n))}},rF=rj(Object.keys,Object),rB=Object.prototype.hasOwnProperty,rK=function(e){if(!r$(e))return rF(e);var t=[];for(var n in Object(e))rB.call(e,n)&&"constructor"!=n&&t.push(n);return t},rG=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},rW=function(e){if(!rG(e))return!1;var t=rl(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},rz=function(e){return null!=e&&rR(e.length)&&!rW(e)},rV=function(e){return rz(e)?rP(e):rK(e)},rH=(c=function(e,t){return e&&rp(e,t,rV)},function(e,t){if(null==e)return e;if(!rz(e))return c(e,t);for(var n=e.length,r=-1,i=Object(e);++r<n&&!1!==t(i[r],r,i););return e}),rY=function(e){return e},rX=function(e,t){return(rc(e)?rd:rH)(e,"function"==typeof t?t:rY)},rJ=n7["__core-js_shared__"],rq=(h=/[^.]+$/.exec(rJ&&rJ.keys&&rJ.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",rZ=Function.prototype.toString,rQ=function(e){if(null!=e){try{return rZ.call(e)}catch(e){}try{return e+""}catch(e){}}return""},r0=/^\[object .+?Constructor\]$/,r1=Object.prototype,r2=Function.prototype.toString,r3=r1.hasOwnProperty,r6=RegExp("^"+r2.call(r3).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),r5=function(e){return!!rG(e)&&(!rq||!(rq in e))&&(rW(e)?r6:r0).test(rQ(e))},r4=function(e,t){var n=null==e?void 0:e[t];return r5(n)?n:void 0},r8=function(){try{var e=r4(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),r9=function(e,t,n){"__proto__"==t&&r8?r8(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},r7=function(e,t){return e===t||e!=e&&t!=t},ie=Object.prototype.hasOwnProperty,it=function(e,t,n){var r=e[t];ie.call(e,t)&&r7(r,n)&&(void 0!==n||t in e)||r9(e,t,n)},ir=function(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;void 0===l&&(l=e[o]),i?r9(n,o,l):it(n,o,l)}return n},ii=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},is=Math.max,ia=Date.now,io=(u=r8?function(e,t){return r8(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:rY,d=0,p=0,function(){var e=ia(),t=16-(e-p);if(p=e,t>0){if(++d>=800)return arguments[0]}else d=0;return u.apply(void 0,arguments)}),il=function(e,t,n){if(!rG(n))return!1;var r=typeof t;return("number"==r?!!(rz(n)&&rO(t,n.length)):"string"==r&&t in n)&&r7(n[t],e)},ic=Object.prototype.hasOwnProperty,ih=(f=function(e,t){if(r$(t)||rz(t))return void ir(t,rV(t),e);for(var n in t)ic.call(t,n)&&it(e,n,t[n])},io((r=function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,s=r>2?t[2]:void 0;for(i=f.length>3&&"function"==typeof i?(r--,i):void 0,s&&il(t[0],t[1],s)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var a=t[n];a&&f(e,a)}return e},i=is((i=void 0,r.length-1),0),function(){for(var e=arguments,t=-1,n=is(e.length-i,0),s=Array(n);++t<n;)s[t]=e[i+t];t=-1;for(var a=Array(i+1);++t<i;)a[t]=e[t];return a[i]=rY(s),ii(r,this,a)}),r+"")),iu=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},id=function(e,t){for(var n=e.length;n--;)if(r7(e[n][0],t))return n;return -1},ip=Array.prototype.splice;function im(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}im.prototype.clear=function(){this.__data__=[],this.size=0},im.prototype.delete=function(e){var t=this.__data__,n=id(t,e);return!(n<0)&&(n==t.length-1?t.pop():ip.call(t,n,1),--this.size,!0)},im.prototype.get=function(e){var t=this.__data__,n=id(t,e);return n<0?void 0:t[n][1]},im.prototype.has=function(e){return id(this.__data__,e)>-1},im.prototype.set=function(e,t){var n=this.__data__,r=id(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var iy=r4(n7,"Map"),ig=r4(Object,"create"),iT=Object.prototype.hasOwnProperty,iE=Object.prototype.hasOwnProperty;function iA(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}iA.prototype.clear=function(){this.__data__=ig?ig(null):{},this.size=0},iA.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},iA.prototype.get=function(e){var t=this.__data__;if(ig){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return iT.call(t,e)?t[e]:void 0},iA.prototype.has=function(e){var t=this.__data__;return ig?void 0!==t[e]:iE.call(t,e)},iA.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=ig&&void 0===t?"__lodash_hash_undefined__":t,this};var ib=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},iS=function(e,t){var n=e.__data__;return ib(t)?n["string"==typeof t?"string":"hash"]:n.map};function iL(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function iv(e){var t=this.__data__=new im(e);this.size=t.size}function iO(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new iL;++t<n;)this.add(e[t])}iL.prototype.clear=function(){this.size=0,this.__data__={hash:new iA,map:new(iy||im),string:new iA}},iL.prototype.delete=function(e){var t=iS(this,e).delete(e);return this.size-=!!t,t},iL.prototype.get=function(e){return iS(this,e).get(e)},iL.prototype.has=function(e){return iS(this,e).has(e)},iL.prototype.set=function(e,t){var n=iS(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},iv.prototype.clear=function(){this.__data__=new im,this.size=0},iv.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},iv.prototype.get=function(e){return this.__data__.get(e)},iv.prototype.has=function(e){return this.__data__.has(e)},iv.prototype.set=function(e,t){var n=this.__data__;if(n instanceof im){var r=n.__data__;if(!iy||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new iL(r)}return n.set(e,t),this.size=n.size,this},iO.prototype.add=iO.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},iO.prototype.has=function(e){return this.__data__.has(e)};var iR=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},ik=function(e,t,n,r,i,s){var a=1&n,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var u=-1,d=!0,p=2&n?new iO:void 0;for(s.set(e,t),s.set(t,e);++u<o;){var f=e[u],m=t[u];if(r)var y=a?r(m,f,u,t,e,s):r(f,m,u,e,t,s);if(void 0!==y){if(y)continue;d=!1;break}if(p){if(!iR(t,function(e,t){if(!p.has(t)&&(f===e||i(f,e,n,r,s)))return p.push(t)})){d=!1;break}}else if(!(f===m||i(f,m,n,r,s))){d=!1;break}}return s.delete(e),s.delete(t),d},iN=n7.Uint8Array,i_=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},iI=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},iC=re?re.prototype:void 0,ix=iC?iC.valueOf:void 0,iw=function(e,t,n,r,i,s,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!s(new iN(e),new iN(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return r7(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=i_;case"[object Set]":var l=1&r;if(o||(o=iI),e.size!=t.size&&!l)break;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var h=ik(o(e),o(t),r,i,s,a);return a.delete(e),h;case"[object Symbol]":if(ix)return ix.call(e)==ix.call(t)}return!1},iU=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},iM=function(e,t,n){var r=t(e);return rc(e)?r:iU(r,n(e))},iP=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s},iD=function(){return[]},i$=Object.prototype.propertyIsEnumerable,ij=Object.getOwnPropertySymbols,iF=ij?function(e){return null==e?[]:iP(ij(e=Object(e)),function(t){return i$.call(e,t)})}:iD,iB=function(e){return iM(e,rV,iF)},iK=Object.prototype.hasOwnProperty,iG=function(e,t,n,r,i,s){var a=1&n,o=iB(e),l=o.length;if(l!=iB(t).length&&!a)return!1;for(var c=l;c--;){var h=o[c];if(!(a?h in t:iK.call(t,h)))return!1}var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var f=a;++c<l;){var m=e[h=o[c]],y=t[h];if(r)var g=a?r(y,m,h,t,e,s):r(m,y,h,e,t,s);if(!(void 0===g?m===y||i(m,y,n,r,s):g)){p=!1;break}f||(f="constructor"==h)}if(p&&!f){var T=e.constructor,E=t.constructor;T!=E&&"constructor"in e&&"constructor"in t&&!("function"==typeof T&&T instanceof T&&"function"==typeof E&&E instanceof E)&&(p=!1)}return s.delete(e),s.delete(t),p},iW=r4(n7,"DataView"),iz=r4(n7,"Promise"),iV=r4(n7,"Set"),iH=r4(n7,"WeakMap"),iY="[object Map]",iX="[object Promise]",iJ="[object Set]",iq="[object WeakMap]",iZ="[object DataView]",iQ=rQ(iW),i0=rQ(iy),i1=rQ(iz),i2=rQ(iV),i3=rQ(iH),i6=rl;(iW&&i6(new iW(new ArrayBuffer(1)))!=iZ||iy&&i6(new iy)!=iY||iz&&i6(iz.resolve())!=iX||iV&&i6(new iV)!=iJ||iH&&i6(new iH)!=iq)&&(i6=function(e){var t=rl(e),n="[object Object]"==t?e.constructor:void 0,r=n?rQ(n):"";if(r)switch(r){case iQ:return iZ;case i0:return iY;case i1:return iX;case i2:return iJ;case i3:return iq}return t});var i5=i6,i4="[object Arguments]",i8="[object Array]",i9="[object Object]",i7=Object.prototype.hasOwnProperty,se=function(e,t,n,r,i,s){var a=rc(e),o=rc(t),l=a?i8:i5(e),c=o?i8:i5(t);l=l==i4?i9:l,c=c==i4?i9:c;var h=l==i9,u=c==i9,d=l==c;if(d&&rL(e)){if(!rL(t))return!1;a=!0,h=!1}if(d&&!h)return s||(s=new iv),a||rU(e)?ik(e,t,n,r,i,s):iw(e,t,l,n,r,i,s);if(!(1&n)){var p=h&&i7.call(e,"__wrapped__"),f=u&&i7.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,y=f?t.value():t;return s||(s=new iv),i(m,y,n,r,s)}}return!!d&&(s||(s=new iv),iG(e,t,n,r,i,s))},st=function e(t,n,r,i,s){return t===n||(null!=t&&null!=n&&(rh(t)||rh(n))?se(t,n,r,i,e,s):t!=t&&n!=n)},sn=function(e,t,n,r){var i=n.length,s=i,a=!r;if(null==e)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){var l=(o=n[i])[0],c=e[l],h=o[1];if(a&&o[2]){if(void 0===c&&!(l in e))return!1}else{var u=new iv;if(r)var d=r(c,h,l,e,t,u);if(!(void 0===d?st(h,c,3,r,u):d))return!1}}return!0},sr=function(e){return e==e&&!rG(e)},si=function(e){for(var t=rV(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,sr(i)]}return t},ss=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},sa=function(e){var t=si(e);return 1==t.length&&t[0][2]?ss(t[0][0],t[0][1]):function(n){return n===e||sn(n,e,t)}},so=function(e){return"symbol"==typeof e||rh(e)&&"[object Symbol]"==rl(e)},sl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sc=/^\w*$/,sh=function(e,t){if(rc(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||so(e))||sc.test(e)||!sl.test(e)||null!=t&&e in Object(t)};function su(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(su.Cache||iL),n}su.Cache=iL;var sd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sp=/\\(\\)?/g,sf=(y=(m=su(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(sd,function(e,n,r,i){t.push(r?i.replace(sp,"$1"):n||e)}),t},function(e){return 500===y.size&&y.clear(),e})).cache,m),sm=re?re.prototype:void 0,sy=sm?sm.toString:void 0,sg=function e(t){if("string"==typeof t)return t;if(rc(t))return iu(t,e)+"";if(so(t))return sy?sy.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},sT=function(e,t){return rc(e)?e:sh(e,t)?[e]:sf(null==e?"":sg(e))},sE=function(e){if("string"==typeof e||so(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},sA=function(e,t){t=sT(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[sE(t[n++])];return n&&n==r?e:void 0},sb=function(e,t,n){var r=null==e?void 0:sA(e,t);return void 0===r?n:r},sS=function(e,t){return null!=e&&t in Object(e)},sL=function(e,t,n){t=sT(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=sE(t[r]);if(!(s=null!=e&&n(e,a)))break;e=e[a]}return s||++r!=i?s:!!(i=null==e?0:e.length)&&rR(i)&&rO(a,i)&&(rc(e)||rE(e))},sv=function(e){var t;return sh(e)?(t=sE(e),function(e){return null==e?void 0:e[t]}):function(t){return sA(t,e)}},sO=function(e){if("function"==typeof e)return e;if(null==e)return rY;if("object"==typeof e){var t,n;return rc(e)?(t=e[0],n=e[1],sh(t)&&sr(n)?ss(sE(t),n):function(e){var r=sb(e,t);return void 0===r&&r===n?null!=e&&sL(e,t,sS):st(n,r,3)}):sa(e)}return sv(e)},sR=function(e,t,n,r){if(!rG(e))return e;t=sT(t,e);for(var i=-1,s=t.length,a=s-1,o=e;null!=o&&++i<s;){var l=sE(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)break;if(i!=a){var h=o[l];void 0===(c=r?r(h,l,o):void 0)&&(c=rG(h)?h:rO(t[i+1])?[]:{})}it(o,l,c),o=o[l]}return e},sk=function(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=sA(e,a);n(o,a)&&sR(s,sT(a,e),o)}return s},sN=rj(Object.getPrototypeOf,Object),s_=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)iU(t,iF(e)),e=sN(e);return t}:iD,sI=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},sC=Object.prototype.hasOwnProperty,sx=function(e){if(!rG(e))return sI(e);var t=r$(e),n=[];for(var r in e)"constructor"==r&&(t||!sC.call(e,r))||n.push(r);return n},sw=function(e){return rz(e)?rP(e,!0):sx(e)},sU=function(e,t){if(null==e)return{};var n=iu(iM(e,sw,s_),function(e){return[e]});return t=sO(t),sk(e,n,function(e,n){return t(e,n[0])})},sM=function(e,t){var n=-1,r=rz(e)?Array(e.length):[];return rH(e,function(e,i,s){r[++n]=t(e,i,s)}),r},sP=function(e,t){return(rc(e)?iu:sM)(e,sO(t))},sD=rx&&rx.isRegExp,s$=sD?rN(sD):function(e){return rh(e)&&"[object RegExp]"==rl(e)};class sj{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),rX(this.definition,t=>{t.accept(e)})}}class sF extends sj{constructor(e){super([]),this.idx=1,ih(this,sU(e,e=>void 0!==e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sB extends sj{constructor(e){super(e.definition),this.orgText="",ih(this,sU(e,e=>void 0!==e))}}class sK extends sj{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,ih(this,sU(e,e=>void 0!==e))}}class sG extends sj{constructor(e){super(e.definition),this.idx=1,ih(this,sU(e,e=>void 0!==e))}}class sW extends sj{constructor(e){super(e.definition),this.idx=1,ih(this,sU(e,e=>void 0!==e))}}class sz extends sj{constructor(e){super(e.definition),this.idx=1,ih(this,sU(e,e=>void 0!==e))}}class sV extends sj{constructor(e){super(e.definition),this.idx=1,ih(this,sU(e,e=>void 0!==e))}}class sH extends sj{constructor(e){super(e.definition),this.idx=1,ih(this,sU(e,e=>void 0!==e))}}class sY extends sj{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,ih(this,sU(e,e=>void 0!==e))}}class sX{constructor(e){this.idx=1,ih(this,sU(e,e=>void 0!==e))}accept(e){e.visit(this)}}class sJ{visit(e){switch(e.constructor){case sF:return this.visitNonTerminal(e);case sK:return this.visitAlternative(e);case sG:return this.visitOption(e);case sW:return this.visitRepetitionMandatory(e);case sz:return this.visitRepetitionMandatoryWithSeparator(e);case sH:return this.visitRepetitionWithSeparator(e);case sV:return this.visitRepetition(e);case sY:return this.visitAlternation(e);case sX:return this.visitTerminal(e);case sB:return this.visitRule(e);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}var sq=function(e,t){var n;return rH(e,function(e,r,i){return!(n=t(e,r,i))}),!!n},sZ=function(e,t,n){var r=rc(e)?iR:sq;return n&&il(e,t,n)&&(t=void 0),r(e,sO(t))},sQ=function(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return -1},s0=function(e){return e!=e},s1=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1},s2=/\s/,s3=function(e){for(var t=e.length;t--&&s2.test(e.charAt(t)););return t},s6=/^\s+/,s5=/^[-+]0x[0-9a-f]+$/i,s4=/^0b[01]+$/i,s8=/^0o[0-7]+$/i,s9=parseInt,s7=function(e){if("number"==typeof e)return e;if(so(e))return 0/0;if(rG(e)){var t,n="function"==typeof e.valueOf?e.valueOf():e;e=rG(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,s3(t)+1).replace(s6,""):t;var r=s4.test(e);return r||s8.test(e)?s9(e.slice(2),r?2:8):s5.test(e)?0/0:+e},ae=function(e){var t,n=(t=e)?1/0===(t=s7(t))||-1/0===t?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0,r=n%1;return n==n?r?n-r:n:0},at=function(e){return null==e?[]:iu(rV(e),function(t){return e[t]})},an=Math.max,ar=function(e,t,n,r){e=rz(e)?e:at(e),n=n&&!r?ae(n):0;var i,s,a=e.length;return n<0&&(n=an(a+n,0)),ru(e)?n<=a&&e.indexOf(t,n)>-1:!!a&&(i=e,s=n,(t==t?s1(i,t,s):sQ(i,s0,s))>-1)},ai=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0},as=function(e,t){var n=!0;return rH(e,function(e,r,i){return n=!!t(e,r,i)}),n},aa=function(e,t,n){var r=rc(e)?ai:as;return n&&il(e,t,n)&&(t=void 0),r(e,sO(t))};function ao(e,t=[]){return e instanceof sG||e instanceof sV||e instanceof sH||(e instanceof sY?sZ(e.definition,e=>ao(e,t)):!(e instanceof sF&&ar(t,e))&&e instanceof sj&&(e instanceof sF&&t.push(e),aa(e.definition,e=>ao(e,t))))}function al(e){if(e instanceof sF)return"SUBRULE";if(e instanceof sG)return"OPTION";if(e instanceof sY)return"OR";if(e instanceof sW)return"AT_LEAST_ONE";if(e instanceof sz)return"AT_LEAST_ONE_SEP";else if(e instanceof sH)return"MANY_SEP";else if(e instanceof sV)return"MANY";else if(e instanceof sX)return"CONSUME";else throw Error("non exhaustive match")}class ac{walk(e,t=[]){eD(e.definition,(n,r)=>{let i=n4(e.definition,r+1);if(n instanceof sF)this.walkProdRef(n,i,t);else if(n instanceof sX)this.walkTerminal(n,i,t);else if(n instanceof sK)this.walkFlat(n,i,t);else if(n instanceof sG)this.walkOption(n,i,t);else if(n instanceof sW)this.walkAtLeastOne(n,i,t);else if(n instanceof sz)this.walkAtLeastOneSep(n,i,t);else if(n instanceof sH)this.walkManySep(n,i,t);else if(n instanceof sV)this.walkMany(n,i,t);else if(n instanceof sY)this.walkOr(n,i,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new sG({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=ah(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new sG({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=ah(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);eD(e.definition,e=>{let t=new sK({definition:[e]});this.walk(t,r)})}}function ah(e,t,n){return[new sG({definition:[new sX({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}var au=function(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return -1},ad=function(e){return e!=e},ap=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1},af=function(e,t,n){return t==t?ap(e,t,n):au(e,ad,n)},am=function(e,t){return!!(null==e?0:e.length)&&af(e,t,0)>-1},ay=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1},ag=function(){},aT=e0&&1/tv(new e0([,-0]))[1]==1/0?function(e){return new e0(e)}:ag,aE=function(e,t,n){var r=-1,i=am,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=ay;else if(s>=200){var c=t?null:aT(e);if(c)return tv(c);a=!1,i=tA,l=new tT}else l=t?[]:o;e:for(;++r<s;){var h=e[r],u=t?t(h):h;if(h=n||0!==h?h:0,a&&u==u){for(var d=l.length;d--;)if(l[d]===u)continue e;t&&l.push(u),o.push(h)}else i(l,u,n)||(l!==o&&l.push(u),o.push(h))}return o},aA=function(e){return e&&e.length?aE(e):[]},ab=V?V.isConcatSpreadable:void 0,aS=function(e){return eo(e)||ea(e)||!!(ab&&e&&e[ab])},aL=function e(t,n,r,i,s){var a=-1,o=t.length;for(r||(r=aS),s||(s=[]);++a<o;){var l=t[a];n>0&&r(l)?n>1?e(l,n-1,r,i,s):tN(s,l):i||(s[s.length]=l)}return s},av=function(e){return(null==e?0:e.length)?aL(e,1):[]};function aO(e){if(e instanceof sF)return aO(e.referencedRule);if(e instanceof sX)return[e.terminalType];if(e instanceof sK||e instanceof sG||e instanceof sV||e instanceof sW||e instanceof sz||e instanceof sH||e instanceof sX||e instanceof sB)return function(e){let t,n=[],r=e.definition,i=0,s=r.length>i,a=!0;for(;s&&a;)a=ao(t=r[i]),n=n.concat(aO(t)),i+=1,s=r.length>i;return aA(n)}(e);if(e instanceof sY)return aA(av(ns(e.definition,e=>aO(e))));throw Error("non exhaustive match")}var aR=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},ak=Math.max,aN=Date.now,a_=(g=nc?function(e,t){return nc(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:eP,T=0,E=0,function(){var e=aN(),t=16-(e-E);if(E=e,t>0){if(++T>=800)return arguments[0]}else T=0;return g.apply(void 0,arguments)}),aI=function(e,t){var n;return a_((n=ak(void 0===(n=t)?e.length-1:n,0),function(){for(var t=arguments,r=-1,i=ak(t.length-n,0),s=Array(i);++r<i;)s[r]=t[n+r];r=-1;for(var a=Array(n+1);++r<n;)a[r]=t[r];return a[n]=eP(s),aR(e,this,a)}),e+"")},aC=function(e,t,n){if(!eC(n))return!1;var r=typeof t;return("number"==r?!!(ew(n)&&ep(t,n.length)):"string"==r&&t in n)&&ta(n[t],e)},ax=Object.prototype.hasOwnProperty,aw=(A=function(e,t){if(eR(t)||ew(t))return void np(t,eU(t),e);for(var n in t)ax.call(t,n)&&nd(e,n,t[n])},aI(function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,s=r>2?t[2]:void 0;for(i=A.length>3&&"function"==typeof i?(r--,i):void 0,s&&aC(t[0],t[1],s)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var a=t[n];a&&A(e,a)}return e}));class aU extends ac{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){var r,i;let s=(r=e.referencedRule,i=e.idx,r.name+i+"_~IN~_"+this.topProd.name),a=aO(new sK({definition:t.concat(n)}));this.follows[s]=a}}var aM=function(e){return"string"==typeof e||!eo(e)&&et(e)&&"[object String]"==ee(e)},aP=function(e){return void 0===e};function aD(e){return e.charCodeAt(0)}function a$(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function aj(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function aF(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function aB(){throw Error("Internal Error - Should never get here!")}function aK(e){return"Character"===e.type}let aG=[];for(let e=aD("0");e<=aD("9");e++)aG.push(e);let aW=[aD("_")].concat(aG);for(let e=aD("a");e<=aD("z");e++)aW.push(e);for(let e=aD("A");e<=aD("Z");e++)aW.push(e);let az=[aD(" "),aD("\f"),aD("\n"),aD("\r"),aD(" "),aD("\v"),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD(" "),aD("\u2028"),aD("\u2029"),aD(" "),aD(" "),aD(" "),aD("\uFEFF")],aV=/[0-9a-fA-F]/,aH=/[0-9]/,aY=/[1-9]/;class aX{visitChildren(e){for(let t in e){let n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}var aJ=Object.prototype,aq=aJ.hasOwnProperty,aZ=aI(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&aC(t[0],t[1],i)&&(r=1);++n<r;)for(var s=t[n],a=ng(s),o=-1,l=a.length;++o<l;){var c=a[o],h=e[c];(void 0===h||ta(h,aJ[c])&&!aq.call(e,c))&&(e[c]=s[c])}return e}),aQ=function(e,t){var n=[];return eM(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n},a0=function(e){if("function"!=typeof e)throw TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}},a1=function(e,t){return(eo(e)?tI:aQ)(e,a0(nr(t)))},a2=eA&&eA.isRegExp,a3=a2?ey(a2):function(e){return et(e)&&"[object RegExp]"==ee(e)},a6=Math.max,a5=function(e,t,n,r){e=ew(e)?e:ej(e),n=n&&!r?n5(n):0;var i=e.length;return n<0&&(n=a6(i+n,0)),aM(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&af(e,t,n)>-1},a4=Math.max,a8=function(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:n5(n);return i<0&&(i=a4(r+i,0)),af(e,t,i)},a9=function(e,t,n,r){var i=-1,s=null==e?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n},a7=function(e,t,n,r,i){return i(e,function(e,i,s){n=r?(r=!1,e):t(n,e,i,s)}),n},oe=function(e,t,n){var r=eo(e)?a9:a7,i=arguments.length<3;return r(e,nr(t),n,i,eM)},ot=function(e,t){return(eo(e)?tI:aQ)(e,nr(t))},on=function(e,t,n,r){var i=-1,s=am,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;n&&(t=e$(t,ey(n))),r?(s=ay,a=!1):t.length>=200&&(s=tA,a=!1,t=new tT(t));e:for(;++i<o;){var h=e[i],u=null==n?h:n(h);if(h=r||0!==h?h:0,a&&u==u){for(var d=c;d--;)if(t[d]===u)continue e;l.push(h)}else s(t,u,r)||l.push(h)}return l},or=function(e){return et(e)&&ew(e)},oi=aI(function(e,t){return or(e)?on(e,aL(t,1,or,!0)):[]}),os=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var s=e[t];s&&(i[r++]=s)}return i},oa=function(e){return e&&e.length?e[0]:void 0},oo=Math.max,ol=(b=function(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:n5(n);return i<0&&(i=oo(r+i,0)),au(e,nr(t),i)},function(e,t,n){var r=Object(e);if(!ew(e)){var i=nr(t);e=eU(e),t=function(e){return i(r[e],e,r)}}var s=b(e,t,n);return s>-1?r[i?e[s]:s]:void 0});function oc(e){console&&console.error&&console.error(`Error: ${e}`)}function oh(e){console&&console.warn&&console.warn(`Warning: ${e}`)}var ou=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0},od=function(e,t){var n=!0;return eM(e,function(e,r,i){return n=!!t(e,r,i)}),n},op=function(e,t,n){var r=eo(e)?ou:od;return n&&aC(e,t,n)&&(t=void 0),r(e,nr(t))};let of={},om=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let t=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":aj(n,"global");break;case"i":aj(n,"ignoreCase");break;case"m":aj(n,"multiLine");break;case"u":aj(n,"unicode");break;case"y":aj(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}aF(t);let n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return aB()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":let r=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:r,atMost:r};break;case",":t=this.isDigit()?{atLeast:r,atMost:this.integerIncludingZero()}:{atLeast:r,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;aF(t)}if((!0!==e||void 0!==t)&&aF(t))return"?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t}atom(){let e,t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return(void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),aF(e))?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):aB()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[aD("\n"),aD("\r"),aD("\u2028"),aD("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=aG;break;case"D":e=aG,t=!0;break;case"s":e=az;break;case"S":e=az,t=!0;break;case"w":e=aW;break;case"W":e=aW,t=!0}return aF(e)?{type:"Set",value:e,complement:t}:aB()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=aD("\f");break;case"n":e=aD("\n");break;case"r":e=aD("\r");break;case"t":e=aD(" ");break;case"v":e=aD("\v")}return aF(e)?{type:"Character",value:e}:aB()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:aD("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:aD(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:aD(this.popChar())}}}characterClass(){let e=[],t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){let t=this.classAtom();if(t.type,aK(t)&&this.isRangeDash()){this.consumeChar("-");let n=this.classAtom();if(n.type,aK(n)){if(n.value<t.value)throw Error("Range out of order in character class");e.push({from:t.value,to:n.value})}else a$(t.value,e),e.push(aD("-")),a$(n.value,e)}else a$(t.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}}classAtom(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:aD("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;this.consumeChar("("),"?"===this.peekChar(0)?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;let t=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(!1===aY.test(e))throw Error("Expecting a positive integer");for(;aH.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(!1===aH.test(e))throw Error("Expecting an integer");for(;aH.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:aD(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return"-"===this.peekChar()&&this.isClassAtom(1)}isDigit(){return aH.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2)||"<"===this.peekChar(2)&&("="===this.peekChar(3)||"!"===this.peekChar(3)));default:return!1}}isQuantifier(){let e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(e){return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let t="";for(let n=0;n<e;n++){let e=this.popChar();if(!1===aV.test(e))throw Error("Expecting a HexDecimal digits");t+=e}return{type:"Character",value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function oy(e){let t=e.toString();if(of.hasOwnProperty(t))return of[t];{let e=om.pattern(t);return of[t]=e,e}}let og="Complement Sets are not supported for first char optimization",oT='Unable to use "first char" lexer optimizations:\n';function oE(e,t,n){let r=oP(e);t[r]=r,!0===n&&function(e,t){let n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){let e=oP(r.charCodeAt(0));t[e]=e}else{let e=n.toLowerCase();if(e!==n){let n=oP(e.charCodeAt(0));t[n]=n}}}(e,t)}function oA(e,t){return ol(e.value,e=>"number"==typeof e?a5(t,e):void 0!==ol(t,t=>e.from<=t&&t<=e.to))}class ob extends aX{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){a5(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===oA(e,this.targetCharCodes)&&(this.found=!0):void 0!==oA(e,this.targetCharCodes)&&(this.found=!0)}}function oS(e,t){if(!(t instanceof RegExp))return void 0!==ol(t,t=>a5(e,t.charCodeAt(0)));{let n=oy(t),r=new ob(e);return r.visit(n),r.found}}let oL="PATTERN",ov="defaultMode",oO="modes",oR=/[^\\][$]/,ok=/[^\\[][\^]|^\^/;function oN(e){let t=e.ignoreCase?"iy":"y";return RegExp(`${e.source}`,t)}function o_(e){let t=e.PATTERN;if(a3(t))return!1;if(ex(t))return!0;if(nl(t,"exec"))return!0;if(aM(t))return!1;throw Error("non exhaustive match")}function oI(e){return!!aM(e)&&1===e.length&&e.charCodeAt(0)}let oC={test:function(e){let t=e.length;for(let n=this.lastIndex;n<t;n++){let t=e.charCodeAt(n);if(10===t)return this.lastIndex=n+1,!0;if(13===t)return 10===e.charCodeAt(n+1)?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function ox(e,t){if(nl(e,"LINE_BREAKS"))return!1;if(a3(e.PATTERN)){try{oS(t,e.PATTERN)}catch(e){return{issue:k.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if(aM(e.PATTERN))return!1;if(o_(e))return{issue:k.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function ow(e){return ns(e,e=>aM(e)?e.charCodeAt(0):e)}function oU(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}let oM=[];function oP(e){return e<256?e:oM[e]}var oD=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};function o$(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function oj(e,t){let n=e.tokenTypeIdx;return n===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[n]}function oF(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}let oB=1,oK={};function oG(e){let t=function(e){let t=nY(e),n=e,r=!0;for(;r;){let e=oi(n=os(av(ns(n,e=>e.CATEGORIES))),t);t=t.concat(e),ts(e)?r=!1:n=e}return t}(e);eD(t,e=>{oW(e)||(oK[oB]=e,e.tokenTypeIdx=oB++),oz(e)&&!eo(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),oz(e)||(e.CATEGORIES=[]),nl(e,"categoryMatches")||(e.categoryMatches=[]),nl(e,"categoryMatchesMap")||(e.categoryMatchesMap={})}),eD(t,e=>{!function e(t,n){eD(t,e=>{n.categoryMatchesMap[e.tokenTypeIdx]=!0}),eD(n.CATEGORIES,r=>{let i=t.concat(n);a5(i,r)||e(i,r)})}([],e)}),eD(t,e=>{e.categoryMatches=[],eD(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(oK[n].tokenTypeIdx)})}),eD(t,e=>{e.isParent=e.categoryMatches.length>0})}function oW(e){return nl(e,"tokenTypeIdx")}function oz(e){return nl(e,"CATEGORIES")}function oV(e){return nl(e,"tokenTypeIdx")}(S=k||(k={}))[S.MISSING_PATTERN=0]="MISSING_PATTERN",S[S.INVALID_PATTERN=1]="INVALID_PATTERN",S[S.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",S[S.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",S[S.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",S[S.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",S[S.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",S[S.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",S[S.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",S[S.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",S[S.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",S[S.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",S[S.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",S[S.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",S[S.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",S[S.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",S[S.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",S[S.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";let oH={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(oH);class oY{constructor(e,t=oH){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0!==this.traceInitPerf)return t();{this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);let{time:r,value:i}=o$(t),s=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=aw({},oH,t);let n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===oH.lineTerminatorsPattern)this.config.lineTerminatorsPattern=oC;else if(this.config.lineTerminatorCharacters===oH.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),eo(e)?n={modes:{defaultMode:nY(e)},defaultMode:ov}:(r=!1,n=nY(e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{var e;let t;this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat((e=n,this.trackStartLines,this.config.lineTerminatorCharacters,t=[],nl(e,ov)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+ov+"> property in its definition\n",type:k.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),nl(e,oO)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+oO+"> property in its definition\n",type:k.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),nl(e,oO)&&nl(e,ov)&&!nl(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${ov}: <${e.defaultMode}>which does not exist
|
|
2
|
-
`,type:k.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),nl(e,oO)&&eD(e.modes,(e,n)=>{eD(e,(r,i)=>{aP(r)?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>
|
|
3
|
-
`,type:k.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):nl(r,"LONGER_ALT")&&eD(eo(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT],i=>{aP(i)||a5(e,i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${n}>
|
|
4
|
-
`,type:k.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{var e,t,r;let i,s,a,o;this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat((e=n,t=this.trackStartLines,r=this.config.lineTerminatorCharacters,i=[],s=!1,a=a1(os(av(ej(e.modes))),e=>e[oL]===oY.NA),o=ow(r),t&&eD(a,e=>{let t=ox(e,o);if(!1!==t){let n={message:function(e,t){if(t.issue===k.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
5
|
-
The problem is in the <${e.name}> Token Type
|
|
6
|
-
Root cause: ${t.errMsg}.
|
|
7
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===k.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
8
|
-
The problem is in the <${e.name}> Token Type
|
|
9
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),type:t.issue,tokenType:e};i.push(n)}else nl(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(s=!0):oS(o,e.PATTERN)&&(s=!0)}),t&&!s&&i.push({message:"Warning: No LINE_BREAKS Found.\n This Lexer has been defined to track line and column information,\n But none of the Token Types can be identified as matching a line terminator.\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n for details.",type:k.NO_LINE_BREAKS_FLAGS}),i))})),n.modes=n.modes?n.modes:{},eD(n.modes,(e,t)=>{n.modes[t]=a1(e,e=>aP(e))});let i=eU(n.modes);if(eD(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{var t,n,r,s,a,o;let l,c,h,u,d,p,f,m,y,g,T,E;this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat((l=[],c={errors:ns(d=ot(t=e,e=>!nl(e,oL)),e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:k.MISSING_PATTERN,tokenTypes:[e]})),valid:oi(t,d)},l=l.concat(c.errors),u=(h={errors:ns(p=ot(n=c.valid,e=>{let t=e[oL];return!a3(t)&&!ex(t)&&!nl(t,"exec")&&!aM(t)}),e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:k.INVALID_PATTERN,tokenTypes:[e]})),valid:oi(n,p)}).valid,l=(l=(l=(l=(l=l.concat(h.errors)).concat((f=[],m=ot(u,e=>a3(e[oL])),(f=(f=(f=(f=f.concat(function(e){class t extends aX{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return ns(ot(e,e=>{let n=e.PATTERN;try{let e=oy(n),r=new t;return r.visit(e),r.found}catch(e){return oR.test(n.source)}}),e=>({message:"Unexpected RegExp Anchor Error:\n Token Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",type:k.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(m))).concat(function(e){class t extends aX{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return ns(ot(e,e=>{let n=e.PATTERN;try{let e=oy(n),r=new t;return r.visit(e),r.found}catch(e){return ok.test(n.source)}}),e=>({message:"Unexpected RegExp Anchor Error:\n Token Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",type:k.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(m))).concat(ns(ot(m,e=>{let t=e[oL];return t instanceof RegExp&&(t.multiline||t.global)}),e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:k.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]})))).concat((y=[],g=ns(r=m,e=>oe(r,(t,n)=>(e.PATTERN.source!==n.PATTERN.source||a5(y,n)||n.PATTERN===oY.NA||(y.push(n),t.push(n)),t),[])),ns(ot(g=os(g),e=>e.length>1),e=>{let t=ns(e,e=>e.name),n=oa(e).PATTERN;return{message:`The same RegExp pattern ->${n}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:k.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})))).concat(ns(ot(m,e=>e.PATTERN.test("")),e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:k.EMPTY_MATCH_PATTERN,tokenTypes:[e]})))))).concat(ns(ot(u,e=>{if(!nl(e,"GROUP"))return!1;let t=e.GROUP;return t!==oY.SKIPPED&&t!==oY.NA&&!aM(t)}),e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:k.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]})))).concat((s=u,a=i,ns(ot(s,e=>void 0!==e.PUSH_MODE&&!a5(a,e.PUSH_MODE)),e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:k.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))))).concat((T=[],E=oe(o=u,(e,t,n)=>{var r;let i=t.PATTERN;return i===oY.NA||(aM(i)?e.push({str:i,idx:n,tokenType:t}):a3(i)&&(r=i,void 0===ol([".","\\","[","]","|","^","$","(",")","?","*","+","{"],e=>-1!==r.source.indexOf(e)))&&e.push({str:i.source,idx:n,tokenType:t})),e},[]),eD(o,(e,t)=>{eD(E,({str:n,idx:r,tokenType:i})=>{if(t<r&&function(e,t){if(a3(t)){var n;if(n=t,/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(n.source))return!1;let r=t.exec(e);return null!==r&&0===r.index}if(ex(t))return t(e,0,[],{});if(nl(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(n,e.PATTERN)){let t=`Token: ->${i.name}<- can never be matched.
|
|
10
|
-
Because it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.
|
|
11
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;T.push({message:t,type:k.UNREACHABLE_PATTERN,tokenTypes:[e,i]})}})}),T))))}),ts(this.lexerDefinitionErrors)){let r;oG(e),this.TRACE_INIT("analyzeTokenTypes",()=>{var n;let i,s,a,o,l,c,h,u,d,p,f,m,y,g,T,E;(y=(n=aZ(n={lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT},{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer)("initCharCodeToOptimizedIndexMap",()=>{if(ts(oM)){oM=Array(65536);for(let e=0;e<65536;e++)oM[e]=e>255?255+~~(e/255):e}}),y("Reject Lexer.NA",()=>{i=a1(e,e=>e[oL]===oY.NA)}),g=!1,y("Transform Patterns",()=>{g=!1,s=ns(i,e=>{let t=e[oL];if(a3(t)){let e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||a5(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?oN(t):e[1]:e}if(ex(t))return g=!0,{exec:t};if("object"==typeof t)return g=!0,t;if("string"==typeof t)if(1===t.length)return t;else return oN(new RegExp(t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")));throw Error("non exhaustive match")})}),y("misc mapping",()=>{a=ns(i,e=>e.tokenTypeIdx),o=ns(i,e=>{let t=e.GROUP;if(t!==oY.SKIPPED){if(aM(t))return t;if(aP(t))return!1;throw Error("non exhaustive match")}}),l=ns(i,e=>{let t=e.LONGER_ALT;if(t)return eo(t)?ns(t,e=>a8(i,e)):[a8(i,t)]}),c=ns(i,e=>e.PUSH_MODE),h=ns(i,e=>nl(e,"POP_MODE"))}),y("Line Terminator Handling",()=>{let e=ow(n.lineTerminatorCharacters);u=ns(i,e=>!1),"onlyOffset"!==n.positionTracking&&(u=ns(i,t=>nl(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ox(t,e)&&oS(e,t.PATTERN)))}),y("Misc Mapping #2",()=>{d=ns(i,o_),p=ns(s,oI),f=oe(i,(e,t)=>{let n=t.GROUP;return aM(n)&&n!==oY.SKIPPED&&(e[n]=[]),e},{}),m=ns(s,(e,t)=>({pattern:s[t],longerAlt:l[t],canLineTerminator:u[t],isCustom:d[t],short:p[t],group:o[t],push:c[t],pop:h[t],tokenTypeIdx:a[t],tokenType:i[t]}))}),T=!0,E=[],n.safeMode||y("First Char Optimization",()=>{E=oe(i,(e,t,r)=>{if("string"==typeof t.PATTERN)oU(e,oP(t.PATTERN.charCodeAt(0)),m[r]);else if(eo(t.START_CHARS_HINT)){let n;eD(t.START_CHARS_HINT,t=>{let i=oP("string"==typeof t?t.charCodeAt(0):t);n!==i&&(n=i,oU(e,i,m[r]))})}else if(a3(t.PATTERN))if(t.PATTERN.unicode)T=!1,n.ensureOptimizations&&oc(`${oT} Unable to analyze < ${t.PATTERN.toString()} > pattern.
|
|
12
|
-
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
13
|
-
This will disable the lexer's first char optimizations.
|
|
14
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let i=function(e,t=!1){try{let t=oy(e);return function e(t,n,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)e(t.value[i],n,r);break;case"Alternative":let i=t.value;for(let t=0;t<i.length;t++){let s=i[t];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}switch(s.type){case"Character":oE(s.value,n,r);break;case"Set":if(!0===s.complement)throw Error(og);eD(s.value,e=>{if("number"==typeof e)oE(e,n,r);else if(!0===r)for(let t=e.from;t<=e.to;t++)oE(t,n,r);else{for(let t=e.from;t<=e.to&&t<256;t++)oE(t,n,r);if(e.to>=256){let t=e.from>=256?e.from:256,r=e.to,i=oP(t),s=oP(r);for(let e=i;e<=s;e++)n[e]=e}}});break;case"Group":e(s.value,n,r);break;default:throw Error("Non Exhaustive Match")}let a=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===function e(t){let n=t.quantifier;return!!n&&0===n.atLeast||!!t.value&&(eo(t.value)?op(t.value,e):e(t.value))}(s)||"Group"!==s.type&&!1===a)break}break;default:throw Error("non exhaustive match!")}return ej(n)}(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===og)t&&oh(`${oT} Unable to optimize: < ${e.toString()} >
|
|
15
|
-
Complement Sets cannot be automatically optimized.
|
|
16
|
-
This will disable the lexer's first char optimizations.
|
|
17
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),oc(`${oT}
|
|
18
|
-
Failed parsing: < ${e.toString()} >
|
|
19
|
-
Using the @chevrotain/regexp-to-ast library
|
|
20
|
-
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}(t.PATTERN,n.ensureOptimizations);ts(i)&&(T=!1),eD(i,t=>{oU(e,t,m[r])})}else n.ensureOptimizations&&oc(`${oT} TokenType: <${t.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
21
|
-
This will disable the lexer's first char optimizations.
|
|
22
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),T=!1;return e},[])}),r={emptyGroups:f,patternIdxToConfig:m,charCodeToPatternIdxToConfig:E,hasCustom:g,canBeOptimized:T}}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=aw({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!ts(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling)throw Error("Errors detected in definition of Lexer:\n"+ns(this.lexerDefinitionErrors,e=>e.message).join("-----------------------\n"));eD(this.lexerDefinitionWarning,e=>{oh(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=ag),!1===this.trackStartLines&&(this.computeNewColumn=eP),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=ag),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let e=oe(this.canModeBeOptimized,(e,t,n)=>(!1===t&&e.push(n),e),[]);if(t.ensureOptimizations&&!ts(e))throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.
|
|
23
|
-
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
24
|
-
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{of={}}),this.TRACE_INIT("toFastProperties",()=>{nX(this)})})}tokenize(e,t=this.defaultMode){if(!ts(this.lexerDefinitionErrors))throw Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+ns(this.lexerDefinitionErrors,e=>e.message).join("-----------------------\n"));return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){var n;let r,i,s,a,o,l,c,h,u,d,p,f,m,y,g,T,E,A=e.length,b=0,S=0,L=Array(this.hasCustom?0:Math.floor(e.length/10)),v=[],O=this.trackStartLines?1:void 0,R=this.trackStartLines?1:void 0,k=(n=this.emptyGroups,E={},eD(eU(n),e=>{if(eo(n[e]))E[e]=[];else throw Error("non exhaustive match")}),E),N=this.trackStartLines,_=this.config.lineTerminatorsPattern,I=0,C=[],x=[],w=[],U=[];Object.freeze(U);let M=!1,P=e=>{if(1===w.length&&void 0===e.tokenType.PUSH_MODE){let t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);v.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{w.pop();let e=oD(w);C=this.patternIdxToConfig[e],x=this.charCodeToPatternIdxToConfig[e],I=C.length;let t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;M=!!x&&!!t}};function D(e){w.push(e),x=this.charCodeToPatternIdxToConfig[e],I=(C=this.patternIdxToConfig[e]).length,I=C.length;let t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;M=!!x&&!!t}D.call(this,t);let $=this.config.recoveryEnabled;for(;b<A;){let t;l=null,u=-1;let n=e.charCodeAt(b);if(M){let e=x[oP(n)];t=void 0!==e?e:U}else t=C;let E=t.length;for(r=0;r<E;r++){let i=(T=t[r]).pattern;c=null;let d=T.short;if(!1!==d?n===d&&(u=1,l=i):!0===T.isCustom?null!==(g=i.exec(e,b,L,k))?(u=(l=g[0]).length,void 0!==g.payload&&(c=g.payload)):l=null:(i.lastIndex=b,u=this.matchLength(i,e,b)),-1!==u){if(void 0!==(o=T.longerAlt)){l=e.substring(b,b+u);let t=o.length;for(s=0;s<t;s++){let t=C[o[s]],n=t.pattern;if(h=null,!0===t.isCustom?null!==(g=n.exec(e,b,L,k))?(a=g[0],void 0!==g.payload&&(h=g.payload)):a=null:(n.lastIndex=b,a=this.match(n,e,b)),a&&a.length>l.length){l=a,u=a.length,c=h,T=t;break}}}break}}if(-1!==u){if(void 0!==(d=T.group)&&(l=null!==l?l:e.substring(b,b+u),p=T.tokenTypeIdx,f=this.createTokenInstance(l,b,p,T.tokenType,O,R,u),this.handlePayload(f,c),!1===d?S=this.addToken(L,S,f):k[d].push(f)),!0===N&&!0===T.canLineTerminator){let t,n,r=0;_.lastIndex=0;do l=null!==l?l:e.substring(b,b+u),!0===(t=_.test(l))&&(n=_.lastIndex-1,r++);while(!0===t)0!==r?(O+=r,R=u-n,this.updateTokenEndLineColumnLocation(f,d,n,r,O,R,u)):R=this.computeNewColumn(R,u)}else R=this.computeNewColumn(R,u);b+=u,this.handleModes(T,P,D,f)}else{let t=b,n=O,r=R,s=!1===$;for(;!1===s&&b<A;)for(b++,i=0;i<I;i++){let t=C[i],n=t.pattern,r=t.short;if(!1!==r?e.charCodeAt(b)===r&&(s=!0):!0===t.isCustom?s=null!==n.exec(e,b,L,k):(n.lastIndex=b,s=null!==n.exec(e)),!0===s)break}if(m=b-t,R=this.computeNewColumn(R,m),y=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(e,t,m,n,r,oD(w)),v.push({offset:t,line:n,column:r,length:m,message:y}),!1===$)break}}return this.hasCustom||(L.length=S),{tokens:L,groups:k,errors:v}}handleModes(e,t,n,r){if(!0===e.pop){let i=e.push;t(r),void 0!==i&&n.call(this,i)}else void 0!==e.push&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,t,n,r,i,s,a){let o,l;void 0!==t&&(l=(o=n===a-1)?-1:0,(1!==r||!0!==o)&&(e.endLine=i+l,e.endColumn=s-1+-l))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,s){return{image:e,startOffset:t,startLine:i,startColumn:s,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,s,a){return{image:e,startOffset:t,endOffset:t+a-1,startLine:i,endLine:i,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,++t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){null!==t&&(e.payload=t)}match(e,t,n){return!0===e.test(t)?t.substring(n,e.lastIndex):null}matchLength(e,t,n){return!0===e.test(t)?e.lastIndex-n:-1}}function oX(e){return oJ(e)?e.LABEL:e.name}function oJ(e){return aM(e.LABEL)&&""!==e.LABEL}oY.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",oY.NA=/NOT_APPLICABLE/;let oq="categories",oZ="label",oQ="group",o0="push_mode",o1="pop_mode",o2="longer_alt",o3="line_breaks",o6="start_chars_hint";function o5(e){let t=e.pattern,n={};if(n.name=e.name,aP(t)||(n.PATTERN=t),nl(e,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return nl(e,oq)&&(n.CATEGORIES=e[oq]),oG([n]),nl(e,oZ)&&(n.LABEL=e[oZ]),nl(e,oQ)&&(n.GROUP=e[oQ]),nl(e,o1)&&(n.POP_MODE=e[o1]),nl(e,o0)&&(n.PUSH_MODE=e[o0]),nl(e,o2)&&(n.LONGER_ALT=e[o2]),nl(e,o3)&&(n.LINE_BREAKS=e[o3]),nl(e,o6)&&(n.START_CHARS_HINT=e[o6]),n}let o4=o5({name:"EOF",pattern:oY.NA});function o8(e,t,n,r,i,s,a,o){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}oG([o4]);let o9={buildMismatchTokenMessage({expected:e,actual:t,previous:n,ruleName:r}){let i=oJ(e)?`--\x3e ${oX(e)} <--`:`token of type --\x3e ${e.name} <--`;return`Expecting ${i} but found --\x3e '${t.image}' <--`},buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){let s="Expecting: ",a="\nbut found: '"+oa(t).image+"'";if(r)return s+r+a;{let t=ns(oe(e,(e,t)=>e.concat(t),[]),e=>`[${ns(e,e=>oX(e)).join(", ")}]`),n=ns(t,(e,t)=>` ${t+1}. ${e}`);return s+`one of these possible Token sequences:
|
|
25
|
-
${n.join("\n")}`+a}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){let i="Expecting: ",s="\nbut found: '"+oa(t).image+"'";if(n)return i+n+s;{let t=ns(e,e=>`[${ns(e,e=>oX(e)).join(",")}]`);return i+`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
26
|
-
<${t.join(" ,")}>`+s}}};Object.freeze(o9);let o7={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},le={buildDuplicateFoundError(e,t){let n=e.name,r=oa(t),i=r.idx,s=al(r),a=r instanceof sX?r.terminalType.name:r instanceof sF?r.nonTerminalName:"",o=`->${s}${i>0?i:""}<- ${a?`with argument: ->${a}<-`:""}
|
|
27
|
-
appears more than once (${t.length} times) in the top level rule: ->${n}<-.
|
|
28
|
-
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
29
|
-
`;return(o=o.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.
|
|
30
|
-
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.
|
|
31
|
-
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
32
|
-
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
33
|
-
and Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){let t=ns(e.prefixPath,e=>oX(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
34
|
-
in <OR${n}> inside <${e.topLevelRule.name}> Rule,
|
|
35
|
-
<${t}> may appears as a prefix path in all these alternatives.
|
|
36
|
-
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
37
|
-
For Further details.`},buildAlternationAmbiguityError(e){let t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,
|
|
38
|
-
`;if(n)r+=`These alternatives are all empty (match no tokens), making them indistinguishable.
|
|
39
|
-
Only the last alternative may be empty.
|
|
40
|
-
`;else{let t=ns(e.prefixPath,e=>oX(e)).join(", ");r+=`<${t}> may appears as a prefix path in all these alternatives.
|
|
41
|
-
`}return r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
42
|
-
For Further details.`},buildEmptyRepetitionError(e){let t=al(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.
|
|
43
|
-
This could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
|
44
|
-
Only the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:
|
|
45
|
-
<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
|
46
|
-
has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){let t=e.topLevelRule.name,n=ns(e.leftRecursionPath,e=>e.name),r=`${t} --\x3e ${n.concat([t]).join(" --\x3e ")}`;return`Left Recursion found in grammar.
|
|
47
|
-
rule: <${t}> can be invoked from itself (directly or indirectly)
|
|
48
|
-
without consuming any Tokens. The grammar path that causes this is:
|
|
49
|
-
${r}
|
|
50
|
-
To fix this refactor your grammar to remove the left recursion.
|
|
51
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sB?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class lt extends sJ{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){eD(ej(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:I.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}var ln=function(e,t){return aL(ns(e,t),1)},lr=function(e,t,n,r){for(var i=-1,s=null==e?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r},li=function(e,t,n,r){return eM(e,function(e,i,s){t(r,e,n(e),s)}),r},ls=Object.prototype.hasOwnProperty,la=(L=function(e,t,n){ls.call(e,n)?e[n].push(t):nh(e,n,[t])},function(e,t){return(eo(e)?lr:li)(e,L,nr(t),{})}),lo=function(e,t,n,r){if(!eC(e))return e;t=t4(t,e);for(var i=-1,s=t.length,a=s-1,o=e;null!=o&&++i<s;){var l=t8(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)break;if(i!=a){var h=o[l];void 0===(c=r?r(h,l,o):void 0)&&(c=eC(h)?h:ep(t[i+1])?[]:{})}nd(o,l,c),o=o[l]}return e},ll=function(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=t9(e,a);n(o,a)&&lo(s,t4(a,e),o)}return s},lc=function(e,t){if(null==e)return{};var n=e$(nR(e),function(e){return[e]});return t=nr(t),ll(e,n,function(e,n){return t(e,n[0])})},lh=function(e,t,n){var r=null==e?0:e.length;return r?nJ(e,0,(t=r-(t=n||void 0===t?1:n5(t)))<0?0:t):[]};class lu extends ac{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=nY(this.path.ruleStack).reverse(),this.occurrenceStack=nY(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){ts(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class ld extends lu{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let e=new sK({definition:t.concat(n)});this.possibleTokTypes=aO(e),this.found=!0}}}class lp extends ac{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class lf extends lp{walkMany(e,t,n){if(e.idx===this.occurrence){let e=oa(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof sX&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class lm extends lp{walkManySep(e,t,n){if(e.idx===this.occurrence){let e=oa(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof sX&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class ly extends lp{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let e=oa(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof sX&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class lg extends lp{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let e=oa(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof sX&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function lT(e,t,n=[]){n=nY(n);let r=[],i=0;function s(s){let a=lT(s.concat(n4(e,i+1)),t,n);return r.concat(a)}for(;n.length<t&&i<e.length;){let t=e[i];if(t instanceof sK)return s(t.definition);if(t instanceof sF)return s(t.definition);if(t instanceof sG)r=s(t.definition);else if(t instanceof sW)return s(t.definition.concat([new sV({definition:t.definition})]));else if(t instanceof sz)return s([new sK({definition:t.definition}),new sV({definition:[new sX({terminalType:t.separator})].concat(t.definition)})]);else if(t instanceof sH)r=s(t.definition.concat([new sV({definition:[new sX({terminalType:t.separator})].concat(t.definition)})]));else if(t instanceof sV)r=s(t.definition.concat([new sV({definition:t.definition})]));else if(t instanceof sY)return eD(t.definition,e=>{!1===ts(e.definition)&&(r=s(e.definition))}),r;else if(t instanceof sX)n.push(t.terminalType);else throw Error("non exhaustive match");i++}return r.push({partialPath:n,suffixDef:n4(e,i)}),r}function lE(e,t,n,r){let i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE",o=!1,l=t.length,c=l-r-1,h=[],u=[];for(u.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!ts(u);){let e=u.pop();if(e===a){o&&oD(u).idx<=c&&u.pop();continue}let r=e.def,d=e.idx,p=e.ruleStack,f=e.occurrenceStack;if(ts(r))continue;let m=r[0];if(m===i){let e={idx:d,def:n4(r),ruleStack:lh(p),occurrenceStack:lh(f)};u.push(e)}else if(m instanceof sX)if(d<l-1){let e=d+1;if(n(t[e],m.terminalType)){let t={idx:e,def:n4(r),ruleStack:p,occurrenceStack:f};u.push(t)}}else if(d===l-1)h.push({nextTokenType:m.terminalType,nextTokenOccurrence:m.idx,ruleStack:p,occurrenceStack:f}),o=!0;else throw Error("non exhaustive match");else if(m instanceof sF){let e=nY(p);e.push(m.nonTerminalName);let t=nY(f);t.push(m.idx);let n={idx:d,def:m.definition.concat(s,n4(r)),ruleStack:e,occurrenceStack:t};u.push(n)}else if(m instanceof sG){let e={idx:d,def:n4(r),ruleStack:p,occurrenceStack:f};u.push(e),u.push(a);let t={idx:d,def:m.definition.concat(n4(r)),ruleStack:p,occurrenceStack:f};u.push(t)}else if(m instanceof sW){let e=new sV({definition:m.definition,idx:m.idx}),t={idx:d,def:m.definition.concat([e],n4(r)),ruleStack:p,occurrenceStack:f};u.push(t)}else if(m instanceof sz){let e=new sV({definition:[new sX({terminalType:m.separator})].concat(m.definition),idx:m.idx}),t={idx:d,def:m.definition.concat([e],n4(r)),ruleStack:p,occurrenceStack:f};u.push(t)}else if(m instanceof sH){let e={idx:d,def:n4(r),ruleStack:p,occurrenceStack:f};u.push(e),u.push(a);let t=new sV({definition:[new sX({terminalType:m.separator})].concat(m.definition),idx:m.idx}),n={idx:d,def:m.definition.concat([t],n4(r)),ruleStack:p,occurrenceStack:f};u.push(n)}else if(m instanceof sV){let e={idx:d,def:n4(r),ruleStack:p,occurrenceStack:f};u.push(e),u.push(a);let t=new sV({definition:m.definition,idx:m.idx}),n={idx:d,def:m.definition.concat([t],n4(r)),ruleStack:p,occurrenceStack:f};u.push(n)}else if(m instanceof sY)for(let e=m.definition.length-1;e>=0;e--){let t={idx:d,def:m.definition[e].definition.concat(n4(r)),ruleStack:p,occurrenceStack:f};u.push(t),u.push(a)}else if(m instanceof sK)u.push({idx:d,def:m.definition.concat(n4(r)),ruleStack:p,occurrenceStack:f});else if(m instanceof sB)u.push(function(e,t,n,r){let i=nY(n);i.push(e.name);let s=nY(r);return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}(m,d,p,f));else throw Error("non exhaustive match")}return h}function lA(e){if(e instanceof sG||"Option"===e)return N.OPTION;if(e instanceof sV||"Repetition"===e)return N.REPETITION;if(e instanceof sW||"RepetitionMandatory"===e)return N.REPETITION_MANDATORY;if(e instanceof sz||"RepetitionMandatoryWithSeparator"===e)return N.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof sH||"RepetitionWithSeparator"===e)return N.REPETITION_WITH_SEPARATOR;else if(e instanceof sY||"Alternation"===e)return N.ALTERNATION;else throw Error("non exhaustive match")}function lb(e,t,n,r){let i=e.length,s=op(e,e=>op(e,e=>1===e.length));if(t)return function(t){let r=ns(t,e=>e.GATE);for(let t=0;t<i;t++){let i=e[t],s=i.length,a=r[t];if(void 0===a||!1!==a.call(this))t:for(let e=0;e<s;e++){let r=i[e],s=r.length;for(let e=0;e<s;e++)if(!1===n(this.LA(e+1),r[e]))continue t;return t}}};if(!s||r)return function(){for(let t=0;t<i;t++){let r=e[t],i=r.length;t:for(let e=0;e<i;e++){let i=r[e],s=i.length;for(let e=0;e<s;e++)if(!1===n(this.LA(e+1),i[e]))continue t;return t}}};{let t=oe(ns(e,e=>av(e)),(e,t,n)=>(eD(t,t=>{nl(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),eD(t.categoryMatches,t=>{nl(e,t)||(e[t]=n)})}),e),{});return function(){return t[this.LA(1).tokenTypeIdx]}}}function lS(e,t,n){let r=op(e,e=>1===e.length),i=e.length;if(!r||n)return function(){t:for(let n=0;n<i;n++){let r=e[n],i=r.length;for(let e=0;e<i;e++)if(!1===t(this.LA(e+1),r[e]))continue t;return!0}return!1};{let t=av(e);if(1===t.length&&ts(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{let e=oe(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,eD(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){return!0===e[this.LA(1).tokenTypeIdx]}}}}(v=N||(N={}))[v.OPTION=0]="OPTION",v[v.REPETITION=1]="REPETITION",v[v.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",v[v.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",v[v.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",v[v.ALTERNATION=5]="ALTERNATION";class lL extends ac{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)}walkOption(e,t,n){this.checkIsTarget(e,N.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,N.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,N.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,N.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,N.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}}class lv extends sJ{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(void 0===this.targetRef||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,N.OPTION)}visitRepetition(e){this.checkIsTarget(e,N.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,N.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,N.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,N.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,N.ALTERNATION)}}function lO(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function lR(e){let t=[""];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let e=0;e<t.length;e++){let n=t[e];i.push(n+"_"+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){let t="_"+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function lk(e,t){let n=ns(e,e=>lT([e],1)),r=lO(n.length),i=ns(n,e=>{let t={};return eD(e,e=>{eD(lR(e.partialPath),e=>{t[e]=!0})}),t}),s=n;for(let e=1;e<=t;e++){let n=s;s=lO(n.length);for(let a=0;a<n.length;a++){let o=n[a];for(let n=0;n<o.length;n++){let l=o[n].partialPath,c=o[n].suffixDef,h=lR(l);if(function(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let e=0;e<t.length;e++)if(!0===i[t[e]])return!1}return!0}(i,h,a)||ts(c)||l.length===t){let e=r[a];if(!1===lI(e,l)){e.push(l);for(let e=0;e<h.length;e++){let t=h[e];i[a][t]=!0}}}else{let t=lT(c,e+1,l);s[a]=s[a].concat(t),eD(t,e=>{eD(lR(e.partialPath),e=>{i[a][e]=!0})})}}}}return r}function lN(e,t,n,r){let i=new lv(e,N.ALTERNATION,r);return t.accept(i),lk(i.result,n)}function l_(e,t,n,r){let i=new lv(e,n);t.accept(i);let s=i.result,a=new lL(t,e,n).startWalking();return lk([new sK({definition:s}),new sK({definition:a})],r)}function lI(e,t){n:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){let n=t[e],i=r[e];if(!1==(n===i||void 0!==i.categoryMatchesMap[n.tokenTypeIdx]))continue n}return!0}}return!1}function lC(e){return op(e,e=>op(e,e=>op(e,e=>ts(e.categoryMatches))))}function lx(e){return`${al(e)}_#_${e.idx}_#_${lw(e)}`}function lw(e){return e instanceof sX?e.terminalType.name:e instanceof sF?e.nonTerminalName:""}class lU extends sJ{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}class lM extends sJ{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class lP extends sJ{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}let lD="MismatchedTokenException",l$="NoViableAltException",lj="EarlyExitException",lF="NotAllInputParsedException",lB=[lD,l$,lj,lF];function lK(e){return a5(lB,e.name)}Object.freeze(lB);class lG extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class lW extends lG{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=lD}}class lz extends lG{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=l$}}class lV extends lG{constructor(e,t){super(e,t),this.name=lF}}class lH extends lG{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=lj}}let lY={},lX="InRuleRecoveryException";class lJ extends Error{constructor(e){super(e),this.name=lX}}function lq(e,t,n,r,i,s,a){let o=this.getKeyForAutomaticLookahead(r,i),l=this.firstAfterRepMap[o];if(void 0===l){let e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,h=l.occurrence,u=l.isEndOfRule;1===this.RULE_STACK.length&&u&&void 0===c&&(c=o4,h=1),void 0!==c&&void 0!==h&&this.shouldInRepetitionRecoveryBeTried(c,h,a)&&this.tryInRepetitionRecovery(e,t,n,c)}class lZ{constructor(e){var t;this.maxLookahead=null!=(t=null==e?void 0:e.maxLookahead)?t:cs.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);return ts(t)?[...t,...this.validateEmptyOrAlternatives(e.rules),...this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),...this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead)]:t}validateNoLeftRecursion(e){return ln(e,e=>(function e(t,n,r,i=[]){let s=[],a=function e(t){let n=[];if(ts(t))return n;let r=oa(t);if(r instanceof sF)n.push(r.referencedRule);else if(r instanceof sK||r instanceof sG||r instanceof sW||r instanceof sz||r instanceof sH||r instanceof sV)n=n.concat(e(r.definition));else if(r instanceof sY)n=av(ns(r.definition,t=>e(t.definition)));else if(r instanceof sX);else throw Error("non exhaustive match");let i=ao(r),s=t.length>1;if(!i||!s)return n;{let r=n4(t);return n.concat(e(r))}}(n.definition);if(ts(a))return[];{let n=t.name;a5(a,t)&&s.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:i}),type:I.LEFT_RECURSION,ruleName:n});let o=ln(oi(a,i.concat([t])),n=>{let s=nY(i);return s.push(n),e(t,n,r,s)});return s.concat(o)}})(e,e,le))}validateEmptyOrAlternatives(e){return ln(e,e=>{let t;return t=new lM,e.accept(t),ln(t.alternations,t=>ln(lh(t.definition),(n,r)=>ts(lE([n],[],oj,1))?[{message:le.buildEmptyAlternationError({topLevelRule:e,alternation:t,emptyChoiceIdx:r}),type:I.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:t.idx,alternative:r+1}]:[]))})}validateAmbiguousAlternationAlternatives(e,t){return ln(e,e=>{let n;return n=new lM,e.accept(n),ln(a1(n.alternations,e=>!0===e.ignoreAmbiguities),n=>{var r,i,s,a,o,l,c,h;let u,d,p=lN(n.idx,e,n.maxLookahead||t,n),f=(r=p,i=n,s=e,a=le,u=[],ns(oe(r,(e,t,n)=>(!0===i.definition[n].ignoreAmbiguities||eD(t,t=>{let s=[n];eD(r,(e,r)=>{n!==r&&lI(e,t)&&!0!==i.definition[r].ignoreAmbiguities&&s.push(r)}),s.length>1&&!lI(u,t)&&(u.push(t),e.push({alts:s,path:t}))}),e),[]),e=>{let t=ns(e.alts,e=>e+1);return{message:a.buildAlternationAmbiguityError({topLevelRule:s,alternation:i,ambiguityIndices:t,prefixPath:e.path}),type:I.AMBIGUOUS_ALTS,ruleName:s.name,occurrence:i.idx,alternatives:e.alts}})),m=(o=p,l=n,c=e,h=le,os(ln(d=oe(o,(e,t,n)=>{let r=ns(t,e=>({idx:n,path:e}));return e.concat(r)},[]),e=>{if(!0===l.definition[e.idx].ignoreAmbiguities)return[];let t=e.idx,n=e.path;return ns(ot(d,e=>{var r;return!0!==l.definition[e.idx].ignoreAmbiguities&&e.idx<t&&(r=e.path,r.length<n.length&&op(r,(e,t)=>{let r=n[t];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]}))}),e=>{let n=[e.idx+1,t+1],r=0===l.idx?"":l.idx;return{message:h.buildAlternationPrefixAmbiguityError({topLevelRule:c,alternation:l,ambiguityIndices:n,prefixPath:e.path}),type:I.AMBIGUOUS_PREFIX_ALTS,ruleName:c.name,occurrence:r,alternatives:n}})})));return f.concat(m)})})}validateSomeNonEmptyLookaheadPath(e,t){let n;return n=[],eD(e,e=>{let r=new lP;e.accept(r),eD(r.allProductions,r=>{let i=lA(r),s=r.maxLookahead||t;if(ts(av(l_(r.idx,e,i,s)[0]))){let t=le.buildEmptyRepetitionError({topLevelRule:e,repetition:r});n.push({message:t,type:I.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),n}buildLookaheadForAlternation(e){var t,n,r,i,s;let a,o;return t=e.prodOccurrence,n=e.rule,r=e.maxLookahead,i=e.hasPredicates,s=e.dynamicTokensEnabled,o=lC(a=lN(t,n,r))?oF:oj,lb(a,i,o,s)}buildLookaheadForOptional(e){var t,n,r,i,s;let a,o;return t=e.prodOccurrence,n=e.rule,r=e.maxLookahead,i=e.dynamicTokensEnabled,s=lA(e.prodType),o=lC(a=l_(t,n,s,r))?oF:oj,lS(a[0],o,i)}}let lQ=new class extends sJ{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function l0(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset)}function l1(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function l2(e,t){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t})}function l3(e,t){let n=eU(e),r=n.length;for(let i=0;i<r;i++){let r=e[n[i]],s=r.length;for(let e=0;e<s;e++){let n=r[e];void 0===n.tokenTypeIdx&&this[n.name](n.children,t)}}}(O=_||(_={}))[O.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",O[O.MISSING_METHOD=1]="MISSING_METHOD";var l6=function(e,t){var n;return eM(e,function(e,r,i){return!(n=t(e,r,i))}),!!n},l5=function(e,t,n){var r=eo(e)?tE:l6;return n&&aC(e,t,n)&&(t=void 0),r(e,nr(t))};let l4={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(l4);let l8=o5({name:"RECORDING_PHASE_TOKEN",pattern:oY.NA});oG([l8]);let l9=o8(l8,"This IToken indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(l9);let l7={name:"This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function ce(e,t,n,r=!1){cr(n);let i=oD(this.recordingProdStack),s=ex(t)?t:t.DEF,a=new e({definition:[],idx:n});return r&&(a.separator=t.SEP),nl(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),l4}function ct(e,t){cr(t);let n=oD(this.recordingProdStack),r=!1===eo(e),i=!1===r?e:e.DEF,s=new sY({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});return nl(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),s.hasPredicates=l5(i,e=>ex(e.GATE)),n.definition.push(s),eD(i,e=>{let t=new sK({definition:[]});s.definition.push(t),nl(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:nl(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),l4}function cn(e){return 0===e?"":`${e}`}function cr(e){if(e<0||e>255){let t=Error(`Invalid DSL Method idx value: <${e}>
|
|
52
|
-
Idx value must be a none negative value smaller than ${256}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}let ci=o8(o4,"",0/0,0/0,0/0,0/0,0/0,0/0);Object.freeze(ci);let cs=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:o9,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ca=Object.freeze({recoveryValueFunc:()=>void 0,resyncEnabled:!0});(R=I||(I={}))[R.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",R[R.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",R[R.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",R[R.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",R[R.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",R[R.LEFT_RECURSION=5]="LEFT_RECURSION",R[R.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",R[R.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",R[R.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",R[R.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",R[R.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",R[R.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",R[R.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",R[R.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION";class co{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let t=this.className;this.TRACE_INIT("toFastProps",()=>{nX(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),eD(this.definedRulesNames,e=>{let t,n=this[e].originalGrammarAction;this.TRACE_INIT(`${e} Rule`,()=>{t=this.topLevelRuleRecord(e,n)}),this.gastProductionsCache[e]=t})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{var e;let t,r,i;r=aZ(e={rules:ej(this.gastProductionsCache)},{errMsgProvider:o7}),i={},eD(e.rules,e=>{i[e.name]=e}),(t=new lt(i,r.errMsgProvider)).resolveRefs(),n=t.errors,this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(ts(n)&&!1===this.skipValidations){var e,r,i,s,a,o,l,c,h;let n,u,d,p,f,m,y=(r=(e=aZ(e={rules:ej(this.gastProductionsCache),tokenTypes:ej(this.tokensMap),errMsgProvider:le,grammarName:t},{errMsgProvider:le})).rules,i=e.tokenTypes,s=e.errMsgProvider,a=e.grammarName,d=ln(r,e=>{var t,n;let r;return t=e,n=s,r=new lU,t.accept(r),ns(ej(lc(la(r.allProductions,lx),e=>e.length>1)),e=>{let r=oa(e),i=n.buildDuplicateFoundError(t,e),s=al(r),a={message:i,type:I.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:s,occurrence:r.idx},o=lw(r);return o&&(a.parameter=o),a})}),l=r,c=i,h=s,n=[],u=ns(c,e=>e.name),eD(l,e=>{let t=e.name;if(a5(u,t)){let r=h.buildNamespaceConflictError(e);n.push({message:r,type:I.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),p=n,f=ln(r,e=>{var t,n;let r;return t=e,n=s,r=new lM,t.accept(r),ln(r.alternations,e=>e.definition.length>255?[{message:n.buildTooManyAlternativesError({topLevelRule:t,alternation:e}),type:I.TOO_MANY_ALTS,ruleName:t.name,occurrence:e.idx}]:[])}),m=ln(r,e=>(function(e,t,n,r){let i=[];if(oe(t,(t,n)=>n.name===e.name?t+1:t,0)>1){let t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:I.DUPLICATE_RULE_NAME,ruleName:e.name})}return i})(e,r,a,s)),d.concat(p,f,m)),g=ns((o={lookaheadStrategy:this.lookaheadStrategy,rules:ej(this.gastProductionsCache),tokenTypes:ej(this.tokensMap),grammarName:t}).lookaheadStrategy.validate({rules:o.rules,tokenTypes:o.tokenTypes,grammarName:o.grammarName}),e=>Object.assign({type:I.CUSTOM_LOOKAHEAD_VALIDATION},e));this.definitionErrors=this.definitionErrors.concat(y,g)}}),ts(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{var e;let t,n=(e=ej(this.gastProductionsCache),t={},eD(e,e=>{aw(t,new aU(e).startWalking())}),t);this.resyncFollows=n}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null==(t=(e=this.lookaheadStrategy).initialize)||t.call(e,{rules:ej(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(ej(this.gastProductionsCache))})),!co.DEFER_DEFINITION_ERRORS_HANDLING&&!ts(this.definitionErrors))throw e=ns(this.definitionErrors,e=>e.message),Error(`Parser Definition Errors detected:
|
|
53
|
-
${e.join("\n-------------------------------\n")}`)})}constructor(e,t){if(this.definitionErrors=[],this.selfAnalysisDone=!1,this.initErrorHandler(t),this.initLexerAdapter(),this.initLooksAhead(t),this.initRecognizerEngine(e,t),this.initRecoverable(t),this.initTreeBuilder(t),this.initContentAssist(),this.initGastRecorder(t),this.initPerformanceTracer(t),nl(t,"ignoredIssues"))throw Error("The <ignoredIssues> IParserConfig property has been deprecated.\n Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.");this.skipValidations=nl(t,"skipValidations")?t.skipValidations:cs.skipValidations}}co.DEFER_DEFINITION_ERRORS_HANDLING=!1,[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=nl(e,"recoveryEnabled")?e.recoveryEnabled:cs.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=lq)}getTokenToInsert(e){let t=o8(e,"",0/0,0/0,0/0,0/0,0/0,0/0);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){let i=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],o=!1,l=this.LA(1),c=this.LA(1),h=()=>{let e=this.LA(0),t=new lW(this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),l,this.LA(0));t.resyncedTokens=lh(a),this.SAVE_ERROR(t)};for(;!o;)if(this.tokenMatcher(c,r))return void h();else if(n.call(this)){h(),e.apply(this,t);return}else this.tokenMatcher(c,i)?o=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!(!1===n||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new lJ("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||ts(t))return!1;let n=this.LA(1);return void 0!==ol(t,e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey();return a5(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),n=2;for(;;){let r=ol(e,e=>oj(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return lY;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return ns(e,(n,r)=>0===r?lY:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return av(ns(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===lY)return[o4];let t=e.ruleName+e.idxInCallingRule+"_~IN~_"+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,o4)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return lh(t)}attemptInRepetitionRecovery(e,t,n,r,i,s,a){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:nY(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return ns(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},class{initLooksAhead(e){this.dynamicTokensEnabled=nl(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:cs.dynamicTokensEnabled,this.maxLookahead=nl(e,"maxLookahead")?e.maxLookahead:cs.maxLookahead,this.lookaheadStrategy=nl(e,"lookaheadStrategy")?e.lookaheadStrategy:new lZ({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){eD(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{var t;let n,{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=(t=e,lQ.reset(),t.accept(lQ),n=lQ.dslMethods,lQ.reset(),n);eD(r,t=>{let n=0===t.idx?"":t.idx;this.TRACE_INIT(`${al(t)}${n}`,()=>{var n;let r=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),i=(n=this.fullRuleNameToShort[e.name],256|t.idx|n);this.setLaFuncCache(i,r)})}),eD(i,t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,al(t))}),eD(s,t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,al(t))}),eD(a,t=>{this.computeLookaheadFunc(e,t.idx,1024,"RepetitionMandatory",t.maxLookahead,al(t))}),eD(o,t=>{this.computeLookaheadFunc(e,t.idx,1536,"RepetitionMandatoryWithSeparator",t.maxLookahead,al(t))}),eD(l,t=>{this.computeLookaheadFunc(e,t.idx,1280,"RepetitionWithSeparator",t.maxLookahead,al(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{let s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),a=t|n|this.fullRuleNameToShort[e.name];this.setLaFuncCache(a,s)})}getKeyForAutomaticLookahead(e,t){return t|e|this.getLastExplicitRuleShortName()}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=nl(e,"nodeLocationTracking")?e.nodeLocationTracking:cs.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=l1,this.setNodeLocationFromNode=l1,this.cstPostRule=ag,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ag,this.setNodeLocationFromNode=ag,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=l0,this.setNodeLocationFromNode=l0,this.cstPostRule=ag,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ag,this.setNodeLocationFromNode=ag,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ag,this.setNodeLocationFromNode=ag,this.cstPostRule=ag,this.setInitialNodeLocation=ag;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);else this.cstInvocationStateUpdate=ag,this.cstFinallyStateUpdate=ag,this.cstPostTerminal=ag,this.cstPostNonTerminal=ag,this.cstPostRule=ag}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:0/0,endOffset:0/0}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:0/0}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:0/0,startLine:0/0,startColumn:0/0,endOffset:0/0,endLine:0/0,endColumn:0/0}}setInitialNodeLocationFullRegular(e){let t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:0/0,endLine:0/0,endColumn:0/0}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==!0?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=0/0,n.startLine=0/0,n.startColumn=0/0)}cstPostRuleOnlyOffset(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==!0?n.endOffset=t.endOffset:n.startOffset=0/0}cstPostTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];void 0===n.children[e]?n.children[e]=[t]:n.children[e].push(t),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];void 0===n.children[t]?n.children[t]=[e]:n.children[t].push(e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(aP(this.baseCstVisitorConstructor)){var e,t;let n,r=(e=this.className,t=eU(this.gastProductionsCache),l2(n=function(){},e+"BaseSemantics"),n.prototype={visit:function(e,t){if(eo(e)&&(e=e[0]),!aP(e))return this[e.name](e.children,t)},validateVisitor:function(){var e,n,r;let i=(e=this,n=t,r=e,os(ns(ot(n,e=>!1===ex(r[e])),e=>({msg:`Missing visitor method: <${e}> on ${r.constructor.name} CST Visitor.`,type:_.MISSING_METHOD,methodName:e}))));if(!ts(i)){let e=ns(i,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
54
|
-
${e.join("\n\n").replace(/\n/g,"\n ")}`)}}},n.prototype.constructor=n,n._RULE_NAMES=t,n);return this.baseCstVisitorConstructor=r,r}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(aP(this.baseCstVisitorWithDefaultsConstructor)){var e,t,n;let r,i,s=(e=this.className,t=eU(this.gastProductionsCache),n=this.getBaseCstVisitorConstructor(),l2(r=function(){},e+"BaseSemanticsWithDefaults"),i=Object.create(n.prototype),eD(t,e=>{i[e]=l3}),r.prototype=i,r.prototype.constructor=r,r);return this.baseCstVisitorWithDefaultsConstructor=s,s}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):ci}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ci:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=oF,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},nl(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");if(eo(e)){if(ts(e))throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details.")}if(eo(e))this.tokensMap=oe(e,(e,t)=>(e[t.name]=t,e),{});else if(nl(e,"modes")&&op(av(ej(e.modes)),oV)){let t=aA(av(ej(e.modes)));this.tokensMap=oe(t,(e,t)=>(e[t.name]=t,e),{})}else if(eC(e))this.tokensMap=nY(e);else throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=o4;let n=op(nl(e,"modes")?av(ej(e.modes)):ej(e),e=>ts(e.categoryMatches));this.tokenMatcher=n?oF:oj,oG(ej(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
55
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let r=nl(n,"resyncEnabled")?n.resyncEnabled:ca.resyncEnabled,i=nl(n,"recoveryValueFunc")?n.recoveryValueFunc:ca.recoveryValueFunc,s=this.ruleShortNameIdx<<12;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,Object.assign(!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);let r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){let r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(lK(e)){if(i){let t=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(t)){if(e.resyncedTokens=this.reSyncTo(t),!this.outputCst)return n(e);{let e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}}if(this.outputCst){let t=this.CST_STACK[this.CST_STACK.length-1];t.recoveredNode=!0,e.partialCstResult=t}throw e}if(r)return this.moveToTerminatedState(),n(e)}throw e}optionInternal(e,t){let n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;let t=e.GATE;if(void 0!==t){let e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;let e=t.GATE;if(void 0!==e){let t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0===i.call(this)){let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}else throw this.raiseEarlyExitException(e,N.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,1024,e,ly)}atLeastOneSepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);let t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,lg],t,1536,e,lg)}else throw this.raiseEarlyExitException(e,N.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;let e=t.GATE;if(void 0!==e){let t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,lf,s)}manySepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);let t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,lm],t,1280,e,lm)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,1536,e,i)}doSingleRepetition(e){let t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){let n=this.getKeyForAutomaticLookahead(256,t),r=eo(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){let e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new lV(t,e))}}subruleInternal(e,t,n){let r;try{let i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw lK(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{let t=this.LA(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r,i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new lW(r,t,i))}consumeInternalRecovery(e,t,n){if(this.recoveryEnabled&&"MismatchedTokenException"===n.name&&!this.isBackTracking()){let r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){if(e.name===lX)throw n;throw e}}throw n}saveRecogState(){let e=this.errors,t=nY(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),o4)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=ca){if(a5(this.definedRulesNames,e)){let t={message:le.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:I.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);let r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=ca){var r,i;let s,a,o=(r=this.definedRulesNames,i=this.className,a=[],a5(r,e)||(s=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${i}<-as it is not defined in any of the super grammars `,a.push({message:s,type:I.INVALID_RULE_OVERRIDE,ruleName:e})),a);this.definitionErrors=this.definitionErrors.concat(o);let l=this.defineRule(e,t,n);return this[e]=l,l}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(lK(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return sP(ej(this.gastProductionsCache),function e(t){function n(t){return sP(t,e)}if(t instanceof sF){let e={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return ru(t.label)&&(e.label=t.label),e}if(t instanceof sK)return{type:"Alternative",definition:n(t.definition)};if(t instanceof sG)return{type:"Option",idx:t.idx,definition:n(t.definition)};if(t instanceof sW)return{type:"RepetitionMandatory",idx:t.idx,definition:n(t.definition)};if(t instanceof sz)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:e(new sX({terminalType:t.separator})),definition:n(t.definition)};else if(t instanceof sH)return{type:"RepetitionWithSeparator",idx:t.idx,separator:e(new sX({terminalType:t.separator})),definition:n(t.definition)};else if(t instanceof sV)return{type:"Repetition",idx:t.idx,definition:n(t.definition)};else if(t instanceof sY)return{type:"Alternation",idx:t.idx,definition:n(t.definition)};else if(t instanceof sX){var r,i;let e={type:"Terminal",name:t.terminalType.name,label:ru((i=r=t.terminalType).LABEL)&&""!==i.LABEL?r.LABEL:r.name,idx:t.idx};ru(t.label)&&(e.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(e.pattern=s$(n)?n.source:n),e}else if(t instanceof sB)return{type:"Rule",name:t.name,orgText:t.orgText,definition:n(t.definition)};else throw Error("non exhaustive match")})}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=nl(e,"errorMessageProvider")?e.errorMessageProvider:cs.errorMessageProvider}SAVE_ERROR(e){if(lK(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:nY(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return nY(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){let r=this.getCurrRuleFullName(),i=l_(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));let a=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new lH(a,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){let n=this.getCurrRuleFullName(),r=lN(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));let s=this.LA(0),a=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new lz(a,this.LA(1),s))}},class{initContentAssist(){}computeContentAssist(e,t){let n=this.gastProductionsCache[e];if(aP(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return lE([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let t=oa(e.ruleStack);return new ld(this.getGAstProductions()[t],e).startWalking()}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{for(let e=0;e<10;e++){let t=e>0?e:"";delete this[`CONSUME${t}`],delete this[`SUBRULE${t}`],delete this[`OPTION${t}`],delete this[`OR${t}`],delete this[`MANY${t}`],delete this[`MANY_SEP${t}`],delete this[`AT_LEAST_ONE${t}`],delete this[`AT_LEAST_ONE_SEP${t}`]}delete this.consume,delete this.subrule,delete this.option,delete this.or,delete this.many,delete this.atLeastOne,delete this.ACTION,delete this.BACKTRACK,delete this.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ci}topLevelRuleRecord(e,t){try{let n=new sB({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n This error was thrown during the "grammar recording phase" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return ce.call(this,sG,e,t)}atLeastOneInternalRecord(e,t){ce.call(this,sW,t,e)}atLeastOneSepFirstInternalRecord(e,t){ce.call(this,sz,t,e,!0)}manyInternalRecord(e,t){ce.call(this,sV,t,e)}manySepFirstInternalRecord(e,t){ce.call(this,sH,t,e,!0)}orInternalRecord(e,t){return ct.call(this,e,t)}subruleInternalRecord(e,t,n){if(cr(t),!e||!1===nl(e,"ruleName")){let n=Error(`<SUBRULE${cn(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
56
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=oD(this.recordingProdStack),i=new sF({idx:t,nonTerminalName:e.ruleName,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(i),this.outputCst?l7:l4}consumeInternalRecord(e,t,n){if(cr(t),!oW(e)){let n=Error(`<CONSUME${cn(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
57
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=oD(this.recordingProdStack),i=new sX({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),l9}},class{initPerformanceTracer(e){if(nl(e,"traceInitPerf")){let t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=cs.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0!==this.traceInitPerf)return t();{this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);let{time:r,value:i}=o$(t),s=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}}}].forEach(e=>{let t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;let r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(co.prototype,n,r):co.prototype[n]=e.prototype[n]})});class cl extends co{constructor(e,t=cs){let n=nY(t);n.outputCst=!0,super(e,n)}}var cc=n("El");function ch(e,t){let n=e.lexer.tokenize(t);if(n.errors.length>0){let r=n.errors[0],i=Number.isFinite(r.offset)?r.offset:t.length,s=i+(Number.isFinite(r.length)?r.length:0);throw Error(`Error lexing ${e.diagramType} diagram: ${r.message} at line ${r.line??1}, column ${r.column??1} [${i},${s})`)}e.parser.input=n.tokens;let r=e.entry();if(e.parser.errors.length>0)throw Error(`Error parsing ${e.diagramType} diagram: ${e.parser.errors[0].message}`);e.visit(r)}(0,j.K)(ch,"runChevrotainParse");var cu=D.UI.usecase,cd=(0,j.K)(()=>({actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,symbols:new Map,direction:"LR",relationshipCounter:0,noteCounter:0,accTitle:"",accDescription:"",ast:void 0,config:structuredClone(cu)}),"createModel"),cp=(0,j.K)(e=>{if(!(e.actors instanceof Map)||!(e.useCases instanceof Map)||!(e.systemBoundaries instanceof Map)||!Array.isArray(e.relationships)||!(e.notes instanceof Map)||!(e.jsonNodes instanceof Map)||!(e.classDefs instanceof Map)||!(e.symbols instanceof Map)||!["TB","TD","BT","RL","LR"].includes(e.direction)||!Number.isSafeInteger(e.relationshipCounter)||e.relationshipCounter<0||!Number.isSafeInteger(e.noteCounter)||e.noteCounter<0||"string"!=typeof e.accTitle||"string"!=typeof e.accDescription||!e.config)throw Error("Cannot commit an incomplete usecase model")},"assertCompleteModel"),cf=cd(),cm=(0,j.K)(()=>structuredClone(cf.config),"getConfig"),cy=(0,j.K)(()=>cf.ast,"getAST"),cg=(0,j.K)(e=>{let t=structuredClone(e);cp(t);let n=(0,D.iN)(),r=(0,D.m7)();try{(0,D.SV)(t.accTitle),(0,D.EI)(t.accDescription),cf=t}catch(e){throw(0,D.SV)(n),(0,D.EI)(r),e}},"commit"),cT=(0,j.K)(()=>{cf=cd(),(0,D.IU)()},"clear"),cE=(0,j.K)(()=>cf.actors,"getActors"),cA=(0,j.K)(e=>cf.actors.get(e),"getActor"),cb=(0,j.K)(()=>cf.useCases,"getUseCases"),cS=(0,j.K)(e=>cf.useCases.get(e),"getUseCase"),cL=(0,j.K)(()=>cf.systemBoundaries,"getSystemBoundaries"),cv=(0,j.K)(e=>cf.systemBoundaries.get(e),"getSystemBoundary"),cO=(0,j.K)(()=>cf.relationships,"getRelationships"),cR=(0,j.K)(()=>cf.notes,"getNotes"),ck=(0,j.K)(e=>cf.notes.get(e),"getNote"),cN=(0,j.K)(()=>cf.jsonNodes,"getJsonNodes"),c_=(0,j.K)(e=>cf.jsonNodes.get(e),"getJsonNode"),cI=(0,j.K)(()=>cf.classDefs,"getClassDefs"),cC=(0,j.K)(e=>cf.classDefs.get(e),"getClassDef"),cx=(0,j.K)(()=>cf.direction,"getDirection"),cw=(0,j.K)(e=>{let t=new Map;for(let n of["default",...e]){let e=cf.classDefs.get(n);if(e)for(let n of e.styles){let e=n.trim(),r=e.indexOf(":"),i=(-1===r?e:e.slice(0,r)).trim();i&&t.set(i,e)}}return[...t.values()]},"getCompiledStyles"),cU=(0,j.K)(e=>e.replaceAll("~","~0").replaceAll("/","~1"),"escapeJsonPointerPart"),cM=(0,j.K)(e=>"string"==typeof e?e:null===e?"null":String(e),"displayJsonScalar"),cP=(0,j.K)((e,t,n=e=>e)=>{let r=[],i=(0,j.K)((e,t,i)=>{r.push({key:n(e),accessibleKey:n(t),value:n(i)})},"append"),s=(0,j.K)((e,n,r)=>{if(Array.isArray(e)){if(0===e.length)return void i(n,n,"[]");if(e.every(e=>null===e||["string","number","boolean"].includes(typeof e))){for(let[t,r]of e.entries())i(0===t?n:"",n,cM(r));return}for(let[t,i]of e.entries())s(i,`${n}[${t}]`,`${r}/${t}`);return}if(null!==e&&"object"==typeof e){let a=t[r]??Object.keys(e);if(0===a.length)return void i(n,n,"{}");for(let t of a){let i=n?`${n}.${t}`:t;s(e[t],i,`${r}/${cU(t)}`)}return}i(n,n,cM(e))},"visit");return s(e,"",""),r},"flattenJsonRows"),cD=(0,j.K)(e=>{switch(e.type){case"hollow":return"usecaseActorHollow";case"awesome":return"usecaseActorAwesome";case"icon":return"usecaseActorIcon";case"normal":return"usecaseActor"}},"actorShape"),c$=(0,j.K)(e=>"ellipse"===e.shape?e.business?"usecaseBusiness":"usecaseEllipse":e.shape,"useCaseShape"),cj=(0,j.K)(e=>{switch(e){case 0:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_point"};case 1:return{arrowTypeStart:"arrow_point",arrowTypeEnd:"none"};case 3:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_circle"};case 4:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_cross"};case 5:return{arrowTypeStart:"arrow_circle",arrowTypeEnd:"none"};case 6:return{arrowTypeStart:"arrow_cross",arrowTypeEnd:"none"};case 2:return{arrowTypeStart:"none",arrowTypeEnd:"none"}}},"associationMarkers"),cF=(0,j.K)(e=>{switch(e.type){case"include":case"extend":return{arrowTypeStart:"none",arrowTypeEnd:"arrow_point",pattern:"dotted",label:e.type,labelType:"text"};case"generalization":return{arrowTypeStart:"none",arrowTypeEnd:"extension",pattern:"solid"};case"association":return{...cj(e.arrowType),pattern:"solid",...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},"relationshipVisuals"),cB=(0,j.K)(e=>e.animate||e.animation?[`edge-animation-${e.animation??"fast"}`]:[],"animationClasses"),cK=(0,j.K)((...e)=>e.filter(e=>!!e).join(" "),"classNames"),cG=(0,j.K)(()=>{let e=(0,D.D7)(),t={...cf.config,...e.usecase},n=(0,j.K)(t=>(0,D.jZ)(t,e),"sanitize"),r=(0,j.K)(e=>n(cf.actors.get(e)?.label??cf.useCases.get(e)?.label??cf.jsonNodes.get(e)?.id??cf.notes.get(e)?.label??e),"endpointLabel"),i=[],s=[],a=0,o=0;for(let t of cf.actors.values())i.push({id:t.id,label:n(t.label),labelType:t.labelType,shape:cD(t),isGroup:!1,padding:10,look:e.look,colorIndex:a++,cssClasses:cK("default","usecase-actor",`usecase-actor-${t.type}`,t.business&&"usecase-business",...t.classes),cssStyles:[...t.styles],cssCompiledStyles:cw(t.classes),actorType:t.type,business:t.business,...t.icon?{icon:t.icon}:{},...t.stereotype?{stereotype:n(t.stereotype)}:{},...t.parentId?{parentId:t.parentId}:{}});for(let t of cf.useCases.values())i.push({id:t.id,label:n(t.label),labelType:t.labelType,shape:c$(t),isGroup:!1,padding:"ellipse"===t.shape?20:10,look:e.look,colorIndex:a++,cssClasses:cK("default","usecase-element",`usecase-${t.shape}`,t.business&&"usecase-business",...t.classes),cssStyles:[...t.styles],cssCompiledStyles:cw(t.classes),business:t.business,...t.stereotype?{stereotype:n(t.stereotype)}:{},...t.parentId?{parentId:t.parentId}:{}});for(let t of cf.notes.values())i.push({id:t.id,label:n(t.label),labelType:t.labelType,shape:"note",isGroup:!1,padding:10,look:e.look,cssClasses:"default usecase-note",cssStyles:[],cssCompiledStyles:cw([]),noteTarget:t.target,noteTargetLabel:n(cf.actors.get(t.target)?.label??cf.useCases.get(t.target)?.label??cf.jsonNodes.get(t.target)?.id??t.target)});for(let t of cf.jsonNodes.values())i.push({id:t.id,label:n(t.id),labelType:"text",shape:"usecaseJsonTable",isGroup:!1,padding:10,look:e.look,cssClasses:cK("default","usecase-json-table",...t.classes),cssStyles:[...t.styles],cssCompiledStyles:cw(t.classes),jsonRows:cP(t.value,t.propertyOrder,n)});for(let t of cf.systemBoundaries.values())i.push({id:t.id,label:n(t.label),labelType:t.labelType,shape:"usecaseSystemBoundary",isGroup:!0,padding:20,look:e.look,colorIndex:o++,cssClasses:cK("default","system-boundary",`system-boundary-${t.type}`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:cw(t.classes),boundaryType:t.type});for(let t of cf.relationships){let{label:i,...a}=cF(t);s.push({id:t.id,start:t.source,end:t.target,source:t.source,target:t.target,sourceLabel:r(t.source),targetLabel:r(t.target),type:"edge",relationshipType:t.type,internal:!1,...a,...void 0!==i?{label:n(i)}:{},labelpos:"c",classes:cK("default","relationship",`relationship-${t.type}`,...t.classes,...cB(t)),style:[...t.styles],cssCompiledStyles:cw(t.classes),animate:t.animate,...t.animation?{animation:t.animation}:{},look:e.look,thickness:"normal",minlen:t.minlen,isUserDefinedId:t.explicitId})}for(let t of cf.notes.values())s.push({id:`${t.id}-edge`,start:t.id,end:t.target,source:t.id,target:t.target,type:"edge",relationshipType:"note",sourceLabel:r(t.id),targetLabel:r(t.target),internal:!0,pattern:"dotted",arrowTypeStart:"none",arrowTypeEnd:"none",labelpos:"c",classes:"default relationship relationship-note",style:[],cssCompiledStyles:cw([]),animate:!1,look:e.look,thickness:"normal",minlen:1,isUserDefinedId:!1});for(let e of i)e.wrappingWidth??=t.wrappingWidth,e.isGroup||e.shape.startsWith("usecaseActor")||(e.minWidth??=t.minNodeWidth),("usecaseEllipse"===e.shape||"usecaseBusiness"===e.shape)&&(e.spreadPorts=!0);return{nodes:i,edges:s,config:e,type:"usecase",layoutAlgorithm:"dagre",direction:cx(),nodeSpacing:t.nodeSpacing,rankSpacing:t.rankSpacing,actorFontSize:t.actorFontSize,actorFontFamily:t.actorFontFamily,actorFontWeight:t.actorFontWeight,usecaseFontSize:t.usecaseFontSize,usecaseFontFamily:t.usecaseFontFamily,usecaseFontWeight:t.usecaseFontWeight,diagramPadding:t.diagramPadding,useMaxWidth:t.useMaxWidth,markers:["point","circle","cross","extension"]}},"getData"),cW={getConfig:cm,createModel:cd,commit:cg,getAST:cy,clear:cT,setDiagramTitle:D.ke,getDiagramTitle:D.ab,setAccTitle:D.SV,getAccTitle:D.iN,setAccDescription:D.EI,getAccDescription:D.m7,getActors:cE,getActor:cA,getUseCases:cb,getUseCase:cS,getSystemBoundaries:cL,getSystemBoundary:cv,getRelationships:cO,getNotes:cR,getNote:ck,getJsonNodes:cN,getJsonNode:c_,getClassDefs:cI,getClassDef:cC,getDirection:cx,getData:cG};function cz(e,t,n){let r=[n];return r.index=t,r.input=e,r}(0,j.K)(cz,"customMatch");var cV=(0,j.K)((e,t)=>{if('"'!==e[t]||"`"!==e[t+1])return null;for(let n=t+2;n<e.length-1;n++)if("`"===e[n]&&'"'===e[n+1])return cz(e,t,e.slice(t,n+2));return null},"matchMarkdownString"),cH=(0,j.K)((e,t)=>{if("%"!==e[t]||"%"!==e[t+1])return null;for(let n=t-1;n>=0;n--){let t=e[n];if("\n"===t||"\r"===t)break;if(" "!==t&&" "!==t)return null}let n=t+2;for(;n<e.length&&"\n"!==e[n]&&"\r"!==e[n];)n++;return cz(e,t,e.slice(t,n))},"matchComment"),cY=(0,j.K)((e,t)=>{for(let n=t-1;n>=0;n--){let t=e[n];if("\n"===t||"\r"===t)break;if(" "!==t&&" "!==t)return!1}return!0},"isIndentedLineStart"),cX=(0,j.K)((e,t,n)=>{if(!cY(e,t))return null;let r=n.exec(e.slice(t));return r?cz(e,t,r[0]):null},"matchAccessibilityLine"),cJ=(0,j.K)((e,t)=>{if(!cY(e,t))return null;let n=/^accDescr[\t ]*{/.exec(e.slice(t));if(!n)return null;let r=e.indexOf("}",t+n[0].length);return -1===r?null:cz(e,t,e.slice(t,r+1))},"matchAccDescrBlock"),cq=(0,j.K)((e,t)=>{if("{"!==e[t])return null;let n=0,r=!1,i=!1;for(let s=t;s<e.length;s++){let a=e[s];if(r){i?i=!1:"\\"===a?i=!0:'"'===a&&(r=!1);continue}if('"'===a)r=!0;else if("{"===a)n++;else if("}"===a&&0==--n)return cz(e,t,e.slice(t,s+1))}return null},"matchJsonObject"),cZ=(0,j.K)((e,t)=>{let n=e.indexOf(">>",t);if(-1===n||/[\n\r]/.test(e.slice(t,n)))return null;let r=e.slice(t,n);return r.trim()?cz(e,t,r):null},"matchStereotypeText"),cQ=o5({name:"LABEL_TEXT",pattern:oY.NA}),c0=o5({name:"WORD",pattern:oY.NA,categories:cQ}),c1=o5({name:"NUMBER",pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:cQ}),c2=o5({name:"IDENTIFIER",pattern:/\w+/,longer_alt:c1,categories:c0}),c3=o5({name:"HWS",pattern:/[\t ]+/,group:oY.SKIPPED}),c6=o5({name:"MARKDOWN_STRING",pattern:cV,start_chars_hint:['"'],line_breaks:!0}),c5=o5({name:"UNCLOSED_MARKDOWN_STRING",pattern:/"`[^]*/,line_breaks:!0}),c4=o5({name:"COMMENT",pattern:cH,start_chars_hint:["%"],line_breaks:!1}),c8=o5({name:"NEWLINE",pattern:/\r\n|\n|\r/,line_breaks:!0}),c9=o5({name:"ACC_DESCR_BLOCK",pattern:cJ,start_chars_hint:["a"],line_breaks:!0}),c7=/^accTitle[\t ]*:[^\n\r]*/,he=/^accDescr[\t ]*:[^\n\r]*/,ht=o5({name:"ACC_TITLE_LINE",pattern:(0,j.K)((e,t)=>cX(e,t,c7),"pattern"),start_chars_hint:["a"],line_breaks:!1}),hn=o5({name:"ACC_DESCR_LINE",pattern:(0,j.K)((e,t)=>cX(e,t,he),"pattern"),start_chars_hint:["a"],line_breaks:!1}),hr=o5({name:"JSON_DECLARATION_START",pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:"jsonBody"}),hi=o5({name:"JSON_OBJECT_LITERAL",pattern:cq,start_chars_hint:["{"],line_breaks:!0,pop_mode:!0}),hs=o5({name:"UNCLOSED_JSON_OBJECT_LITERAL",pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),ha=(0,j.K)((e,t)=>o5({name:e,pattern:t,longer_alt:c2,categories:c0}),"keyword"),ho=ha("USECASE",/usecase-beta/),hl=ha("ACTOR",/actor/),hc=ha("SYSTEM_BOUNDARY",/systemBoundary/),hh=ha("END",/end/),hu=ha("DIRECTION",/direction/),hd=ha("TD",/TD/),hp=ha("TB",/TB/),hf=ha("BT",/BT/),hm=ha("LR",/LR/),hy=ha("RL",/RL/),hg=ha("NOTE",/note/),hT=ha("FOR",/for/),hE=ha("JSON",/json/),hA=ha("CLASS_DEF",/classDef/),hb=ha("CLASS",/class/),hS=ha("STYLE",/style/),hL=ha("INCLUDE",/include/i),hv=ha("EXTEND",/extend/i),hO=ha("TRUE",/true/),hR=ha("FALSE",/false/),hk=o5({name:"GENERALIZATION",pattern:/--\|>/}),hN=o5({name:"DEPENDENCY_ARROW",pattern:/\.\.>/}),h_=o5({name:"STEREOTYPE_START",pattern:/<</,push_mode:"stereotype"}),hI=o5({name:"STEREOTYPE_END",pattern:/>>/,pop_mode:!0}),hC=o5({name:"STEREOTYPE_TEXT",pattern:cZ,line_breaks:!1}),hx=o5({name:"UNCLOSED_STEREOTYPE_TEXT",pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),hw=o5({name:"CLASS_SEPARATOR",pattern:/:::/}),hU=o5({name:"FORWARD_SOLID",pattern:/--+>/}),hM=o5({name:"BACKWARD_SOLID",pattern:/<--+/}),hP=o5({name:"FORWARD_CIRCLE",pattern:/--o/}),hD=o5({name:"BACKWARD_CIRCLE",pattern:/o--/}),h$=o5({name:"FORWARD_CROSS",pattern:/--x/}),hj=o5({name:"BACKWARD_CROSS",pattern:/x--/}),hF=o5({name:"MARKERLESS_SOLID",pattern:/--+/}),hB=o5({name:"METADATA_START",pattern:/@{/}),hK=o5({name:"AT",pattern:/@/,categories:cQ}),hG=o5({name:"LBRACE",pattern:/{/}),hW=o5({name:"RBRACE",pattern:/}/}),hz=o5({name:"LBRACKET",pattern:/\[/}),hV=o5({name:"RBRACKET",pattern:/]/}),hH=o5({name:"LPAREN",pattern:/\(/}),hY=o5({name:"RPAREN",pattern:/\)/}),hX=o5({name:"COMMA",pattern:/,/,categories:cQ}),hJ=o5({name:"COLON",pattern:/:/,categories:cQ}),hq=o5({name:"HASH_COLOR",pattern:/#[\dA-Fa-f]+/,categories:cQ}),hZ=o5({name:"PLAIN_STRING",pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),hQ=o5({name:"CSS_IDENTIFIER",pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:cQ}),h0=o5({name:"CSS_ESCAPED_COMMA",pattern:/\\,/,categories:cQ}),h1=o5({name:"DASH",pattern:/-/,categories:cQ}),h2=o5({name:"DOT",pattern:/\./,categories:cQ}),h3=o5({name:"PERCENT",pattern:/%/,categories:cQ}),h6=o5({name:"CSS_PUNCTUATION",pattern:/[!#$&*+/=?^_|~]/,categories:cQ}),h5=o5({name:"LABEL_PUNCTUATION",pattern:/[;<>\\`]/,categories:cQ}),h4=o5({name:"LABEL_SYMBOL",pattern:/[^\t\n\r !-~]+/,categories:cQ}),h8=[cQ,c0,c3,c6,c5,c4,c8,c9,ht,hn,hr,ho,hl,hc,hh,hu,hd,hp,hf,hm,hy,hg,hT,hE,hA,hb,hS,hL,hv,hO,hR,hk,hN,h_,hw,hU,hM,hP,hD,h$,hj,hF,hB,hK,hG,hW,hz,hV,hH,hY,hX,hJ,hq,hZ,hQ,c2,c1,h0,h1,h2,h3,h6,h5,h4],h9={defaultMode:"defaultMode",modes:{defaultMode:[...h8],jsonBody:[hi,hs],stereotype:[hI,hC,hx]}},h7=[...h8,hi,hs,hI,hC,hx],ue=new oY(h9),ut=(0,j.K)(e=>oj(e,cQ)||e.tokenType===hZ||e.tokenType===c6,"isLabelToken"),un={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},ur=new class extends cl{static{(0,j.K)(this,"UsecaseParser")}constructor(){super(h7,{nodeLocationTracking:"full"}),this.RULE("start",()=>{this.CONSUME(ho),this.SUBRULE(this.lineEnd),this.MANY(()=>this.SUBRULE(this.line))}),this.RULE("line",()=>{this.OR([{ALT:(0,j.K)(()=>this.SUBRULE(this.blankLine),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.commentLine),"ALT")},{GATE:(0,j.K)(()=>this.isStatementStart(),"GATE"),ALT:(0,j.K)(()=>this.SUBRULE(this.statement),"ALT")}])}),this.RULE("statement",()=>{this.OR([{ALT:(0,j.K)(()=>this.SUBRULE(this.accTitleStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.accDescrStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.directionStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.actorStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.systemBoundaryStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.noteStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.jsonStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.classDefStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.classStatement),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.styleStatement),"ALT")},{GATE:(0,j.K)(()=>this.isMetadataAssignment(),"GATE"),ALT:(0,j.K)(()=>this.SUBRULE(this.metadataAssignmentStatement),"ALT")},{GATE:(0,j.K)(()=>!this.isForbiddenPlantUmlStatement(),"GATE"),ALT:(0,j.K)(()=>this.SUBRULE(this.entityStatement),"ALT")}])}),this.RULE("lineEnd",()=>{this.OR([{ALT:(0,j.K)(()=>this.CONSUME(c8),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(o4),"ALT")}])}),this.RULE("blankLine",()=>{this.CONSUME(c8)}),this.RULE("commentLine",()=>{this.CONSUME(c4),this.SUBRULE(this.lineEnd)}),this.RULE("accTitleStatement",()=>{this.CONSUME(ht),this.SUBRULE(this.lineEnd)}),this.RULE("accDescrStatement",()=>{this.OR([{ALT:(0,j.K)(()=>this.CONSUME(hn),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(c9),"ALT")}]),this.SUBRULE(this.lineEnd)}),this.RULE("actorStatement",()=>{this.CONSUME(hl),this.SUBRULE(this.actorItem),this.OPTION(()=>{this.OR([{ALT:(0,j.K)(()=>this.AT_LEAST_ONE(()=>{this.CONSUME(hX),this.SUBRULE2(this.actorItem)}),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.relationTail),"ALT")}])}),this.SUBRULE(this.lineEnd)}),this.RULE("actorItem",()=>{this.SUBRULE(this.actorName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.stereotype)),this.OPTION3(()=>this.SUBRULE(this.classSuffix))}),this.RULE("actorName",()=>{this.OR([{ALT:(0,j.K)(()=>{this.CONSUME(c2),this.OPTION(()=>{this.CONSUME(hH),this.SUBRULE(this.nodeLabel),this.CONSUME(hY)})},"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hZ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(c6),"ALT")}])}),this.RULE("actorDeclarationOnly",()=>{this.CONSUME(hl),this.SUBRULE(this.actorItem),this.MANY(()=>{this.CONSUME(hX),this.SUBRULE2(this.actorItem)}),this.SUBRULE(this.lineEnd)}),this.RULE("entityStatement",()=>{this.SUBRULE(this.entityName),this.OPTION(()=>this.SUBRULE(this.relationTail)),this.SUBRULE(this.lineEnd)}),this.RULE("entityName",()=>{this.OR([{ALT:(0,j.K)(()=>{this.CONSUME(c2),this.OPTION(()=>{this.OR2([{ALT:(0,j.K)(()=>{this.CONSUME(hH),this.SUBRULE(this.nodeLabel),this.CONSUME(hY)},"ALT")},{ALT:(0,j.K)(()=>{this.CONSUME(hz),this.SUBRULE2(this.nodeLabel),this.CONSUME(hV)},"ALT")}])})},"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hZ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(c6),"ALT")}]),this.OPTION2(()=>this.SUBRULE(this.useCaseMetadata)),this.OPTION3(()=>this.SUBRULE(this.stereotype)),this.OPTION4(()=>this.SUBRULE(this.classSuffix))}),this.RULE("nodeLabel",()=>{this.OR([{ALT:(0,j.K)(()=>this.CONSUME(hZ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(c6),"ALT")},{ALT:(0,j.K)(()=>this.AT_LEAST_ONE(()=>this.CONSUME(cQ)),"ALT")}])}),this.RULE("useCaseMetadata",()=>{this.SUBRULE(this.metadata)}),this.RULE("relationTail",()=>{this.OPTION({GATE:(0,j.K)(()=>this.LA(1).tokenType===c2&&this.LA(2).tokenType===hK,"GATE"),DEF:(0,j.K)(()=>{this.CONSUME(c2),this.CONSUME(hK)},"DEF")}),this.SUBRULE(this.arrow),this.SUBRULE(this.entityName)}),this.RULE("arrow",()=>{this.OR([{ALT:(0,j.K)(()=>this.SUBRULE(this.semanticRelation),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.forwardSolidOperator),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.backwardSolidOperator),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.markerlessSolidOperator),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.forwardCircleOperator),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.backwardCircleOperator),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.forwardCrossOperator),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.backwardCrossOperator),"ALT")}])}),this.RULE("forwardSolidOperator",()=>{this.CONSUME(hU)}),this.RULE("backwardSolidOperator",()=>{this.CONSUME(hM),this.OPTION({GATE:(0,j.K)(()=>"<--"===this.LA(0).image&&this.hasLabeledRight([hF]),"GATE"),DEF:(0,j.K)(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(hF)},"DEF")})}),this.RULE("markerlessSolidOperator",()=>{this.CONSUME(hF),this.OPTION({GATE:(0,j.K)(()=>"--"===this.LA(0).image&&this.hasLabeledRight([hU,hF,hP,h$]),"GATE"),DEF:(0,j.K)(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:(0,j.K)(()=>this.CONSUME(hU),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME2(hF),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hP),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(h$),"ALT")}])},"DEF")})}),this.RULE("forwardCircleOperator",()=>{this.CONSUME(hP)}),this.RULE("backwardCircleOperator",()=>{this.CONSUME(hD),this.OPTION({GATE:(0,j.K)(()=>this.hasLabeledRight([hF]),"GATE"),DEF:(0,j.K)(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(hF)},"DEF")})}),this.RULE("forwardCrossOperator",()=>{this.CONSUME(h$)}),this.RULE("backwardCrossOperator",()=>{this.CONSUME(hj),this.OPTION({GATE:(0,j.K)(()=>this.hasLabeledRight([hF]),"GATE"),DEF:(0,j.K)(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(hF)},"DEF")})}),this.RULE("edgeLabel",()=>{this.OR([{ALT:(0,j.K)(()=>this.CONSUME(hZ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(c6),"ALT")},{ALT:(0,j.K)(()=>this.AT_LEAST_ONE(()=>this.CONSUME(cQ)),"ALT")}])}),this.RULE("semanticRelation",()=>{this.OR([{ALT:(0,j.K)(()=>{this.CONSUME(hN),this.CONSUME(hJ),this.OR2([{ALT:(0,j.K)(()=>this.CONSUME(hL),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hv),"ALT")}])},"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hk),"ALT")}])}),this.RULE("metadata",()=>{this.CONSUME(hB),this.MANY(()=>this.CONSUME(c8)),this.OPTION(()=>{this.SUBRULE(this.metadataProperty),this.MANY2(()=>{this.SUBRULE(this.metadataSeparator),this.SUBRULE2(this.metadataProperty)}),this.OPTION2(()=>this.CONSUME(hX)),this.MANY3(()=>this.CONSUME2(c8))}),this.CONSUME(hW)}),this.RULE("metadataProperty",()=>{this.OR([{ALT:(0,j.K)(()=>this.CONSUME(c2),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hZ),"ALT")}]),this.CONSUME(hJ),this.OR2([{ALT:(0,j.K)(()=>this.CONSUME2(c2),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME2(hZ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hO),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hR),"ALT")}])}),this.RULE("metadataSeparator",()=>{this.OR([{ALT:(0,j.K)(()=>{this.CONSUME(hX),this.MANY(()=>this.CONSUME(c8))},"ALT")},{ALT:(0,j.K)(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(c8)),this.OPTION(()=>this.CONSUME2(hX)),this.MANY2(()=>this.CONSUME3(c8))},"ALT")}])}),this.RULE("systemBoundaryStatement",()=>{this.CONSUME(hc),this.SUBRULE(this.systemBoundaryName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd),this.SUBRULE(this.systemBoundaryContent),this.CONSUME(hh),this.SUBRULE2(this.lineEnd)}),this.RULE("systemBoundaryName",()=>{this.OR([{ALT:(0,j.K)(()=>{this.CONSUME(c2),this.OPTION(()=>{this.OR2([{ALT:(0,j.K)(()=>{this.CONSUME(hH),this.SUBRULE(this.nodeLabel),this.CONSUME(hY)},"ALT")},{ALT:(0,j.K)(()=>{this.CONSUME(hz),this.SUBRULE2(this.nodeLabel),this.CONSUME(hV)},"ALT")}])})},"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hZ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(c6),"ALT")}])}),this.RULE("systemBoundaryContent",()=>{this.MANY(()=>{this.OR([{ALT:(0,j.K)(()=>this.SUBRULE(this.blankLine),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.commentLine),"ALT")},{ALT:(0,j.K)(()=>this.SUBRULE(this.boundaryElement),"ALT")}])})}),this.RULE("boundaryElement",()=>{this.OR([{ALT:(0,j.K)(()=>this.SUBRULE(this.actorDeclarationOnly),"ALT")},{ALT:(0,j.K)(()=>{this.SUBRULE(this.entityName),this.SUBRULE(this.lineEnd)},"ALT")}])}),this.RULE("metadataAssignmentStatement",()=>{this.SUBRULE(this.metadataAssignmentTarget),this.SUBRULE(this.metadata),this.SUBRULE(this.lineEnd)}),this.RULE("metadataAssignmentTarget",()=>{this.OR([{ALT:(0,j.K)(()=>this.CONSUME(c2),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hZ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(c6),"ALT")}])}),this.RULE("noteStatement",()=>{this.CONSUME(hg),this.CONSUME(hT),this.CONSUME(c2),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE("stereotype",()=>{this.CONSUME(h_),this.CONSUME(hC),this.CONSUME(hI)}),this.RULE("classSuffix",()=>{this.CONSUME(hw),this.CONSUME(c2),this.MANY(()=>{this.CONSUME(hX),this.CONSUME2(c2)})}),this.RULE("jsonStatement",()=>{this.CONSUME(hr),this.CONSUME(hi),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE("directionStatement",()=>{this.CONSUME(hu),this.OR([{ALT:(0,j.K)(()=>this.CONSUME(hd),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hp),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hf),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hm),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hy),"ALT")}]),this.SUBRULE(this.lineEnd)}),this.RULE("classDefStatement",()=>{this.CONSUME(hA),this.CONSUME(c2),this.MANY(()=>{this.CONSUME(hX),this.CONSUME2(c2)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE("classStatement",()=>{this.CONSUME(hb),this.CONSUME(c2),this.MANY(()=>{this.CONSUME(hX),this.CONSUME2(c2)}),this.CONSUME3(c2),this.MANY2(()=>{this.CONSUME2(hX),this.CONSUME4(c2)}),this.SUBRULE(this.lineEnd)}),this.RULE("styleStatement",()=>{this.CONSUME(hS),this.CONSUME(c2),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE("styles",()=>{this.SUBRULE(this.styleValue),this.MANY(()=>{this.CONSUME(hX),this.SUBRULE2(this.styleValue)})}),this.RULE("styleValue",()=>{this.OR([{ALT:(0,j.K)(()=>this.CONSUME(c0),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hQ),"ALT")},{ALT:(0,j.K)(()=>{this.CONSUME(hF),this.CONSUME2(c0)},"ALT")}]),this.CONSUME(hJ),this.AT_LEAST_ONE(()=>this.SUBRULE(this.styleComponent))}),this.RULE("styleComponent",()=>{this.OR([{ALT:(0,j.K)(()=>this.CONSUME(c0),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hZ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(c1),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hq),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hQ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(h0),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(h1),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(h2),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(h3),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(h6),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hJ),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hH),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hY),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hz),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hV),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hG),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hW),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hK),"ALT")},{ALT:(0,j.K)(()=>this.CONSUME(hF),"ALT")}])}),this.performSelfAnalysis()}isMetadataAssignment(){let e=this.LA(1).tokenType;return(e===c2||e===hZ||e===c6)&&this.LA(2).tokenType===hB}isStatementStart(){let e=this.LA(1).tokenType;return e!==o4&&e!==c8&&e!==c4}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===c2&&!0===un[this.LA(1).image.toLowerCase()]}hasLabeledRight(e){if(!ut(this.LA(1)))return!1;for(let t=2;;t++){let n=this.LA(t);if(e.includes(n.tokenType))return!0;if(!ut(n))return!1}}},ui=class extends Error{constructor(e,t,n){super(`${e} (line ${t}, column ${n})`),this.line=t,this.column=n,this.name="UsecaseJsonError"}static{(0,j.K)(this,"UsecaseJsonError")}},us=(0,j.K)((e,t,n,r)=>{let i=n,s=r,a=Math.min(Math.max(t,0),e.length);for(let t=0;t<a;t++){let n=e[t];"\r"===n?(i++,s=1):"\n"===n?(0===t||"\r"!==e[t-1])&&(i++,s=1):s++}return{line:i,column:s}},"locationAtOffset"),ua=(0,j.K)((e,t,n,r)=>{let i=/\bposition (\d+)\b/u.exec(e);if(i)return us(t,Number.parseInt(i[1],10),n,r);let s=/\bline (\d+) column (\d+)\b/u.exec(e);if(s){let e=Number.parseInt(s[1],10),t=Number.parseInt(s[2],10);return{line:n+e-1,column:1===e?r+t-1:t}}if(/unexpected end|end of json input/iu.test(e))return us(t,t.length,n,r)},"locationFromErrorMessage"),uo=class extends Error{constructor(e){super("Invalid JSON token"),this.offset=e}static{(0,j.K)(this,"JsonWalkError")}},ul=class{constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{(0,j.K)(this,"PropertyOrderCollector")}collect(){if(this.skipWhitespace(),this.collectValue(""),this.skipWhitespace(),this.offset!==this.text.length)throw new uo(this.offset);return this.propertyOrder}collectValue(e){this.skipWhitespace();let t=this.text[this.offset];if("{"===t)this.collectObject(e);else if("["===t)this.collectArray(e);else if('"'===t)this.readString(!1);else if("t"===t)this.consumeLiteral("true");else if("f"===t)this.consumeLiteral("false");else if("n"===t)this.consumeLiteral("null");else if("-"===t||t>="0"&&t<="9")this.consumeNumber();else throw new uo(this.offset)}collectObject(e){this.offset++;let t=[],n=new Set;if(this.propertyOrder[e]=t,this.skipWhitespace(),"}"===this.text[this.offset])return void this.offset++;for(;this.offset<this.text.length&&'"'===this.text[this.offset];){let r=this.readString(!0),i=`${e}/${r.replaceAll("~","~0").replaceAll("/","~1")}`;if(n.has(r)?this.deletePointerSubtree(i):(n.add(r),t.push(r)),this.skipWhitespace(),":"!==this.text[this.offset])break;if(this.offset++,this.collectValue(i),this.skipWhitespace(),"}"===this.text[this.offset])return void this.offset++;if(","!==this.text[this.offset])break;this.offset++,this.skipWhitespace()}throw new uo(this.offset)}collectArray(e){if(this.offset++,this.skipWhitespace(),"]"===this.text[this.offset])return void this.offset++;let t=0;for(;this.offset<this.text.length;){if(this.collectValue(`${e}/${t}`),t++,this.skipWhitespace(),"]"===this.text[this.offset])return void this.offset++;if(","!==this.text[this.offset])break;this.offset++,this.skipWhitespace()}throw new uo(this.offset)}readString(e){this.offset++;let t="";for(;this.offset<this.text.length;){let n=this.offset,r=this.text[this.offset++];if('"'===r)return t;if(32>r.charCodeAt(0))throw new uo(n);if("\\"!==r){e&&(t+=r);continue}let i=this.offset,s=this.text[this.offset++];switch(s){case'"':case"\\":case"/":e&&(t+=s);break;case"b":e&&(t+="\b");break;case"f":e&&(t+="\f");break;case"n":e&&(t+="\n");break;case"r":e&&(t+="\r");break;case"t":e&&(t+=" ");break;case"u":{let n=this.text.slice(this.offset,this.offset+4);if(!/^[\dA-Fa-f]{4}$/u.test(n))throw new uo(this.offset);e&&(t+=String.fromCharCode(Number.parseInt(n,16))),this.offset+=4;break}default:throw new uo(i)}}throw new uo(this.offset)}consumeLiteral(e){let t=0;for(let n of e){if(this.text[this.offset+t]!==n)throw new uo(this.offset+t);t++}this.offset+=e.length}consumeNumber(){if("-"===this.text[this.offset]&&this.offset++,"0"===this.text[this.offset])this.offset++;else if(this.text[this.offset]>="1"&&this.text[this.offset]<="9")for(;this.text[this.offset]>="0"&&this.text[this.offset]<="9";)this.offset++;else throw new uo(this.offset);if("."===this.text[this.offset]){if(this.offset++,this.text[this.offset]<"0"||this.text[this.offset]>"9")throw new uo(this.offset);for(;this.text[this.offset]>="0"&&this.text[this.offset]<="9";)this.offset++}if("e"===this.text[this.offset]||"E"===this.text[this.offset]){if(this.offset++,("+"===this.text[this.offset]||"-"===this.text[this.offset])&&this.offset++,this.text[this.offset]<"0"||this.text[this.offset]>"9")throw new uo(this.offset);for(;this.text[this.offset]>="0"&&this.text[this.offset]<="9";)this.offset++}}skipWhitespace(){for(;this.offset<this.text.length;){let e=this.text[this.offset];if(" "!==e&&" "!==e&&"\n"!==e&&"\r"!==e)return;this.offset++}}deletePointerSubtree(e){let t=`${e}/`;for(let n of Object.keys(this.propertyOrder))(n===e||n.startsWith(t))&&delete this.propertyOrder[n]}};function uc(e,t,n){let r;try{r=JSON.parse(e)}catch(s){let r=s instanceof Error?s.message:String(s),i=ua(r,e,t,n);if(!i){let r=0;try{new ul(e).collect()}catch(e){e instanceof uo&&(r=e.offset)}i=us(e,r,t,n)}throw new ui(`Invalid JSON: ${r}`,i.line,i.column)}if("object"!=typeof r||null===r||Array.isArray(r))throw new ui("JSON value must have an object root",t,n);return{value:r,propertyOrder:new ul(e).collect()}}(0,j.K)(uc,"parseOrderedJsonObject");var uh=(0,j.K)(e=>({shape:"normal"===e.type?"actor":"hollow"===e.type?"actor-hollow":"awesome"===e.type?"actor-awesome":"actor-icon",...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"actor",actorType:e.type,business:e.business,labelType:e.labelType,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),"actorNode"),uu=(0,j.K)(e=>({shape:e.shape,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"usecase",useCaseShape:e.shape,business:e.business,labelType:e.labelType,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),"useCaseNode"),ud=(0,j.K)(e=>({label:e.label,shape:"note",attrs:{kind:"note",target:e.target,labelType:e.labelType}}),"noteNode"),up=(0,j.K)(e=>({label:e.id,shape:"json-table",...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"json",value:e.value,propertyOrder:e.propertyOrder,labelType:"text"}}),"jsonNode"),uf=(0,j.K)(e=>({id:e.id,source:e.source,target:e.target,...e.label?{label:e.label}:{},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{relationshipType:e.type,arrowType:e.arrowType,minlen:e.minlen,explicitId:e.explicitId,animate:e.animate,...e.animation?{animation:e.animation}:{},...e.labelType?{labelType:e.labelType}:{}}}),"relationshipEdge"),um=(0,j.K)(e=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:"note",arrowType:2,pattern:"dotted",minlen:1,explicitId:!1,animate:!1,internal:!0}}),"noteEdge"),uy=(0,j.K)((e,t,n,r)=>{let i={};for(let t of e.getActors().values())i[t.id]=uh(t);for(let t of e.getUseCases().values())i[t.id]=uu(t);for(let t of e.getNotes().values())i[t.id]=ud(t);for(let t of e.getJsonNodes().values())i[t.id]=up(t);let s={};for(let t of e.getSystemBoundaries().values())s[t.id]={...t.label===t.id?{}:{title:t.label},nodes:[...t.members],...t.classes.length?{classes:[...t.classes]}:{},...t.styles.length?{styles:[...t.styles]}:{},attrs:{kind:"systemBoundary",boundaryType:t.type,labelType:t.labelType}};let a={};for(let t of e.getClassDefs().values())a[t.id]={styles:[...t.styles]};let o=e.getDirection();return{version:1,diagramType:"usecase",source:t,header:{keyword:"usecase",direction:"TD"===o?"TB":o,span:n},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:i,edges:[...e.getRelationships().map(uf),...[...e.getNotes().values()].map(um)],groups:s,classDefs:a,statements:r}},"buildUsecaseGraphAST"),ug=(0,j.K)(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,"locationText"),uT=(0,j.K)(e=>void 0===e?"":` (label "${e}")`,"labelSuffix"),uE=(0,j.K)(e=>e.generated?e.label:void 0,"generatedFrom"),uA=(0,j.K)((e,t)=>{for(let n of t)e.includes(n)||e.push(n)},"pushUnique"),ub=class{constructor(e){this.db=e,this.source="",this.statements=[],this.elements=[],this.boundaries=[],this.jsonDrafts=[],this.relationshipDrafts=[],this.noteDrafts=[],this.metadataAssignments=[],this.classAssignments=[],this.styleAssignments=[],this.classDefinitions=[],this.directions=[],this.model=e.createModel()}static{(0,j.K)(this,"UsecaseModelBuilder")}reset(e){this.model=this.db.createModel(),this.source=e,this.statements=[],this.elements.length=0,this.boundaries.length=0,this.jsonDrafts.length=0,this.relationshipDrafts.length=0,this.noteDrafts.length=0,this.metadataAssignments.length=0,this.classAssignments.length=0,this.styleAssignments.length=0,this.classDefinitions.length=0,this.directions.length=0}addElement(e){this.elements.push(e)}addBoundary(e){this.boundaries.push(e)}addJson(e){this.jsonDrafts.push(e)}addRelationship(e){this.relationshipDrafts.push(e)}addNote(e){this.noteDrafts.push(e)}addMetadataAssignment(e,t,n,r){this.metadataAssignments.push({target:e,targetLocation:t,metadata:n,statement:r})}addClassDef(e,t){this.classDefinitions.push({ids:e,styles:t})}addClassAssignment(e,t){this.classAssignments.push({targets:e,classes:t})}addStyleAssignment(e,t,n){this.styleAssignments.push({target:e,location:t,styles:n})}setDirection(e){this.directions.push("TD"===e?"TB":e)}setAccTitle(e){this.model.accTitle=e}setAccDescription(e){this.model.accDescription=e}setStatements(e){this.statements=e}getActors(){return this.model.actors}getUseCases(){return this.model.useCases}getSystemBoundaries(){return this.model.systemBoundaries}getRelationships(){return this.model.relationships}getNotes(){return this.model.notes}getJsonNodes(){return this.model.jsonNodes}getClassDefs(){return this.model.classDefs}getDirection(){return this.model.direction}getAccTitle(){return this.model.accTitle}getAccDescription(){return this.model.accDescription}finalize(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let e of this.relationshipDrafts)this.recordFirst(i,e.source.id,e.source.location.span[0]),this.recordFirst(i,e.target.id,e.target.location.span[0]);for(let e of this.elements)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.boundaries)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.jsonDrafts)this.recordFirst(i,e.id,e.location.span[0]);for(let e of[...this.elements.map(e=>({offset:e.location.span[0],type:"element",value:e})),...this.boundaries.map(e=>({offset:e.location.span[0],type:"boundary",value:e})),...this.jsonDrafts.map(e=>({offset:e.location.span[0],type:"json",value:e})),...this.relationshipDrafts.filter(e=>e.explicitId).map(e=>({offset:e.explicitIdLocation.span[0],type:"edge",value:e}))].sort((e,t)=>e.offset-t.offset))"element"===e.type?this.collectElement(e.value,t,n):"boundary"===e.type?this.collectBoundary(e.value,t,r):"json"===e.type?this.registerUnique(t,e.value.id,"json",e.value.location,!1):this.registerUnique(t,e.value.explicitId,"edge",e.value.explicitIdLocation,!1);this.materializeElements(n,i),this.materializeBoundaries(r,i),this.materializeJson(i);let s=this.materializeRelationships(t,n,i);this.reorderElements(n,i),this.applyMetadataAssignments(t,n,r,s),this.validateAndRefreshElements(n),this.refreshBoundaries(r,n),this.materializeNotes(t),this.applyClassDefinitions(),this.applyClassesAndStyles(t,s),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...t].map(([e,t])=>[e,t.kind]));let a=uy(this,this.source,e,this.statements);return this.model.ast=a,this.db.commit(this.model),a}collectElement(e,t,n){let r=t.get(e.id),i=uE({generated:e.generated,label:e.label.text});r&&r.kind!==e.kind&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and ${e.kind}`,e.location,r.location,i,uE(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,uE(r));let s=n.get(e.id);if(!s){let r={kind:e.kind,id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],...e.parentId?{parentId:e.parentId,parentLocation:e.parentLocation}:{},...e.shape?{shape:e.shape}:{},...e.stereotype?{stereotype:e.stereotype,stereotypeLocation:e.location}:{}};this.applyDeclarationMetadata(r,e.metadata),n.set(e.id,r),t.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text});return}(s.label.text!==e.label.text||s.label.type!==e.label.type)&&this.conflict(`ID '${e.id}' has conflicting labels`,e.location,s.location),e.shape&&s.shape&&e.shape!==s.shape&&this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,s.location),e.parentId&&s.parentId&&e.parentId!==s.parentId&&this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,s.parentLocation??s.location),e.stereotype&&s.stereotype&&e.stereotype!==s.stereotype&&this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,s.stereotypeLocation??s.location),s.shape??=e.shape,s.parentId??=e.parentId,s.parentLocation??=e.parentLocation,s.stereotype??=e.stereotype,s.stereotypeLocation??=e.stereotype?e.location:void 0,uA(s.classes,e.classes),this.applyDeclarationMetadata(s,e.metadata)}collectBoundary(e,t,n){let r=t.get(e.id),i=uE({generated:e.generated,label:e.label.text});r&&"boundary"!==r.kind&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and boundary`,e.location,r.location,i,uE(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,uE(r));let s=n.get(e.id);if(s){(s.label.text!==e.label.text||s.label.type!==e.label.type)&&this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,s.location),uA(s.classes,e.classes);return}n.set(e.id,{id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],styles:[],members:[]}),t.set(e.id,{kind:"boundary",location:e.location,generated:e.generated,label:e.label.text})}materializeElements(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.setElementModel(n)}materializeBoundaries(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.model.systemBoundaries.set(n.id,{id:n.id,label:n.label.text,labelType:n.label.type,type:n.type??"rect",members:[],classes:[...n.classes],styles:[...n.styles]})}materializeJson(e){for(let t of[...this.jsonDrafts].sort((t,n)=>(e.get(t.id)??0)-(e.get(n.id)??0)))this.model.jsonNodes.set(t.id,{id:t.id,value:t.value,propertyOrder:t.propertyOrder,classes:[...t.classes],styles:[]})}materializeRelationships(e,t,n){let r=new Map,i=0;for(let s of this.relationshipDrafts){let a=this.resolveEndpoint(s.source,e,t,n),o=this.resolveEndpoint(s.target,e,t,n);this.validateRelationship(s,a,o,e);let l=s.explicitId??`edge-${i++}`,c={id:l,explicitId:!!s.explicitId,source:s.source.id,target:s.target.id,type:s.type,arrowType:s.arrowType,...s.label?{label:s.label.text,labelType:s.label.type}:{},minlen:s.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(c),r.set(l,{draft:s,relationship:c})}return this.model.relationshipCounter=i,r}resolveEndpoint(e,t,n,r){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${ug(e.location)}`);let i=t.get(e.id);return i?i.kind:(n.set(e.id,{kind:"usecase",id:e.id,label:e.label,location:e.location,generated:e.generated,shape:"ellipse",classes:[]}),t.set(e.id,{kind:"usecase",location:e.location,generated:e.generated,label:e.label.text}),this.recordFirst(r,e.id,e.location.span[0]),"usecase")}reorderElements(e,t){let n=new Map(this.model.actors),r=new Map(this.model.useCases);for(let i of(this.model.actors.clear(),this.model.useCases.clear(),[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))){n.has(i.id)||r.has(i.id)||this.setElementModel(i);let e=n.get(i.id)??this.model.actors.get(i.id),t=r.get(i.id)??this.model.useCases.get(i.id);e?this.model.actors.set(i.id,e):t&&this.model.useCases.set(i.id,t)}}applyMetadataAssignments(e,t,n,r){for(let i of this.metadataAssignments){let s=e.get(i.target);if(!s){let e=this.inferMetadataKind(i.metadata);throw Error(`Metadata target '${i.target}' is unresolved${e?` (metadata implies ${e})`:""} at ${ug(i.targetLocation)}`)}if("actor"===s.kind||"usecase"===s.kind)this.applyStandaloneElementMetadata(t.get(i.target),i.metadata);else if("boundary"===s.kind){let e=n.get(i.target);for(let t of i.metadata.properties)("type"!==t.key||"rect"!==t.value&&"package"!==t.value)&&this.invalidMetadata(i.target,s.kind,t),e.type=t.value}else if("edge"===s.kind){let e=r.get(i.target);if(!e)throw Error(`Metadata target '${i.target}' is not an explicit edge at ${ug(i.targetLocation)}`);for(let t of(i.statement.kind="edgeMetadata",i.statement.edges=[{id:i.target,span:i.statement.span,idSpan:i.targetLocation.span,...i.statement.metadata?{metadata:i.statement.metadata}:{}}],delete i.statement.nodes,i.metadata.properties))"animate"===t.key&&"boolean"==typeof t.value?e.relationship.animate=t.value:"animation"===t.key&&("fast"===t.value||"slow"===t.value)?(e.relationship.animation=t.value,e.relationship.animate=!0):this.invalidMetadata(i.target,s.kind,t)}else for(let e of i.metadata.properties)this.invalidMetadata(i.target,s.kind,e)}for(let{relationship:e}of r.values())e.animation&&(e.animate=!0)}applyStandaloneElementMetadata(e,t){for(let n of t.properties)"actor"===e.kind?this.applyActorProperty(e,n,!0):"business"===n.key&&"boolean"==typeof n.value?e.business=n.value:this.invalidMetadata(e.id,e.kind,n)}applyDeclarationMetadata(e,t){if(t)for(let n of t.properties)"actor"===e.kind?this.applyActorProperty(e,n,!1):"business"===n.key&&"boolean"==typeof n.value?(void 0!==e.business&&e.business!==n.value&&this.conflict(`Use case '${e.id}' has conflicting business metadata`,n.location,e.location),e.business=n.value):this.invalidMetadata(e.id,e.kind,n)}applyActorProperty(e,t,n){"type"===t.key&&("normal"===t.value||"hollow"===t.value||"awesome"===t.value)?(n||void 0===e.actorType||e.actorType===t.value||this.conflict(`Actor '${e.id}' has conflicting type metadata`,t.location,e.location),e.actorType=t.value):"icon"===t.key&&"string"==typeof t.value?(n||void 0===e.icon||e.icon===t.value||this.conflict(`Actor '${e.id}' has conflicting icon metadata`,t.location,e.location),e.icon=t.value):"business"===t.key&&"boolean"==typeof t.value?(n||void 0===e.business||e.business===t.value||this.conflict(`Actor '${e.id}' has conflicting business metadata`,t.location,e.location),e.business=t.value):this.invalidMetadata(e.id,e.kind,t)}validateAndRefreshElements(e){for(let t of e.values()){let e=t.icon?"icon":t.actorType??"normal";if("actor"===t.kind){if(t.icon&&t.actorType&&"normal"!==t.actorType)throw Error(`Actor '${t.id}' cannot combine icon with type '${t.actorType}' at ${ug(t.location)}`);if(t.business&&("icon"===e||"awesome"===e))throw Error(`Business actor '${t.id}' must use normal or hollow geometry at ${ug(t.location)}`)}else if((t.shape??"ellipse")==="rect"&&t.business)throw Error(`Rectangular use case '${t.id}' cannot be a business use case at ${ug(t.location)}`);this.setElementModel(t)}}refreshBoundaries(e,t){for(let t of e.values())t.members.length=0;for(let t of[...this.elements].sort((e,t)=>e.location.span[0]-t.location.span[0])){if(!t.parentId)continue;let n=e.get(t.parentId);if(!n)throw Error(`Parent boundary '${t.parentId}' for '${t.id}' is unresolved at ${ug(t.parentLocation??t.location)}`);n.members.includes(t.id)||n.members.push(t.id)}for(let n of t.values())if(n.parentId&&!e.has(n.parentId))throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${ug(n.parentLocation??n.location)}`);for(let t of e.values()){let e=this.model.systemBoundaries.get(t.id);e.type=t.type??"rect",e.members=[...t.members],e.classes=[...t.classes],e.styles=[...t.styles]}}materializeNotes(e){let t=0;for(let n of this.noteDrafts){let r=e.get(n.target);if(!r)throw Error(`Note target '${n.target}' is unresolved at ${ug(n.targetLocation)}`);"actor"!==r.kind&&"usecase"!==r.kind&&this.conflict(`Note target '${n.target}' must be an actor or use case, not ${r.kind}`,n.targetLocation,r.location);let i=`note-${t++}`;this.model.notes.set(i,{id:i,target:n.target,label:n.label.text,labelType:n.label.type})}this.model.noteCounter=t}applyClassDefinitions(){for(let e of this.classDefinitions)for(let t of e.ids)this.model.classDefs.set(t,{id:t,styles:[...e.styles]})}applyClassesAndStyles(e,t){for(let n of this.classAssignments)for(let r of n.targets)uA(this.getStylable(r.id,e,t,r.location).classes,n.classes);for(let n of this.styleAssignments)this.getStylable(n.target,e,t,n.location).styles.push(...n.styles)}getStylable(e,t,n,r){let i=t.get(e)?.kind,s="actor"===i?this.model.actors.get(e):"usecase"===i?this.model.useCases.get(e):"boundary"===i?this.model.systemBoundaries.get(e):"json"===i?this.model.jsonNodes.get(e):"edge"===i?n.get(e)?.relationship:void 0;if(!s)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${ug(r)}`);return s}validateRelationship(e,t,n,r){let i=(0,j.K)(e=>"actor"===e||"usecase"===e||"json"===e,"allowed");if(i(t)||this.conflict(`Relationship source '${e.source.id}' cannot be ${t}`,e.source.location,r.get(e.source.id).location),i(n)||this.conflict(`Relationship target '${e.target.id}' cannot be ${n}`,e.target.location,r.get(e.target.id).location),("include"===e.type||"extend"===e.type)&&("usecase"!==t||"usecase"!==n))throw Error(`${e.type} relationship requires use-case endpoints at ${ug(e.location)}`);if("generalization"===e.type&&("actor"!==t&&"usecase"!==t||t!==n))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${ug(e.location)}`);if("association"===e.type&&("json"===t||"json"===n)&&![0,1,2].includes(e.arrowType))throw Error(`JSON relationship '${e.source.id}' to '${e.target.id}' permits only point, reversed-point, or markerless solid association at ${ug(e.location)}`)}setElementModel(e){if("actor"===e.kind){let t=e.icon?"icon":e.actorType??"normal";this.model.useCases.delete(e.id),this.model.actors.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:t,...e.icon?{icon:e.icon}:{},business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.actors.get(e.id)?.styles??[]})}else this.model.actors.delete(e.id),this.model.useCases.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,shape:e.shape??"ellipse",business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.useCases.get(e.id)?.styles??[]})}inferMetadataKind(e){let t=new Set(["actor","usecase","boundary","edge"]);for(let n of e.properties)if("icon"===n.key)t.clear(),t.add("actor");else if("animate"===n.key||"animation"===n.key)t.clear(),t.add("edge");else if("type"===n.key)t.clear(),"rect"===n.value||"package"===n.value?t.add("boundary"):("normal"===n.value||"hollow"===n.value||"awesome"===n.value)&&t.add("actor");else{if("business"!==n.key)return;t.delete("boundary"),t.delete("edge")}return 1===t.size?[...t][0]:void 0}invalidMetadata(e,t,n){throw Error(`Metadata property '${n.key}' is invalid for ${t} '${e}' at ${ug(n.location)}`)}registerUnique(e,t,n,r,i){let s=e.get(t);s&&this.conflict(`ID '${t}' is declared more than once (${s.kind} and ${n})`,r,s.location,void 0,uE(s)),e.set(t,{kind:n,location:r,generated:i})}recordFirst(e,t,n){let r=e.get(t);(void 0===r||n<r)&&e.set(t,n)}conflict(e,t,n,r,i){throw Error(`${e} at ${ug(t)}${uT(r)}; previous declaration at ${ug(n)}${uT(i)}`)}},uS=ur.getBaseCstVisitorConstructor(),uL=new class extends uS{constructor(){super(),this.builder=new ub(cW),this.source="",this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{(0,j.K)(this,"UsecaseVisitor")}build(e,t){this.source=t,this.parentBoundary=void 0,this.anonymousEdge=0,this.anonymousNote=0,this.builder.reset(t),this.visit(e)}start(e){let t=this.tokens(e,"USECASE")[0],n=[];for(let t of this.nodes(e,"line"))n.push(this.visit(t));this.builder.setStatements(n),this.builder.finalize(this.tokenSpan(t))}line(e){let t=this.firstNode(e,"blankLine","commentLine","statement");return this.wrap(t,this.visit(t))}statement(e){return this.visit(this.firstNode(e,"accTitleStatement","accDescrStatement","directionStatement","actorStatement","systemBoundaryStatement","noteStatement","jsonStatement","classDefStatement","classStatement","styleStatement","metadataAssignmentStatement","entityStatement"))}lineEnd(e){}blankLine(e){return{kind:"blank",span:this.tokenSpan(this.tokens(e,"NEWLINE")[0])}}commentLine(e){return{kind:"comment",span:this.tokenSpan(this.tokens(e,"COMMENT")[0])}}accTitleStatement(e){let t=this.tokens(e,"ACC_TITLE_LINE")[0].image;return this.builder.setAccTitle(t.slice(t.indexOf(":")+1).trim()),{kind:"accTitle",span:[0,0]}}accDescrStatement(e){let t=this.tokens(e,"ACC_DESCR_LINE")[0],n=this.tokens(e,"ACC_DESCR_BLOCK")[0],r=t?t.image.slice(t.image.indexOf(":")+1).trim():n.image.slice(n.image.indexOf("{")+1,n.image.lastIndexOf("}")).trim();return this.builder.setAccDescription(r),{kind:"accDescr",span:[0,0]}}actorStatement(e){let t=this.nodes(e,"actorItem"),n=t.map(e=>this.visit(e)),r=this.nodes(e,"relationTail")[0],i=n.map((e,n)=>this.actorOccurrence(t[n],e,!0));for(let e of n)this.builder.addElement(this.actorDraft(e));if(!r)return{kind:"node",span:[0,0],nodes:i};let s=this.visit(r);s.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(s.target));let a=this.relationshipDraft(n[0],s,this.nodeLocation(r));this.builder.addRelationship(a);let o=a.explicitId??`edge-${this.anonymousEdge++}`;return i.push(this.entityOccurrence(this.nodes(r.children,"entityName")[0],s.target,s.target.explicitDeclaration)),{kind:"edge",span:[0,0],nodes:i,edges:[{id:o,span:[0,0],...a.explicitIdLocation?{idSpan:a.explicitIdLocation.span}:{},...a.label?{labelSpan:a.label.span}:{}}]}}actorItem(e){let t=this.visit(this.nodes(e,"actorName")[0]),n=this.nodes(e,"metadata")[0],r=this.nodes(e,"stereotype")[0],i=this.nodes(e,"classSuffix")[0],s=i?this.visit(i):{classes:[],spans:[]};return{...t,...n?{metadata:this.visit(n)}:{},...r?{stereotype:this.visit(r)}:{},classes:s.classes,classSpans:s.spans}}actorName(e){let t=this.tokens(e,"IDENTIFIER")[0],n=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0];if(t){let n=this.nodes(e,"nodeLabel")[0],r=n?this.visit(n):this.tokenLabel(t);return{id:t.image,label:r,location:this.tokenLocation(t),generated:!1,classes:[],classSpans:[]}}let r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let t=this.nodes(e,"actorItem"),n=t.map(e=>this.visit(e));for(let e of n)this.builder.addElement(this.actorDraft(e));return{kind:"node",span:[0,0],nodes:n.map((e,n)=>this.actorOccurrence(t[n],e,!0))}}entityStatement(e){let t=this.nodes(e,"entityName"),n=this.visit(t[0]),r=this.nodes(e,"relationTail")[0];if(!r)return n.explicitDeclaration=!0,n.shape??="ellipse",this.builder.addElement(this.entityDraft(n)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(t[0],n,!0)]};n.explicitDeclaration&&this.builder.addElement(this.entityDraft(n));let i=this.visit(r);i.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(i.target));let s={source:this.endpoint(n),target:this.endpoint(i.target),location:this.nodeLocation(r),...i.explicitId?{explicitId:i.explicitId,explicitIdLocation:i.explicitIdLocation}:{},...i.arrow};this.builder.addRelationship(s);let a=s.explicitId??`edge-${this.anonymousEdge++}`;return{kind:"edge",span:[0,0],nodes:[this.entityOccurrence(t[0],n,n.explicitDeclaration),this.entityOccurrence(this.nodes(r.children,"entityName")[0],i.target,i.target.explicitDeclaration)],edges:[{id:a,span:[0,0],...s.explicitIdLocation?{idSpan:s.explicitIdLocation.span}:{},...s.label?{labelSpan:s.label.span}:{}}]}}entityName(e){let t=this.tokens(e,"IDENTIFIER")[0],n=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],r=this.nodes(e,"nodeLabel")[0],i=this.nodes(e,"useCaseMetadata")[0],s=this.nodes(e,"stereotype")[0],a=this.nodes(e,"classSuffix")[0],o=a?this.visit(a):{classes:[],spans:[]};if(t){let n=r?this.visit(r):this.tokenLabel(t),a=r?this.tokens(e,"LBRACKET").length?"rect":"ellipse":void 0;return{id:t.image,label:n,location:this.tokenLocation(t),generated:!1,...a?{shape:a}:{},...i?{metadata:this.visit(i)}:{},...s?{stereotype:this.visit(s)}:{},classes:o.classes,classSpans:o.spans,explicitDeclaration:!!(a||i||s)}}let l=this.tokenLabel(n);return{id:this.generateId(l.text),label:l,location:this.tokenLocation(n),generated:!0,...i?{metadata:this.visit(i)}:{},...s?{stereotype:this.visit(s)}:{},classes:o.classes,classSpans:o.spans,explicitDeclaration:!!(i||s)}}nodeLabel(e){let t=this.allTokens(e);if(1===t.length&&("PLAIN_STRING"===t[0].tokenType.name||"MARKDOWN_STRING"===t[0].tokenType.name))return this.tokenLabel(t[0]);let n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return{text:this.source.slice(n[0],n[1]),type:"text",span:n}}useCaseMetadata(e){return this.visit(this.nodes(e,"metadata")[0])}relationTail(e){let t=this.tokens(e,"IDENTIFIER")[0];return{...t?{explicitId:t.image,explicitIdLocation:this.tokenLocation(t)}:{},arrow:this.visit(this.nodes(e,"arrow")[0]),target:this.visit(this.nodes(e,"entityName")[0])}}arrow(e){return this.visit(this.firstNode(e,"semanticRelation","forwardSolidOperator","backwardSolidOperator","markerlessSolidOperator","forwardCircleOperator","backwardCircleOperator","forwardCrossOperator","backwardCrossOperator"))}edgeLabel(e){return this.nodeLabel(e)}semanticRelation(e){if(this.tokens(e,"GENERALIZATION").length)return{type:"generalization",arrowType:0,minlen:1};let t=this.tokens(e,"INCLUDE").length?"include":"extend",n=this.tokens(e,"include"===t?"INCLUDE":"EXTEND")[0];return{type:t,arrowType:0,label:{text:t,type:"text",span:this.tokenSpan(n)},minlen:1}}metadata(e){return{properties:this.nodes(e,"metadataProperty").map(e=>this.visit(e)),location:this.ctxLocation(e)}}metadataProperty(e){let t=this.allTokens(e).filter(e=>"COLON"!==e.tokenType.name),n=t[0],r=t[1],i="TRUE"===r.tokenType.name||"FALSE"!==r.tokenType.name&&this.decodePlain(r),s=[n.startOffset,(r.endOffset??r.startOffset)+1];return{key:this.decodePlain(n),value:i,span:s,keySpan:this.contentSpan(n),valueSpan:this.contentSpan(r),location:this.tokenLocation(n)}}metadataSeparator(e){}systemBoundaryStatement(e){let t=this.visit(this.nodes(e,"systemBoundaryName")[0]),n=this.nodes(e,"classSuffix")[0],r=n?this.visit(n):{classes:[],spans:[]};t.classes=r.classes,this.builder.addBoundary(t);let i=this.parentBoundary;this.parentBoundary={id:t.id,location:t.location};let s=this.nodes(e,"systemBoundaryContent")[0],a=s?this.visit(s):[];this.parentBoundary=i;let o=this.tokens(e,"END")[0],l=this.nodes(e,"metadata")[0],c=l?this.visit(l):void 0,h={kind:"group",span:[0,0],group:t.id,idSpan:t.location.span,titleSpan:t.label.span,endSpan:this.tokenSpan(o),classSpans:r.spans,...c?{metadata:c.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...a.length?{children:a}:{}};return c&&this.builder.addMetadataAssignment(t.id,t.location,c,h),h}systemBoundaryName(e){let t=this.tokens(e,"IDENTIFIER")[0];if(t){let n=this.nodes(e,"nodeLabel")[0];return{id:t.image,label:n?this.visit(n):this.tokenLabel(t),location:this.tokenLocation(t),generated:!1,classes:[]}}let n=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,"blankLine"),...this.nodes(e,"commentLine"),...this.nodes(e,"boundaryElement")].sort((e,t)=>(e.location?.startOffset??0)-(t.location?.startOffset??0)).map(e=>this.wrap(e,this.visit(e)))}boundaryElement(e){let t=this.nodes(e,"actorDeclarationOnly")[0];if(t)return this.visit(t);let n=this.nodes(e,"entityName")[0],r=this.visit(n);return r.explicitDeclaration=!0,r.shape??="ellipse",this.builder.addElement(this.entityDraft(r)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(n,r,!0)]}}metadataAssignmentStatement(e){let t=this.visit(this.nodes(e,"metadataAssignmentTarget")[0]),n=this.visit(this.nodes(e,"metadata")[0]),r={kind:"metadata",span:[0,0],nodes:[{id:t.id,span:t.location.span,idSpan:t.location.span}],metadata:n.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))};return this.builder.addMetadataAssignment(t.id,t.location,n,r),r}metadataAssignmentTarget(e){let t=this.allTokens(e)[0],n=this.tokenLabel(t);return{id:"IDENTIFIER"===t.tokenType.name?t.image:this.generateId(n.text),location:this.tokenLocation(t)}}noteStatement(e){let t=this.tokens(e,"IDENTIFIER")[0],n=this.visit(this.nodes(e,"nodeLabel")[0]);return this.builder.addNote({target:t.image,targetLocation:this.tokenLocation(t),label:n,location:this.ctxLocation(e)}),{kind:"note",span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:n.span,nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}stereotype(e){let t=this.tokens(e,"STEREOTYPE_TEXT")[0];return{value:t.image.trim(),span:this.tokenSpan(t)}}classSuffix(e){let t=this.tokens(e,"IDENTIFIER");return{classes:t.map(e=>e.image),spans:t.map(e=>this.tokenSpan(e))}}jsonStatement(e){let t=this.tokens(e,"JSON_DECLARATION_START")[0],n=this.tokens(e,"JSON_OBJECT_LITERAL")[0],r=/^json[\t ]+(\w+)/.exec(t.image),i=r[1],s=r[0].length-i.length,a={span:[t.startOffset+s,t.startOffset+s+i.length],line:t.startLine??1,column:(t.startColumn??1)+s},o=uc(n.image,n.startLine??1,n.startColumn??1),l=this.nodes(e,"classSuffix")[0],c=l?this.visit(l):{classes:[],spans:[]},h={id:i,value:o.value,propertyOrder:o.propertyOrder,location:a,classes:c.classes};return this.builder.addJson(h),{kind:"json",span:[0,0],nodes:[{id:i,span:a.span,idSpan:a.span,defines:!0,classSpans:c.spans}],classSpans:c.spans}}directionStatement(e){let t=this.allTokens(e).find(e=>["TD","TB","BT","RL","LR"].includes(e.tokenType.name));return this.builder.setDirection(t.image),{kind:"direction",span:[0,0]}}classDefStatement(e){let t=this.tokens(e,"IDENTIFIER"),n=this.visit(this.nodes(e,"styles")[0]);return this.builder.addClassDef(t.map(e=>e.image),n),{kind:"classDef",span:[0,0],ref:t[0].image,refSpan:this.tokenSpan(t[0])}}classStatement(e){let t=this.tokens(e,"IDENTIFIER"),n=1;for(;n<t.length&&this.source.slice((t[n-1].endOffset??t[n-1].startOffset)+1,t[n].startOffset).includes(",");n++);let r=t.slice(0,n).map(e=>({id:e.image,location:this.tokenLocation(e)})),i=t.slice(n).map(e=>e.image);return this.builder.addClassAssignment(r,i),{kind:"classAssign",span:[0,0],ref:i[0],refSpan:this.tokenSpan(t[n]),nodes:r.map(({id:e,location:t})=>({id:e,span:t.span,idSpan:t.span}))}}styleStatement(e){let t=this.tokens(e,"IDENTIFIER")[0],n=this.visit(this.nodes(e,"styles")[0]);return this.builder.addStyleAssignment(t.image,this.tokenLocation(t),n),{kind:"style",span:[0,0],nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}styles(e){return this.nodes(e,"styleValue").map(e=>this.visit(e))}styleValue(e){let t=this.allTokens(e),n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return this.source.slice(n[0],n[1]).replaceAll("\\,",",")}styleComponent(e){return this.allTokens(e).map(e=>e.image).join("")}forwardSolidOperator(e){let t=this.tokens(e,"FORWARD_SOLID")[0];return{type:"association",arrowType:0,minlen:this.solidMinlen(t)}}backwardSolidOperator(e){let t=this.tokens(e,"BACKWARD_SOLID")[0],n=this.nodes(e,"edgeLabel")[0],r=n?this.tokens(e,"MARKERLESS_SOLID").at(-1):t;return{type:"association",arrowType:1,minlen:this.solidMinlen(r),...n?{label:this.visit(n)}:{}}}markerlessSolidOperator(e){let t=this.nodes(e,"edgeLabel")[0],n=this.allTokens(e);if(!t)return{type:"association",arrowType:2,minlen:this.solidMinlen(this.tokens(e,"MARKERLESS_SOLID")[0])};let r=n.at(-1),i="FORWARD_SOLID"===r.tokenType.name?0:"FORWARD_CIRCLE"===r.tokenType.name?3:"FORWARD_CROSS"===r.tokenType.name?4:2;return{type:"association",arrowType:i,label:this.visit(t),minlen:0===i||2===i?this.solidMinlen(r):1}}forwardCircleOperator(e){return{type:"association",arrowType:3,minlen:1}}backwardCircleOperator(e){let t=this.nodes(e,"edgeLabel")[0];return{type:"association",arrowType:5,minlen:1,...t?{label:this.visit(t)}:{}}}forwardCrossOperator(e){return{type:"association",arrowType:4,minlen:1}}backwardCrossOperator(e){let t=this.nodes(e,"edgeLabel")[0];return{type:"association",arrowType:6,minlen:1,...t?{label:this.visit(t)}:{}}}actorDraft(e){return{id:e.id,kind:"actor",label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}entityDraft(e){return{id:e.id,kind:"usecase",label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.shape?{shape:e.shape}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}endpoint(e,t=e.explicitDeclaration??!0){return{id:e.id,label:e.label,location:e.location,generated:e.generated,declaration:t,classesOnReference:e.classes.length>0}}relationshipDraft(e,t,n){return{source:this.endpoint(e,!0),target:this.endpoint(t.target),location:n,...t.explicitId?{explicitId:t.explicitId,explicitIdLocation:t.explicitIdLocation}:{},...t.arrow}}actorOccurrence(e,t,n){return{id:t.id,span:this.nodeSpan(e),idSpan:t.location.span,labelSpan:t.label.span,...n?{defines:!0}:{},...t.stereotype?{stereotypeSpan:t.stereotype.span}:{},...t.metadata?{metadata:t.metadata.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...t.classSpans.length?{classSpans:t.classSpans}:{}}}entityOccurrence(e,t,n){return this.actorOccurrence(e,t,n)}wrap(e,t){if("blank"===t.kind||"comment"===t.kind)return t;for(let n of(t.span=this.nodeSpan(e),t.edges??[]))n.span=t.span;return t}tokenLabel(e){let t="MARKDOWN_STRING"===e.tokenType.name?"markdown":"text",n="markdown"===t?2:+("PLAIN_STRING"===e.tokenType.name),r=this.tokenSpan(e,n);return{text:this.source.slice(r[0],r[1]),type:t,span:r}}decodePlain(e){return"PLAIN_STRING"===e.tokenType.name?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,"PLAIN_STRING"===e.tokenType.name?1:2*("MARKDOWN_STRING"===e.tokenType.name))}generateId(e){return e.replace(/\W/g,"_")}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){let t=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:t.startLine??1,column:t.startColumn??1}}ctxLocation(e){let t=this.allTokens(e).filter(e=>"NEWLINE"!==e.tokenType.name&&"EOF"!==e.tokenType.name),n=t[0],r=t.at(-1);return{span:[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)],line:n.startLine??1,column:n.startColumn??1}}tokenLocation(e){let t="PLAIN_STRING"===e.tokenType.name?1:2*("MARKDOWN_STRING"===e.tokenType.name);return{span:this.tokenSpan(e,t),line:e.startLine??1,column:(e.startColumn??1)+t}}nodeSpan(e){let t=this.allTokens(e.children).filter(e=>"NEWLINE"!==e.tokenType.name&&"EOF"!==e.tokenType.name),n=t[0],r=t.at(-1);if(!n||!r)throw Error("Usecase CST node has no source token");return[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)]}tokenSpan(e,t=0){return[e.startOffset+t,Math.min(this.source.length,(e.endOffset??e.startOffset+e.image.length-1)+1-t)]}nodes(e,t){return(e[t]??[]).filter(e=>"children"in e)}tokens(e,t){return(e[t]??[]).filter(e=>"tokenTypeIdx"in e)}firstNode(e,...t){for(let n of t){let t=this.nodes(e,n)[0];if(t)return t}throw Error(`Usecase CST is missing one of: ${t.join(", ")}`)}allTokens(e){let t=[];for(let n of Object.values(e))for(let e of n)"tokenTypeIdx"in e?t.push(e):t.push(...this.allTokens(e.children));return t.sort((e,t)=>e.startOffset-t.startOffset)}},uv={parse:(0,j.K)(async e=>{cW.clear(),ur.input=[];try{ch({diagramType:"usecase",lexer:ue,parser:ur,entry:(0,j.K)(()=>ur.start(),"entry"),visit:(0,j.K)(t=>uL.build(t,e),"visit")},e)}catch(n){cW.clear();let t=ur.errors[0];if(t){let{token:r}=t,i=Number.isFinite(r.startOffset)?r.startOffset:e.length,s="number"==typeof r.endOffset&&Number.isFinite(r.endOffset)?r.endOffset+1:i,a=r.startLine??e.slice(0,i).split(/\r\n|\r|\n/).length,o=Math.max(e.lastIndexOf("\n",i-1),e.lastIndexOf("\r",i-1)),l=r.startColumn??i-o,c=n instanceof Error?n.message:String(n);throw Error(`${c} at line ${a}, column ${l} [${i},${s})`)}throw n}},"parse")},uO=["point","circle","cross","extension"],uR={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},uk=(0,j.K)((e,t)=>{let[n,r]=[e,t].map(e=>e.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element");return`usecase-${n}-${r}`},"usecaseDomId"),uN=(0,j.K)(e=>`usecase-${e.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element"}`,"usecaseNodeDomId"),u_=(0,j.K)((e,t)=>"markdown"!==t?e:(0,U.O6)(e).map(e=>e.map(e=>e.content).join(" ")).join("\n"),"getAccessibleLabel"),uI=(0,j.K)(e=>{let t=u_(e.label??e.id,e.labelType);if(uR[e.shape]){let n=e.actorType&&"normal"!==e.actorType?`${e.actorType} `:"",r=e.business?"business ":"",i=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${r}${n}actor ${t}${i}`}if("note"===e.shape)return`Note for ${e.noteTargetLabel??e.noteTarget??""}: ${t}`;if("usecaseJsonTable"===e.shape){let n=(e.jsonRows??[]).map(e=>`${e.accessibleKey}: ${e.value}`).join("; ");return n?`${t}: ${n}`:t}let n=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${e.business?"business ":""}use case ${t}${n}`},"getUsecaseNodeAccessibleName"),uC=(0,j.K)(e=>`${e.boundaryType} system boundary ${u_(e.label??e.id,e.labelType)}`,"getUsecaseBoundaryAccessibleName"),ux=(0,j.K)(e=>{if("note"===e.relationshipType)return"";let t="association"===e.relationshipType&&e.label?`association ${u_(e.label,e.labelType)}`:e.relationshipType;return`${t} from ${e.sourceLabel} to ${e.targetLabel}`},"getUsecaseEdgeAccessibleName"),uw=(0,j.K)(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"escapePlainLabel"),uU=(0,j.K)(e=>e.replace(/([*[\\\]_`])/g,"\\$1"),"escapeMarkdownMarkers"),uM=(0,j.K)((e,t)=>{for(let n of(e.diagramId=t,e.markers=[...uO],e.nodes))if(n.domId=uN(n.id),void 0!==n.label&&"text"===n.labelType&&(n.label=uw(n.label)),n.stereotype&&(n.stereotype=uw(n.stereotype)),n.isGroup||"usecaseJsonTable"!==n.shape||(n.jsonRows=n.jsonRows?.map(e=>({...e,key:uw(e.key),value:uw(e.value)}))),!n.isGroup&&("usecaseEllipse"===n.shape||"rect"===n.shape)&&n.stereotype){let e=n.label??uw(n.id);n.label=`\xab${uU(n.stereotype)}\xbb<br/>${"text"===n.labelType?uU(e):e}`,n.labelType="markdown",n.hasFoldedStereotype=!0,delete n.stereotype}for(let t of e.edges)void 0!==t.label&&"text"===t.labelType&&(t.label=uw(t.label));return e},"prepareUsecaseLayoutData"),uP=(0,j.K)((e,t,n)=>{for(let r of t.nodes){let i="string"==typeof r.domId?r.domId:uk(t.diagramId,r.id),s=e.select(`#${i}`),a=r.isGroup?"boundary":uR[r.shape]?"actor":"note"===r.shape?"note":"usecaseJsonTable"===r.shape?"json":"usecase",o=n.nodes.get(r.id)??r.id;if(s.attr("data-usecase-id",r.id).attr("data-usecase-kind",a).attr("role","img").attr("aria-label",o),!r.isGroup&&("usecaseEllipse"===r.shape||"rect"===r.shape)&&"hasFoldedStereotype"in r&&!0===r.hasFoldedStereotype){let e=s.node(),t=e?.querySelector(".nodeLabel"),n=t?.querySelector("p")??t,r=n?.firstChild;if(n&&r?.nodeType===3){let e=n.ownerDocument.createElement("span");e.className="usecase-stereotype",n.insertBefore(e,r),e.appendChild(r)}else e?.querySelector(".label tspan tspan, .label tspan")?.classList.add("usecase-stereotype")}}let r=new Map(t.edges.map(e=>[e.id,e]));e.selectAll('path[data-et="edge"]').each(function(){let e=r.get(this.getAttribute("data-id")??"");if(!e)return;let i=(0,cc.Ltv)(this);i.attr("id",uk(t.diagramId,e.id)).attr("data-usecase-id",e.id).attr("data-usecase-kind",e.internal?"note-connector":"relationship"),e.internal?i.attr("aria-hidden","true"):i.attr("role","img").attr("aria-label",n.edges.get(e.id)??e.id)})},"annotateUsecaseElements"),uD=(0,j.K)((e,t)=>{e.style("--mermaid-usecase-actor-font-size",`${t.actorFontSize}px`).style("--mermaid-usecase-actor-font-family",t.actorFontFamily).style("--mermaid-usecase-actor-font-weight",t.actorFontWeight).style("--mermaid-usecase-font-size",`${t.usecaseFontSize}px`).style("--mermaid-usecase-font-family",t.usecaseFontFamily).style("--mermaid-usecase-font-weight",t.usecaseFontWeight)},"applyUsecaseFonts"),u$=(0,j.K)(async(e,t,n,r)=>{$.R.info("Drawing usecase diagram (unified)",t);let{layout:i}=(0,D.D7)(),s=r.db,a=s.getData(),o=new Map(a.nodes.map(e=>[e.id,u_(e.label??e.id,e.labelType)])),l={nodes:new Map(a.nodes.map(e=>[e.id,e.isGroup?uC(e):uI("note"===e.shape?{...e,noteTargetLabel:o.get(e.noteTarget??"")}:e)])),edges:new Map(a.edges.map(e=>[e.id,ux({...e,sourceLabel:o.get(e.source)??e.sourceLabel,targetLabel:o.get(e.target)??e.targetLabel})]))},c=(0,C.A)(t,a.config.securityLevel);a.layoutAlgorithm=(0,w.q7)(i),uM(a,t),uD(c,a),await (0,w.XX)(a,c),uP(c,a,l);let h=a.diagramPadding;P._K.insertTitle(c,"usecaseDiagramTitleText",0,s.getDiagramTitle?.()??""),(0,x.P)(c,h,"usecaseDiagram",a.useMaxWidth),uD(c,a)},"draw"),uj=(0,j.K)(e=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),"roleColors"),uF=(0,j.K)(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!(0,M.P1)(t,r))return"";let i=(0,D.zj)().usecase?.colorScheme==="rotate",s=(0,M.rq)(e.look),a="handDrawn"===s,o=(0,M.Ic)(n),l="";for(let e=0;e<(0,M.Hu)(r);e++){let t=r[e],c=o?`fill: ${n[e%n.length]};`:"",h=`[data-look="${s}"][data-color-id="color-${e}"]`;l+=`
|
|
58
|
-
|
|
59
|
-
& ${h}.system-boundary rect.boundary-body,
|
|
60
|
-
& ${h}.system-boundary rect.boundary-tab,
|
|
61
|
-
& ${h}.system-boundary .boundary-body path,
|
|
62
|
-
& ${h}.system-boundary .boundary-tab path {
|
|
63
|
-
stroke: ${t};
|
|
64
|
-
${c}
|
|
65
|
-
}
|
|
66
|
-
`,i&&(l+=`
|
|
67
|
-
|
|
68
|
-
/* Use case bodies -- \`.usecase-element\` covers the ellipse form, the \`[Rect]\` form and
|
|
69
|
-
the business variant.
|
|
70
|
-
|
|
71
|
-
Element selectors only, never a bare \`path\`. Under the handDrawn look roughjs draws
|
|
72
|
-
the body as a *pair* of paths, an outline stroked in the border colour and a hachure
|
|
73
|
-
fill stroked in the background colour, with no class to tell them apart. Stroking
|
|
74
|
-
both repaints the fill lines as border colour and the shape collapses into a solid
|
|
75
|
-
block -- which is what \`.usecase-element path\` did. So handDrawn bodies keep the
|
|
76
|
-
theme's uniform colours, exactly as handDrawn flowchart nodes do. */
|
|
77
|
-
& ${h}.usecase-element ellipse,
|
|
78
|
-
& ${h}.usecase-element rect {
|
|
79
|
-
stroke: ${t};
|
|
80
|
-
${c}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/* The business marker is a single classed path, so it can be reached safely by name --
|
|
84
|
-
without it the marker keeps the uniform border beside a palette-coloured body. No
|
|
85
|
-
\`fill\`: the marker is drawn with \`fill="none"\` and has to stay that way. */
|
|
86
|
-
& ${h}.usecase-element .usecase-business-marker {
|
|
87
|
-
stroke: ${t};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* Actor glyphs, mirroring the uniform rule further down. The fill goes on the glyph
|
|
91
|
-
group, never on its children, so the hollow variant's own \`fill="none"\` keeps
|
|
92
|
-
winning and a hollow actor stays hollow. Same reason as above for not descending
|
|
93
|
-
into the handDrawn paths. */
|
|
94
|
-
& ${h}.usecase-actor .usecase-actor-shape,
|
|
95
|
-
& ${h}.usecase-actor .usecase-actor-hollow,
|
|
96
|
-
& ${h}.usecase-actor .usecase-actor-awesome,
|
|
97
|
-
& ${h}.usecase-actor .usecase-actor-icon {
|
|
98
|
-
stroke: ${t};
|
|
99
|
-
${c}
|
|
100
|
-
}
|
|
101
|
-
${a?"":`
|
|
102
|
-
/* The group rule above reaches the glyph by inheritance, which the neo look breaks: it
|
|
103
|
-
ships a \`[data-look="neo"].node path { stroke }\` rule that hits the glyph's own paths,
|
|
104
|
-
and a value set directly on the child always beats one inherited from the parent,
|
|
105
|
-
whatever the parent rule's specificity. So name the children too.
|
|
106
|
-
|
|
107
|
-
Emitted for every look *except* handDrawn, where roughjs draws the glyph as an
|
|
108
|
-
outline path plus a hachure fill path stroked in the fill colour, indistinguishable
|
|
109
|
-
in CSS -- stroking both turns a hollow actor into a solid disc. Deliberately no
|
|
110
|
-
\`fill\` either way, so the hollow variant's own \`fill="none"\` keeps winning. */
|
|
111
|
-
& ${h}.usecase-actor .usecase-actor-glyph path,
|
|
112
|
-
& ${h}.usecase-actor .usecase-actor-glyph circle {
|
|
113
|
-
stroke: ${t};
|
|
114
|
-
}
|
|
115
|
-
`}
|
|
116
|
-
`)}return l},"genColor"),uB={parser:uv,db:cW,renderer:{draw:u$},styles:(0,j.K)(e=>{let t=uj(e),n="handDrawn"===(0,M.rq)(e.look);return`
|
|
117
|
-
${uF(e)}
|
|
118
|
-
& .usecase-actor {
|
|
119
|
-
color: ${e.actorTextColor??e.primaryTextColor};
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
& .usecase-actor-shape,
|
|
123
|
-
& .usecase-actor-hollow,
|
|
124
|
-
& .usecase-actor-awesome,
|
|
125
|
-
& .usecase-actor-icon {
|
|
126
|
-
fill: ${t.actorBkg};
|
|
127
|
-
stroke: ${t.actorBorder};
|
|
128
|
-
stroke-width: 2px;
|
|
129
|
-
}
|
|
130
|
-
${n?"":`
|
|
131
|
-
/* The rule above colours the glyph group and lets its children inherit, which the neo
|
|
132
|
-
look breaks: it ships a \`[data-look="neo"].node path { stroke }\` rule that lands on
|
|
133
|
-
the glyph's own paths, and a value set directly on a child always beats one inherited
|
|
134
|
-
from its parent, whatever the parent rule's specificity. Since neo is the default look,
|
|
135
|
-
without this every actor renders in the node border colour rather than the actor
|
|
136
|
-
colour the rule above asks for.
|
|
137
|
-
|
|
138
|
-
\`.node\` is in the selector to outrank that neo rule rather than tie with it: both
|
|
139
|
-
would otherwise be one attribute plus one class plus one element, leaving the winner to
|
|
140
|
-
depend on which stylesheet is concatenated last.
|
|
141
|
-
|
|
142
|
-
Stroke only: the hollow variant's own \`fill="none"\` has to keep winning. */
|
|
143
|
-
& .node.usecase-actor .usecase-actor-glyph path,
|
|
144
|
-
& .node.usecase-actor .usecase-actor-glyph circle {
|
|
145
|
-
stroke: ${t.actorBorder};
|
|
146
|
-
}
|
|
147
|
-
`}
|
|
148
|
-
& .usecase-actor .nodeLabel,
|
|
149
|
-
& .actor-label {
|
|
150
|
-
color: ${e.actorTextColor??e.primaryTextColor};
|
|
151
|
-
fill: ${e.actorTextColor??e.primaryTextColor};
|
|
152
|
-
font-family: var(--mermaid-usecase-actor-font-family, ${e.fontFamily});
|
|
153
|
-
font-size: var(--mermaid-usecase-actor-font-size, 14px);
|
|
154
|
-
font-weight: var(--mermaid-usecase-actor-font-weight, normal);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
& .usecase-element ellipse,
|
|
158
|
-
& .usecase-element rect,
|
|
159
|
-
& .usecase-business ellipse,
|
|
160
|
-
& .usecase-business rect {
|
|
161
|
-
fill: ${t.bkg};
|
|
162
|
-
stroke: ${t.border};
|
|
163
|
-
stroke-width: 2px;
|
|
164
|
-
}
|
|
165
|
-
${n?"":`
|
|
166
|
-
/* The same interception the actor glyph hits, one element down: neo ships
|
|
167
|
-
\`[data-look="neo"].node rect { stroke: nodeBorder }\`, which outranks the plain
|
|
168
|
-
\`.usecase-element rect\` above, so a use case written in the \`[Rect]\` form kept the node
|
|
169
|
-
border colour while its ellipse siblings took the role colour. An \`<ellipse>\` has no
|
|
170
|
-
equivalent neo rule and is already correct; restating it here costs nothing and means
|
|
171
|
-
the two forms cannot drift apart again.
|
|
172
|
-
|
|
173
|
-
Qualified with \`[data-look]\` *and* \`.node\` to land strictly above that rule rather than
|
|
174
|
-
tie with it -- on a tie the later stylesheet would win, which is how neo took this in
|
|
175
|
-
the first place. Skipped under handDrawn, where roughjs draws paths and neither element
|
|
176
|
-
exists. */
|
|
177
|
-
& [data-look="${(0,M.rq)(e.look)}"].node.usecase-element ellipse,
|
|
178
|
-
& [data-look="${(0,M.rq)(e.look)}"].node.usecase-element rect {
|
|
179
|
-
fill: ${t.bkg};
|
|
180
|
-
stroke: ${t.border};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/* The business marker is a \`<path>\`, so it loses to \`[data-look="neo"].node path\` the same
|
|
184
|
-
way. No \`fill\`: the marker is drawn with \`fill="none"\` and has to stay that way. */
|
|
185
|
-
& [data-look="${(0,M.rq)(e.look)}"].node.usecase-element .usecase-business-marker {
|
|
186
|
-
stroke: ${t.border};
|
|
187
|
-
}
|
|
188
|
-
`}
|
|
189
|
-
& .usecase-element .nodeLabel,
|
|
190
|
-
& .usecase-label {
|
|
191
|
-
color: ${e.primaryTextColor};
|
|
192
|
-
fill: ${e.primaryTextColor};
|
|
193
|
-
font-family: var(--mermaid-usecase-font-family, ${e.fontFamily});
|
|
194
|
-
font-size: var(--mermaid-usecase-font-size, 12px);
|
|
195
|
-
font-weight: var(--mermaid-usecase-font-weight, normal);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
& .usecase-stereotype,
|
|
199
|
-
& .usecase-business-marker {
|
|
200
|
-
color: ${e.primaryTextColor};
|
|
201
|
-
fill: ${e.primaryTextColor};
|
|
202
|
-
stroke: ${t.border};
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
& .system-boundary rect.boundary-body,
|
|
206
|
-
& .system-boundary rect.boundary-tab,
|
|
207
|
-
& .system-boundary-package-tab {
|
|
208
|
-
fill: ${t.boundaryBkg};
|
|
209
|
-
stroke: ${t.boundaryBorder};
|
|
210
|
-
stroke-width: 1px;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
& .system-boundary-title text {
|
|
214
|
-
fill: ${e.titleColor??e.primaryTextColor};
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/* Only the span, never the <p> inside it: the renderer puts a user-supplied
|
|
218
|
-
'color' on the span, and that has to stay inheritable by its children. */
|
|
219
|
-
& .system-boundary-title span {
|
|
220
|
-
color: ${e.titleColor??e.primaryTextColor};
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
& .usecase-note {
|
|
224
|
-
fill: ${e.noteBkgColor};
|
|
225
|
-
stroke: ${e.noteBorderColor};
|
|
226
|
-
color: ${e.noteTextColor};
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
& .usecase-note .nodeLabel {
|
|
230
|
-
color: ${e.noteTextColor};
|
|
231
|
-
fill: ${e.noteTextColor};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
& .usecase-json-table,
|
|
235
|
-
& .usecase-json-table rect,
|
|
236
|
-
& .usecase-json-cell {
|
|
237
|
-
fill: ${e.mainBkg};
|
|
238
|
-
stroke: ${e.nodeBorder??e.primaryColor};
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
& .usecase-json-title,
|
|
242
|
-
& .usecase-json-key,
|
|
243
|
-
& .usecase-json-value {
|
|
244
|
-
color: ${e.primaryTextColor};
|
|
245
|
-
fill: ${e.primaryTextColor};
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
& .relationship {
|
|
249
|
-
fill: none;
|
|
250
|
-
stroke: ${e.lineColor};
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
& .relationship-include,
|
|
254
|
-
& .relationship-extend,
|
|
255
|
-
& .relationship-note {
|
|
256
|
-
stroke-dasharray: 3;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/* Include and extend are both dashed, which is a weak distinction at small sizes. The
|
|
260
|
-
tokens default to \`lineColor\`, so a theme that does not set them is unchanged. */
|
|
261
|
-
& .relationship-include {
|
|
262
|
-
stroke: ${t.includeLine};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
& .relationship-extend {
|
|
266
|
-
stroke: ${t.extendLine};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
& .relationship.edge-animation-fast,
|
|
270
|
-
& .relationship.edge-animation-slow {
|
|
271
|
-
stroke-linecap: round;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
& .edgeLabel,
|
|
275
|
-
& .edgeLabel p {
|
|
276
|
-
background-color: ${e.edgeLabelBackground};
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
& .labelBkg {
|
|
280
|
-
background-color: ${e.edgeLabelBackground};
|
|
281
|
-
padding: 0 2px;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
& .edgeLabel .label rect {
|
|
285
|
-
fill: ${e.edgeLabelBackground};
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
& .relationship-label,
|
|
289
|
-
& .edgeLabel {
|
|
290
|
-
color: ${e.primaryTextColor};
|
|
291
|
-
fill: ${e.primaryTextColor};
|
|
292
|
-
font-family: ${e.fontFamily};
|
|
293
|
-
font-size: 10px;
|
|
294
|
-
font-weight: normal;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
& .marker,
|
|
298
|
-
& .marker.point,
|
|
299
|
-
& .marker.circle,
|
|
300
|
-
& .marker.cross {
|
|
301
|
-
fill: ${e.lineColor};
|
|
302
|
-
stroke: ${e.lineColor};
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
& .marker.extension {
|
|
306
|
-
fill: ${e.mainBkg};
|
|
307
|
-
stroke: ${e.lineColor};
|
|
308
|
-
}
|
|
309
|
-
`},"getStyles")}}}]);
|