@scalar/agent-chat 0.2.3 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/App.vue.d.ts +3 -2
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +32 -0
- package/dist/App.vue2.js +4 -0
- package/dist/Chat.vue.d.ts.map +1 -1
- package/dist/Chat.vue.js +23 -0
- package/dist/Chat.vue2.js +4 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/api.d.ts +50 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +68 -0
- package/dist/components/ApprovalSection.vue.d.ts.map +1 -1
- package/dist/components/ApprovalSection.vue.js +7 -0
- package/dist/components/ApprovalSection.vue2.js +42 -0
- package/dist/components/AuthenticationProvided.vue.d.ts +3 -0
- package/dist/components/AuthenticationProvided.vue.d.ts.map +1 -0
- package/dist/components/AuthenticationProvided.vue.js +13 -0
- package/dist/components/AuthenticationRequired.vue.d.ts +3 -0
- package/dist/components/AuthenticationRequired.vue.d.ts.map +1 -0
- package/dist/components/AuthenticationRequired.vue.js +13 -0
- package/dist/components/AutosendPaused.vue.d.ts.map +1 -1
- package/dist/components/AutosendPaused.vue.js +13 -0
- package/dist/components/ContextItem.vue.d.ts.map +1 -1
- package/dist/components/ContextItem.vue.js +7 -0
- package/dist/components/ContextItem.vue2.js +19 -0
- package/dist/components/ErrorMessage.vue.d.ts +2 -1
- package/dist/components/ErrorMessage.vue.d.ts.map +1 -1
- package/dist/components/ErrorMessage.vue.js +7 -0
- package/dist/components/ErrorMessage.vue2.js +22 -0
- package/dist/components/LoadingMiniOpenAPIDoc.vue.d.ts.map +1 -1
- package/dist/components/LoadingMiniOpenAPIDoc.vue.js +14 -0
- package/dist/components/LoadingOpenAPISpecsSummary.vue.d.ts.map +1 -1
- package/dist/components/LoadingOpenAPISpecsSummary.vue.js +14 -0
- package/dist/components/Logo.vue.d.ts.map +1 -1
- package/dist/components/Logo.vue.js +23 -0
- package/dist/components/PaymentSection.vue.d.ts.map +1 -1
- package/dist/components/PaymentSection.vue.js +7 -0
- package/dist/components/PaymentSection.vue2.js +34 -0
- package/dist/components/RequestApproved.vue.d.ts.map +1 -1
- package/dist/components/RequestApproved.vue.js +13 -0
- package/dist/components/RequestFailed.vue.d.ts.map +1 -1
- package/dist/components/RequestFailed.vue.js +24 -0
- package/dist/components/RequestPreview.vue.d.ts +1 -1
- package/dist/components/RequestPreview.vue.d.ts.map +1 -1
- package/dist/components/RequestPreview.vue.js +7 -0
- package/dist/components/RequestPreview.vue2.js +123 -0
- package/dist/components/RequestRejected.vue.d.ts.map +1 -1
- package/dist/components/RequestRejected.vue.js +22 -0
- package/dist/components/RequestSuccess.vue.d.ts.map +1 -1
- package/dist/components/RequestSuccess.vue.js +13 -0
- package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
- package/dist/components/ResponseBody/ResponseBody.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBody.vue.js +41 -0
- package/dist/components/ResponseBody/ResponseBody.vue2.js +4 -0
- package/dist/components/ResponseBody/ResponseBodyInfo.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +14 -0
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +7 -0
- package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +65 -0
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +20 -0
- package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +4 -0
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts +2 -2
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +26 -0
- package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +4 -0
- package/dist/components/ResponseBody/helpers/media-types.js +130 -0
- package/dist/components/ResponseBody/helpers/process-response-body.d.ts +1 -1
- package/dist/components/ResponseBody/helpers/process-response-body.d.ts.map +1 -1
- package/dist/components/ResponseBody/helpers/process-response-body.js +33 -0
- package/dist/components/SearchPopover.vue.d.ts +2 -2
- package/dist/components/SearchPopover.vue.d.ts.map +1 -1
- package/dist/components/SearchPopover.vue.js +7 -0
- package/dist/components/SearchPopover.vue2.js +67 -0
- package/dist/components/Selector.vue.d.ts +24 -0
- package/dist/components/Selector.vue.d.ts.map +1 -0
- package/dist/components/Selector.vue.js +67 -0
- package/dist/components/Selector.vue2.js +4 -0
- package/dist/components/SendingRequest.vue.d.ts.map +1 -1
- package/dist/components/SendingRequest.vue.js +24 -0
- package/dist/components/ServerSelector.vue.d.ts +22 -0
- package/dist/components/ServerSelector.vue.d.ts.map +1 -0
- package/dist/components/ServerSelector.vue.js +57 -0
- package/dist/components/ServerSelector.vue2.js +4 -0
- package/dist/components/Suggestion.vue.d.ts.map +1 -1
- package/dist/components/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/components/{Endpoint.vue.d.ts → UploadSection.vue.d.ts} +3 -5
- package/dist/components/UploadSection.vue.d.ts.map +1 -0
- package/dist/components/UploadSection.vue.js +7 -0
- package/dist/components/UploadSection.vue2.js +62 -0
- package/dist/entities/prompt/constants.d.ts +2 -0
- package/dist/entities/prompt/constants.d.ts.map +1 -0
- package/dist/entities/prompt/constants.js +4 -0
- package/dist/entities/registry/document.d.ts +21 -0
- package/dist/entities/registry/document.d.ts.map +1 -0
- package/dist/entities/registry/document.js +12 -0
- package/dist/entities/tools/ask-for-authentication.d.ts +7 -0
- package/dist/entities/tools/ask-for-authentication.d.ts.map +1 -0
- package/dist/entities/tools/ask-for-authentication.js +8 -0
- package/dist/entities/tools/constants.d.ts +2 -0
- package/dist/entities/tools/constants.d.ts.map +1 -0
- package/dist/entities/tools/constants.js +4 -0
- package/dist/entities/tools/execute-request.d.ts +42 -0
- package/dist/entities/tools/execute-request.d.ts.map +1 -0
- package/dist/entities/tools/execute-request.js +11 -0
- package/dist/entities/tools/get-mini-openapi-spec.d.ts +12 -0
- package/dist/entities/tools/get-mini-openapi-spec.d.ts.map +1 -0
- package/dist/entities/tools/get-mini-openapi-spec.js +8 -0
- package/dist/entities/tools/get-openapi-spec-summary.d.ts +10 -0
- package/dist/entities/tools/get-openapi-spec-summary.d.ts.map +1 -0
- package/dist/entities/tools/get-openapi-spec-summary.js +4 -0
- package/dist/helpers.d.ts +20 -12
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +122 -0
- package/dist/hooks/{useChatApprovals.d.ts → use-chat-approvals.d.ts} +1 -1
- package/dist/hooks/use-chat-approvals.d.ts.map +1 -0
- package/dist/hooks/use-chat-approvals.js +21 -0
- package/dist/hooks/use-chat-error.d.ts +14 -0
- package/dist/hooks/use-chat-error.d.ts.map +1 -0
- package/dist/hooks/use-chat-error.js +23 -0
- package/dist/hooks/use-chat-pending-client-tool-parts.d.ts +19 -0
- package/dist/hooks/use-chat-pending-client-tool-parts.d.ts.map +1 -0
- package/dist/hooks/use-chat-pending-client-tool-parts.js +12 -0
- package/dist/hooks/{useChatScroll.d.ts → use-chat-scroll.d.ts} +1 -1
- package/dist/hooks/use-chat-scroll.d.ts.map +1 -0
- package/dist/hooks/use-chat-scroll.js +16 -0
- package/dist/hooks/{useSearch.d.ts → use-search.d.ts} +11 -11
- package/dist/hooks/use-search.d.ts.map +1 -0
- package/dist/hooks/use-search.js +25 -0
- package/dist/hooks/use-term-and-conditions.d.ts +6 -0
- package/dist/hooks/use-term-and-conditions.d.ts.map +1 -0
- package/dist/hooks/use-term-and-conditions.js +16 -0
- package/dist/hooks/use-upload-tmp-document.d.ts +19 -0
- package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -0
- package/dist/hooks/use-upload-tmp-document.js +64 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/package.json +34 -23
- package/dist/registry/add-documents-to-store.d.ts +6 -6
- package/dist/registry/add-documents-to-store.d.ts.map +1 -1
- package/dist/registry/add-documents-to-store.js +40 -0
- package/dist/registry/create-document-name.d.ts +2 -0
- package/dist/registry/create-document-name.d.ts.map +1 -0
- package/dist/registry/create-document-name.js +6 -0
- package/dist/state/state.d.ts +20 -8
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +110 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
- package/dist/views/Chat/Chat.vue.js +7 -0
- package/dist/views/Chat/Chat.vue2.js +77 -0
- package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts +10 -0
- package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -0
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +7 -0
- package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +93 -0
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +7 -0
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +23 -0
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +7 -0
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +56 -0
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +26 -0
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +4 -0
- package/dist/views/Chat/Messages/Text.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/Text.vue.js +16 -0
- package/dist/views/Chat/Messages/Text.vue2.js +4 -0
- package/dist/views/Layout.vue.d.ts.map +1 -1
- package/dist/views/Layout.vue.js +7 -0
- package/dist/views/Layout.vue2.js +23 -0
- package/dist/views/PromptForm.vue.d.ts.map +1 -1
- package/dist/views/PromptForm.vue.js +7 -0
- package/dist/views/PromptForm.vue2.js +212 -0
- package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
- package/dist/views/Settings/Auth.vue.js +67 -0
- package/dist/views/Settings/Auth.vue2.js +4 -0
- package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
- package/dist/views/Settings/DocSettings.vue.js +7 -0
- package/dist/views/Settings/DocSettings.vue2.js +48 -0
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/dist/views/Settings/Settings.vue.js +8 -0
- package/dist/views/Settings/Settings.vue2.js +67 -0
- package/dist/views/Start.vue.d.ts.map +1 -1
- package/dist/views/Start.vue.js +7 -0
- package/dist/views/Start.vue2.js +41 -0
- package/package.json +52 -7
- package/dist/Tooltip-Cm82QgNj.js +0 -575
- package/dist/__vite-optional-peer-dep_stream-markdown_markstream-vue_false-sdjmOmXd.js +0 -5
- package/dist/__vite-optional-peer-dep_stream-monaco_markstream-vue_false-HdL4xm5U.js +0 -5
- package/dist/__vite-optional-peer-dep_vue-i18n_markstream-vue_false-B9Pwe5kz.js +0 -5
- package/dist/_basePickBy-hHD8tMGb.js +0 -151
- package/dist/_baseUniq-DTF1wuF6.js +0 -614
- package/dist/arc-Dw2RQerU.js +0 -83
- package/dist/architecture-U656AL7Q-B00Z9eXr.js +0 -36
- package/dist/architectureDiagram-VXUJARFQ-BtOffFaM.js +0 -4662
- package/dist/blockDiagram-VD42YOAC-BUqFMMQe.js +0 -2261
- package/dist/c4Diagram-YG6GDRKO-NrM1YcpG.js +0 -1579
- package/dist/channel-105myCGU.js +0 -5
- package/dist/chunk-4BX2VUAB-TAxJli7C.js +0 -8
- package/dist/chunk-55IACEB6-VXFJ4bz5.js +0 -8
- package/dist/chunk-B4BG7PRW-CZDQpfj5.js +0 -1375
- package/dist/chunk-DI55MBZ5-D3l7TA-E.js +0 -1370
- package/dist/chunk-FMBD7UC4-BMXFm8I3.js +0 -19
- package/dist/chunk-QN33PNHL-BOUpbpWp.js +0 -19
- package/dist/chunk-QZHKN3VN-C-TEEx05.js +0 -15
- package/dist/chunk-TZMSLE5B-BUiROKNR.js +0 -64
- package/dist/classDiagram-2ON5EDUG-HQET4ybK.js +0 -16
- package/dist/classDiagram-v2-WZHVMYZB-HQET4ybK.js +0 -16
- package/dist/clone-CIIO71O9.js +0 -8
- package/dist/components/Endpoint.vue.d.ts.map +0 -1
- package/dist/cose-bilkent-S5V4N54A-CMsF4n-5.js +0 -2609
- package/dist/cytoscape.esm-DfdJODL8.js +0 -18735
- package/dist/dagre-6UL2VRFP-DqzdQ6Qg.js +0 -444
- package/dist/defaultLocale-BEa-49Qz.js +0 -171
- package/dist/diagram-PSM6KHXK-1xyGntw2.js +0 -531
- package/dist/diagram-QEK2KX5R-DdZdlAm1.js +0 -217
- package/dist/diagram-S2PKOQOG-C80Eo2jp.js +0 -142
- package/dist/erDiagram-Q2GNP2WA-DFVRrMXT.js +0 -841
- package/dist/flowDiagram-NV44I4VS-D9QK_qqB.js +0 -1620
- package/dist/ganttDiagram-LVOFAZNH-Bo1NTkeQ.js +0 -2506
- package/dist/gitGraph-F6HP7TQM-C5hdgcgO.js +0 -27
- package/dist/gitGraphDiagram-NY62KEGX-BZqnqZh6.js +0 -699
- package/dist/graph-Dth4IhEK.js +0 -247
- package/dist/hooks/useChatApprovals.d.ts.map +0 -1
- package/dist/hooks/useChatOperationBlocks.d.ts +0 -3
- package/dist/hooks/useChatOperationBlocks.d.ts.map +0 -1
- package/dist/hooks/useChatScroll.d.ts.map +0 -1
- package/dist/hooks/useSearch.d.ts.map +0 -1
- package/dist/index-BOvT43H8.js +0 -111780
- package/dist/index2-B36B-gt0.js +0 -69
- package/dist/index3-CtIyYUnG.js +0 -70
- package/dist/index4-Dzz91Ao2.js +0 -537
- package/dist/index5-Bmz0gMSP.js +0 -590
- package/dist/index6-DMB3qTSV.js +0 -196
- package/dist/info-NVLQJR56-azt5obk5.js +0 -27
- package/dist/infoDiagram-ER5ION4S-DD4Jtctm.js +0 -24
- package/dist/infographic_markstream-vue_false-BfsmcXxk.js +0 -5
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/journeyDiagram-XKPGCS4Q-CXL6UO0r.js +0 -834
- package/dist/kanban-definition-3W4ZIXB7-B57do5Wg.js +0 -719
- package/dist/katex-SsTUIUTC.js +0 -11688
- package/dist/layout-7TCY8eA2.js +0 -1332
- package/dist/linear-DSm5i91N.js +0 -625
- package/dist/mermaid-parser.core-CUQWpAMM.js +0 -12746
- package/dist/mermaid.core-QjuzH7xx.js +0 -14164
- package/dist/mhchem-XHl7cef5.js +0 -2306
- package/dist/mindmap-definition-VGOIOE7T-DAQyGNAM.js +0 -784
- package/dist/ordinal-DfAQgscy.js +0 -61
- package/dist/packet-BFZMPI3H-CixuxAEA.js +0 -27
- package/dist/pie-7BOR55EZ-D3cgnzR1.js +0 -32
- package/dist/pieDiagram-ADFJNKIX-BqxgYwrL.js +0 -161
- package/dist/quadrantDiagram-AYHSOK5B-CQ4v-9Hh.js +0 -1022
- package/dist/radar-NHE76QYJ-DhV0Od_M.js +0 -27
- package/dist/requirementDiagram-UZGBJVZJ-ncWNAgFi.js +0 -850
- package/dist/safeRaf-I3a3-dyJ.js +0 -10
- package/dist/sankeyDiagram-TZEHDZUN-yCR2_cH5.js +0 -810
- package/dist/sequenceDiagram-WL72ISMW-DZ7wqFyd.js +0 -2511
- package/dist/stateDiagram-FKZM4ZOC-Dra68Tzi.js +0 -263
- package/dist/stateDiagram-v2-4FDKWEC3-CARbPECD.js +0 -16
- package/dist/timeline-definition-IT6M3QCI-DEbG9QIM.js +0 -795
- package/dist/treemap-KMMF4GRG-CQbPsyWe.js +0 -81
- package/dist/xychartDiagram-PRI3JC2R-C94Pu8hL.js +0 -1340
|
@@ -1,1370 +0,0 @@
|
|
|
1
|
-
import { g as te } from "./chunk-55IACEB6-VXFJ4bz5.js";
|
|
2
|
-
import { s as ee } from "./chunk-QN33PNHL-BOUpbpWp.js";
|
|
3
|
-
import { _ as u, l as b, c as w, r as se, u as ie, a as re, b as ae, g as ne, s as oe, p as le, q as ce, T as he, k as U, y as ue } from "./mermaid.core-QjuzH7xx.js";
|
|
4
|
-
var vt = (function() {
|
|
5
|
-
var t = /* @__PURE__ */ u(function(Y, o, c, n) {
|
|
6
|
-
for (c = c || {}, n = Y.length; n--; c[Y[n]] = o) ;
|
|
7
|
-
return c;
|
|
8
|
-
}, "o"), e = [1, 2], s = [1, 3], a = [1, 4], r = [2, 4], h = [1, 9], d = [1, 11], S = [1, 16], f = [1, 17], T = [1, 18], _ = [1, 19], m = [1, 33], A = [1, 20], v = [1, 21], p = [1, 22], k = [1, 23], R = [1, 24], L = [1, 26], $ = [1, 27], I = [1, 28], P = [1, 29], st = [1, 30], it = [1, 31], rt = [1, 32], at = [1, 35], nt = [1, 36], ot = [1, 37], lt = [1, 38], H = [1, 34], y = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], ct = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 39, 40, 41, 45, 48, 51, 52, 53, 54, 57], xt = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], gt = {
|
|
9
|
-
trace: /* @__PURE__ */ u(function() {
|
|
10
|
-
}, "trace"),
|
|
11
|
-
yy: {},
|
|
12
|
-
symbols_: { error: 2, start: 3, SPACE: 4, NL: 5, SD: 6, document: 7, line: 8, statement: 9, classDefStatement: 10, styleStatement: 11, cssClassStatement: 12, idStatement: 13, DESCR: 14, "-->": 15, HIDE_EMPTY: 16, scale: 17, WIDTH: 18, COMPOSIT_STATE: 19, STRUCT_START: 20, STRUCT_STOP: 21, STATE_DESCR: 22, AS: 23, ID: 24, FORK: 25, JOIN: 26, CHOICE: 27, CONCURRENT: 28, note: 29, notePosition: 30, NOTE_TEXT: 31, direction: 32, acc_title: 33, acc_title_value: 34, acc_descr: 35, acc_descr_value: 36, acc_descr_multiline_value: 37, CLICK: 38, STRING: 39, HREF: 40, classDef: 41, CLASSDEF_ID: 42, CLASSDEF_STYLEOPTS: 43, DEFAULT: 44, style: 45, STYLE_IDS: 46, STYLEDEF_STYLEOPTS: 47, class: 48, CLASSENTITY_IDS: 49, STYLECLASS: 50, direction_tb: 51, direction_bt: 52, direction_rl: 53, direction_lr: 54, eol: 55, ";": 56, EDGE_STATE: 57, STYLE_SEPARATOR: 58, left_of: 59, right_of: 60, $accept: 0, $end: 1 },
|
|
13
|
-
terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "CLICK", 39: "STRING", 40: "HREF", 41: "classDef", 42: "CLASSDEF_ID", 43: "CLASSDEF_STYLEOPTS", 44: "DEFAULT", 45: "style", 46: "STYLE_IDS", 47: "STYLEDEF_STYLEOPTS", 48: "class", 49: "CLASSENTITY_IDS", 50: "STYLECLASS", 51: "direction_tb", 52: "direction_bt", 53: "direction_rl", 54: "direction_lr", 56: ";", 57: "EDGE_STATE", 58: "STYLE_SEPARATOR", 59: "left_of", 60: "right_of" },
|
|
14
|
-
productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [9, 5], [9, 5], [10, 3], [10, 3], [11, 3], [12, 3], [32, 1], [32, 1], [32, 1], [32, 1], [55, 1], [55, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1]],
|
|
15
|
-
performAction: /* @__PURE__ */ u(function(o, c, n, g, E, i, J) {
|
|
16
|
-
var l = i.length - 1;
|
|
17
|
-
switch (E) {
|
|
18
|
-
case 3:
|
|
19
|
-
return g.setRootDoc(i[l]), i[l];
|
|
20
|
-
case 4:
|
|
21
|
-
this.$ = [];
|
|
22
|
-
break;
|
|
23
|
-
case 5:
|
|
24
|
-
i[l] != "nl" && (i[l - 1].push(i[l]), this.$ = i[l - 1]);
|
|
25
|
-
break;
|
|
26
|
-
case 6:
|
|
27
|
-
case 7:
|
|
28
|
-
this.$ = i[l];
|
|
29
|
-
break;
|
|
30
|
-
case 8:
|
|
31
|
-
this.$ = "nl";
|
|
32
|
-
break;
|
|
33
|
-
case 12:
|
|
34
|
-
this.$ = i[l];
|
|
35
|
-
break;
|
|
36
|
-
case 13:
|
|
37
|
-
const q = i[l - 1];
|
|
38
|
-
q.description = g.trimColon(i[l]), this.$ = q;
|
|
39
|
-
break;
|
|
40
|
-
case 14:
|
|
41
|
-
this.$ = { stmt: "relation", state1: i[l - 2], state2: i[l] };
|
|
42
|
-
break;
|
|
43
|
-
case 15:
|
|
44
|
-
const Tt = g.trimColon(i[l]);
|
|
45
|
-
this.$ = { stmt: "relation", state1: i[l - 3], state2: i[l - 1], description: Tt };
|
|
46
|
-
break;
|
|
47
|
-
case 19:
|
|
48
|
-
this.$ = { stmt: "state", id: i[l - 3], type: "default", description: "", doc: i[l - 1] };
|
|
49
|
-
break;
|
|
50
|
-
case 20:
|
|
51
|
-
var B = i[l], W = i[l - 2].trim();
|
|
52
|
-
if (i[l].match(":")) {
|
|
53
|
-
var ut = i[l].split(":");
|
|
54
|
-
B = ut[0], W = [W, ut[1]];
|
|
55
|
-
}
|
|
56
|
-
this.$ = { stmt: "state", id: B, type: "default", description: W };
|
|
57
|
-
break;
|
|
58
|
-
case 21:
|
|
59
|
-
this.$ = { stmt: "state", id: i[l - 3], type: "default", description: i[l - 5], doc: i[l - 1] };
|
|
60
|
-
break;
|
|
61
|
-
case 22:
|
|
62
|
-
this.$ = { stmt: "state", id: i[l], type: "fork" };
|
|
63
|
-
break;
|
|
64
|
-
case 23:
|
|
65
|
-
this.$ = { stmt: "state", id: i[l], type: "join" };
|
|
66
|
-
break;
|
|
67
|
-
case 24:
|
|
68
|
-
this.$ = { stmt: "state", id: i[l], type: "choice" };
|
|
69
|
-
break;
|
|
70
|
-
case 25:
|
|
71
|
-
this.$ = { stmt: "state", id: g.getDividerId(), type: "divider" };
|
|
72
|
-
break;
|
|
73
|
-
case 26:
|
|
74
|
-
this.$ = { stmt: "state", id: i[l - 1].trim(), note: { position: i[l - 2].trim(), text: i[l].trim() } };
|
|
75
|
-
break;
|
|
76
|
-
case 29:
|
|
77
|
-
this.$ = i[l].trim(), g.setAccTitle(this.$);
|
|
78
|
-
break;
|
|
79
|
-
case 30:
|
|
80
|
-
case 31:
|
|
81
|
-
this.$ = i[l].trim(), g.setAccDescription(this.$);
|
|
82
|
-
break;
|
|
83
|
-
case 32:
|
|
84
|
-
this.$ = {
|
|
85
|
-
stmt: "click",
|
|
86
|
-
id: i[l - 3],
|
|
87
|
-
url: i[l - 2],
|
|
88
|
-
tooltip: i[l - 1]
|
|
89
|
-
};
|
|
90
|
-
break;
|
|
91
|
-
case 33:
|
|
92
|
-
this.$ = {
|
|
93
|
-
stmt: "click",
|
|
94
|
-
id: i[l - 3],
|
|
95
|
-
url: i[l - 1],
|
|
96
|
-
tooltip: ""
|
|
97
|
-
};
|
|
98
|
-
break;
|
|
99
|
-
case 34:
|
|
100
|
-
case 35:
|
|
101
|
-
this.$ = { stmt: "classDef", id: i[l - 1].trim(), classes: i[l].trim() };
|
|
102
|
-
break;
|
|
103
|
-
case 36:
|
|
104
|
-
this.$ = { stmt: "style", id: i[l - 1].trim(), styleClass: i[l].trim() };
|
|
105
|
-
break;
|
|
106
|
-
case 37:
|
|
107
|
-
this.$ = { stmt: "applyClass", id: i[l - 1].trim(), styleClass: i[l].trim() };
|
|
108
|
-
break;
|
|
109
|
-
case 38:
|
|
110
|
-
g.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" };
|
|
111
|
-
break;
|
|
112
|
-
case 39:
|
|
113
|
-
g.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" };
|
|
114
|
-
break;
|
|
115
|
-
case 40:
|
|
116
|
-
g.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" };
|
|
117
|
-
break;
|
|
118
|
-
case 41:
|
|
119
|
-
g.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" };
|
|
120
|
-
break;
|
|
121
|
-
case 44:
|
|
122
|
-
case 45:
|
|
123
|
-
this.$ = { stmt: "state", id: i[l].trim(), type: "default", description: "" };
|
|
124
|
-
break;
|
|
125
|
-
case 46:
|
|
126
|
-
this.$ = { stmt: "state", id: i[l - 2].trim(), classes: [i[l].trim()], type: "default", description: "" };
|
|
127
|
-
break;
|
|
128
|
-
case 47:
|
|
129
|
-
this.$ = { stmt: "state", id: i[l - 2].trim(), classes: [i[l].trim()], type: "default", description: "" };
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
}, "anonymous"),
|
|
133
|
-
table: [{ 3: 1, 4: e, 5: s, 6: a }, { 1: [3] }, { 3: 5, 4: e, 5: s, 6: a }, { 3: 6, 4: e, 5: s, 6: a }, t([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: h, 5: d, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: f, 19: T, 22: _, 24: m, 25: A, 26: v, 27: p, 28: k, 29: R, 32: 25, 33: L, 35: $, 37: I, 38: P, 41: st, 45: it, 48: rt, 51: at, 52: nt, 53: ot, 54: lt, 57: H }, t(y, [2, 5]), { 9: 39, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: f, 19: T, 22: _, 24: m, 25: A, 26: v, 27: p, 28: k, 29: R, 32: 25, 33: L, 35: $, 37: I, 38: P, 41: st, 45: it, 48: rt, 51: at, 52: nt, 53: ot, 54: lt, 57: H }, t(y, [2, 7]), t(y, [2, 8]), t(y, [2, 9]), t(y, [2, 10]), t(y, [2, 11]), t(y, [2, 12], { 14: [1, 40], 15: [1, 41] }), t(y, [2, 16]), { 18: [1, 42] }, t(y, [2, 18], { 20: [1, 43] }), { 23: [1, 44] }, t(y, [2, 22]), t(y, [2, 23]), t(y, [2, 24]), t(y, [2, 25]), { 30: 45, 31: [1, 46], 59: [1, 47], 60: [1, 48] }, t(y, [2, 28]), { 34: [1, 49] }, { 36: [1, 50] }, t(y, [2, 31]), { 13: 51, 24: m, 57: H }, { 42: [1, 52], 44: [1, 53] }, { 46: [1, 54] }, { 49: [1, 55] }, t(ct, [2, 44], { 58: [1, 56] }), t(ct, [2, 45], { 58: [1, 57] }), t(y, [2, 38]), t(y, [2, 39]), t(y, [2, 40]), t(y, [2, 41]), t(y, [2, 6]), t(y, [2, 13]), { 13: 58, 24: m, 57: H }, t(y, [2, 17]), t(xt, r, { 7: 59 }), { 24: [1, 60] }, { 24: [1, 61] }, { 23: [1, 62] }, { 24: [2, 48] }, { 24: [2, 49] }, t(y, [2, 29]), t(y, [2, 30]), { 39: [1, 63], 40: [1, 64] }, { 43: [1, 65] }, { 43: [1, 66] }, { 47: [1, 67] }, { 50: [1, 68] }, { 24: [1, 69] }, { 24: [1, 70] }, t(y, [2, 14], { 14: [1, 71] }), { 4: h, 5: d, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: f, 19: T, 21: [1, 72], 22: _, 24: m, 25: A, 26: v, 27: p, 28: k, 29: R, 32: 25, 33: L, 35: $, 37: I, 38: P, 41: st, 45: it, 48: rt, 51: at, 52: nt, 53: ot, 54: lt, 57: H }, t(y, [2, 20], { 20: [1, 73] }), { 31: [1, 74] }, { 24: [1, 75] }, { 39: [1, 76] }, { 39: [1, 77] }, t(y, [2, 34]), t(y, [2, 35]), t(y, [2, 36]), t(y, [2, 37]), t(ct, [2, 46]), t(ct, [2, 47]), t(y, [2, 15]), t(y, [2, 19]), t(xt, r, { 7: 78 }), t(y, [2, 26]), t(y, [2, 27]), { 5: [1, 79] }, { 5: [1, 80] }, { 4: h, 5: d, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: f, 19: T, 21: [1, 81], 22: _, 24: m, 25: A, 26: v, 27: p, 28: k, 29: R, 32: 25, 33: L, 35: $, 37: I, 38: P, 41: st, 45: it, 48: rt, 51: at, 52: nt, 53: ot, 54: lt, 57: H }, t(y, [2, 32]), t(y, [2, 33]), t(y, [2, 21])],
|
|
134
|
-
defaultActions: { 5: [2, 1], 6: [2, 2], 47: [2, 48], 48: [2, 49] },
|
|
135
|
-
parseError: /* @__PURE__ */ u(function(o, c) {
|
|
136
|
-
if (c.recoverable)
|
|
137
|
-
this.trace(o);
|
|
138
|
-
else {
|
|
139
|
-
var n = new Error(o);
|
|
140
|
-
throw n.hash = c, n;
|
|
141
|
-
}
|
|
142
|
-
}, "parseError"),
|
|
143
|
-
parse: /* @__PURE__ */ u(function(o) {
|
|
144
|
-
var c = this, n = [0], g = [], E = [null], i = [], J = this.table, l = "", B = 0, W = 0, ut = 2, q = 1, Tt = i.slice.call(arguments, 1), D = Object.create(this.lexer), V = { yy: {} };
|
|
145
|
-
for (var Et in this.yy)
|
|
146
|
-
Object.prototype.hasOwnProperty.call(this.yy, Et) && (V.yy[Et] = this.yy[Et]);
|
|
147
|
-
D.setInput(o, V.yy), V.yy.lexer = D, V.yy.parser = this, typeof D.yylloc > "u" && (D.yylloc = {});
|
|
148
|
-
var _t = D.yylloc;
|
|
149
|
-
i.push(_t);
|
|
150
|
-
var Qt = D.options && D.options.ranges;
|
|
151
|
-
typeof V.yy.parseError == "function" ? this.parseError = V.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
152
|
-
function Zt(O) {
|
|
153
|
-
n.length = n.length - 2 * O, E.length = E.length - O, i.length = i.length - O;
|
|
154
|
-
}
|
|
155
|
-
u(Zt, "popStack");
|
|
156
|
-
function Lt() {
|
|
157
|
-
var O;
|
|
158
|
-
return O = g.pop() || D.lex() || q, typeof O != "number" && (O instanceof Array && (g = O, O = g.pop()), O = c.symbols_[O] || O), O;
|
|
159
|
-
}
|
|
160
|
-
u(Lt, "lex");
|
|
161
|
-
for (var x, M, N, mt, z = {}, dt, F, It, ft; ; ) {
|
|
162
|
-
if (M = n[n.length - 1], this.defaultActions[M] ? N = this.defaultActions[M] : ((x === null || typeof x > "u") && (x = Lt()), N = J[M] && J[M][x]), typeof N > "u" || !N.length || !N[0]) {
|
|
163
|
-
var bt = "";
|
|
164
|
-
ft = [];
|
|
165
|
-
for (dt in J[M])
|
|
166
|
-
this.terminals_[dt] && dt > ut && ft.push("'" + this.terminals_[dt] + "'");
|
|
167
|
-
D.showPosition ? bt = "Parse error on line " + (B + 1) + `:
|
|
168
|
-
` + D.showPosition() + `
|
|
169
|
-
Expecting ` + ft.join(", ") + ", got '" + (this.terminals_[x] || x) + "'" : bt = "Parse error on line " + (B + 1) + ": Unexpected " + (x == q ? "end of input" : "'" + (this.terminals_[x] || x) + "'"), this.parseError(bt, {
|
|
170
|
-
text: D.match,
|
|
171
|
-
token: this.terminals_[x] || x,
|
|
172
|
-
line: D.yylineno,
|
|
173
|
-
loc: _t,
|
|
174
|
-
expected: ft
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
if (N[0] instanceof Array && N.length > 1)
|
|
178
|
-
throw new Error("Parse Error: multiple actions possible at state: " + M + ", token: " + x);
|
|
179
|
-
switch (N[0]) {
|
|
180
|
-
case 1:
|
|
181
|
-
n.push(x), E.push(D.yytext), i.push(D.yylloc), n.push(N[1]), x = null, W = D.yyleng, l = D.yytext, B = D.yylineno, _t = D.yylloc;
|
|
182
|
-
break;
|
|
183
|
-
case 2:
|
|
184
|
-
if (F = this.productions_[N[1]][1], z.$ = E[E.length - F], z._$ = {
|
|
185
|
-
first_line: i[i.length - (F || 1)].first_line,
|
|
186
|
-
last_line: i[i.length - 1].last_line,
|
|
187
|
-
first_column: i[i.length - (F || 1)].first_column,
|
|
188
|
-
last_column: i[i.length - 1].last_column
|
|
189
|
-
}, Qt && (z._$.range = [
|
|
190
|
-
i[i.length - (F || 1)].range[0],
|
|
191
|
-
i[i.length - 1].range[1]
|
|
192
|
-
]), mt = this.performAction.apply(z, [
|
|
193
|
-
l,
|
|
194
|
-
W,
|
|
195
|
-
B,
|
|
196
|
-
V.yy,
|
|
197
|
-
N[1],
|
|
198
|
-
E,
|
|
199
|
-
i
|
|
200
|
-
].concat(Tt)), typeof mt < "u")
|
|
201
|
-
return mt;
|
|
202
|
-
F && (n = n.slice(0, -1 * F * 2), E = E.slice(0, -1 * F), i = i.slice(0, -1 * F)), n.push(this.productions_[N[1]][0]), E.push(z.$), i.push(z._$), It = J[n[n.length - 2]][n[n.length - 1]], n.push(It);
|
|
203
|
-
break;
|
|
204
|
-
case 3:
|
|
205
|
-
return !0;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return !0;
|
|
209
|
-
}, "parse")
|
|
210
|
-
}, qt = /* @__PURE__ */ (function() {
|
|
211
|
-
var Y = {
|
|
212
|
-
EOF: 1,
|
|
213
|
-
parseError: /* @__PURE__ */ u(function(c, n) {
|
|
214
|
-
if (this.yy.parser)
|
|
215
|
-
this.yy.parser.parseError(c, n);
|
|
216
|
-
else
|
|
217
|
-
throw new Error(c);
|
|
218
|
-
}, "parseError"),
|
|
219
|
-
// resets the lexer, sets new input
|
|
220
|
-
setInput: /* @__PURE__ */ u(function(o, c) {
|
|
221
|
-
return this.yy = c || this.yy || {}, this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
222
|
-
first_line: 1,
|
|
223
|
-
first_column: 0,
|
|
224
|
-
last_line: 1,
|
|
225
|
-
last_column: 0
|
|
226
|
-
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
227
|
-
}, "setInput"),
|
|
228
|
-
// consumes and returns one char from the input
|
|
229
|
-
input: /* @__PURE__ */ u(function() {
|
|
230
|
-
var o = this._input[0];
|
|
231
|
-
this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o;
|
|
232
|
-
var c = o.match(/(?:\r\n?|\n).*/g);
|
|
233
|
-
return c ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o;
|
|
234
|
-
}, "input"),
|
|
235
|
-
// unshifts one char (or a string) into the input
|
|
236
|
-
unput: /* @__PURE__ */ u(function(o) {
|
|
237
|
-
var c = o.length, n = o.split(/(?:\r\n?|\n)/g);
|
|
238
|
-
this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - c), this.offset -= c;
|
|
239
|
-
var g = this.match.split(/(?:\r\n?|\n)/g);
|
|
240
|
-
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
|
|
241
|
-
var E = this.yylloc.range;
|
|
242
|
-
return this.yylloc = {
|
|
243
|
-
first_line: this.yylloc.first_line,
|
|
244
|
-
last_line: this.yylineno + 1,
|
|
245
|
-
first_column: this.yylloc.first_column,
|
|
246
|
-
last_column: n ? (n.length === g.length ? this.yylloc.first_column : 0) + g[g.length - n.length].length - n[0].length : this.yylloc.first_column - c
|
|
247
|
-
}, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - c]), this.yyleng = this.yytext.length, this;
|
|
248
|
-
}, "unput"),
|
|
249
|
-
// When called from action, caches matched text and appends it on next action
|
|
250
|
-
more: /* @__PURE__ */ u(function() {
|
|
251
|
-
return this._more = !0, this;
|
|
252
|
-
}, "more"),
|
|
253
|
-
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
|
254
|
-
reject: /* @__PURE__ */ u(function() {
|
|
255
|
-
if (this.options.backtrack_lexer)
|
|
256
|
-
this._backtrack = !0;
|
|
257
|
-
else
|
|
258
|
-
return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
259
|
-
` + this.showPosition(), {
|
|
260
|
-
text: "",
|
|
261
|
-
token: null,
|
|
262
|
-
line: this.yylineno
|
|
263
|
-
});
|
|
264
|
-
return this;
|
|
265
|
-
}, "reject"),
|
|
266
|
-
// retain first n characters of the match
|
|
267
|
-
less: /* @__PURE__ */ u(function(o) {
|
|
268
|
-
this.unput(this.match.slice(o));
|
|
269
|
-
}, "less"),
|
|
270
|
-
// displays already matched input, i.e. for error messages
|
|
271
|
-
pastInput: /* @__PURE__ */ u(function() {
|
|
272
|
-
var o = this.matched.substr(0, this.matched.length - this.match.length);
|
|
273
|
-
return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, "");
|
|
274
|
-
}, "pastInput"),
|
|
275
|
-
// displays upcoming input, i.e. for error messages
|
|
276
|
-
upcomingInput: /* @__PURE__ */ u(function() {
|
|
277
|
-
var o = this.match;
|
|
278
|
-
return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
279
|
-
}, "upcomingInput"),
|
|
280
|
-
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
281
|
-
showPosition: /* @__PURE__ */ u(function() {
|
|
282
|
-
var o = this.pastInput(), c = new Array(o.length + 1).join("-");
|
|
283
|
-
return o + this.upcomingInput() + `
|
|
284
|
-
` + c + "^";
|
|
285
|
-
}, "showPosition"),
|
|
286
|
-
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
287
|
-
test_match: /* @__PURE__ */ u(function(o, c) {
|
|
288
|
-
var n, g, E;
|
|
289
|
-
if (this.options.backtrack_lexer && (E = {
|
|
290
|
-
yylineno: this.yylineno,
|
|
291
|
-
yylloc: {
|
|
292
|
-
first_line: this.yylloc.first_line,
|
|
293
|
-
last_line: this.last_line,
|
|
294
|
-
first_column: this.yylloc.first_column,
|
|
295
|
-
last_column: this.yylloc.last_column
|
|
296
|
-
},
|
|
297
|
-
yytext: this.yytext,
|
|
298
|
-
match: this.match,
|
|
299
|
-
matches: this.matches,
|
|
300
|
-
matched: this.matched,
|
|
301
|
-
yyleng: this.yyleng,
|
|
302
|
-
offset: this.offset,
|
|
303
|
-
_more: this._more,
|
|
304
|
-
_input: this._input,
|
|
305
|
-
yy: this.yy,
|
|
306
|
-
conditionStack: this.conditionStack.slice(0),
|
|
307
|
-
done: this.done
|
|
308
|
-
}, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), g = o[0].match(/(?:\r\n?|\n).*/g), g && (this.yylineno += g.length), this.yylloc = {
|
|
309
|
-
first_line: this.yylloc.last_line,
|
|
310
|
-
last_line: this.yylineno + 1,
|
|
311
|
-
first_column: this.yylloc.last_column,
|
|
312
|
-
last_column: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length
|
|
313
|
-
}, this.yytext += o[0], this.match += o[0], this.matches = o, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(o[0].length), this.matched += o[0], n = this.performAction.call(this, this.yy, this, c, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n)
|
|
314
|
-
return n;
|
|
315
|
-
if (this._backtrack) {
|
|
316
|
-
for (var i in E)
|
|
317
|
-
this[i] = E[i];
|
|
318
|
-
return !1;
|
|
319
|
-
}
|
|
320
|
-
return !1;
|
|
321
|
-
}, "test_match"),
|
|
322
|
-
// return next match in input
|
|
323
|
-
next: /* @__PURE__ */ u(function() {
|
|
324
|
-
if (this.done)
|
|
325
|
-
return this.EOF;
|
|
326
|
-
this._input || (this.done = !0);
|
|
327
|
-
var o, c, n, g;
|
|
328
|
-
this._more || (this.yytext = "", this.match = "");
|
|
329
|
-
for (var E = this._currentRules(), i = 0; i < E.length; i++)
|
|
330
|
-
if (n = this._input.match(this.rules[E[i]]), n && (!c || n[0].length > c[0].length)) {
|
|
331
|
-
if (c = n, g = i, this.options.backtrack_lexer) {
|
|
332
|
-
if (o = this.test_match(n, E[i]), o !== !1)
|
|
333
|
-
return o;
|
|
334
|
-
if (this._backtrack) {
|
|
335
|
-
c = !1;
|
|
336
|
-
continue;
|
|
337
|
-
} else
|
|
338
|
-
return !1;
|
|
339
|
-
} else if (!this.options.flex)
|
|
340
|
-
break;
|
|
341
|
-
}
|
|
342
|
-
return c ? (o = this.test_match(c, E[g]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
343
|
-
` + this.showPosition(), {
|
|
344
|
-
text: "",
|
|
345
|
-
token: null,
|
|
346
|
-
line: this.yylineno
|
|
347
|
-
});
|
|
348
|
-
}, "next"),
|
|
349
|
-
// return next match that has a token
|
|
350
|
-
lex: /* @__PURE__ */ u(function() {
|
|
351
|
-
var c = this.next();
|
|
352
|
-
return c || this.lex();
|
|
353
|
-
}, "lex"),
|
|
354
|
-
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
355
|
-
begin: /* @__PURE__ */ u(function(c) {
|
|
356
|
-
this.conditionStack.push(c);
|
|
357
|
-
}, "begin"),
|
|
358
|
-
// pop the previously active lexer condition state off the condition stack
|
|
359
|
-
popState: /* @__PURE__ */ u(function() {
|
|
360
|
-
var c = this.conditionStack.length - 1;
|
|
361
|
-
return c > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
362
|
-
}, "popState"),
|
|
363
|
-
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
364
|
-
_currentRules: /* @__PURE__ */ u(function() {
|
|
365
|
-
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
366
|
-
}, "_currentRules"),
|
|
367
|
-
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
368
|
-
topState: /* @__PURE__ */ u(function(c) {
|
|
369
|
-
return c = this.conditionStack.length - 1 - Math.abs(c || 0), c >= 0 ? this.conditionStack[c] : "INITIAL";
|
|
370
|
-
}, "topState"),
|
|
371
|
-
// alias for begin(condition)
|
|
372
|
-
pushState: /* @__PURE__ */ u(function(c) {
|
|
373
|
-
this.begin(c);
|
|
374
|
-
}, "pushState"),
|
|
375
|
-
// return the number of states currently on the stack
|
|
376
|
-
stateStackSize: /* @__PURE__ */ u(function() {
|
|
377
|
-
return this.conditionStack.length;
|
|
378
|
-
}, "stateStackSize"),
|
|
379
|
-
options: { "case-insensitive": !0 },
|
|
380
|
-
performAction: /* @__PURE__ */ u(function(c, n, g, E) {
|
|
381
|
-
switch (g) {
|
|
382
|
-
case 0:
|
|
383
|
-
return 38;
|
|
384
|
-
case 1:
|
|
385
|
-
return 40;
|
|
386
|
-
case 2:
|
|
387
|
-
return 39;
|
|
388
|
-
case 3:
|
|
389
|
-
return 44;
|
|
390
|
-
case 4:
|
|
391
|
-
return 51;
|
|
392
|
-
case 5:
|
|
393
|
-
return 52;
|
|
394
|
-
case 6:
|
|
395
|
-
return 53;
|
|
396
|
-
case 7:
|
|
397
|
-
return 54;
|
|
398
|
-
case 8:
|
|
399
|
-
break;
|
|
400
|
-
case 9:
|
|
401
|
-
break;
|
|
402
|
-
case 10:
|
|
403
|
-
return 5;
|
|
404
|
-
case 11:
|
|
405
|
-
break;
|
|
406
|
-
case 12:
|
|
407
|
-
break;
|
|
408
|
-
case 13:
|
|
409
|
-
break;
|
|
410
|
-
case 14:
|
|
411
|
-
break;
|
|
412
|
-
case 15:
|
|
413
|
-
return this.pushState("SCALE"), 17;
|
|
414
|
-
case 16:
|
|
415
|
-
return 18;
|
|
416
|
-
case 17:
|
|
417
|
-
this.popState();
|
|
418
|
-
break;
|
|
419
|
-
case 18:
|
|
420
|
-
return this.begin("acc_title"), 33;
|
|
421
|
-
case 19:
|
|
422
|
-
return this.popState(), "acc_title_value";
|
|
423
|
-
case 20:
|
|
424
|
-
return this.begin("acc_descr"), 35;
|
|
425
|
-
case 21:
|
|
426
|
-
return this.popState(), "acc_descr_value";
|
|
427
|
-
case 22:
|
|
428
|
-
this.begin("acc_descr_multiline");
|
|
429
|
-
break;
|
|
430
|
-
case 23:
|
|
431
|
-
this.popState();
|
|
432
|
-
break;
|
|
433
|
-
case 24:
|
|
434
|
-
return "acc_descr_multiline_value";
|
|
435
|
-
case 25:
|
|
436
|
-
return this.pushState("CLASSDEF"), 41;
|
|
437
|
-
case 26:
|
|
438
|
-
return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
|
|
439
|
-
case 27:
|
|
440
|
-
return this.popState(), this.pushState("CLASSDEFID"), 42;
|
|
441
|
-
case 28:
|
|
442
|
-
return this.popState(), 43;
|
|
443
|
-
case 29:
|
|
444
|
-
return this.pushState("CLASS"), 48;
|
|
445
|
-
case 30:
|
|
446
|
-
return this.popState(), this.pushState("CLASS_STYLE"), 49;
|
|
447
|
-
case 31:
|
|
448
|
-
return this.popState(), 50;
|
|
449
|
-
case 32:
|
|
450
|
-
return this.pushState("STYLE"), 45;
|
|
451
|
-
case 33:
|
|
452
|
-
return this.popState(), this.pushState("STYLEDEF_STYLES"), 46;
|
|
453
|
-
case 34:
|
|
454
|
-
return this.popState(), 47;
|
|
455
|
-
case 35:
|
|
456
|
-
return this.pushState("SCALE"), 17;
|
|
457
|
-
case 36:
|
|
458
|
-
return 18;
|
|
459
|
-
case 37:
|
|
460
|
-
this.popState();
|
|
461
|
-
break;
|
|
462
|
-
case 38:
|
|
463
|
-
this.pushState("STATE");
|
|
464
|
-
break;
|
|
465
|
-
case 39:
|
|
466
|
-
return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25;
|
|
467
|
-
case 40:
|
|
468
|
-
return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26;
|
|
469
|
-
case 41:
|
|
470
|
-
return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27;
|
|
471
|
-
case 42:
|
|
472
|
-
return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25;
|
|
473
|
-
case 43:
|
|
474
|
-
return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26;
|
|
475
|
-
case 44:
|
|
476
|
-
return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27;
|
|
477
|
-
case 45:
|
|
478
|
-
return 51;
|
|
479
|
-
case 46:
|
|
480
|
-
return 52;
|
|
481
|
-
case 47:
|
|
482
|
-
return 53;
|
|
483
|
-
case 48:
|
|
484
|
-
return 54;
|
|
485
|
-
case 49:
|
|
486
|
-
this.pushState("STATE_STRING");
|
|
487
|
-
break;
|
|
488
|
-
case 50:
|
|
489
|
-
return this.pushState("STATE_ID"), "AS";
|
|
490
|
-
case 51:
|
|
491
|
-
return this.popState(), "ID";
|
|
492
|
-
case 52:
|
|
493
|
-
this.popState();
|
|
494
|
-
break;
|
|
495
|
-
case 53:
|
|
496
|
-
return "STATE_DESCR";
|
|
497
|
-
case 54:
|
|
498
|
-
return 19;
|
|
499
|
-
case 55:
|
|
500
|
-
this.popState();
|
|
501
|
-
break;
|
|
502
|
-
case 56:
|
|
503
|
-
return this.popState(), this.pushState("struct"), 20;
|
|
504
|
-
case 57:
|
|
505
|
-
break;
|
|
506
|
-
case 58:
|
|
507
|
-
return this.popState(), 21;
|
|
508
|
-
case 59:
|
|
509
|
-
break;
|
|
510
|
-
case 60:
|
|
511
|
-
return this.begin("NOTE"), 29;
|
|
512
|
-
case 61:
|
|
513
|
-
return this.popState(), this.pushState("NOTE_ID"), 59;
|
|
514
|
-
case 62:
|
|
515
|
-
return this.popState(), this.pushState("NOTE_ID"), 60;
|
|
516
|
-
case 63:
|
|
517
|
-
this.popState(), this.pushState("FLOATING_NOTE");
|
|
518
|
-
break;
|
|
519
|
-
case 64:
|
|
520
|
-
return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
|
|
521
|
-
case 65:
|
|
522
|
-
break;
|
|
523
|
-
case 66:
|
|
524
|
-
return "NOTE_TEXT";
|
|
525
|
-
case 67:
|
|
526
|
-
return this.popState(), "ID";
|
|
527
|
-
case 68:
|
|
528
|
-
return this.popState(), this.pushState("NOTE_TEXT"), 24;
|
|
529
|
-
case 69:
|
|
530
|
-
return this.popState(), n.yytext = n.yytext.substr(2).trim(), 31;
|
|
531
|
-
case 70:
|
|
532
|
-
return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 31;
|
|
533
|
-
case 71:
|
|
534
|
-
return 6;
|
|
535
|
-
case 72:
|
|
536
|
-
return 6;
|
|
537
|
-
case 73:
|
|
538
|
-
return 16;
|
|
539
|
-
case 74:
|
|
540
|
-
return 57;
|
|
541
|
-
case 75:
|
|
542
|
-
return 24;
|
|
543
|
-
case 76:
|
|
544
|
-
return n.yytext = n.yytext.trim(), 14;
|
|
545
|
-
case 77:
|
|
546
|
-
return 15;
|
|
547
|
-
case 78:
|
|
548
|
-
return 28;
|
|
549
|
-
case 79:
|
|
550
|
-
return 58;
|
|
551
|
-
case 80:
|
|
552
|
-
return 5;
|
|
553
|
-
case 81:
|
|
554
|
-
return "INVALID";
|
|
555
|
-
}
|
|
556
|
-
}, "anonymous"),
|
|
557
|
-
rules: [/^(?:click\b)/i, /^(?:href\b)/i, /^(?:"[^"]*")/i, /^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:classDef\s+)/i, /^(?:DEFAULT\s+)/i, /^(?:\w+\s+)/i, /^(?:[^\n]*)/i, /^(?:class\s+)/i, /^(?:(\w+)+((,\s*\w+)*))/i, /^(?:[^\n]*)/i, /^(?:style\s+)/i, /^(?:[\w,]+\s+)/i, /^(?:[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:state\s+)/i, /^(?:.*<<fork>>)/i, /^(?:.*<<join>>)/i, /^(?:.*<<choice>>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i],
|
|
558
|
-
conditions: { LINE: { rules: [12, 13], inclusive: !1 }, struct: { rules: [12, 13, 25, 29, 32, 38, 45, 46, 47, 48, 57, 58, 59, 60, 74, 75, 76, 77, 78], inclusive: !1 }, FLOATING_NOTE_ID: { rules: [67], inclusive: !1 }, FLOATING_NOTE: { rules: [64, 65, 66], inclusive: !1 }, NOTE_TEXT: { rules: [69, 70], inclusive: !1 }, NOTE_ID: { rules: [68], inclusive: !1 }, NOTE: { rules: [61, 62, 63], inclusive: !1 }, STYLEDEF_STYLEOPTS: { rules: [], inclusive: !1 }, STYLEDEF_STYLES: { rules: [34], inclusive: !1 }, STYLE_IDS: { rules: [], inclusive: !1 }, STYLE: { rules: [33], inclusive: !1 }, CLASS_STYLE: { rules: [31], inclusive: !1 }, CLASS: { rules: [30], inclusive: !1 }, CLASSDEFID: { rules: [28], inclusive: !1 }, CLASSDEF: { rules: [26, 27], inclusive: !1 }, acc_descr_multiline: { rules: [23, 24], inclusive: !1 }, acc_descr: { rules: [21], inclusive: !1 }, acc_title: { rules: [19], inclusive: !1 }, SCALE: { rules: [16, 17, 36, 37], inclusive: !1 }, ALIAS: { rules: [], inclusive: !1 }, STATE_ID: { rules: [51], inclusive: !1 }, STATE_STRING: { rules: [52, 53], inclusive: !1 }, FORK_STATE: { rules: [], inclusive: !1 }, STATE: { rules: [12, 13, 39, 40, 41, 42, 43, 44, 49, 50, 54, 55, 56], inclusive: !1 }, ID: { rules: [12, 13], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 18, 20, 22, 25, 29, 32, 35, 38, 56, 60, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81], inclusive: !0 } }
|
|
559
|
-
};
|
|
560
|
-
return Y;
|
|
561
|
-
})();
|
|
562
|
-
gt.lexer = qt;
|
|
563
|
-
function ht() {
|
|
564
|
-
this.yy = {};
|
|
565
|
-
}
|
|
566
|
-
return u(ht, "Parser"), ht.prototype = gt, gt.Parser = ht, new ht();
|
|
567
|
-
})();
|
|
568
|
-
vt.parser = vt;
|
|
569
|
-
var Be = vt, de = "TB", Yt = "TB", Ot = "dir", X = "state", K = "root", Ct = "relation", fe = "classDef", pe = "style", Se = "applyClass", tt = "default", Gt = "divider", Bt = "fill:none", Vt = "fill: #333", Mt = "c", Ut = "text", jt = "normal", Dt = "rect", kt = "rectWithTitle", ye = "stateStart", ge = "stateEnd", Rt = "divider", Nt = "roundedWithTitle", Te = "note", Ee = "noteGroup", et = "statediagram", _e = "state", me = `${et}-${_e}`, Ht = "transition", be = "note", De = "note-edge", ke = `${Ht} ${De}`, ve = `${et}-${be}`, Ce = "cluster", Ae = `${et}-${Ce}`, xe = "cluster-alt", Le = `${et}-${xe}`, Wt = "parent", zt = "note", Ie = "state", At = "----", Oe = `${At}${zt}`, wt = `${At}${Wt}`, Kt = /* @__PURE__ */ u((t, e = Yt) => {
|
|
570
|
-
if (!t.doc)
|
|
571
|
-
return e;
|
|
572
|
-
let s = e;
|
|
573
|
-
for (const a of t.doc)
|
|
574
|
-
a.stmt === "dir" && (s = a.value);
|
|
575
|
-
return s;
|
|
576
|
-
}, "getDir"), Re = /* @__PURE__ */ u(function(t, e) {
|
|
577
|
-
return e.db.getClasses();
|
|
578
|
-
}, "getClasses"), Ne = /* @__PURE__ */ u(async function(t, e, s, a) {
|
|
579
|
-
b.info("REF0:"), b.info("Drawing state diagram (v2)", e);
|
|
580
|
-
const { securityLevel: r, state: h, layout: d } = w();
|
|
581
|
-
a.db.extract(a.db.getRootDocV2());
|
|
582
|
-
const S = a.db.getData(), f = te(e, r);
|
|
583
|
-
S.type = a.type, S.layoutAlgorithm = d, S.nodeSpacing = h?.nodeSpacing || 50, S.rankSpacing = h?.rankSpacing || 50, S.markers = ["barb"], S.diagramId = e, await se(S, f);
|
|
584
|
-
const T = 8;
|
|
585
|
-
try {
|
|
586
|
-
(typeof a.db.getLinks == "function" ? a.db.getLinks() : /* @__PURE__ */ new Map()).forEach((m, A) => {
|
|
587
|
-
const v = typeof A == "string" ? A : typeof A?.id == "string" ? A.id : "";
|
|
588
|
-
if (!v) {
|
|
589
|
-
b.warn("⚠️ Invalid or missing stateId from key:", JSON.stringify(A));
|
|
590
|
-
return;
|
|
591
|
-
}
|
|
592
|
-
const p = f.node()?.querySelectorAll("g");
|
|
593
|
-
let k;
|
|
594
|
-
if (p?.forEach((I) => {
|
|
595
|
-
I.textContent?.trim() === v && (k = I);
|
|
596
|
-
}), !k) {
|
|
597
|
-
b.warn("⚠️ Could not find node matching text:", v);
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
const R = k.parentNode;
|
|
601
|
-
if (!R) {
|
|
602
|
-
b.warn("⚠️ Node has no parent, cannot wrap:", v);
|
|
603
|
-
return;
|
|
604
|
-
}
|
|
605
|
-
const L = document.createElementNS("http://www.w3.org/2000/svg", "a"), $ = m.url.replace(/^"+|"+$/g, "");
|
|
606
|
-
if (L.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", $), L.setAttribute("target", "_blank"), m.tooltip) {
|
|
607
|
-
const I = m.tooltip.replace(/^"+|"+$/g, "");
|
|
608
|
-
L.setAttribute("title", I);
|
|
609
|
-
}
|
|
610
|
-
R.replaceChild(L, k), L.appendChild(k), b.info("🔗 Wrapped node in <a> tag for:", v, m.url);
|
|
611
|
-
});
|
|
612
|
-
} catch (_) {
|
|
613
|
-
b.error("❌ Error injecting clickable links:", _);
|
|
614
|
-
}
|
|
615
|
-
ie.insertTitle(
|
|
616
|
-
f,
|
|
617
|
-
"statediagramTitleText",
|
|
618
|
-
h?.titleTopMargin ?? 25,
|
|
619
|
-
a.db.getDiagramTitle()
|
|
620
|
-
), ee(f, T, et, h?.useMaxWidth ?? !0);
|
|
621
|
-
}, "draw"), Ve = {
|
|
622
|
-
getClasses: Re,
|
|
623
|
-
draw: Ne,
|
|
624
|
-
getDir: Kt
|
|
625
|
-
}, St = /* @__PURE__ */ new Map(), G = 0;
|
|
626
|
-
function yt(t = "", e = 0, s = "", a = At) {
|
|
627
|
-
const r = s !== null && s.length > 0 ? `${a}${s}` : "";
|
|
628
|
-
return `${Ie}-${t}${r}-${e}`;
|
|
629
|
-
}
|
|
630
|
-
u(yt, "stateDomId");
|
|
631
|
-
var we = /* @__PURE__ */ u((t, e, s, a, r, h, d, S) => {
|
|
632
|
-
b.trace("items", e), e.forEach((f) => {
|
|
633
|
-
switch (f.stmt) {
|
|
634
|
-
case X:
|
|
635
|
-
Z(t, f, s, a, r, h, d, S);
|
|
636
|
-
break;
|
|
637
|
-
case tt:
|
|
638
|
-
Z(t, f, s, a, r, h, d, S);
|
|
639
|
-
break;
|
|
640
|
-
case Ct:
|
|
641
|
-
{
|
|
642
|
-
Z(
|
|
643
|
-
t,
|
|
644
|
-
f.state1,
|
|
645
|
-
s,
|
|
646
|
-
a,
|
|
647
|
-
r,
|
|
648
|
-
h,
|
|
649
|
-
d,
|
|
650
|
-
S
|
|
651
|
-
), Z(
|
|
652
|
-
t,
|
|
653
|
-
f.state2,
|
|
654
|
-
s,
|
|
655
|
-
a,
|
|
656
|
-
r,
|
|
657
|
-
h,
|
|
658
|
-
d,
|
|
659
|
-
S
|
|
660
|
-
);
|
|
661
|
-
const T = {
|
|
662
|
-
id: "edge" + G,
|
|
663
|
-
start: f.state1.id,
|
|
664
|
-
end: f.state2.id,
|
|
665
|
-
arrowhead: "normal",
|
|
666
|
-
arrowTypeEnd: "arrow_barb",
|
|
667
|
-
style: Bt,
|
|
668
|
-
labelStyle: "",
|
|
669
|
-
label: U.sanitizeText(f.description ?? "", w()),
|
|
670
|
-
arrowheadStyle: Vt,
|
|
671
|
-
labelpos: Mt,
|
|
672
|
-
labelType: Ut,
|
|
673
|
-
thickness: jt,
|
|
674
|
-
classes: Ht,
|
|
675
|
-
look: d
|
|
676
|
-
};
|
|
677
|
-
r.push(T), G++;
|
|
678
|
-
}
|
|
679
|
-
break;
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
}, "setupDoc"), $t = /* @__PURE__ */ u((t, e = Yt) => {
|
|
683
|
-
let s = e;
|
|
684
|
-
if (t.doc)
|
|
685
|
-
for (const a of t.doc)
|
|
686
|
-
a.stmt === "dir" && (s = a.value);
|
|
687
|
-
return s;
|
|
688
|
-
}, "getDir");
|
|
689
|
-
function Q(t, e, s) {
|
|
690
|
-
if (!e.id || e.id === "</join></fork>" || e.id === "</choice>")
|
|
691
|
-
return;
|
|
692
|
-
e.cssClasses && (Array.isArray(e.cssCompiledStyles) || (e.cssCompiledStyles = []), e.cssClasses.split(" ").forEach((r) => {
|
|
693
|
-
const h = s.get(r);
|
|
694
|
-
h && (e.cssCompiledStyles = [...e.cssCompiledStyles ?? [], ...h.styles]);
|
|
695
|
-
}));
|
|
696
|
-
const a = t.find((r) => r.id === e.id);
|
|
697
|
-
a ? Object.assign(a, e) : t.push(e);
|
|
698
|
-
}
|
|
699
|
-
u(Q, "insertOrUpdateNode");
|
|
700
|
-
function Xt(t) {
|
|
701
|
-
return t?.classes?.join(" ") ?? "";
|
|
702
|
-
}
|
|
703
|
-
u(Xt, "getClassesFromDbInfo");
|
|
704
|
-
function Jt(t) {
|
|
705
|
-
return t?.styles ?? [];
|
|
706
|
-
}
|
|
707
|
-
u(Jt, "getStylesFromDbInfo");
|
|
708
|
-
var Z = /* @__PURE__ */ u((t, e, s, a, r, h, d, S) => {
|
|
709
|
-
const f = e.id, T = s.get(f), _ = Xt(T), m = Jt(T), A = w();
|
|
710
|
-
if (b.info("dataFetcher parsedItem", e, T, m), f !== "root") {
|
|
711
|
-
let v = Dt;
|
|
712
|
-
e.start === !0 ? v = ye : e.start === !1 && (v = ge), e.type !== tt && (v = e.type), St.get(f) || St.set(f, {
|
|
713
|
-
id: f,
|
|
714
|
-
shape: v,
|
|
715
|
-
description: U.sanitizeText(f, A),
|
|
716
|
-
cssClasses: `${_} ${me}`,
|
|
717
|
-
cssStyles: m
|
|
718
|
-
});
|
|
719
|
-
const p = St.get(f);
|
|
720
|
-
e.description && (Array.isArray(p.description) ? (p.shape = kt, p.description.push(e.description)) : p.description?.length && p.description.length > 0 ? (p.shape = kt, p.description === f ? p.description = [e.description] : p.description = [p.description, e.description]) : (p.shape = Dt, p.description = e.description), p.description = U.sanitizeTextOrArray(p.description, A)), p.description?.length === 1 && p.shape === kt && (p.type === "group" ? p.shape = Nt : p.shape = Dt), !p.type && e.doc && (b.info("Setting cluster for XCX", f, $t(e)), p.type = "group", p.isGroup = !0, p.dir = $t(e), p.shape = e.type === Gt ? Rt : Nt, p.cssClasses = `${p.cssClasses} ${Ae} ${h ? Le : ""}`);
|
|
721
|
-
const k = {
|
|
722
|
-
labelStyle: "",
|
|
723
|
-
shape: p.shape,
|
|
724
|
-
label: p.description,
|
|
725
|
-
cssClasses: p.cssClasses,
|
|
726
|
-
cssCompiledStyles: [],
|
|
727
|
-
cssStyles: p.cssStyles,
|
|
728
|
-
id: f,
|
|
729
|
-
dir: p.dir,
|
|
730
|
-
domId: yt(f, G),
|
|
731
|
-
type: p.type,
|
|
732
|
-
isGroup: p.type === "group",
|
|
733
|
-
padding: 8,
|
|
734
|
-
rx: 10,
|
|
735
|
-
ry: 10,
|
|
736
|
-
look: d
|
|
737
|
-
};
|
|
738
|
-
if (k.shape === Rt && (k.label = ""), t && t.id !== "root" && (b.trace("Setting node ", f, " to be child of its parent ", t.id), k.parentId = t.id), k.centerLabel = !0, e.note) {
|
|
739
|
-
const R = {
|
|
740
|
-
labelStyle: "",
|
|
741
|
-
shape: Te,
|
|
742
|
-
label: e.note.text,
|
|
743
|
-
cssClasses: ve,
|
|
744
|
-
// useHtmlLabels: false,
|
|
745
|
-
cssStyles: [],
|
|
746
|
-
cssCompiledStyles: [],
|
|
747
|
-
id: f + Oe + "-" + G,
|
|
748
|
-
domId: yt(f, G, zt),
|
|
749
|
-
type: p.type,
|
|
750
|
-
isGroup: p.type === "group",
|
|
751
|
-
padding: A.flowchart?.padding,
|
|
752
|
-
look: d,
|
|
753
|
-
position: e.note.position
|
|
754
|
-
}, L = f + wt, $ = {
|
|
755
|
-
labelStyle: "",
|
|
756
|
-
shape: Ee,
|
|
757
|
-
label: e.note.text,
|
|
758
|
-
cssClasses: p.cssClasses,
|
|
759
|
-
cssStyles: [],
|
|
760
|
-
id: f + wt,
|
|
761
|
-
domId: yt(f, G, Wt),
|
|
762
|
-
type: "group",
|
|
763
|
-
isGroup: !0,
|
|
764
|
-
padding: 16,
|
|
765
|
-
//getConfig().flowchart.padding
|
|
766
|
-
look: d,
|
|
767
|
-
position: e.note.position
|
|
768
|
-
};
|
|
769
|
-
G++, $.id = L, R.parentId = L, Q(a, $, S), Q(a, R, S), Q(a, k, S);
|
|
770
|
-
let I = f, P = R.id;
|
|
771
|
-
e.note.position === "left of" && (I = R.id, P = f), r.push({
|
|
772
|
-
id: I + "-" + P,
|
|
773
|
-
start: I,
|
|
774
|
-
end: P,
|
|
775
|
-
arrowhead: "none",
|
|
776
|
-
arrowTypeEnd: "",
|
|
777
|
-
style: Bt,
|
|
778
|
-
labelStyle: "",
|
|
779
|
-
classes: ke,
|
|
780
|
-
arrowheadStyle: Vt,
|
|
781
|
-
labelpos: Mt,
|
|
782
|
-
labelType: Ut,
|
|
783
|
-
thickness: jt,
|
|
784
|
-
look: d
|
|
785
|
-
});
|
|
786
|
-
} else
|
|
787
|
-
Q(a, k, S);
|
|
788
|
-
}
|
|
789
|
-
e.doc && (b.trace("Adding nodes children "), we(e, e.doc, s, a, r, !h, d, S));
|
|
790
|
-
}, "dataFetcher"), $e = /* @__PURE__ */ u(() => {
|
|
791
|
-
St.clear(), G = 0;
|
|
792
|
-
}, "reset"), C = {
|
|
793
|
-
START_NODE: "[*]",
|
|
794
|
-
START_TYPE: "start",
|
|
795
|
-
END_NODE: "[*]",
|
|
796
|
-
END_TYPE: "end",
|
|
797
|
-
COLOR_KEYWORD: "color",
|
|
798
|
-
FILL_KEYWORD: "fill",
|
|
799
|
-
BG_FILL: "bgFill",
|
|
800
|
-
STYLECLASS_SEP: ","
|
|
801
|
-
}, Pt = /* @__PURE__ */ u(() => /* @__PURE__ */ new Map(), "newClassesList"), Ft = /* @__PURE__ */ u(() => ({
|
|
802
|
-
relations: [],
|
|
803
|
-
states: /* @__PURE__ */ new Map(),
|
|
804
|
-
documents: {}
|
|
805
|
-
}), "newDoc"), pt = /* @__PURE__ */ u((t) => JSON.parse(JSON.stringify(t)), "clone"), j, Me = (j = class {
|
|
806
|
-
constructor(e) {
|
|
807
|
-
this.version = e, this.nodes = [], this.edges = [], this.rootDoc = [], this.classes = Pt(), this.documents = { root: Ft() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.dividerCnt = 0, this.links = /* @__PURE__ */ new Map(), this.getAccTitle = re, this.setAccTitle = ae, this.getAccDescription = ne, this.setAccDescription = oe, this.setDiagramTitle = le, this.getDiagramTitle = ce, this.clear(), this.setRootDoc = this.setRootDoc.bind(this), this.getDividerId = this.getDividerId.bind(this), this.setDirection = this.setDirection.bind(this), this.trimColon = this.trimColon.bind(this);
|
|
808
|
-
}
|
|
809
|
-
/**
|
|
810
|
-
* Convert all of the statements (stmts) that were parsed into states and relationships.
|
|
811
|
-
* This is done because a state diagram may have nested sections,
|
|
812
|
-
* where each section is a 'document' and has its own set of statements.
|
|
813
|
-
* Ex: the section within a fork has its own statements, and incoming and outgoing statements
|
|
814
|
-
* refer to the fork as a whole (document).
|
|
815
|
-
* See the parser grammar: the definition of a document is a document then a 'line', where a line can be a statement.
|
|
816
|
-
* This will push the statement into the list of statements for the current document.
|
|
817
|
-
*/
|
|
818
|
-
extract(e) {
|
|
819
|
-
this.clear(!0);
|
|
820
|
-
for (const r of Array.isArray(e) ? e : e.doc)
|
|
821
|
-
switch (r.stmt) {
|
|
822
|
-
case X:
|
|
823
|
-
this.addState(r.id.trim(), r.type, r.doc, r.description, r.note);
|
|
824
|
-
break;
|
|
825
|
-
case Ct:
|
|
826
|
-
this.addRelation(r.state1, r.state2, r.description);
|
|
827
|
-
break;
|
|
828
|
-
case fe:
|
|
829
|
-
this.addStyleClass(r.id.trim(), r.classes);
|
|
830
|
-
break;
|
|
831
|
-
case pe:
|
|
832
|
-
this.handleStyleDef(r);
|
|
833
|
-
break;
|
|
834
|
-
case Se:
|
|
835
|
-
this.setCssClass(r.id.trim(), r.styleClass);
|
|
836
|
-
break;
|
|
837
|
-
case "click":
|
|
838
|
-
this.addLink(r.id, r.url, r.tooltip);
|
|
839
|
-
break;
|
|
840
|
-
}
|
|
841
|
-
const s = this.getStates(), a = w();
|
|
842
|
-
$e(), Z(
|
|
843
|
-
void 0,
|
|
844
|
-
this.getRootDocV2(),
|
|
845
|
-
s,
|
|
846
|
-
this.nodes,
|
|
847
|
-
this.edges,
|
|
848
|
-
!0,
|
|
849
|
-
a.look,
|
|
850
|
-
this.classes
|
|
851
|
-
);
|
|
852
|
-
for (const r of this.nodes)
|
|
853
|
-
if (Array.isArray(r.label)) {
|
|
854
|
-
if (r.description = r.label.slice(1), r.isGroup && r.description.length > 0)
|
|
855
|
-
throw new Error(
|
|
856
|
-
`Group nodes can only have label. Remove the additional description for node [${r.id}]`
|
|
857
|
-
);
|
|
858
|
-
r.label = r.label[0];
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
handleStyleDef(e) {
|
|
862
|
-
const s = e.id.trim().split(","), a = e.styleClass.split(",");
|
|
863
|
-
for (const r of s) {
|
|
864
|
-
let h = this.getState(r);
|
|
865
|
-
if (!h) {
|
|
866
|
-
const d = r.trim();
|
|
867
|
-
this.addState(d), h = this.getState(d);
|
|
868
|
-
}
|
|
869
|
-
h && (h.styles = a.map((d) => d.replace(/;/g, "")?.trim()));
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
setRootDoc(e) {
|
|
873
|
-
b.info("Setting root doc", e), this.rootDoc = e, this.version === 1 ? this.extract(e) : this.extract(this.getRootDocV2());
|
|
874
|
-
}
|
|
875
|
-
docTranslator(e, s, a) {
|
|
876
|
-
if (s.stmt === Ct) {
|
|
877
|
-
this.docTranslator(e, s.state1, !0), this.docTranslator(e, s.state2, !1);
|
|
878
|
-
return;
|
|
879
|
-
}
|
|
880
|
-
if (s.stmt === X && (s.id === C.START_NODE ? (s.id = e.id + (a ? "_start" : "_end"), s.start = a) : s.id = s.id.trim()), s.stmt !== K && s.stmt !== X || !s.doc)
|
|
881
|
-
return;
|
|
882
|
-
const r = [];
|
|
883
|
-
let h = [];
|
|
884
|
-
for (const d of s.doc)
|
|
885
|
-
if (d.type === Gt) {
|
|
886
|
-
const S = pt(d);
|
|
887
|
-
S.doc = pt(h), r.push(S), h = [];
|
|
888
|
-
} else
|
|
889
|
-
h.push(d);
|
|
890
|
-
if (r.length > 0 && h.length > 0) {
|
|
891
|
-
const d = {
|
|
892
|
-
stmt: X,
|
|
893
|
-
id: he(),
|
|
894
|
-
type: "divider",
|
|
895
|
-
doc: pt(h)
|
|
896
|
-
};
|
|
897
|
-
r.push(pt(d)), s.doc = r;
|
|
898
|
-
}
|
|
899
|
-
s.doc.forEach((d) => this.docTranslator(s, d, !0));
|
|
900
|
-
}
|
|
901
|
-
getRootDocV2() {
|
|
902
|
-
return this.docTranslator(
|
|
903
|
-
{ id: K, stmt: K },
|
|
904
|
-
{ id: K, stmt: K, doc: this.rootDoc },
|
|
905
|
-
!0
|
|
906
|
-
), { id: K, doc: this.rootDoc };
|
|
907
|
-
}
|
|
908
|
-
/**
|
|
909
|
-
* Function called by parser when a node definition has been found.
|
|
910
|
-
*
|
|
911
|
-
* @param descr - description for the state. Can be a string or a list or strings
|
|
912
|
-
* @param classes - class styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 class, convert it to an array of that 1 class.
|
|
913
|
-
* @param styles - styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 style, convert it to an array of that 1 style.
|
|
914
|
-
* @param textStyles - text styles to apply to this state. Can be a string (1 text test) or an array of text styles. If it's just 1 text style, convert it to an array of that 1 text style.
|
|
915
|
-
*/
|
|
916
|
-
addState(e, s = tt, a = void 0, r = void 0, h = void 0, d = void 0, S = void 0, f = void 0) {
|
|
917
|
-
const T = e?.trim();
|
|
918
|
-
if (!this.currentDocument.states.has(T))
|
|
919
|
-
b.info("Adding state ", T, r), this.currentDocument.states.set(T, {
|
|
920
|
-
stmt: X,
|
|
921
|
-
id: T,
|
|
922
|
-
descriptions: [],
|
|
923
|
-
type: s,
|
|
924
|
-
doc: a,
|
|
925
|
-
note: h,
|
|
926
|
-
classes: [],
|
|
927
|
-
styles: [],
|
|
928
|
-
textStyles: []
|
|
929
|
-
});
|
|
930
|
-
else {
|
|
931
|
-
const _ = this.currentDocument.states.get(T);
|
|
932
|
-
if (!_)
|
|
933
|
-
throw new Error(`State not found: ${T}`);
|
|
934
|
-
_.doc || (_.doc = a), _.type || (_.type = s);
|
|
935
|
-
}
|
|
936
|
-
if (r && (b.info("Setting state description", T, r), (Array.isArray(r) ? r : [r]).forEach((m) => this.addDescription(T, m.trim()))), h) {
|
|
937
|
-
const _ = this.currentDocument.states.get(T);
|
|
938
|
-
if (!_)
|
|
939
|
-
throw new Error(`State not found: ${T}`);
|
|
940
|
-
_.note = h, _.note.text = U.sanitizeText(_.note.text, w());
|
|
941
|
-
}
|
|
942
|
-
d && (b.info("Setting state classes", T, d), (Array.isArray(d) ? d : [d]).forEach((m) => this.setCssClass(T, m.trim()))), S && (b.info("Setting state styles", T, S), (Array.isArray(S) ? S : [S]).forEach((m) => this.setStyle(T, m.trim()))), f && (b.info("Setting state styles", T, S), (Array.isArray(f) ? f : [f]).forEach((m) => this.setTextStyle(T, m.trim())));
|
|
943
|
-
}
|
|
944
|
-
clear(e) {
|
|
945
|
-
this.nodes = [], this.edges = [], this.documents = { root: Ft() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.classes = Pt(), e || (this.links = /* @__PURE__ */ new Map(), ue());
|
|
946
|
-
}
|
|
947
|
-
getState(e) {
|
|
948
|
-
return this.currentDocument.states.get(e);
|
|
949
|
-
}
|
|
950
|
-
getStates() {
|
|
951
|
-
return this.currentDocument.states;
|
|
952
|
-
}
|
|
953
|
-
logDocuments() {
|
|
954
|
-
b.info("Documents = ", this.documents);
|
|
955
|
-
}
|
|
956
|
-
getRelations() {
|
|
957
|
-
return this.currentDocument.relations;
|
|
958
|
-
}
|
|
959
|
-
/**
|
|
960
|
-
* Adds a clickable link to a state.
|
|
961
|
-
*/
|
|
962
|
-
addLink(e, s, a) {
|
|
963
|
-
this.links.set(e, { url: s, tooltip: a }), b.warn("Adding link", e, s, a);
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* Get all registered links.
|
|
967
|
-
*/
|
|
968
|
-
getLinks() {
|
|
969
|
-
return this.links;
|
|
970
|
-
}
|
|
971
|
-
/**
|
|
972
|
-
* If the id is a start node ( [*] ), then return a new id constructed from
|
|
973
|
-
* the start node name and the current start node count.
|
|
974
|
-
* else return the given id
|
|
975
|
-
*/
|
|
976
|
-
startIdIfNeeded(e = "") {
|
|
977
|
-
return e === C.START_NODE ? (this.startEndCount++, `${C.START_TYPE}${this.startEndCount}`) : e;
|
|
978
|
-
}
|
|
979
|
-
/**
|
|
980
|
-
* If the id is a start node ( [*] ), then return the start type ('start')
|
|
981
|
-
* else return the given type
|
|
982
|
-
*/
|
|
983
|
-
startTypeIfNeeded(e = "", s = tt) {
|
|
984
|
-
return e === C.START_NODE ? C.START_TYPE : s;
|
|
985
|
-
}
|
|
986
|
-
/**
|
|
987
|
-
* If the id is an end node ( [*] ), then return a new id constructed from
|
|
988
|
-
* the end node name and the current start_end node count.
|
|
989
|
-
* else return the given id
|
|
990
|
-
*/
|
|
991
|
-
endIdIfNeeded(e = "") {
|
|
992
|
-
return e === C.END_NODE ? (this.startEndCount++, `${C.END_TYPE}${this.startEndCount}`) : e;
|
|
993
|
-
}
|
|
994
|
-
/**
|
|
995
|
-
* If the id is an end node ( [*] ), then return the end type
|
|
996
|
-
* else return the given type
|
|
997
|
-
*
|
|
998
|
-
*/
|
|
999
|
-
endTypeIfNeeded(e = "", s = tt) {
|
|
1000
|
-
return e === C.END_NODE ? C.END_TYPE : s;
|
|
1001
|
-
}
|
|
1002
|
-
addRelationObjs(e, s, a = "") {
|
|
1003
|
-
const r = this.startIdIfNeeded(e.id.trim()), h = this.startTypeIfNeeded(e.id.trim(), e.type), d = this.startIdIfNeeded(s.id.trim()), S = this.startTypeIfNeeded(s.id.trim(), s.type);
|
|
1004
|
-
this.addState(
|
|
1005
|
-
r,
|
|
1006
|
-
h,
|
|
1007
|
-
e.doc,
|
|
1008
|
-
e.description,
|
|
1009
|
-
e.note,
|
|
1010
|
-
e.classes,
|
|
1011
|
-
e.styles,
|
|
1012
|
-
e.textStyles
|
|
1013
|
-
), this.addState(
|
|
1014
|
-
d,
|
|
1015
|
-
S,
|
|
1016
|
-
s.doc,
|
|
1017
|
-
s.description,
|
|
1018
|
-
s.note,
|
|
1019
|
-
s.classes,
|
|
1020
|
-
s.styles,
|
|
1021
|
-
s.textStyles
|
|
1022
|
-
), this.currentDocument.relations.push({
|
|
1023
|
-
id1: r,
|
|
1024
|
-
id2: d,
|
|
1025
|
-
relationTitle: U.sanitizeText(a, w())
|
|
1026
|
-
});
|
|
1027
|
-
}
|
|
1028
|
-
/**
|
|
1029
|
-
* Add a relation between two items. The items may be full objects or just the string id of a state.
|
|
1030
|
-
*/
|
|
1031
|
-
addRelation(e, s, a) {
|
|
1032
|
-
if (typeof e == "object" && typeof s == "object")
|
|
1033
|
-
this.addRelationObjs(e, s, a);
|
|
1034
|
-
else if (typeof e == "string" && typeof s == "string") {
|
|
1035
|
-
const r = this.startIdIfNeeded(e.trim()), h = this.startTypeIfNeeded(e), d = this.endIdIfNeeded(s.trim()), S = this.endTypeIfNeeded(s);
|
|
1036
|
-
this.addState(r, h), this.addState(d, S), this.currentDocument.relations.push({
|
|
1037
|
-
id1: r,
|
|
1038
|
-
id2: d,
|
|
1039
|
-
relationTitle: a ? U.sanitizeText(a, w()) : void 0
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
addDescription(e, s) {
|
|
1044
|
-
const a = this.currentDocument.states.get(e), r = s.startsWith(":") ? s.replace(":", "").trim() : s;
|
|
1045
|
-
a?.descriptions?.push(U.sanitizeText(r, w()));
|
|
1046
|
-
}
|
|
1047
|
-
cleanupLabel(e) {
|
|
1048
|
-
return e.startsWith(":") ? e.slice(2).trim() : e.trim();
|
|
1049
|
-
}
|
|
1050
|
-
getDividerId() {
|
|
1051
|
-
return this.dividerCnt++, `divider-id-${this.dividerCnt}`;
|
|
1052
|
-
}
|
|
1053
|
-
/**
|
|
1054
|
-
* Called when the parser comes across a (style) class definition
|
|
1055
|
-
* @example classDef my-style fill:#f96;
|
|
1056
|
-
*
|
|
1057
|
-
* @param id - the id of this (style) class
|
|
1058
|
-
* @param styleAttributes - the string with 1 or more style attributes (each separated by a comma)
|
|
1059
|
-
*/
|
|
1060
|
-
addStyleClass(e, s = "") {
|
|
1061
|
-
this.classes.has(e) || this.classes.set(e, { id: e, styles: [], textStyles: [] });
|
|
1062
|
-
const a = this.classes.get(e);
|
|
1063
|
-
s && a && s.split(C.STYLECLASS_SEP).forEach((r) => {
|
|
1064
|
-
const h = r.replace(/([^;]*);/, "$1").trim();
|
|
1065
|
-
if (RegExp(C.COLOR_KEYWORD).exec(r)) {
|
|
1066
|
-
const S = h.replace(C.FILL_KEYWORD, C.BG_FILL).replace(C.COLOR_KEYWORD, C.FILL_KEYWORD);
|
|
1067
|
-
a.textStyles.push(S);
|
|
1068
|
-
}
|
|
1069
|
-
a.styles.push(h);
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
getClasses() {
|
|
1073
|
-
return this.classes;
|
|
1074
|
-
}
|
|
1075
|
-
/**
|
|
1076
|
-
* Add a (style) class or css class to a state with the given id.
|
|
1077
|
-
* If the state isn't already in the list of known states, add it.
|
|
1078
|
-
* Might be called by parser when a style class or CSS class should be applied to a state
|
|
1079
|
-
*
|
|
1080
|
-
* @param itemIds - The id or a list of ids of the item(s) to apply the css class to
|
|
1081
|
-
* @param cssClassName - CSS class name
|
|
1082
|
-
*/
|
|
1083
|
-
setCssClass(e, s) {
|
|
1084
|
-
e.split(",").forEach((a) => {
|
|
1085
|
-
let r = this.getState(a);
|
|
1086
|
-
if (!r) {
|
|
1087
|
-
const h = a.trim();
|
|
1088
|
-
this.addState(h), r = this.getState(h);
|
|
1089
|
-
}
|
|
1090
|
-
r?.classes?.push(s);
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* Add a style to a state with the given id.
|
|
1095
|
-
* @example style stateId fill:#f9f,stroke:#333,stroke-width:4px
|
|
1096
|
-
* where 'style' is the keyword
|
|
1097
|
-
* stateId is the id of a state
|
|
1098
|
-
* the rest of the string is the styleText (all of the attributes to be applied to the state)
|
|
1099
|
-
*
|
|
1100
|
-
* @param itemId - The id of item to apply the style to
|
|
1101
|
-
* @param styleText - the text of the attributes for the style
|
|
1102
|
-
*/
|
|
1103
|
-
setStyle(e, s) {
|
|
1104
|
-
this.getState(e)?.styles?.push(s);
|
|
1105
|
-
}
|
|
1106
|
-
/**
|
|
1107
|
-
* Add a text style to a state with the given id
|
|
1108
|
-
*
|
|
1109
|
-
* @param itemId - The id of item to apply the css class to
|
|
1110
|
-
* @param cssClassName - CSS class name
|
|
1111
|
-
*/
|
|
1112
|
-
setTextStyle(e, s) {
|
|
1113
|
-
this.getState(e)?.textStyles?.push(s);
|
|
1114
|
-
}
|
|
1115
|
-
/**
|
|
1116
|
-
* Finds the direction statement in the root document.
|
|
1117
|
-
* @returns the direction statement if present
|
|
1118
|
-
*/
|
|
1119
|
-
getDirectionStatement() {
|
|
1120
|
-
return this.rootDoc.find((e) => e.stmt === Ot);
|
|
1121
|
-
}
|
|
1122
|
-
getDirection() {
|
|
1123
|
-
return this.getDirectionStatement()?.value ?? de;
|
|
1124
|
-
}
|
|
1125
|
-
setDirection(e) {
|
|
1126
|
-
const s = this.getDirectionStatement();
|
|
1127
|
-
s ? s.value = e : this.rootDoc.unshift({ stmt: Ot, value: e });
|
|
1128
|
-
}
|
|
1129
|
-
trimColon(e) {
|
|
1130
|
-
return e.startsWith(":") ? e.slice(1).trim() : e.trim();
|
|
1131
|
-
}
|
|
1132
|
-
getData() {
|
|
1133
|
-
const e = w();
|
|
1134
|
-
return {
|
|
1135
|
-
nodes: this.nodes,
|
|
1136
|
-
edges: this.edges,
|
|
1137
|
-
other: {},
|
|
1138
|
-
config: e,
|
|
1139
|
-
direction: Kt(this.getRootDocV2())
|
|
1140
|
-
};
|
|
1141
|
-
}
|
|
1142
|
-
getConfig() {
|
|
1143
|
-
return w().state;
|
|
1144
|
-
}
|
|
1145
|
-
}, u(j, "StateDB"), j.relationType = {
|
|
1146
|
-
AGGREGATION: 0,
|
|
1147
|
-
EXTENSION: 1,
|
|
1148
|
-
COMPOSITION: 2,
|
|
1149
|
-
DEPENDENCY: 3
|
|
1150
|
-
}, j), Pe = /* @__PURE__ */ u((t) => `
|
|
1151
|
-
defs #statediagram-barbEnd {
|
|
1152
|
-
fill: ${t.transitionColor};
|
|
1153
|
-
stroke: ${t.transitionColor};
|
|
1154
|
-
}
|
|
1155
|
-
g.stateGroup text {
|
|
1156
|
-
fill: ${t.nodeBorder};
|
|
1157
|
-
stroke: none;
|
|
1158
|
-
font-size: 10px;
|
|
1159
|
-
}
|
|
1160
|
-
g.stateGroup text {
|
|
1161
|
-
fill: ${t.textColor};
|
|
1162
|
-
stroke: none;
|
|
1163
|
-
font-size: 10px;
|
|
1164
|
-
|
|
1165
|
-
}
|
|
1166
|
-
g.stateGroup .state-title {
|
|
1167
|
-
font-weight: bolder;
|
|
1168
|
-
fill: ${t.stateLabelColor};
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
g.stateGroup rect {
|
|
1172
|
-
fill: ${t.mainBkg};
|
|
1173
|
-
stroke: ${t.nodeBorder};
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
g.stateGroup line {
|
|
1177
|
-
stroke: ${t.lineColor};
|
|
1178
|
-
stroke-width: 1;
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
.transition {
|
|
1182
|
-
stroke: ${t.transitionColor};
|
|
1183
|
-
stroke-width: 1;
|
|
1184
|
-
fill: none;
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
.stateGroup .composit {
|
|
1188
|
-
fill: ${t.background};
|
|
1189
|
-
border-bottom: 1px
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
.stateGroup .alt-composit {
|
|
1193
|
-
fill: #e0e0e0;
|
|
1194
|
-
border-bottom: 1px
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
.state-note {
|
|
1198
|
-
stroke: ${t.noteBorderColor};
|
|
1199
|
-
fill: ${t.noteBkgColor};
|
|
1200
|
-
|
|
1201
|
-
text {
|
|
1202
|
-
fill: ${t.noteTextColor};
|
|
1203
|
-
stroke: none;
|
|
1204
|
-
font-size: 10px;
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
.stateLabel .box {
|
|
1209
|
-
stroke: none;
|
|
1210
|
-
stroke-width: 0;
|
|
1211
|
-
fill: ${t.mainBkg};
|
|
1212
|
-
opacity: 0.5;
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
.edgeLabel .label rect {
|
|
1216
|
-
fill: ${t.labelBackgroundColor};
|
|
1217
|
-
opacity: 0.5;
|
|
1218
|
-
}
|
|
1219
|
-
.edgeLabel {
|
|
1220
|
-
background-color: ${t.edgeLabelBackground};
|
|
1221
|
-
p {
|
|
1222
|
-
background-color: ${t.edgeLabelBackground};
|
|
1223
|
-
}
|
|
1224
|
-
rect {
|
|
1225
|
-
opacity: 0.5;
|
|
1226
|
-
background-color: ${t.edgeLabelBackground};
|
|
1227
|
-
fill: ${t.edgeLabelBackground};
|
|
1228
|
-
}
|
|
1229
|
-
text-align: center;
|
|
1230
|
-
}
|
|
1231
|
-
.edgeLabel .label text {
|
|
1232
|
-
fill: ${t.transitionLabelColor || t.tertiaryTextColor};
|
|
1233
|
-
}
|
|
1234
|
-
.label div .edgeLabel {
|
|
1235
|
-
color: ${t.transitionLabelColor || t.tertiaryTextColor};
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
.stateLabel text {
|
|
1239
|
-
fill: ${t.stateLabelColor};
|
|
1240
|
-
font-size: 10px;
|
|
1241
|
-
font-weight: bold;
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
.node circle.state-start {
|
|
1245
|
-
fill: ${t.specialStateColor};
|
|
1246
|
-
stroke: ${t.specialStateColor};
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
.node .fork-join {
|
|
1250
|
-
fill: ${t.specialStateColor};
|
|
1251
|
-
stroke: ${t.specialStateColor};
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
.node circle.state-end {
|
|
1255
|
-
fill: ${t.innerEndBackground};
|
|
1256
|
-
stroke: ${t.background};
|
|
1257
|
-
stroke-width: 1.5
|
|
1258
|
-
}
|
|
1259
|
-
.end-state-inner {
|
|
1260
|
-
fill: ${t.compositeBackground || t.background};
|
|
1261
|
-
// stroke: ${t.background};
|
|
1262
|
-
stroke-width: 1.5
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
.node rect {
|
|
1266
|
-
fill: ${t.stateBkg || t.mainBkg};
|
|
1267
|
-
stroke: ${t.stateBorder || t.nodeBorder};
|
|
1268
|
-
stroke-width: 1px;
|
|
1269
|
-
}
|
|
1270
|
-
.node polygon {
|
|
1271
|
-
fill: ${t.mainBkg};
|
|
1272
|
-
stroke: ${t.stateBorder || t.nodeBorder};;
|
|
1273
|
-
stroke-width: 1px;
|
|
1274
|
-
}
|
|
1275
|
-
#statediagram-barbEnd {
|
|
1276
|
-
fill: ${t.lineColor};
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
.statediagram-cluster rect {
|
|
1280
|
-
fill: ${t.compositeTitleBackground};
|
|
1281
|
-
stroke: ${t.stateBorder || t.nodeBorder};
|
|
1282
|
-
stroke-width: 1px;
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
.cluster-label, .nodeLabel {
|
|
1286
|
-
color: ${t.stateLabelColor};
|
|
1287
|
-
// line-height: 1;
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
.statediagram-cluster rect.outer {
|
|
1291
|
-
rx: 5px;
|
|
1292
|
-
ry: 5px;
|
|
1293
|
-
}
|
|
1294
|
-
.statediagram-state .divider {
|
|
1295
|
-
stroke: ${t.stateBorder || t.nodeBorder};
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
.statediagram-state .title-state {
|
|
1299
|
-
rx: 5px;
|
|
1300
|
-
ry: 5px;
|
|
1301
|
-
}
|
|
1302
|
-
.statediagram-cluster.statediagram-cluster .inner {
|
|
1303
|
-
fill: ${t.compositeBackground || t.background};
|
|
1304
|
-
}
|
|
1305
|
-
.statediagram-cluster.statediagram-cluster-alt .inner {
|
|
1306
|
-
fill: ${t.altBackground ? t.altBackground : "#efefef"};
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
.statediagram-cluster .inner {
|
|
1310
|
-
rx:0;
|
|
1311
|
-
ry:0;
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
|
-
.statediagram-state rect.basic {
|
|
1315
|
-
rx: 5px;
|
|
1316
|
-
ry: 5px;
|
|
1317
|
-
}
|
|
1318
|
-
.statediagram-state rect.divider {
|
|
1319
|
-
stroke-dasharray: 10,10;
|
|
1320
|
-
fill: ${t.altBackground ? t.altBackground : "#efefef"};
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
.note-edge {
|
|
1324
|
-
stroke-dasharray: 5;
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
.statediagram-note rect {
|
|
1328
|
-
fill: ${t.noteBkgColor};
|
|
1329
|
-
stroke: ${t.noteBorderColor};
|
|
1330
|
-
stroke-width: 1px;
|
|
1331
|
-
rx: 0;
|
|
1332
|
-
ry: 0;
|
|
1333
|
-
}
|
|
1334
|
-
.statediagram-note rect {
|
|
1335
|
-
fill: ${t.noteBkgColor};
|
|
1336
|
-
stroke: ${t.noteBorderColor};
|
|
1337
|
-
stroke-width: 1px;
|
|
1338
|
-
rx: 0;
|
|
1339
|
-
ry: 0;
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
.statediagram-note text {
|
|
1343
|
-
fill: ${t.noteTextColor};
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
.statediagram-note .nodeLabel {
|
|
1347
|
-
color: ${t.noteTextColor};
|
|
1348
|
-
}
|
|
1349
|
-
.statediagram .edgeLabel {
|
|
1350
|
-
color: red; // ${t.noteTextColor};
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
#dependencyStart, #dependencyEnd {
|
|
1354
|
-
fill: ${t.lineColor};
|
|
1355
|
-
stroke: ${t.lineColor};
|
|
1356
|
-
stroke-width: 1;
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
.statediagramTitleText {
|
|
1360
|
-
text-anchor: middle;
|
|
1361
|
-
font-size: 18px;
|
|
1362
|
-
fill: ${t.textColor};
|
|
1363
|
-
}
|
|
1364
|
-
`, "getStyles"), Ue = Pe;
|
|
1365
|
-
export {
|
|
1366
|
-
Me as S,
|
|
1367
|
-
Be as a,
|
|
1368
|
-
Ve as b,
|
|
1369
|
-
Ue as s
|
|
1370
|
-
};
|