@microvac/ui 0.0.0-stage → 0.1.0-rc.14
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 +29 -2
- package/dist/android-chrome-192x192.png +0 -0
- package/dist/android-chrome-512x512.png +0 -0
- package/dist/announcement-preview.svg +11 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/assets/ActiveAgentsPanel-C9AP9hJu.js +1 -0
- package/dist/assets/AdapterManager-CmxTUKJH.js +1 -0
- package/dist/assets/AdvancedToolsRoute-CXsQnTei.js +39 -0
- package/dist/assets/AgentActionButtons-DWq2OuVK.js +1 -0
- package/dist/assets/AgentAdvancedTab-dhBDxF-H.js +131 -0
- package/dist/assets/AgentBulkSettingsSheet-DYT4ovDg.js +1 -0
- package/dist/assets/AgentChat-r0TPOfPK.js +1 -0
- package/dist/assets/AgentDetailPage-Bc_okBuS.js +39 -0
- package/dist/assets/AgentIdentityChip-CB2NBXkZ.js +1 -0
- package/dist/assets/AgentRosterFilters-b7qMLv8-.js +2 -0
- package/dist/assets/Agents-BsvXy3pZ.js +2 -0
- package/dist/assets/Agents.production-BeOZmzaF.js +2 -0
- package/dist/assets/AnimatedDialogContent-CWshmxP2.js +1 -0
- package/dist/assets/AppDetail-DbqENTF_.js +1 -0
- package/dist/assets/AppNotConnected-BhnCqL0F.js +1 -0
- package/dist/assets/ApprovalDetail-B2KiYLTj.js +1 -0
- package/dist/assets/Approvals-j-wRmqKj.js +1 -0
- package/dist/assets/AppsConnect-CcPVEZ0C.js +1 -0
- package/dist/assets/AppsReview-B8eWvKkS.js +1 -0
- package/dist/assets/ArtifactEmptyGraphic-5mdkS5jj.js +1 -0
- package/dist/assets/Artifacts-Bz7Oo6VX.js +1 -0
- package/dist/assets/AssigneePickerInner-DdpF7hck.js +1 -0
- package/dist/assets/AssistantConnection-BpaaJDc_.js +1 -0
- package/dist/assets/AttentionInlineVerbs-DlPQVCO-.js +1 -0
- package/dist/assets/AttentionQueueRow-BC6ezctS.js +1 -0
- package/dist/assets/AuditHub-BVP7LKL9.js +1 -0
- package/dist/assets/AuditRuns-DqizHgX1.js +1 -0
- package/dist/assets/Auth-DOF0snjp.js +3 -0
- package/dist/assets/BoardChat-BYAbDtfd.js +18 -0
- package/dist/assets/BoardClaim-7y41Pr8e.js +1 -0
- package/dist/assets/BootstrapSetupUxLab-BftH1vOv.js +1 -0
- package/dist/assets/Browse-Ck01W1Yl.js +1 -0
- package/dist/assets/BudgetPolicyCard-CKhrzfgy.js +1 -0
- package/dist/assets/CaseDetail-qlXKJ66D.js +1 -0
- package/dist/assets/CaseStatus-B3RiZVDH.js +1 -0
- package/dist/assets/Cases-CFV3V-5X.js +1 -0
- package/dist/assets/ChatEndpointDetail-7Hi5TJNt.js +5 -0
- package/dist/assets/ChatEndpointSetup-CtwgH6sg.js +1 -0
- package/dist/assets/ChatIdentityConfirm-CXjksBwX.js +1 -0
- package/dist/assets/CliAuth-KVjrGMfZ.js +1 -0
- package/dist/assets/Companies-oeJem3De.js +1 -0
- package/dist/assets/CompanyAccess-vWT6G-n_.js +1 -0
- package/dist/assets/CompanyActivity-zOzzeN1B.js +1 -0
- package/dist/assets/CompanyActivity.production-DbaFBsM0.js +1 -0
- package/dist/assets/CompanyConnections-llSEaVa2.js +1 -0
- package/dist/assets/CompanyEnvironments-BrP-ENHg.css +1 -0
- package/dist/assets/CompanyEnvironments-DNyyGC_S.js +35 -0
- package/dist/assets/CompanyExport-CFa-F8Es.js +4 -0
- package/dist/assets/CompanyImport-DG6qwQ8F.js +1 -0
- package/dist/assets/CompanySettings-Dv5Z3ZQi.js +1 -0
- package/dist/assets/CompanySettingsPluginPage-CZk1d_0d.js +1 -0
- package/dist/assets/CompanySkills-CdzWhJfQ.js +10 -0
- package/dist/assets/CompanySkills.production-IoCRW5FQ.js +10 -0
- package/dist/assets/ConfigureBuiltInAgentModal-BwW7XQ1O.js +1 -0
- package/dist/assets/CopyableGatewayUrl-PTn061ft.js +1 -0
- package/dist/assets/CordisPluginSettings-C_BeeGEc.js +1 -0
- package/dist/assets/Costs-DhuNxwSj.js +1 -0
- package/dist/assets/CrossIssueCollaborationUxLab-ZaAXq46r.js +1 -0
- package/dist/assets/Dashboard-BaDnqiKo.js +2 -0
- package/dist/assets/DashboardLive-D-Ed7osd.js +1 -0
- package/dist/assets/DecisionDateChips-D3pl_mLn.js +1 -0
- package/dist/assets/DecisionHistoryPanel-D5MzyrOh.js +1 -0
- package/dist/assets/DecisionQueuePage-D3UZ9oRk.js +1 -0
- package/dist/assets/DesignGuide-COTo7ICj.js +25 -0
- package/dist/assets/DesignSandboxTaskThread-CMeCSQid.js +28 -0
- package/dist/assets/EmailConnectionAccess-kCL7obSr.js +1 -0
- package/dist/assets/EmailEndpointSetup-BGrksR_u.js +1 -0
- package/dist/assets/EnforcementBanner-_Eb_nK3M.js +1 -0
- package/dist/assets/EntityRow-gpsOgEtu.js +1 -0
- package/dist/assets/ExecutionWorkspaceDetail-DwGkH6d3.js +19 -0
- package/dist/assets/ExternalAgentInviteDialog-CGid6pM9.js +50 -0
- package/dist/assets/FilterBar-1D-VhrvG.js +1 -0
- package/dist/assets/FolderControls-CQ6kef3c.js +1 -0
- package/dist/assets/GatewayDetail-CCqekM1J.js +2 -0
- package/dist/assets/GatewaysList-nFsRcszh.js +1 -0
- package/dist/assets/GitHubConnectionRecovery-B9sFWJup.js +1 -0
- package/dist/assets/GoalDetail-BQ8y55P-.js +1 -0
- package/dist/assets/GoalTree-laRjXp0P.js +1 -0
- package/dist/assets/Goals-Cm14EaeP.js +1 -0
- package/dist/assets/InstanceAccess-DxQ-Akt_.js +1 -0
- package/dist/assets/InstanceExperimentalSettings-BxwqbXNw.js +1 -0
- package/dist/assets/InviteLanding-Cf0L_u6s.js +1 -0
- package/dist/assets/IssueChatLongThreadPerf-BfsF6FdF.js +2 -0
- package/dist/assets/JoinRequestQueue-BXCdTFG_.js +1 -0
- package/dist/assets/Layout.production-CqzU0qMi.js +1 -0
- package/dist/assets/McpConnect-COWnZ9Eb.js +1 -0
- package/dist/assets/MembershipAction-C9i9Sdmi.js +1 -0
- package/dist/assets/MetricCard-Bwnt3_p3.js +1 -0
- package/dist/assets/MissingPluginTabPlaceholder-B0Zxv1Kx.js +1 -0
- package/dist/assets/NewAgent-BIlJ5Dyt.js +1 -0
- package/dist/assets/NewAgentDialog-CJdMxxYL.js +1 -0
- package/dist/assets/NewGoalDialog-B8izfKLm.js +1 -0
- package/dist/assets/NewProjectDialog-DXqjTYFK.js +1 -0
- package/dist/assets/OnboardingPrimitives-DHYBqn_0.js +1 -0
- package/dist/assets/OnboardingWizard-DqSfZ13V.js +2 -0
- package/dist/assets/OrgChart.production-DrSFUf7i.js +1 -0
- package/dist/assets/PaperclipCloudOAuthHandoff-jPUvjJ8q.js +1 -0
- package/dist/assets/PluginManager-h3LFPaUq.js +1 -0
- package/dist/assets/PluginPage-E5Im4454.js +1 -0
- package/dist/assets/PluginSettings-BBO0jAgo.js +1 -0
- package/dist/assets/ProfileDetailRoute-CQBD7fms.js +1 -0
- package/dist/assets/ProfileSettings-BwnVEHLp.js +1 -0
- package/dist/assets/ProfileWizardRoute-By_SC6Gn.js +1 -0
- package/dist/assets/ProjectDetail-CbiwFBAE.js +1 -0
- package/dist/assets/ProjectRepositoryInput-DZF9bX4E.js +1 -0
- package/dist/assets/ProjectWorkspaceDetail-DPsl_4bD.js +29 -0
- package/dist/assets/ProjectWorkspacesContent-COH4dOWK.js +1 -0
- package/dist/assets/Projects-Ch9Qu7sn.js +1 -0
- package/dist/assets/QuotaBar-DIFOT9Uh.js +1 -0
- package/dist/assets/RepositoryEditor-DHB1bqId.js +1 -0
- package/dist/assets/Responsibilities-C5O0JXXG.js +4 -0
- package/dist/assets/ResponsibilityDetail-D6NpZpkm.js +1 -0
- package/dist/assets/ResponsibleUserDenialUxLab-CFrIWYwe.js +1 -0
- package/dist/assets/ReviewQueueCard-BPC4Lm67.js +1 -0
- package/dist/assets/RoutineAuditActivity-sKyzMajz.js +1 -0
- package/dist/assets/RoutineDetail-CG8HF5fp.js +2 -0
- package/dist/assets/RoutineRunVariablesDialog-CKh3CmLD.js +1 -0
- package/dist/assets/Routines-tF2qfUKo.js +1 -0
- package/dist/assets/Routines.production-BTyj1Ljr.js +1 -0
- package/dist/assets/RoutinesToolbar-CvUFVCGN.js +1 -0
- package/dist/assets/Search-Z9D0NuS1.js +1 -0
- package/dist/assets/Secrets-DgmbLOJK.js +4 -0
- package/dist/assets/SkillBinaryFile-F3_9qcaM.js +1 -0
- package/dist/assets/SkillCardIcon-CXHUCMej.js +2 -0
- package/dist/assets/SkillFolderTree-CB3lrTIE.js +1 -0
- package/dist/assets/SkillSourceTree-BbuciCo6.js +2 -0
- package/dist/assets/SkillSources-Dlo6Cew3.js +2 -0
- package/dist/assets/SkillStudio-ZO-Nf7eI.js +9 -0
- package/dist/assets/SkillsNavigationTabs-B9Iqnlqt.js +1 -0
- package/dist/assets/SpekoPhoneCallback-C4VnMiZh.js +1 -0
- package/dist/assets/SpekoProviderSetup-I4evPZb3.js +1 -0
- package/dist/assets/StatusCards-D0MVzbsw.js +1 -0
- package/dist/assets/SummarySlotCard-DUXgZPxG.js +1 -0
- package/dist/assets/TailscaleConnector-CMhT73gj.js +1 -0
- package/dist/assets/TaskChatLab-D9-KAE-7.js +11 -0
- package/dist/assets/TaskSummaryList-CUxieFNe.js +1 -0
- package/dist/assets/Timeline-BNMoRbtK.js +1 -0
- package/dist/assets/ToolsAdminGate-CEr0zy2T.js +1 -0
- package/dist/assets/TrustPresetSection-B9YXZtkh.js +1 -0
- package/dist/assets/UserProfile-D-tnW96X.js +1 -0
- package/dist/assets/WebhookUrlWarning-Ba_DixKh.js +1 -0
- package/dist/assets/WhatNeedsMe-B-Jzj8_M.js +1 -0
- package/dist/assets/Workspaces-BqhDI_Bl.js +1 -0
- package/dist/assets/abnfDiagram-YUKMZFIV-Bn9P-nUW.js +1 -0
- package/dist/assets/apl-MHzTCvfx.js +1 -0
- package/dist/assets/arc-Dnq9Aszq.js +1 -0
- package/dist/assets/architecture-WOLXFQ4H-V1ldsZlt.js +1 -0
- package/dist/assets/architectureDiagram-47P4ROYG-BkYxt-Gc.js +36 -0
- package/dist/assets/array-CL5Tisss.js +1 -0
- package/dist/assets/arrow-down-left-o81ENfeW.js +1 -0
- package/dist/assets/asciiarmor-DFLNSgns.js +1 -0
- package/dist/assets/asn1-CfPVWRYE.js +1 -0
- package/dist/assets/asterisk-CJ4OeA7Y.js +1 -0
- package/dist/assets/blockDiagram-E7TT5TSB-BO7pPYbp.js +140 -0
- package/dist/assets/brainfuck-NEHkmXMc.js +1 -0
- package/dist/assets/budgets-0Dw6TH1A.js +1 -0
- package/dist/assets/building-complex-DciZTnys.js +1 -0
- package/dist/assets/c4Diagram-CRA5TL53-D4EpmmzV.js +38 -0
- package/dist/assets/channel-BQh2vFIU.js +1 -0
- package/dist/assets/character-CguPM7IG.js +1 -0
- package/dist/assets/chat-channels-DWyry-9M.js +1 -0
- package/dist/assets/chunk-2BW5OAIV-DFXIyCJy.js +10 -0
- package/dist/assets/chunk-2Q5K7J3B-CkPHWFj-.js +1 -0
- package/dist/assets/chunk-3YJQHVM4-Dj5wEKIw.js +2 -0
- package/dist/assets/chunk-4EA7E6EY-5XiUVgzK.js +1 -0
- package/dist/assets/chunk-5VM5RSS4-2H3r6wq0.js +15 -0
- package/dist/assets/chunk-7TKQ45FW-D0opKcsy.js +1 -0
- package/dist/assets/chunk-AW2ZBBNX-DnjsTe04.js +88 -0
- package/dist/assets/chunk-DBDB3WZW-DNqSQPZ0.js +1 -0
- package/dist/assets/chunk-DUW6YSOI-slPglwIh.js +1 -0
- package/dist/assets/chunk-E2ZNV5FY-cjSf_BTz.js +70 -0
- package/dist/assets/chunk-EU5HNXII-CZYBiaSw.js +213 -0
- package/dist/assets/chunk-FVRAUYC3-DSc0-wJA.js +2 -0
- package/dist/assets/chunk-HJ2JQQFS-MXK0gYSP.js +1 -0
- package/dist/assets/chunk-HTAEGDNF-BjDZm_5k.js +1 -0
- package/dist/assets/chunk-J5ZVWO5B-ClU583ja.js +1 -0
- package/dist/assets/chunk-JWPE2WC7--HEGjv3t.js +1 -0
- package/dist/assets/chunk-KQW6MTUR-Bfj0tDmO.js +1 -0
- package/dist/assets/chunk-NGNAAXSQ-e5XI1hSt.js +128 -0
- package/dist/assets/chunk-NTY3LDVX-Bpz5TkVb.js +1 -0
- package/dist/assets/chunk-VPRB5NB3-CfeHjtbb.js +129 -0
- package/dist/assets/chunk-XC4XBNZT-FBCWmi6K.js +62 -0
- package/dist/assets/chunk-XXDRQBXY-BdWplhUD.js +1 -0
- package/dist/assets/chunk-Y2CYZVJY-OvsAdhaO.js +1 -0
- package/dist/assets/circle-slash-DqKFFqfb.js +1 -0
- package/dist/assets/classDiagram-v2-K4WV4PDN-DbC_J0kK.js +217 -0
- package/dist/assets/clike-CIx9nZSv.js +1 -0
- package/dist/assets/clojure-DFaIEz5O.js +1 -0
- package/dist/assets/cmake-koz-qBlo.js +1 -0
- package/dist/assets/cobol-Bo8Zw9gB.js +1 -0
- package/dist/assets/coffeescript-CXYzYf-Y.js +1 -0
- package/dist/assets/coins-BztUbqyl.js +1 -0
- package/dist/assets/collections-BxrcELwt.js +3 -0
- package/dist/assets/commonlisp-C4OOCwkD.js +1 -0
- package/dist/assets/company-skill-routes-D5LJ1l8M.js +1 -0
- package/dist/assets/company-skill-summary-DnWVmP1S.js +1 -0
- package/dist/assets/configuration-warnings-CZKSfHJv.js +2 -0
- package/dist/assets/connection-owner-D-ikSHyR.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-DFyVDb92.js +1 -0
- package/dist/assets/crystal-BlJXQDvy.js +1 -0
- package/dist/assets/css-DEZwfVpY.js +1 -0
- package/dist/assets/cynefin-EF2NZ3EQ-COwSJ4qP.js +1 -0
- package/dist/assets/cynefinDiagram-3GCD6N5R-diaEJq9Y.js +62 -0
- package/dist/assets/cypher-z2oFsVv2.js +1 -0
- package/dist/assets/cytoscape.esm-C2vp4vBx.js +321 -0
- package/dist/assets/d-Dkt6y7AQ.js +1 -0
- package/dist/assets/dagre-W4DXFKR2-BPAMRuIj.js +4 -0
- package/dist/assets/defaultLocale-C2Bpu8Ih.js +1 -0
- package/dist/assets/definition-DxwMBXnu.js +1 -0
- package/dist/assets/diagram-2UJZ2QOL-BvRnO1Id.js +200 -0
- package/dist/assets/diagram-OVF4WLC6-CDgBeD0m.js +24 -0
- package/dist/assets/diagram-PFPMY2P6-DAw9lREG.js +30 -0
- package/dist/assets/diagram-UMYRVEAY-ZQqQn22t.js +24 -0
- package/dist/assets/diagram-YEKJPTXX-CoJtGgWs.js +41 -0
- package/dist/assets/diagram-ZIFT7M5P-qW_Zn_bO.js +3 -0
- package/dist/assets/diff-C60bAYOU.js +1 -0
- package/dist/assets/dist-B2E6oBK1.js +1 -0
- package/dist/assets/dist-B6Qde8KJ.js +1 -0
- package/dist/assets/dist-BCJybC91.js +1 -0
- package/dist/assets/dist-CG-phytt.js +1 -0
- package/dist/assets/dist-CG6fC1Db.js +1 -0
- package/dist/assets/dist-CPgRB-NQ.js +1 -0
- package/dist/assets/dist-CTlCK4Pe.js +1 -0
- package/dist/assets/dist-CYRzGbSY.js +7 -0
- package/dist/assets/dist-Cd7wdKYE.js +39 -0
- package/dist/assets/dist-CdmdXwCZ.js +1 -0
- package/dist/assets/dist-CeSzCyeG.js +1 -0
- package/dist/assets/dist-CjRqeLFz.js +2 -0
- package/dist/assets/dist-CuwPDbnL.js +1 -0
- package/dist/assets/dist-CvRpZH53.js +1 -0
- package/dist/assets/dist-DKyBHaH2.js +1 -0
- package/dist/assets/dist-DML0cJH3.js +13 -0
- package/dist/assets/dist-DXjkgaZX.js +1 -0
- package/dist/assets/dist-DZIxMHOT.js +1 -0
- package/dist/assets/dist-DZruZxAk.js +1 -0
- package/dist/assets/dist-DbXGl-wj.js +3 -0
- package/dist/assets/dist-Dl94YqeS.js +1 -0
- package/dist/assets/dist-DylHAy-6.js +1 -0
- package/dist/assets/dist-IcdxEhjC.js +1 -0
- package/dist/assets/dist-_EtfntKJ.js +6 -0
- package/dist/assets/dist-ptDa9fKh.js +1 -0
- package/dist/assets/dockerfile-BttNdtK0.js +1 -0
- package/dist/assets/dtd-CCVZU5Da.js +1 -0
- package/dist/assets/dylan-3pmV5wzs.js +1 -0
- package/dist/assets/ebnf-bm-I2WIh.js +1 -0
- package/dist/assets/ebnfDiagram-VR2GEFS7-DA4UvKXV.js +1 -0
- package/dist/assets/ecl-BIv3PrZb.js +1 -0
- package/dist/assets/eiffel-DuLnr4-r.js +1 -0
- package/dist/assets/elk-IJKZMXRS-CM74d3mJ.js +25 -0
- package/dist/assets/elm-njbaCU-L.js +1 -0
- package/dist/assets/erDiagram-O2IAPWRE-d869V0qL.js +99 -0
- package/dist/assets/erlang-CuhOC2I8.js +1 -0
- package/dist/assets/eventmodeling-K75KTNOO-C-oz_eyI.js +1 -0
- package/dist/assets/factor-CM3-9V3b.js +1 -0
- package/dist/assets/fcl-nWsMJ92o.js +1 -0
- package/dist/assets/flowDiagram-OXPTDLAJ-Be1xLbJu.js +1 -0
- package/dist/assets/folder-plus-CxWXoYCi.js +1 -0
- package/dist/assets/forth-BQ9HrCVY.js +1 -0
- package/dist/assets/fortran-DHJe28ev.js +1 -0
- package/dist/assets/ganttDiagram-R7TSEDQI-BBul4Kpm.js +292 -0
- package/dist/assets/gas-ByO0qYMr.js +1 -0
- package/dist/assets/gherkin-CwOmHL5K.js +1 -0
- package/dist/assets/gitGraph-VSP46ZUC-BriEZgAq.js +1 -0
- package/dist/assets/gitGraphDiagram-XJZIOB7I-I12rg8s1.js +106 -0
- package/dist/assets/goals-CvMWzjH4.js +1 -0
- package/dist/assets/googleAccessRemoval-CQIi1dvu.js +1 -0
- package/dist/assets/graphlib-DHhK3saS.js +1 -0
- package/dist/assets/groovy-ByXGF8cx.js +1 -0
- package/dist/assets/haskell-CHSpCNOy.js +1 -0
- package/dist/assets/haxe-P2jh68ck.js +1 -0
- package/dist/assets/http-0jwMmfWP.js +1 -0
- package/dist/assets/idl-DTVVj6r5.js +1 -0
- package/dist/assets/index-Bt31d8ga.js +706 -0
- package/dist/assets/index-z7lcCz2I.css +1 -0
- package/dist/assets/info-OHQRW6UA-CxrcGiem.js +1 -0
- package/dist/assets/infoDiagram-5W2HQ5XZ-4Sm0LiOu.js +2 -0
- package/dist/assets/init-BXPE0p7i.js +1 -0
- package/dist/assets/invite-memory-BKdqfr5K.js +1 -0
- package/dist/assets/ishikawaDiagram-K3B6WC7H-CKXvKV-s.js +70 -0
- package/dist/assets/issue-detail-4PCbYpdv.js +119 -0
- package/dist/assets/javascript-Cblpdx44.js +1 -0
- package/dist/assets/journeyDiagram-COXZFDF6-BHsrZLvQ.js +139 -0
- package/dist/assets/julia-KVJvUu_F.js +1 -0
- package/dist/assets/kanban-definition-P3RFRI5V-8HhnIs_l.js +89 -0
- package/dist/assets/katex-Du_FPwxl.js +257 -0
- package/dist/assets/line-rrKrpB-b.js +1 -0
- package/dist/assets/linear-BRQgexd0.js +1 -0
- package/dist/assets/link-BecLzmfo.js +1 -0
- package/dist/assets/list-filter-BC3D4IoX.js +1 -0
- package/dist/assets/livescript-DSHsJPcD.js +1 -0
- package/dist/assets/log-in-BJCGwGGT.js +1 -0
- package/dist/assets/lua-Vher-70I.js +1 -0
- package/dist/assets/mathematica-CE9SaVsW.js +1 -0
- package/dist/assets/mbox-JGl1Fgvq.js +1 -0
- package/dist/assets/mcpSkills-DRs3pGKn.js +1 -0
- package/dist/assets/mermaid-parser.core-DmG0b4S0.js +7 -0
- package/dist/assets/mermaid.core-D1vILTuF.js +42 -0
- package/dist/assets/mindmap-definition-LZFPQGKD-DIMpL0de.js +96 -0
- package/dist/assets/mirc-BGWbO906.js +1 -0
- package/dist/assets/mllike-DuNQsEw8.js +1 -0
- package/dist/assets/model-DL5biheO.js +1 -0
- package/dist/assets/modelica-5XCgKQt8.js +1 -0
- package/dist/assets/mscgen-mVFg19ri.js +1 -0
- package/dist/assets/mumps-C7oS353s.js +1 -0
- package/dist/assets/nginx-DXVlpyCz.js +1 -0
- package/dist/assets/nsis-KFC6hioG.js +1 -0
- package/dist/assets/ntriples-5ckCopnn.js +1 -0
- package/dist/assets/octave-D1J2QQNt.js +1 -0
- package/dist/assets/onboarding-state-C5_mIw3o.js +1 -0
- package/dist/assets/ordinal-BJyFM1v8.js +1 -0
- package/dist/assets/oz-CPsllMDD.js +1 -0
- package/dist/assets/packet-JDAUHWVQ-BnbYht3G.js +1 -0
- package/dist/assets/palette-tokens-CL5ZDrEd.js +1 -0
- package/dist/assets/pascal-B-I6JP0Y.js +1 -0
- package/dist/assets/path-D6mommQw.js +1 -0
- package/dist/assets/pegDiagram-BGZESJAR-BUjtJVjT.js +1 -0
- package/dist/assets/perl-CI8WIWBi.js +1 -0
- package/dist/assets/pie-XZMESJXO-CM4VXUb-.js +1 -0
- package/dist/assets/pieDiagram-CAPJLFHJ-B3v8ryvG.js +39 -0
- package/dist/assets/pig-FQI0W3S3.js +1 -0
- package/dist/assets/portable-files-CloN_vbk.js +1 -0
- package/dist/assets/power-0mw59G-l.js +1 -0
- package/dist/assets/powershell-BAu6x78A.js +1 -0
- package/dist/assets/prod-C6Q7tISe.js +495 -0
- package/dist/assets/profile-summary-B5rPf8v-.js +1 -0
- package/dist/assets/properties-BKTTDgau.js +1 -0
- package/dist/assets/protobuf-UWh8gh_j.js +1 -0
- package/dist/assets/pug-C20tNwmy.js +1 -0
- package/dist/assets/puppet-BAHVzCkO.js +1 -0
- package/dist/assets/python-C2DOnsac.js +1 -0
- package/dist/assets/q-Cooe-Nh8.js +1 -0
- package/dist/assets/quadrantDiagram-GDMTTRAM-Cv-dS2Rn.js +7 -0
- package/dist/assets/r-CktBKya9.js +1 -0
- package/dist/assets/radar-ABXABTNO-v6yZj4Fk.js +1 -0
- package/dist/assets/railroad-I3PHUGI6-D-U8Cs0m.js +1 -0
- package/dist/assets/railroad-abnf-LNEFI6M7-Dw3fkrVy.js +1 -0
- package/dist/assets/railroad-ebnf-DWYD2UWJ-_ln-e3Tx.js +1 -0
- package/dist/assets/railroad-peg-JR7BVNR7-Bf8u1-RZ.js +1 -0
- package/dist/assets/railroadDiagram-SM67HX2B-Drr5UhQI.js +1 -0
- package/dist/assets/requirementDiagram-X7JNWC4A-D5ef6_ac.js +84 -0
- package/dist/assets/rolldown-runtime-DhZMWcEn.js +1 -0
- package/dist/assets/rough.esm-DnC5Tr1g.js +1 -0
- package/dist/assets/rpm-Csj9nLHl.js +1 -0
- package/dist/assets/ruby-bGx9eo-K.js +1 -0
- package/dist/assets/runtime-IAg0vdY9.js +4137 -0
- package/dist/assets/sankeyDiagram-UM26HJRW-DncJWIz_.js +40 -0
- package/dist/assets/sas-Drou_EQ9.js +1 -0
- package/dist/assets/saved-permissions-CizWg8-P.js +1 -0
- package/dist/assets/scheme-DcjG9bAf.js +1 -0
- package/dist/assets/scroll-text-Ck6HB7eM.js +1 -0
- package/dist/assets/sdk-CWyUlmcn.js +1 -0
- package/dist/assets/search-DkTqg7ab.js +1 -0
- package/dist/assets/send-CYVi50sh.js +1 -0
- package/dist/assets/sequenceDiagram-ZO4K6R2Y-Cs0nGCCg.js +169 -0
- package/dist/assets/shared-CIwISWMj.js +1 -0
- package/dist/assets/shell-BSKClwid.js +1 -0
- package/dist/assets/sieve-CcvsXPZo.js +1 -0
- package/dist/assets/simple-mode-B79cVo-x.js +1 -0
- package/dist/assets/sizeCapture-INFHLROL-XURNLuv_.js +1 -0
- package/dist/assets/skill-source-connect-return-eFTeuj7y.js +1 -0
- package/dist/assets/smalltalk-Cmg-4mjQ.js +1 -0
- package/dist/assets/smoke-lab-matrix-A7ubFpfk.js +1 -0
- package/dist/assets/solr-Dj8ahEwG.js +1 -0
- package/dist/assets/sparql-LAJYmgfk.js +1 -0
- package/dist/assets/spreadsheet-B8doD_pL.js +1 -0
- package/dist/assets/sql-C3kWxFGw.js +1 -0
- package/dist/assets/src-DYjgETqR.js +1 -0
- package/dist/assets/stateDiagram-v2-TBUQTH76-Dpp3m5Wq.js +291 -0
- package/dist/assets/stex-CW6K5Nmu.js +1 -0
- package/dist/assets/stylus-BS-Ienrc.js +1 -0
- package/dist/assets/swift-BD82LMDK.js +1 -0
- package/dist/assets/swimlanes-N4OXWK64-NXVbx1w8.js +1 -0
- package/dist/assets/swimlanesDiagram-K3J5GTZL-Ct3LnXZt.js +8 -0
- package/dist/assets/tcl-RZa1cqc-.js +1 -0
- package/dist/assets/textile-C-BY_OGF.js +1 -0
- package/dist/assets/tiddlywiki-C9bm_Oju.js +1 -0
- package/dist/assets/tiki-DJOT-rFT.js +1 -0
- package/dist/assets/timeline-definition-YOQAKGHF-DqI-Mv2e.js +120 -0
- package/dist/assets/toml-Civ2fTsu.js +1 -0
- package/dist/assets/treeView-D4JQ5SDB-CZBlE7ya.js +1 -0
- package/dist/assets/treemap-SAJKECNS-BlueznID.js +1 -0
- package/dist/assets/troff-Lns35Xcq.js +1 -0
- package/dist/assets/ttcn-7vlxVTUK.js +1 -0
- package/dist/assets/ttcn-cfg-B8qhhp6o.js +1 -0
- package/dist/assets/turtle-DTIS1YQ7.js +1 -0
- package/dist/assets/useAgentlessOnboardingAutoOpen-CnFwEQ-H.js +1 -0
- package/dist/assets/useAuthorizationWindow-DnFQsiFj.js +1 -0
- package/dist/assets/useDateRange-9EbqkWXy.js +1 -0
- package/dist/assets/useFastResponsesEnabled-D8dunm4j.js +1 -0
- package/dist/assets/usePageView-BiX5i8ck.js +1 -0
- package/dist/assets/useProfilesData-0VYQ4lAT.js +1 -0
- package/dist/assets/useReviewCount-WBWxwKI3.js +1 -0
- package/dist/assets/useRoutineFormOptions-DnX5DBn1.js +3 -0
- package/dist/assets/useSummaryDraftStream-DPQRvaXT.js +3 -0
- package/dist/assets/useTailscaleConnections-BDff6dWx.js +1 -0
- package/dist/assets/usecaseDiagram-VIAY4XPW-BSDn8OaJ.js +362 -0
- package/dist/assets/vb-BO8UacKu.js +1 -0
- package/dist/assets/vbscript-DWLru3lT.js +1 -0
- package/dist/assets/velocity-BIIn-Nl2.js +1 -0
- package/dist/assets/vennDiagram-BLWOH2XV-BBSA9KNN.js +34 -0
- package/dist/assets/verilog-BVYlmXGg.js +1 -0
- package/dist/assets/vhdl-Cn8cC8Yb.js +1 -0
- package/dist/assets/wardley-7MLQ67FV-CsT-rTZ9.js +1 -0
- package/dist/assets/wardleyDiagram-YMQ3BMBF-BLClsIjw.js +78 -0
- package/dist/assets/webidl-ChvzbZ5-.js +1 -0
- package/dist/assets/xquery-BKN7qEbU.js +1 -0
- package/dist/assets/xychartDiagram-TAQBALBS-2x4wB0gq.js +7 -0
- package/dist/assets/yacas-BG9ha7tU.js +1 -0
- package/dist/assets/z80-CB2cGLew.js +1 -0
- package/dist/brands/adapters/LICENSE +21 -0
- package/dist/brands/adapters/README.md +7 -0
- package/dist/brands/adapters/cursor-dark.svg +1 -0
- package/dist/brands/adapters/cursor.svg +1 -0
- package/dist/brands/adapters/gemini-color.svg +1 -0
- package/dist/brands/adapters/grok-dark.svg +1 -0
- package/dist/brands/adapters/grok.svg +1 -0
- package/dist/brands/adapters/hermesagent-dark.svg +1 -0
- package/dist/brands/adapters/hermesagent.svg +1 -0
- package/dist/brands/adapters/kimi-color-light.svg +1 -0
- package/dist/brands/adapters/kimi-color.svg +1 -0
- package/dist/brands/adapters/openai-dot.README.md +7 -0
- package/dist/brands/adapters/openai-dot.svg +3 -0
- package/dist/brands/adapters/pi-dark.svg +1 -0
- package/dist/brands/adapters/pi.svg +1 -0
- package/dist/brands/apps/1password-dark.svg +1 -0
- package/dist/brands/apps/1password.svg +1 -0
- package/dist/brands/apps/LOBE-LICENSE +21 -0
- package/dist/brands/apps/agentmail-dark.svg +16 -0
- package/dist/brands/apps/agentmail.svg +17 -0
- package/dist/brands/apps/airtable.svg +1 -0
- package/dist/brands/apps/anthropic-dark.svg +1 -0
- package/dist/brands/apps/anthropic.svg +1 -0
- package/dist/brands/apps/antigravity.svg +31 -0
- package/dist/brands/apps/api-key-generic.svg +1 -0
- package/dist/brands/apps/arcade.png +0 -0
- package/dist/brands/apps/asana.svg +12 -0
- package/dist/brands/apps/aws-dark.svg +1 -0
- package/dist/brands/apps/aws.svg +1 -0
- package/dist/brands/apps/bedrock.svg +1 -0
- package/dist/brands/apps/beehiiv.png +0 -0
- package/dist/brands/apps/bitly.svg +1 -0
- package/dist/brands/apps/box.svg +1 -0
- package/dist/brands/apps/braintrust-dark.png +0 -0
- package/dist/brands/apps/braintrust.png +0 -0
- package/dist/brands/apps/brex-dark.svg +1 -0
- package/dist/brands/apps/brex.svg +1 -0
- package/dist/brands/apps/browser-use.svg +6 -0
- package/dist/brands/apps/calendly.png +0 -0
- package/dist/brands/apps/candid.png +0 -0
- package/dist/brands/apps/circleback.png +0 -0
- package/dist/brands/apps/clickhouse-dark.svg +1 -0
- package/dist/brands/apps/clickhouse.svg +1 -0
- package/dist/brands/apps/clickup.png +0 -0
- package/dist/brands/apps/cloudflare.svg +1 -0
- package/dist/brands/apps/cloudinary-dark.svg +1 -0
- package/dist/brands/apps/cloudinary.svg +3 -0
- package/dist/brands/apps/coda.svg +1 -0
- package/dist/brands/apps/cognee.png +0 -0
- package/dist/brands/apps/composio-dark.svg +11 -0
- package/dist/brands/apps/composio.svg +16 -0
- package/dist/brands/apps/connection-pool.svg +1 -0
- package/dist/brands/apps/context7-dark.svg +8 -0
- package/dist/brands/apps/context7.svg +8 -0
- package/dist/brands/apps/daytona-dark.svg +1 -0
- package/dist/brands/apps/daytona.svg +1 -0
- package/dist/brands/apps/discord-dark.svg +1 -0
- package/dist/brands/apps/discord.svg +1 -0
- package/dist/brands/apps/ditto.png +0 -0
- package/dist/brands/apps/egnyte.svg +1 -0
- package/dist/brands/apps/embat.svg +1 -0
- package/dist/brands/apps/enterpret.png +0 -0
- package/dist/brands/apps/exa.svg +5 -0
- package/dist/brands/apps/executor.png +0 -0
- package/dist/brands/apps/firecrawl.svg +12 -0
- package/dist/brands/apps/fireflies.svg +76 -0
- package/dist/brands/apps/gauge.png +0 -0
- package/dist/brands/apps/github-copilot-dark.svg +1 -0
- package/dist/brands/apps/github-copilot.svg +1 -0
- package/dist/brands/apps/github-dark.svg +10 -0
- package/dist/brands/apps/github.svg +10 -0
- package/dist/brands/apps/gmail.svg +1 -0
- package/dist/brands/apps/google-calendar.svg +1 -0
- package/dist/brands/apps/google-chat.svg +1 -0
- package/dist/brands/apps/google-docs.svg +1 -0
- package/dist/brands/apps/google-drive.svg +1 -0
- package/dist/brands/apps/google-people.svg +1 -0
- package/dist/brands/apps/google-sheets.svg +1 -0
- package/dist/brands/apps/google-slides.svg +1 -0
- package/dist/brands/apps/google-workspace-search.svg +1 -0
- package/dist/brands/apps/google.svg +1 -0
- package/dist/brands/apps/gsc-wizard.png +0 -0
- package/dist/brands/apps/honcho.svg +33 -0
- package/dist/brands/apps/hugging-face.svg +8 -0
- package/dist/brands/apps/imessage-photon.png +0 -0
- package/dist/brands/apps/jam-dev-dark.svg +1 -0
- package/dist/brands/apps/jam-dev.svg +1 -0
- package/dist/brands/apps/jira-dark.svg +1 -0
- package/dist/brands/apps/jira.svg +4 -0
- package/dist/brands/apps/kernel.svg +3 -0
- package/dist/brands/apps/klaviyo.png +0 -0
- package/dist/brands/apps/linear-dark.svg +5 -0
- package/dist/brands/apps/linear.svg +5 -0
- package/dist/brands/apps/local-falcon.png +0 -0
- package/dist/brands/apps/make-dark.svg +1 -0
- package/dist/brands/apps/make.svg +1 -0
- package/dist/brands/apps/manifest.json +756 -0
- package/dist/brands/apps/manufact-dark.svg +6 -0
- package/dist/brands/apps/manufact.svg +5 -0
- package/dist/brands/apps/mem0.svg +1 -0
- package/dist/brands/apps/microsoft-teams.svg +68 -0
- package/dist/brands/apps/miro-dark.svg +1 -0
- package/dist/brands/apps/miro.svg +4 -0
- package/dist/brands/apps/mixpanel-dark.svg +1 -0
- package/dist/brands/apps/mixpanel.svg +1 -0
- package/dist/brands/apps/monday-dark.png +0 -0
- package/dist/brands/apps/monday.png +0 -0
- package/dist/brands/apps/neon.png +0 -0
- package/dist/brands/apps/netlify-dark.svg +1 -0
- package/dist/brands/apps/netlify.svg +16 -0
- package/dist/brands/apps/notion-dark.svg +1 -0
- package/dist/brands/apps/notion.svg +1 -0
- package/dist/brands/apps/oauth-generic.svg +1 -0
- package/dist/brands/apps/openai-dark.svg +1 -0
- package/dist/brands/apps/openai.svg +1 -0
- package/dist/brands/apps/openrouter-dark.svg +3 -0
- package/dist/brands/apps/openrouter.svg +3 -0
- package/dist/brands/apps/oreilly.svg +1 -0
- package/dist/brands/apps/pagerduty.svg +4 -0
- package/dist/brands/apps/paperclip-notebook-dark.svg +1 -0
- package/dist/brands/apps/paperclip-notebook.svg +1 -0
- package/dist/brands/apps/parallel-dark.svg +11 -0
- package/dist/brands/apps/parallel.svg +11 -0
- package/dist/brands/apps/planetscale-dark.svg +1 -0
- package/dist/brands/apps/planetscale.svg +1 -0
- package/dist/brands/apps/posthog-dark.svg +1 -0
- package/dist/brands/apps/posthog.svg +1 -0
- package/dist/brands/apps/postman.svg +1 -0
- package/dist/brands/apps/railway-dark.svg +1 -0
- package/dist/brands/apps/railway.svg +1 -0
- package/dist/brands/apps/razorpay-dark.svg +1 -0
- package/dist/brands/apps/razorpay.svg +1 -0
- package/dist/brands/apps/resend-dark.svg +1 -0
- package/dist/brands/apps/resend.svg +1 -0
- package/dist/brands/apps/sanity-dark.svg +1 -0
- package/dist/brands/apps/sanity.svg +1 -0
- package/dist/brands/apps/sentry-dark.svg +1 -0
- package/dist/brands/apps/sentry.svg +1 -0
- package/dist/brands/apps/shopify.svg +24 -0
- package/dist/brands/apps/similarweb-dark.svg +1 -0
- package/dist/brands/apps/similarweb.svg +1 -0
- package/dist/brands/apps/slack.png +0 -0
- package/dist/brands/apps/slack.svg +17 -0
- package/dist/brands/apps/speko.svg +16 -0
- package/dist/brands/apps/stripe.svg +11 -0
- package/dist/brands/apps/supabase.svg +15 -0
- package/dist/brands/apps/superagent.png +0 -0
- package/dist/brands/apps/supermemory.png +0 -0
- package/dist/brands/apps/tailscale.png +0 -0
- package/dist/brands/apps/tavily.png +0 -0
- package/dist/brands/apps/telegram.svg +12 -0
- package/dist/brands/apps/telem-dark.svg +9 -0
- package/dist/brands/apps/telem.svg +9 -0
- package/dist/brands/apps/ticket-tailor-dark.svg +1 -0
- package/dist/brands/apps/ticket-tailor.svg +1 -0
- package/dist/brands/apps/ticktick.svg +1 -0
- package/dist/brands/apps/todoist.svg +1 -0
- package/dist/brands/apps/unikraft.svg +1 -0
- package/dist/brands/apps/vercel-dark.svg +1 -0
- package/dist/brands/apps/vercel.svg +1 -0
- package/dist/brands/apps/webflow.svg +1 -0
- package/dist/brands/apps/windsor-ai.png +0 -0
- package/dist/brands/apps/wix-dark.svg +12 -0
- package/dist/brands/apps/wix.svg +12 -0
- package/dist/brands/apps/xai-dark.svg +1 -0
- package/dist/brands/apps/xai.svg +1 -0
- package/dist/brands/apps/xero.svg +1 -0
- package/dist/brands/apps/youcom-dark.svg +13 -0
- package/dist/brands/apps/youcom.svg +13 -0
- package/dist/brands/apps/zapier.svg +1 -0
- package/dist/brands/apps/zep.png +0 -0
- package/dist/brands/claude-color.svg +17 -0
- package/dist/brands/codex-color.svg +17 -0
- package/dist/brands/opencode-logo-dark-square.svg +18 -0
- package/dist/brands/opencode-logo-light-square.svg +18 -0
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.svg +7 -0
- package/dist/fonts/InterVariable-Italic.woff2 +0 -0
- package/dist/fonts/InterVariable.woff2 +0 -0
- package/dist/fonts/NOTICE.md +30 -0
- package/dist/fonts/PaperMono-OFL.txt +93 -0
- package/dist/fonts/PaperMono-Variable.woff2 +0 -0
- package/dist/index.html +165 -0
- package/dist/microvac-push-sw.js +37 -0
- package/dist/paperclip-thinking.svg +17 -0
- package/dist/site.webmanifest +30 -0
- package/dist/storybook/grok-comparison.csv +4 -0
- package/dist/sw.js +176 -0
- package/dist/worktree-favicon-16x16.png +0 -0
- package/dist/worktree-favicon-32x32.png +0 -0
- package/dist/worktree-favicon.ico +0 -0
- package/dist/worktree-favicon.svg +9 -0
- package/package.json +20 -4
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
var ci=Object.defineProperty;var c=(e,t)=>ci(e,"name",{value:t,configurable:!0});import{n as h}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as hi,p as ui}from"./src-DYjgETqR.js";import{C as di,H as bt,U as _t,_ as Ds,a as fi,b as Fs,f as pi,q as mi,v as Bs,y as Ei,z as Ti}from"./chunk-VPRB5NB3-CfeHjtbb.js";import{_ as gi}from"./chunk-3YJQHVM4-Dj5wEKIw.js";import"./chunk-HJ2JQQFS-MXK0gYSP.js";import{i as Ai}from"./chunk-E2ZNV5FY-cjSf_BTz.js";import"./chunk-4EA7E6EY-5XiUVgzK.js";import{a as Si,i as yi,o as xe,r as Oi}from"./chunk-J5ZVWO5B-ClU583ja.js";import"./chunk-XC4XBNZT-FBCWmi6K.js";import"./chunk-DBDB3WZW-DNqSQPZ0.js";import"./chunk-2BW5OAIV-DFXIyCJy.js";import{t as Ri}from"./chunk-XXDRQBXY-BdWplhUD.js";import{t as Li}from"./chunk-KQW6MTUR-Bfj0tDmO.js";import"./chunk-NTY3LDVX-Bpz5TkVb.js";import{i as Ii,r as Ni}from"./mermaid.core-D1vILTuF.js";function $s(e){const t=new Date().getTime(),s=e();return{time:new Date().getTime()-t,value:s}}c($s,"timer");function js(e){function t(){}c(t,"FakeConstructor"),t.prototype=e;const s=new t;function n(){return typeof s.bar}return c(n,"fakeAccess"),n(),n(),e}c(js,"toFastProperties");function ki(e){return vi(e)?e.LABEL:e.name}c(ki,"tokenLabel$1");function vi(e){return typeof e.LABEL=="string"&&e.LABEL!==""}c(vi,"hasTokenLabel$1");var te=class{static{c(this,"AbstractProduction")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}},K=class extends te{static{c(this,"NonTerminal")}constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ie=class extends te{static{c(this,"Rule")}constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}},W=class extends te{static{c(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}},G=class extends te{static{c(this,"Option")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},se=class extends te{static{c(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},ne=class extends te{static{c(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},M=class extends te{static{c(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},q=class extends te{static{c(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},Z=class extends te{static{c(this,"Alternation")}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,Object.assign(this,ie(e))}},k=class{static{c(this,"Terminal")}constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}};function Ci(e){return e.map(Ye)}c(Ci,"serializeGrammar");function Ye(e){function t(s){return s.map(Ye)}if(c(t,"convertDefinition"),e instanceof K){const s={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return typeof e.label=="string"&&(s.label=e.label),s}else{if(e instanceof W)return{type:"Alternative",definition:t(e.definition)};if(e instanceof G)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof se)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:Ye(new k({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof q)return{type:"RepetitionWithSeparator",idx:e.idx,separator:Ye(new k({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof M)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof Z)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof k){const s={type:"Terminal",name:e.terminalType.name,label:ki(e.terminalType),idx:e.idx};typeof e.label=="string"&&(s.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(s.pattern=n instanceof RegExp?n.source:n),s}else{if(e instanceof Ie)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}c(Ye,"serializeProduction");function ie(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}c(ie,"pickOnlyDefined");var Ne=class{static{c(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case M:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case Ie:return this.visitRule(t);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){}};function bi(e){return e instanceof W||e instanceof G||e instanceof M||e instanceof se||e instanceof ne||e instanceof q||e instanceof k||e instanceof Ie}c(bi,"isSequenceProd");function rt(e,t=[]){return e instanceof G||e instanceof M||e instanceof q?!0:e instanceof Z?e.definition.some(s=>rt(s,t)):e instanceof K&&t.includes(e)?!1:e instanceof te?(e instanceof K&&t.push(e),e.definition.every(s=>rt(s,t))):!1}c(rt,"isOptionalProd");function _i(e){return e instanceof Z}c(_i,"isBranchingProd");function ee(e){if(e instanceof K)return"SUBRULE";if(e instanceof G)return"OPTION";if(e instanceof Z)return"OR";if(e instanceof se)return"AT_LEAST_ONE";if(e instanceof ne)return"AT_LEAST_ONE_SEP";if(e instanceof q)return"MANY_SEP";if(e instanceof M)return"MANY";if(e instanceof k)return"CONSUME";throw Error("non exhaustive match")}c(ee,"getProductionDslName");var mt=class{static{c(this,"RestWalker")}walk(e,t=[]){e.definition.forEach((s,n)=>{const i=e.definition.slice(n+1);if(s instanceof K)this.walkProdRef(s,i,t);else if(s instanceof k)this.walkTerminal(s,i,t);else if(s instanceof W)this.walkFlat(s,i,t);else if(s instanceof G)this.walkOption(s,i,t);else if(s instanceof se)this.walkAtLeastOne(s,i,t);else if(s instanceof ne)this.walkAtLeastOneSep(s,i,t);else if(s instanceof q)this.walkManySep(s,i,t);else if(s instanceof M)this.walkMany(s,i,t);else if(s instanceof Z)this.walkOr(s,i,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,s){}walkProdRef(e,t,s){}walkFlat(e,t,s){const n=t.concat(s);this.walk(e,n)}walkOption(e,t,s){const n=t.concat(s);this.walk(e,n)}walkAtLeastOne(e,t,s){const n=[new G({definition:e.definition})].concat(t,s);this.walk(e,n)}walkAtLeastOneSep(e,t,s){const n=rs(e,t,s);this.walk(e,n)}walkMany(e,t,s){const n=[new G({definition:e.definition})].concat(t,s);this.walk(e,n)}walkManySep(e,t,s){const n=rs(e,t,s);this.walk(e,n)}walkOr(e,t,s){const n=t.concat(s);e.definition.forEach(i=>{const a=new W({definition:[i]});this.walk(a,n)})}};function rs(e,t,s){return[new G({definition:[new k({terminalType:e.separator})].concat(e.definition)})].concat(t,s)}c(rs,"restForRepetitionWithSeparator");function je(e){if(e instanceof K)return je(e.referencedRule);if(e instanceof k)return xi(e);if(bi(e))return wi(e);if(_i(e))return Mi(e);throw Error("non exhaustive match")}c(je,"first");function wi(e){let t=[];const s=e.definition;let n=0,i=s.length>n,a,o=!0;for(;i&&o;)a=s[n],o=rt(a),t=t.concat(je(a)),n=n+1,i=s.length>n;return[...new Set(t)]}c(wi,"firstForSequence");function Mi(e){const t=e.definition.map(s=>je(s));return[...new Set(t.flat())]}c(Mi,"firstForBranching");function xi(e){return[e.terminalType]}c(xi,"firstForTerminal");var Gs="_~IN~_",Ui=class extends mt{static{c(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,s){}walkProdRef(e,t,s){const n=Di(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(s),a=new W({definition:i}),o=je(a);this.follows[n]=o}};function Pi(e){const t={};return e.forEach(s=>{const n=new Ui(s).startWalking();Object.assign(t,n)}),t}c(Pi,"computeAllProdsFollows");function Di(e,t){return e.name+t+Gs}c(Di,"buildBetweenProdsFollowPrefix");function S(e){return e.charCodeAt(0)}c(S,"cc");function It(e,t){Array.isArray(e)?e.forEach(function(s){t.push(s)}):t.push(e)}c(It,"insertToSet");function _e(e,t){if(e[t]===!0)throw"duplicate flag "+t;e[t],e[t]=!0}c(_e,"addFlag");function Se(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}c(Se,"ASSERT_EXISTS");function ze(){throw Error("Internal Error - Should never get here!")}c(ze,"ASSERT_NEVER_REACH_HERE");function os(e){return e.type==="Character"}c(os,"isCharacter");var ot=[];for(let e=S("0");e<=S("9");e++)ot.push(e);var lt=[S("_")].concat(ot);for(let e=S("a");e<=S("z");e++)lt.push(e);for(let e=S("A");e<=S("Z");e++)lt.push(e);var ls=[S(" "),S("\f"),S(`
|
|
2
|
+
`),S("\r"),S(" "),S("\v"),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S("\u2028"),S("\u2029"),S(" "),S(" "),S(" "),S("\uFEFF")],Fi=/[0-9a-fA-F]/,He=/[0-9]/,Bi=/[1-9]/,$i=class{static{c(this,"RegExpParser")}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("/");const t=this.disjunction();this.consumeChar("/");const s={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":_e(s,"global");break;case"i":_e(s,"ignoreCase");break;case"m":_e(s,"multiLine");break;case"u":_e(s,"unicode");break;case"y":_e(s,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:s,value:t,loc:this.loc(0)}}disjunction(){const 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(){const 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(){const 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"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Se(t);const s=this.disjunction();return this.consumeChar(")"),{type:t,value:s,loc:this.loc(e)}}return ze()}quantifier(e=!1){let t;const s=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"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let i;this.isDigit()?(i=this.integerIncludingZero(),t={atLeast:n,atMost:i}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(e===!0&&t===void 0)return;Se(t)}if(!(e===!0&&t===void 0)&&Se(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(s),t}atom(){let e;const 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 e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Se(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):ze()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[S(`
|
|
3
|
+
`),S("\r"),S("\u2028"),S("\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=ot;break;case"D":e=ot,t=!0;break;case"s":e=ls;break;case"S":e=ls,t=!0;break;case"w":e=lt;break;case"W":e=lt,t=!0}return Se(e)?{type:"Set",value:e,complement:t}:ze()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=S("\f");break;case"n":e=S(`
|
|
4
|
+
`);break;case"r":e=S("\r");break;case"t":e=S(" ");break;case"v":e=S("\v")}return Se(e)?{type:"Character",value:e}:ze()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:S("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:S(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:S(e)}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const s=this.classAtom();if(s.type,os(s)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,os(n)){if(n.value<s.value)throw Error("Range out of order in character class");e.push({from:s.value,to:n.value})}else It(s.value,e),e.push(S("-")),It(n.value,e)}else It(s.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`: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:S("\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++;const t=this.disjunction();this.consumeChar(")");const s={type:"Group",capturing:e,value:t};return e&&(s.idx=this.groupIdx),s}positiveInteger(){let e=this.popChar();if(Bi.test(e)===!1)throw Error("Expecting a positive integer");for(;He.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(He.test(e)===!1)throw Error("Expecting an integer");for(;He.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
|
+
`: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:S(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 He.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
|
+
`: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(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let t="";for(let s=0;s<e;s++){const n=this.popChar();if(Fi.test(n)===!1)throw Error("Expecting a HexDecimal digits");t+=n}return{type:"Character",value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&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}}},zt=class{static{c(this,"BaseRegExpVisitor")}visitChildren(e){for(const t in e){const s=e[t];e.hasOwnProperty(t)&&(s.type!==void 0?this.visit(s):Array.isArray(s)&&s.forEach(n=>{this.visit(n)},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){}},Je={},ji=new $i;function Ge(e){const t=e.toString();if(Je.hasOwnProperty(t))return Je[t];{const s=ji.pattern(t);return Je[t]=s,s}}c(Ge,"getRegExpAst");function Gi(){Je={}}c(Gi,"clearRegExpParserCache");var Ws="Complement Sets are not supported for first char optimization",ct=`Unable to use "first char" lexer optimizations:
|
|
10
|
+
`;function Wi(e,t=!1){try{const s=Ge(e);return wt(s.value,{},s.flags.ignoreCase)}catch(s){if(s.message===Ws)t&&(`${ct}${e.toString()}`,void 0);else{let n="";t&&(n=`
|
|
11
|
+
This will disable the lexer's first char optimizations.
|
|
12
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),`${ct}
|
|
13
|
+
Failed parsing: < ${e.toString()} >
|
|
14
|
+
Using the @chevrotain/regexp-to-ast library
|
|
15
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n}}return[]}c(Wi,"getOptimizedStartCodesIndices");function wt(e,t,s){switch(e.type){case"Disjunction":for(let i=0;i<e.value.length;i++)wt(e.value[i],t,s);break;case"Alternative":const n=e.value;for(let i=0;i<n.length;i++){const a=n[i];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=a;switch(o.type){case"Character":Ve(o.value,t,s);break;case"Set":if(o.complement===!0)throw Error(Ws);o.value.forEach(r=>{if(typeof r=="number")Ve(r,t,s);else{const u=r;if(s===!0)for(let d=u.from;d<=u.to;d++)Ve(d,t,s);else{for(let d=u.from;d<=u.to&&d<256;d++)Ve(d,t,s);if(u.to>=256){const d=u.from>=256?u.from:256,p=u.to,m=ue(d),g=ue(p);for(let y=m;y<=g;y++)t[y]=y}}}});break;case"Group":wt(o.value,t,s);break;default:throw Error("Non Exhaustive Match")}const l=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&Mt(o)===!1||o.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}c(wt,"firstCharOptimizedIndices");function Ve(e,t,s){const n=ue(e);t[n]=n,s===!0&&Ki(e,t)}c(Ve,"addOptimizedIdxToResult");function Ki(e,t){const s=String.fromCharCode(e),n=s.toUpperCase();if(n!==s){const i=ue(n.charCodeAt(0));t[i]=i}else{const i=s.toLowerCase();if(i!==s){const a=ue(i.charCodeAt(0));t[a]=a}}}c(Ki,"handleIgnoreCase");function cs(e,t){return e.value.find(s=>{if(typeof s=="number")return t.includes(s);{const n=s;return t.find(i=>n.from<=i&&i<=n.to)!==void 0}})}c(cs,"findCode");function Mt(e){const t=e.quantifier;return t&&t.atLeast===0?!0:e.value?Array.isArray(e.value)?e.value.every(Mt):Mt(e.value):!1}c(Mt,"isWholeOptional");var zi=class extends zt{static{c(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){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){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?cs(e,this.targetCharCodes)===void 0&&(this.found=!0):cs(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Ht(e,t){if(t instanceof RegExp){const s=Ge(t),n=new zi(e);return n.visit(s),n.found}else{for(const s of t){const n=s.charCodeAt(0);if(e.includes(n))return!0}return!1}}c(Ht,"canMatchCharCode");var Te="PATTERN",Ks="defaultMode";function Hi(e,t){t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
16
|
+
`],tracer:c((T,f)=>f(),"tracer")},t);const s=t.tracer;s("initCharCodeToOptimizedIndexMap",()=>{Ea()});let n;s("Reject Lexer.NA",()=>{n=e.filter(T=>T[Te]!==F.NA)});let i=!1,a;s("Transform Patterns",()=>{i=!1,a=n.map(T=>{const f=T[Te];if(f instanceof RegExp){const O=f.source;return O.length===1&&O!=="^"&&O!=="$"&&O!=="."&&!f.ignoreCase?O:O.length===2&&O[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(O[1])?O[1]:hs(f)}else{if(typeof f=="function")return i=!0,{exec:f};if(typeof f=="object")return i=!0,f;if(typeof f=="string"){if(f.length===1)return f;{const O=f.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return hs(new RegExp(O))}}else throw Error("non exhaustive match")}})});let o,l,r,u,d;s("misc mapping",()=>{o=n.map(T=>T.tokenTypeIdx),l=n.map(T=>{const f=T.GROUP;if(f!==F.SKIPPED){if(typeof f=="string")return f;if(f===void 0)return!1;throw Error("non exhaustive match")}}),r=n.map(T=>{const f=T.LONGER_ALT;if(f)return Array.isArray(f)?f.map(O=>n.indexOf(O)):[n.indexOf(f)]}),u=n.map(T=>T.PUSH_MODE),d=n.map(T=>Object.hasOwn(T,"POP_MODE"))});let p;s("Line Terminator Handling",()=>{const T=Vs(t.lineTerminatorCharacters);p=n.map(f=>!1),t.positionTracking!=="onlyOffset"&&(p=n.map(f=>Object.hasOwn(f,"LINE_BREAKS")?!!f.LINE_BREAKS:Hs(f,T)===!1&&Ht(T,f.PATTERN)))});let m,g,y,R;s("Misc Mapping #2",()=>{m=n.map(zs),g=a.map(fa),y=n.reduce((T,f)=>{const O=f.GROUP;return typeof O=="string"&&O!==F.SKIPPED&&(T[O]=[]),T},{}),R=a.map((T,f)=>{const O=l[f]===void 0&&r[f]===void 0?Vi(n[f].PATTERN):void 0;return{pattern:a[f],asciiClass:O,longerAlt:r[f],canLineTerminator:p[f],matchType:O!==void 0?3:g[f]!==!1?0:m[f]?1:2,short:g[f],group:l[f],push:u[f],pop:d[f],tokenTypeIdx:o[f],tokenType:n[f]}})});let L=!0,A=[];return t.safeMode||s("First Char Optimization",()=>{A=n.reduce((T,f,O)=>{if(typeof f.PATTERN=="string")Nt(T,ue(f.PATTERN.charCodeAt(0)),R[O]);else if(Array.isArray(f.START_CHARS_HINT)){let ae;f.START_CHARS_HINT.forEach(z=>{const de=ue(typeof z=="string"?z.charCodeAt(0):z);ae!==de&&(ae=de,Nt(T,de,R[O]))})}else if(f.PATTERN instanceof RegExp)if(f.PATTERN.unicode)L=!1,t.ensureOptimizations&&(`${ct}${f.PATTERN.toString()}`,void 0);else{const ae=Wi(f.PATTERN,t.ensureOptimizations);ae.length===0&&(L=!1),ae.forEach(z=>{Nt(T,z,R[O])})}else t.ensureOptimizations&&(`${ct}${f.name}`,void 0),L=!1;return T},[])}),{emptyGroups:y,patternIdxToConfig:R,charCodeToPatternIdxToConfig:A,hasCustom:i,canBeOptimized:L}}c(Hi,"analyzeTokenTypes");function Vi(e){var t,s;if(!(e instanceof RegExp)||e.flags!=="")return;let n;try{n=Ge(e)}catch{return}if(n.value.value.length!==1||n.value.value[0].value.length!==1)return;let i=n.value.value[0].value[0],a;for(;i.type==="Group";){if(i.capturing||i.quantifier!==void 0&&a!==void 0||i.value.value.length!==1||i.value.value[0].value.length!==1)return;a=(t=i.quantifier)!==null&&t!==void 0?t:a,i=i.value.value[0].value[0]}if(i.type!=="Set"||i.complement||i.quantifier!==void 0&&a!==void 0||(a=(s=i.quantifier)!==null&&s!==void 0?s:a,a?.atLeast!==1||a.atMost!==1/0||!a.greedy))return;const o=new Uint8Array(128);for(const l of i.value){const r=typeof l=="number"?l:l.from,u=typeof l=="number"?l:l.to;if(r<0||u>=o.length)return;o.fill(1,r,u+1)}return o}c(Vi,"getAsciiClass");function Xi(e,t){let s=[];const n=Ji(e);s=s.concat(n.errors);const i=qi(n.valid),a=i.valid;return s=s.concat(i.errors),s=s.concat(Yi(a)),s=s.concat(aa(a)),s=s.concat(ra(a,t)),s=s.concat(oa(a)),s}c(Xi,"validatePatterns");function Yi(e){let t=[];const s=e.filter(n=>n[Te]instanceof RegExp);return t=t.concat(Qi(s)),t=t.concat(sa(s)),t=t.concat(na(s)),t=t.concat(ia(s)),t=t.concat(ea(s)),t}c(Yi,"validateRegExpPattern");function Ji(e){const t=e.filter(s=>!Object.hasOwn(s,Te));return{errors:t.map(s=>({message:"Token Type: ->"+s.name+"<- missing static 'PATTERN' property",type:b.MISSING_PATTERN,tokenTypes:[s]})),valid:e.filter(s=>!t.includes(s))}}c(Ji,"findMissingPatterns");function qi(e){const t=e.filter(s=>{const n=s[Te];return!(n instanceof RegExp)&&typeof n!="function"&&!Object.hasOwn(n,"exec")&&typeof n!="string"});return{errors:t.map(s=>({message:"Token Type: ->"+s.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:b.INVALID_PATTERN,tokenTypes:[s]})),valid:e.filter(s=>!t.includes(s))}}c(qi,"findInvalidPatterns");var Zi=/[^\\][$]/;function Qi(e){class t extends zt{static{c(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(n){this.found=!0}}return e.filter(s=>{const n=s.PATTERN;try{const i=Ge(n),a=new t;return a.visit(i),a.found}catch{return Zi.test(n.source)}}).map(s=>({message:`Unexpected RegExp Anchor Error:
|
|
17
|
+
Token Type: ->`+s.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
18
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:b.EOI_ANCHOR_FOUND,tokenTypes:[s]}))}c(Qi,"findEndOfInputAnchor");function ea(e){return e.filter(t=>t.PATTERN.test("")).map(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' must not match an empty string",type:b.EMPTY_MATCH_PATTERN,tokenTypes:[t]}))}c(ea,"findEmptyMatchRegExps");var ta=/[^\\[][\^]|^\^/;function sa(e){class t extends zt{static{c(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(n){this.found=!0}}return e.filter(s=>{const n=s.PATTERN;try{const i=Ge(n),a=new t;return a.visit(i),a.found}catch{return ta.test(n.source)}}).map(s=>({message:`Unexpected RegExp Anchor Error:
|
|
19
|
+
Token Type: ->`+s.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
20
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:b.SOI_ANCHOR_FOUND,tokenTypes:[s]}))}c(sa,"findStartOfInputAnchor");function na(e){return e.filter(t=>{const s=t[Te];return s instanceof RegExp&&(s.multiline||s.global)}).map(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:b.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]}))}c(na,"findUnsupportedFlags");function ia(e){const t=[];let s=e.map(n=>e.reduce((i,a)=>(n.PATTERN.source===a.PATTERN.source&&!t.includes(a)&&a.PATTERN!==F.NA&&(t.push(a),i.push(a)),i),[]));return s=s.filter(Boolean),s.filter(n=>n.length>1).map(n=>{const i=n.map(a=>a.name);return{message:`The same RegExp pattern ->${n[0].PATTERN}<-has been used in all of the following Token Types: ${i.join(", ")} <-`,type:b.DUPLICATE_PATTERNS_FOUND,tokenTypes:n}})}c(ia,"findDuplicatePatterns");function aa(e){return e.filter(t=>{if(!Object.hasOwn(t,"GROUP"))return!1;const s=t.GROUP;return s!==F.SKIPPED&&s!==F.NA&&typeof s!="string"}).map(t=>({message:"Token Type: ->"+t.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:b.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]}))}c(aa,"findInvalidGroupType");function ra(e,t){return e.filter(s=>s.PUSH_MODE!==void 0&&!t.includes(s.PUSH_MODE)).map(s=>({message:`Token Type: ->${s.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${s.PUSH_MODE}<-which does not exist`,type:b.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[s]}))}c(ra,"findModesThatDoNotExist");function oa(e){const t=[],s=e.reduce((n,i,a)=>{const o=i.PATTERN;return o===F.NA||(typeof o=="string"?n.push({str:o,idx:a,tokenType:i}):o instanceof RegExp&&ca(o)&&n.push({str:o.source,idx:a,tokenType:i})),n},[]);return e.forEach((n,i)=>{s.forEach(({str:a,idx:o,tokenType:l})=>{if(i<o&&la(a,n.PATTERN)){const r=`Token: ->${l.name}<- can never be matched.
|
|
21
|
+
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
|
|
22
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:r,type:b.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),t}c(oa,"findUnreachablePatterns");function la(e,t){if(t instanceof RegExp){if(ha(t))return!1;const s=t.exec(e);return s!==null&&s.index===0}else{if(typeof t=="function")return t(e,0,[],{});if(Object.hasOwn(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}c(la,"tryToMatchStrToPattern");function ca(e){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(t=>e.source.indexOf(t)!==-1)===void 0}c(ca,"noMetaChar");function ha(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}c(ha,"usesLookAheadOrBehind");function hs(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}c(hs,"addStickyFlag");function ua(e,t,s){const n=[];return Object.hasOwn(e,"defaultMode")||n.push({message:`A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition
|
|
23
|
+
`,type:b.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,"modes")||n.push({message:`A MultiMode Lexer cannot be initialized without a <modes> property in its definition
|
|
24
|
+
`,type:b.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,"modes")&&Object.hasOwn(e,"defaultMode")&&!Object.hasOwn(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Ks}: <${e.defaultMode}>which does not exist
|
|
25
|
+
`,type:b.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,"modes")&&Object.keys(e.modes).forEach(i=>{const a=e.modes[i];a.forEach((o,l)=>{o===void 0?n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${l}>
|
|
26
|
+
`,type:b.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(o,"LONGER_ALT")&&(Array.isArray(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT]).forEach(r=>{r!==void 0&&!a.includes(r)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${r.name}> on token <${o.name}> outside of mode <${i}>
|
|
27
|
+
`,type:b.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}c(ua,"performRuntimeChecks");function da(e,t,s){const n=[];let i=!1;const a=Object.values(e.modes||{}).flat().filter(Boolean).filter(l=>l[Te]!==F.NA),o=Vs(s);return t&&a.forEach(l=>{const r=Hs(l,o);if(r!==!1){const u={message:ma(l,r),type:r.issue,tokenType:l};n.push(u)}else Object.hasOwn(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Ht(o,l.PATTERN)&&(i=!0)}),t&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
28
|
+
This Lexer has been defined to track line and column information,
|
|
29
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
30
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
31
|
+
for details.`,type:b.NO_LINE_BREAKS_FLAGS}),n}c(da,"performWarningRuntimeChecks");function zs(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if(typeof t=="function")return!0;if(Object.hasOwn(t,"exec"))return!0;if(typeof t=="string")return!1;throw Error("non exhaustive match")}c(zs,"isCustomPattern");function fa(e){return typeof e=="string"&&e.length===1?e.charCodeAt(0):!1}c(fa,"isShortPattern");var pa={test:c(function(e){const t=e.length;for(let s=this.lastIndex;s<t;s++){const n=e.charCodeAt(s);if(n===10)return this.lastIndex=s+1,!0;if(n===13)return e.charCodeAt(s+1)===10?this.lastIndex=s+2:this.lastIndex=s+1,!0}return!1},"test"),lastIndex:0};function Hs(e,t){if(Object.hasOwn(e,"LINE_BREAKS"))return!1;if(e.PATTERN instanceof RegExp){try{Ht(t,e.PATTERN)}catch(s){return{issue:b.IDENTIFY_TERMINATOR,errMsg:s.message}}return!1}else{if(typeof e.PATTERN=="string")return!1;if(zs(e))return{issue:b.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}c(Hs,"checkLineBreaksIssues");function ma(e,t){if(t.issue===b.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
32
|
+
The problem is in the <${e.name}> Token Type
|
|
33
|
+
Root cause: ${t.errMsg}.
|
|
34
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===b.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
35
|
+
The problem is in the <${e.name}> Token Type
|
|
36
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}c(ma,"buildLineBreakIssueMessage");function Vs(e){return e.map(t=>typeof t=="string"?t.charCodeAt(0):t)}c(Vs,"getCharCodes");function Nt(e,t,s){e[t]===void 0?e[t]=[s]:e[t].push(s)}c(Nt,"addToMapOfArrays");var qe=[];function ue(e){return e<256?e:qe[e]}c(ue,"charCodeToOptimizedIndex");function Ea(){if(qe.length===0){qe=new Array(65536);for(let e=0;e<65536;e++)qe[e]=e>255?255+~~(e/255):e}}c(Ea,"initCharCodeToOptimizedIndexMap");function We(e,t){const s=e.tokenTypeIdx;return s===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[s]===!0}c(We,"tokenStructuredMatcher");function ht(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}c(ht,"tokenStructuredMatcherNoCategories");var us=1,Xs={};function Ke(e){const t=Ta(e);ga(t),Sa(t),Aa(t),t.forEach(s=>{s.isParent=s.categoryMatches.length>0})}c(Ke,"augmentTokenTypes");function Ta(e){let t=[...e],s=e,n=!0;for(;n;){s=s.map(a=>a.CATEGORIES).flat().filter(Boolean);const i=s.filter(a=>!t.includes(a));t=t.concat(i),i.length===0?n=!1:s=i}return t}c(Ta,"expandCategories");function ga(e){e.forEach(t=>{Js(t)||(Xs[us]=t,t.tokenTypeIdx=us++),ds(t)&&!Array.isArray(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),ds(t)||(t.CATEGORIES=[]),ya(t)||(t.categoryMatches=[]),Oa(t)||(t.categoryMatchesMap={})})}c(ga,"assignTokenDefaultProps");function Aa(e){e.forEach(t=>{t.categoryMatches=[],Object.keys(t.categoryMatchesMap).forEach(s=>{t.categoryMatches.push(Xs[s].tokenTypeIdx)})})}c(Aa,"assignCategoriesTokensProp");function Sa(e){e.forEach(t=>{Ys([],t)})}c(Sa,"assignCategoriesMapProp");function Ys(e,t){e.forEach(s=>{t.categoryMatchesMap[s.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(s=>{const n=e.concat(t);n.includes(s)||Ys(n,s)})}c(Ys,"singleAssignCategoriesToksMap");function Js(e){return Object.hasOwn(e??{},"tokenTypeIdx")}c(Js,"hasShortKeyProperty");function ds(e){return Object.hasOwn(e??{},"CATEGORIES")}c(ds,"hasCategoriesProperty");function ya(e){return Object.hasOwn(e??{},"categoryMatches")}c(ya,"hasExtendingTokensTypesProperty");function Oa(e){return Object.hasOwn(e??{},"categoryMatchesMap")}c(Oa,"hasExtendingTokensTypesMapProperty");function Ra(e){return Object.hasOwn(e??{},"tokenTypeIdx")}c(Ra,"isTokenType");var La={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,s,n,i,a){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${s} characters.`}},b;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(b||(b={}));var Ue={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
37
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:La,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ue);var F=class{static{c(this,"Lexer")}constructor(e,t=Ue){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.cachedGroupKeys=[],this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(n,i)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent;const{time:o,value:l}=$s(i),r=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&r(`${a}<-- <${n}> time: ${o}ms`),this.traceInitIndent--,l}else return i()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
38
|
+
a boolean 2nd argument is no longer supported`);this.config=Object.assign({},Ue,t);const s=this.config.traceInitPerf;s===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof s=="number"&&(this.traceInitMaxIdent=s,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,i=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ue.lineTerminatorsPattern)this.config.lineTerminatorsPattern=pa;else if(this.config.lineTerminatorCharacters===Ue.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
39
|
+
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),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Ks}:(i=!1,n=Object.assign({},e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(ua(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(da(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([o,l])=>{n.modes[o]=l.filter(r=>r!==void 0)});const a=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([o,l])=>{this.TRACE_INIT(`Mode: <${o}> processing`,()=>{if(this.modes.push(o),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Xi(l,a))}),this.lexerDefinitionErrors.length===0){Ke(l);let r;this.TRACE_INIT("analyzeTokenTypes",()=>{r=Hi(l,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[o]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[o]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[o]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.cachedGroupKeys=Object.keys(this.emptyGroups),this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const o=this.lexerDefinitionErrors.map(l=>l.message).join(`-----------------------
|
|
40
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
41
|
+
`+o)}this.lexerDefinitionWarning.forEach(o=>{o.message}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(i&&(this.handleModes=()=>{}),this.trackStartLines===!1&&(this.computeNewColumn=o=>o),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=()=>{}),/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",()=>{const o=Object.entries(this.canModeBeOptimized).reduce((l,[r,u])=>(u===!1&&l.push(r),l),[]);if(t.ensureOptimizations&&o.length>0)throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
|
42
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
43
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Gi()}),this.TRACE_INIT("toFastProperties",()=>{js(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const s=this.lexerDefinitionErrors.map(n=>n.message).join(`-----------------------
|
|
44
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
45
|
+
`+s)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let s,n,i,a,o,l,r,u,d,p,m,g,y,R,L;const A=e,T=A.length;let f=0,O=0;const ae=this.hasCustom?0:Math.floor(e.length/10),z=new Array(ae),de=[];let ke=this.trackStartLines?1:void 0,Q=this.trackStartLines?1:void 0;const Ae={};for(let w=0;w<this.cachedGroupKeys.length;w++)Ae[this.cachedGroupKeys[w]]=[];const oi=this.trackStartLines,St=this.config.lineTerminatorsPattern;let yt=0,fe=[],ve=[];const Ce=[],ns=[];Object.freeze(ns);let be=!1;const li=c(w=>{if(Ce.length===1&&w.tokenType.PUSH_MODE===void 0){const V=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(w);de.push({offset:w.startOffset,line:w.startLine,column:w.startColumn,length:w.image.length,message:V})}else{Ce.pop();const V=Ce.at(-1);fe=this.patternIdxToConfig[V],ve=this.charCodeToPatternIdxToConfig[V],yt=fe.length;const Ot=this.canModeBeOptimized[V]&&this.config.safeMode===!1;ve&&Ot?be=!0:be=!1}},"pop_mode");function is(w){Ce.push(w),ve=this.charCodeToPatternIdxToConfig[w],fe=this.patternIdxToConfig[w],yt=fe.length;const V=this.canModeBeOptimized[w]&&this.config.safeMode===!1;ve&&V?be=!0:be=!1}c(is,"push_mode"),is.call(this,t);let H;const as=this.config.recoveryEnabled;for(;f<T;){l=null,d=-1;const w=A.charCodeAt(f);let V;if(be){const U=ue(w),j=ve[U];V=j!==void 0?j:ns}else V=fe;const Ot=V.length;for(s=0;s<Ot;s++){H=V[s];const U=H.pattern;switch(r=null,H.matchType){case 0:w===H.short&&(d=1,l=U);break;case 1:L=U.exec(A,f,z,Ae),L!==null?(l=L[0],d=l.length,L.payload!==void 0&&(r=L.payload)):l=null;break;case 3:{const j=H.asciiClass;if(j[w]!==1){U.lastIndex=0;break}let B=f+1;for(;j[A.charCodeAt(B)]===1;)B++;d=B-f,U.lastIndex=B;break}case 2:U.lastIndex=f,d=this.matchLength(U,e,f)}if(d!==-1){if(o=H.longerAlt,o!==void 0){l=e.substring(f,f+d);const j=o.length;for(i=0;i<j;i++){const B=fe[o[i]],re=B.pattern;if(u=null,B.matchType===1?(L=re.exec(A,f,z,Ae),L!==null?(a=L[0],L.payload!==void 0&&(u=L.payload)):a=null):(re.lastIndex=f,a=this.match(re,e,f)),a&&a.length>l.length){l=a,d=a.length,r=u,H=B;break}}}break}}if(d!==-1){if(p=H.group,p!==void 0&&(l=l!==null?l:e.substring(f,f+d),m=H.tokenTypeIdx,g=this.createTokenInstance(l,f,m,H.tokenType,ke,Q,d),this.handlePayload(g,r),p===!1?O=this.addToken(z,O,g):Ae[p].push(g)),oi===!0&&H.canLineTerminator===!0){let U=0,j,B;St.lastIndex=0;do l=l!==null?l:e.substring(f,f+d),j=St.test(l),j===!0&&(B=St.lastIndex-1,U++);while(j===!0);U!==0?(ke=ke+U,Q=d-B,this.updateTokenEndLineColumnLocation(g,p,B,U,ke,Q,d)):Q=this.computeNewColumn(Q,d)}else Q=this.computeNewColumn(Q,d);f=f+d,this.handleModes(H,li,is,g)}else{const U=f,j=ke,B=Q;let re=as===!1;for(;re===!1&&f<T;)for(f++,n=0;n<yt;n++){const Rt=fe[n],Lt=Rt.pattern;switch(Rt.matchType){case 0:A.charCodeAt(f)===Rt.short&&(re=!0);break;case 1:re=Lt.exec(A,f,z,Ae)!==null;break;case 3:case 2:Lt.lastIndex=f,re=Lt.exec(e)!==null}if(re===!0)break}if(y=f-U,Q=this.computeNewColumn(Q,y),R=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(A,U,y,j,B,Ce.at(-1)),de.push({offset:U,line:j,column:B,length:y,message:R}),as===!1)break}}return this.hasCustom||(z.length=O),{tokens:z,groups:Ae,errors:de}}handleModes(e,t,s,n){if(e.pop===!0){const i=e.push;t(n),i!==void 0&&s.call(this,i)}else e.push!==void 0&&s.call(this,e.push)}updateTokenEndLineColumnLocation(e,t,s,n,i,a,o){let l,r;t!==void 0&&(l=s===o-1,r=l?-1:0,n===1&&l===!0||(e.endLine=i+r,e.endColumn=a-1+-r))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,s,n){return{image:e,startOffset:t,tokenTypeIdx:s,tokenType:n}}createStartOnlyToken(e,t,s,n,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:s,tokenType:n}}createFullToken(e,t,s,n,i,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:i,endLine:i,startColumn:a,endColumn:a+o-1,tokenTypeIdx:s,tokenType:n}}addTokenUsingPush(e,t,s){return e.push(s),t}addTokenUsingMemberAccess(e,t,s){return e[t]=s,t++,t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){t!==null&&(e.payload=t)}match(e,t,s){return e.test(t)===!0?t.substring(s,e.lastIndex):null}matchLength(e,t,s){return e.test(t)===!0?e.lastIndex-s:-1}};F.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.";F.NA=/NOT_APPLICABLE/;function $e(e){return qs(e)?e.LABEL:e.name}c($e,"tokenLabel");function qs(e){return typeof e.LABEL=="string"&&e.LABEL!==""}c(qs,"hasTokenLabel");var Ia="parent",fs="categories",ps="label",ms="group",Es="push_mode",Ts="pop_mode",gs="longer_alt",As="line_breaks",Ss="start_chars_hint";function E(e){return Na(e)}c(E,"createToken");function Na(e){const t=e.pattern,s={};if(s.name=e.name,t!==void 0&&(s.PATTERN=t),Object.hasOwn(e,Ia))throw`The parent property is no longer supported.
|
|
46
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(e,fs)&&(s.CATEGORIES=e[fs]),Ke([s]),Object.hasOwn(e,ps)&&(s.LABEL=e[ps]),Object.hasOwn(e,ms)&&(s.GROUP=e[ms]),Object.hasOwn(e,Ts)&&(s.POP_MODE=e[Ts]),Object.hasOwn(e,Es)&&(s.PUSH_MODE=e[Es]),Object.hasOwn(e,gs)&&(s.LONGER_ALT=e[gs]),Object.hasOwn(e,As)&&(s.LINE_BREAKS=e[As]),Object.hasOwn(e,Ss)&&(s.START_CHARS_HINT=e[Ss]),s}c(Na,"createTokenInternal");var ce=E({name:"EOF",pattern:F.NA});Ke([ce]);function Vt(e,t,s,n,i,a,o,l){return{image:t,startOffset:s,endOffset:n,startLine:i,endLine:a,startColumn:o,endColumn:l,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}c(Vt,"createTokenInstance");function Zs(e,t){return We(e,t)}c(Zs,"tokenMatcher");var Qs={buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:n}){return`Expecting ${qs(e)?`--> ${$e(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:s,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=`
|
|
47
|
+
but found: '`+t[0].image+"'";return n?a+n+o:`Expecting: one of these possible Token sequences:
|
|
48
|
+
${e.reduce((l,r)=>l.concat(r),[]).map(l=>`[${l.map(r=>$e(r)).join(", ")}]`).map((l,r)=>` ${r+1}. ${l}`).join(`
|
|
49
|
+
`)}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:s,ruleName:n}){const i="Expecting: ",a=`
|
|
50
|
+
but found: '`+t[0].image+"'";return s?i+s+a:`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::
|
|
51
|
+
<${e.map(o=>`[${o.map(l=>$e(l)).join(",")}]`).join(" ,")}>`+a}};Object.freeze(Qs);var ka={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<-
|
|
52
|
+
inside top level rule: ->`+e.name+"<-"}},Ee={buildDuplicateFoundError(e,t){function s(u){return u instanceof k?u.terminalType.name:u instanceof K?u.nonTerminalName:""}c(s,"getExtraProductionArgument");const n=e.name,i=t[0],a=i.idx,o=ee(i),l=s(i);let r=`->${o}${a>0?a:""}<- ${l?`with argument: ->${l}<-`:""}
|
|
53
|
+
appears more than once (${t.length} times) in the top level rule: ->${n}<-.
|
|
54
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
55
|
+
`;return r=r.replace(/[ \t]+/g," "),r=r.replace(/\s\s+/g,`
|
|
56
|
+
`),r},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.
|
|
57
|
+
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.
|
|
58
|
+
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
59
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
60
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(n=>$e(n)).join(", "),s=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
61
|
+
in <OR${s}> inside <${e.topLevelRule.name}> Rule,
|
|
62
|
+
<${t}> may appears as a prefix path in all these alternatives.
|
|
63
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
64
|
+
For Further details.`},buildAlternationAmbiguityError(e){const t=e.alternation.idx===0?"":e.alternation.idx,s=e.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,
|
|
65
|
+
`;if(s)n+=`These alternatives are all empty (match no tokens), making them indistinguishable.
|
|
66
|
+
Only the last alternative may be empty.
|
|
67
|
+
`;else{const i=e.prefixPath.map(a=>$e(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives.
|
|
68
|
+
`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
69
|
+
For Further details.`,n},buildEmptyRepetitionError(e){let t=ee(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.
|
|
70
|
+
This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
|
71
|
+
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:
|
|
72
|
+
<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
|
73
|
+
has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.
|
|
74
|
+
rule: <${t}> can be invoked from itself (directly or indirectly)
|
|
75
|
+
without consuming any Tokens. The grammar path that causes this is:
|
|
76
|
+
${`${t} --> ${e.leftRecursionPath.map(s=>s.name).concat([t]).join(" --> ")}`}
|
|
77
|
+
To fix this refactor your grammar to remove the left recursion.
|
|
78
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof Ie?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function va(e,t){const s=new Ca(e,t);return s.resolveRefs(),s.errors}c(va,"resolveGrammar$1");var Ca=class extends Ne{static{c(this,"GastRefResolverVisitor")}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const s=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:s,type:$.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},ba=class extends mt{static{c(this,"AbstractNextPossibleTokensWalker")}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=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...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,s){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const n=t.concat(s);this.updateExpectedNext(),this.walk(e.referencedRule,n)}}updateExpectedNext(){this.ruleStack.length===0?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},_a=class extends ba{static{c(this,"NextAfterTokenWalker")}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,s){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const n=t.concat(s),i=new W({definition:n});this.possibleTokTypes=je(i),this.found=!0}}},Et=class extends mt{static{c(this,"AbstractNextTerminalAfterProductionWalker")}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}},wa=class extends Et{static{c(this,"NextTerminalAfterManyWalker")}walkMany(e,t,s){if(e.idx===this.occurrence){const n=t.concat(s)[0];this.result.isEndOfRule=n===void 0,n instanceof k&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkMany(e,t,s)}},ys=class extends Et{static{c(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,s){if(e.idx===this.occurrence){const n=t.concat(s)[0];this.result.isEndOfRule=n===void 0,n instanceof k&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkManySep(e,t,s)}},Ma=class extends Et{static{c(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,s){if(e.idx===this.occurrence){const n=t.concat(s)[0];this.result.isEndOfRule=n===void 0,n instanceof k&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOne(e,t,s)}},Os=class extends Et{static{c(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,s){if(e.idx===this.occurrence){const n=t.concat(s)[0];this.result.isEndOfRule=n===void 0,n instanceof k&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOneSep(e,t,s)}};function xt(e,t,s=[]){s=[...s];let n=[],i=0;function a(l){return l.concat(e.slice(i+1))}c(a,"remainingPathWith");function o(l){const r=xt(a(l),t,s);return n.concat(r)}for(c(o,"getAlternativesForProd");s.length<t&&i<e.length;){const l=e[i];if(l instanceof W)return o(l.definition);if(l instanceof K)return o(l.definition);if(l instanceof G)n=o(l.definition);else{if(l instanceof se)return o(l.definition.concat([new M({definition:l.definition})]));if(l instanceof ne)return o([new W({definition:l.definition}),new M({definition:[new k({terminalType:l.separator})].concat(l.definition)})]);if(l instanceof q)n=o(l.definition.concat([new M({definition:[new k({terminalType:l.separator})].concat(l.definition)})]));else if(l instanceof M)n=o(l.definition.concat([new M({definition:l.definition})]));else{if(l instanceof Z)return l.definition.forEach(r=>{r.definition.length!==0&&(n=o(r.definition))}),n;if(l instanceof k)s.push(l.terminalType);else throw Error("non exhaustive match")}}i++}return n.push({partialPath:s,suffixDef:e.slice(i)}),n}c(xt,"possiblePathsFrom");function xa(e,t,s,n){const i="EXIT_NONE_TERMINAL",a=[i],o="EXIT_ALTERNATIVE";let l=!1;const r=t.length,u=r-n-1,d=[],p=[];for(p.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});p.length!==0;){const m=p.pop();if(m===o){l&&p.at(-1).idx<=u&&p.pop();continue}const g=m.def,y=m.idx,R=m.ruleStack,L=m.occurrenceStack;if(g.length===0)continue;const A=g[0];if(A===i){const T={idx:y,def:g.slice(1),ruleStack:R.slice(0,-1),occurrenceStack:L.slice(0,-1)};p.push(T)}else if(A instanceof k)if(y<r-1){const T=y+1,f=t[T];if(s(f,A.terminalType)){const O={idx:T,def:g.slice(1),ruleStack:R,occurrenceStack:L};p.push(O)}}else if(y===r-1)d.push({nextTokenType:A.terminalType,nextTokenOccurrence:A.idx,ruleStack:R,occurrenceStack:L}),l=!0;else throw Error("non exhaustive match");else if(A instanceof K){const T=[...R];T.push(A.nonTerminalName);const f=[...L];f.push(A.idx);const O={idx:y,def:A.definition.concat(a,g.slice(1)),ruleStack:T,occurrenceStack:f};p.push(O)}else if(A instanceof G){const T={idx:y,def:g.slice(1),ruleStack:R,occurrenceStack:L};p.push(T),p.push(o);const f={idx:y,def:A.definition.concat(g.slice(1)),ruleStack:R,occurrenceStack:L};p.push(f)}else if(A instanceof se){const T=new M({definition:A.definition,idx:A.idx}),f={idx:y,def:A.definition.concat([T],g.slice(1)),ruleStack:R,occurrenceStack:L};p.push(f)}else if(A instanceof ne){const T=new k({terminalType:A.separator}),f=new M({definition:[T].concat(A.definition),idx:A.idx}),O={idx:y,def:A.definition.concat([f],g.slice(1)),ruleStack:R,occurrenceStack:L};p.push(O)}else if(A instanceof q){const T={idx:y,def:g.slice(1),ruleStack:R,occurrenceStack:L};p.push(T),p.push(o);const f=new k({terminalType:A.separator}),O=new M({definition:[f].concat(A.definition),idx:A.idx}),ae={idx:y,def:A.definition.concat([O],g.slice(1)),ruleStack:R,occurrenceStack:L};p.push(ae)}else if(A instanceof M){const T={idx:y,def:g.slice(1),ruleStack:R,occurrenceStack:L};p.push(T),p.push(o);const f=new M({definition:A.definition,idx:A.idx}),O={idx:y,def:A.definition.concat([f],g.slice(1)),ruleStack:R,occurrenceStack:L};p.push(O)}else if(A instanceof Z)for(let T=A.definition.length-1;T>=0;T--){const f={idx:y,def:A.definition[T].definition.concat(g.slice(1)),ruleStack:R,occurrenceStack:L};p.push(f),p.push(o)}else if(A instanceof W)p.push({idx:y,def:A.definition.concat(g.slice(1)),ruleStack:R,occurrenceStack:L});else if(A instanceof Ie)p.push(Ua(A,y,R,L));else throw Error("non exhaustive match")}return d}c(xa,"nextPossibleTokensAfter");function Ua(e,t,s,n){const i=[...s];i.push(e.name);const a=[...n];return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}c(Ua,"expandTopLevelRule");var C;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(C||(C={}));function en(e){if(e instanceof G||e==="Option")return C.OPTION;if(e instanceof M||e==="Repetition")return C.REPETITION;if(e instanceof se||e==="RepetitionMandatory")return C.REPETITION_MANDATORY;if(e instanceof ne||e==="RepetitionMandatoryWithSeparator")return C.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof q||e==="RepetitionWithSeparator")return C.REPETITION_WITH_SEPARATOR;if(e instanceof Z||e==="Alternation")return C.ALTERNATION;throw Error("non exhaustive match")}c(en,"getProdType");function Pa(e,t,s,n,i,a){const o=Xt(e,t,s);return a(o,n,nn(o)?ht:We,i)}c(Pa,"buildLookaheadFuncForOr");function Da(e,t,s,n,i,a){const o=Yt(e,t,i,s),l=nn(o)?ht:We;return a(o[0],l,n)}c(Da,"buildLookaheadFuncForOptionalProd");function Fa(e,t,s,n){const i=e.length,a=e.every(o=>o.every(l=>l.length===1));if(t)return function(o){const l=o.map(r=>r.GATE);for(let r=0;r<i;r++){const u=e[r],d=u.length,p=l[r];if(!(p!==void 0&&p.call(this)===!1))e:for(let m=0;m<d;m++){const g=u[m],y=g.length;for(let R=0;R<y;R++)if(s(this.LA_FAST(R+1),g[R])===!1)continue e;return r}}};if(a&&!n){const o=e.map(l=>l.flat()).reduce((l,r,u)=>(r.forEach(d=>{d.tokenTypeIdx in l||(l[d.tokenTypeIdx]=u),d.categoryMatches.forEach(p=>{Object.hasOwn(l,p)||(l[p]=u)})}),l),{});return function(){const l=this.LA_FAST(1);return o[l.tokenTypeIdx]}}else return function(){for(let o=0;o<i;o++){const l=e[o],r=l.length;e:for(let u=0;u<r;u++){const d=l[u],p=d.length;for(let m=0;m<p;m++)if(s(this.LA_FAST(m+1),d[m])===!1)continue e;return o}}}}c(Fa,"buildAlternativesLookAheadFunc");function Ba(e,t,s){const n=e.every(a=>a.length===1),i=e.length;if(n&&!s){const a=e.flat();if(a.length===1&&a[0].categoryMatches.length===0){const o=a[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===o}}else{const o=a.reduce((l,r,u)=>(l[r.tokenTypeIdx]=!0,r.categoryMatches.forEach(d=>{l[d]=!0}),l),[]);return function(){const l=this.LA_FAST(1);return o[l.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){const o=e[a],l=o.length;for(let r=0;r<l;r++)if(t(this.LA_FAST(r+1),o[r])===!1)continue e;return!0}return!1}}c(Ba,"buildSingleAlternativeLookaheadFunction");var $a=class extends mt{static{c(this,"RestDefinitionFinderWalker")}constructor(e,t,s){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=s}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,s,n){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=s.concat(n),!0):!1}walkOption(e,t,s){this.checkIsTarget(e,C.OPTION,t,s)||super.walkOption(e,t,s)}walkAtLeastOne(e,t,s){this.checkIsTarget(e,C.REPETITION_MANDATORY,t,s)||super.walkOption(e,t,s)}walkAtLeastOneSep(e,t,s){this.checkIsTarget(e,C.REPETITION_MANDATORY_WITH_SEPARATOR,t,s)||super.walkOption(e,t,s)}walkMany(e,t,s){this.checkIsTarget(e,C.REPETITION,t,s)||super.walkOption(e,t,s)}walkManySep(e,t,s){this.checkIsTarget(e,C.REPETITION_WITH_SEPARATOR,t,s)||super.walkOption(e,t,s)}},tn=class extends Ne{static{c(this,"InsideDefinitionFinderVisitor")}constructor(e,t,s){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=s,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,C.OPTION)}visitRepetition(e){this.checkIsTarget(e,C.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,C.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,C.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,C.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,C.ALTERNATION)}};function Rs(e){const t=new Array(e);for(let s=0;s<e;s++)t[s]=[];return t}c(Rs,"initializeArrayOfArrays");function kt(e){let t=[""];for(let s=0;s<e.length;s++){const n=e[s],i=[];for(let a=0;a<t.length;a++){const o=t[a];i.push(o+"_"+n.tokenTypeIdx);for(let l=0;l<n.categoryMatches.length;l++){const r="_"+n.categoryMatches[l];i.push(o+r)}}t=i}return t}c(kt,"pathToHashKeys");function ja(e,t,s){for(let n=0;n<e.length;n++){if(n===s)continue;const i=e[n];for(let a=0;a<t.length;a++)if(i[t[a]]===!0)return!1}return!0}c(ja,"isUniquePrefixHash");function sn(e,t){const s=e.map(o=>xt([o],1)),n=Rs(s.length),i=s.map(o=>{const l={};return o.forEach(r=>{kt(r.partialPath).forEach(u=>{l[u]=!0})}),l});let a=s;for(let o=1;o<=t;o++){const l=a;a=Rs(l.length);for(let r=0;r<l.length;r++){const u=l[r];for(let d=0;d<u.length;d++){const p=u[d].partialPath,m=u[d].suffixDef,g=kt(p);if(ja(i,g,r)||m.length===0||p.length===t){const y=n[r];if(Ut(y,p)===!1){y.push(p);for(let R=0;R<g.length;R++){const L=g[R];i[r][L]=!0}}}else{const y=xt(m,o+1,p);a[r]=a[r].concat(y),y.forEach(R=>{kt(R.partialPath).forEach(L=>{i[r][L]=!0})})}}}}return n}c(sn,"lookAheadSequenceFromAlternatives");function Xt(e,t,s,n){const i=new tn(e,C.ALTERNATION,n);return t.accept(i),sn(i.result,s)}c(Xt,"getLookaheadPathsForOr");function Yt(e,t,s,n){const i=new tn(e,s);t.accept(i);const a=i.result,o=new $a(t,e,s).startWalking();return sn([new W({definition:a}),new W({definition:o})],n)}c(Yt,"getLookaheadPathsForOptionalProd");function Ut(e,t){e:for(let s=0;s<e.length;s++){const n=e[s];if(n.length===t.length){for(let i=0;i<n.length;i++){const a=t[i],o=n[i];if(!(a===o||o.categoryMatchesMap[a.tokenTypeIdx]!==void 0))continue e}return!0}}return!1}c(Ut,"containsPath");function Ga(e,t){return e.length<t.length&&e.every((s,n)=>{const i=t[n];return s===i||i.categoryMatchesMap[s.tokenTypeIdx]})}c(Ga,"isStrictPrefixOfPath");function nn(e){return e.every(t=>t.every(s=>s.every(n=>n.categoryMatches.length===0)))}c(nn,"areTokenCategoriesNotUsed");function Wa(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(t=>Object.assign({type:$.CUSTOM_LOOKAHEAD_VALIDATION},t))}c(Wa,"validateLookahead");function Ka(e,t,s,n){const i=e.flatMap(r=>za(r,s)),a=nr(e,t,s),o=e.flatMap(r=>Qa(r,s)),l=e.flatMap(r=>Xa(r,e,n,s));return i.concat(a,o,l)}c(Ka,"validateGrammar$1");function za(e,t){const s=new Va;e.accept(s);const n=s.allProductions,i=Object.groupBy(n,Ha),a=Object.fromEntries(Object.entries(i).filter(([o,l])=>l.length>1));return Object.values(a).map(o=>{const l=o[0],r=t.buildDuplicateFoundError(e,o),u=ee(l),d={message:r,type:$.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:u,occurrence:l.idx},p=an(l);return p&&(d.parameter=p),d})}c(za,"validateDuplicateProductions");function Ha(e){return`${ee(e)}_#_${e.idx}_#_${an(e)}`}c(Ha,"identifyProductionForDuplicates");function an(e){return e instanceof k?e.terminalType.name:e instanceof K?e.nonTerminalName:""}c(an,"getExtraProductionArgument");var Va=class extends Ne{static{c(this,"OccurrenceValidationCollector")}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)}};function Xa(e,t,s,n){const i=[];if(t.reduce((a,o)=>o.name===e.name?a+1:a,0)>1){const a=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:s});i.push({message:a,type:$.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}c(Xa,"validateRuleDoesNotAlreadyExist");function Ya(e,t,s){const n=[];let i;return t.includes(e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${s}<-as it is not defined in any of the super grammars `,n.push({message:i,type:$.INVALID_RULE_OVERRIDE,ruleName:e})),n}c(Ya,"validateRuleIsOverridden");function rn(e,t,s,n=[]){const i=[],a=Ze(t.definition);if(a.length===0)return[];{const o=e.name;a.includes(e)&&i.push({message:s.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:$.LEFT_RECURSION,ruleName:o});const l=n.concat([e]),r=a.filter(u=>!l.includes(u)).flatMap(u=>{const d=[...n];return d.push(u),rn(e,u,s,d)});return i.concat(r)}}c(rn,"validateNoLeftRecursion");function Ze(e){let t=[];if(e.length===0)return t;const s=e[0];if(s instanceof K)t.push(s.referencedRule);else if(s instanceof W||s instanceof G||s instanceof se||s instanceof ne||s instanceof q||s instanceof M)t=t.concat(Ze(s.definition));else if(s instanceof Z)t=s.definition.map(a=>Ze(a.definition)).flat();else if(!(s instanceof k))throw Error("non exhaustive match");const n=rt(s),i=e.length>1;if(n&&i){const a=e.slice(1);return t.concat(Ze(a))}else return t}c(Ze,"getFirstNoneTerminal");var Jt=class extends Ne{static{c(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function Ja(e,t){const s=new Jt;return e.accept(s),s.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((i,a)=>xa([i],[],We,1).length===0?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:a}),type:$.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:a+1}]:[]))}c(Ja,"validateEmptyOrAlternative");function qa(e,t,s){const n=new Jt;e.accept(n);let i=n.alternations;return i=i.filter(a=>a.ignoreAmbiguities!==!0),i.flatMap(a=>{const o=a.idx,l=a.maxLookahead||t,r=Xt(o,e,l,a),u=tr(r,a,e,s),d=sr(r,a,e,s);return u.concat(d)})}c(qa,"validateAmbiguousAlternationAlternatives");var Za=class extends Ne{static{c(this,"RepetitionCollector")}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)}};function Qa(e,t){const s=new Jt;return e.accept(s),s.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:$.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}c(Qa,"validateTooManyAlts");function er(e,t,s){const n=[];return e.forEach(i=>{const a=new Za;i.accept(a),a.allProductions.forEach(o=>{const l=en(o),r=o.maxLookahead||t,u=o.idx;if(Yt(u,i,l,r)[0].flat().length===0){const d=s.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:d,type:$.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}c(er,"validateSomeNonEmptyLookaheadPath");function tr(e,t,s,n){const i=[];return e.reduce((a,o,l)=>(t.definition[l].ignoreAmbiguities===!0||o.forEach(r=>{const u=[l];e.forEach((d,p)=>{l!==p&&Ut(d,r)&&t.definition[p].ignoreAmbiguities!==!0&&u.push(p)}),u.length>1&&!Ut(i,r)&&(i.push(r),a.push({alts:u,path:r}))}),a),[]).map(a=>{const o=a.alts.map(l=>l+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:s,alternation:t,ambiguityIndices:o,prefixPath:a.path}),type:$.AMBIGUOUS_ALTS,ruleName:s.name,occurrence:t.idx,alternatives:a.alts}})}c(tr,"checkAlternativesAmbiguities");function sr(e,t,s,n){const i=e.reduce((a,o,l)=>{const r=o.map(u=>({idx:l,path:u}));return a.concat(r)},[]);return i.flatMap(a=>{if(t.definition[a.idx].ignoreAmbiguities===!0)return[];const o=a.idx,l=a.path;return i.filter(r=>t.definition[r.idx].ignoreAmbiguities!==!0&&r.idx<o&&Ga(r.path,l)).map(r=>{const u=[r.idx+1,o+1],d=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:s,alternation:t,ambiguityIndices:u,prefixPath:r.path}),type:$.AMBIGUOUS_PREFIX_ALTS,ruleName:s.name,occurrence:d,alternatives:u}})})}c(sr,"checkPrefixAlternativesAmbiguities");function nr(e,t,s){const n=[],i=t.map(a=>a.name);return e.forEach(a=>{const o=a.name;if(i.includes(o)){const l=s.buildNamespaceConflictError(a);n.push({message:l,type:$.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}c(nr,"checkTerminalAndNoneTerminalsNameSpace");function ir(e){const t=Object.assign({errMsgProvider:ka},e),s={};return e.rules.forEach(n=>{s[n.name]=n}),va(s,t.errMsgProvider)}c(ir,"resolveGrammar");function ar(e){var t;const s=(t=e.errMsgProvider)!==null&&t!==void 0?t:Ee;return Ka(e.rules,e.tokenTypes,s,e.grammarName)}c(ar,"validateGrammar");var on="MismatchedTokenException",ln="NoViableAltException",cn="EarlyExitException",hn="NotAllInputParsedException",un=[on,ln,cn,hn];Object.freeze(un);function ut(e){return un.includes(e.name)}c(ut,"isRecognitionException");var Tt=class extends Error{static{c(this,"RecognitionException")}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},dn=class extends Tt{static{c(this,"MismatchedTokenException")}constructor(e,t,s){super(e,t),this.previousToken=s,this.name=on}},rr=class extends Tt{static{c(this,"NoViableAltException")}constructor(e,t,s){super(e,t),this.previousToken=s,this.name=ln}},or=class extends Tt{static{c(this,"NotAllInputParsedException")}constructor(e,t){super(e,t),this.name=hn}},lr=class extends Tt{static{c(this,"EarlyExitException")}constructor(e,t,s){super(e,t),this.previousToken=s,this.name=cn}},vt={},cr="InRuleRecoveryException",hr=class extends Error{static{c(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=cr}},ur=class{static{c(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap=[],this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:he.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=dr)}getTokenToInsert(e){const t=Vt(e,"",-1,-1,-1,-1,-1,-1);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,s,n){const i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const r=this.LA_FAST(1);let u=this.LA_FAST(1);const d=c(()=>{const p=this.LA(0),m=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:r,previous:p,ruleName:this.getCurrRuleFullName()}),g=new dn(m,r,this.LA(0));g.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(u,n)){d();return}else if(s.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(u,i)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,s){return!(s===!1||this.tokenMatcher(this.LA_FAST(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],s=this.getGAstProductions()[t];return new _a(s,e).startWalking()}getFollowsForInRuleRecovery(e,t){const s=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(s)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const s=this.SKIP_TOKEN();return this.consumeToken(),s}throw new hr("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||t.length===0)return!1;const s=this.LA_FAST(1);return t.find(n=>this.tokenMatcher(s,n))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),s=2;for(;;){const n=e.find(i=>Zs(t,i));if(n!==void 0)return n;t=this.LA(s),s++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return vt;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),s=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(s)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,s=this.RULE_STACK_IDX+1,n=new Array(s);for(let i=0;i<s;i++)i===0?n[i]=vt:n[i]={ruleName:this.shortRuleNameToFullName(e[i]),idxInCallingRule:t[i],inRule:this.shortRuleNameToFullName(e[i-1])};return n}flattenFollowSet(){return this.buildFullFollowKeyStack().map(e=>this.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===vt)return[ce];const t=e.ruleName+e.idxInCallingRule+Gs+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,ce)||t.push(e),t}reSyncTo(e){const t=[];let s=this.LA_FAST(1);for(;this.tokenMatcher(s,e)===!1;)s=this.SKIP_TOKEN(),this.addToResyncTokens(s,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,s,n,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let s=0;s<e;s++)t[s]=this.shortRuleNameToFullName(this.RULE_STACK[s]);return t}};function dr(e,t,s,n,i,a,o){var l,r,u;const d=n|i,p=(l=(r=this.firstAfterRepMap)[u=this.currRuleShortName])!==null&&l!==void 0?l:r[u]=[];let m=p[d];if(m===void 0){const L=this.getCurrRuleFullName(),A=this.getGAstProductions()[L];m=new a(A,i).startWalking(),p[d]=m}let g=m.token,y=m.occurrence;const R=m.isEndOfRule;this.RULE_STACK_IDX===0&&R&&g===void 0&&(g=ce,y=1),!(g===void 0||y===void 0)&&this.shouldInRepetitionRecoveryBeTried(g,y,o)&&this.tryInRepetitionRecovery(e,t,s,g)}c(dr,"attemptInRepetitionRecovery");var Pt=1024,Dt=1280,Qe=1536,fr=class{static{c(this,"LLkLookaheadStrategy")}constructor(e){var t;this.maxLookahead=(t=e?.maxLookahead)!==null&&t!==void 0?t:he.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(t.length===0){const s=this.validateEmptyOrAlternatives(e.rules),n=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...s,...n,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(t=>rn(t,t,Ee))}validateEmptyOrAlternatives(e){return e.flatMap(t=>Ja(t,Ee))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(s=>qa(s,t,Ee))}validateSomeNonEmptyLookaheadPath(e,t){return er(e,t,Ee)}buildLookaheadForAlternation(e){return Pa(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Fa)}buildLookaheadForOptional(e){return Da(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,en(e.prodType),Ba)}},pr=class{static{c(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:he.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:he.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,"lookaheadStrategy")?e.lookaheadStrategy:new fr({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=[],this.currRuleLookaheadFuncs=[]}preComputeLookaheadFunctions(e){e.forEach(t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:s,repetition:n,option:i,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Er(t);s.forEach(r=>{const u=r.idx===0?"":r.idx;this.TRACE_INIT(`${ee(r)}${u}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:r.idx,rule:t,maxLookahead:r.maxLookahead||this.maxLookahead,hasPredicates:r.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled});this.setLaFuncCache(this.fullRuleNameToShort[t.name],256|r.idx,d)})}),n.forEach(r=>{this.computeLookaheadFunc(t,r.idx,768,"Repetition",r.maxLookahead,ee(r))}),i.forEach(r=>{this.computeLookaheadFunc(t,r.idx,512,"Option",r.maxLookahead,ee(r))}),a.forEach(r=>{this.computeLookaheadFunc(t,r.idx,Pt,"RepetitionMandatory",r.maxLookahead,ee(r))}),o.forEach(r=>{this.computeLookaheadFunc(t,r.idx,Qe,"RepetitionMandatoryWithSeparator",r.maxLookahead,ee(r))}),l.forEach(r=>{this.computeLookaheadFunc(t,r.idx,Dt,"RepetitionWithSeparator",r.maxLookahead,ee(r))})})})}computeLookaheadFunc(e,t,s,n,i,a){this.TRACE_INIT(`${a}${t===0?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n});this.setLaFuncCache(this.fullRuleNameToShort[e.name],s|t,o)})}setLaFuncCache(e,t,s){let n=this.lookAheadFuncsCache[e];n===void 0&&(n=[],this.lookAheadFuncsCache[e]=n),n[t]=s}},mr=class extends Ne{static{c(this,"DslMethodsCollectorVisitor")}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)}},Xe=new mr;function Er(e){Xe.reset(),e.accept(Xe);const t=Xe.dslMethods;return Xe.reset(),t}c(Er,"collectMethods");function Ls(e,t){e.startOffset===-1?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}c(Ls,"setNodeLocationOnlyOffset");function Is(e,t){e.startOffset===-1?(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&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}c(Is,"setNodeLocationFull");function Tr(e,t,s){e.children[s]===void 0?e.children[s]=[t]:e.children[s].push(t)}c(Tr,"addTerminalToCst");function gr(e,t,s){e.children[t]===void 0?e.children[t]=[s]:e.children[t].push(s)}c(gr,"addNoneTerminalToCst");var Ar="name";function fn(e,t){Object.defineProperty(e,Ar,{enumerable:!1,configurable:!0,writable:!1,value:t})}c(fn,"defineNameProp");function Sr(e,t){const s=Object.keys(e),n=s.length;for(let i=0;i<n;i++){const a=e[s[i]],o=a.length;for(let l=0;l<o;l++){const r=a[l];r.tokenTypeIdx===void 0&&this[r.name](r.children,t)}}}c(Sr,"defaultVisit");function yr(e,t){const s=c(function(){},"derivedConstructor");return fn(s,e+"BaseSemantics"),s.prototype={visit:c(function(n,i){if(Array.isArray(n)&&(n=n[0]),n!==void 0)return this[n.name](n.children,i)},"visit"),validateVisitor:c(function(){const n=Rr(this,t);if(n.length!==0){const i=n.map(a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
79
|
+
${i.join(`
|
|
80
|
+
|
|
81
|
+
`).replace(/\n/g,`
|
|
82
|
+
`)}`)}},"validateVisitor")},s.prototype.constructor=s,s._RULE_NAMES=t,s}c(yr,"createBaseSemanticVisitorConstructor");function Or(e,t,s){const n=c(function(){},"derivedConstructor");fn(n,e+"BaseSemanticsWithDefaults");const i=Object.create(s.prototype);return t.forEach(a=>{i[a]=Sr}),n.prototype=i,n.prototype.constructor=n,n}c(Or,"createBaseVisitorConstructorWithDefaults");var Ft;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(Ft||(Ft={}));function Rr(e,t){return Lr(e,t)}c(Rr,"validateVisitor");function Lr(e,t){return t.filter(s=>typeof e[s]!="function").map(s=>({msg:`Missing visitor method: <${s}> on ${e.constructor.name} CST Visitor.`,type:Ft.MISSING_METHOD,methodName:s})).filter(Boolean)}c(Lr,"validateMissingCstMethods");var Ir=class{static{c(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:he.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Is,this.setNodeLocationFromNode=Is,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ls,this.setNodeLocationFromNode=Ls,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{};else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:-1,endOffset:-1}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:-1}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:-1,startLine:-1,startColumn:-1,endOffset:-1,endLine:-1,endColumn:-1}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:-1,endLine:-1,endColumn:-1}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),s=e.location;s.startOffset!==-1&&s.startOffset<=t.startOffset?(s.endOffset=t.endOffset,s.endLine=t.endLine,s.endColumn=t.endColumn):(s.startOffset=-1,s.startLine=-1,s.startColumn=-1)}cstPostRuleOnlyOffset(e){const t=this.LA(0),s=e.location;s.startOffset!==-1&&s.startOffset<=t.startOffset?s.endOffset=t.endOffset:s.startOffset=-1}cstPostTerminal(e,t){const s=this.CST_STACK[this.CST_STACK.length-1];Tr(s,t,e),this.setNodeLocationFromToken(s.location,t)}cstPostNonTerminal(e,t){const s=this.CST_STACK[this.CST_STACK.length-1];gr(s,t,e),this.setNodeLocationFromNode(s.location,e.location)}get currCSTNode(){const e=this;return e.CST_STACK[e.CST_STACK.length-1]}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){const e=yr(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){const e=Or(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},Nr=class{static{c(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)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.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):Le}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Le:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},kr=class{static{c(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,s){return this.consumeInternal(t,e,s)}subrule(e,t,s){return this.subruleInternal(t,e,s)}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,s=ft){if(this.definedRulesNames.includes(e)){const i={message:Ee.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:$.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(i)}this.definedRulesNames.push(e);const n=this.defineRule(e,t,s);return this[e]=n,n}OVERRIDE_RULE(e,t,s=ft){const n=Ya(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const i=this.defineRule(e,t,s);return this[e]=i,i}BACKTRACK(e,t){var s;const n=(s=e.coreRule)!==null&&s!==void 0?s:e;return function(){this.isBackTrackingStack.push(1);const i=this.saveRecogState();try{return n.apply(this,t),!0}catch(a){if(ut(a))return!1;throw a}finally{this.reloadRecogState(i),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ci(Object.values(this.gastProductionsCache))}},vr=class{static{c(this,"RecognizerEngine")}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull=[],this.fullRuleNameToShort={},this.ruleShortNameIdx=0,this.tokenMatcher=ht,this.subruleIdx=0,this.currRuleShortName=-1,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
83
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
84
|
+
For Further details.`);if(Array.isArray(e)){if(e.length===0)throw Error(`A Token Vocabulary cannot be empty.
|
|
85
|
+
Note that the first argument for the parser constructor
|
|
86
|
+
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
87
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
88
|
+
For Further details.`)}if(Array.isArray(e))this.tokensMap=e.reduce((n,i)=>(n[i.name]=i,n),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Ra)){const n=Object.values(e.modes).flat(),i=[...new Set(n)];this.tokensMap=i.reduce((a,o)=>(a[o.name]=o,a),{})}else if(typeof e=="object"&&e!==null)this.tokensMap=Object.assign({},e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=ce;const s=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(n=>{var i;return((i=n.categoryMatches)===null||i===void 0?void 0:i.length)==0});this.tokenMatcher=s?ht:We,Ke(Object.values(this.tokensMap))}defineRule(e,t,s){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
89
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const n=Object.hasOwn(s,"resyncEnabled")?s.resyncEnabled:ft.resyncEnabled,i=Object.hasOwn(s,"recoveryValueFunc")?s.recoveryValueFunc:ft.recoveryValueFunc,a=this.ruleShortNameIdx++;this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return this.outputCst===!0?o=c(function(...r){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,r);const u=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(u),u}catch(u){return this.invokeRuleCatch(u,n,i)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):o=c(function(...r){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,r)}catch(u){return this.invokeRuleCatch(u,n,i)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(c(function(...r){this.onBeforeParse(e);try{return o.apply(this,r)}finally{this.onAfterParse(e)}},"rootRule"),{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,s){const n=this.RULE_STACK_IDX===0,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(ut(e)){const a=e;if(i){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return s(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,a.partialCstResult=l}throw a}}else{if(n)return this.moveToTerminatedState(),s(e);throw a}}else throw e}optionInternal(e,t){const s=512|t;return this.optionInternalLogic(e,t,s)}optionInternalLogic(e,t,s){let n=this.currRuleLookaheadFuncs[s],i;if(typeof e!="function"){i=e.DEF;const a=e.GATE;if(a!==void 0){const o=n;n=c(()=>a.call(this)&&o.call(this),"lookAheadFunc")}}else i=e;if(n.call(this)===!0)return i.call(this)}atLeastOneInternal(e,t){const s=Pt|e;return this.atLeastOneInternalLogic(e,t,s)}atLeastOneInternalLogic(e,t,s){let n=this.currRuleLookaheadFuncs[s],i;if(typeof t!="function"){i=t.DEF;const a=t.GATE;if(a!==void 0){const o=n;n=c(()=>a.call(this)&&o.call(this),"lookAheadFunc")}}else i=t;if(n.call(this)===!0){let a=this.doSingleRepetition(i);for(;n.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,C.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],n,Pt,e,Ma)}atLeastOneSepFirstInternal(e,t){const s=Qe|e;this.atLeastOneSepFirstInternalLogic(e,t,s)}atLeastOneSepFirstInternalLogic(e,t,s){const n=t.DEF,i=t.SEP;if(this.currRuleLookaheadFuncs[s].call(this)===!0){n.call(this);const a=c(()=>this.tokenMatcher(this.LA_FAST(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA_FAST(1),i)===!0;)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,a,n,Os],a,Qe,e,Os)}else throw this.raiseEarlyExitException(e,C.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){const s=768|e;return this.manyInternalLogic(e,t,s)}manyInternalLogic(e,t,s){let n=this.currRuleLookaheadFuncs[s],i;if(typeof t!="function"){i=t.DEF;const o=t.GATE;if(o!==void 0){const l=n;n=c(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else i=t;let a=!0;for(;n.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],n,768,e,wa,a)}manySepFirstInternal(e,t){const s=Dt|e;this.manySepFirstInternalLogic(e,t,s)}manySepFirstInternalLogic(e,t,s){const n=t.DEF,i=t.SEP;if(this.currRuleLookaheadFuncs[s].call(this)===!0){n.call(this);const a=c(()=>this.tokenMatcher(this.LA_FAST(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA_FAST(1),i)===!0;)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,a,n,ys],a,Dt,e,ys)}}repetitionSepSecondInternal(e,t,s,n,i){for(;s();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,s,n,i],s,Qe,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const s=256|t,n=Array.isArray(e)?e:e.DEF,i=this.currRuleLookaheadFuncs[s].call(this,n);if(i!==void 0)return n[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName]),this.cstFinallyStateUpdate()}subruleInternal(e,t,s){let n;try{const i=s!==void 0?s.ARGS:void 0;return this.subruleIdx=t,n=e.coreRule.apply(this,i),this.cstPostNonTerminal(n,s!==void 0&&s.LABEL!==void 0?s.LABEL:e.ruleName),n}catch(i){throw this.subruleInternalError(i,s,e.ruleName)}}subruleInternalError(e,t,s){throw ut(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:s),delete e.partialCstResult),e}consumeInternal(e,t,s){let n;try{const i=this.LA_FAST(1);this.tokenMatcher(i,e)===!0?(this.consumeToken(),n=i):this.consumeInternalError(e,i,s)}catch(i){n=this.consumeInternalRecovery(e,t,i)}return this.cstPostTerminal(s!==void 0&&s.LABEL!==void 0?s.LABEL:e.name,n),n}consumeInternalError(e,t,s){let n;const i=this.LA(0);throw s!==void 0&&s.ERR_MSG?n=s.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new dn(n,t,i))}consumeInternalRecovery(e,t,s){if(this.recoveryEnabled&&s.name==="MismatchedTokenException"&&!this.isBackTracking()){const n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(i){throw i.name==="InRuleRecoveryException"?s:i}}else throw s}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let s=0;s<t.length;s++)this.RULE_STACK[s]=t[s];this.RULE_STACK_IDX=t.length-1,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName])}ruleInvocationStateUpdate(e,t,s){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=s,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[e],this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),ce)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=-1,this.currRuleLookaheadFuncs=[],this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let t=0;t<this.maxLookahead+1;t++)this.tokVector.push(Le)}onAfterParse(e){if(this.isAtEndOfInput()===!1){const t=this.LA(1),s=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new or(s,t))}for(;this.tokVector.at(-1)===Le;)this.tokVector.pop()}},Cr=class{static{c(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:he.errorMessageProvider}SAVE_ERROR(e){if(ut(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,s){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Yt(e,i,t,this.maxLookahead)[0],o=[];for(let r=1;r<=this.maxLookahead;r++)o.push(this.LA(r));const l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:o,previous:this.LA(0),customUserDescription:s,ruleName:n});throw this.SAVE_ERROR(new lr(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const s=this.getCurrRuleFullName(),n=this.getGAstProductions()[s],i=Xt(e,n,this.maxLookahead),a=[];for(let r=1;r<=this.maxLookahead;r++)a.push(this.LA(r));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new rr(l,this.LA(1),o))}},gt={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(gt);var Ns=!0,br=255,pn=E({name:"RECORDING_PHASE_TOKEN",pattern:F.NA});Ke([pn]);var mn=Vt(pn,`This IToken indicates the Parser is in Recording Phase
|
|
90
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(mn);var _r={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
91
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},wr=class{static{c(this,"GastRecorder")}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++){const t=e>0?e:"";this[`CONSUME${t}`]=function(s,n){return this.consumeInternalRecord(s,e,n)},this[`SUBRULE${t}`]=function(s,n){return this.subruleInternalRecord(s,e,n)},this[`OPTION${t}`]=function(s){return this.optionInternalRecord(s,e)},this[`OR${t}`]=function(s){return this.orInternalRecord(s,e)},this[`MANY${t}`]=function(s){this.manyInternalRecord(e,s)},this[`MANY_SEP${t}`]=function(s){this.manySepFirstInternalRecord(e,s)},this[`AT_LEAST_ONE${t}`]=function(s){this.atLeastOneInternalRecord(e,s)},this[`AT_LEAST_ONE_SEP${t}`]=function(s){this.atLeastOneSepFirstInternalRecord(e,s)}}this.consume=function(e,t,s){return this.consumeInternalRecord(t,e,s)},this.subrule=function(e,t,s){return this.subruleInternalRecord(t,e,s)},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",()=>{const e=this;for(let t=0;t<10;t++){const s=t>0?t:"";delete e[`CONSUME${s}`],delete e[`SUBRULE${s}`],delete e[`OPTION${s}`],delete e[`OR${s}`],delete e[`MANY${s}`],delete e[`MANY_SEP${s}`],delete e[`AT_LEAST_ONE${s}`],delete e[`AT_LEAST_ONE_SEP${s}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Le}topLevelRuleRecord(e,t){try{const s=new Ie({definition:[],name:e});return s.name=e,this.recordingProdStack.push(s),t.call(this),this.recordingProdStack.pop(),s}catch(s){if(s.KNOWN_RECORDER_ERROR!==!0)try{s.message=s.message+`
|
|
92
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
93
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw s}throw s}}optionInternalRecord(e,t){return we.call(this,G,e,t)}atLeastOneInternalRecord(e,t){we.call(this,se,t,e)}atLeastOneSepFirstInternalRecord(e,t){we.call(this,ne,t,e,Ns)}manyInternalRecord(e,t){we.call(this,M,t,e)}manySepFirstInternalRecord(e,t){we.call(this,q,t,e,Ns)}orInternalRecord(e,t){return Mr.call(this,e,t)}subruleInternalRecord(e,t,s){if(dt(t),!e||!Object.hasOwn(e,"ruleName")){const o=new Error(`<SUBRULE${ks(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
94
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const n=this.recordingProdStack.at(-1),i=e.ruleName,a=new K({idx:t,nonTerminalName:i,label:s?.LABEL,referencedRule:void 0});return n.definition.push(a),this.outputCst?_r:gt}consumeInternalRecord(e,t,s){if(dt(t),!Js(e)){const a=new Error(`<CONSUME${ks(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
95
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const n=this.recordingProdStack.at(-1),i=new k({idx:t,terminalType:e,label:s?.LABEL});return n.definition.push(i),mn}};function we(e,t,s,n=!1){dt(s);const i=this.recordingProdStack.at(-1),a=typeof t=="function"?t:t.DEF,o=new e({definition:[],idx:s});return n&&(o.separator=t.SEP),Object.hasOwn(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),gt}c(we,"recordProd");function Mr(e,t){dt(t);const s=this.recordingProdStack.at(-1),n=Array.isArray(e)===!1,i=n===!1?e:e.DEF,a=new Z({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});return Object.hasOwn(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),a.hasPredicates=i.some(o=>typeof o.GATE=="function"),s.definition.push(a),i.forEach(o=>{const l=new W({definition:[]});a.definition.push(l),Object.hasOwn(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Object.hasOwn(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),gt}c(Mr,"recordOrProd");function ks(e){return e===0?"":`${e}`}c(ks,"getIdxSuffix");function dt(e){if(e<0||e>br){const t=new Error(`Invalid DSL Method idx value: <${e}>
|
|
96
|
+
Idx value must be a none negative value smaller than 256`);throw t.KNOWN_RECORDER_ERROR=!0,t}}c(dt,"assertMethodIdxIsValid");var xr=class{static{c(this,"PerformanceTracer")}initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,s=typeof t=="number";this.traceInitMaxIdent=s?t:1/0,this.traceInitPerf=s?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=he.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent;const{time:n,value:i}=$s(t),a=n>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${s}<-- <${e}> time: ${n}ms`),this.traceInitIndent--,i}else return t()}};function Ur(e,t){t.forEach(s=>{const n=s.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(e.prototype,i,a):e.prototype[i]=s.prototype[i]})})}c(Ur,"applyMixins");var Le=Vt(ce,"",-1,-1,-1,-1,-1,-1);Object.freeze(Le);var he=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Qs,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ft=Object.freeze({recoveryValueFunc:c(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),$;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})($||($={}));var qt=class En{static{c(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;const s=this.className;this.TRACE_INIT("toFastProps",()=>{js(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=ir({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(n.length===0&&this.skipValidations===!1){const i=ar({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:Ee,grammarName:s}),a=Wa({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:s});this.definitionErrors=this.definitionErrors.concat(i,a)}}),this.definitionErrors.length===0&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Pi(Object.values(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!En.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw t=this.definitionErrors.map(i=>i.message),new Error(`Parser Definition Errors detected:
|
|
97
|
+
${t.join(`
|
|
98
|
+
-------------------------------
|
|
99
|
+
`)}`)})}constructor(t,s){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(s),n.initLexerAdapter(),n.initLooksAhead(s),n.initRecognizerEngine(t,s),n.initRecoverable(s),n.initTreeBuilder(s),n.initGastRecorder(s),n.initPerformanceTracer(s),Object.hasOwn(s,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
100
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
101
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
102
|
+
For further details.`);this.skipValidations=Object.hasOwn(s,"skipValidations")?s.skipValidations:he.skipValidations}};qt.DEFER_DEFINITION_ERRORS_HANDLING=!1;Ur(qt,[ur,pr,Ir,Nr,vr,kr,Cr,wr,xr]);var Pr=class extends qt{static{c(this,"CstParser")}constructor(e,t=he){const s=Object.assign({},t);s.outputCst=!0,super(e,s)}},Oe=h(e=>e!==void 0&&e>=0,"isKnownLocation");function Tn(e,t){const s=e.lexer.tokenize(t);if(s.errors.length>0){const i=s.errors[0],a=Oe(i.offset)?i.offset:t.length,o=a+(Oe(i.length)?i.length:0);throw new Error(`Error lexing ${e.diagramType} diagram: ${i.message} at line ${i.line??1}, column ${i.column??1} [${a},${o})`)}e.parser.input=s.tokens;const n=e.entry();if(e.parser.errors.length>0)throw new Error(`Error parsing ${e.diagramType} diagram: ${e.parser.errors[0].message}`);e.visit(n)}c(Tn,"runChevrotainParse");h(Tn,"runChevrotainParse");var N={SOLID_ARROW:0,BACK_ARROW:1,LINE_SOLID:2,CIRCLE_ARROW:3,CROSS_ARROW:4,CIRCLE_ARROW_REVERSED:5,CROSS_ARROW_REVERSED:6},Dr="LR",Fr=pi.usecase,Zt=h(()=>({actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,symbols:new Map,direction:Dr,relationshipCounter:0,noteCounter:0,accTitle:"",accDescription:"",ast:void 0,config:structuredClone(Fr)}),"createModel"),Br=h(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||typeof e.accTitle!="string"||typeof e.accDescription!="string"||!e.config)throw new Error("Cannot commit an incomplete usecase model")},"assertCompleteModel"),I=Zt(),$r=h(()=>structuredClone(I.config),"getConfig"),jr=h(()=>I.ast,"getAST"),Gr=h(e=>{const t=structuredClone(e);Br(t);const s=Bs(),n=Ds();try{_t(t.accTitle),bt(t.accDescription),I=t}catch(i){throw _t(s),bt(n),i}},"commit"),Wr=h(()=>{I=Zt(),fi()},"clear"),Kr=h(()=>I.actors,"getActors"),zr=h(e=>I.actors.get(e),"getActor"),Hr=h(()=>I.useCases,"getUseCases"),Vr=h(e=>I.useCases.get(e),"getUseCase"),Xr=h(()=>I.systemBoundaries,"getSystemBoundaries"),Yr=h(e=>I.systemBoundaries.get(e),"getSystemBoundary"),Jr=h(()=>I.relationships,"getRelationships"),qr=h(()=>I.notes,"getNotes"),Zr=h(e=>I.notes.get(e),"getNote"),Qr=h(()=>I.jsonNodes,"getJsonNodes"),eo=h(e=>I.jsonNodes.get(e),"getJsonNode"),to=h(()=>I.classDefs,"getClassDefs"),so=h(e=>I.classDefs.get(e),"getClassDef"),vs=h(()=>I.direction,"getDirection"),pe=h(e=>{const t=new Map;for(const s of["default",...e]){const n=I.classDefs.get(s);if(n)for(const i of n.styles){const a=i.trim(),o=a.indexOf(":"),l=(o===-1?a:a.slice(0,o)).trim();l&&t.set(l,a)}}return[...t.values()]},"getCompiledStyles"),no=h(e=>e.replaceAll("~","~0").replaceAll("/","~1"),"escapeJsonPointerPart"),Cs=h(e=>typeof e=="string"?e:e===null?"null":String(e),"displayJsonScalar"),io=h((e,t,s=n=>n)=>{const n=[],i=h((o,l,r)=>{n.push({key:s(o),accessibleKey:s(l),value:s(r)})},"append"),a=h((o,l,r)=>{if(Array.isArray(o)){if(o.length===0){i(l,l,"[]");return}if(o.every(u=>u===null||["string","number","boolean"].includes(typeof u))){for(const[u,d]of o.entries())i(u===0?l:"",l,Cs(d));return}for(const[u,d]of o.entries())a(d,`${l}[${u}]`,`${r}/${u}`);return}if(o!==null&&typeof o=="object"){const u=o,d=t[r]??Object.keys(u);if(d.length===0){i(l,l,"{}");return}for(const p of d){const m=l?`${l}.${p}`:p;a(u[p],m,`${r}/${no(p)}`)}return}i(l,l,Cs(o))},"visit");return a(e,"",""),n},"flattenJsonRows"),ao=h(e=>{switch(e.type){case"hollow":return"usecaseActorHollow";case"awesome":return"usecaseActorAwesome";case"icon":return"usecaseActorIcon";case"normal":return"usecaseActor"}},"actorShape"),ro=h(e=>e.shape==="ellipse"?e.business?"usecaseBusiness":"usecaseEllipse":e.shape,"useCaseShape"),oo=h(e=>{switch(e){case N.SOLID_ARROW:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_point"};case N.BACK_ARROW:return{arrowTypeStart:"arrow_point",arrowTypeEnd:"none"};case N.CIRCLE_ARROW:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_circle"};case N.CROSS_ARROW:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_cross"};case N.CIRCLE_ARROW_REVERSED:return{arrowTypeStart:"arrow_circle",arrowTypeEnd:"none"};case N.CROSS_ARROW_REVERSED:return{arrowTypeStart:"arrow_cross",arrowTypeEnd:"none"};case N.LINE_SOLID:return{arrowTypeStart:"none",arrowTypeEnd:"none"}}},"associationMarkers"),lo=h(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{...oo(e.arrowType),pattern:"solid",...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},"relationshipVisuals"),co=h(e=>e.animate||e.animation?[`edge-animation-${e.animation??"fast"}`]:[],"animationClasses"),Me=h((...e)=>e.filter(t=>!!t).join(" "),"classNames"),pt={getConfig:$r,createModel:Zt,commit:Gr,getAST:jr,clear:Wr,setDiagramTitle:mi,getDiagramTitle:di,setAccTitle:_t,getAccTitle:Bs,setAccDescription:bt,getAccDescription:Ds,getActors:Kr,getActor:zr,getUseCases:Hr,getUseCase:Vr,getSystemBoundaries:Xr,getSystemBoundary:Yr,getRelationships:Jr,getNotes:qr,getNote:Zr,getJsonNodes:Qr,getJsonNode:eo,getClassDefs:to,getClassDef:so,getDirection:vs,getData:h(()=>{const e=Fs(),t={...I.config,...e.usecase},s=h(r=>Ti(r,e),"sanitize"),n=h(r=>s(I.actors.get(r)?.label??I.useCases.get(r)?.label??I.jsonNodes.get(r)?.id??I.notes.get(r)?.label??r),"endpointLabel"),i=[],a=[];let o=0,l=0;for(const r of I.actors.values())i.push({id:r.id,label:s(r.label),labelType:r.labelType,shape:ao(r),isGroup:!1,padding:10,look:e.look,colorIndex:o++,cssClasses:Me("default","usecase-actor",`usecase-actor-${r.type}`,r.business&&"usecase-business",...r.classes),cssStyles:[...r.styles],cssCompiledStyles:pe(r.classes),actorType:r.type,business:r.business,...r.icon?{icon:r.icon}:{},...r.stereotype?{stereotype:s(r.stereotype)}:{},...r.parentId?{parentId:r.parentId}:{}});for(const r of I.useCases.values())i.push({id:r.id,label:s(r.label),labelType:r.labelType,shape:ro(r),isGroup:!1,padding:r.shape==="ellipse"?20:10,look:e.look,colorIndex:o++,cssClasses:Me("default","usecase-element",`usecase-${r.shape}`,r.business&&"usecase-business",...r.classes),cssStyles:[...r.styles],cssCompiledStyles:pe(r.classes),business:r.business,...r.stereotype?{stereotype:s(r.stereotype)}:{},...r.parentId?{parentId:r.parentId}:{}});for(const r of I.notes.values())i.push({id:r.id,label:s(r.label),labelType:r.labelType,shape:"note",isGroup:!1,padding:10,look:e.look,cssClasses:"default usecase-note",cssStyles:[],cssCompiledStyles:pe([]),noteTarget:r.target,noteTargetLabel:s(I.actors.get(r.target)?.label??I.useCases.get(r.target)?.label??I.jsonNodes.get(r.target)?.id??r.target)});for(const r of I.jsonNodes.values())i.push({id:r.id,label:s(r.id),labelType:"text",shape:"usecaseJsonTable",isGroup:!1,padding:10,look:e.look,cssClasses:Me("default","usecase-json-table",...r.classes),cssStyles:[...r.styles],cssCompiledStyles:pe(r.classes),jsonRows:io(r.value,r.propertyOrder,s)});for(const r of I.systemBoundaries.values())i.push({id:r.id,label:s(r.label),labelType:r.labelType,shape:"usecaseSystemBoundary",isGroup:!0,padding:20,look:e.look,colorIndex:l++,cssClasses:Me("default","system-boundary",`system-boundary-${r.type}`,...r.classes),cssStyles:[...r.styles],cssCompiledStyles:pe(r.classes),boundaryType:r.type});for(const r of I.relationships){const{label:u,...d}=lo(r);a.push({id:r.id,start:r.source,end:r.target,source:r.source,target:r.target,sourceLabel:n(r.source),targetLabel:n(r.target),type:"edge",relationshipType:r.type,internal:!1,...d,...u!==void 0?{label:s(u)}:{},labelpos:"c",classes:Me("default","relationship",`relationship-${r.type}`,...r.classes,...co(r)),style:[...r.styles],cssCompiledStyles:pe(r.classes),animate:r.animate,...r.animation?{animation:r.animation}:{},look:e.look,thickness:"normal",minlen:r.minlen,isUserDefinedId:r.explicitId})}for(const r of I.notes.values())a.push({id:`${r.id}-edge`,start:r.id,end:r.target,source:r.id,target:r.target,type:"edge",relationshipType:"note",sourceLabel:n(r.id),targetLabel:n(r.target),internal:!0,pattern:"dotted",arrowTypeStart:"none",arrowTypeEnd:"none",labelpos:"c",classes:"default relationship relationship-note",style:[],cssCompiledStyles:pe([]),animate:!1,look:e.look,thickness:"normal",minlen:1,isUserDefinedId:!1});for(const r of i)r.wrappingWidth??=t.wrappingWidth,!r.isGroup&&!r.shape.startsWith("usecaseActor")&&(r.minWidth??=t.minNodeWidth),(r.shape==="usecaseEllipse"||r.shape==="usecaseBusiness")&&(r.spreadPorts=!0);return{nodes:i,edges:a,config:e,type:"usecase",layoutAlgorithm:"dagre",direction:vs(),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")};function ge(e,t,s){const n=[s];return n.index=t,n.input=e,n}c(ge,"customMatch");h(ge,"customMatch");var ho=h((e,t)=>{if(e[t]!=='"'||e[t+1]!=="`")return null;for(let s=t+2;s<e.length-1;s++)if(e[s]==="`"&&e[s+1]==='"')return ge(e,t,e.slice(t,s+2));return null},"matchMarkdownString"),uo=h((e,t)=>{if(e[t]!=="%"||e[t+1]!=="%")return null;for(let n=t-1;n>=0;n--){const i=e[n];if(i===`
|
|
103
|
+
`||i==="\r")break;if(i!==" "&&i!==" ")return null}let s=t+2;for(;s<e.length&&e[s]!==`
|
|
104
|
+
`&&e[s]!=="\r";)s++;return ge(e,t,e.slice(t,s))},"matchComment"),gn=h((e,t)=>{for(let s=t-1;s>=0;s--){const n=e[s];if(n===`
|
|
105
|
+
`||n==="\r")return!0;if(n!==" "&&n!==" ")return!1}return!0},"isIndentedLineStart"),An=h((e,t,s)=>{if(!gn(e,t))return null;const n=s.exec(e.slice(t));return n?ge(e,t,n[0]):null},"matchAccessibilityLine"),fo=h((e,t)=>{if(!gn(e,t))return null;const s=/^accDescr[\t ]*{/.exec(e.slice(t));if(!s)return null;const n=e.indexOf("}",t+s[0].length);return n===-1?null:ge(e,t,e.slice(t,n+1))},"matchAccDescrBlock"),po=h((e,t)=>{if(e[t]!=="{")return null;let s=0,n=!1,i=!1;for(let a=t;a<e.length;a++){const o=e[a];if(n){i?i=!1:o==="\\"?i=!0:o==='"'&&(n=!1);continue}if(o==='"')n=!0;else if(o==="{")s++;else if(o==="}"&&--s===0)return ge(e,t,e.slice(t,a+1))}return null},"matchJsonObject"),mo=h((e,t)=>{const s=e.indexOf(">>",t);if(s===-1||/[\n\r]/.test(e.slice(t,s)))return null;const n=e.slice(t,s);return n.trim()?ge(e,t,n):null},"matchStereotypeText"),x=E({name:"LABEL_TEXT",pattern:F.NA}),Re=E({name:"WORD",pattern:F.NA,categories:x}),Qt=E({name:"NUMBER",pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:x}),v=E({name:"IDENTIFIER",pattern:/\w+/,longer_alt:Qt,categories:Re}),Eo=E({name:"HWS",pattern:/[\t ]+/,group:F.SKIPPED}),le=E({name:"MARKDOWN_STRING",pattern:ho,start_chars_hint:['"'],line_breaks:!0}),To=E({name:"UNCLOSED_MARKDOWN_STRING",pattern:/"`[^]*/,line_breaks:!0}),Bt=E({name:"COMMENT",pattern:uo,start_chars_hint:["%"],line_breaks:!1}),oe=E({name:"NEWLINE",pattern:/\r\n|\n|\r/,line_breaks:!0}),Sn=E({name:"ACC_DESCR_BLOCK",pattern:fo,start_chars_hint:["a"],line_breaks:!0}),go=/^accTitle[\t ]*:[^\n\r]*/,Ao=/^accDescr[\t ]*:[^\n\r]*/,yn=E({name:"ACC_TITLE_LINE",pattern:h((e,t)=>An(e,t,go),"pattern"),start_chars_hint:["a"],line_breaks:!1}),On=E({name:"ACC_DESCR_LINE",pattern:h((e,t)=>An(e,t,Ao),"pattern"),start_chars_hint:["a"],line_breaks:!1}),Rn=E({name:"JSON_DECLARATION_START",pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:"jsonBody"}),es=E({name:"JSON_OBJECT_LITERAL",pattern:po,start_chars_hint:["{"],line_breaks:!0,pop_mode:!0}),Ln=E({name:"UNCLOSED_JSON_OBJECT_LITERAL",pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),_=h((e,t)=>E({name:e,pattern:t,longer_alt:v,categories:Re}),"keyword"),In=_("USECASE",/usecase-beta/),$t=_("ACTOR",/actor/),Nn=_("SYSTEM_BOUNDARY",/systemBoundary/),kn=_("END",/end/),vn=_("DIRECTION",/direction/),Cn=_("TD",/TD/),bn=_("TB",/TB/),_n=_("BT",/BT/),wn=_("LR",/LR/),Mn=_("RL",/RL/),xn=_("NOTE",/note/),Un=_("FOR",/for/),So=_("JSON",/json/),Pn=_("CLASS_DEF",/classDef/),Dn=_("CLASS",/class/),Fn=_("STYLE",/style/),Bn=_("INCLUDE",/include/i),$n=_("EXTEND",/extend/i),jn=_("TRUE",/true/),Gn=_("FALSE",/false/),Wn=E({name:"GENERALIZATION",pattern:/--\|>/}),Kn=E({name:"DEPENDENCY_ARROW",pattern:/\.\.>/}),zn=E({name:"STEREOTYPE_START",pattern:/<</,push_mode:"stereotype"}),ts=E({name:"STEREOTYPE_END",pattern:/>>/,pop_mode:!0}),ss=E({name:"STEREOTYPE_TEXT",pattern:mo,line_breaks:!1}),Hn=E({name:"UNCLOSED_STEREOTYPE_TEXT",pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),Vn=E({name:"CLASS_SEPARATOR",pattern:/:::/}),et=E({name:"FORWARD_SOLID",pattern:/--+>/}),Xn=E({name:"BACKWARD_SOLID",pattern:/<--+/}),tt=E({name:"FORWARD_CIRCLE",pattern:/--o/}),Yn=E({name:"BACKWARD_CIRCLE",pattern:/o--/}),st=E({name:"FORWARD_CROSS",pattern:/--x/}),Jn=E({name:"BACKWARD_CROSS",pattern:/x--/}),X=E({name:"MARKERLESS_SOLID",pattern:/--+/}),jt=E({name:"METADATA_START",pattern:/@{/}),nt=E({name:"AT",pattern:/@/,categories:x}),qn=E({name:"LBRACE",pattern:/{/}),Gt=E({name:"RBRACE",pattern:/}/}),it=E({name:"LBRACKET",pattern:/\[/}),at=E({name:"RBRACKET",pattern:/]/}),Pe=E({name:"LPAREN",pattern:/\(/}),De=E({name:"RPAREN",pattern:/\)/}),J=E({name:"COMMA",pattern:/,/,categories:x}),Fe=E({name:"COLON",pattern:/:/,categories:x}),Zn=E({name:"HASH_COLOR",pattern:/#[\dA-Fa-f]+/,categories:x}),Y=E({name:"PLAIN_STRING",pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),Wt=E({name:"CSS_IDENTIFIER",pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:x}),Qn=E({name:"CSS_ESCAPED_COMMA",pattern:/\\,/,categories:x}),ei=E({name:"DASH",pattern:/-/,categories:x}),ti=E({name:"DOT",pattern:/\./,categories:x}),si=E({name:"PERCENT",pattern:/%/,categories:x}),ni=E({name:"CSS_PUNCTUATION",pattern:/[!#$&*+/=?^_|~]/,categories:x}),ii=[x,Re,Eo,le,To,Bt,oe,Sn,yn,On,Rn,In,$t,Nn,kn,vn,Cn,bn,_n,wn,Mn,xn,Un,So,Pn,Dn,Fn,Bn,$n,jn,Gn,Wn,Kn,zn,Vn,et,Xn,tt,Yn,st,Jn,X,jt,nt,qn,Gt,it,at,Pe,De,J,Fe,Zn,Y,Wt,v,Qt,Qn,ei,ti,si,ni,E({name:"LABEL_PUNCTUATION",pattern:/[;<>\\`]/,categories:x}),E({name:"LABEL_SYMBOL",pattern:/[^\t\n\r !-~]+/,categories:x})],yo={defaultMode:"defaultMode",modes:{defaultMode:[...ii],jsonBody:[es,Ln],stereotype:[ts,ss,Hn]}},Oo=[...ii,es,Ln,ts,ss,Hn],Ro=new F(yo),bs=h(e=>Zs(e,x)||e.tokenType===Y||e.tokenType===le,"isLabelToken"),Lo={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},Io=class extends Pr{static{c(this,"UsecaseParser")}static{h(this,"UsecaseParser")}constructor(){super(Oo,{nodeLocationTracking:"full"}),this.RULE("start",()=>{this.CONSUME(In),this.SUBRULE(this.lineEnd),this.MANY(()=>this.SUBRULE(this.line))}),this.RULE("line",()=>{this.OR([{ALT:h(()=>this.SUBRULE(this.blankLine),"ALT")},{ALT:h(()=>this.SUBRULE(this.commentLine),"ALT")},{GATE:h(()=>this.isStatementStart(),"GATE"),ALT:h(()=>this.SUBRULE(this.statement),"ALT")}])}),this.RULE("statement",()=>{this.OR([{ALT:h(()=>this.SUBRULE(this.accTitleStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.accDescrStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.directionStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.actorStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.systemBoundaryStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.noteStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.jsonStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.classDefStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.classStatement),"ALT")},{ALT:h(()=>this.SUBRULE(this.styleStatement),"ALT")},{GATE:h(()=>this.isMetadataAssignment(),"GATE"),ALT:h(()=>this.SUBRULE(this.metadataAssignmentStatement),"ALT")},{GATE:h(()=>!this.isForbiddenPlantUmlStatement(),"GATE"),ALT:h(()=>this.SUBRULE(this.entityStatement),"ALT")}])}),this.RULE("lineEnd",()=>{this.OR([{ALT:h(()=>this.CONSUME(oe),"ALT")},{ALT:h(()=>this.CONSUME(ce),"ALT")}])}),this.RULE("blankLine",()=>{this.CONSUME(oe)}),this.RULE("commentLine",()=>{this.CONSUME(Bt),this.SUBRULE(this.lineEnd)}),this.RULE("accTitleStatement",()=>{this.CONSUME(yn),this.SUBRULE(this.lineEnd)}),this.RULE("accDescrStatement",()=>{this.OR([{ALT:h(()=>this.CONSUME(On),"ALT")},{ALT:h(()=>this.CONSUME(Sn),"ALT")}]),this.SUBRULE(this.lineEnd)}),this.RULE("actorStatement",()=>{this.CONSUME($t),this.SUBRULE(this.actorItem),this.OPTION(()=>{this.OR([{ALT:h(()=>this.AT_LEAST_ONE(()=>{this.CONSUME(J),this.SUBRULE2(this.actorItem)}),"ALT")},{ALT:h(()=>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:h(()=>{this.CONSUME(v),this.OPTION(()=>{this.CONSUME(Pe),this.SUBRULE(this.nodeLabel),this.CONSUME(De)})},"ALT")},{ALT:h(()=>this.CONSUME(Y),"ALT")},{ALT:h(()=>this.CONSUME(le),"ALT")}])}),this.RULE("actorDeclarationOnly",()=>{this.CONSUME($t),this.SUBRULE(this.actorItem),this.MANY(()=>{this.CONSUME(J),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:h(()=>{this.CONSUME(v),this.OPTION(()=>{this.OR2([{ALT:h(()=>{this.CONSUME(Pe),this.SUBRULE(this.nodeLabel),this.CONSUME(De)},"ALT")},{ALT:h(()=>{this.CONSUME(it),this.SUBRULE2(this.nodeLabel),this.CONSUME(at)},"ALT")}])})},"ALT")},{ALT:h(()=>this.CONSUME(Y),"ALT")},{ALT:h(()=>this.CONSUME(le),"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:h(()=>this.CONSUME(Y),"ALT")},{ALT:h(()=>this.CONSUME(le),"ALT")},{ALT:h(()=>this.AT_LEAST_ONE(()=>this.CONSUME(x)),"ALT")}])}),this.RULE("useCaseMetadata",()=>{this.SUBRULE(this.metadata)}),this.RULE("relationTail",()=>{this.OPTION({GATE:h(()=>this.LA(1).tokenType===v&&this.LA(2).tokenType===nt,"GATE"),DEF:h(()=>{this.CONSUME(v),this.CONSUME(nt)},"DEF")}),this.SUBRULE(this.arrow),this.SUBRULE(this.entityName)}),this.RULE("arrow",()=>{this.OR([{ALT:h(()=>this.SUBRULE(this.semanticRelation),"ALT")},{ALT:h(()=>this.SUBRULE(this.forwardSolidOperator),"ALT")},{ALT:h(()=>this.SUBRULE(this.backwardSolidOperator),"ALT")},{ALT:h(()=>this.SUBRULE(this.markerlessSolidOperator),"ALT")},{ALT:h(()=>this.SUBRULE(this.forwardCircleOperator),"ALT")},{ALT:h(()=>this.SUBRULE(this.backwardCircleOperator),"ALT")},{ALT:h(()=>this.SUBRULE(this.forwardCrossOperator),"ALT")},{ALT:h(()=>this.SUBRULE(this.backwardCrossOperator),"ALT")}])}),this.RULE("forwardSolidOperator",()=>{this.CONSUME(et)}),this.RULE("backwardSolidOperator",()=>{this.CONSUME(Xn),this.OPTION({GATE:h(()=>this.LA(0).image==="<--"&&this.hasLabeledRight([X]),"GATE"),DEF:h(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(X)},"DEF")})}),this.RULE("markerlessSolidOperator",()=>{this.CONSUME(X),this.OPTION({GATE:h(()=>this.LA(0).image==="--"&&this.hasLabeledRight([et,X,tt,st]),"GATE"),DEF:h(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:h(()=>this.CONSUME(et),"ALT")},{ALT:h(()=>this.CONSUME2(X),"ALT")},{ALT:h(()=>this.CONSUME(tt),"ALT")},{ALT:h(()=>this.CONSUME(st),"ALT")}])},"DEF")})}),this.RULE("forwardCircleOperator",()=>{this.CONSUME(tt)}),this.RULE("backwardCircleOperator",()=>{this.CONSUME(Yn),this.OPTION({GATE:h(()=>this.hasLabeledRight([X]),"GATE"),DEF:h(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(X)},"DEF")})}),this.RULE("forwardCrossOperator",()=>{this.CONSUME(st)}),this.RULE("backwardCrossOperator",()=>{this.CONSUME(Jn),this.OPTION({GATE:h(()=>this.hasLabeledRight([X]),"GATE"),DEF:h(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(X)},"DEF")})}),this.RULE("edgeLabel",()=>{this.OR([{ALT:h(()=>this.CONSUME(Y),"ALT")},{ALT:h(()=>this.CONSUME(le),"ALT")},{ALT:h(()=>this.AT_LEAST_ONE(()=>this.CONSUME(x)),"ALT")}])}),this.RULE("semanticRelation",()=>{this.OR([{ALT:h(()=>{this.CONSUME(Kn),this.CONSUME(Fe),this.OR2([{ALT:h(()=>this.CONSUME(Bn),"ALT")},{ALT:h(()=>this.CONSUME($n),"ALT")}])},"ALT")},{ALT:h(()=>this.CONSUME(Wn),"ALT")}])}),this.RULE("metadata",()=>{this.CONSUME(jt),this.MANY(()=>this.CONSUME(oe)),this.OPTION(()=>{this.SUBRULE(this.metadataProperty),this.MANY2(()=>{this.SUBRULE(this.metadataSeparator),this.SUBRULE2(this.metadataProperty)}),this.OPTION2(()=>this.CONSUME(J)),this.MANY3(()=>this.CONSUME2(oe))}),this.CONSUME(Gt)}),this.RULE("metadataProperty",()=>{this.OR([{ALT:h(()=>this.CONSUME(v),"ALT")},{ALT:h(()=>this.CONSUME(Y),"ALT")}]),this.CONSUME(Fe),this.OR2([{ALT:h(()=>this.CONSUME2(v),"ALT")},{ALT:h(()=>this.CONSUME2(Y),"ALT")},{ALT:h(()=>this.CONSUME(jn),"ALT")},{ALT:h(()=>this.CONSUME(Gn),"ALT")}])}),this.RULE("metadataSeparator",()=>{this.OR([{ALT:h(()=>{this.CONSUME(J),this.MANY(()=>this.CONSUME(oe))},"ALT")},{ALT:h(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(oe)),this.OPTION(()=>this.CONSUME2(J)),this.MANY2(()=>this.CONSUME3(oe))},"ALT")}])}),this.RULE("systemBoundaryStatement",()=>{this.CONSUME(Nn),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(kn),this.SUBRULE2(this.lineEnd)}),this.RULE("systemBoundaryName",()=>{this.OR([{ALT:h(()=>{this.CONSUME(v),this.OPTION(()=>{this.OR2([{ALT:h(()=>{this.CONSUME(Pe),this.SUBRULE(this.nodeLabel),this.CONSUME(De)},"ALT")},{ALT:h(()=>{this.CONSUME(it),this.SUBRULE2(this.nodeLabel),this.CONSUME(at)},"ALT")}])})},"ALT")},{ALT:h(()=>this.CONSUME(Y),"ALT")},{ALT:h(()=>this.CONSUME(le),"ALT")}])}),this.RULE("systemBoundaryContent",()=>{this.MANY(()=>{this.OR([{ALT:h(()=>this.SUBRULE(this.blankLine),"ALT")},{ALT:h(()=>this.SUBRULE(this.commentLine),"ALT")},{ALT:h(()=>this.SUBRULE(this.boundaryElement),"ALT")}])})}),this.RULE("boundaryElement",()=>{this.OR([{ALT:h(()=>this.SUBRULE(this.actorDeclarationOnly),"ALT")},{ALT:h(()=>{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:h(()=>this.CONSUME(v),"ALT")},{ALT:h(()=>this.CONSUME(Y),"ALT")},{ALT:h(()=>this.CONSUME(le),"ALT")}])}),this.RULE("noteStatement",()=>{this.CONSUME(xn),this.CONSUME(Un),this.CONSUME(v),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE("stereotype",()=>{this.CONSUME(zn),this.CONSUME(ss),this.CONSUME(ts)}),this.RULE("classSuffix",()=>{this.CONSUME(Vn),this.CONSUME(v),this.MANY(()=>{this.CONSUME(J),this.CONSUME2(v)})}),this.RULE("jsonStatement",()=>{this.CONSUME(Rn),this.CONSUME(es),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE("directionStatement",()=>{this.CONSUME(vn),this.OR([{ALT:h(()=>this.CONSUME(Cn),"ALT")},{ALT:h(()=>this.CONSUME(bn),"ALT")},{ALT:h(()=>this.CONSUME(_n),"ALT")},{ALT:h(()=>this.CONSUME(wn),"ALT")},{ALT:h(()=>this.CONSUME(Mn),"ALT")}]),this.SUBRULE(this.lineEnd)}),this.RULE("classDefStatement",()=>{this.CONSUME(Pn),this.CONSUME(v),this.MANY(()=>{this.CONSUME(J),this.CONSUME2(v)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE("classStatement",()=>{this.CONSUME(Dn),this.CONSUME(v),this.MANY(()=>{this.CONSUME(J),this.CONSUME2(v)}),this.CONSUME3(v),this.MANY2(()=>{this.CONSUME2(J),this.CONSUME4(v)}),this.SUBRULE(this.lineEnd)}),this.RULE("styleStatement",()=>{this.CONSUME(Fn),this.CONSUME(v),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE("styles",()=>{this.SUBRULE(this.styleValue),this.MANY(()=>{this.CONSUME(J),this.SUBRULE2(this.styleValue)})}),this.RULE("styleValue",()=>{this.OR([{ALT:h(()=>this.CONSUME(Re),"ALT")},{ALT:h(()=>this.CONSUME(Wt),"ALT")},{ALT:h(()=>{this.CONSUME(X),this.CONSUME2(Re)},"ALT")}]),this.CONSUME(Fe),this.AT_LEAST_ONE(()=>this.SUBRULE(this.styleComponent))}),this.RULE("styleComponent",()=>{this.OR([{ALT:h(()=>this.CONSUME(Re),"ALT")},{ALT:h(()=>this.CONSUME(Y),"ALT")},{ALT:h(()=>this.CONSUME(Qt),"ALT")},{ALT:h(()=>this.CONSUME(Zn),"ALT")},{ALT:h(()=>this.CONSUME(Wt),"ALT")},{ALT:h(()=>this.CONSUME(Qn),"ALT")},{ALT:h(()=>this.CONSUME(ei),"ALT")},{ALT:h(()=>this.CONSUME(ti),"ALT")},{ALT:h(()=>this.CONSUME(si),"ALT")},{ALT:h(()=>this.CONSUME(ni),"ALT")},{ALT:h(()=>this.CONSUME(Fe),"ALT")},{ALT:h(()=>this.CONSUME(Pe),"ALT")},{ALT:h(()=>this.CONSUME(De),"ALT")},{ALT:h(()=>this.CONSUME(it),"ALT")},{ALT:h(()=>this.CONSUME(at),"ALT")},{ALT:h(()=>this.CONSUME(qn),"ALT")},{ALT:h(()=>this.CONSUME(Gt),"ALT")},{ALT:h(()=>this.CONSUME(nt),"ALT")},{ALT:h(()=>this.CONSUME(X),"ALT")}])}),this.performSelfAnalysis()}isMetadataAssignment(){const e=this.LA(1).tokenType;return(e===v||e===Y||e===le)&&this.LA(2).tokenType===jt}isStatementStart(){const e=this.LA(1).tokenType;return e!==ce&&e!==oe&&e!==Bt}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===v&&Lo[this.LA(1).image.toLowerCase()]===!0}hasLabeledRight(e){if(!bs(this.LA(1)))return!1;for(let t=2;;t++){const s=this.LA(t);if(e.includes(s.tokenType))return!0;if(!bs(s))return!1}}},Be=new Io,_s=class extends Error{static{c(this,"UsecaseJsonError")}constructor(e,t,s){super(`${e} (line ${t}, column ${s})`),this.line=t,this.column=s,this.name="UsecaseJsonError"}static{h(this,"UsecaseJsonError")}},Kt=h((e,t,s,n)=>{let i=s,a=n;const o=Math.min(Math.max(t,0),e.length);for(let l=0;l<o;l++){const r=e[l];r==="\r"?(i++,a=1):r===`
|
|
106
|
+
`?(l===0||e[l-1]!=="\r")&&(i++,a=1):a++}return{line:i,column:a}},"locationAtOffset"),No=h((e,t,s,n)=>{const i=/\bposition (\d+)\b/u.exec(e);if(i)return Kt(t,Number.parseInt(i[1],10),s,n);const a=/\bline (\d+) column (\d+)\b/u.exec(e);if(a){const o=Number.parseInt(a[1],10),l=Number.parseInt(a[2],10);return{line:s+o-1,column:o===1?n+l-1:l}}if(/unexpected end|end of json input/iu.test(e))return Kt(t,t.length,s,n)},"locationFromErrorMessage"),P=class extends Error{static{c(this,"JsonWalkError")}constructor(e){super("Invalid JSON token"),this.offset=e}static{h(this,"JsonWalkError")}},ws=class{static{c(this,"PropertyOrderCollector")}constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{h(this,"PropertyOrderCollector")}collect(){if(this.skipWhitespace(),this.collectValue(""),this.skipWhitespace(),this.offset!==this.text.length)throw new P(this.offset);return this.propertyOrder}collectValue(e){this.skipWhitespace();const 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(t==="f")this.consumeLiteral("false");else if(t==="n")this.consumeLiteral("null");else if(t==="-"||t>="0"&&t<="9")this.consumeNumber();else throw new P(this.offset)}collectObject(e){this.offset++;const t=[],s=new Set;if(this.propertyOrder[e]=t,this.skipWhitespace(),this.text[this.offset]==="}"){this.offset++;return}for(;this.offset<this.text.length;){if(this.text[this.offset]!=='"')throw new P(this.offset);const n=this.readString(!0),i=`${e}/${n.replaceAll("~","~0").replaceAll("/","~1")}`;if(s.has(n)?this.deletePointerSubtree(i):(s.add(n),t.push(n)),this.skipWhitespace(),this.text[this.offset]!==":")throw new P(this.offset);if(this.offset++,this.collectValue(i),this.skipWhitespace(),this.text[this.offset]==="}"){this.offset++;return}if(this.text[this.offset]!==",")throw new P(this.offset);this.offset++,this.skipWhitespace()}throw new P(this.offset)}collectArray(e){if(this.offset++,this.skipWhitespace(),this.text[this.offset]==="]"){this.offset++;return}let t=0;for(;this.offset<this.text.length;){if(this.collectValue(`${e}/${t}`),t++,this.skipWhitespace(),this.text[this.offset]==="]"){this.offset++;return}if(this.text[this.offset]!==",")throw new P(this.offset);this.offset++,this.skipWhitespace()}throw new P(this.offset)}readString(e){this.offset++;let t="";for(;this.offset<this.text.length;){const s=this.offset,n=this.text[this.offset++];if(n==='"')return t;if(n.charCodeAt(0)<32)throw new P(s);if(n!=="\\"){e&&(t+=n);continue}const i=this.offset,a=this.text[this.offset++];switch(a){case'"':case"\\":case"/":e&&(t+=a);break;case"b":e&&(t+="\b");break;case"f":e&&(t+="\f");break;case"n":e&&(t+=`
|
|
107
|
+
`);break;case"r":e&&(t+="\r");break;case"t":e&&(t+=" ");break;case"u":{const o=this.text.slice(this.offset,this.offset+4);if(!/^[\dA-Fa-f]{4}$/u.test(o))throw new P(this.offset);e&&(t+=String.fromCharCode(Number.parseInt(o,16))),this.offset+=4;break}default:throw new P(i)}}throw new P(this.offset)}consumeLiteral(e){let t=0;for(const s of e){if(this.text[this.offset+t]!==s)throw new P(this.offset+t);t++}this.offset+=e.length}consumeNumber(){if(this.text[this.offset]==="-"&&this.offset++,this.text[this.offset]==="0")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 P(this.offset);if(this.text[this.offset]==="."){if(this.offset++,this.text[this.offset]<"0"||this.text[this.offset]>"9")throw new P(this.offset);for(;this.text[this.offset]>="0"&&this.text[this.offset]<="9";)this.offset++}if(this.text[this.offset]==="e"||this.text[this.offset]==="E"){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 P(this.offset);for(;this.text[this.offset]>="0"&&this.text[this.offset]<="9";)this.offset++}}skipWhitespace(){for(;this.offset<this.text.length;){const e=this.text[this.offset];if(e!==" "&&e!==" "&&e!==`
|
|
108
|
+
`&&e!=="\r")return;this.offset++}}deletePointerSubtree(e){const t=`${e}/`;for(const s of Object.keys(this.propertyOrder))(s===e||s.startsWith(t))&&delete this.propertyOrder[s]}};function ai(e,t,s){let n;try{n=JSON.parse(e)}catch(i){const a=i instanceof Error?i.message:String(i);let o=No(a,e,t,s);if(!o){let l=0;try{new ws(e).collect()}catch(r){r instanceof P&&(l=r.offset)}o=Kt(e,l,t,s)}throw new _s(`Invalid JSON: ${a}`,o.line,o.column)}if(typeof n!="object"||n===null||Array.isArray(n))throw new _s("JSON value must have an object root",t,s);return{value:n,propertyOrder:new ws(e).collect()}}c(ai,"parseOrderedJsonObject");h(ai,"parseOrderedJsonObject");var ko=h(e=>({shape:e.type==="normal"?"actor":e.type==="hollow"?"actor-hollow":e.type==="awesome"?"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"),vo=h(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"),Co=h(e=>({label:e.label,shape:"note",attrs:{kind:"note",target:e.target,labelType:e.labelType}}),"noteNode"),bo=h(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"),_o=h(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"),wo=h(e=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:"note",arrowType:N.LINE_SOLID,pattern:"dotted",minlen:1,explicitId:!1,animate:!1,internal:!0}}),"noteEdge"),Mo=h((e,t,s,n)=>{const i={};for(const r of e.getActors().values())i[r.id]=ko(r);for(const r of e.getUseCases().values())i[r.id]=vo(r);for(const r of e.getNotes().values())i[r.id]=Co(r);for(const r of e.getJsonNodes().values())i[r.id]=bo(r);const a={};for(const r of e.getSystemBoundaries().values())a[r.id]={...r.label===r.id?{}:{title:r.label},nodes:[...r.members],...r.classes.length?{classes:[...r.classes]}:{},...r.styles.length?{styles:[...r.styles]}:{},attrs:{kind:"systemBoundary",boundaryType:r.type,labelType:r.labelType}};const o={};for(const r of e.getClassDefs().values())o[r.id]={styles:[...r.styles]};const l=e.getDirection();return{version:1,diagramType:"usecase",source:t,header:{keyword:"usecase",direction:l==="TD"?"TB":l,span:s},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:i,edges:[...e.getRelationships().map(_o),...[...e.getNotes().values()].map(wo)],groups:a,classDefs:o,statements:n}},"buildUsecaseGraphAST"),D=h(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,"locationText"),Ms=h(e=>e===void 0?"":` (label "${e}")`,"labelSuffix"),me=h(e=>e.generated?e.label:void 0,"generatedFrom"),Ct=h((e,t)=>{for(const s of t)e.includes(s)||e.push(s)},"pushUnique"),xo=class{static{c(this,"UsecaseModelBuilder")}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{h(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,s,n){this.metadataAssignments.push({target:e,targetLocation:t,metadata:s,statement:n})}addClassDef(e,t){this.classDefinitions.push({ids:e,styles:t})}addClassAssignment(e,t){this.classAssignments.push({targets:e,classes:t})}addStyleAssignment(e,t,s){this.styleAssignments.push({target:e,location:t,styles:s})}setDirection(e){this.directions.push(e==="TD"?"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){const t=new Map,s=new Map,n=new Map,i=new Map;for(const r of this.relationshipDrafts)this.recordFirst(i,r.source.id,r.source.location.span[0]),this.recordFirst(i,r.target.id,r.target.location.span[0]);for(const r of this.elements)this.recordFirst(i,r.id,r.location.span[0]);for(const r of this.boundaries)this.recordFirst(i,r.id,r.location.span[0]);for(const r of this.jsonDrafts)this.recordFirst(i,r.id,r.location.span[0]);const a=[...this.elements.map(r=>({offset:r.location.span[0],type:"element",value:r})),...this.boundaries.map(r=>({offset:r.location.span[0],type:"boundary",value:r})),...this.jsonDrafts.map(r=>({offset:r.location.span[0],type:"json",value:r})),...this.relationshipDrafts.filter(r=>r.explicitId).map(r=>({offset:r.explicitIdLocation.span[0],type:"edge",value:r}))].sort((r,u)=>r.offset-u.offset);for(const r of a)r.type==="element"?this.collectElement(r.value,t,s):r.type==="boundary"?this.collectBoundary(r.value,t,n):r.type==="json"?this.registerUnique(t,r.value.id,"json",r.value.location,!1):this.registerUnique(t,r.value.explicitId,"edge",r.value.explicitIdLocation,!1);this.materializeElements(s,i),this.materializeBoundaries(n,i),this.materializeJson(i);const o=this.materializeRelationships(t,s,i);this.reorderElements(s,i),this.applyMetadataAssignments(t,s,n,o),this.validateAndRefreshElements(s),this.refreshBoundaries(n,s),this.materializeNotes(t),this.applyClassDefinitions(),this.applyClassesAndStyles(t,o),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...t].map(([r,u])=>[r,u.kind]));const l=Mo(this,this.source,e,this.statements);return this.model.ast=l,this.db.commit(this.model),l}collectElement(e,t,s){const n=t.get(e.id),i=me({generated:e.generated,label:e.label.text});n&&n.kind!==e.kind&&this.conflict(`ID '${e.id}' is declared as both ${n.kind} and ${e.kind}`,e.location,n.location,i,me(n)),n&&(n.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,n.location,i,me(n));const a=s.get(e.id);if(!a){const o={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(o,e.metadata),s.set(e.id,o),t.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text});return}(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`ID '${e.id}' has conflicting labels`,e.location,a.location),e.shape&&a.shape&&e.shape!==a.shape&&this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,a.location),e.parentId&&a.parentId&&e.parentId!==a.parentId&&this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,a.parentLocation??a.location),e.stereotype&&a.stereotype&&e.stereotype!==a.stereotype&&this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,a.stereotypeLocation??a.location),a.shape??=e.shape,a.parentId??=e.parentId,a.parentLocation??=e.parentLocation,a.stereotype??=e.stereotype,a.stereotypeLocation??=e.stereotype?e.location:void 0,Ct(a.classes,e.classes),this.applyDeclarationMetadata(a,e.metadata)}collectBoundary(e,t,s){const n=t.get(e.id),i=me({generated:e.generated,label:e.label.text});n&&n.kind!=="boundary"&&this.conflict(`ID '${e.id}' is declared as both ${n.kind} and boundary`,e.location,n.location,i,me(n)),n&&(n.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,n.location,i,me(n));const a=s.get(e.id);if(a){(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,a.location),Ct(a.classes,e.classes);return}s.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(const s of[...e.values()].sort((n,i)=>(t.get(n.id)??0)-(t.get(i.id)??0)))this.setElementModel(s)}materializeBoundaries(e,t){for(const s of[...e.values()].sort((n,i)=>(t.get(n.id)??0)-(t.get(i.id)??0)))this.model.systemBoundaries.set(s.id,{id:s.id,label:s.label.text,labelType:s.label.type,type:s.type??"rect",members:[],classes:[...s.classes],styles:[...s.styles]})}materializeJson(e){for(const t of[...this.jsonDrafts].sort((s,n)=>(e.get(s.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,s){const n=new Map;let i=0;for(const a of this.relationshipDrafts){const o=this.resolveEndpoint(a.source,e,t,s),l=this.resolveEndpoint(a.target,e,t,s);this.validateRelationship(a,o,l,e);const r=a.explicitId??`edge-${i++}`,u={id:r,explicitId:!!a.explicitId,source:a.source.id,target:a.target.id,type:a.type,arrowType:a.arrowType,...a.label?{label:a.label.text,labelType:a.label.type}:{},minlen:a.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(u),n.set(r,{draft:a,relationship:u})}return this.model.relationshipCounter=i,n}resolveEndpoint(e,t,s,n){if(e.classesOnReference&&!e.declaration)throw new Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${D(e.location)}`);const i=t.get(e.id);return i?i.kind:(s.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(n,e.id,e.location.span[0]),"usecase")}reorderElements(e,t){const s=new Map(this.model.actors),n=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(const i of[...e.values()].sort((a,o)=>(t.get(a.id)??0)-(t.get(o.id)??0))){!s.has(i.id)&&!n.has(i.id)&&this.setElementModel(i);const a=s.get(i.id)??this.model.actors.get(i.id),o=n.get(i.id)??this.model.useCases.get(i.id);a?this.model.actors.set(i.id,a):o&&this.model.useCases.set(i.id,o)}}applyMetadataAssignments(e,t,s,n){for(const i of this.metadataAssignments){const a=e.get(i.target);if(!a){const o=this.inferMetadataKind(i.metadata);throw new Error(`Metadata target '${i.target}' is unresolved${o?` (metadata implies ${o})`:""} at ${D(i.targetLocation)}`)}if(a.kind==="actor"||a.kind==="usecase")this.applyStandaloneElementMetadata(t.get(i.target),i.metadata);else if(a.kind==="boundary"){const o=s.get(i.target);for(const l of i.metadata.properties)(l.key!=="type"||l.value!=="rect"&&l.value!=="package")&&this.invalidMetadata(i.target,a.kind,l),o.type=l.value}else if(a.kind==="edge"){const o=n.get(i.target);if(!o)throw new Error(`Metadata target '${i.target}' is not an explicit edge at ${D(i.targetLocation)}`);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;for(const l of i.metadata.properties)l.key==="animate"&&typeof l.value=="boolean"?o.relationship.animate=l.value:l.key==="animation"&&(l.value==="fast"||l.value==="slow")?(o.relationship.animation=l.value,o.relationship.animate=!0):this.invalidMetadata(i.target,a.kind,l)}else for(const o of i.metadata.properties)this.invalidMetadata(i.target,a.kind,o)}for(const{relationship:i}of n.values())i.animation&&(i.animate=!0)}applyStandaloneElementMetadata(e,t){for(const s of t.properties)e.kind==="actor"?this.applyActorProperty(e,s,!0):s.key==="business"&&typeof s.value=="boolean"?e.business=s.value:this.invalidMetadata(e.id,e.kind,s)}applyDeclarationMetadata(e,t){if(t)for(const s of t.properties)e.kind==="actor"?this.applyActorProperty(e,s,!1):s.key==="business"&&typeof s.value=="boolean"?(e.business!==void 0&&e.business!==s.value&&this.conflict(`Use case '${e.id}' has conflicting business metadata`,s.location,e.location),e.business=s.value):this.invalidMetadata(e.id,e.kind,s)}applyActorProperty(e,t,s){t.key==="type"&&(t.value==="normal"||t.value==="hollow"||t.value==="awesome")?(!s&&e.actorType!==void 0&&e.actorType!==t.value&&this.conflict(`Actor '${e.id}' has conflicting type metadata`,t.location,e.location),e.actorType=t.value):t.key==="icon"&&typeof t.value=="string"?(!s&&e.icon!==void 0&&e.icon!==t.value&&this.conflict(`Actor '${e.id}' has conflicting icon metadata`,t.location,e.location),e.icon=t.value):t.key==="business"&&typeof t.value=="boolean"?(!s&&e.business!==void 0&&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(const t of e.values()){const s=t.icon?"icon":t.actorType??"normal";if(t.kind==="actor"){if(t.icon&&t.actorType&&t.actorType!=="normal")throw new Error(`Actor '${t.id}' cannot combine icon with type '${t.actorType}' at ${D(t.location)}`);if(t.business&&(s==="icon"||s==="awesome"))throw new Error(`Business actor '${t.id}' must use normal or hollow geometry at ${D(t.location)}`)}else if((t.shape??"ellipse")==="rect"&&t.business)throw new Error(`Rectangular use case '${t.id}' cannot be a business use case at ${D(t.location)}`);this.setElementModel(t)}}refreshBoundaries(e,t){for(const s of e.values())s.members.length=0;for(const s of[...this.elements].sort((n,i)=>n.location.span[0]-i.location.span[0])){if(!s.parentId)continue;const n=e.get(s.parentId);if(!n)throw new Error(`Parent boundary '${s.parentId}' for '${s.id}' is unresolved at ${D(s.parentLocation??s.location)}`);n.members.includes(s.id)||n.members.push(s.id)}for(const s of t.values())if(s.parentId&&!e.has(s.parentId))throw new Error(`Parent boundary '${s.parentId}' for '${s.id}' is unresolved at ${D(s.parentLocation??s.location)}`);for(const s of e.values()){const n=this.model.systemBoundaries.get(s.id);n.type=s.type??"rect",n.members=[...s.members],n.classes=[...s.classes],n.styles=[...s.styles]}}materializeNotes(e){let t=0;for(const s of this.noteDrafts){const n=e.get(s.target);if(!n)throw new Error(`Note target '${s.target}' is unresolved at ${D(s.targetLocation)}`);n.kind!=="actor"&&n.kind!=="usecase"&&this.conflict(`Note target '${s.target}' must be an actor or use case, not ${n.kind}`,s.targetLocation,n.location);const i=`note-${t++}`;this.model.notes.set(i,{id:i,target:s.target,label:s.label.text,labelType:s.label.type})}this.model.noteCounter=t}applyClassDefinitions(){for(const e of this.classDefinitions)for(const t of e.ids)this.model.classDefs.set(t,{id:t,styles:[...e.styles]})}applyClassesAndStyles(e,t){for(const s of this.classAssignments)for(const n of s.targets)Ct(this.getStylable(n.id,e,t,n.location).classes,s.classes);for(const s of this.styleAssignments)this.getStylable(s.target,e,t,s.location).styles.push(...s.styles)}getStylable(e,t,s,n){const i=t.get(e)?.kind,a=i==="actor"?this.model.actors.get(e):i==="usecase"?this.model.useCases.get(e):i==="boundary"?this.model.systemBoundaries.get(e):i==="json"?this.model.jsonNodes.get(e):i==="edge"?s.get(e)?.relationship:void 0;if(!a)throw new Error(`Class/style target '${e}' is unresolved or anonymous at ${D(n)}`);return a}validateRelationship(e,t,s,n){const i=h(a=>a==="actor"||a==="usecase"||a==="json","allowed");if(i(t)||this.conflict(`Relationship source '${e.source.id}' cannot be ${t}`,e.source.location,n.get(e.source.id).location),i(s)||this.conflict(`Relationship target '${e.target.id}' cannot be ${s}`,e.target.location,n.get(e.target.id).location),(e.type==="include"||e.type==="extend")&&(t!=="usecase"||s!=="usecase"))throw new Error(`${e.type} relationship requires use-case endpoints at ${D(e.location)}`);if(e.type==="generalization"&&(t!=="actor"&&t!=="usecase"||t!==s))throw new Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${D(e.location)}`);if(e.type==="association"&&(t==="json"||s==="json")&&![0,1,2].includes(e.arrowType))throw new Error(`JSON relationship '${e.source.id}' to '${e.target.id}' permits only point, reversed-point, or markerless solid association at ${D(e.location)}`)}setElementModel(e){if(e.kind==="actor"){const 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){const t=new Set(["actor","usecase","boundary","edge"]);for(const s of e.properties)if(s.key==="icon")t.clear(),t.add("actor");else if(s.key==="animate"||s.key==="animation")t.clear(),t.add("edge");else if(s.key==="type")t.clear(),s.value==="rect"||s.value==="package"?t.add("boundary"):(s.value==="normal"||s.value==="hollow"||s.value==="awesome")&&t.add("actor");else if(s.key==="business")t.delete("boundary"),t.delete("edge");else return;return t.size===1?[...t][0]:void 0}invalidMetadata(e,t,s){throw new Error(`Metadata property '${s.key}' is invalid for ${t} '${e}' at ${D(s.location)}`)}registerUnique(e,t,s,n,i){const a=e.get(t);a&&this.conflict(`ID '${t}' is declared more than once (${a.kind} and ${s})`,n,a.location,void 0,me(a)),e.set(t,{kind:s,location:n,generated:i})}recordFirst(e,t,s){const n=e.get(t);(n===void 0||s<n)&&e.set(t,s)}conflict(e,t,s,n,i){throw new Error(`${e} at ${D(t)}${Ms(n)}; previous declaration at ${D(s)}${Ms(i)}`)}},Uo=Be.getBaseCstVisitorConstructor(),Po=class extends Uo{static{c(this,"UsecaseVisitor")}constructor(){super(),this.builder=new xo(pt),this.source="",this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{h(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){const t=this.tokens(e,"USECASE")[0],s=[];for(const n of this.nodes(e,"line"))s.push(this.visit(n));this.builder.setStatements(s),this.builder.finalize(this.tokenSpan(t))}line(e){const 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){const 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){const t=this.tokens(e,"ACC_DESCR_LINE")[0],s=this.tokens(e,"ACC_DESCR_BLOCK")[0],n=t?t.image.slice(t.image.indexOf(":")+1).trim():s.image.slice(s.image.indexOf("{")+1,s.image.lastIndexOf("}")).trim();return this.builder.setAccDescription(n),{kind:"accDescr",span:[0,0]}}actorStatement(e){const t=this.nodes(e,"actorItem"),s=t.map(r=>this.visit(r)),n=this.nodes(e,"relationTail")[0],i=s.map((r,u)=>this.actorOccurrence(t[u],r,!0));for(const r of s)this.builder.addElement(this.actorDraft(r));if(!n)return{kind:"node",span:[0,0],nodes:i};const a=this.visit(n);a.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(a.target));const o=this.relationshipDraft(s[0],a,this.nodeLocation(n));this.builder.addRelationship(o);const l=o.explicitId??`edge-${this.anonymousEdge++}`;return i.push(this.entityOccurrence(this.nodes(n.children,"entityName")[0],a.target,a.target.explicitDeclaration)),{kind:"edge",span:[0,0],nodes:i,edges:[{id:l,span:[0,0],...o.explicitIdLocation?{idSpan:o.explicitIdLocation.span}:{},...o.label?{labelSpan:o.label.span}:{}}]}}actorItem(e){const t=this.visit(this.nodes(e,"actorName")[0]),s=this.nodes(e,"metadata")[0],n=this.nodes(e,"stereotype")[0],i=this.nodes(e,"classSuffix")[0],a=i?this.visit(i):{classes:[],spans:[]};return{...t,...s?{metadata:this.visit(s)}:{},...n?{stereotype:this.visit(n)}:{},classes:a.classes,classSpans:a.spans}}actorName(e){const t=this.tokens(e,"IDENTIFIER")[0],s=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0];if(t){const i=this.nodes(e,"nodeLabel")[0],a=i?this.visit(i):this.tokenLabel(t);return{id:t.image,label:a,location:this.tokenLocation(t),generated:!1,classes:[],classSpans:[]}}const n=this.tokenLabel(s);return{id:this.generateId(n.text),label:n,location:this.tokenLocation(s),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){const t=this.nodes(e,"actorItem"),s=t.map(n=>this.visit(n));for(const n of s)this.builder.addElement(this.actorDraft(n));return{kind:"node",span:[0,0],nodes:s.map((n,i)=>this.actorOccurrence(t[i],n,!0))}}entityStatement(e){const t=this.nodes(e,"entityName"),s=this.visit(t[0]),n=this.nodes(e,"relationTail")[0];if(!n)return s.explicitDeclaration=!0,s.shape??="ellipse",this.builder.addElement(this.entityDraft(s)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(t[0],s,!0)]};s.explicitDeclaration&&this.builder.addElement(this.entityDraft(s));const i=this.visit(n);i.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(i.target));const a={source:this.endpoint(s),target:this.endpoint(i.target),location:this.nodeLocation(n),...i.explicitId?{explicitId:i.explicitId,explicitIdLocation:i.explicitIdLocation}:{},...i.arrow};this.builder.addRelationship(a);const o=a.explicitId??`edge-${this.anonymousEdge++}`;return{kind:"edge",span:[0,0],nodes:[this.entityOccurrence(t[0],s,s.explicitDeclaration),this.entityOccurrence(this.nodes(n.children,"entityName")[0],i.target,i.target.explicitDeclaration)],edges:[{id:o,span:[0,0],...a.explicitIdLocation?{idSpan:a.explicitIdLocation.span}:{},...a.label?{labelSpan:a.label.span}:{}}]}}entityName(e){const t=this.tokens(e,"IDENTIFIER")[0],s=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],n=this.nodes(e,"nodeLabel")[0],i=this.nodes(e,"useCaseMetadata")[0],a=this.nodes(e,"stereotype")[0],o=this.nodes(e,"classSuffix")[0],l=o?this.visit(o):{classes:[],spans:[]};if(t){const u=n?this.visit(n):this.tokenLabel(t),d=n?this.tokens(e,"LBRACKET").length?"rect":"ellipse":void 0;return{id:t.image,label:u,location:this.tokenLocation(t),generated:!1,...d?{shape:d}:{},...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:l.classes,classSpans:l.spans,explicitDeclaration:!!(d||i||a)}}const r=this.tokenLabel(s);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(s),generated:!0,...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:l.classes,classSpans:l.spans,explicitDeclaration:!!(i||a)}}nodeLabel(e){const t=this.allTokens(e);if(t.length===1&&(t[0].tokenType.name==="PLAIN_STRING"||t[0].tokenType.name==="MARKDOWN_STRING"))return this.tokenLabel(t[0]);const s=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return{text:this.source.slice(s[0],s[1]),type:"text",span:s}}useCaseMetadata(e){return this.visit(this.nodes(e,"metadata")[0])}relationTail(e){const 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:N.SOLID_ARROW,minlen:1};const t=this.tokens(e,"INCLUDE").length?"include":"extend",s=this.tokens(e,t==="include"?"INCLUDE":"EXTEND")[0];return{type:t,arrowType:N.SOLID_ARROW,label:{text:t,type:"text",span:this.tokenSpan(s)},minlen:1}}metadata(e){return{properties:this.nodes(e,"metadataProperty").map(t=>this.visit(t)),location:this.ctxLocation(e)}}metadataProperty(e){const t=this.allTokens(e).filter(o=>o.tokenType.name!=="COLON"),s=t[0],n=t[1],i=n.tokenType.name==="TRUE"?!0:n.tokenType.name==="FALSE"?!1:this.decodePlain(n),a=[s.startOffset,(n.endOffset??n.startOffset)+1];return{key:this.decodePlain(s),value:i,span:a,keySpan:this.contentSpan(s),valueSpan:this.contentSpan(n),location:this.tokenLocation(s)}}metadataSeparator(e){}systemBoundaryStatement(e){const t=this.visit(this.nodes(e,"systemBoundaryName")[0]),s=this.nodes(e,"classSuffix")[0],n=s?this.visit(s):{classes:[],spans:[]};t.classes=n.classes,this.builder.addBoundary(t);const i=this.parentBoundary;this.parentBoundary={id:t.id,location:t.location};const a=this.nodes(e,"systemBoundaryContent")[0],o=a?this.visit(a):[];this.parentBoundary=i;const l=this.tokens(e,"END")[0],r=this.nodes(e,"metadata")[0],u=r?this.visit(r):void 0,d={kind:"group",span:[0,0],group:t.id,idSpan:t.location.span,titleSpan:t.label.span,endSpan:this.tokenSpan(l),classSpans:n.spans,...u?{metadata:u.properties.map(({key:p,span:m,keySpan:g,valueSpan:y})=>({key:p,span:m,keySpan:g,valueSpan:y}))}:{},...o.length?{children:o}:{}};return u&&this.builder.addMetadataAssignment(t.id,t.location,u,d),d}systemBoundaryName(e){const t=this.tokens(e,"IDENTIFIER")[0];if(t){const i=this.nodes(e,"nodeLabel")[0];return{id:t.image,label:i?this.visit(i):this.tokenLabel(t),location:this.tokenLocation(t),generated:!1,classes:[]}}const s=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],n=this.tokenLabel(s);return{id:this.generateId(n.text),label:n,location:this.tokenLocation(s),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,"blankLine"),...this.nodes(e,"commentLine"),...this.nodes(e,"boundaryElement")].sort((t,s)=>(t.location?.startOffset??0)-(s.location?.startOffset??0)).map(t=>this.wrap(t,this.visit(t)))}boundaryElement(e){const t=this.nodes(e,"actorDeclarationOnly")[0];if(t)return this.visit(t);const s=this.nodes(e,"entityName")[0],n=this.visit(s);return n.explicitDeclaration=!0,n.shape??="ellipse",this.builder.addElement(this.entityDraft(n)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(s,n,!0)]}}metadataAssignmentStatement(e){const t=this.visit(this.nodes(e,"metadataAssignmentTarget")[0]),s=this.visit(this.nodes(e,"metadata")[0]),n={kind:"metadata",span:[0,0],nodes:[{id:t.id,span:t.location.span,idSpan:t.location.span}],metadata:s.properties.map(({key:i,span:a,keySpan:o,valueSpan:l})=>({key:i,span:a,keySpan:o,valueSpan:l}))};return this.builder.addMetadataAssignment(t.id,t.location,s,n),n}metadataAssignmentTarget(e){const t=this.allTokens(e)[0],s=this.tokenLabel(t);return{id:t.tokenType.name==="IDENTIFIER"?t.image:this.generateId(s.text),location:this.tokenLocation(t)}}noteStatement(e){const t=this.tokens(e,"IDENTIFIER")[0],s=this.visit(this.nodes(e,"nodeLabel")[0]);return this.builder.addNote({target:t.image,targetLocation:this.tokenLocation(t),label:s,location:this.ctxLocation(e)}),{kind:"note",span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:s.span,nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}stereotype(e){const t=this.tokens(e,"STEREOTYPE_TEXT")[0];return{value:t.image.trim(),span:this.tokenSpan(t)}}classSuffix(e){const t=this.tokens(e,"IDENTIFIER");return{classes:t.map(s=>s.image),spans:t.map(s=>this.tokenSpan(s))}}jsonStatement(e){const t=this.tokens(e,"JSON_DECLARATION_START")[0],s=this.tokens(e,"JSON_OBJECT_LITERAL")[0],n=/^json[\t ]+(\w+)/.exec(t.image),i=n[1],a=n[0].length-i.length,o={span:[t.startOffset+a,t.startOffset+a+i.length],line:t.startLine??1,column:(t.startColumn??1)+a},l=ai(s.image,s.startLine??1,s.startColumn??1),r=this.nodes(e,"classSuffix")[0],u=r?this.visit(r):{classes:[],spans:[]},d={id:i,value:l.value,propertyOrder:l.propertyOrder,location:o,classes:u.classes};return this.builder.addJson(d),{kind:"json",span:[0,0],nodes:[{id:i,span:o.span,idSpan:o.span,defines:!0,classSpans:u.spans}],classSpans:u.spans}}directionStatement(e){const t=this.allTokens(e).find(s=>["TD","TB","BT","RL","LR"].includes(s.tokenType.name));return this.builder.setDirection(t.image),{kind:"direction",span:[0,0]}}classDefStatement(e){const t=this.tokens(e,"IDENTIFIER"),s=this.visit(this.nodes(e,"styles")[0]);return this.builder.addClassDef(t.map(n=>n.image),s),{kind:"classDef",span:[0,0],ref:t[0].image,refSpan:this.tokenSpan(t[0])}}classStatement(e){const t=this.tokens(e,"IDENTIFIER");let s=1;for(;s<t.length&&this.source.slice((t[s-1].endOffset??t[s-1].startOffset)+1,t[s].startOffset).includes(",");s++);const n=t.slice(0,s).map(a=>({id:a.image,location:this.tokenLocation(a)})),i=t.slice(s).map(a=>a.image);return this.builder.addClassAssignment(n,i),{kind:"classAssign",span:[0,0],ref:i[0],refSpan:this.tokenSpan(t[s]),nodes:n.map(({id:a,location:o})=>({id:a,span:o.span,idSpan:o.span}))}}styleStatement(e){const t=this.tokens(e,"IDENTIFIER")[0],s=this.visit(this.nodes(e,"styles")[0]);return this.builder.addStyleAssignment(t.image,this.tokenLocation(t),s),{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(t=>this.visit(t))}styleValue(e){const t=this.allTokens(e),s=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return this.source.slice(s[0],s[1]).replaceAll("\\,",",")}styleComponent(e){return this.allTokens(e).map(t=>t.image).join("")}forwardSolidOperator(e){const t=this.tokens(e,"FORWARD_SOLID")[0];return{type:"association",arrowType:N.SOLID_ARROW,minlen:this.solidMinlen(t)}}backwardSolidOperator(e){const t=this.tokens(e,"BACKWARD_SOLID")[0],s=this.nodes(e,"edgeLabel")[0],n=s?this.tokens(e,"MARKERLESS_SOLID").at(-1):t;return{type:"association",arrowType:N.BACK_ARROW,minlen:this.solidMinlen(n),...s?{label:this.visit(s)}:{}}}markerlessSolidOperator(e){const t=this.nodes(e,"edgeLabel")[0],s=this.allTokens(e);if(!t)return{type:"association",arrowType:N.LINE_SOLID,minlen:this.solidMinlen(this.tokens(e,"MARKERLESS_SOLID")[0])};const n=s.at(-1),i=n.tokenType.name==="FORWARD_SOLID"?N.SOLID_ARROW:n.tokenType.name==="FORWARD_CIRCLE"?N.CIRCLE_ARROW:n.tokenType.name==="FORWARD_CROSS"?N.CROSS_ARROW:N.LINE_SOLID;return{type:"association",arrowType:i,label:this.visit(t),minlen:i===N.SOLID_ARROW||i===N.LINE_SOLID?this.solidMinlen(n):1}}forwardCircleOperator(e){return{type:"association",arrowType:N.CIRCLE_ARROW,minlen:1}}backwardCircleOperator(e){const t=this.nodes(e,"edgeLabel")[0];return{type:"association",arrowType:N.CIRCLE_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}forwardCrossOperator(e){return{type:"association",arrowType:N.CROSS_ARROW,minlen:1}}backwardCrossOperator(e){const t=this.nodes(e,"edgeLabel")[0];return{type:"association",arrowType:N.CROSS_ARROW_REVERSED,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,s){return{source:this.endpoint(e,!0),target:this.endpoint(t.target),location:s,...t.explicitId?{explicitId:t.explicitId,explicitIdLocation:t.explicitIdLocation}:{},...t.arrow}}actorOccurrence(e,t,s){return{id:t.id,span:this.nodeSpan(e),idSpan:t.location.span,labelSpan:t.label.span,...s?{defines:!0}:{},...t.stereotype?{stereotypeSpan:t.stereotype.span}:{},...t.metadata?{metadata:t.metadata.properties.map(({key:n,span:i,keySpan:a,valueSpan:o})=>({key:n,span:i,keySpan:a,valueSpan:o}))}:{},...t.classSpans.length?{classSpans:t.classSpans}:{}}}entityOccurrence(e,t,s){return this.actorOccurrence(e,t,s)}wrap(e,t){if(t.kind==="blank"||t.kind==="comment")return t;t.span=this.nodeSpan(e);for(const s of t.edges??[])s.span=t.span;return t}tokenLabel(e){const t=e.tokenType.name==="MARKDOWN_STRING"?"markdown":"text",s=t==="markdown"?2:e.tokenType.name==="PLAIN_STRING"?1:0,n=this.tokenSpan(e,s);return{text:this.source.slice(n[0],n[1]),type:t,span:n}}decodePlain(e){return e.tokenType.name==="PLAIN_STRING"?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,e.tokenType.name==="PLAIN_STRING"?1:e.tokenType.name==="MARKDOWN_STRING"?2:0)}generateId(e){return e.replace(/\W/g,"_")}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){const t=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:t.startLine??1,column:t.startColumn??1}}ctxLocation(e){const t=this.allTokens(e).filter(i=>i.tokenType.name!=="NEWLINE"&&i.tokenType.name!=="EOF"),s=t[0],n=t.at(-1);return{span:[s.startOffset,Math.min(this.source.length,(n.endOffset??n.startOffset+n.image.length-1)+1)],line:s.startLine??1,column:s.startColumn??1}}tokenLocation(e){const t=e.tokenType.name==="PLAIN_STRING"?1:e.tokenType.name==="MARKDOWN_STRING"?2:0;return{span:this.tokenSpan(e,t),line:e.startLine??1,column:(e.startColumn??1)+t}}nodeSpan(e){const t=this.allTokens(e.children).filter(i=>i.tokenType.name!=="NEWLINE"&&i.tokenType.name!=="EOF"),s=t[0],n=t.at(-1);if(!s||!n)throw new Error("Usecase CST node has no source token");return[s.startOffset,Math.min(this.source.length,(n.endOffset??n.startOffset+n.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(s=>"children"in s)}tokens(e,t){return(e[t]??[]).filter(s=>"tokenTypeIdx"in s)}firstNode(e,...t){for(const s of t){const n=this.nodes(e,s)[0];if(n)return n}throw new Error(`Usecase CST is missing one of: ${t.join(", ")}`)}allTokens(e){const t=[];for(const s of Object.values(e))for(const n of s)"tokenTypeIdx"in n?t.push(n):t.push(...this.allTokens(n.children));return t.sort((s,n)=>s.startOffset-n.startOffset)}},Do=new Po,Fo={parse:h(async e=>{pt.clear(),Be.input=[];try{Tn({diagramType:"usecase",lexer:Ro,parser:Be,entry:h(()=>Be.start(),"entry"),visit:h(t=>Do.build(t,e),"visit")},e)}catch(t){pt.clear();const s=Be.errors[0];if(s){const{token:n}=s,i=Oe(n.startOffset)?n.startOffset:e.length,a=Oe(n.endOffset)?n.endOffset+1:i,o=Oe(n.startLine)?n.startLine:e.slice(0,i).split(/\r\n|\r|\n/).length,l=Math.max(e.lastIndexOf(`
|
|
109
|
+
`,i-1),e.lastIndexOf("\r",i-1)),r=Oe(n.startColumn)?n.startColumn:i-l,u=t instanceof Error?t.message:String(t);throw new Error(`${u} at line ${o}, column ${r} [${i},${a})`)}throw t}},"parse")},Bo=["point","circle","cross","extension"],ri={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},xs=h((e,t)=>{const[s,n]=[e,t].map(i=>i.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element");return`usecase-${s}-${n}`},"usecaseDomId"),$o=h(e=>`usecase-${e.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element"}`,"usecaseNodeDomId"),At=h((e,t)=>t!=="markdown"?e:Ai(e).map(s=>s.map(n=>n.content).join(" ")).join(`
|
|
110
|
+
`),"getAccessibleLabel"),jo=h(e=>{const t=At(e.label??e.id,e.labelType);if(ri[e.shape]){const n=e.actorType&&e.actorType!=="normal"?`${e.actorType} `:"";return`${e.business?"business ":""}${n}actor ${t}${e.stereotype?`, stereotype ${e.stereotype}`:""}`}if(e.shape==="note")return`Note for ${e.noteTargetLabel??e.noteTarget??""}: ${t}`;if(e.shape==="usecaseJsonTable"){const n=(e.jsonRows??[]).map(i=>`${i.accessibleKey}: ${i.value}`).join("; ");return n?`${t}: ${n}`:t}const s=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${e.business?"business ":""}use case ${t}${s}`},"getUsecaseNodeAccessibleName"),Go=h(e=>`${e.boundaryType} system boundary ${At(e.label??e.id,e.labelType)}`,"getUsecaseBoundaryAccessibleName"),Wo=h(e=>e.relationshipType==="note"?"":`${e.relationshipType==="association"&&e.label?`association ${At(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`,"getUsecaseEdgeAccessibleName"),ye=h(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"escapePlainLabel"),Us=h(e=>e.replace(/([*[\\\]_`])/g,"\\$1"),"escapeMarkdownMarkers"),Ko=h((e,t)=>{e.diagramId=t,e.markers=[...Bo];for(const s of e.nodes){const n=s;if(n.domId=$o(s.id),s.label!==void 0&&s.labelType==="text"&&(s.label=ye(s.label)),s.stereotype&&(s.stereotype=ye(s.stereotype)),!s.isGroup&&s.shape==="usecaseJsonTable"&&(s.jsonRows=s.jsonRows?.map(i=>({...i,key:ye(i.key),value:ye(i.value)}))),!s.isGroup&&(s.shape==="usecaseEllipse"||s.shape==="rect")&&s.stereotype){const i=s.label??ye(s.id);s.label=`«${Us(s.stereotype)}»<br/>${s.labelType==="text"?Us(i):i}`,s.labelType="markdown",n.hasFoldedStereotype=!0,delete s.stereotype}}for(const s of e.edges)s.label!==void 0&&s.labelType==="text"&&(s.label=ye(s.label));return e},"prepareUsecaseLayoutData"),zo=h((e,t,s)=>{for(const i of t.nodes){const a=typeof i.domId=="string"?i.domId:xs(t.diagramId,i.id),o=e.select(`#${a}`),l=i.isGroup?"boundary":ri[i.shape]?"actor":i.shape==="note"?"note":i.shape==="usecaseJsonTable"?"json":"usecase",r=s.nodes.get(i.id)??i.id;if(o.attr("data-usecase-id",i.id).attr("data-usecase-kind",l).attr("role","img").attr("aria-label",r),!i.isGroup&&(i.shape==="usecaseEllipse"||i.shape==="rect")&&"hasFoldedStereotype"in i&&i.hasFoldedStereotype===!0){const u=o.node(),d=u?.querySelector(".nodeLabel"),p=d?.querySelector("p")??d,m=p?.firstChild;if(p&&m?.nodeType===3){const g=p.ownerDocument.createElement("span");g.className="usecase-stereotype",p.insertBefore(g,m),g.appendChild(m)}else u?.querySelector(".label tspan tspan, .label tspan")?.classList.add("usecase-stereotype")}}const n=new Map(t.edges.map(i=>[i.id,i]));e.selectAll('path[data-et="edge"]').each(function(){const i=n.get(this.getAttribute("data-id")??"");if(!i)return;const a=ui(this);a.attr("id",xs(t.diagramId,i.id)).attr("data-usecase-id",i.id).attr("data-usecase-kind",i.internal?"note-connector":"relationship"),i.internal?a.attr("aria-hidden","true"):a.attr("role","img").attr("aria-label",s.edges.get(i.id)??i.id)})},"annotateUsecaseElements"),Ps=h((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"),Ho={draw:h(async(e,t,s,n)=>{hi.info("Drawing usecase diagram (unified)",t);const{layout:i}=Fs(),a=n.db,o=a.getData(),l=new Map(o.nodes.map(p=>[p.id,At(p.label??p.id,p.labelType)])),r={nodes:new Map(o.nodes.map(p=>[p.id,p.isGroup?Go(p):jo(p.shape==="note"?{...p,noteTargetLabel:l.get(p.noteTarget??"")}:p)])),edges:new Map(o.edges.map(p=>[p.id,Wo({...p,sourceLabel:l.get(p.source)??p.sourceLabel,targetLabel:l.get(p.target)??p.targetLabel})]))},u=Ri(t,o.config.securityLevel);o.layoutAlgorithm=Ni(i),Ko(o,t),Ps(u,o),await Ii(o,u),zo(u,o,r);const d=o.diagramPadding;gi.insertTitle(u,"usecaseDiagramTitleText",0,a.getDiagramTitle?.()??""),Li(u,d,"usecaseDiagram",o.useMaxWidth),Ps(u,o)},"draw")},Vo=h(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"),Xo=h(e=>{const{theme:t,bkgColorArray:s,borderColorArray:n}=e;if(!yi(t,n))return"";const i=Ei().usecase?.colorScheme==="rotate",a=xe(e.look),o=a==="handDrawn",l=Oi(s);let r="";for(let u=0;u<Si(n);u++){const d=n[u],p=l?`fill: ${s[u%s.length]};`:"",m=`[data-look="${a}"][data-color-id="color-${u}"]`;r+=`
|
|
111
|
+
|
|
112
|
+
& ${m}.system-boundary rect.boundary-body,
|
|
113
|
+
& ${m}.system-boundary rect.boundary-tab,
|
|
114
|
+
& ${m}.system-boundary .boundary-body path,
|
|
115
|
+
& ${m}.system-boundary .boundary-tab path {
|
|
116
|
+
stroke: ${d};
|
|
117
|
+
${p}
|
|
118
|
+
}
|
|
119
|
+
`,i&&(r+=`
|
|
120
|
+
|
|
121
|
+
/* Use case bodies -- \`.usecase-element\` covers the ellipse form, the \`[Rect]\` form and
|
|
122
|
+
the business variant.
|
|
123
|
+
|
|
124
|
+
Element selectors only, never a bare \`path\`. Under the handDrawn look roughjs draws
|
|
125
|
+
the body as a *pair* of paths, an outline stroked in the border colour and a hachure
|
|
126
|
+
fill stroked in the background colour, with no class to tell them apart. Stroking
|
|
127
|
+
both repaints the fill lines as border colour and the shape collapses into a solid
|
|
128
|
+
block -- which is what \`.usecase-element path\` did. So handDrawn bodies keep the
|
|
129
|
+
theme's uniform colours, exactly as handDrawn flowchart nodes do. */
|
|
130
|
+
& ${m}.usecase-element ellipse,
|
|
131
|
+
& ${m}.usecase-element rect {
|
|
132
|
+
stroke: ${d};
|
|
133
|
+
${p}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* The business marker is a single classed path, so it can be reached safely by name --
|
|
137
|
+
without it the marker keeps the uniform border beside a palette-coloured body. No
|
|
138
|
+
\`fill\`: the marker is drawn with \`fill="none"\` and has to stay that way. */
|
|
139
|
+
& ${m}.usecase-element .usecase-business-marker {
|
|
140
|
+
stroke: ${d};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Actor glyphs, mirroring the uniform rule further down. The fill goes on the glyph
|
|
144
|
+
group, never on its children, so the hollow variant's own \`fill="none"\` keeps
|
|
145
|
+
winning and a hollow actor stays hollow. Same reason as above for not descending
|
|
146
|
+
into the handDrawn paths. */
|
|
147
|
+
& ${m}.usecase-actor .usecase-actor-shape,
|
|
148
|
+
& ${m}.usecase-actor .usecase-actor-hollow,
|
|
149
|
+
& ${m}.usecase-actor .usecase-actor-awesome,
|
|
150
|
+
& ${m}.usecase-actor .usecase-actor-icon {
|
|
151
|
+
stroke: ${d};
|
|
152
|
+
${p}
|
|
153
|
+
}
|
|
154
|
+
${o?"":`
|
|
155
|
+
/* The group rule above reaches the glyph by inheritance, which the neo look breaks: it
|
|
156
|
+
ships a \`[data-look="neo"].node path { stroke }\` rule that hits the glyph's own paths,
|
|
157
|
+
and a value set directly on the child always beats one inherited from the parent,
|
|
158
|
+
whatever the parent rule's specificity. So name the children too.
|
|
159
|
+
|
|
160
|
+
Emitted for every look *except* handDrawn, where roughjs draws the glyph as an
|
|
161
|
+
outline path plus a hachure fill path stroked in the fill colour, indistinguishable
|
|
162
|
+
in CSS -- stroking both turns a hollow actor into a solid disc. Deliberately no
|
|
163
|
+
\`fill\` either way, so the hollow variant's own \`fill="none"\` keeps winning. */
|
|
164
|
+
& ${m}.usecase-actor .usecase-actor-glyph path,
|
|
165
|
+
& ${m}.usecase-actor .usecase-actor-glyph circle {
|
|
166
|
+
stroke: ${d};
|
|
167
|
+
}
|
|
168
|
+
`}
|
|
169
|
+
`)}return r},"genColor"),ul={parser:Fo,db:pt,renderer:Ho,styles:h(e=>{const t=Vo(e),s=xe(e.look)==="handDrawn";return`
|
|
170
|
+
${Xo(e)}
|
|
171
|
+
& .usecase-actor {
|
|
172
|
+
color: ${e.actorTextColor??e.primaryTextColor};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
& .usecase-actor-shape,
|
|
176
|
+
& .usecase-actor-hollow,
|
|
177
|
+
& .usecase-actor-awesome,
|
|
178
|
+
& .usecase-actor-icon {
|
|
179
|
+
fill: ${t.actorBkg};
|
|
180
|
+
stroke: ${t.actorBorder};
|
|
181
|
+
stroke-width: 2px;
|
|
182
|
+
}
|
|
183
|
+
${s?"":`
|
|
184
|
+
/* The rule above colours the glyph group and lets its children inherit, which the neo
|
|
185
|
+
look breaks: it ships a \`[data-look="neo"].node path { stroke }\` rule that lands on
|
|
186
|
+
the glyph's own paths, and a value set directly on a child always beats one inherited
|
|
187
|
+
from its parent, whatever the parent rule's specificity. Since neo is the default look,
|
|
188
|
+
without this every actor renders in the node border colour rather than the actor
|
|
189
|
+
colour the rule above asks for.
|
|
190
|
+
|
|
191
|
+
\`.node\` is in the selector to outrank that neo rule rather than tie with it: both
|
|
192
|
+
would otherwise be one attribute plus one class plus one element, leaving the winner to
|
|
193
|
+
depend on which stylesheet is concatenated last.
|
|
194
|
+
|
|
195
|
+
Stroke only: the hollow variant's own \`fill="none"\` has to keep winning. */
|
|
196
|
+
& .node.usecase-actor .usecase-actor-glyph path,
|
|
197
|
+
& .node.usecase-actor .usecase-actor-glyph circle {
|
|
198
|
+
stroke: ${t.actorBorder};
|
|
199
|
+
}
|
|
200
|
+
`}
|
|
201
|
+
& .usecase-actor .nodeLabel,
|
|
202
|
+
& .actor-label {
|
|
203
|
+
color: ${e.actorTextColor??e.primaryTextColor};
|
|
204
|
+
fill: ${e.actorTextColor??e.primaryTextColor};
|
|
205
|
+
font-family: var(--mermaid-usecase-actor-font-family, ${e.fontFamily});
|
|
206
|
+
font-size: var(--mermaid-usecase-actor-font-size, 14px);
|
|
207
|
+
font-weight: var(--mermaid-usecase-actor-font-weight, normal);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
& .usecase-element ellipse,
|
|
211
|
+
& .usecase-element rect,
|
|
212
|
+
& .usecase-business ellipse,
|
|
213
|
+
& .usecase-business rect {
|
|
214
|
+
fill: ${t.bkg};
|
|
215
|
+
stroke: ${t.border};
|
|
216
|
+
stroke-width: 2px;
|
|
217
|
+
}
|
|
218
|
+
${s?"":`
|
|
219
|
+
/* The same interception the actor glyph hits, one element down: neo ships
|
|
220
|
+
\`[data-look="neo"].node rect { stroke: nodeBorder }\`, which outranks the plain
|
|
221
|
+
\`.usecase-element rect\` above, so a use case written in the \`[Rect]\` form kept the node
|
|
222
|
+
border colour while its ellipse siblings took the role colour. An \`<ellipse>\` has no
|
|
223
|
+
equivalent neo rule and is already correct; restating it here costs nothing and means
|
|
224
|
+
the two forms cannot drift apart again.
|
|
225
|
+
|
|
226
|
+
Qualified with \`[data-look]\` *and* \`.node\` to land strictly above that rule rather than
|
|
227
|
+
tie with it -- on a tie the later stylesheet would win, which is how neo took this in
|
|
228
|
+
the first place. Skipped under handDrawn, where roughjs draws paths and neither element
|
|
229
|
+
exists. */
|
|
230
|
+
& [data-look="${xe(e.look)}"].node.usecase-element ellipse,
|
|
231
|
+
& [data-look="${xe(e.look)}"].node.usecase-element rect {
|
|
232
|
+
fill: ${t.bkg};
|
|
233
|
+
stroke: ${t.border};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* The business marker is a \`<path>\`, so it loses to \`[data-look="neo"].node path\` the same
|
|
237
|
+
way. No \`fill\`: the marker is drawn with \`fill="none"\` and has to stay that way. */
|
|
238
|
+
& [data-look="${xe(e.look)}"].node.usecase-element .usecase-business-marker {
|
|
239
|
+
stroke: ${t.border};
|
|
240
|
+
}
|
|
241
|
+
`}
|
|
242
|
+
& .usecase-element .nodeLabel,
|
|
243
|
+
& .usecase-label {
|
|
244
|
+
color: ${e.primaryTextColor};
|
|
245
|
+
fill: ${e.primaryTextColor};
|
|
246
|
+
font-family: var(--mermaid-usecase-font-family, ${e.fontFamily});
|
|
247
|
+
font-size: var(--mermaid-usecase-font-size, 12px);
|
|
248
|
+
font-weight: var(--mermaid-usecase-font-weight, normal);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
& .usecase-stereotype,
|
|
252
|
+
& .usecase-business-marker {
|
|
253
|
+
color: ${e.primaryTextColor};
|
|
254
|
+
fill: ${e.primaryTextColor};
|
|
255
|
+
stroke: ${t.border};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
& .system-boundary rect.boundary-body,
|
|
259
|
+
& .system-boundary rect.boundary-tab,
|
|
260
|
+
& .system-boundary-package-tab {
|
|
261
|
+
fill: ${t.boundaryBkg};
|
|
262
|
+
stroke: ${t.boundaryBorder};
|
|
263
|
+
stroke-width: 1px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
& .system-boundary-title text {
|
|
267
|
+
fill: ${e.titleColor??e.primaryTextColor};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Only the span, never the <p> inside it: the renderer puts a user-supplied
|
|
271
|
+
'color' on the span, and that has to stay inheritable by its children. */
|
|
272
|
+
& .system-boundary-title span {
|
|
273
|
+
color: ${e.titleColor??e.primaryTextColor};
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
& .usecase-note {
|
|
277
|
+
fill: ${e.noteBkgColor};
|
|
278
|
+
stroke: ${e.noteBorderColor};
|
|
279
|
+
color: ${e.noteTextColor};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
& .usecase-note .nodeLabel {
|
|
283
|
+
color: ${e.noteTextColor};
|
|
284
|
+
fill: ${e.noteTextColor};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
& .usecase-json-table,
|
|
288
|
+
& .usecase-json-table rect,
|
|
289
|
+
& .usecase-json-cell {
|
|
290
|
+
fill: ${e.mainBkg};
|
|
291
|
+
stroke: ${e.nodeBorder??e.primaryColor};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
& .usecase-json-title,
|
|
295
|
+
& .usecase-json-key,
|
|
296
|
+
& .usecase-json-value {
|
|
297
|
+
color: ${e.primaryTextColor};
|
|
298
|
+
fill: ${e.primaryTextColor};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
& .relationship {
|
|
302
|
+
fill: none;
|
|
303
|
+
stroke: ${e.lineColor};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
& .relationship-include,
|
|
307
|
+
& .relationship-extend,
|
|
308
|
+
& .relationship-note {
|
|
309
|
+
stroke-dasharray: 3;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* Include and extend are both dashed, which is a weak distinction at small sizes. The
|
|
313
|
+
tokens default to \`lineColor\`, so a theme that does not set them is unchanged. */
|
|
314
|
+
& .relationship-include {
|
|
315
|
+
stroke: ${t.includeLine};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
& .relationship-extend {
|
|
319
|
+
stroke: ${t.extendLine};
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
& .relationship.edge-animation-fast,
|
|
323
|
+
& .relationship.edge-animation-slow {
|
|
324
|
+
stroke-linecap: round;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
& .edgeLabel,
|
|
328
|
+
& .edgeLabel p {
|
|
329
|
+
background-color: ${e.edgeLabelBackground};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
& .labelBkg {
|
|
333
|
+
background-color: ${e.edgeLabelBackground};
|
|
334
|
+
padding: 0 2px;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
& .edgeLabel .label rect {
|
|
338
|
+
fill: ${e.edgeLabelBackground};
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
& .relationship-label,
|
|
342
|
+
& .edgeLabel {
|
|
343
|
+
color: ${e.primaryTextColor};
|
|
344
|
+
fill: ${e.primaryTextColor};
|
|
345
|
+
font-family: ${e.fontFamily};
|
|
346
|
+
font-size: 10px;
|
|
347
|
+
font-weight: normal;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
& .marker,
|
|
351
|
+
& .marker.point,
|
|
352
|
+
& .marker.circle,
|
|
353
|
+
& .marker.cross {
|
|
354
|
+
fill: ${e.lineColor};
|
|
355
|
+
stroke: ${e.lineColor};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
& .marker.extension {
|
|
359
|
+
fill: ${e.mainBkg};
|
|
360
|
+
stroke: ${e.lineColor};
|
|
361
|
+
}
|
|
362
|
+
`},"getStyles")};export{ul as diagram};
|