@aiquants/markdown 11.2.0 → 11.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -11
- package/dist/{abnfDiagram-VRR7QNED-BKDymcgU.js → abnfDiagram-VRR7QNED-CBHDWVyi.js} +3 -3
- package/dist/{abnfDiagram-VRR7QNED-BrysG8di.cjs → abnfDiagram-VRR7QNED-RhtDe_7N.cjs} +1 -1
- package/dist/{arc-BB8-GmvF.cjs → arc-CM3wvUZ0.cjs} +1 -1
- package/dist/{arc-HSlzHLN5.js → arc-DTM_h6lx.js} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-DUr8yu65.cjs → architectureDiagram-ZJ3FMSHR-D2dRhNFv.cjs} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-Cw5TsOQY.js → architectureDiagram-ZJ3FMSHR-NRi6G3X3.js} +2 -2
- package/dist/{blockDiagram-677ZJIJ3-3fEMZifU.cjs → blockDiagram-677ZJIJ3-CHxk95XA.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-B4QKTXoS.js → blockDiagram-677ZJIJ3-CV8nnIV7.js} +3 -3
- package/dist/{c4Diagram-LMCZKHZV-Cr3HwHd7.cjs → c4Diagram-LMCZKHZV-BvbPlr0h.cjs} +1 -1
- package/dist/{c4Diagram-LMCZKHZV-BF-7sSPW.js → c4Diagram-LMCZKHZV-DoD_wB8P.js} +2 -2
- package/dist/{channel-0qa8ce6Q.js → channel-CTUWcSTH.js} +1 -1
- package/dist/{channel-CHciNRIB.cjs → channel-DqD7QHJJ.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-3IUhxfJe.cjs → chunk-2Q5K7J3B-BrFIRhHf.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-BhPb31Ds.js → chunk-2Q5K7J3B-Cxwan1Kr.js} +1 -1
- package/dist/{chunk-32BRIVSS-D5djvojF.cjs → chunk-32BRIVSS-BQp-ZQs_.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-BGg_X4L2.js → chunk-32BRIVSS-L7r_G8HL.js} +1 -1
- package/dist/{chunk-5VM5RSS4-BiHk_ZMt.js → chunk-5VM5RSS4-D8617CsW.js} +1 -1
- package/dist/{chunk-5VM5RSS4-BZ3BilMv.cjs → chunk-5VM5RSS4-txcIZk2V.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-C-ow5sUu.cjs → chunk-EX3LRPZG-C9LWVILV.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-C5kdwLBO.js → chunk-EX3LRPZG-DSgZX9T2.js} +4 -4
- package/dist/{chunk-JWPE2WC7-e5NtU9tE.cjs → chunk-JWPE2WC7-DPOD7SL9.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-DdePg2tx.js → chunk-JWPE2WC7-kIqdo6CF.js} +1 -1
- package/dist/{chunk-MOJQB5TN-BLSnD3t7.cjs → chunk-MOJQB5TN-C3IjuSDY.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-Dbd1TEnx.js → chunk-MOJQB5TN-DfEITzGw.js} +1 -1
- package/dist/{chunk-PUDLZKDR-hGJNph5n.cjs → chunk-PUDLZKDR-C7waD5EN.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-BsiVpD8V.js → chunk-PUDLZKDR-DCpimEnH.js} +6 -6
- package/dist/{chunk-RYQCIY6F-DX34sli0.cjs → chunk-RYQCIY6F-DD87UjzR.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-BUXnC2bE.js → chunk-RYQCIY6F-xEZx-wfp.js} +1 -1
- package/dist/{chunk-V7JOEXUC-CWk-EdL4.cjs → chunk-V7JOEXUC-CXNcuGNB.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-BQueT2fh.js → chunk-V7JOEXUC-CzBsdP3-.js} +5 -5
- package/dist/{chunk-VR4S4FIN-DI4PTMge.js → chunk-VR4S4FIN-CLDWDcHV.js} +1 -1
- package/dist/{chunk-VR4S4FIN-6fMMVlwy.cjs → chunk-VR4S4FIN-Cl5yJ6D5.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-0FVYkVuP.js → chunk-XXDRQBXY-DsBYLmqe.js} +1 -1
- package/dist/{chunk-XXDRQBXY-DcL_rCNu.cjs → chunk-XXDRQBXY-cbcKgiGG.cjs} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-DRGfIZdE.js → classDiagram-OUVF2IWQ-D5ws8Gla.js} +2 -2
- package/dist/{classDiagram-OUVF2IWQ-CEZdsWvZ.cjs → classDiagram-OUVF2IWQ-DpeVtgCa.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-DRGfIZdE.js → classDiagram-v2-EOCWNBFH-D5ws8Gla.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-CEZdsWvZ.cjs → classDiagram-v2-EOCWNBFH-DpeVtgCa.cjs} +1 -1
- package/dist/components/svgImageLabels.d.ts +3 -0
- package/dist/components/svgRaster.d.ts +8 -0
- package/dist/components/toolbar.d.ts +12 -0
- package/dist/converter.wasm +0 -0
- package/dist/{cose-bilkent-JH36ORCC-3kBRwN8L.js → cose-bilkent-JH36ORCC-B1gOmkEg.js} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-DjBFwUgZ.cjs → cose-bilkent-JH36ORCC-gLQPpHUk.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-COFBfMTD.js → cynefinDiagram-TSTJHNR4-919whoYx.js} +2 -2
- package/dist/{cynefinDiagram-TSTJHNR4-CHqP9wNf.cjs → cynefinDiagram-TSTJHNR4-BYBWPdDO.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-BiBZp1UZ.js → dagre-VKFMJZFB-CkWSnQUL.js} +2 -2
- package/dist/{dagre-VKFMJZFB-CfOPJOfT.cjs → dagre-VKFMJZFB-qi55jjuZ.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-DE88GkFP.js → diagram-FQU43EPY-BO3iobOs.js} +2 -2
- package/dist/{diagram-FQU43EPY-BWf-0ZaX.cjs → diagram-FQU43EPY-DSSMCztI.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-BmGTMih1.cjs → diagram-G47NLZAW-B09nXJfw.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-AGqBg4BW.js → diagram-G47NLZAW-Cf0tc0aA.js} +3 -3
- package/dist/{diagram-NH7WQ7WH-C_OQJCoz.js → diagram-NH7WQ7WH-BB6RW17H.js} +2 -2
- package/dist/{diagram-NH7WQ7WH-avUTm6At.cjs → diagram-NH7WQ7WH-Lyxwzvru.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-BcG8oYQH.js → diagram-OA4YK3LP-JaYkBo12.js} +3 -3
- package/dist/{diagram-OA4YK3LP-v4R9pnOp.cjs → diagram-OA4YK3LP-vvSPKQUH.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-DMANh2pW.cjs → diagram-WEI45ONY-BwyxNljM.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-B3f9-St7.js → diagram-WEI45ONY-Ca5HRdQN.js} +2 -2
- package/dist/{ebnfDiagram-CCIWWBDH-DViSMuU5.cjs → ebnfDiagram-CCIWWBDH-DdLMeyQC.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-DHMH95Qm.js → ebnfDiagram-CCIWWBDH-DiAw4CfJ.js} +3 -3
- package/dist/{erDiagram-Q63AITRT-HV9x1ciI.cjs → erDiagram-Q63AITRT-Bjm6ywZL.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-DrY-YSX7.js → erDiagram-Q63AITRT-C3uAJSXI.js} +4 -4
- package/dist/{extractHeadings-Boz4pTVy.js → extractHeadings-B6uw4Yra.js} +5510 -5438
- package/dist/{extractHeadings-UK9m7d29.cjs → extractHeadings-C13XIINZ.cjs} +87 -87
- package/dist/flowDiagram-23GEKE2U-C_wOwOVo.js +7 -0
- package/dist/flowDiagram-23GEKE2U-QtfsGltE.cjs +1 -0
- package/dist/{ganttDiagram-NO4QXBWP-BrcUlnJH.js → ganttDiagram-NO4QXBWP-DYmXJjT_.js} +2 -2
- package/dist/{ganttDiagram-NO4QXBWP-XbcZyqEG.cjs → ganttDiagram-NO4QXBWP-DsgcCBX-.cjs} +1 -1
- package/dist/{gitGraphDiagram-IHSO6WYX-DDgZkg3G.cjs → gitGraphDiagram-IHSO6WYX-Dif1CkFs.cjs} +1 -1
- package/dist/{gitGraphDiagram-IHSO6WYX-Dqk3F0Su.js → gitGraphDiagram-IHSO6WYX-DrVk6UCc.js} +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-DM1S6-Hc.cjs → infoDiagram-FWYZ7A6U-C0lktmoS.cjs} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-a32XjwX5.js → infoDiagram-FWYZ7A6U-sn774MmG.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-DWsA1PP7.js → ishikawaDiagram-FXEZZL3T-CO2dFzp0.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-CHzSqzMH.cjs → ishikawaDiagram-FXEZZL3T-FxqvFozF.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-Cis5Fa71.cjs → journeyDiagram-5HDEW3XC-BWtP4L5i.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-CkVTUCEp.js → journeyDiagram-5HDEW3XC-DR9yN3TX.js} +4 -4
- package/dist/{kanban-definition-HUTT4EX6-DcANcb4G.cjs → kanban-definition-HUTT4EX6-06pnLnb8.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-B30ORUDT.js → kanban-definition-HUTT4EX6-C0ais5E8.js} +2 -2
- package/dist/{linear-CAd-44F2.cjs → linear-BdAEOCTg.cjs} +1 -1
- package/dist/{linear-uw6vQWir.js → linear-C1ElxCAF.js} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-CP0bNnn-.cjs → mindmap-definition-LN4V7U3C-B2fkPG93.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-D-yIE9Kv.js → mindmap-definition-LN4V7U3C-DV9IVNXB.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-BOdy4HUA.js → pegDiagram-2B236MQR-BqyUnioq.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-Brh5cxKw.cjs → pegDiagram-2B236MQR-mbYpu4tr.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-CEaHvWUM.cjs → pieDiagram-ENE6RG2P-BRnxo4U8.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-1cY-R9MG.js → pieDiagram-ENE6RG2P-Bt1RRvjY.js} +3 -3
- package/dist/{quadrantDiagram-ABIIQ3AL-C5CTuaUm.cjs → quadrantDiagram-ABIIQ3AL-BUFLtZUw.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-CbZZ5GEh.js → quadrantDiagram-ABIIQ3AL-Dw51VXFI.js} +2 -2
- package/dist/{railroadDiagram-RFXS5EU6-DThY6dTL.js → railroadDiagram-RFXS5EU6-CmOA5o_d.js} +3 -3
- package/dist/{railroadDiagram-RFXS5EU6-C6-tc-QZ.cjs → railroadDiagram-RFXS5EU6-UM6xkPjd.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-h_ZfNqUh.cjs → requirementDiagram-TGXJPOKE-8ArbyRU3.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-BwtXYJtb.js → requirementDiagram-TGXJPOKE-Dqm0JbUO.js} +3 -3
- package/dist/{sankeyDiagram-HTMAVEWB-DkwdXFCH.js → sankeyDiagram-HTMAVEWB-B5vAZunk.js} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-DalNC8XY.cjs → sankeyDiagram-HTMAVEWB-DZ8GFTQp.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-BE2rVf2w.cjs → sequenceDiagram-DBY2YBRQ-Gn5MDMnL.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-CZHBSmBp.js → sequenceDiagram-DBY2YBRQ-uuuSzhVp.js} +3 -3
- package/dist/{sizeCapture-X5ZJPWSS-o-wx7oGH.js → sizeCapture-X5ZJPWSS-8MTcAVtS.js} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-CiSkHK1v.cjs → sizeCapture-X5ZJPWSS-BYPlek4L.cjs} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-C2yZajhM.js → stateDiagram-2N3HPSRC-B26FS7jn.js} +2 -2
- package/dist/{stateDiagram-2N3HPSRC-Cts12p59.cjs → stateDiagram-2N3HPSRC-DcMx4da-.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-B8p1-c97.cjs → stateDiagram-v2-6OUMAXLB-ByTp0tao.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-VE-c3q_l.js → stateDiagram-v2-6OUMAXLB-DwHp4lqJ.js} +2 -2
- package/dist/styles/markdown.css +1 -1
- package/dist/styles/markdown.standalone.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-DeNuvXGa.cjs → swimlanes-5IMT3BWC-COEdbJMp.cjs} +1 -1
- package/dist/{swimlanes-5IMT3BWC-TTTBHYYv.js → swimlanes-5IMT3BWC-SbQF6zqF.js} +3 -3
- package/dist/{swimlanesDiagram-G3AALYLV-Bxz106Lt.cjs → swimlanesDiagram-G3AALYLV-C0gqMROP.cjs} +1 -1
- package/dist/{swimlanesDiagram-G3AALYLV-Buup5yvb.js → swimlanesDiagram-G3AALYLV-DAdz3_b7.js} +2 -2
- package/dist/{timeline-definition-FHXFAJF6-c15QQTDf.cjs → timeline-definition-FHXFAJF6-DZGHbSpR.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-C_zjmLAX.js → timeline-definition-FHXFAJF6-fmCUTBQj.js} +2 -2
- package/dist/{vennDiagram-L72KCM5P-CjX3W2Ne.cjs → vennDiagram-L72KCM5P-CsNtbCv1.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-DNLnBVJ_.js → vennDiagram-L72KCM5P-DwEGVrpl.js} +1 -1
- package/dist/{wardleyDiagram-EHGQE667-CjE65uje.js → wardleyDiagram-EHGQE667-BV41ARvm.js} +2 -2
- package/dist/{wardleyDiagram-EHGQE667-UlY3HJxP.cjs → wardleyDiagram-EHGQE667-DJUb0osY.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-DziQHnEA.js → xychartDiagram-FW5EYKEG-B1Pmn4Zf.js} +2 -2
- package/dist/{xychartDiagram-FW5EYKEG-DDVfULUl.cjs → xychartDiagram-FW5EYKEG-DD-HPA7H.cjs} +1 -1
- package/package.json +7 -7
- package/dist/flowDiagram-23GEKE2U-Cw3lE3iu.cjs +0 -1
- package/dist/flowDiagram-23GEKE2U-DeQftLq7.js +0 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var fC=Object.create;var Wh=Object.defineProperty;var gC=Object.getOwnPropertyDescriptor;var pC=Object.getOwnPropertyNames;var mC=Object.getPrototypeOf,yC=Object.prototype.hasOwnProperty;var xC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of pC(t))!yC.call(e,o)&&o!==r&&Wh(e,o,{get:()=>t[o],enumerable:!(i=gC(t,o))||i.enumerable});return e};var Hh=(e,t,r)=>(r=e!=null?fC(mC(e)):{},xC(t||!e||!e.__esModule?Wh(r,"default",{value:e,enumerable:!0}):r,e));const L=require("react"),Ne=require("./linkCards-Bjd_vW39.cjs"),Rr=require("./providers-DO2t7ks4.cjs"),Yi=require("./viewer-settings.cjs"),wt=require("html-react-parser"),It=require("./code-blocks-Bax5Xik7.cjs"),cr=require("./embeds.cjs"),vi=require("./source-lines.cjs"),fn=require("./simple-logger-9yf7ypyB.cjs"),gn=require("shiki"),Ti=require("dompurify"),oe=require("@aiquants/spreadsheet/view"),Qs=require("@aiquants/spreadsheet/tsv"),CC=require("github-slugger"),bC=require("katex"),fe=require("unist-util-visit"),_i=(e,t)=>{const r={};for(const i of Object.keys(e)){const o=t?.[i];if(o===void 0){r[i]=e[i];continue}if(typeof o!="string")throw new TypeError(`[@aiquants/markdown] label "${i}" must be a string; got ${o===null?"null":typeof o}`);r[i]={text:o,lang:void 0}}return Object.freeze(r)},Js=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},ta=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),kC=Js(ta),Jd=e=>_i(ta,e),wC=Jd(void 0);function tu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zo={exports:{}},Ui={};var Yh;function SC(){if(Yh)return Ui;Yh=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var n in o)n!=="key"&&(s[n]=o[n])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:a,ref:o!==void 0?o:null,props:s}}return Ui.Fragment=t,Ui.jsx=r,Ui.jsxs=r,Ui}var Gi={};var Uh;function vC(){return Uh||(Uh=1,process.env.NODE_ENV!=="production"&&(function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===P?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case _:return"Suspense";case E:return"SuspenseList";case M:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case m:return"Portal";case S:return T.displayName||"Context";case w:return(T._context.displayName||"Context")+".Consumer";case v:var W=T.render;return T=T.displayName,T||(T=W.displayName||W.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case B:return W=T.displayName||null,W!==null?W:e(T.type)||"Memo";case D:W=T._payload,T=T._init;try{return e(T(W))}catch{}}return null}function t(T){return""+T}function r(T){try{t(T);var W=!1}catch{W=!0}if(W){W=console;var z=W.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return z.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(T)}}function i(T){if(T===y)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===D)return"<...>";try{var W=e(T);return W?"<"+W+">":"<...>"}catch{return"<...>"}}function o(){var T=U.A;return T===null?null:T.getOwner()}function s(){return Error("react-stack-top-frame")}function a(T){if(N.call(T,"key")){var W=Object.getOwnPropertyDescriptor(T,"key").get;if(W&&W.isReactWarning)return!1}return T.key!==void 0}function n(T,W){function z(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}z.isReactWarning=!0,Object.defineProperty(T,"key",{get:z,configurable:!0})}function l(){var T=e(this.type);return O[T]||(O[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function c(T,W,z,X,G,K){var Z=z.ref;return T={$$typeof:g,type:T,key:W,props:z,_owner:X},(Z!==void 0?Z:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:l}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function h(T,W,z,X,G,K){var Z=W.children;if(Z!==void 0)if(X)if(q(Z)){for(X=0;X<Z.length;X++)d(Z[X]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(Z);if(N.call(W,"key")){Z=e(T);var at=Object.keys(W).filter(function(ut){return ut!=="key"});X=0<at.length?"{key: someKey, "+at.join(": ..., ")+": ...}":"{key: someKey}",j[Z+X]||(at=0<at.length?"{"+at.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,G,Q,nt,Q),j[Q+G]=!0)}if(Q=null,z!==void 0&&(r(z),Q=""+z),a(W)&&(r(W.key),Q=""+W.key),"key"in W){z={};for(var gt in W)gt!=="key"&&(z[gt]=W[gt])}else z=W;return Q&&n(z,typeof T=="function"?T.displayName||T.name||"Unknown":T),c(T,Q,z,o(),X,K)}function d(T){u(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===I&&(T._payload.status==="fulfilled"?u(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function u(T){return typeof T=="object"&&T!==null&&T.$$typeof===p}var f=L,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),S=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),U=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,N=Array.isArray,A=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(T){return T()}};var F,P={},O=f.react_stack_bottom_frame.bind(f,s)(),$=A(i(s)),j={};Xi.Fragment=y,Xi.jsx=function(T,W,z){var G=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,z,!1,G?Error("react-stack-top-frame"):O,G?A(i(T)):$)},Xi.jsxs=function(T,W,z){var G=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,z,!0,G?Error("react-stack-top-frame"):O,G?A(i(T)):$)}})()),Xi}var Uh;function wC(){return Uh||(Uh=1,process.env.NODE_ENV==="production"?qo.exports=bC():qo.exports=kC()),qo.exports}var w=wC();const Xh=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),SC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),vC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),TC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),_C=Object.freeze({scrollbarWidth:"none"}),BC=.01,Gh=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Fa=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},LC=(e,t,r)=>{const i=getComputedStyle(e),o=Fa(i.width),s=e.getBoundingClientRect();if(o<=0||s.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=s.width/o,n=(s.width-t.getBoundingClientRect().width)/a-Fa(i.borderLeftWidth)-Fa(i.borderRightWidth),l=Math.max(0,Math.ceil(n-BC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},EC=(e,t,r,i,o)=>{const[s,a]=L.useState(Gh),n=L.useRef(o),l=L.useRef(0);return L.useLayoutEffect(()=>{n.current=o}),L.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,u=i.current;if(!e||h===null||d===null||u===null){a(Gh),c(0);return}const f=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=LC(h,d,u);a(C=>C.scroller===h&&C.barInlineSize===m&&C.nativeBarInlineSize===y&&C.overlaysScrollbars===x?C:Object.freeze({scroller:h,barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x})),c(m)};f();const p=new ResizeObserver(f);return p.observe(h),p.observe(d),p.observe(u),window.addEventListener("resize",f),()=>{p.disconnect(),window.removeEventListener("resize",f)}},[e,t,r,i]),s},FC=(e,t)=>{if(typeof e=="function"){const r=e(t);return typeof r=="function"?r:()=>e(null)}return e!=null?(e.current=t,()=>{e.current=null}):()=>{}};function Qd({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:a}){const n=L.useRef(null),l=L.useRef(null),c=L.useRef(null),h=i!==void 0,d=EC(h,n,l,c,a),u=L.useCallback(m=>{n.current=m;const y=FC(t,m);return()=>{n.current=null,y()}},[t]),f=h?{...e.style,position:"relative",boxSizing:"border-box",overflowY:"scroll",width:`calc(100% + ${d.nativeBarInlineSize}px)`,...d.overlaysScrollbars?_C:void 0}:e.style,p=w.jsxs("div",{...e,ref:u,style:f,children:[r,h&&w.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:TC})]});return h?w.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?Xh:{...Xh,...s},children:[w.jsx("div",{"data-aqmd-scroll-clip":!0,style:SC,children:p}),w.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:vC,children:d.scroller!==null&&i(d.scroller)})]}):p}const AC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),Vh=e=>{const t=MC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Jd=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),$C=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var OC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const RC=L.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:a,...n},l)=>L.createElement("svg",{ref:l,...OC,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Jd("lucide",o),...!s&&!$C(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>L.createElement(c,h)),...Array.isArray(s)?s:[s]]));const Tt=(e,t)=>{const r=L.forwardRef(({className:i,...o},s)=>L.createElement(RC,{ref:s,iconNode:t,className:Jd(`lucide-${AC(Vh(e))}`,`lucide-${e}`,i),...o}));return r.displayName=Vh(e),r};const IC=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],PC=Tt("image-off",IC);class DC extends L.Component{constructor(t){super(t),this.state={content:t.content,failed:!1}}static getDerivedStateFromProps(t,r){return t.content===r.content?null:{content:t.content,failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?w.jsxs("div",{"data-aqmd-block-failure":"",children:[w.jsx("p",{"data-aqmd-block-failure-notice":"",lang:this.props.label.lang,children:this.props.label.text}),w.jsx("pre",{"data-aqmd-block-failure-text":"",children:this.props.text()})]}):this.props.children}}const tu=Object.freeze({blockFailed:{text:"This block could not be shown.",lang:"en"}}),NC=1024,Cs=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,qC=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&Cs(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&Cs(e[e.length-1-i],t[t.length-1-i]);)i+=1;const o=Array.from({length:r},(n,l)=>[l,l]),s=Array.from({length:i},(n,l)=>[e.length-i+l,t.length-i+l]),a=zC(e,t,r,e.length-i,t.length-i);return[...o,...a,...s]},zC=(e,t,r,i,o)=>{const s=new Set(e.slice(r,i).map(S=>S.fingerprint)),a=new Set(t.slice(r,o).map(S=>S.fingerprint)),n=[];for(let S=r;S<i;S+=1)a.has(e[S].fingerprint)&&n.push(S);const l=[];for(let S=r;S<o;S+=1)s.has(t[S].fingerprint)&&l.push(S);const c=n.length,h=l.length;if(c===0||h===0)return[];const d=(S,v)=>Cs(e[n[S]],t[l[v]]),u=(S,v)=>e[n[S]].fingerprint===t[l[v]].fingerprint,f=(S,v)=>{let _=S;for(;_<c&&_+v<h&&d(_,_+v);)_+=1;return _},p=[Int32Array.of(f(0,0))],m=[Uint8Array.of(Aa)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&p[x][y+x]===c);){if(x+=1,x>NC)return[];const S=p[x-1],v=B=>B>=-(x-1)&&B<=x-1?S[B+x-1]:-1,_=new Int32Array(2*x+1).fill(-1),E=new Uint8Array(2*x+1);for(let B=-x;B<=x;B+=1){if(B<-c||B>h)continue;let I=-1,M=Aa;const D=v(B);D!==-1&&D<c&&D+B<h&&u(D,D+B)&&(I=D+1,M=Kh);const U=v(B+1);U!==-1&&U+1<=c&&U+1>I&&(I=U+1,M=Zh);const q=v(B-1);q!==-1&&q+B<=h&&q>I&&(I=q,M=Ma),I!==-1&&(_[B+x]=f(I,B),E[B+x]=M)}p.push(_),m.push(E)}const C=[];let k=y;for(let S=x;S>=0;S-=1){const v=p[S][k+S],_=m[S][k+S],E=_===Zh?k+1:_===Ma?k-1:k,B=_===Aa?0:p[S-1][E+S-1]+(_===Ma?0:1);for(let I=v-1;I>=B;I-=1)C.push([n[I],l[I+k]]);_===Kh&&C.push([n[B-1],l[B-1+k]]),k=E}return C.reverse()},Aa=0,Kh=1,Zh=2,Ma=3,jC=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[n,l]of qC(t,e))r[l]=t[n].key,i.add(n);const o=new Map;for(const[n,l]of t.entries()){if(i.has(n))continue;const c=o.get(l.fingerprint);c===void 0?o.set(l.fingerprint,[n]):c.push(n)}const s=n=>{for(const[l,c]of e.entries()){if(r[l]!==null)continue;const h=o.get(c.fingerprint),d=h===void 0?-1:h.findIndex(u=>n(c,t[u]));h!==void 0&&d!==-1&&(r[l]=t[h.splice(d,1)[0]].key)}};s(Cs),s(()=>!0);const a=new Set(r.filter(n=>n!==null));return e.map((n,l)=>{let c=r[l];if(c===null){let h=0;for(;a.has(`${n.fingerprint}.${h}`);)h+=1;c=`${n.fingerprint}.${h}`,a.add(c)}return{...n,key:c}})};const WC=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],HC=Tt("building-2",WC);const YC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Qh=Tt("globe",YC),UC=/^[a-z]{2,3}$/u,XC=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return UC.test(t)?t:null},GC=()=>()=>{},VC=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},Sl=()=>L.useSyncExternalStore(GC,()=>window.location.origin,()=>null),KC=()=>L.useSyncExternalStore(VC,()=>XC(document.documentElement.lang),()=>null),ZC=/^[1-9]\d{0,4}$/u,Jh=e=>e!==void 0&&ZC.test(e.trim())?Number(e.trim()):null,QC=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=Sl(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const a=Jh(e.attributes.width),n=Jh(e.attributes.height),l=a!==null&&n!==null?{width:"100%",maxWidth:`${a}px`,aspectRatio:`${a} / ${n}`}:void 0,c=e.attributes.title,h=c===void 0?t.lang:void 0;return w.jsx("span",{"data-embed-frame":o===null?"pending":"refused","data-aqmd-embed-surface":l===void 0?void 0:"",style:l,className:l===void 0?void 0:"flex items-center justify-center rounded-lg p-2 text-center",children:r?w.jsx("span",{lang:h,children:`${c??t.text}: ${s.hostname}`}):w.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${s.hostname}`})})},eu=({concurrency:e,capacity:t,timeoutMs:r})=>{for(const[h,d]of Object.entries({concurrency:e,capacity:t,timeoutMs:r}))if(!Number.isInteger(d)||d<=0)throw new RangeError(`[@aiquants/markdown] request queue ${h} must be a positive integer; got ${String(d)}`);const i=new Map,o=new Map,s=[];let a=0;const n=(h,d,u)=>{if(o.get(h)===d&&(o.delete(h),u!==null)){i.set(h,u);for(const f of i.keys()){if(i.size<=t)break;i.delete(f)}for(const f of d.subscriptions)f.listener(u)}},l=()=>{for(;a<e;){const h=s.shift();if(h===void 0)return;const d=o.get(h);if(d===void 0)continue;const u=new AbortController;d.controller=u,a+=1,new Promise(f=>f(d.start(AbortSignal.any([u.signal,AbortSignal.timeout(r)])))).then(f=>n(h,d,{ok:!0,value:f}),()=>n(h,d,u.signal.aborted?null:{ok:!1})).finally(()=>{a-=1,l()})}};return Object.freeze({subscribe:(h,d,u)=>{const f=i.get(h);if(f!==void 0)return i.delete(h),i.set(h,f),u(f),()=>{};let p=o.get(h);p===void 0&&(p={start:d,subscriptions:new Set,controller:null},o.set(h,p),s.push(h));const m=p,y={listener:u};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||o.get(h)!==m)&&(o.delete(h),m.controller===null?s.splice(s.indexOf(h),1):m.controller.abort())}}})},JC=eu({concurrency:2,capacity:256,timeoutMs:15e3}),tb="[data-aqmd-scroll-container]",eb=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(s){if(t.aborted)throw s;return{kind:"error",cause:"network error"}}if(r.status===204){const s=Ne.linkCardSkipReasonOf(r.headers.get(Ne.LINK_CARD_SKIP_HEADER));return s===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:s}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(s){if(t.aborted)throw s;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const o=Ne.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},rb=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",tc=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,$a=({tile:e,tileKind:t,primary:r,secondary:i})=>w.jsxs("span",{className:"flex min-w-0 flex-auto items-center gap-3 px-3",children:[w.jsx("span",{"aria-hidden":"true","data-link-card-icon":t,className:`flex size-8 shrink-0 items-center justify-center rounded-md bg-(--aqmd-link-card-bg-hover) text-(--aqmd-link-card-muted) ${t==="pending"?"motion-safe:animate-pulse":""}`,children:e}),w.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[w.jsx("span",{className:"truncate font-semibold text-[0.875rem] leading-5",children:r}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:i})]})]}),ib=({href:e,endpoint:t,size:r,fallback:i})=>{const o=Sl(),s=L.useRef(null),a=new URL(e),n=`${t}
|
|
7
|
-
${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const k=new IntersectionObserver(S=>{C!==null||!S.some(v=>v.isIntersecting)||(k.disconnect(),C=JC.subscribe(n,v=>eb(Ne.linkCardRequestOf(t,new URL(e),o),v),v=>{c({key:n,outcome:v});const _=rb(v);_!==null&&un.linkCardLogger.info(`No link card for ${e} (${_})`)}))},{root:x.closest(tb),rootMargin:"100% 0px"});return k.observe(x),()=>{k.disconnect(),C?.()}},[n,t,e,o]);const h=l!==null&&l.key===n?l.outcome:null;if(h!==null&&!h.ok)return i;const d=h===null?null:h.value;if(d!==null&&d.kind==="error")return i;if(d===null||o===null)return w.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","aria-busy":"true","data-link-card":"pending","data-link-card-size":r,children:r==="compact"?w.jsx($a,{tile:null,tileKind:"pending",primary:a.hostname,secondary:e}):w.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-2 px-4 py-3.5",children:[w.jsx("span",{"aria-hidden":"true",className:"block h-3.5 w-2/3 rounded bg-(--aqmd-link-card-border) motion-safe:animate-pulse"}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem]",children:a.hostname}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:e})]})});if(d.kind==="skip"){const{reason:x}=d,C=x==="private-network",k=C?HC:Qh;return w.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"compact","data-link-card-reason":x,"data-link-card-size":"compact",children:w.jsx($a,{tile:w.jsx(k,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:a.hostname,secondary:e})})}const{metadata:u}=d,f=new URL(o).hostname,p=tc(u.image,f),m=tc(u.icon,f),y=u.siteName===null?a.hostname:`${u.siteName} · ${a.hostname}`;return r==="compact"?w.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:w.jsx($a,{tile:m===null?w.jsx(Qh,{"aria-hidden":"true",className:"size-4"}):w.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 rounded-[3px]"}),tileKind:m===null?"link":"favicon",primary:u.title??e,secondary:y})}):w.jsxs("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":r,children:[w.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1 px-4 py-3.5",children:[w.jsx("span",{className:"wrap-anywhere line-clamp-2 font-semibold text-[0.9375rem] leading-5",children:u.title??e}),u.description===null?null:w.jsx("span",{className:`wrap-anywhere text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem] ${r==="banner"?"line-clamp-1":"line-clamp-2"}`,children:u.description}),w.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-(--aqmd-link-card-muted) text-xs leading-4",children:[m===null?null:w.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 shrink-0 rounded-[3px]"}),w.jsx("span",{className:"truncate",children:y})]})]}),p===null?null:w.jsx("img",{src:p,alt:"",loading:"lazy",referrerPolicy:"no-referrer"})]})},ru=e=>{if(!Array.isArray(e.providers))throw new RangeError(`[@aiquants/markdown] embeds.providers must be an array of provider ids; got ${typeof e.providers}`);for(const t of e.providers)if(!Rr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Rr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!Ne.isLinkCardEndpoint(e.linkCardEndpoint))throw new RangeError(`[@aiquants/markdown] embeds.linkCardEndpoint must be null or an absolute path without a trailing "/" (segments of A-Z a-z 0-9 . _ ~ -, no "." or ".."); got ${JSON.stringify(e.linkCardEndpoint)}`);if(e.linkCardSize!==void 0&&!Ne.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${Ne.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},ro=new WeakMap;let zo=0;const ec=e=>{if(e.source===null)return;const t=ro.get(e.source);if(t===void 0||e.origin!==t.watch.origin)return;const r=t.watch.heightOf(e.data,t.watch.src);if(r===null||!Number.isFinite(r))return;const i=Math.min(Rr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(Rr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},ob=(e,t)=>{const r={watch:t,last:null};return ro.has(e)||(zo+=1,zo===1&&window.addEventListener("message",ec)),ro.set(e,r),()=>{ro.get(e)===r&&(ro.delete(e),zo-=1,zo===0&&window.removeEventListener("message",ec))}},sb=eu({concurrency:2,capacity:256,timeoutMs:5e3}),ab=async(e,t)=>{const r=await fetch(e,{credentials:"omit",redirect:"error",referrerPolicy:"no-referrer",headers:{accept:"application/json"},signal:t});if(!r.ok)throw new Error(`[@aiquants/markdown] embed lookup answered ${r.status}`);return await r.json()},nb=(e,t)=>{const r=e.maxWidth===null?void 0:`${e.maxWidth}px`;switch(e.kind){case"aspect":return{width:"100%",maxWidth:r,aspectRatio:`${e.ratio[0]} / ${e.ratio[1]}`};case"fixed":return{width:"100%",maxWidth:r,height:`${e.height}px`};case"message":return{width:"100%",maxWidth:r,height:`${t??e.initialHeight}px`}}},lb=Object.freeze({marginInline:0}),Oa=Object.freeze({kind:"pending"}),hb=Object.freeze({kind:"narrow"}),cb=Object.freeze({kind:"fallback"}),db=(e,t,r,i,o)=>{if(t===null)return Oa;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return Oa;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return cb;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(o===null)return Oa;if(Math.min(o,n??Number.POSITIVE_INFINITY)<a)return hb}return{kind:"frame",src:s}},ub=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=Sl(),a=KC(),[n,l]=L.useState(null),[c,h]=L.useState(null),d=e.kind==="lookup"?e.request.href:null,[u,f]=L.useState(null);L.useEffect(()=>{if(d!==null)return sb.subscribe(d,B=>ab(new URL(d),B),B=>f({key:d,outcome:B}))},[d]);const{provider:p,layout:m}=e,y=db(e,s,{theme:i,lang:a},u!==null&&u.key===d?u.outcome:null,n),x=L.useCallback(B=>{if(B===null)return;l(B.getBoundingClientRect().width);const I=new ResizeObserver(()=>l(B.getBoundingClientRect().width));return I.observe(B),()=>I.disconnect()},[]),C=y.kind==="frame"?y.src:null,k=c!==null&&c.src===C?c.height:null,S=L.useCallback(B=>{if(!(B===null||B.contentWindow===null||m.kind!=="message"||C===null))return ob(B.contentWindow,{origin:p.frameOrigin,src:C,heightOf:m.heightOf,set:I=>h({src:C,height:I})})},[m,p.frameOrigin,C]);if(y.kind==="fallback")return r;const v=m.minWidth===null?null:w.jsx("span",{ref:x,"aria-hidden":"true","data-embed-measure":p.id,className:"block h-0"});if(y.kind==="narrow")return w.jsxs(w.Fragment,{children:[v,r]});const _=p.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:E}=p;return w.jsxs(w.Fragment,{children:[v,w.jsxs("figure",{"data-embed-provider":p.id,"data-embed-state":y.kind,style:lb,children:[w.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:nb(m,k),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?w.jsx("iframe",{ref:S,src:y.src,title:`${p.name}: ${_.text}`,lang:_.lang,loading:"lazy",allow:E.allow??void 0,allowFullScreen:E.allowFullScreen,sandbox:E.sandbox,referrerPolicy:E.referrerPolicy,scrolling:E.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),w.jsx("figcaption",{className:"mt-2",children:t})]})]})},fb=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],pb=(e,t)=>cr.allowedFrameUrlOf(e,t)!==null,gb=(e,t)=>{const r=new Map(Object.entries(e).map(([s,a])=>[s.toLowerCase(),a])),i=cr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of fb){const a=r.get(s);if(a!==void 0)if(s==="allow"){const n=cr.reduceFrameFeatures(a);n!==null&&(o.allow=n)}else if(s==="referrerpolicy"){const n=a.trim().toLowerCase();cr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(o.referrerpolicy=n)}else o[s]=a}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},mb=new Set(["script","style","template","noscript","noembed","noframes","plaintext","xmp","title","head","meta","link","base","object","embed","applet","param","frame","frameset","select","datalist","track","math","foreignobject"]),yb=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),xb=new Set(["markdown-alert","markdown-alert-title","markdown-alert-note","markdown-alert-tip","markdown-alert-important","markdown-alert-warning","markdown-alert-caution","octicon","octicon-info","octicon-light-bulb","octicon-report","octicon-alert","octicon-stop","mr-2","message","message-symbol","message-content","alert","info","warning","markdown-details","markdown-details-content","footnotes","footnote-ref","footnote-backref","math","inline","display"]),rc="language-",Cb=/[\t\n\f\r ]+/u,bb=new Set(["h1","h2","h3","h4","h5","h6"]),ic=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),oc="user-content-",Gt=["align"],Jr=["width","height"],sc=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],Ra=Object.freeze({a:["href","name","hreflang","data-link-kind","data-doc-path","data-doc-exists","data-footnote-ref","data-footnote-backref"],abbr:[],address:[],article:[],aside:[],audio:["src","controls","loop","muted","preload"],b:[],bdi:[],bdo:[],blockquote:["cite"],br:[],caption:Gt,cite:[],code:[It.CODE_META_ATTRIBUTE],col:["span",...Gt,...Jr],colgroup:["span",...Gt,...Jr],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:Gt,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:Gt,h2:Gt,h3:Gt,h4:Gt,h5:Gt,h6:Gt,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...Gt,...Jr,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:Gt,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...Gt,"border",...Jr],tbody:[...Gt,"valign"],td:sc,tfoot:[...Gt,"valign"],th:sc,thead:[...Gt,"valign"],time:["datetime"],tr:[...Gt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...Jr],wbr:[]}),Ia=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...Jr],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),kb=new Set(["svg","g"]),wb=new Set(["href","src","cite","poster",cr.EMBED_LINK_ATTRIBUTE]),Sb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,vb=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,Tb=new Set(["left","right","center","justify","start","end"]),Mo=e=>vb.test(e.replace(Sb,"")),_b=e=>{let t=null;for(const r of e.split(";")){const i=r.indexOf(":");if(i<0||r.slice(0,i).trim().toLowerCase()!=="text-align")continue;const o=r.slice(i+1).trim().toLowerCase();Tb.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},Bb=e=>{const t=e.split(Cb).filter(r=>xb.has(r)||r.startsWith(rc)&&r.length>rc.length);return t.length===0?null:t.join(" ")},Lb=(e,t)=>bb.has(e)||t.startsWith(oc)&&t.length>oc.length||Object.hasOwn(ic,e)&&ic[e].test(t),Eb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();t.has(o)||t.set(o,i)}return t},Gi=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===vi.SOURCE_LINES_ATTRIBUTE){vi.parseSourceLines(s)!==null&&(i[o]=s);continue}if((yb.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(wb.has(o)&&!Mo(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!Lb(e,s))){if(o==="class"||o==="style"){const a=o==="class"?Bb(s):_b(s);a!==null&&(i[o]=a);continue}i[o]=s}}return i},Fb=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),ta=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=Eb(t);if(o!==null&&kb.has(o)){const n=i!=="svg"&&Object.hasOwn(Ia,i)?Ia[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:Gi(i,s,n)}}if(i==="svg")return{action:"keep",attributes:Gi(i,s,Ia.svg)};if(i==="iframe"){const n=gb(Object.fromEntries(s),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:s.get("data-plugin-type")??null}}if(i==="p"){const n=Gi(i,s,Ra.p),l=s.get(cr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&Mo(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return Fb(s)?{action:"keep",attributes:Gi(i,s,["type","checked","disabled"])}:{action:"remove"};if(mb.has(i))return{action:"remove"};const a=Object.hasOwn(Ra,i)?Ra[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:Gi(i,s,a)}};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,r){r=r||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r.bubbles,r.cancelable,r.detail),i}));const Ab=typeof document<"u"&&!!document.documentMode;let Pa;function Mb(){return Pa||(Pa=document.createElement("div").style)}const ac=["webkit","moz","ms"],jo={};function vl(e){if(jo[e])return jo[e];const t=Mb();if(e in t)return jo[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=ac.length;for(;i--;){const o=`${ac[i]}${r}`;if(o in t)return jo[e]=o}}function Wo(e,t){return parseFloat(t[vl(e)])||0}function Ho(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:Wo(`${t}Left${i}`,r),right:Wo(`${t}Right${i}`,r),top:Wo(`${t}Top${i}`,r),bottom:Wo(`${t}Bottom${i}`,r)}}function oi(e,t,r){e.style[vl(t)]=r}function $b(e,t){const r=vl("transform");oi(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function Ob(e,{x:t,y:r,scale:i,isSVG:o},s){if(oi(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&Ab){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Da(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),o=e.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:r,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,margin:Ho(e,"margin",r),border:Ho(e,"border",r)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:Ho(t,"padding",i),border:Ho(t,"border",i)}}}let Co={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Co={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Co={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Na(e,t,r,i){Co[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function qa(e,t,r){Co[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function iu(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function pn(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,pn(e,i);return}r=iu(e,t),r>-1&&e.splice(r,1),e.push(t)}function Rb(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=iu(e,t);r>-1&&e.splice(r,1)}function nc(e){e=e.slice(0);let t=e.pop(),r;for(;r=e.pop();)t={clientX:(r.clientX-t.clientX)/2+t.clientX,clientY:(r.clientY-t.clientY)/2+t.clientY};return t}function za(e){if(e.length<2)return 0;const t=e[0],r=e[1];return Math.sqrt(Math.pow(Math.abs(r.clientX-t.clientX),2)+Math.pow(Math.abs(r.clientY-t.clientY),2))}function Ib(e){let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function Pb(e){return(e.getAttribute("class")||"").trim()}function Db(e,t){return e.nodeType===1&&` ${Pb(e)} `.indexOf(` ${t} `)>-1}function Nb(e,t){for(let r=e;r!=null;r=r.parentNode)if(Db(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const qb=/^http:[\w\.\/]+svg$/;function zb(e){return qb.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function jb(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const ou={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:e=>{e.preventDefault(),e.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:Ob,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function su(e,t){if(!e)throw new Error("Panzoom requires an element as an argument");if(e.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!Ib(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...ou,...t};const r=zb(e),i=e.parentNode;i.style.overflow=t.overflow,i.style.userSelect="none",i.style.touchAction=t.touchAction,(t.canvas?i:e).style.cursor=t.cursor,e.style.userSelect="none",e.style.touchAction=t.touchAction,oi(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function o(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",oi(e,"transformOrigin","")}function s($={}){for(const j in $)$.hasOwnProperty(j)&&(t[j]=$[j]);($.hasOwnProperty("cursor")||$.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),$.hasOwnProperty("overflow")&&(i.style.overflow=$.overflow),$.hasOwnProperty("touchAction")&&(i.style.touchAction=$.touchAction,e.style.touchAction=$.touchAction)}let a=0,n=0,l=1,c=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(()=>{p(t.startX,t.startY,{animate:!1,force:!0})});function h($,j,T){if(T.silent)return;const W=new CustomEvent($,{detail:j});e.dispatchEvent(W)}function d($,j,T){const W={x:a,y:n,scale:l,isSVG:r,originalEvent:T};return requestAnimationFrame(()=>{typeof j.animate=="boolean"&&(j.animate?$b(e,j):oi(e,"transition","none")),j.setTransform(e,W,j),h($,W,j),h("panzoomchange",W,j)}),W}function u($,j,T,W){const z={...t,...W},G={x:a,y:n,opts:z};if(!W?.force&&(z.disablePan||z.panOnlyWhenZoomed&&l===z.startScale))return G;if($=parseFloat($),j=parseFloat(j),z.disableXAxis||(G.x=(z.relative?a:0)+$),z.disableYAxis||(G.y=(z.relative?n:0)+j),z.contain){const X=Da(e),K=X.elem.width/l,Q=X.elem.height/l,nt=K*T,gt=Q*T,ut=(nt-K)/2,mt=(gt-Q)/2;if(z.contain==="inside"){const Lt=(-X.elem.margin.left-X.parent.padding.left+ut)/T,Ft=(X.parent.width-nt-X.parent.padding.left-X.elem.margin.left-X.parent.border.left-X.parent.border.right+ut)/T;G.x=Math.max(Math.min(G.x,Ft),Lt);const Mt=(-X.elem.margin.top-X.parent.padding.top+mt)/T,Ht=(X.parent.height-gt-X.parent.padding.top-X.elem.margin.top-X.parent.border.top-X.parent.border.bottom+mt)/T;G.y=Math.max(Math.min(G.y,Ht),Mt)}else if(z.contain==="outside"){const Lt=(-(nt-X.parent.width)-X.parent.padding.left-X.parent.border.left-X.parent.border.right+ut)/T,Ft=(ut-X.parent.padding.left)/T;G.x=Math.max(Math.min(G.x,Ft),Lt);const Mt=(-(gt-X.parent.height)-X.parent.padding.top-X.parent.border.top-X.parent.border.bottom+mt)/T,Ht=(mt-X.parent.padding.top)/T;G.y=Math.max(Math.min(G.y,Ht),Mt)}}return z.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function f($,j){const T={...t,...j},W={scale:l,opts:T};if(!j?.force&&T.disableZoom)return W;let z=t.minScale,G=t.maxScale;if(T.contain){const X=Da(e),K=X.elem.width/l,Q=X.elem.height/l;if(K>1&&Q>1){const nt=X.parent.width-X.parent.border.left-X.parent.border.right,gt=X.parent.height-X.parent.border.top-X.parent.border.bottom,ut=nt/K,mt=gt/Q;t.contain==="inside"?G=Math.min(G,ut,mt):t.contain==="outside"&&(z=Math.max(z,ut,mt))}}return W.scale=Math.min(Math.max($,z),G),W}function p($,j,T,W){const z=u($,j,l,T);return a!==z.x||n!==z.y?(a=z.x,n=z.y,d("panzoompan",z.opts,W)):{x:a,y:n,scale:l,isSVG:r,originalEvent:W}}function m($,j,T){const W=f($,j),z=W.opts;if(!j?.force&&z.disableZoom)return;$=W.scale;let G=a,X=n;if(z.focal){const Q=z.focal;G=(Q.x/$-Q.x/l+a*$)/$,X=(Q.y/$-Q.y/l+n*$)/$}const K=u(G,X,$,{relative:!1,force:!0});return a=K.x,n=K.y,l=$,d("panzoomzoom",z,T)}function y($,j){const T={...t,animate:!0,...j};return m(l*Math.exp(($?1:-1)*T.step),T)}function x($){return y(!0,$)}function C($){return y(!1,$)}function k($,j,T,W){const z=Da(e),G={width:z.parent.width-z.parent.padding.left-z.parent.padding.right-z.parent.border.left-z.parent.border.right,height:z.parent.height-z.parent.padding.top-z.parent.padding.bottom-z.parent.border.top-z.parent.border.bottom};let X=j.clientX-z.parent.left-z.parent.padding.left-z.parent.border.left-z.elem.margin.left,K=j.clientY-z.parent.top-z.parent.padding.top-z.parent.border.top-z.elem.margin.top;r||(X-=z.elem.width/l/2,K-=z.elem.height/l/2);const Q={x:X/G.width*(G.width*$),y:K/G.height*(G.height*$)};return m($,{...T,animate:!1,focal:Q},W)}function S($,j){$.preventDefault();const T={...t,...j,animate:!1},z=($.deltaY===0&&$.deltaX?$.deltaX:$.deltaY)<0?1:-1,G=f(l*Math.exp(z*T.step/3),T).scale;return k(G,$,T,$)}function v($){const j={...t,animate:!0,force:!0,...$};l=f(j.startScale,j).scale;const T=u(j.startX,j.startY,l,j);return a=T.x,n=T.y,d("panzoomreset",j)}let _,E,B,I,M,D;const U=[];function q($){if(Nb($.target,t))return;pn(U,$),c=!0,t.handleStartEvent($),_=a,E=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:$},t);const j=nc(U);B=j.clientX,I=j.clientY,M=l,D=za(U)}function N($){if(!c||_===void 0||E===void 0||B===void 0||I===void 0)return;pn(U,$);const j=nc(U),T=U.length>1;let W=l;if(T){D===0&&(D=za(U));const z=za(U)-D;W=f(z*t.step/80+M).scale,k(W,j,{animate:!1},$)}(!T||t.pinchAndPan)&&p(_+(j.clientX-B)/W,E+(j.clientY-I)/W,{animate:!1},$)}function A($){U.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:$},t),Rb(U,$),c&&(c=!1,_=E=B=I=void 0)}let F=!1;function P(){F||(F=!0,Na("down",t.canvas?i:e,q),Na("move",document,N,{passive:!0}),Na("up",document,A,{passive:!0}))}function O(){F=!1,qa("down",t.canvas?i:e,q),qa("move",document,N),qa("up",document,A)}return t.noBind||P(),{bind:P,destroy:O,eventNames:Co,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>jb(t),handleDown:q,handleMove:N,handleUp:A,pan:p,reset:v,resetStyle:o,setOptions:s,setStyle:($,j)=>oi(e,$,j),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:k,zoomWithWheel:S}}su.defaultOptions=ou;const Wb=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Hb=Tt("arrow-down",Wb);const Yb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ub=Tt("arrow-left",Yb);const Xb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Gb=Tt("arrow-right",Xb);const Vb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Kb=Tt("arrow-up",Vb);const Zb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],gn=Tt("refresh-cw",Zb);const Qb=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Jb=Tt("settings-2",Qb);const t1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],au=Tt("zoom-in",t1);const e1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],nu=Tt("zoom-out",e1);var lu=Object.defineProperty,g=(e,t)=>lu(e,"name",{value:t,configurable:!0}),hu=(e,t)=>{for(var r in t)lu(e,r,{get:t[r],enumerable:!0})},os={exports:{}},r1=os.exports,lc;function i1(){return lc||(lc=1,(function(e,t){(function(r,i){e.exports=i()})(r1,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var A=["th","st","nd","rd"],F=N%100;return"["+N+(A[(F-20)%10]||A[F]||A[0])+"]"}},k=function(N,A,F){var P=String(N);return!P||P.length>=A?N:""+Array(A+1-P.length).join(F)+N},S={s:k,z:function(N){var A=-N.utcOffset(),F=Math.abs(A),P=Math.floor(F/60),O=F%60;return(A<=0?"+":"-")+k(P,2,"0")+":"+k(O,2,"0")},m:function N(A,F){if(A.date()<F.date())return-N(F,A);var P=12*(F.year()-A.year())+(F.month()-A.month()),O=A.clone().add(P,d),$=F-O<0,j=A.clone().add(P+($?-1:1),d);return+(-(P+(F-O)/($?O-j:j-O))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:d,y:f,w:h,d:c,D:p,h:l,m:n,s:a,ms:s,Q:u}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},v="en",_={};_[v]=C;var E="$isDayjsObject",B=function(N){return N instanceof U||!(!N||!N[E])},I=function N(A,F,P){var O;if(!A)return v;if(typeof A=="string"){var $=A.toLowerCase();_[$]&&(O=$),F&&(_[$]=F,O=$);var j=A.split("-");if(!O&&j.length>1)return N(j[0])}else{var T=A.name;_[T]=A,O=T}return!P&&O&&(v=O),O||!P&&v},M=function(N,A){if(B(N))return N.clone();var F=typeof A=="object"?A:{};return F.date=N,F.args=arguments,new U(F)},D=S;D.l=I,D.i=B,D.w=function(N,A){return M(N,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var U=(function(){function N(F){this.$L=I(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[E]=!0}var A=N.prototype;return A.parse=function(F){this.$d=(function(P){var O=P.date,$=P.utc;if(O===null)return new Date(NaN);if(D.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var j=O.match(y);if(j){var T=j[2]-1||0,W=(j[7]||"0").substring(0,3);return $?new Date(Date.UTC(j[1],T,j[3]||1,j[4]||0,j[5]||0,j[6]||0,W)):new Date(j[1],T,j[3]||1,j[4]||0,j[5]||0,j[6]||0,W)}}return new Date(O)})(F),this.init()},A.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},A.$utils=function(){return D},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(F,P){var O=M(F);return this.startOf(P)<=O&&O<=this.endOf(P)},A.isAfter=function(F,P){return M(F)<this.startOf(P)},A.isBefore=function(F,P){return this.endOf(P)<M(F)},A.$g=function(F,P,O){return D.u(F)?this[P]:this.set(O,F)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(F,P){var O=this,$=!!D.u(P)||P,j=D.p(F),T=function(gt,ut){var mt=D.w(O.$u?Date.UTC(O.$y,ut,gt):new Date(O.$y,ut,gt),O);return $?mt:mt.endOf(c)},W=function(gt,ut){return D.w(O.toDate()[gt].apply(O.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(ut)),O)},z=this.$W,G=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(j){case f:return $?T(1,0):T(31,11);case d:return $?T(1,G):T(0,G+1);case h:var Q=this.$locale().weekStart||0,nt=(z<Q?z+7:z)-Q;return T($?X-nt:X+(6-nt),G);case c:case p:return W(K+"Hours",0);case l:return W(K+"Minutes",1);case n:return W(K+"Seconds",2);case a:return W(K+"Milliseconds",3);default:return this.clone()}},A.endOf=function(F){return this.startOf(F,!1)},A.$set=function(F,P){var O,$=D.p(F),j="set"+(this.$u?"UTC":""),T=(O={},O[c]=j+"Date",O[p]=j+"Date",O[d]=j+"Month",O[f]=j+"FullYear",O[l]=j+"Hours",O[n]=j+"Minutes",O[a]=j+"Seconds",O[s]=j+"Milliseconds",O)[$],W=$===c?this.$D+(P-this.$W):P;if($===d||$===f){var z=this.clone().set(p,1);z.$d[T](W),z.init(),this.$d=z.set(p,Math.min(this.$D,z.daysInMonth())).$d}else T&&this.$d[T](W);return this.init(),this},A.set=function(F,P){return this.clone().$set(F,P)},A.get=function(F){return this[D.p(F)]()},A.add=function(F,P){var O,$=this;F=Number(F);var j=D.p(P),T=function(G){var X=M($);return D.w(X.date(X.date()+Math.round(G*F)),$)};if(j===d)return this.set(d,this.$M+F);if(j===f)return this.set(f,this.$y+F);if(j===c)return T(1);if(j===h)return T(7);var W=(O={},O[n]=i,O[l]=o,O[a]=r,O)[j]||1,z=this.$d.getTime()+F*W;return D.w(z,this)},A.subtract=function(F,P){return this.add(-1*F,P)},A.format=function(F){var P=this,O=this.$locale();if(!this.isValid())return O.invalidDate||m;var $=F||"YYYY-MM-DDTHH:mm:ssZ",j=D.z(this),T=this.$H,W=this.$m,z=this.$M,G=O.weekdays,X=O.months,K=O.meridiem,Q=function(ut,mt,Lt,Ft){return ut&&(ut[mt]||ut(P,$))||Lt[mt].slice(0,Ft)},nt=function(ut){return D.s(T%12||12,ut,"0")},gt=K||function(ut,mt,Lt){var Ft=ut<12?"AM":"PM";return Lt?Ft.toLowerCase():Ft};return $.replace(x,(function(ut,mt){return mt||(function(Lt){switch(Lt){case"YY":return String(P.$y).slice(-2);case"YYYY":return D.s(P.$y,4,"0");case"M":return z+1;case"MM":return D.s(z+1,2,"0");case"MMM":return Q(O.monthsShort,z,X,3);case"MMMM":return Q(X,z);case"D":return P.$D;case"DD":return D.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return Q(O.weekdaysMin,P.$W,G,2);case"ddd":return Q(O.weekdaysShort,P.$W,G,3);case"dddd":return G[P.$W];case"H":return String(T);case"HH":return D.s(T,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return gt(T,W,!0);case"A":return gt(T,W,!1);case"m":return String(W);case"mm":return D.s(W,2,"0");case"s":return String(P.$s);case"ss":return D.s(P.$s,2,"0");case"SSS":return D.s(P.$ms,3,"0");case"Z":return j}return null})(ut)||j.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(F,P,O){var $,j=this,T=D.p(P),W=M(F),z=(W.utcOffset()-this.utcOffset())*i,G=this-W,X=function(){return D.m(j,W)};switch(T){case f:$=X()/12;break;case d:$=X();break;case u:$=X()/3;break;case h:$=(G-z)/6048e5;break;case c:$=(G-z)/864e5;break;case l:$=G/o;break;case n:$=G/i;break;case a:$=G/r;break;default:$=G}return O?$:D.a($)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return _[this.$L]},A.locale=function(F,P){if(!F)return this.$L;var O=this.clone(),$=I(F,P,!0);return $&&(O.$L=$),O},A.clone=function(){return D.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},N})(),q=U.prototype;return M.prototype=q,[["$ms",s],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach((function(N){q[N[1]]=function(A){return this.$g(A,N[0],N[1])}})),M.extend=function(N,A){return N.$i||(N(A,U,M),N.$i=!0),M},M.locale=I,M.isDayjs=B,M.unix=function(N){return M(1e3*N)},M.en=_[v],M.Ls=_,M.p={},M}))})(os)),os.exports}var o1=i1();const cu=Zd(o1);var Ge={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:g((...e)=>{},"trace"),debug:g((...e)=>{},"debug"),info:g((...e)=>{},"info"),warn:g((...e)=>{},"warn"),error:g((...e)=>{},"error"),fatal:g((...e)=>{},"fatal")},Tl=g(function(e="fatal"){let t=Ge.fatal;typeof e=="string"?e.toLowerCase()in Ge&&(t=Ge[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=Ge.fatal&&(V.fatal=console.error?console.error.bind(console,me("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",me("FATAL"))),t<=Ge.error&&(V.error=console.error?console.error.bind(console,me("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",me("ERROR"))),t<=Ge.warn&&(V.warn=console.warn?console.warn.bind(console,me("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",me("WARN"))),t<=Ge.info&&(V.info=console.info?console.info.bind(console,me("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",me("INFO"))),t<=Ge.debug&&(V.debug=console.debug?console.debug.bind(console,me("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("DEBUG"))),t<=Ge.trace&&(V.trace=console.debug?console.debug.bind(console,me("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("TRACE")))},"setLogLevel"),me=g(e=>`%c${cu().format("ss.SSS")} : ${e} : `,"format");const ss={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return ss.hue2rgb(s,o,e+1/3)*255;case"g":return ss.hue2rgb(s,o,e)*255;case"b":return ss.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},s1={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},a1={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},pt={channel:ss,lang:s1,unit:a1},nr={};for(let e=0;e<=255;e++)nr[e]=pt.unit.dec2hex(e);const Jt={ALL:0,RGB:1,HSL:2};class n1{constructor(){this.type=Jt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Jt.ALL}is(t){return this.type===t}}class l1{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new n1}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Jt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=pt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=pt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=pt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=pt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=pt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=pt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Jt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Jt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Jt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Jt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Jt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Jt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ea=new l1({r:0,g:0,b:0,a:0},"transparent"),ni={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ni.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return ea.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${nr[Math.round(t)]}${nr[Math.round(r)]}${nr[Math.round(i)]}${nr[Math.round(o*255)]}`:`#${nr[Math.round(t)]}${nr[Math.round(r)]}${nr[Math.round(i)]}`}},Er={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Er.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return pt.channel.clamp.h(parseFloat(r)*.9);case"rad":return pt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return pt.channel.clamp.h(parseFloat(r)*360)}}return pt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Er.re);if(!r)return;const[,i,o,s,a,n]=r;return ea.set({h:Er._hue2deg(i),s:pt.channel.clamp.s(parseFloat(o)),l:pt.channel.clamp.l(parseFloat(s)),a:a?pt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${pt.lang.round(t)}, ${pt.lang.round(r)}%, ${pt.lang.round(i)}%, ${o})`:`hsl(${pt.lang.round(t)}, ${pt.lang.round(r)}%, ${pt.lang.round(i)}%)`}},uo={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=uo.colors[e];if(t)return ni.parse(t)},stringify:e=>{const t=ni.stringify(e);for(const r in uo.colors)if(uo.colors[r]===t)return r}},io={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(io.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return ea.set({r:pt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:pt.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:pt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?pt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${pt.lang.round(t)}, ${pt.lang.round(r)}, ${pt.lang.round(i)}, ${pt.lang.round(o)})`:`rgb(${pt.lang.round(t)}, ${pt.lang.round(r)}, ${pt.lang.round(i)})`}},Me={format:{keyword:uo,hex:ni,rgb:io,rgba:io,hsl:Er,hsla:Er},parse:e=>{if(typeof e!="string")return e;const t=ni.parse(e)||io.parse(e)||Er.parse(e)||uo.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Jt.HSL)||e.data.r===void 0?Er.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?io.stringify(e):ni.stringify(e)},du=(e,t)=>{const r=Me.parse(e);for(const i in t)r[i]=pt.channel.clamp[i](t[i]);return Me.stringify(r)},Je=(e,t,r=0,i=1)=>{if(typeof e!="number")return du(e,{a:t});const o=ea.set({r:pt.channel.clamp.r(e),g:pt.channel.clamp.g(t),b:pt.channel.clamp.b(r),a:pt.channel.clamp.a(i)});return Me.stringify(o)},h1=e=>{const{r:t,g:r,b:i}=Me.parse(e),o=.2126*pt.channel.toLinear(t)+.7152*pt.channel.toLinear(r)+.0722*pt.channel.toLinear(i);return pt.lang.round(o)},c1=e=>h1(e)>=.5,ke=e=>!c1(e),_l=(e,t,r)=>{const i=Me.parse(e),o=i[t],s=pt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Me.stringify(i)},H=(e,t)=>_l(e,"l",t),Y=(e,t)=>_l(e,"l",-t),b=(e,t)=>{const r=Me.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return du(e,i)},d1=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Me.parse(e),{r:n,g:l,b:c,a:h}=Me.parse(t),d=r/100,u=d*2-1,f=a-h,m=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,y=1-m,x=i*m+n*y,C=o*m+l*y,k=s*m+c*y,S=a*d+h*(1-d);return Je(x,C,k,S)},R=(e,t=100)=>{const r=Me.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,d1(r,e,t)};var mn=g((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>mn(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=mn(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),qt=mn,We="#ffffff",He="#f2f2f2",dt=g((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),ci,u1=(ci=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Y(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10)):(this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ci,"Theme"),ci),f1=g(e=>{const t=new u1;return t.calculate(e),t},"getThemeVariables"),di,p1=(di=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(R("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=Y("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Y(this.sectionBkgColor,10),this.taskBorderColor=Je(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Je(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=H(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=H(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=H(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=R(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||R(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??H(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=H(this.secondaryColor,20),this.git1=H(this.pie2||this.secondaryColor,20),this.git2=H(this.pie3||this.tertiaryColor,20),this.git3=H(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=H(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=H(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=H(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=H(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||H("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||H("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||H("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||H("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||H(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||H(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||H(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||H(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(di,"Theme"),di),g1=g(e=>{const t=new p1;return t.calculate(e),t},"getThemeVariables"),ui,m1=(ui=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=b(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Je(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||R(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||R(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||H(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||H(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||b(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||b(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||Y(R(this.git0),25),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ui,"Theme"),ui),uu=g(e=>{const t=new m1;return t.calculate(e),t},"getThemeVariables"),fi,y1=(fi=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=H("#cde498",10),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.primaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=Y(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-30}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(fi,"Theme"),fi),x1=g(e=>{const t=new y1;return t.calculate(e),t},"getThemeVariables"),pi,C1=(pi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=H(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=H(this.contrast,55),this.border2=this.contrast,this.actorBorder=H(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||R(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=H(this.contrast,30),this.sectionBkgColor2=H(this.contrast,30),this.taskBorderColor=Y(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=H(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Y(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Y(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||b(this.primaryColor,{h:-30}),this.git4=this.pie5||b(this.primaryColor,{h:-60}),this.git5=this.pie6||b(this.primaryColor,{h:-90}),this.git6=this.pie7||b(this.primaryColor,{h:60}),this.git7=this.pie8||b(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(pi,"Theme"),pi),b1=g(e=>{const t=new C1;return t.calculate(e),t},"getThemeVariables"),gi,k1=(gi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||b(t,{h:30}),this.cScale4=this.cScale4||b(t,{h:60}),this.cScale5=this.cScale5||b(t,{h:90}),this.cScale6=this.cScale6||b(t,{h:120}),this.cScale7=this.cScale7||b(t,{h:150}),this.cScale8=this.cScale8||b(t,{h:210,l:150}),this.cScale9=this.cScale9||b(t,{h:270}),this.cScale10=this.cScale10||b(t,{h:300}),this.cScale11=this.cScale11||b(t,{h:330}),this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(gi,"Theme"),gi),w1=g(e=>{const t=new k1;return t.calculate(e),t},"getThemeVariables"),mi,S1=(mi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(R("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=R(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(mi,"Theme"),mi),v1=g(e=>{const t=new S1;return t.calculate(e),t},"getThemeVariables"),yi,T1=(yi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=dt("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=this.mainBkg;if(this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(yi,"Theme"),yi),_1=g(e=>{const t=new T1;return t.calculate(e),t},"getThemeVariables"),xi,B1=(xi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(R("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=R(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(xi,"Theme"),xi),L1=g(e=>{const t=new B1;return t.calculate(e),t},"getThemeVariables"),Ci,E1=(Ci=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(Ci,"Theme"),Ci),F1=g(e=>{const t=new E1;return t.calculate(e),t},"getThemeVariables"),bi,A1=(bi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(R("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=R(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=Y(this["cScale"+r],75);const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(bi,"Theme"),bi),M1=g(e=>{const t=new A1;return t.calculate(e),t},"getThemeVariables"),tr={base:{getThemeVariables:f1},dark:{getThemeVariables:g1},default:{getThemeVariables:uu},forest:{getThemeVariables:x1},neutral:{getThemeVariables:b1},neo:{getThemeVariables:w1},"neo-dark":{getThemeVariables:v1},redux:{getThemeVariables:_1},"redux-dark":{getThemeVariables:L1},"redux-color":{getThemeVariables:F1},"redux-dark-color":{getThemeVariables:M1}},Vt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},fu={...Vt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:tr.default.getThemeVariables(),sequence:{...Vt.sequence,messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:g(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:g(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Vt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Vt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Vt.flowchart,inheritDir:!1},external_personFont:g(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:g(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:g(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:g(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:g(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:g(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:g(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:g(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:g(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:g(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:g(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:g(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:g(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:g(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:g(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:g(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:g(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:g(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:g(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:g(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Vt.pie,useWidth:984},xyChart:{...Vt.xyChart,useWidth:void 0},requirement:{...Vt.requirement,useWidth:void 0},packet:{...Vt.packet},eventmodeling:{...Vt.eventmodeling},treeView:{...Vt.treeView,useWidth:void 0},radar:{...Vt.radar},railroad:{...Vt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Vt.ishikawa},sankey:{...Vt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Vt.venn},cynefin:{...Vt.cynefin}},pu=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...pu(e[i],"")]:[...r,t+i],[]),"keyify"),$1=new Set(pu(fu,"")),Bl=fu,O1={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},R1=g((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(V.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),bs=g(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>bs(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!$1.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=O1[t];i?R1(e[t],i):(V.debug("sanitizing object",t),bs(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=gu(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}V.debug("After sanitization",e)}},"sanitizeDirective"),gu=g(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Bi=Object.freeze(Bl),Ye=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ce=qt({},Bi),ks,Ir=[],fo=qt({},Bi),ra=g((e,t)=>{let r=qt({},e),i={};for(const o of t)xu(o),i=qt(i,o);if(r=qt(r,i),i.theme&&i.theme in tr){const o=qt({},ks),s=qt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in tr&&(r.themeVariables=tr[r.theme].getThemeVariables(s))}return fo=r,bu(fo),fo},"updateCurrentConfig"),I1=g(e=>(ce=qt({},Bi),ce=qt(ce,e),e.theme&&tr[e.theme]&&(ce.themeVariables=tr[e.theme].getThemeVariables(e.themeVariables)),ra(ce,Ir),ce),"setSiteConfig"),P1=g(e=>{ks=qt({},e)},"saveConfigFromInitialize"),D1=g(e=>(ce=qt(ce,e),ra(ce,Ir),ce),"updateSiteConfig"),mu=g(()=>qt({},ce),"getSiteConfig"),yu=g(e=>(bu(e),qt(fo,e),Ot()),"setConfig"),Ot=g(()=>qt({},fo),"getConfig"),xu=g(e=>{e&&(["secure",...ce.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(V.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&xu(e[t])}))},"sanitize"),N1=g(e=>{bs(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Ir.push(e),ra(ce,Ir)},"addDirective"),ws=g((e=ce)=>{Ir=[],ra(e,Ir)},"reset"),q1={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},hc={},Cu=g(e=>{hc[e]||(V.warn(q1[e]),hc[e]=!0)},"issueWarning"),bu=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Cu("LAZY_LOAD_DEPRECATED")},"checkConfig"),z1=g(()=>{let e={};ks&&(e=qt(e,ks));for(const t of Ir)e=qt(e,t);return e},"getUserDefinedConfig"),ee=g(e=>(e.flowchart?.htmlLabels!=null&&Cu("FLOWCHART_HTML_LABELS_DEPRECATED"),Ye(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),ku=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,po=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,j1=/\s*%%.*\n/gm,ki,wu=(ki=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},g(ki,"UnknownDiagramError"),ki),Pr={},Ll=g(function(e,t){e=e.replace(ku,"").replace(po,"").replace(j1,`
|
|
8
|
-
`);for(const[r,{detector:i}]of Object.entries(Pr))if(i(e,t))return r;throw new
|
|
9
|
-
`)}
|
|
6
|
+
<%s key={someKey} {...props} />`,X,Z,at,Z),j[Z+X]=!0)}if(Z=null,z!==void 0&&(r(z),Z=""+z),a(W)&&(r(W.key),Z=""+W.key),"key"in W){z={};for(var pt in W)pt!=="key"&&(z[pt]=W[pt])}else z=W;return Z&&n(z,typeof T=="function"?T.displayName||T.name||"Unknown":T),c(T,Z,z,o(),G,K)}function d(T){f(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===D&&(T._payload.status==="fulfilled"?f(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function f(T){return typeof T=="object"&&T!==null&&T.$$typeof===g}var u=L,g=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),U=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,q=Array.isArray,A=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(T){return T()}};var $,O={},F=u.react_stack_bottom_frame.bind(u,s)(),R=A(i(s)),j={};Gi.Fragment=y,Gi.jsx=function(T,W,z){var X=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,z,!1,X?Error("react-stack-top-frame"):F,X?A(i(T)):R)},Gi.jsxs=function(T,W,z){var X=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,z,!0,X?Error("react-stack-top-frame"):F,X?A(i(T)):R)}})()),Gi}var Gh;function TC(){return Gh||(Gh=1,process.env.NODE_ENV==="production"?zo.exports=SC():zo.exports=vC()),zo.exports}var k=TC();const Xh=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),_C=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),BC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),LC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),EC=Object.freeze({scrollbarWidth:"none"}),FC=.01,Vh=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Aa=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},AC=(e,t,r)=>{const i=getComputedStyle(e),o=Aa(i.width),s=e.getBoundingClientRect();if(o<=0||s.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=s.width/o,n=(s.width-t.getBoundingClientRect().width)/a-Aa(i.borderLeftWidth)-Aa(i.borderRightWidth),l=Math.max(0,Math.ceil(n-FC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},MC=(e,t,r,i,o)=>{const[s,a]=L.useState(Vh),n=L.useRef(o),l=L.useRef(0);return L.useLayoutEffect(()=>{n.current=o}),L.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,f=i.current;if(!e||h===null||d===null||f===null){a(Vh),c(0);return}const u=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=AC(h,d,f);a(C=>C.scroller===h&&C.barInlineSize===m&&C.nativeBarInlineSize===y&&C.overlaysScrollbars===x?C:Object.freeze({scroller:h,barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x})),c(m)};u();const g=new ResizeObserver(u);return g.observe(h),g.observe(d),g.observe(f),window.addEventListener("resize",u),()=>{g.disconnect(),window.removeEventListener("resize",u)}},[e,t,r,i]),s},$C=(e,t)=>{if(typeof e=="function"){const r=e(t);return typeof r=="function"?r:()=>e(null)}return e!=null?(e.current=t,()=>{e.current=null}):()=>{}};function eu({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:a}){const n=L.useRef(null),l=L.useRef(null),c=L.useRef(null),h=i!==void 0,d=MC(h,n,l,c,a),f=L.useCallback(m=>{n.current=m;const y=$C(t,m);return()=>{n.current=null,y()}},[t]),u=h?{...e.style,position:"relative",boxSizing:"border-box",overflowY:"scroll",width:`calc(100% + ${d.nativeBarInlineSize}px)`,...d.overlaysScrollbars?EC:void 0}:e.style,g=k.jsxs("div",{...e,ref:f,style:u,children:[r,h&&k.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:LC})]});return h?k.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?Xh:{...Xh,...s},children:[k.jsx("div",{"data-aqmd-scroll-clip":!0,style:_C,children:g}),k.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:BC,children:d.scroller!==null&&i(d.scroller)})]}):g}const OC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),RC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),Kh=e=>{const t=RC(e);return t.charAt(0).toUpperCase()+t.slice(1)},ru=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),IC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var PC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const DC=L.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:a,...n},l)=>L.createElement("svg",{ref:l,...PC,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:ru("lucide",o),...!s&&!IC(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>L.createElement(c,h)),...Array.isArray(s)?s:[s]]));const Tt=(e,t)=>{const r=L.forwardRef(({className:i,...o},s)=>L.createElement(DC,{ref:s,iconNode:t,className:ru(`lucide-${OC(Kh(e))}`,`lucide-${e}`,i),...o}));return r.displayName=Kh(e),r};const NC=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],qC=Tt("image-off",NC);class zC extends L.Component{constructor(t){super(t),this.state={content:t.content,failed:!1}}static getDerivedStateFromProps(t,r){return t.content===r.content?null:{content:t.content,failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?k.jsxs("div",{"data-aqmd-block-failure":"",children:[k.jsx("p",{"data-aqmd-block-failure-notice":"",lang:this.props.label.lang,children:this.props.label.text}),k.jsx("pre",{"data-aqmd-block-failure-text":"",children:this.props.text()})]}):this.props.children}}const iu=Object.freeze({blockFailed:{text:"This block could not be shown.",lang:"en"}}),jC=1024,bs=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,WC=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&bs(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&bs(e[e.length-1-i],t[t.length-1-i]);)i+=1;const o=Array.from({length:r},(n,l)=>[l,l]),s=Array.from({length:i},(n,l)=>[e.length-i+l,t.length-i+l]),a=HC(e,t,r,e.length-i,t.length-i);return[...o,...a,...s]},HC=(e,t,r,i,o)=>{const s=new Set(e.slice(r,i).map(S=>S.fingerprint)),a=new Set(t.slice(r,o).map(S=>S.fingerprint)),n=[];for(let S=r;S<i;S+=1)a.has(e[S].fingerprint)&&n.push(S);const l=[];for(let S=r;S<o;S+=1)s.has(t[S].fingerprint)&&l.push(S);const c=n.length,h=l.length;if(c===0||h===0)return[];const d=(S,v)=>bs(e[n[S]],t[l[v]]),f=(S,v)=>e[n[S]].fingerprint===t[l[v]].fingerprint,u=(S,v)=>{let _=S;for(;_<c&&_+v<h&&d(_,_+v);)_+=1;return _},g=[Int32Array.of(u(0,0))],m=[Uint8Array.of(Ma)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&g[x][y+x]===c);){if(x+=1,x>jC)return[];const S=g[x-1],v=B=>B>=-(x-1)&&B<=x-1?S[B+x-1]:-1,_=new Int32Array(2*x+1).fill(-1),E=new Uint8Array(2*x+1);for(let B=-x;B<=x;B+=1){if(B<-c||B>h)continue;let D=-1,M=Ma;const P=v(B);P!==-1&&P<c&&P+B<h&&f(P,P+B)&&(D=P+1,M=Zh);const U=v(B+1);U!==-1&&U+1<=c&&U+1>D&&(D=U+1,M=Qh);const N=v(B-1);N!==-1&&N+B<=h&&N>D&&(D=N,M=$a),D!==-1&&(_[B+x]=u(D,B),E[B+x]=M)}g.push(_),m.push(E)}const C=[];let w=y;for(let S=x;S>=0;S-=1){const v=g[S][w+S],_=m[S][w+S],E=_===Qh?w+1:_===$a?w-1:w,B=_===Ma?0:g[S-1][E+S-1]+(_===$a?0:1);for(let D=v-1;D>=B;D-=1)C.push([n[D],l[D+w]]);_===Zh&&C.push([n[B-1],l[B-1+w]]),w=E}return C.reverse()},Ma=0,Zh=1,Qh=2,$a=3,YC=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[n,l]of WC(t,e))r[l]=t[n].key,i.add(n);const o=new Map;for(const[n,l]of t.entries()){if(i.has(n))continue;const c=o.get(l.fingerprint);c===void 0?o.set(l.fingerprint,[n]):c.push(n)}const s=n=>{for(const[l,c]of e.entries()){if(r[l]!==null)continue;const h=o.get(c.fingerprint),d=h===void 0?-1:h.findIndex(f=>n(c,t[f]));h!==void 0&&d!==-1&&(r[l]=t[h.splice(d,1)[0]].key)}};s(bs),s(()=>!0);const a=new Set(r.filter(n=>n!==null));return e.map((n,l)=>{let c=r[l];if(c===null){let h=0;for(;a.has(`${n.fingerprint}.${h}`);)h+=1;c=`${n.fingerprint}.${h}`,a.add(c)}return{...n,key:c}})};const UC=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],GC=Tt("building-2",UC);const XC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Jh=Tt("globe",XC),VC=/^[a-z]{2,3}$/u,KC=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return VC.test(t)?t:null},ZC=()=>()=>{},QC=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},vl=()=>L.useSyncExternalStore(ZC,()=>window.location.origin,()=>null),JC=()=>L.useSyncExternalStore(QC,()=>KC(document.documentElement.lang),()=>null),tb=/^[1-9]\d{0,4}$/u,tc=e=>e!==void 0&&tb.test(e.trim())?Number(e.trim()):null,eb=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=vl(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const a=tc(e.attributes.width),n=tc(e.attributes.height),l=a!==null&&n!==null?{width:"100%",maxWidth:`${a}px`,aspectRatio:`${a} / ${n}`}:void 0,c=e.attributes.title,h=c===void 0?t.lang:void 0;return k.jsx("span",{"data-embed-frame":o===null?"pending":"refused","data-aqmd-embed-surface":l===void 0?void 0:"",style:l,className:l===void 0?void 0:"flex items-center justify-center rounded-lg p-2 text-center",children:r?k.jsx("span",{lang:h,children:`${c??t.text}: ${s.hostname}`}):k.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${s.hostname}`})})},ou=({concurrency:e,capacity:t,timeoutMs:r})=>{for(const[h,d]of Object.entries({concurrency:e,capacity:t,timeoutMs:r}))if(!Number.isInteger(d)||d<=0)throw new RangeError(`[@aiquants/markdown] request queue ${h} must be a positive integer; got ${String(d)}`);const i=new Map,o=new Map,s=[];let a=0;const n=(h,d,f)=>{if(o.get(h)===d&&(o.delete(h),f!==null)){i.set(h,f);for(const u of i.keys()){if(i.size<=t)break;i.delete(u)}for(const u of d.subscriptions)u.listener(f)}},l=()=>{for(;a<e;){const h=s.shift();if(h===void 0)return;const d=o.get(h);if(d===void 0)continue;const f=new AbortController;d.controller=f,a+=1,new Promise(u=>u(d.start(AbortSignal.any([f.signal,AbortSignal.timeout(r)])))).then(u=>n(h,d,{ok:!0,value:u}),()=>n(h,d,f.signal.aborted?null:{ok:!1})).finally(()=>{a-=1,l()})}};return Object.freeze({subscribe:(h,d,f)=>{const u=i.get(h);if(u!==void 0)return i.delete(h),i.set(h,u),f(u),()=>{};let g=o.get(h);g===void 0&&(g={start:d,subscriptions:new Set,controller:null},o.set(h,g),s.push(h));const m=g,y={listener:f};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||o.get(h)!==m)&&(o.delete(h),m.controller===null?s.splice(s.indexOf(h),1):m.controller.abort())}}})},rb=ou({concurrency:2,capacity:256,timeoutMs:15e3}),ib="[data-aqmd-scroll-container]",ob=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(s){if(t.aborted)throw s;return{kind:"error",cause:"network error"}}if(r.status===204){const s=Ne.linkCardSkipReasonOf(r.headers.get(Ne.LINK_CARD_SKIP_HEADER));return s===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:s}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(s){if(t.aborted)throw s;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const o=Ne.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},sb=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",ec=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,Oa=({tile:e,tileKind:t,primary:r,secondary:i})=>k.jsxs("span",{className:"flex min-w-0 flex-auto items-center gap-3 px-3",children:[k.jsx("span",{"aria-hidden":"true","data-link-card-icon":t,className:`flex size-8 shrink-0 items-center justify-center rounded-md bg-(--aqmd-link-card-bg-hover) text-(--aqmd-link-card-muted) ${t==="pending"?"motion-safe:animate-pulse":""}`,children:e}),k.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[k.jsx("span",{className:"truncate font-semibold text-[0.875rem] leading-5",children:r}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:i})]})]}),ab=({href:e,endpoint:t,size:r,fallback:i})=>{const o=vl(),s=L.useRef(null),a=new URL(e),n=`${t}
|
|
7
|
+
${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const w=new IntersectionObserver(S=>{C!==null||!S.some(v=>v.isIntersecting)||(w.disconnect(),C=rb.subscribe(n,v=>ob(Ne.linkCardRequestOf(t,new URL(e),o),v),v=>{c({key:n,outcome:v});const _=sb(v);_!==null&&fn.linkCardLogger.info(`No link card for ${e} (${_})`)}))},{root:x.closest(ib),rootMargin:"100% 0px"});return w.observe(x),()=>{w.disconnect(),C?.()}},[n,t,e,o]);const h=l!==null&&l.key===n?l.outcome:null;if(h!==null&&!h.ok)return i;const d=h===null?null:h.value;if(d!==null&&d.kind==="error")return i;if(d===null||o===null)return k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","aria-busy":"true","data-link-card":"pending","data-link-card-size":r,children:r==="compact"?k.jsx(Oa,{tile:null,tileKind:"pending",primary:a.hostname,secondary:e}):k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-2 px-4 py-3.5",children:[k.jsx("span",{"aria-hidden":"true",className:"block h-3.5 w-2/3 rounded bg-(--aqmd-link-card-border) motion-safe:animate-pulse"}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem]",children:a.hostname}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:e})]})});if(d.kind==="skip"){const{reason:x}=d,C=x==="private-network",w=C?GC:Jh;return k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"compact","data-link-card-reason":x,"data-link-card-size":"compact",children:k.jsx(Oa,{tile:k.jsx(w,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:a.hostname,secondary:e})})}const{metadata:f}=d,u=new URL(o).hostname,g=ec(f.image,u),m=ec(f.icon,u),y=f.siteName===null?a.hostname:`${f.siteName} · ${a.hostname}`;return r==="compact"?k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:k.jsx(Oa,{tile:m===null?k.jsx(Jh,{"aria-hidden":"true",className:"size-4"}):k.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 rounded-[3px]"}),tileKind:m===null?"link":"favicon",primary:f.title??e,secondary:y})}):k.jsxs("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":r,children:[k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1 px-4 py-3.5",children:[k.jsx("span",{className:"wrap-anywhere line-clamp-2 font-semibold text-[0.9375rem] leading-5",children:f.title??e}),f.description===null?null:k.jsx("span",{className:`wrap-anywhere text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem] ${r==="banner"?"line-clamp-1":"line-clamp-2"}`,children:f.description}),k.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-(--aqmd-link-card-muted) text-xs leading-4",children:[m===null?null:k.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 shrink-0 rounded-[3px]"}),k.jsx("span",{className:"truncate",children:y})]})]}),g===null?null:k.jsx("img",{src:g,alt:"",loading:"lazy",referrerPolicy:"no-referrer"})]})},su=e=>{if(!Array.isArray(e.providers))throw new RangeError(`[@aiquants/markdown] embeds.providers must be an array of provider ids; got ${typeof e.providers}`);for(const t of e.providers)if(!Rr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Rr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!Ne.isLinkCardEndpoint(e.linkCardEndpoint))throw new RangeError(`[@aiquants/markdown] embeds.linkCardEndpoint must be null or an absolute path without a trailing "/" (segments of A-Z a-z 0-9 . _ ~ -, no "." or ".."); got ${JSON.stringify(e.linkCardEndpoint)}`);if(e.linkCardSize!==void 0&&!Ne.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${Ne.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},ro=new WeakMap;let jo=0;const rc=e=>{if(e.source===null)return;const t=ro.get(e.source);if(t===void 0||e.origin!==t.watch.origin)return;const r=t.watch.heightOf(e.data,t.watch.src);if(r===null||!Number.isFinite(r))return;const i=Math.min(Rr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(Rr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},nb=(e,t)=>{const r={watch:t,last:null};return ro.has(e)||(jo+=1,jo===1&&window.addEventListener("message",rc)),ro.set(e,r),()=>{ro.get(e)===r&&(ro.delete(e),jo-=1,jo===0&&window.removeEventListener("message",rc))}},lb=ou({concurrency:2,capacity:256,timeoutMs:5e3}),hb=async(e,t)=>{const r=await fetch(e,{credentials:"omit",redirect:"error",referrerPolicy:"no-referrer",headers:{accept:"application/json"},signal:t});if(!r.ok)throw new Error(`[@aiquants/markdown] embed lookup answered ${r.status}`);return await r.json()},cb=(e,t)=>{const r=e.maxWidth===null?void 0:`${e.maxWidth}px`;switch(e.kind){case"aspect":return{width:"100%",maxWidth:r,aspectRatio:`${e.ratio[0]} / ${e.ratio[1]}`};case"fixed":return{width:"100%",maxWidth:r,height:`${e.height}px`};case"message":return{width:"100%",maxWidth:r,height:`${t??e.initialHeight}px`}}},db=Object.freeze({marginInline:0}),Ra=Object.freeze({kind:"pending"}),ub=Object.freeze({kind:"narrow"}),fb=Object.freeze({kind:"fallback"}),gb=(e,t,r,i,o)=>{if(t===null)return Ra;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return Ra;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return fb;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(o===null)return Ra;if(Math.min(o,n??Number.POSITIVE_INFINITY)<a)return ub}return{kind:"frame",src:s}},pb=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=vl(),a=JC(),[n,l]=L.useState(null),[c,h]=L.useState(null),d=e.kind==="lookup"?e.request.href:null,[f,u]=L.useState(null);L.useEffect(()=>{if(d!==null)return lb.subscribe(d,B=>hb(new URL(d),B),B=>u({key:d,outcome:B}))},[d]);const{provider:g,layout:m}=e,y=gb(e,s,{theme:i,lang:a},f!==null&&f.key===d?f.outcome:null,n),x=L.useCallback(B=>{if(B===null)return;l(B.getBoundingClientRect().width);const D=new ResizeObserver(()=>l(B.getBoundingClientRect().width));return D.observe(B),()=>D.disconnect()},[]),C=y.kind==="frame"?y.src:null,w=c!==null&&c.src===C?c.height:null,S=L.useCallback(B=>{if(!(B===null||B.contentWindow===null||m.kind!=="message"||C===null))return nb(B.contentWindow,{origin:g.frameOrigin,src:C,heightOf:m.heightOf,set:D=>h({src:C,height:D})})},[m,g.frameOrigin,C]);if(y.kind==="fallback")return r;const v=m.minWidth===null?null:k.jsx("span",{ref:x,"aria-hidden":"true","data-embed-measure":g.id,className:"block h-0"});if(y.kind==="narrow")return k.jsxs(k.Fragment,{children:[v,r]});const _=g.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:E}=g;return k.jsxs(k.Fragment,{children:[v,k.jsxs("figure",{"data-embed-provider":g.id,"data-embed-state":y.kind,style:db,children:[k.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:cb(m,w),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?k.jsx("iframe",{ref:S,src:y.src,title:`${g.name}: ${_.text}`,lang:_.lang,loading:"lazy",allow:E.allow??void 0,allowFullScreen:E.allowFullScreen,sandbox:E.sandbox,referrerPolicy:E.referrerPolicy,scrolling:E.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),k.jsx("figcaption",{className:"mt-2",children:t})]})]})},mb=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],yb=(e,t)=>cr.allowedFrameUrlOf(e,t)!==null,xb=(e,t)=>{const r=new Map(Object.entries(e).map(([s,a])=>[s.toLowerCase(),a])),i=cr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of mb){const a=r.get(s);if(a!==void 0)if(s==="allow"){const n=cr.reduceFrameFeatures(a);n!==null&&(o.allow=n)}else if(s==="referrerpolicy"){const n=a.trim().toLowerCase();cr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(o.referrerpolicy=n)}else o[s]=a}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},Cb=new Set(["script","style","template","noscript","noembed","noframes","plaintext","xmp","title","head","meta","link","base","object","embed","applet","param","frame","frameset","select","datalist","track","math","foreignobject"]),bb=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),kb=new Set(["markdown-alert","markdown-alert-title","markdown-alert-note","markdown-alert-tip","markdown-alert-important","markdown-alert-warning","markdown-alert-caution","octicon","octicon-info","octicon-light-bulb","octicon-report","octicon-alert","octicon-stop","mr-2","message","message-symbol","message-content","alert","info","warning","markdown-details","markdown-details-content","footnotes","footnote-ref","footnote-backref","math","inline","display"]),ic="language-",wb=/[\t\n\f\r ]+/u,Sb=new Set(["h1","h2","h3","h4","h5","h6"]),oc=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),sc="user-content-",Xt=["align"],Jr=["width","height"],ac=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],Ia=Object.freeze({a:["href","name","hreflang","data-link-kind","data-doc-path","data-doc-exists","data-footnote-ref","data-footnote-backref"],abbr:[],address:[],article:[],aside:[],audio:["src","controls","loop","muted","preload"],b:[],bdi:[],bdo:[],blockquote:["cite"],br:[],caption:Xt,cite:[],code:[It.CODE_META_ATTRIBUTE],col:["span",...Xt,...Jr],colgroup:["span",...Xt,...Jr],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:Xt,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:Xt,h2:Xt,h3:Xt,h4:Xt,h5:Xt,h6:Xt,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...Xt,...Jr,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:Xt,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...Xt,"border",...Jr],tbody:[...Xt,"valign"],td:ac,tfoot:[...Xt,"valign"],th:ac,thead:[...Xt,"valign"],time:["datetime"],tr:[...Xt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...Jr],wbr:[]}),Pa=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...Jr],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),vb=new Set(["svg","g"]),Tb=new Set(["href","src","cite","poster",cr.EMBED_LINK_ATTRIBUTE]),_b=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,Bb=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,Lb=new Set(["left","right","center","justify","start","end"]),$o=e=>Bb.test(e.replace(_b,"")),Eb=e=>{let t=null;for(const r of e.split(";")){const i=r.indexOf(":");if(i<0||r.slice(0,i).trim().toLowerCase()!=="text-align")continue;const o=r.slice(i+1).trim().toLowerCase();Lb.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},Fb=e=>{const t=e.split(wb).filter(r=>kb.has(r)||r.startsWith(ic)&&r.length>ic.length);return t.length===0?null:t.join(" ")},Ab=(e,t)=>Sb.has(e)||t.startsWith(sc)&&t.length>sc.length||Object.hasOwn(oc,e)&&oc[e].test(t),Mb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();t.has(o)||t.set(o,i)}return t},Xi=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===vi.SOURCE_LINES_ATTRIBUTE){vi.parseSourceLines(s)!==null&&(i[o]=s);continue}if((bb.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(Tb.has(o)&&!$o(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!Ab(e,s))){if(o==="class"||o==="style"){const a=o==="class"?Fb(s):Eb(s);a!==null&&(i[o]=a);continue}i[o]=s}}return i},$b=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),ea=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=Mb(t);if(o!==null&&vb.has(o)){const n=i!=="svg"&&Object.hasOwn(Pa,i)?Pa[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:Xi(i,s,n)}}if(i==="svg")return{action:"keep",attributes:Xi(i,s,Pa.svg)};if(i==="iframe"){const n=xb(Object.fromEntries(s),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:s.get("data-plugin-type")??null}}if(i==="p"){const n=Xi(i,s,Ia.p),l=s.get(cr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&$o(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return $b(s)?{action:"keep",attributes:Xi(i,s,["type","checked","disabled"])}:{action:"remove"};if(Cb.has(i))return{action:"remove"};const a=Object.hasOwn(Ia,i)?Ia[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:Xi(i,s,a)}};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,r){r=r||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r.bubbles,r.cancelable,r.detail),i}));const Ob=typeof document<"u"&&!!document.documentMode;let Da;function Rb(){return Da||(Da=document.createElement("div").style)}const nc=["webkit","moz","ms"],Wo={};function Tl(e){if(Wo[e])return Wo[e];const t=Rb();if(e in t)return Wo[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=nc.length;for(;i--;){const o=`${nc[i]}${r}`;if(o in t)return Wo[e]=o}}function Ho(e,t){return parseFloat(t[Tl(e)])||0}function Yo(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:Ho(`${t}Left${i}`,r),right:Ho(`${t}Right${i}`,r),top:Ho(`${t}Top${i}`,r),bottom:Ho(`${t}Bottom${i}`,r)}}function oi(e,t,r){e.style[Tl(t)]=r}function Ib(e,t){const r=Tl("transform");oi(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function Pb(e,{x:t,y:r,scale:i,isSVG:o},s){if(oi(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&Ob){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Na(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),o=e.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:r,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,margin:Yo(e,"margin",r),border:Yo(e,"border",r)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:Yo(t,"padding",i),border:Yo(t,"border",i)}}}let bo={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?bo={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(bo={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function qa(e,t,r,i){bo[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function za(e,t,r){bo[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function au(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function pn(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,pn(e,i);return}r=au(e,t),r>-1&&e.splice(r,1),e.push(t)}function Db(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=au(e,t);r>-1&&e.splice(r,1)}function lc(e){e=e.slice(0);let t=e.pop(),r;for(;r=e.pop();)t={clientX:(r.clientX-t.clientX)/2+t.clientX,clientY:(r.clientY-t.clientY)/2+t.clientY};return t}function ja(e){if(e.length<2)return 0;const t=e[0],r=e[1];return Math.sqrt(Math.pow(Math.abs(r.clientX-t.clientX),2)+Math.pow(Math.abs(r.clientY-t.clientY),2))}function Nb(e){let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function qb(e){return(e.getAttribute("class")||"").trim()}function zb(e,t){return e.nodeType===1&&` ${qb(e)} `.indexOf(` ${t} `)>-1}function jb(e,t){for(let r=e;r!=null;r=r.parentNode)if(zb(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const Wb=/^http:[\w\.\/]+svg$/;function Hb(e){return Wb.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function Yb(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const nu={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:e=>{e.preventDefault(),e.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:Pb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function lu(e,t){if(!e)throw new Error("Panzoom requires an element as an argument");if(e.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!Nb(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...nu,...t};const r=Hb(e),i=e.parentNode;i.style.overflow=t.overflow,i.style.userSelect="none",i.style.touchAction=t.touchAction,(t.canvas?i:e).style.cursor=t.cursor,e.style.userSelect="none",e.style.touchAction=t.touchAction,oi(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function o(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",oi(e,"transformOrigin","")}function s(R={}){for(const j in R)R.hasOwnProperty(j)&&(t[j]=R[j]);(R.hasOwnProperty("cursor")||R.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),R.hasOwnProperty("overflow")&&(i.style.overflow=R.overflow),R.hasOwnProperty("touchAction")&&(i.style.touchAction=R.touchAction,e.style.touchAction=R.touchAction)}let a=0,n=0,l=1,c=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(()=>{g(t.startX,t.startY,{animate:!1,force:!0})});function h(R,j,T){if(T.silent)return;const W=new CustomEvent(R,{detail:j});e.dispatchEvent(W)}function d(R,j,T){const W={x:a,y:n,scale:l,isSVG:r,originalEvent:T};return requestAnimationFrame(()=>{typeof j.animate=="boolean"&&(j.animate?Ib(e,j):oi(e,"transition","none")),j.setTransform(e,W,j),h(R,W,j),h("panzoomchange",W,j)}),W}function f(R,j,T,W){const z={...t,...W},X={x:a,y:n,opts:z};if(!W?.force&&(z.disablePan||z.panOnlyWhenZoomed&&l===z.startScale))return X;if(R=parseFloat(R),j=parseFloat(j),z.disableXAxis||(X.x=(z.relative?a:0)+R),z.disableYAxis||(X.y=(z.relative?n:0)+j),z.contain){const G=Na(e),K=G.elem.width/l,Z=G.elem.height/l,at=K*T,pt=Z*T,ut=(at-K)/2,mt=(pt-Z)/2;if(z.contain==="inside"){const Lt=(-G.elem.margin.left-G.parent.padding.left+ut)/T,Ft=(G.parent.width-at-G.parent.padding.left-G.elem.margin.left-G.parent.border.left-G.parent.border.right+ut)/T;X.x=Math.max(Math.min(X.x,Ft),Lt);const Mt=(-G.elem.margin.top-G.parent.padding.top+mt)/T,Ht=(G.parent.height-pt-G.parent.padding.top-G.elem.margin.top-G.parent.border.top-G.parent.border.bottom+mt)/T;X.y=Math.max(Math.min(X.y,Ht),Mt)}else if(z.contain==="outside"){const Lt=(-(at-G.parent.width)-G.parent.padding.left-G.parent.border.left-G.parent.border.right+ut)/T,Ft=(ut-G.parent.padding.left)/T;X.x=Math.max(Math.min(X.x,Ft),Lt);const Mt=(-(pt-G.parent.height)-G.parent.padding.top-G.parent.border.top-G.parent.border.bottom+mt)/T,Ht=(mt-G.parent.padding.top)/T;X.y=Math.max(Math.min(X.y,Ht),Mt)}}return z.roundPixels&&(X.x=Math.round(X.x),X.y=Math.round(X.y)),X}function u(R,j){const T={...t,...j},W={scale:l,opts:T};if(!j?.force&&T.disableZoom)return W;let z=t.minScale,X=t.maxScale;if(T.contain){const G=Na(e),K=G.elem.width/l,Z=G.elem.height/l;if(K>1&&Z>1){const at=G.parent.width-G.parent.border.left-G.parent.border.right,pt=G.parent.height-G.parent.border.top-G.parent.border.bottom,ut=at/K,mt=pt/Z;t.contain==="inside"?X=Math.min(X,ut,mt):t.contain==="outside"&&(z=Math.max(z,ut,mt))}}return W.scale=Math.min(Math.max(R,z),X),W}function g(R,j,T,W){const z=f(R,j,l,T);return a!==z.x||n!==z.y?(a=z.x,n=z.y,d("panzoompan",z.opts,W)):{x:a,y:n,scale:l,isSVG:r,originalEvent:W}}function m(R,j,T){const W=u(R,j),z=W.opts;if(!j?.force&&z.disableZoom)return;R=W.scale;let X=a,G=n;if(z.focal){const Z=z.focal;X=(Z.x/R-Z.x/l+a*R)/R,G=(Z.y/R-Z.y/l+n*R)/R}const K=f(X,G,R,{relative:!1,force:!0});return a=K.x,n=K.y,l=R,d("panzoomzoom",z,T)}function y(R,j){const T={...t,animate:!0,...j};return m(l*Math.exp((R?1:-1)*T.step),T)}function x(R){return y(!0,R)}function C(R){return y(!1,R)}function w(R,j,T,W){const z=Na(e),X={width:z.parent.width-z.parent.padding.left-z.parent.padding.right-z.parent.border.left-z.parent.border.right,height:z.parent.height-z.parent.padding.top-z.parent.padding.bottom-z.parent.border.top-z.parent.border.bottom};let G=j.clientX-z.parent.left-z.parent.padding.left-z.parent.border.left-z.elem.margin.left,K=j.clientY-z.parent.top-z.parent.padding.top-z.parent.border.top-z.elem.margin.top;r||(G-=z.elem.width/l/2,K-=z.elem.height/l/2);const Z={x:G/X.width*(X.width*R),y:K/X.height*(X.height*R)};return m(R,{...T,animate:!1,focal:Z},W)}function S(R,j){R.preventDefault();const T={...t,...j,animate:!1},z=(R.deltaY===0&&R.deltaX?R.deltaX:R.deltaY)<0?1:-1,X=u(l*Math.exp(z*T.step/3),T).scale;return w(X,R,T,R)}function v(R){const j={...t,animate:!0,force:!0,...R};l=u(j.startScale,j).scale;const T=f(j.startX,j.startY,l,j);return a=T.x,n=T.y,d("panzoomreset",j)}let _,E,B,D,M,P;const U=[];function N(R){if(jb(R.target,t))return;pn(U,R),c=!0,t.handleStartEvent(R),_=a,E=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:R},t);const j=lc(U);B=j.clientX,D=j.clientY,M=l,P=ja(U)}function q(R){if(!c||_===void 0||E===void 0||B===void 0||D===void 0)return;pn(U,R);const j=lc(U),T=U.length>1;let W=l;if(T){P===0&&(P=ja(U));const z=ja(U)-P;W=u(z*t.step/80+M).scale,w(W,j,{animate:!1},R)}(!T||t.pinchAndPan)&&g(_+(j.clientX-B)/W,E+(j.clientY-D)/W,{animate:!1},R)}function A(R){U.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:R},t),Db(U,R),c&&(c=!1,_=E=B=D=void 0)}let $=!1;function O(){$||($=!0,qa("down",t.canvas?i:e,N),qa("move",document,q,{passive:!0}),qa("up",document,A,{passive:!0}))}function F(){$=!1,za("down",t.canvas?i:e,N),za("move",document,q),za("up",document,A)}return t.noBind||O(),{bind:O,destroy:F,eventNames:bo,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>Yb(t),handleDown:N,handleMove:q,handleUp:A,pan:g,reset:v,resetStyle:o,setOptions:s,setStyle:(R,j)=>oi(e,R,j),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:w,zoomWithWheel:S}}lu.defaultOptions=nu;const Ub=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Gb=Tt("arrow-down",Ub);const Xb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Vb=Tt("arrow-left",Xb);const Kb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Zb=Tt("arrow-right",Kb);const Qb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Jb=Tt("arrow-up",Qb);const t1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],mn=Tt("refresh-cw",t1);const e1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],r1=Tt("settings-2",e1);const i1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],hu=Tt("zoom-in",i1);const o1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],cu=Tt("zoom-out",o1);var du=Object.defineProperty,p=(e,t)=>du(e,"name",{value:t,configurable:!0}),uu=(e,t)=>{for(var r in t)du(e,r,{get:t[r],enumerable:!0})},ss={exports:{}},s1=ss.exports,hc;function a1(){return hc||(hc=1,(function(e,t){(function(r,i){e.exports=i()})(s1,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(q){var A=["th","st","nd","rd"],$=q%100;return"["+q+(A[($-20)%10]||A[$]||A[0])+"]"}},w=function(q,A,$){var O=String(q);return!O||O.length>=A?q:""+Array(A+1-O.length).join($)+q},S={s:w,z:function(q){var A=-q.utcOffset(),$=Math.abs(A),O=Math.floor($/60),F=$%60;return(A<=0?"+":"-")+w(O,2,"0")+":"+w(F,2,"0")},m:function q(A,$){if(A.date()<$.date())return-q($,A);var O=12*($.year()-A.year())+($.month()-A.month()),F=A.clone().add(O,d),R=$-F<0,j=A.clone().add(O+(R?-1:1),d);return+(-(O+($-F)/(R?F-j:j-F))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:d,y:u,w:h,d:c,D:g,h:l,m:n,s:a,ms:s,Q:f}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},v="en",_={};_[v]=C;var E="$isDayjsObject",B=function(q){return q instanceof U||!(!q||!q[E])},D=function q(A,$,O){var F;if(!A)return v;if(typeof A=="string"){var R=A.toLowerCase();_[R]&&(F=R),$&&(_[R]=$,F=R);var j=A.split("-");if(!F&&j.length>1)return q(j[0])}else{var T=A.name;_[T]=A,F=T}return!O&&F&&(v=F),F||!O&&v},M=function(q,A){if(B(q))return q.clone();var $=typeof A=="object"?A:{};return $.date=q,$.args=arguments,new U($)},P=S;P.l=D,P.i=B,P.w=function(q,A){return M(q,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var U=(function(){function q($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[E]=!0}var A=q.prototype;return A.parse=function($){this.$d=(function(O){var F=O.date,R=O.utc;if(F===null)return new Date(NaN);if(P.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var j=F.match(y);if(j){var T=j[2]-1||0,W=(j[7]||"0").substring(0,3);return R?new Date(Date.UTC(j[1],T,j[3]||1,j[4]||0,j[5]||0,j[6]||0,W)):new Date(j[1],T,j[3]||1,j[4]||0,j[5]||0,j[6]||0,W)}}return new Date(F)})($),this.init()},A.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},A.$utils=function(){return P},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function($,O){var F=M($);return this.startOf(O)<=F&&F<=this.endOf(O)},A.isAfter=function($,O){return M($)<this.startOf(O)},A.isBefore=function($,O){return this.endOf(O)<M($)},A.$g=function($,O,F){return P.u($)?this[O]:this.set(F,$)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function($,O){var F=this,R=!!P.u(O)||O,j=P.p($),T=function(pt,ut){var mt=P.w(F.$u?Date.UTC(F.$y,ut,pt):new Date(F.$y,ut,pt),F);return R?mt:mt.endOf(c)},W=function(pt,ut){return P.w(F.toDate()[pt].apply(F.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(ut)),F)},z=this.$W,X=this.$M,G=this.$D,K="set"+(this.$u?"UTC":"");switch(j){case u:return R?T(1,0):T(31,11);case d:return R?T(1,X):T(0,X+1);case h:var Z=this.$locale().weekStart||0,at=(z<Z?z+7:z)-Z;return T(R?G-at:G+(6-at),X);case c:case g:return W(K+"Hours",0);case l:return W(K+"Minutes",1);case n:return W(K+"Seconds",2);case a:return W(K+"Milliseconds",3);default:return this.clone()}},A.endOf=function($){return this.startOf($,!1)},A.$set=function($,O){var F,R=P.p($),j="set"+(this.$u?"UTC":""),T=(F={},F[c]=j+"Date",F[g]=j+"Date",F[d]=j+"Month",F[u]=j+"FullYear",F[l]=j+"Hours",F[n]=j+"Minutes",F[a]=j+"Seconds",F[s]=j+"Milliseconds",F)[R],W=R===c?this.$D+(O-this.$W):O;if(R===d||R===u){var z=this.clone().set(g,1);z.$d[T](W),z.init(),this.$d=z.set(g,Math.min(this.$D,z.daysInMonth())).$d}else T&&this.$d[T](W);return this.init(),this},A.set=function($,O){return this.clone().$set($,O)},A.get=function($){return this[P.p($)]()},A.add=function($,O){var F,R=this;$=Number($);var j=P.p(O),T=function(X){var G=M(R);return P.w(G.date(G.date()+Math.round(X*$)),R)};if(j===d)return this.set(d,this.$M+$);if(j===u)return this.set(u,this.$y+$);if(j===c)return T(1);if(j===h)return T(7);var W=(F={},F[n]=i,F[l]=o,F[a]=r,F)[j]||1,z=this.$d.getTime()+$*W;return P.w(z,this)},A.subtract=function($,O){return this.add(-1*$,O)},A.format=function($){var O=this,F=this.$locale();if(!this.isValid())return F.invalidDate||m;var R=$||"YYYY-MM-DDTHH:mm:ssZ",j=P.z(this),T=this.$H,W=this.$m,z=this.$M,X=F.weekdays,G=F.months,K=F.meridiem,Z=function(ut,mt,Lt,Ft){return ut&&(ut[mt]||ut(O,R))||Lt[mt].slice(0,Ft)},at=function(ut){return P.s(T%12||12,ut,"0")},pt=K||function(ut,mt,Lt){var Ft=ut<12?"AM":"PM";return Lt?Ft.toLowerCase():Ft};return R.replace(x,(function(ut,mt){return mt||(function(Lt){switch(Lt){case"YY":return String(O.$y).slice(-2);case"YYYY":return P.s(O.$y,4,"0");case"M":return z+1;case"MM":return P.s(z+1,2,"0");case"MMM":return Z(F.monthsShort,z,G,3);case"MMMM":return Z(G,z);case"D":return O.$D;case"DD":return P.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return Z(F.weekdaysMin,O.$W,X,2);case"ddd":return Z(F.weekdaysShort,O.$W,X,3);case"dddd":return X[O.$W];case"H":return String(T);case"HH":return P.s(T,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return pt(T,W,!0);case"A":return pt(T,W,!1);case"m":return String(W);case"mm":return P.s(W,2,"0");case"s":return String(O.$s);case"ss":return P.s(O.$s,2,"0");case"SSS":return P.s(O.$ms,3,"0");case"Z":return j}return null})(ut)||j.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function($,O,F){var R,j=this,T=P.p(O),W=M($),z=(W.utcOffset()-this.utcOffset())*i,X=this-W,G=function(){return P.m(j,W)};switch(T){case u:R=G()/12;break;case d:R=G();break;case f:R=G()/3;break;case h:R=(X-z)/6048e5;break;case c:R=(X-z)/864e5;break;case l:R=X/o;break;case n:R=X/i;break;case a:R=X/r;break;default:R=X}return F?R:P.a(R)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return _[this.$L]},A.locale=function($,O){if(!$)return this.$L;var F=this.clone(),R=D($,O,!0);return R&&(F.$L=R),F},A.clone=function(){return P.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},q})(),N=U.prototype;return M.prototype=N,[["$ms",s],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",u],["$D",g]].forEach((function(q){N[q[1]]=function(A){return this.$g(A,q[0],q[1])}})),M.extend=function(q,A){return q.$i||(q(A,U,M),q.$i=!0),M},M.locale=D,M.isDayjs=B,M.unix=function(q){return M(1e3*q)},M.en=_[v],M.Ls=_,M.p={},M}))})(ss)),ss.exports}var n1=a1();const fu=tu(n1);var Xe={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:p((...e)=>{},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},_l=p(function(e="fatal"){let t=Xe.fatal;typeof e=="string"?e.toLowerCase()in Xe&&(t=Xe[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=Xe.fatal&&(V.fatal=console.error?console.error.bind(console,me("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",me("FATAL"))),t<=Xe.error&&(V.error=console.error?console.error.bind(console,me("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",me("ERROR"))),t<=Xe.warn&&(V.warn=console.warn?console.warn.bind(console,me("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",me("WARN"))),t<=Xe.info&&(V.info=console.info?console.info.bind(console,me("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",me("INFO"))),t<=Xe.debug&&(V.debug=console.debug?console.debug.bind(console,me("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("DEBUG"))),t<=Xe.trace&&(V.trace=console.debug?console.debug.bind(console,me("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("TRACE")))},"setLogLevel"),me=p(e=>`%c${fu().format("ss.SSS")} : ${e} : `,"format");const as={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return as.hue2rgb(s,o,e+1/3)*255;case"g":return as.hue2rgb(s,o,e)*255;case"b":return as.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},l1={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},h1={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},gt={channel:as,lang:l1,unit:h1},nr={};for(let e=0;e<=255;e++)nr[e]=gt.unit.dec2hex(e);const Jt={ALL:0,RGB:1,HSL:2};class c1{constructor(){this.type=Jt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Jt.ALL}is(t){return this.type===t}}class d1{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new c1}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Jt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=gt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=gt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=gt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=gt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=gt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=gt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Jt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Jt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Jt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Jt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Jt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Jt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ra=new d1({r:0,g:0,b:0,a:0},"transparent"),ni={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ni.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return ra.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${nr[Math.round(t)]}${nr[Math.round(r)]}${nr[Math.round(i)]}${nr[Math.round(o*255)]}`:`#${nr[Math.round(t)]}${nr[Math.round(r)]}${nr[Math.round(i)]}`}},Er={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Er.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return gt.channel.clamp.h(parseFloat(r)*.9);case"rad":return gt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return gt.channel.clamp.h(parseFloat(r)*360)}}return gt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Er.re);if(!r)return;const[,i,o,s,a,n]=r;return ra.set({h:Er._hue2deg(i),s:gt.channel.clamp.s(parseFloat(o)),l:gt.channel.clamp.l(parseFloat(s)),a:a?gt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${gt.lang.round(t)}, ${gt.lang.round(r)}%, ${gt.lang.round(i)}%, ${o})`:`hsl(${gt.lang.round(t)}, ${gt.lang.round(r)}%, ${gt.lang.round(i)}%)`}},uo={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=uo.colors[e];if(t)return ni.parse(t)},stringify:e=>{const t=ni.stringify(e);for(const r in uo.colors)if(uo.colors[r]===t)return r}},io={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(io.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return ra.set({r:gt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:gt.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:gt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?gt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${gt.lang.round(t)}, ${gt.lang.round(r)}, ${gt.lang.round(i)}, ${gt.lang.round(o)})`:`rgb(${gt.lang.round(t)}, ${gt.lang.round(r)}, ${gt.lang.round(i)})`}},Me={format:{keyword:uo,hex:ni,rgb:io,rgba:io,hsl:Er,hsla:Er},parse:e=>{if(typeof e!="string")return e;const t=ni.parse(e)||io.parse(e)||Er.parse(e)||uo.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Jt.HSL)||e.data.r===void 0?Er.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?io.stringify(e):ni.stringify(e)},gu=(e,t)=>{const r=Me.parse(e);for(const i in t)r[i]=gt.channel.clamp[i](t[i]);return Me.stringify(r)},Je=(e,t,r=0,i=1)=>{if(typeof e!="number")return gu(e,{a:t});const o=ra.set({r:gt.channel.clamp.r(e),g:gt.channel.clamp.g(t),b:gt.channel.clamp.b(r),a:gt.channel.clamp.a(i)});return Me.stringify(o)},u1=e=>{const{r:t,g:r,b:i}=Me.parse(e),o=.2126*gt.channel.toLinear(t)+.7152*gt.channel.toLinear(r)+.0722*gt.channel.toLinear(i);return gt.lang.round(o)},f1=e=>u1(e)>=.5,ke=e=>!f1(e),Bl=(e,t,r)=>{const i=Me.parse(e),o=i[t],s=gt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Me.stringify(i)},H=(e,t)=>Bl(e,"l",t),Y=(e,t)=>Bl(e,"l",-t),b=(e,t)=>{const r=Me.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return gu(e,i)},g1=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Me.parse(e),{r:n,g:l,b:c,a:h}=Me.parse(t),d=r/100,f=d*2-1,u=a-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,x=i*m+n*y,C=o*m+l*y,w=s*m+c*y,S=a*d+h*(1-d);return Je(x,C,w,S)},I=(e,t=100)=>{const r=Me.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,g1(r,e,t)};var yn=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>yn(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=yn(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),qt=yn,We="#ffffff",He="#f2f2f2",dt=p((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),ci,p1=(ci=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Y(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10)):(this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ci,"Theme"),ci),m1=p(e=>{const t=new p1;return t.calculate(e),t},"getThemeVariables"),di,y1=(di=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=Y("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Y(this.sectionBkgColor,10),this.taskBorderColor=Je(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Je(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=H(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=H(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=H(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=I(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||I(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??H(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=H(this.secondaryColor,20),this.git1=H(this.pie2||this.secondaryColor,20),this.git2=H(this.pie3||this.tertiaryColor,20),this.git3=H(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=H(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=H(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=H(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=H(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||H("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||H("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||H("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||H("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||H(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||H(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||H(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||H(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(di,"Theme"),di),x1=p(e=>{const t=new y1;return t.calculate(e),t},"getThemeVariables"),ui,C1=(ui=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=b(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Je(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||I(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||I(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||H(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||H(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||b(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||b(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||Y(I(this.git0),25),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ui,"Theme"),ui),pu=p(e=>{const t=new C1;return t.calculate(e),t},"getThemeVariables"),fi,b1=(fi=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=H("#cde498",10),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.primaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=Y(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-30}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(fi,"Theme"),fi),k1=p(e=>{const t=new b1;return t.calculate(e),t},"getThemeVariables"),gi,w1=(gi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=H(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=H(this.contrast,55),this.border2=this.contrast,this.actorBorder=H(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||I(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=H(this.contrast,30),this.sectionBkgColor2=H(this.contrast,30),this.taskBorderColor=Y(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=H(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Y(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Y(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||b(this.primaryColor,{h:-30}),this.git4=this.pie5||b(this.primaryColor,{h:-60}),this.git5=this.pie6||b(this.primaryColor,{h:-90}),this.git6=this.pie7||b(this.primaryColor,{h:60}),this.git7=this.pie8||b(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(gi,"Theme"),gi),S1=p(e=>{const t=new w1;return t.calculate(e),t},"getThemeVariables"),pi,v1=(pi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||b(t,{h:30}),this.cScale4=this.cScale4||b(t,{h:60}),this.cScale5=this.cScale5||b(t,{h:90}),this.cScale6=this.cScale6||b(t,{h:120}),this.cScale7=this.cScale7||b(t,{h:150}),this.cScale8=this.cScale8||b(t,{h:210,l:150}),this.cScale9=this.cScale9||b(t,{h:270}),this.cScale10=this.cScale10||b(t,{h:300}),this.cScale11=this.cScale11||b(t,{h:330}),this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(pi,"Theme"),pi),T1=p(e=>{const t=new v1;return t.calculate(e),t},"getThemeVariables"),mi,_1=(mi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=I(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(mi,"Theme"),mi),B1=p(e=>{const t=new _1;return t.calculate(e),t},"getThemeVariables"),yi,L1=(yi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=dt("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=this.mainBkg;if(this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(yi,"Theme"),yi),E1=p(e=>{const t=new L1;return t.calculate(e),t},"getThemeVariables"),xi,F1=(xi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=I(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(xi,"Theme"),xi),A1=p(e=>{const t=new F1;return t.calculate(e),t},"getThemeVariables"),Ci,M1=(Ci=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Ci,"Theme"),Ci),$1=p(e=>{const t=new M1;return t.calculate(e),t},"getThemeVariables"),bi,O1=(bi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=I(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=Y(this["cScale"+r],75);const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(bi,"Theme"),bi),R1=p(e=>{const t=new O1;return t.calculate(e),t},"getThemeVariables"),tr={base:{getThemeVariables:m1},dark:{getThemeVariables:x1},default:{getThemeVariables:pu},forest:{getThemeVariables:k1},neutral:{getThemeVariables:S1},neo:{getThemeVariables:T1},"neo-dark":{getThemeVariables:B1},redux:{getThemeVariables:E1},"redux-dark":{getThemeVariables:A1},"redux-color":{getThemeVariables:$1},"redux-dark-color":{getThemeVariables:R1}},Vt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},mu={...Vt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:tr.default.getThemeVariables(),sequence:{...Vt.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Vt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Vt.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Vt.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Vt.pie,useWidth:984},xyChart:{...Vt.xyChart,useWidth:void 0},requirement:{...Vt.requirement,useWidth:void 0},packet:{...Vt.packet},eventmodeling:{...Vt.eventmodeling},treeView:{...Vt.treeView,useWidth:void 0},radar:{...Vt.radar},railroad:{...Vt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Vt.ishikawa},sankey:{...Vt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Vt.venn},cynefin:{...Vt.cynefin}},yu=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...yu(e[i],"")]:[...r,t+i],[]),"keyify"),I1=new Set(yu(mu,"")),Ll=mu,P1={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},D1=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(V.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),ks=p(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>ks(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!I1.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=P1[t];i?D1(e[t],i):(V.debug("sanitizing object",t),ks(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=xu(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}V.debug("After sanitization",e)}},"sanitizeDirective"),xu=p(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Bi=Object.freeze(Ll),Ye=p(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ce=qt({},Bi),ws,Ir=[],fo=qt({},Bi),ia=p((e,t)=>{let r=qt({},e),i={};for(const o of t)ku(o),i=qt(i,o);if(r=qt(r,i),i.theme&&i.theme in tr){const o=qt({},ws),s=qt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in tr&&(r.themeVariables=tr[r.theme].getThemeVariables(s))}return fo=r,Su(fo),fo},"updateCurrentConfig"),N1=p(e=>(ce=qt({},Bi),ce=qt(ce,e),e.theme&&tr[e.theme]&&(ce.themeVariables=tr[e.theme].getThemeVariables(e.themeVariables)),ia(ce,Ir),ce),"setSiteConfig"),q1=p(e=>{ws=qt({},e)},"saveConfigFromInitialize"),z1=p(e=>(ce=qt(ce,e),ia(ce,Ir),ce),"updateSiteConfig"),Cu=p(()=>qt({},ce),"getSiteConfig"),bu=p(e=>(Su(e),qt(fo,e),Ot()),"setConfig"),Ot=p(()=>qt({},fo),"getConfig"),ku=p(e=>{e&&(["secure",...ce.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(V.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&ku(e[t])}))},"sanitize"),j1=p(e=>{ks(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Ir.push(e),ia(ce,Ir)},"addDirective"),Ss=p((e=ce)=>{Ir=[],ia(e,Ir)},"reset"),W1={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},cc={},wu=p(e=>{cc[e]||(V.warn(W1[e]),cc[e]=!0)},"issueWarning"),Su=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&wu("LAZY_LOAD_DEPRECATED")},"checkConfig"),H1=p(()=>{let e={};ws&&(e=qt(e,ws));for(const t of Ir)e=qt(e,t);return e},"getUserDefinedConfig"),ee=p(e=>(e.flowchart?.htmlLabels!=null&&wu("FLOWCHART_HTML_LABELS_DEPRECATED"),Ye(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),vu=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,go=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Y1=/\s*%%.*\n/gm,ki,Tu=(ki=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(ki,"UnknownDiagramError"),ki),Pr={},El=p(function(e,t){e=e.replace(vu,"").replace(go,"").replace(Y1,`
|
|
8
|
+
`);for(const[r,{detector:i}]of Object.entries(Pr))if(i(e,t))return r;throw new Tu(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),xn=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)_u(t,r,i)},"registerLazyLoadedDiagrams"),_u=p((e,t,r)=>{Pr[e]&&V.warn(`Detector with key ${e} already exists. Overwriting.`),Pr[e]={detector:t,loader:r},V.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),U1=p(e=>Pr[e].loader,"getDiagramLoader"),Ii=/<br\s*\/?>/gi,G1=p(e=>e?Eu(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),X1=(()=>{let e=!1;return()=>{e||(Bu(),e=!0)}})();function Bu(){const e="data-temp-href-target";Ti.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Ti.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(Bu,"setupDompurifyHooks");var Lu=p(e=>(X1(),Ti.sanitize(e)),"removeScript"),dc=p((e,t)=>{if(ee(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Lu(e):r!=="loose"&&(e=Eu(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=Q1(e))}return e},"sanitizeMore"),Ce=p((e,t)=>e&&(t.dompurifyConfig?e=Ti.sanitize(dc(e,t),t.dompurifyConfig).toString():e=Ti.sanitize(dc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),V1=p((e,t)=>typeof e=="string"?Ce(e,t):e.flat().map(r=>Ce(r,t)),"sanitizeTextOrArray"),K1=p(e=>Ii.test(e),"hasBreaks"),Z1=p(e=>e.split(Ii),"splitBreaks"),Q1=p(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Eu=p(e=>e.replace(Ii,"#br#"),"breakToPlaceholder"),Fu=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),J1=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),tk=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Cn=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const s=t[i-1],a=t[i+1];ek(s,a)&&(o=s+","+a,i++,r.pop())}r.push(rk(o))}return r.join("")},"parseGenericTypes"),bn=p((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),ek=p((e,t)=>{const r=bn(e,"~"),i=bn(t,"~");return r===1&&i===1},"shouldCombineSets"),rk=p(e=>{const t=bn(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),uc=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),kn=/\$\$(.*?)\$\$/g,Li=p(e=>(e.match(kn)?.length??0)>0,"hasKatex"),ik=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Fl(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),ok=p(async(e,t)=>{if(!Li(e))return e;if(!(uc()||t.legacyMathML||t.forceLegacyMathML))return e.replace(kn,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!uc()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Ii).map(o=>Li(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(kn,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Fl=p(async(e,t)=>Ce(await ok(e,t),t),"renderKatexSanitized"),Pi={getRows:G1,sanitizeText:Ce,sanitizeTextOrArray:V1,hasBreaks:K1,splitBreaks:Z1,lineBreakRegex:Ii,removeScript:Lu,getUrl:Fu,evaluate:Ye,getMax:J1,getMin:tk},sk=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),ak=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Al=p(function(e,t,r,i){const o=ak(t,r,i);sk(e,o)},"configureSvgSize"),Au=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;V.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;V.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,V.info(`Calculated bounds: ${n}x${l}`),Al(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),ns={};function wn(e){return[...e.cssRules].map(t=>t.cssText).join(`
|
|
9
|
+
`)}p(wn,"cssStyleSheetToString");var nk=p((e,t,r,i)=>{let o="";return e in ns&&ns[e]?o=ns[e]({...r,svgId:i}):V.warn(`No theme found for ${e}`),` & {
|
|
10
10
|
font-family: ${r.fontFamily};
|
|
11
11
|
font-size: ${r.fontSize};
|
|
12
12
|
fill: ${r.textColor}
|
|
@@ -127,65 +127,65 @@ ${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
${t}
|
|
130
|
-
`},"getStyles"),
|
|
131
|
-
`)},"setAccDescription"),$u=g(()=>Ol,"getAccDescription"),Ou=g(e=>{$l=Rl(e)},"setDiagramTitle"),Ru=g(()=>$l,"getDiagramTitle"),uc=V,nk=Tl,kt=Ot,lk=yu,hk=Bi,Il=g(e=>Ce(e,kt()),"sanitizeText"),Iu=Lu,ck=g(()=>Al,"getCommonDb"),Ss={},vs=g((e,t,r)=>{Ss[e]&&uc.warn(`Diagram with id ${e} already registered. Overwriting.`),Ss[e]=t,r&&Su(e,r),sk(e,t.styles),t.injectUtils?.(uc,nk,kt,Il,Iu,ck(),()=>{})},"registerDiagram"),wn=g(e=>{if(e in Ss)return Ss[e];throw new dk(e)},"getDiagram"),wi,dk=(wi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},g(wi,"DiagramNotFoundError"),wi),uk={value:()=>{}};function Pu(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new ns(r)}function ns(e){this._=e}function fk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}ns.prototype=Pu.prototype={constructor:ns,on:function(e,t){var r=this._,i=fk(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=pk(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(o=(e=i[s]).type)r[o]=fc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=fc(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new ns(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,o=s.length;i<o;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,s=i.length;o<s;++o)i[o].value.apply(t,r)}};function pk(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function fc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=uk,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Sn="http://www.w3.org/1999/xhtml";const pc={svg:"http://www.w3.org/2000/svg",xhtml:Sn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ia(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),pc.hasOwnProperty(t)?{space:pc[t],local:e}:e}function gk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Sn&&t.documentElement.namespaceURI===Sn?t.createElement(e):t.createElementNS(r,e)}}function mk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Du(e){var t=ia(e);return(t.local?mk:gk)(t)}function yk(){}function Pl(e){return e==null?yk:function(){return this.querySelector(e)}}function xk(e){typeof e!="function"&&(e=Pl(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=new Array(a),l,c,h=0;h<a;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new pe(i,this._parents)}function Ck(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bk(){return[]}function Nu(e){return e==null?bk:function(){return this.querySelectorAll(e)}}function kk(e){return function(){return Ck(e.apply(this,arguments))}}function wk(e){typeof e=="function"?e=kk(e):e=Nu(e);for(var t=this._groups,r=t.length,i=[],o=[],s=0;s<r;++s)for(var a=t[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),o.push(l));return new pe(i,o)}function qu(e){return function(){return this.matches(e)}}function zu(e){return function(t){return t.matches(e)}}var Sk=Array.prototype.find;function vk(e){return function(){return Sk.call(this.children,e)}}function Tk(){return this.firstElementChild}function _k(e){return this.select(e==null?Tk:vk(typeof e=="function"?e:zu(e)))}var Bk=Array.prototype.filter;function Lk(){return Array.from(this.children)}function Ek(e){return function(){return Bk.call(this.children,e)}}function Fk(e){return this.selectAll(e==null?Lk:Ek(typeof e=="function"?e:zu(e)))}function Ak(e){typeof e!="function"&&(e=qu(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new pe(i,this._parents)}function ju(e){return new Array(e.length)}function Mk(){return new pe(this._enter||this._groups.map(ju),this._parents)}function Ts(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ts.prototype={constructor:Ts,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $k(e){return function(){return e}}function Ok(e,t,r,i,o,s){for(var a=0,n,l=t.length,c=s.length;a<c;++a)(n=t[a])?(n.__data__=s[a],i[a]=n):r[a]=new Ts(e,s[a]);for(;a<l;++a)(n=t[a])&&(o[a]=n)}function Rk(e,t,r,i,o,s,a){var n,l,c=new Map,h=t.length,d=s.length,u=new Array(h),f;for(n=0;n<h;++n)(l=t[n])&&(u[n]=f=a.call(l,l.__data__,n,t)+"",c.has(f)?o[n]=l:c.set(f,l));for(n=0;n<d;++n)f=a.call(e,s[n],n,s)+"",(l=c.get(f))?(i[n]=l,l.__data__=s[n],c.delete(f)):r[n]=new Ts(e,s[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(o[n]=l)}function Ik(e){return e.__data__}function Pk(e,t){if(!arguments.length)return Array.from(this,Ik);var r=t?Rk:Ok,i=this._parents,o=this._groups;typeof e!="function"&&(e=$k(e));for(var s=o.length,a=new Array(s),n=new Array(s),l=new Array(s),c=0;c<s;++c){var h=i[c],d=o[c],u=d.length,f=Dk(e.call(h,h&&h.__data__,c,i)),p=f.length,m=n[c]=new Array(p),y=a[c]=new Array(p),x=l[c]=new Array(u);r(h,d,m,y,x,f,t);for(var C=0,k=0,S,v;C<p;++C)if(S=m[C]){for(C>=k&&(k=C+1);!(v=y[k])&&++k<p;);S._next=v||null}}return a=new pe(a,i),a._enter=n,a._exit=l,a}function Dk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Nk(){return new pe(this._exit||this._groups.map(ju),this._parents)}function qk(e,t,r){var i=this.enter(),o=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function zk(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,s=i.length,a=Math.min(o,s),n=new Array(o),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,u=n[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||h[p])&&(u[p]=f);for(;l<o;++l)n[l]=r[l];return new pe(n,this._parents)}function jk(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Wk(e){e||(e=Hk);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],n=a.length,l=o[s]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new pe(o,this._parents).order()}function Hk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Yk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Uk(){return Array.from(this)}function Xk(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function Gk(){let e=0;for(const t of this)++e;return e}function Vk(){return!this.node()}function Kk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],s=0,a=o.length,n;s<a;++s)(n=o[s])&&e.call(n,n.__data__,s,o);return this}function Zk(e){return function(){this.removeAttribute(e)}}function Qk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jk(e,t){return function(){this.setAttribute(e,t)}}function t2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function e2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function r2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function i2(e,t){var r=ia(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?Qk:Zk:typeof t=="function"?r.local?r2:e2:r.local?t2:Jk)(r,t))}function Wu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function o2(e){return function(){this.style.removeProperty(e)}}function s2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function a2(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function n2(e,t,r){return arguments.length>1?this.each((t==null?o2:typeof t=="function"?a2:s2)(e,t,r??"")):Ei(this.node(),e)}function Ei(e,t){return e.style.getPropertyValue(t)||Wu(e).getComputedStyle(e,null).getPropertyValue(t)}function l2(e){return function(){delete this[e]}}function h2(e,t){return function(){this[e]=t}}function c2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function d2(e,t){return arguments.length>1?this.each((t==null?l2:typeof t=="function"?c2:h2)(e,t)):this.node()[e]}function Hu(e){return e.trim().split(/^|\s+/)}function Dl(e){return e.classList||new Yu(e)}function Yu(e){this._node=e,this._names=Hu(e.getAttribute("class")||"")}Yu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Uu(e,t){for(var r=Dl(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function Xu(e,t){for(var r=Dl(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function u2(e){return function(){Uu(this,e)}}function f2(e){return function(){Xu(this,e)}}function p2(e,t){return function(){(t.apply(this,arguments)?Uu:Xu)(this,e)}}function g2(e,t){var r=Hu(e+"");if(arguments.length<2){for(var i=Dl(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?p2:t?u2:f2)(r,t))}function m2(){this.textContent=""}function y2(e){return function(){this.textContent=e}}function x2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function C2(e){return arguments.length?this.each(e==null?m2:(typeof e=="function"?x2:y2)(e)):this.node().textContent}function b2(){this.innerHTML=""}function k2(e){return function(){this.innerHTML=e}}function w2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function S2(e){return arguments.length?this.each(e==null?b2:(typeof e=="function"?w2:k2)(e)):this.node().innerHTML}function v2(){this.nextSibling&&this.parentNode.appendChild(this)}function T2(){return this.each(v2)}function _2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function B2(){return this.each(_2)}function L2(e){var t=typeof e=="function"?e:Du(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function E2(){return null}function F2(e,t){var r=typeof e=="function"?e:Du(e),i=t==null?E2:typeof t=="function"?t:Pl(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function A2(){var e=this.parentNode;e&&e.removeChild(this)}function M2(){return this.each(A2)}function $2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function O2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function R2(e){return this.select(e?O2:$2)}function I2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function P2(e){return function(t){e.call(this,t,this.__data__)}}function D2(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function N2(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r<o;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function q2(e,t,r){return function(){var i=this.__on,o,s=P2(t);if(i){for(var a=0,n=i.length;a<n;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=t;return}}this.addEventListener(e.type,s,r),o={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(o):this.__on=[o]}}function z2(e,t,r){var i=D2(e+""),o,s=i.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(o=0,h=n[l];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?q2:N2,o=0;o<s;++o)this.each(n(i[o],t,r));return this}function Gu(e,t,r){var i=Wu(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function j2(e,t){return function(){return Gu(this,e,t)}}function W2(e,t){return function(){return Gu(this,e,t.apply(this,arguments))}}function H2(e,t){return this.each((typeof t=="function"?W2:j2)(e,t))}function*Y2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var Vu=[null];function pe(e,t){this._groups=e,this._parents=t}function $o(){return new pe([[document.documentElement]],Vu)}function U2(){return this}pe.prototype=$o.prototype={constructor:pe,select:xk,selectAll:wk,selectChild:_k,selectChildren:Fk,filter:Ak,data:Pk,enter:Mk,exit:Nk,join:qk,merge:zk,selection:U2,order:jk,sort:Wk,call:Yk,nodes:Uk,node:Xk,size:Gk,empty:Vk,each:Kk,attr:i2,style:n2,property:d2,classed:g2,text:C2,html:S2,raise:T2,lower:B2,append:L2,insert:F2,remove:M2,clone:R2,datum:I2,on:z2,dispatch:H2,[Symbol.iterator]:Y2};function yt(e){return typeof e=="string"?new pe([[document.querySelector(e)]],[document.documentElement]):new pe([[e]],Vu)}function oa(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Nl(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Di(){}var bo=.7,_s=1/bo,li="\\s*([+-]?\\d+)\\s*",ko="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",X2=/^#([0-9a-f]{3,8})$/,G2=new RegExp(`^rgb\\(${li},${li},${li}\\)$`),V2=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),K2=new RegExp(`^rgba\\(${li},${li},${li},${ko}\\)$`),Z2=new RegExp(`^rgba\\(${qe},${qe},${qe},${ko}\\)$`),Q2=new RegExp(`^hsl\\(${ko},${qe},${qe}\\)$`),J2=new RegExp(`^hsla\\(${ko},${qe},${qe},${ko}\\)$`),gc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};oa(Di,Fi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mc,formatHex:mc,formatHex8:tw,formatHsl:ew,formatRgb:yc,toString:yc});function mc(){return this.rgb().formatHex()}function tw(){return this.rgb().formatHex8()}function ew(){return Zu(this).formatHsl()}function yc(){return this.rgb().formatRgb()}function Fi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=X2.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?xc(t):r===3?new se(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Yo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Yo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=G2.exec(e))?new se(t[1],t[2],t[3],1):(t=V2.exec(e))?new se(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=K2.exec(e))?Yo(t[1],t[2],t[3],t[4]):(t=Z2.exec(e))?Yo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Q2.exec(e))?kc(t[1],t[2]/100,t[3]/100,1):(t=J2.exec(e))?kc(t[1],t[2]/100,t[3]/100,t[4]):gc.hasOwnProperty(e)?xc(gc[e]):e==="transparent"?new se(NaN,NaN,NaN,0):null}function xc(e){return new se(e>>16&255,e>>8&255,e&255,1)}function Yo(e,t,r,i){return i<=0&&(e=t=r=NaN),new se(e,t,r,i)}function Ku(e){return e instanceof Di||(e=Fi(e)),e?(e=e.rgb(),new se(e.r,e.g,e.b,e.opacity)):new se}function vn(e,t,r,i){return arguments.length===1?Ku(e):new se(e,t,r,i??1)}function se(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}oa(se,vn,Nl(Di,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bo:Math.pow(bo,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new se($r(this.r),$r(this.g),$r(this.b),Bs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Cc,formatHex:Cc,formatHex8:rw,formatRgb:bc,toString:bc}));function Cc(){return`#${Fr(this.r)}${Fr(this.g)}${Fr(this.b)}`}function rw(){return`#${Fr(this.r)}${Fr(this.g)}${Fr(this.b)}${Fr((isNaN(this.opacity)?1:this.opacity)*255)}`}function bc(){const e=Bs(this.opacity);return`${e===1?"rgb(":"rgba("}${$r(this.r)}, ${$r(this.g)}, ${$r(this.b)}${e===1?")":`, ${e})`}`}function Bs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $r(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fr(e){return e=$r(e),(e<16?"0":"")+e.toString(16)}function kc(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ee(e,t,r,i)}function Zu(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Di||(e=Fi(e)),!e)return new Ee;if(e instanceof Ee)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r<i)*6:r===s?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?s+o:2-s-o,a*=60):n=l>0&&l<1?0:a,new Ee(a,n,l,e.opacity)}function iw(e,t,r,i){return arguments.length===1?Zu(e):new Ee(e,t,r,i??1)}function Ee(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}oa(Ee,iw,Nl(Di,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bo:Math.pow(bo,e),new Ee(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new se(ja(e>=240?e-240:e+120,o,i),ja(e,o,i),ja(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Ee(wc(this.h),Uo(this.s),Uo(this.l),Bs(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Bs(this.opacity);return`${e===1?"hsl(":"hsla("}${wc(this.h)}, ${Uo(this.s)*100}%, ${Uo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wc(e){return e=(e||0)%360,e<0?e+360:e}function Uo(e){return Math.max(0,Math.min(1,e||0))}function ja(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const sa=e=>()=>e;function Qu(e,t){return function(r){return e+r*t}}function ow(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function sw(e,t){var r=t-e;return r?Qu(e,r>180||r<-180?r-360*Math.round(r/360):r):sa(isNaN(e)?t:e)}function aw(e){return(e=+e)==1?ql:function(t,r){return r-t?ow(t,r,e):sa(isNaN(t)?r:t)}}function ql(e,t){var r=t-e;return r?Qu(e,r):sa(isNaN(e)?t:e)}const Tn=(function e(t){var r=aw(t);function i(o,s){var a=r((o=vn(o)).r,(s=vn(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=ql(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function Qe(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var _n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wa=new RegExp(_n.source,"g");function nw(e){return function(){return e}}function lw(e){return function(t){return e(t)+""}}function Ju(e,t){var r=_n.lastIndex=Wa.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=_n.exec(e))&&(o=Wa.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:Qe(i,o)})),r=Wa.lastIndex;return r<t.length&&(s=t.slice(r),n[a]?n[a]+=s:n[++a]=s),n.length<2?l[0]?lw(l[0].x):nw(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)n[(d=l[h]).i]=d.x(c);return n.join("")})}var Sc=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tf(e,t,r,i,o,s){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),e*i<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*Sc,skewX:Math.atan(l)*Sc,scaleX:a,scaleY:n}}var Xo;function hw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bn:tf(t.a,t.b,t.c,t.d,t.e,t.f)}function cw(e){return e==null||(Xo||(Xo=document.createElementNS("http://www.w3.org/2000/svg","g")),Xo.setAttribute("transform",e),!(e=Xo.transform.baseVal.consolidate()))?Bn:(e=e.matrix,tf(e.a,e.b,e.c,e.d,e.e,e.f))}function ef(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function s(c,h,d,u,f,p){if(c!==d||h!==u){var m=f.push("translate(",null,t,null,r);p.push({i:m-4,x:Qe(c,d)},{i:m-2,x:Qe(h,u)})}else(d||u)&&f.push("translate("+d+t+u+r)}function a(c,h,d,u){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),u.push({i:d.push(o(d)+"rotate(",null,i)-2,x:Qe(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,u){c!==h?u.push({i:d.push(o(d)+"skewX(",null,i)-2,x:Qe(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,u,f,p){if(c!==d||h!==u){var m=f.push(o(f)+"scale(",null,",",null,")");p.push({i:m-4,x:Qe(c,d)},{i:m-2,x:Qe(h,u)})}else(d!==1||u!==1)&&f.push(o(f)+"scale("+d+","+u+")")}return function(c,h){var d=[],u=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,u),a(c.rotate,h.rotate,d,u),n(c.skewX,h.skewX,d,u),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,u),c=h=null,function(f){for(var p=-1,m=u.length,y;++p<m;)d[(y=u[p]).i]=y.x(f);return d.join("")}}}var dw=ef(hw,"px, ","px)","deg)"),uw=ef(cw,", ",")",")"),Ai=0,oo=0,Vi=0,rf=1e3,Ls,so,Es=0,Dr=0,aa=0,wo=typeof performance=="object"&&performance.now?performance:Date,of=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zl(){return Dr||(of(fw),Dr=wo.now()+aa)}function fw(){Dr=0}function Fs(){this._call=this._time=this._next=null}Fs.prototype=sf.prototype={constructor:Fs,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?zl():+r)+(t==null?0:+t),!this._next&&so!==this&&(so?so._next=this:Ls=this,so=this),this._call=e,this._time=r,Ln()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ln())}};function sf(e,t,r){var i=new Fs;return i.restart(e,t,r),i}function pw(){zl(),++Ai;for(var e=Ls,t;e;)(t=Dr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ai}function vc(){Dr=(Es=wo.now())+aa,Ai=oo=0;try{pw()}finally{Ai=0,mw(),Dr=0}}function gw(){var e=wo.now(),t=e-Es;t>rf&&(aa-=t,Es=e)}function mw(){for(var e,t=Ls,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Ls=r);so=e,Ln(i)}function Ln(e){if(!Ai){oo&&(oo=clearTimeout(oo));var t=e-Dr;t>24?(e<1/0&&(oo=setTimeout(vc,e-wo.now()-aa)),Vi&&(Vi=clearInterval(Vi))):(Vi||(Es=wo.now(),Vi=setInterval(gw,rf)),Ai=1,of(vc))}}function Tc(e,t,r){var i=new Fs;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var yw=Pu("start","end","cancel","interrupt"),xw=[],af=0,_c=1,En=2,ls=3,Bc=4,Fn=5,hs=6;function na(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;Cw(e,r,{name:t,index:i,group:o,on:yw,tween:xw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:af})}function jl(e,t){var r=$e(e,t);if(r.state>af)throw new Error("too late; already scheduled");return r}function Ue(e,t){var r=$e(e,t);if(r.state>ls)throw new Error("too late; already running");return r}function $e(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Cw(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=sf(s,0,r.time);function s(c){r.state=_c,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,u,f;if(r.state!==_c)return l();for(h in i)if(f=i[h],f.name===r.name){if(f.state===ls)return Tc(a);f.state===Bc?(f.state=hs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[h]):+h<t&&(f.state=hs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[h])}if(Tc(function(){r.state===ls&&(r.state=Bc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=En,r.on.call("start",e,e.__data__,r.index,r.group),r.state===En){for(r.state=ls,o=new Array(u=r.tween.length),h=0,d=-1;h<u;++h)(f=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++d]=f);o.length=d+1}}function n(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=Fn,1),d=-1,u=o.length;++d<u;)o[d].call(e,h);r.state===Fn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=hs,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function bw(e,t){var r=e.__transition,i,o,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){s=!1;continue}o=i.state>En&&i.state<Fn,i.state=hs,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function kw(e){return this.each(function(){bw(this,e)})}function ww(e,t){var r,i;return function(){var o=Ue(this,e),s=o.tween;if(s!==r){i=r=s;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function Sw(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=Ue(this,e),a=s.tween;if(a!==i){o=(i=a).slice();for(var n={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=n;break}l===c&&o.push(n)}s.tween=o}}function vw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=$e(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?ww:Sw)(r,e,t))}function Wl(e,t,r){var i=e._id;return e.each(function(){var o=Ue(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return $e(o,i).value[t]}}function nf(e,t){var r;return(typeof t=="number"?Qe:t instanceof Fi?Tn:(r=Fi(t))?(t=r,Tn):Ju)(e,t)}function Tw(e){return function(){this.removeAttribute(e)}}function _w(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Bw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===i?s:s=t(i=a,r)}}function Lw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?s:s=t(i=a,r)}}function Ew(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Fw(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Aw(e,t){var r=ia(e),i=r==="transform"?uw:nf;return this.attrTween(e,typeof t=="function"?(r.local?Fw:Ew)(r,i,Wl(this,"attr."+e,t)):t==null?(r.local?_w:Tw)(r):(r.local?Lw:Bw)(r,i,t))}function Mw(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function $w(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Ow(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&$w(e,s)),r}return o._value=t,o}function Rw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Mw(e,s)),r}return o._value=t,o}function Iw(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=ia(e);return this.tween(r,(i.local?Ow:Rw)(i,t))}function Pw(e,t){return function(){jl(this,e).delay=+t.apply(this,arguments)}}function Dw(e,t){return t=+t,function(){jl(this,e).delay=t}}function Nw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Pw:Dw)(t,e)):$e(this.node(),t).delay}function qw(e,t){return function(){Ue(this,e).duration=+t.apply(this,arguments)}}function zw(e,t){return t=+t,function(){Ue(this,e).duration=t}}function jw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qw:zw)(t,e)):$e(this.node(),t).duration}function Ww(e,t){if(typeof t!="function")throw new Error;return function(){Ue(this,e).ease=t}}function Hw(e){var t=this._id;return arguments.length?this.each(Ww(t,e)):$e(this.node(),t).ease}function Yw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ue(this,e).ease=r}}function Uw(e){if(typeof e!="function")throw new Error;return this.each(Yw(this._id,e))}function Xw(e){typeof e!="function"&&(e=qu(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new rr(i,this._parents,this._name,this._id)}function Gw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),n=0;n<s;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),u,f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;n<i;++n)a[n]=t[n];return new rr(a,this._parents,this._name,this._id)}function Vw(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Kw(e,t,r){var i,o,s=Vw(t)?jl:Ue;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function Zw(e,t){var r=this._id;return arguments.length<2?$e(this.node(),r).on.on(e):this.each(Kw(r,e,t))}function Qw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Jw(){return this.on("end.remove",Qw(this._id))}function tS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Pl(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var n=i[a],l=n.length,c=s[a]=new Array(l),h,d,u=0;u<l;++u)(h=n[u])&&(d=e.call(h,h.__data__,u,n))&&("__data__"in h&&(d.__data__=h.__data__),c[u]=d,na(c[u],t,r,u,c,$e(h,r)));return new rr(s,this._parents,t,r)}function eS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Nu(e));for(var i=this._groups,o=i.length,s=[],a=[],n=0;n<o;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var u=e.call(h,h.__data__,d,l),f,p=$e(h,r),m=0,y=u.length;m<y;++m)(f=u[m])&&na(f,t,r,m,u,p);s.push(u),a.push(h)}return new rr(s,a,t,r)}var rS=$o.prototype.constructor;function iS(){return new rS(this._groups,this._parents)}function oS(e,t){var r,i,o;return function(){var s=Ei(this,e),a=(this.style.removeProperty(e),Ei(this,e));return s===a?null:s===r&&a===i?o:o=t(r=s,i=a)}}function lf(e){return function(){this.style.removeProperty(e)}}function sS(e,t,r){var i,o=r+"",s;return function(){var a=Ei(this,e);return a===o?null:a===i?s:s=t(i=a,r)}}function aS(e,t,r){var i,o,s;return function(){var a=Ei(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),Ei(this,e))),a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n))}}function nS(e,t){var r,i,o,s="style."+t,a="end."+s,n;return function(){var l=Ue(this,e),c=l.on,h=l.value[s]==null?n||(n=lf(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function lS(e,t,r){var i=(e+="")=="transform"?dw:nf;return t==null?this.styleTween(e,oS(e,i)).on("end.style."+e,lf(e)):typeof t=="function"?this.styleTween(e,aS(e,i,Wl(this,"style."+e,t))).each(nS(this._id,e)):this.styleTween(e,sS(e,i,t),r).on("end.style."+e,null)}function hS(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function cS(e,t,r){var i,o;function s(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&hS(e,a,r)),i}return s._value=t,s}function dS(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,cS(e,t,r??""))}function uS(e){return function(){this.textContent=e}}function fS(e){return function(){var t=e(this);this.textContent=t??""}}function pS(e){return this.tween("text",typeof e=="function"?fS(Wl(this,"text",e)):uS(e==null?"":e+""))}function gS(e){return function(t){this.textContent=e.call(this,t)}}function mS(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&gS(o)),t}return i._value=e,i}function yS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,mS(e))}function xS(){for(var e=this._name,t=this._id,r=hf(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=$e(l,t);na(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new rr(i,this._parents,e,r)}function CS(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var n={value:a},l={value:function(){--o===0&&s()}};r.each(function(){var c=Ue(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),o===0&&s()})}var bS=0;function rr(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function hf(){return++bS}var Ve=$o.prototype;rr.prototype={constructor:rr,select:tS,selectAll:eS,selectChild:Ve.selectChild,selectChildren:Ve.selectChildren,filter:Xw,merge:Gw,selection:iS,transition:xS,call:Ve.call,nodes:Ve.nodes,node:Ve.node,size:Ve.size,empty:Ve.empty,each:Ve.each,on:Zw,attr:Aw,attrTween:Iw,style:lS,styleTween:dS,text:pS,textTween:yS,remove:Jw,tween:vw,delay:Nw,duration:jw,ease:Hw,easeVarying:Uw,end:CS,[Symbol.iterator]:Ve[Symbol.iterator]};function kS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var wS={time:null,delay:0,duration:250,ease:kS};function SS(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function vS(e){var t,r;e instanceof rr?(t=e._id,e=e._name):(t=hf(),(r=wS).time=zl(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&na(l,e,t,c,a,r||SS(l,t));return new rr(i,this._parents,e,t)}$o.prototype.interrupt=kw;$o.prototype.transition=vS;const An=Math.PI,Mn=2*An,Tr=1e-6,TS=Mn-Tr;function cf(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function _S(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return cf;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;o<s;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class BS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?cf:_S(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,s,a){this._append`C${+t},${+r},${+i},${+o},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,i,o,s){if(t=+t,r=+r,i=+i,o=+o,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,n=this._y1,l=i-t,c=o-r,h=a-t,d=n-r,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(u>Tr)if(!(Math.abs(d*l-c*h)>Tr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-a,p=o-n,m=l*l+c*c,y=f*f+p*p,x=Math.sqrt(m),C=Math.sqrt(u),k=s*Math.tan((An-Math.acos((m+u-y)/(2*x*C)))/2),S=k/C,v=k/x;Math.abs(S-1)>Tr&&this._append`L${t+S*h},${r+S*d}`,this._append`A${s},${s},0,0,${+(d*f>h*p)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,u=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Tr||Math.abs(this._y1-h)>Tr)&&this._append`L${c},${h}`,i&&(u<0&&(u=u%Mn+Mn),u>TS?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:u>Tr&&this._append`A${i},${i},0,${+(u>=An)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function _r(e){return function(){return e}}const LS=Math.abs,ES=Math.atan2,FS=Math.cos,AS=Math.max,MS=Math.min,$S=Math.sin,OS=Math.sqrt,$n=1e-12,la=Math.PI,On=la/2,RS=2*la;function IS(e){return e>1?0:e<-1?la:Math.acos(e)}function PS(e){return e>=1?On:e<=-1?-On:Math.asin(e)}function df(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new BS(t)}function uf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ff(e){this._context=e}ff.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function go(e){return new ff(e)}function DS(e){return e[0]}function NS(e){return e[1]}function pf(e,t){var r=_r(!0),i=null,o=go,s=null,a=df(n);e=typeof e=="function"?e:e===void 0?DS:_r(e),t=typeof t=="function"?t:t===void 0?NS:_r(t);function n(l){var c,h=(l=uf(l)).length,d,u=!1,f;for(i==null&&(s=o(f=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:_r(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:_r(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:_r(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(s=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=s=null:s=o(i=l),n):i},n}class gf{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function mf(e){return new gf(e,!0)}function yf(e){return new gf(e,!1)}function ur(){}function As(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function ha(e){this._context=e}ha.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:As(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ms(e){return new ha(e)}function xf(e){this._context=e}xf.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qS(e){return new xf(e)}function Cf(e){this._context=e}Cf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zS(e){return new Cf(e)}function bf(e,t){this._basis=new ha(e),this._beta=t}bf.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const jS=(function e(t){function r(i){return t===1?new ha(i):new bf(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function $s(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Hl(e,t){this._context=e,this._k=(1-t)/6}Hl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:$s(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:$s(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const kf=(function e(t){function r(i){return new Hl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Yl(e,t){this._context=e,this._k=(1-t)/6}Yl.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:$s(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const WS=(function e(t){function r(i){return new Yl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Ul(e,t){this._context=e,this._k=(1-t)/6}Ul.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:$s(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const HS=(function e(t){function r(i){return new Ul(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Xl(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>$n){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>$n){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,a,e._x2,e._y2)}function wf(e,t){this._context=e,this._alpha=t}wf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Xl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Sf=(function e(t){function r(i){return t?new wf(i,t):new Hl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function vf(e,t){this._context=e,this._alpha=t}vf.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Xl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const YS=(function e(t){function r(i){return t?new vf(i,t):new Yl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Tf(e,t){this._context=e,this._alpha=t}Tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const US=(function e(t){function r(i){return t?new Tf(i,t):new Ul(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function _f(e){this._context=e}_f.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function XS(e){return new _f(e)}function Lc(e){return e<0?-1:1}function Ec(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(Lc(s)+Lc(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function Fc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ha(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function Os(e){this._context=e}Os.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ha(this,this._t0,Fc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ha(this,Fc(this,r=Ec(this,e,t)),r);break;default:Ha(this,this._t0,r=Ec(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Bf(e){this._context=new Lf(e)}(Bf.prototype=Object.create(Os.prototype)).point=function(e,t){Os.prototype.point.call(this,t,e)};function Lf(e){this._context=e}Lf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function Ef(e){return new Os(e)}function Ff(e){return new Bf(e)}function Af(e){this._context=e}Af.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=Ac(e),o=Ac(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],o[0][s],i[1][s],o[1][s],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Ac(e){var t,r=e.length-1,i,o=new Array(r),s=new Array(r),a=new Array(r);for(o[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(o[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-o[t+1];return[o,s]}function Mf(e){return new Af(e)}function ca(e,t){this._context=e,this._t=t}ca.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function $f(e){return new ca(e,.5)}function Of(e){return new ca(e,0)}function Rf(e){return new ca(e,1)}function ao(e,t,r){this.k=e,this.x=t,this.y=r}ao.prototype={constructor:ao,scale:function(e){return e===1?this:new ao(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ao(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};ao.prototype;var If=g(e=>{const{securityLevel:t}=kt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement");function Gl(e){return typeof e>"u"||e===null}g(Gl,"isNothing");function Pf(e){return typeof e=="object"&&e!==null}g(Pf,"isObject");function Df(e){return Array.isArray(e)?e:Gl(e)?[]:[e]}g(Df,"toArray");function Nf(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}g(Nf,"extend");function qf(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}g(qf,"repeat");function zf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}g(zf,"isNegativeZero");var GS=Gl,VS=Pf,KS=Df,ZS=qf,QS=zf,JS=Nf,Wt={isNothing:GS,isObject:VS,toArray:KS,repeat:ZS,isNegativeZero:QS,extend:JS};function Vl(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
130
|
+
`},"getStyles"),lk=p((e,t)=>{t!==void 0&&(ns[e]=t)},"addStylesForDiagram"),hk=nk,Ml={};uu(Ml,{clear:()=>Mu,getAccDescription:()=>Iu,getAccTitle:()=>Ou,getDiagramTitle:()=>Du,setAccDescription:()=>Ru,setAccTitle:()=>$u,setDiagramTitle:()=>Pu});var $l="",Ol="",Rl="",Il=p(e=>Ce(e,Ot()),"sanitizeText"),Mu=p(()=>{$l="",Rl="",Ol=""},"clear"),$u=p(e=>{$l=Il(e).replace(/^\s+/g,"")},"setAccTitle"),Ou=p(()=>$l,"getAccTitle"),Ru=p(e=>{Rl=Il(e).replace(/\n\s+/g,`
|
|
131
|
+
`)},"setAccDescription"),Iu=p(()=>Rl,"getAccDescription"),Pu=p(e=>{Ol=Il(e)},"setDiagramTitle"),Du=p(()=>Ol,"getDiagramTitle"),fc=V,ck=_l,kt=Ot,dk=bu,uk=Bi,Pl=p(e=>Ce(e,kt()),"sanitizeText"),Nu=Au,fk=p(()=>Ml,"getCommonDb"),vs={},Ts=p((e,t,r)=>{vs[e]&&fc.warn(`Diagram with id ${e} already registered. Overwriting.`),vs[e]=t,r&&_u(e,r),lk(e,t.styles),t.injectUtils?.(fc,ck,kt,Pl,Nu,fk(),()=>{})},"registerDiagram"),Sn=p(e=>{if(e in vs)return vs[e];throw new gk(e)},"getDiagram"),wi,gk=(wi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(wi,"DiagramNotFoundError"),wi),pk={value:()=>{}};function qu(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new ls(r)}function ls(e){this._=e}function mk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}ls.prototype=qu.prototype={constructor:ls,on:function(e,t){var r=this._,i=mk(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=yk(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(o=(e=i[s]).type)r[o]=gc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=gc(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new ls(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,o=s.length;i<o;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,s=i.length;o<s;++o)i[o].value.apply(t,r)}};function yk(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function gc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=pk,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var vn="http://www.w3.org/1999/xhtml";const pc={svg:"http://www.w3.org/2000/svg",xhtml:vn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function oa(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),pc.hasOwnProperty(t)?{space:pc[t],local:e}:e}function xk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===vn&&t.documentElement.namespaceURI===vn?t.createElement(e):t.createElementNS(r,e)}}function Ck(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zu(e){var t=oa(e);return(t.local?Ck:xk)(t)}function bk(){}function Dl(e){return e==null?bk:function(){return this.querySelector(e)}}function kk(e){typeof e!="function"&&(e=Dl(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=new Array(a),l,c,h=0;h<a;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new ge(i,this._parents)}function wk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Sk(){return[]}function ju(e){return e==null?Sk:function(){return this.querySelectorAll(e)}}function vk(e){return function(){return wk(e.apply(this,arguments))}}function Tk(e){typeof e=="function"?e=vk(e):e=ju(e);for(var t=this._groups,r=t.length,i=[],o=[],s=0;s<r;++s)for(var a=t[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),o.push(l));return new ge(i,o)}function Wu(e){return function(){return this.matches(e)}}function Hu(e){return function(t){return t.matches(e)}}var _k=Array.prototype.find;function Bk(e){return function(){return _k.call(this.children,e)}}function Lk(){return this.firstElementChild}function Ek(e){return this.select(e==null?Lk:Bk(typeof e=="function"?e:Hu(e)))}var Fk=Array.prototype.filter;function Ak(){return Array.from(this.children)}function Mk(e){return function(){return Fk.call(this.children,e)}}function $k(e){return this.selectAll(e==null?Ak:Mk(typeof e=="function"?e:Hu(e)))}function Ok(e){typeof e!="function"&&(e=Wu(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new ge(i,this._parents)}function Yu(e){return new Array(e.length)}function Rk(){return new ge(this._enter||this._groups.map(Yu),this._parents)}function _s(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}_s.prototype={constructor:_s,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ik(e){return function(){return e}}function Pk(e,t,r,i,o,s){for(var a=0,n,l=t.length,c=s.length;a<c;++a)(n=t[a])?(n.__data__=s[a],i[a]=n):r[a]=new _s(e,s[a]);for(;a<l;++a)(n=t[a])&&(o[a]=n)}function Dk(e,t,r,i,o,s,a){var n,l,c=new Map,h=t.length,d=s.length,f=new Array(h),u;for(n=0;n<h;++n)(l=t[n])&&(f[n]=u=a.call(l,l.__data__,n,t)+"",c.has(u)?o[n]=l:c.set(u,l));for(n=0;n<d;++n)u=a.call(e,s[n],n,s)+"",(l=c.get(u))?(i[n]=l,l.__data__=s[n],c.delete(u)):r[n]=new _s(e,s[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(f[n])===l&&(o[n]=l)}function Nk(e){return e.__data__}function qk(e,t){if(!arguments.length)return Array.from(this,Nk);var r=t?Dk:Pk,i=this._parents,o=this._groups;typeof e!="function"&&(e=Ik(e));for(var s=o.length,a=new Array(s),n=new Array(s),l=new Array(s),c=0;c<s;++c){var h=i[c],d=o[c],f=d.length,u=zk(e.call(h,h&&h.__data__,c,i)),g=u.length,m=n[c]=new Array(g),y=a[c]=new Array(g),x=l[c]=new Array(f);r(h,d,m,y,x,u,t);for(var C=0,w=0,S,v;C<g;++C)if(S=m[C]){for(C>=w&&(w=C+1);!(v=y[w])&&++w<g;);S._next=v||null}}return a=new ge(a,i),a._enter=n,a._exit=l,a}function zk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jk(){return new ge(this._exit||this._groups.map(Yu),this._parents)}function Wk(e,t,r){var i=this.enter(),o=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function Hk(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,s=i.length,a=Math.min(o,s),n=new Array(o),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,f=n[l]=new Array(d),u,g=0;g<d;++g)(u=c[g]||h[g])&&(f[g]=u);for(;l<o;++l)n[l]=r[l];return new ge(n,this._parents)}function Yk(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Uk(e){e||(e=Gk);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],n=a.length,l=o[s]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new ge(o,this._parents).order()}function Gk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Xk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Vk(){return Array.from(this)}function Kk(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function Zk(){let e=0;for(const t of this)++e;return e}function Qk(){return!this.node()}function Jk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],s=0,a=o.length,n;s<a;++s)(n=o[s])&&e.call(n,n.__data__,s,o);return this}function t2(e){return function(){this.removeAttribute(e)}}function e2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function r2(e,t){return function(){this.setAttribute(e,t)}}function i2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function o2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function s2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function a2(e,t){var r=oa(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?e2:t2:typeof t=="function"?r.local?s2:o2:r.local?i2:r2)(r,t))}function Uu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function n2(e){return function(){this.style.removeProperty(e)}}function l2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function h2(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function c2(e,t,r){return arguments.length>1?this.each((t==null?n2:typeof t=="function"?h2:l2)(e,t,r??"")):Ei(this.node(),e)}function Ei(e,t){return e.style.getPropertyValue(t)||Uu(e).getComputedStyle(e,null).getPropertyValue(t)}function d2(e){return function(){delete this[e]}}function u2(e,t){return function(){this[e]=t}}function f2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function g2(e,t){return arguments.length>1?this.each((t==null?d2:typeof t=="function"?f2:u2)(e,t)):this.node()[e]}function Gu(e){return e.trim().split(/^|\s+/)}function Nl(e){return e.classList||new Xu(e)}function Xu(e){this._node=e,this._names=Gu(e.getAttribute("class")||"")}Xu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Vu(e,t){for(var r=Nl(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function Ku(e,t){for(var r=Nl(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function p2(e){return function(){Vu(this,e)}}function m2(e){return function(){Ku(this,e)}}function y2(e,t){return function(){(t.apply(this,arguments)?Vu:Ku)(this,e)}}function x2(e,t){var r=Gu(e+"");if(arguments.length<2){for(var i=Nl(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?y2:t?p2:m2)(r,t))}function C2(){this.textContent=""}function b2(e){return function(){this.textContent=e}}function k2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function w2(e){return arguments.length?this.each(e==null?C2:(typeof e=="function"?k2:b2)(e)):this.node().textContent}function S2(){this.innerHTML=""}function v2(e){return function(){this.innerHTML=e}}function T2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _2(e){return arguments.length?this.each(e==null?S2:(typeof e=="function"?T2:v2)(e)):this.node().innerHTML}function B2(){this.nextSibling&&this.parentNode.appendChild(this)}function L2(){return this.each(B2)}function E2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function F2(){return this.each(E2)}function A2(e){var t=typeof e=="function"?e:zu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function M2(){return null}function $2(e,t){var r=typeof e=="function"?e:zu(e),i=t==null?M2:typeof t=="function"?t:Dl(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function O2(){var e=this.parentNode;e&&e.removeChild(this)}function R2(){return this.each(O2)}function I2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function P2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function D2(e){return this.select(e?P2:I2)}function N2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function q2(e){return function(t){e.call(this,t,this.__data__)}}function z2(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function j2(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r<o;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function W2(e,t,r){return function(){var i=this.__on,o,s=q2(t);if(i){for(var a=0,n=i.length;a<n;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=t;return}}this.addEventListener(e.type,s,r),o={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(o):this.__on=[o]}}function H2(e,t,r){var i=z2(e+""),o,s=i.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(o=0,h=n[l];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?W2:j2,o=0;o<s;++o)this.each(n(i[o],t,r));return this}function Zu(e,t,r){var i=Uu(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Y2(e,t){return function(){return Zu(this,e,t)}}function U2(e,t){return function(){return Zu(this,e,t.apply(this,arguments))}}function G2(e,t){return this.each((typeof t=="function"?U2:Y2)(e,t))}function*X2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var Qu=[null];function ge(e,t){this._groups=e,this._parents=t}function Oo(){return new ge([[document.documentElement]],Qu)}function V2(){return this}ge.prototype=Oo.prototype={constructor:ge,select:kk,selectAll:Tk,selectChild:Ek,selectChildren:$k,filter:Ok,data:qk,enter:Rk,exit:jk,join:Wk,merge:Hk,selection:V2,order:Yk,sort:Uk,call:Xk,nodes:Vk,node:Kk,size:Zk,empty:Qk,each:Jk,attr:a2,style:c2,property:g2,classed:x2,text:w2,html:_2,raise:L2,lower:F2,append:A2,insert:$2,remove:R2,clone:D2,datum:N2,on:H2,dispatch:G2,[Symbol.iterator]:X2};function yt(e){return typeof e=="string"?new ge([[document.querySelector(e)]],[document.documentElement]):new ge([[e]],Qu)}function sa(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function ql(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Di(){}var ko=.7,Bs=1/ko,li="\\s*([+-]?\\d+)\\s*",wo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",K2=/^#([0-9a-f]{3,8})$/,Z2=new RegExp(`^rgb\\(${li},${li},${li}\\)$`),Q2=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),J2=new RegExp(`^rgba\\(${li},${li},${li},${wo}\\)$`),tw=new RegExp(`^rgba\\(${qe},${qe},${qe},${wo}\\)$`),ew=new RegExp(`^hsl\\(${wo},${qe},${qe}\\)$`),rw=new RegExp(`^hsla\\(${wo},${qe},${qe},${wo}\\)$`),mc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};sa(Di,Fi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yc,formatHex:yc,formatHex8:iw,formatHsl:ow,formatRgb:xc,toString:xc});function yc(){return this.rgb().formatHex()}function iw(){return this.rgb().formatHex8()}function ow(){return tf(this).formatHsl()}function xc(){return this.rgb().formatRgb()}function Fi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=K2.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Cc(t):r===3?new se(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Uo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Uo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Z2.exec(e))?new se(t[1],t[2],t[3],1):(t=Q2.exec(e))?new se(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=J2.exec(e))?Uo(t[1],t[2],t[3],t[4]):(t=tw.exec(e))?Uo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ew.exec(e))?wc(t[1],t[2]/100,t[3]/100,1):(t=rw.exec(e))?wc(t[1],t[2]/100,t[3]/100,t[4]):mc.hasOwnProperty(e)?Cc(mc[e]):e==="transparent"?new se(NaN,NaN,NaN,0):null}function Cc(e){return new se(e>>16&255,e>>8&255,e&255,1)}function Uo(e,t,r,i){return i<=0&&(e=t=r=NaN),new se(e,t,r,i)}function Ju(e){return e instanceof Di||(e=Fi(e)),e?(e=e.rgb(),new se(e.r,e.g,e.b,e.opacity)):new se}function Tn(e,t,r,i){return arguments.length===1?Ju(e):new se(e,t,r,i??1)}function se(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}sa(se,Tn,ql(Di,{brighter(e){return e=e==null?Bs:Math.pow(Bs,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new se($r(this.r),$r(this.g),$r(this.b),Ls(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bc,formatHex:bc,formatHex8:sw,formatRgb:kc,toString:kc}));function bc(){return`#${Fr(this.r)}${Fr(this.g)}${Fr(this.b)}`}function sw(){return`#${Fr(this.r)}${Fr(this.g)}${Fr(this.b)}${Fr((isNaN(this.opacity)?1:this.opacity)*255)}`}function kc(){const e=Ls(this.opacity);return`${e===1?"rgb(":"rgba("}${$r(this.r)}, ${$r(this.g)}, ${$r(this.b)}${e===1?")":`, ${e})`}`}function Ls(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $r(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fr(e){return e=$r(e),(e<16?"0":"")+e.toString(16)}function wc(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ee(e,t,r,i)}function tf(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Di||(e=Fi(e)),!e)return new Ee;if(e instanceof Ee)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r<i)*6:r===s?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?s+o:2-s-o,a*=60):n=l>0&&l<1?0:a,new Ee(a,n,l,e.opacity)}function aw(e,t,r,i){return arguments.length===1?tf(e):new Ee(e,t,r,i??1)}function Ee(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}sa(Ee,aw,ql(Di,{brighter(e){return e=e==null?Bs:Math.pow(Bs,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new Ee(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new se(Wa(e>=240?e-240:e+120,o,i),Wa(e,o,i),Wa(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Ee(Sc(this.h),Go(this.s),Go(this.l),Ls(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ls(this.opacity);return`${e===1?"hsl(":"hsla("}${Sc(this.h)}, ${Go(this.s)*100}%, ${Go(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Sc(e){return e=(e||0)%360,e<0?e+360:e}function Go(e){return Math.max(0,Math.min(1,e||0))}function Wa(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const aa=e=>()=>e;function ef(e,t){return function(r){return e+r*t}}function nw(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function lw(e,t){var r=t-e;return r?ef(e,r>180||r<-180?r-360*Math.round(r/360):r):aa(isNaN(e)?t:e)}function hw(e){return(e=+e)==1?zl:function(t,r){return r-t?nw(t,r,e):aa(isNaN(t)?r:t)}}function zl(e,t){var r=t-e;return r?ef(e,r):aa(isNaN(e)?t:e)}const _n=(function e(t){var r=hw(t);function i(o,s){var a=r((o=Tn(o)).r,(s=Tn(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=zl(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function Qe(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Bn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ha=new RegExp(Bn.source,"g");function cw(e){return function(){return e}}function dw(e){return function(t){return e(t)+""}}function rf(e,t){var r=Bn.lastIndex=Ha.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=Bn.exec(e))&&(o=Ha.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:Qe(i,o)})),r=Ha.lastIndex;return r<t.length&&(s=t.slice(r),n[a]?n[a]+=s:n[++a]=s),n.length<2?l[0]?dw(l[0].x):cw(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)n[(d=l[h]).i]=d.x(c);return n.join("")})}var vc=180/Math.PI,Ln={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function of(e,t,r,i,o,s){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),e*i<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*vc,skewX:Math.atan(l)*vc,scaleX:a,scaleY:n}}var Xo;function uw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ln:of(t.a,t.b,t.c,t.d,t.e,t.f)}function fw(e){return e==null||(Xo||(Xo=document.createElementNS("http://www.w3.org/2000/svg","g")),Xo.setAttribute("transform",e),!(e=Xo.transform.baseVal.consolidate()))?Ln:(e=e.matrix,of(e.a,e.b,e.c,e.d,e.e,e.f))}function sf(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function s(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push("translate(",null,t,null,r);g.push({i:m-4,x:Qe(c,d)},{i:m-2,x:Qe(h,f)})}else(d||f)&&u.push("translate("+d+t+f+r)}function a(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(o(d)+"rotate(",null,i)-2,x:Qe(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,f){c!==h?f.push({i:d.push(o(d)+"skewX(",null,i)-2,x:Qe(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push(o(u)+"scale(",null,",",null,")");g.push({i:m-4,x:Qe(c,d)},{i:m-2,x:Qe(h,f)})}else(d!==1||f!==1)&&u.push(o(u)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,f),a(c.rotate,h.rotate,d,f),n(c.skewX,h.skewX,d,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(u){for(var g=-1,m=f.length,y;++g<m;)d[(y=f[g]).i]=y.x(u);return d.join("")}}}var gw=sf(uw,"px, ","px)","deg)"),pw=sf(fw,", ",")",")"),Ai=0,oo=0,Vi=0,af=1e3,Es,so,Fs=0,Dr=0,na=0,So=typeof performance=="object"&&performance.now?performance:Date,nf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jl(){return Dr||(nf(mw),Dr=So.now()+na)}function mw(){Dr=0}function As(){this._call=this._time=this._next=null}As.prototype=lf.prototype={constructor:As,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?jl():+r)+(t==null?0:+t),!this._next&&so!==this&&(so?so._next=this:Es=this,so=this),this._call=e,this._time=r,En()},stop:function(){this._call&&(this._call=null,this._time=1/0,En())}};function lf(e,t,r){var i=new As;return i.restart(e,t,r),i}function yw(){jl(),++Ai;for(var e=Es,t;e;)(t=Dr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ai}function Tc(){Dr=(Fs=So.now())+na,Ai=oo=0;try{yw()}finally{Ai=0,Cw(),Dr=0}}function xw(){var e=So.now(),t=e-Fs;t>af&&(na-=t,Fs=e)}function Cw(){for(var e,t=Es,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Es=r);so=e,En(i)}function En(e){if(!Ai){oo&&(oo=clearTimeout(oo));var t=e-Dr;t>24?(e<1/0&&(oo=setTimeout(Tc,e-So.now()-na)),Vi&&(Vi=clearInterval(Vi))):(Vi||(Fs=So.now(),Vi=setInterval(xw,af)),Ai=1,nf(Tc))}}function _c(e,t,r){var i=new As;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var bw=qu("start","end","cancel","interrupt"),kw=[],hf=0,Bc=1,Fn=2,hs=3,Lc=4,An=5,cs=6;function la(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;ww(e,r,{name:t,index:i,group:o,on:bw,tween:kw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:hf})}function Wl(e,t){var r=$e(e,t);if(r.state>hf)throw new Error("too late; already scheduled");return r}function Ue(e,t){var r=$e(e,t);if(r.state>hs)throw new Error("too late; already running");return r}function $e(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function ww(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=lf(s,0,r.time);function s(c){r.state=Bc,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,f,u;if(r.state!==Bc)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===hs)return _c(a);u.state===Lc?(u.state=cs,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+h<t&&(u.state=cs,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete i[h])}if(_c(function(){r.state===hs&&(r.state=Lc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=Fn,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Fn){for(r.state=hs,o=new Array(f=r.tween.length),h=0,d=-1;h<f;++h)(u=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++d]=u);o.length=d+1}}function n(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=An,1),d=-1,f=o.length;++d<f;)o[d].call(e,h);r.state===An&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=cs,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function Sw(e,t){var r=e.__transition,i,o,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){s=!1;continue}o=i.state>Fn&&i.state<An,i.state=cs,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function vw(e){return this.each(function(){Sw(this,e)})}function Tw(e,t){var r,i;return function(){var o=Ue(this,e),s=o.tween;if(s!==r){i=r=s;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function _w(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=Ue(this,e),a=s.tween;if(a!==i){o=(i=a).slice();for(var n={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=n;break}l===c&&o.push(n)}s.tween=o}}function Bw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=$e(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?Tw:_w)(r,e,t))}function Hl(e,t,r){var i=e._id;return e.each(function(){var o=Ue(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return $e(o,i).value[t]}}function cf(e,t){var r;return(typeof t=="number"?Qe:t instanceof Fi?_n:(r=Fi(t))?(t=r,_n):rf)(e,t)}function Lw(e){return function(){this.removeAttribute(e)}}function Ew(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===i?s:s=t(i=a,r)}}function Aw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?s:s=t(i=a,r)}}function Mw(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function $w(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Ow(e,t){var r=oa(e),i=r==="transform"?pw:cf;return this.attrTween(e,typeof t=="function"?(r.local?$w:Mw)(r,i,Hl(this,"attr."+e,t)):t==null?(r.local?Ew:Lw)(r):(r.local?Aw:Fw)(r,i,t))}function Rw(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Iw(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Pw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Iw(e,s)),r}return o._value=t,o}function Dw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Rw(e,s)),r}return o._value=t,o}function Nw(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=oa(e);return this.tween(r,(i.local?Pw:Dw)(i,t))}function qw(e,t){return function(){Wl(this,e).delay=+t.apply(this,arguments)}}function zw(e,t){return t=+t,function(){Wl(this,e).delay=t}}function jw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qw:zw)(t,e)):$e(this.node(),t).delay}function Ww(e,t){return function(){Ue(this,e).duration=+t.apply(this,arguments)}}function Hw(e,t){return t=+t,function(){Ue(this,e).duration=t}}function Yw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ww:Hw)(t,e)):$e(this.node(),t).duration}function Uw(e,t){if(typeof t!="function")throw new Error;return function(){Ue(this,e).ease=t}}function Gw(e){var t=this._id;return arguments.length?this.each(Uw(t,e)):$e(this.node(),t).ease}function Xw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ue(this,e).ease=r}}function Vw(e){if(typeof e!="function")throw new Error;return this.each(Xw(this._id,e))}function Kw(e){typeof e!="function"&&(e=Wu(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new rr(i,this._parents,this._name,this._id)}function Zw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),n=0;n<s;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),f,u=0;u<h;++u)(f=l[u]||c[u])&&(d[u]=f);for(;n<i;++n)a[n]=t[n];return new rr(a,this._parents,this._name,this._id)}function Qw(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Jw(e,t,r){var i,o,s=Qw(t)?Wl:Ue;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function tS(e,t){var r=this._id;return arguments.length<2?$e(this.node(),r).on.on(e):this.each(Jw(r,e,t))}function eS(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function rS(){return this.on("end.remove",eS(this._id))}function iS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Dl(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var n=i[a],l=n.length,c=s[a]=new Array(l),h,d,f=0;f<l;++f)(h=n[f])&&(d=e.call(h,h.__data__,f,n))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,la(c[f],t,r,f,c,$e(h,r)));return new rr(s,this._parents,t,r)}function oS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=ju(e));for(var i=this._groups,o=i.length,s=[],a=[],n=0;n<o;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var f=e.call(h,h.__data__,d,l),u,g=$e(h,r),m=0,y=f.length;m<y;++m)(u=f[m])&&la(u,t,r,m,f,g);s.push(f),a.push(h)}return new rr(s,a,t,r)}var sS=Oo.prototype.constructor;function aS(){return new sS(this._groups,this._parents)}function nS(e,t){var r,i,o;return function(){var s=Ei(this,e),a=(this.style.removeProperty(e),Ei(this,e));return s===a?null:s===r&&a===i?o:o=t(r=s,i=a)}}function df(e){return function(){this.style.removeProperty(e)}}function lS(e,t,r){var i,o=r+"",s;return function(){var a=Ei(this,e);return a===o?null:a===i?s:s=t(i=a,r)}}function hS(e,t,r){var i,o,s;return function(){var a=Ei(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),Ei(this,e))),a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n))}}function cS(e,t){var r,i,o,s="style."+t,a="end."+s,n;return function(){var l=Ue(this,e),c=l.on,h=l.value[s]==null?n||(n=df(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function dS(e,t,r){var i=(e+="")=="transform"?gw:cf;return t==null?this.styleTween(e,nS(e,i)).on("end.style."+e,df(e)):typeof t=="function"?this.styleTween(e,hS(e,i,Hl(this,"style."+e,t))).each(cS(this._id,e)):this.styleTween(e,lS(e,i,t),r).on("end.style."+e,null)}function uS(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function fS(e,t,r){var i,o;function s(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&uS(e,a,r)),i}return s._value=t,s}function gS(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,fS(e,t,r??""))}function pS(e){return function(){this.textContent=e}}function mS(e){return function(){var t=e(this);this.textContent=t??""}}function yS(e){return this.tween("text",typeof e=="function"?mS(Hl(this,"text",e)):pS(e==null?"":e+""))}function xS(e){return function(t){this.textContent=e.call(this,t)}}function CS(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&xS(o)),t}return i._value=e,i}function bS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,CS(e))}function kS(){for(var e=this._name,t=this._id,r=uf(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=$e(l,t);la(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new rr(i,this._parents,e,r)}function wS(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var n={value:a},l={value:function(){--o===0&&s()}};r.each(function(){var c=Ue(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),o===0&&s()})}var SS=0;function rr(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function uf(){return++SS}var Ve=Oo.prototype;rr.prototype={constructor:rr,select:iS,selectAll:oS,selectChild:Ve.selectChild,selectChildren:Ve.selectChildren,filter:Kw,merge:Zw,selection:aS,transition:kS,call:Ve.call,nodes:Ve.nodes,node:Ve.node,size:Ve.size,empty:Ve.empty,each:Ve.each,on:tS,attr:Ow,attrTween:Nw,style:dS,styleTween:gS,text:yS,textTween:bS,remove:rS,tween:Bw,delay:jw,duration:Yw,ease:Gw,easeVarying:Vw,end:wS,[Symbol.iterator]:Ve[Symbol.iterator]};function vS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var TS={time:null,delay:0,duration:250,ease:vS};function _S(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function BS(e){var t,r;e instanceof rr?(t=e._id,e=e._name):(t=uf(),(r=TS).time=jl(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&la(l,e,t,c,a,r||_S(l,t));return new rr(i,this._parents,e,t)}Oo.prototype.interrupt=vw;Oo.prototype.transition=BS;const Mn=Math.PI,$n=2*Mn,Tr=1e-6,LS=$n-Tr;function ff(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function ES(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ff;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;o<s;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class FS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ff:ES(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,s,a){this._append`C${+t},${+r},${+i},${+o},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,i,o,s){if(t=+t,r=+r,i=+i,o=+o,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,n=this._y1,l=i-t,c=o-r,h=a-t,d=n-r,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>Tr)if(!(Math.abs(d*l-c*h)>Tr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,g=o-n,m=l*l+c*c,y=u*u+g*g,x=Math.sqrt(m),C=Math.sqrt(f),w=s*Math.tan((Mn-Math.acos((m+f-y)/(2*x*C)))/2),S=w/C,v=w/x;Math.abs(S-1)>Tr&&this._append`L${t+S*h},${r+S*d}`,this._append`A${s},${s},0,0,${+(d*u>h*g)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,f=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Tr||Math.abs(this._y1-h)>Tr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%$n+$n),f>LS?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:f>Tr&&this._append`A${i},${i},0,${+(f>=Mn)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function _r(e){return function(){return e}}const AS=Math.abs,MS=Math.atan2,$S=Math.cos,OS=Math.max,RS=Math.min,IS=Math.sin,PS=Math.sqrt,On=1e-12,ha=Math.PI,Rn=ha/2,DS=2*ha;function NS(e){return e>1?0:e<-1?ha:Math.acos(e)}function qS(e){return e>=1?Rn:e<=-1?-Rn:Math.asin(e)}function gf(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new FS(t)}function pf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mf(e){this._context=e}mf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function po(e){return new mf(e)}function zS(e){return e[0]}function jS(e){return e[1]}function yf(e,t){var r=_r(!0),i=null,o=po,s=null,a=gf(n);e=typeof e=="function"?e:e===void 0?zS:_r(e),t=typeof t=="function"?t:t===void 0?jS:_r(t);function n(l){var c,h=(l=pf(l)).length,d,f=!1,u;for(i==null&&(s=o(u=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(d,c,l),+t(d,c,l));if(u)return s=null,u+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:_r(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:_r(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:_r(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(s=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=s=null:s=o(i=l),n):i},n}class xf{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Cf(e){return new xf(e,!0)}function bf(e){return new xf(e,!1)}function ur(){}function Ms(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function ca(e){this._context=e}ca.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ms(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ms(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $s(e){return new ca(e)}function kf(e){this._context=e}kf.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ms(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function WS(e){return new kf(e)}function wf(e){this._context=e}wf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:Ms(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function HS(e){return new wf(e)}function Sf(e,t){this._basis=new ca(e),this._beta=t}Sf.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const YS=(function e(t){function r(i){return t===1?new ca(i):new Sf(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function Os(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Yl(e,t){this._context=e,this._k=(1-t)/6}Yl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Os(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Os(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const vf=(function e(t){function r(i){return new Yl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Ul(e,t){this._context=e,this._k=(1-t)/6}Ul.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Os(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const US=(function e(t){function r(i){return new Ul(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Gl(e,t){this._context=e,this._k=(1-t)/6}Gl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Os(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const GS=(function e(t){function r(i){return new Gl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Xl(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>On){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>On){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,a,e._x2,e._y2)}function Tf(e,t){this._context=e,this._alpha=t}Tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Xl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const _f=(function e(t){function r(i){return t?new Tf(i,t):new Yl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Bf(e,t){this._context=e,this._alpha=t}Bf.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Xl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const XS=(function e(t){function r(i){return t?new Bf(i,t):new Ul(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Lf(e,t){this._context=e,this._alpha=t}Lf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const VS=(function e(t){function r(i){return t?new Lf(i,t):new Gl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Ef(e){this._context=e}Ef.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function KS(e){return new Ef(e)}function Ec(e){return e<0?-1:1}function Fc(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(Ec(s)+Ec(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function Ac(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ya(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function Rs(e){this._context=e}Rs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ya(this,this._t0,Ac(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ya(this,Ac(this,r=Fc(this,e,t)),r);break;default:Ya(this,this._t0,r=Fc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Ff(e){this._context=new Af(e)}(Ff.prototype=Object.create(Rs.prototype)).point=function(e,t){Rs.prototype.point.call(this,t,e)};function Af(e){this._context=e}Af.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function Mf(e){return new Rs(e)}function $f(e){return new Ff(e)}function Of(e){this._context=e}Of.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=Mc(e),o=Mc(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],o[0][s],i[1][s],o[1][s],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Mc(e){var t,r=e.length-1,i,o=new Array(r),s=new Array(r),a=new Array(r);for(o[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(o[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-o[t+1];return[o,s]}function Rf(e){return new Of(e)}function da(e,t){this._context=e,this._t=t}da.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function If(e){return new da(e,.5)}function Pf(e){return new da(e,0)}function Df(e){return new da(e,1)}function ao(e,t,r){this.k=e,this.x=t,this.y=r}ao.prototype={constructor:ao,scale:function(e){return e===1?this:new ao(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ao(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};ao.prototype;var Nf=p(e=>{const{securityLevel:t}=kt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement");function Vl(e){return typeof e>"u"||e===null}p(Vl,"isNothing");function qf(e){return typeof e=="object"&&e!==null}p(qf,"isObject");function zf(e){return Array.isArray(e)?e:Vl(e)?[]:[e]}p(zf,"toArray");function jf(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}p(jf,"extend");function Wf(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}p(Wf,"repeat");function Hf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}p(Hf,"isNegativeZero");var ZS=Vl,QS=qf,JS=zf,tv=Wf,ev=Hf,rv=jf,Wt={isNothing:ZS,isObject:QS,toArray:JS,repeat:tv,isNegativeZero:ev,extend:rv};function Kl(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
132
132
|
|
|
133
|
-
`+e.mark.snippet),i+" "+r):i}
|
|
134
|
-
`+n;for(c=
|
|
133
|
+
`+e.mark.snippet),i+" "+r):i}p(Kl,"formatError");function Mi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Kl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}p(Mi,"YAMLException$1");Mi.prototype=Object.create(Error.prototype);Mi.prototype.constructor=Mi;Mi.prototype.toString=p(function(t){return this.name+": "+Kl(this,t)},"toString");var de=Mi;function ds(e,t,r,i,o){var s="",a="",n=Math.floor(o/2)-1;return i-t>n&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}p(ds,"getLine");function us(e,t){return Wt.repeat(" ",t-e.length)+e}p(us,"padStart");function Yf(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=ds(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),d),n=Wt.repeat(" ",t.indent)+us((e.line-l+1).toString(),h)+" | "+c.str+`
|
|
134
|
+
`+n;for(c=ds(e.buffer,i[a],o[a],e.position,d),n+=Wt.repeat(" ",t.indent)+us((e.line+1).toString(),h)+" | "+c.str+`
|
|
135
135
|
`,n+=Wt.repeat("-",t.indent+h+3+c.pos)+`^
|
|
136
|
-
`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=
|
|
137
|
-
`;return n.replace(/\n$/,"")}
|
|
138
|
-
\r`;function
|
|
139
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}
|
|
140
|
-
`,t-1))}
|
|
141
|
-
`,s?1+l:l):o===
|
|
136
|
+
`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=ds(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),d),n+=Wt.repeat(" ",t.indent)+us((e.line+l+1).toString(),h)+" | "+c.str+`
|
|
137
|
+
`;return n.replace(/\n$/,"")}p(Yf,"makeSnippet");var iv=Yf,ov=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],sv=["scalar","sequence","mapping"];function Uf(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(Uf,"compileStyleAliases");function Gf(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(ov.indexOf(r)===-1)throw new de('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Uf(t.styleAliases||null),sv.indexOf(this.kind)===-1)throw new de('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(Gf,"Type$1");var te=Gf;function In(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}p(In,"compileList");function Xf(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(p(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}p(Xf,"compileMap");function Is(e){return this.extend(e)}p(Is,"Schema$1");Is.prototype.extend=p(function(t){var r=[],i=[];if(t instanceof te)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new de("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof te))throw new de("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new de("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new de("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof te))throw new de("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(Is.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(i),o.compiledImplicit=In(o,"implicit"),o.compiledExplicit=In(o,"explicit"),o.compiledTypeMap=Xf(o.compiledImplicit,o.compiledExplicit),o},"extend");var av=Is,nv=new te("tag:yaml.org,2002:str",{kind:"scalar",construct:p(function(e){return e!==null?e:""},"construct")}),lv=new te("tag:yaml.org,2002:seq",{kind:"sequence",construct:p(function(e){return e!==null?e:[]},"construct")}),hv=new te("tag:yaml.org,2002:map",{kind:"mapping",construct:p(function(e){return e!==null?e:{}},"construct")}),cv=new av({explicit:[nv,lv,hv]});function Vf(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}p(Vf,"resolveYamlNull");function Kf(){return null}p(Kf,"constructYamlNull");function Zf(e){return e===null}p(Zf,"isNull");var dv=new te("tag:yaml.org,2002:null",{kind:"scalar",resolve:Vf,construct:Kf,predicate:Zf,represent:{canonical:p(function(){return"~"},"canonical"),lowercase:p(function(){return"null"},"lowercase"),uppercase:p(function(){return"NULL"},"uppercase"),camelcase:p(function(){return"Null"},"camelcase"),empty:p(function(){return""},"empty")},defaultStyle:"lowercase"});function Qf(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}p(Qf,"resolveYamlBoolean");function Jf(e){return e==="true"||e==="True"||e==="TRUE"}p(Jf,"constructYamlBoolean");function tg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}p(tg,"isBoolean");var uv=new te("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Qf,construct:Jf,predicate:tg,represent:{lowercase:p(function(e){return e?"true":"false"},"lowercase"),uppercase:p(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:p(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function eg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}p(eg,"isHexCode");function rg(e){return 48<=e&&e<=55}p(rg,"isOctCode");function ig(e){return 48<=e&&e<=57}p(ig,"isDecCode");function og(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!eg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!rg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!ig(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}p(og,"resolveYamlInteger");function sg(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}p(sg,"constructYamlInteger");function ag(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Wt.isNegativeZero(e)}p(ag,"isInteger");var fv=new te("tag:yaml.org,2002:int",{kind:"scalar",resolve:og,construct:sg,predicate:ag,represent:{binary:p(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),gv=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ng(e){return!(e===null||!gv.test(e)||e[e.length-1]==="_")}p(ng,"resolveYamlFloat");function lg(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}p(lg,"constructYamlFloat");var pv=/^[-+]?[0-9]+e/;function hg(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Wt.isNegativeZero(e))return"-0.0";return r=e.toString(10),pv.test(r)?r.replace("e",".e"):r}p(hg,"representYamlFloat");function cg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Wt.isNegativeZero(e))}p(cg,"isFloat");var mv=new te("tag:yaml.org,2002:float",{kind:"scalar",resolve:ng,construct:lg,predicate:cg,represent:hg,defaultStyle:"lowercase"}),dg=cv.extend({implicit:[dv,uv,fv,mv]}),yv=dg,ug=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),fg=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function gg(e){return e===null?!1:ug.exec(e)!==null||fg.exec(e)!==null}p(gg,"resolveYamlTimestamp");function pg(e){var t,r,i,o,s,a,n,l=0,c=null,h,d,f;if(t=ug.exec(e),t===null&&(t=fg.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),c=(h*60+d)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,o,s,a,n,l)),c&&f.setTime(f.getTime()-c),f}p(pg,"constructYamlTimestamp");function mg(e){return e.toISOString()}p(mg,"representYamlTimestamp");var xv=new te("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:gg,construct:pg,instanceOf:Date,represent:mg});function yg(e){return e==="<<"||e===null}p(yg,"resolveYamlMerge");var Cv=new te("tag:yaml.org,2002:merge",{kind:"scalar",resolve:yg}),Zl=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
138
|
+
\r`;function xg(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Zl;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}p(xg,"resolveYamlBinary");function Cg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Zl,a=0,n=[];for(t=0;t<o;t++)t%4===0&&t&&(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}p(Cg,"constructYamlBinary");function bg(e){var t="",r=0,i,o,s=e.length,a=Zl;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}p(bg,"representYamlBinary");function kg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(kg,"isBinary");var bv=new te("tag:yaml.org,2002:binary",{kind:"scalar",resolve:xg,construct:Cg,predicate:kg,represent:bg}),kv=Object.prototype.hasOwnProperty,wv=Object.prototype.toString;function wg(e){if(e===null)return!0;var t=[],r,i,o,s,a,n=e;for(r=0,i=n.length;r<i;r+=1){if(o=n[r],a=!1,wv.call(o)!=="[object Object]")return!1;for(s in o)if(kv.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}p(wg,"resolveYamlOmap");function Sg(e){return e!==null?e:[]}p(Sg,"constructYamlOmap");var Sv=new te("tag:yaml.org,2002:omap",{kind:"sequence",resolve:wg,construct:Sg}),vv=Object.prototype.toString;function vg(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],vv.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}p(vg,"resolveYamlPairs");function Tg(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}p(Tg,"constructYamlPairs");var Tv=new te("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:vg,construct:Tg}),_v=Object.prototype.hasOwnProperty;function _g(e){if(e===null)return!0;var t,r=e;for(t in r)if(_v.call(r,t)&&r[t]!==null)return!1;return!0}p(_g,"resolveYamlSet");function Bg(e){return e!==null?e:{}}p(Bg,"constructYamlSet");var Bv=new te("tag:yaml.org,2002:set",{kind:"mapping",resolve:_g,construct:Bg}),Lg=yv.extend({implicit:[xv,Cv],explicit:[bv,Sv,Tv,Bv]}),fr=Object.prototype.hasOwnProperty,Ps=1,Eg=2,Fg=3,Ds=4,Ua=1,Lv=2,$c=3,Ev=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Fv=/[\x85\u2028\u2029]/,Av=/[,\[\]\{\}]/,Ag=/^(?:!|!!|![a-z\-]+!)$/i,Mg=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Pn(e){return Object.prototype.toString.call(e)}p(Pn,"_class");function Fe(e){return e===10||e===13}p(Fe,"is_EOL");function dr(e){return e===9||e===32}p(dr,"is_WHITE_SPACE");function ae(e){return e===9||e===32||e===10||e===13}p(ae,"is_WS_OR_EOL");function Ar(e){return e===44||e===91||e===93||e===123||e===125}p(Ar,"is_FLOW_INDICATOR");function $g(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}p($g,"fromHexCode");function Og(e){return e===120?2:e===117?4:e===85?8:0}p(Og,"escapedHexLen");function Rg(e){return 48<=e&&e<=57?e-48:-1}p(Rg,"fromDecimalCode");function Dn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
139
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}p(Dn,"simpleEscapeSequence");function Ig(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}p(Ig,"charFromCodepoint");function Ql(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(Ql,"setProperty");var Pg=new Array(256),Dg=new Array(256);for(wr=0;wr<256;wr++)Pg[wr]=Dn(wr)?1:0,Dg[wr]=Dn(wr);var wr;function Ng(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Lg,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}p(Ng,"State$1");function Jl(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=iv(r),new de(t,r)}p(Jl,"generateError");function nt(e,t){throw Jl(e,t)}p(nt,"throwError");function vo(e,t){e.onWarning&&e.onWarning.call(null,Jl(e,t))}p(vo,"throwWarning");var Oc={YAML:p(function(t,r,i){var o,s,a;t.version!==null&&nt(t,"duplication of %YAML directive"),i.length!==1&&nt(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&nt(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&&nt(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&vo(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var o,s;i.length!==2&&nt(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],Ag.test(o)||nt(t,"ill-formed tag handle (first argument) of the TAG directive"),fr.call(t.tagMap,o)&&nt(t,'there is a previously declared suffix for "'+o+'" tag handle'),Mg.test(s)||nt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{nt(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function er(e,t,r,i){var o,s,a,n;if(t<r){if(n=e.input.slice(t,r),i)for(o=0,s=n.length;o<s;o+=1)a=n.charCodeAt(o),a===9||32<=a&&a<=1114111||nt(e,"expected valid JSON character");else Ev.test(n)&&nt(e,"the stream contains non-printable characters");e.result+=n}}p(er,"captureSegment");function Nn(e,t,r,i){var o,s,a,n;for(Wt.isObject(r)||nt(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,n=o.length;a<n;a+=1)s=o[a],fr.call(t,s)||(Ql(t,s,r[s]),i[s]=!0)}p(Nn,"mergeMappings");function Mr(e,t,r,i,o,s,a,n,l){var c,h;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),c=0,h=o.length;c<h;c+=1)Array.isArray(o[c])&&nt(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Pn(o[c])==="[object Object]"&&(o[c]="[object Object]");if(typeof o=="object"&&Pn(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,h=s.length;c<h;c+=1)Nn(e,t,s[c],r);else Nn(e,t,s,r);else!e.json&&!fr.call(r,o)&&fr.call(t,o)&&(e.line=a||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,nt(e,"duplicated mapping key")),Ql(t,o,s),delete r[o];return t}p(Mr,"storeMappingPair");function ua(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):nt(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}p(ua,"readLineBreak");function Pt(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;dr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Fe(o))for(ua(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&vo(e,"deficient indentation"),i}p(Pt,"skipSeparationSpace");function Ro(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||ae(r)))}p(Ro,"testDocumentSeparator");function fa(e,t){t===1?e.result+=" ":t>1&&(e.result+=Wt.repeat(`
|
|
140
|
+
`,t-1))}p(fa,"writeFoldedLines");function qg(e,t,r){var i,o,s,a,n,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),ae(u)||Ar(u)||u===35||u===38||u===42||u===33||u===124||u===62||u===39||u===34||u===37||u===64||u===96||(u===63||u===45)&&(o=e.input.charCodeAt(e.position+1),ae(o)||r&&Ar(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,n=!1;u!==0;){if(u===58){if(o=e.input.charCodeAt(e.position+1),ae(o)||r&&Ar(o))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),ae(i))break}else{if(e.position===e.lineStart&&Ro(e)||r&&Ar(u))break;if(Fe(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,Pt(e,!1,-1),e.lineIndent>=t){n=!0,u=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(er(e,s,a,!1),fa(e,e.line-l),s=a=e.position,n=!1),dr(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return er(e,s,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}p(qg,"readPlainScalar");function zg(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(er(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else Fe(r)?(er(e,i,o,!0),fa(e,Pt(e,!1,t)),i=o=e.position):e.position===e.lineStart&&Ro(e)?nt(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);nt(e,"unexpected end of the stream within a single quoted scalar")}p(zg,"readSingleQuotedScalar");function jg(e,t){var r,i,o,s,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return er(e,r,e.position,!0),e.position++,!0;if(n===92){if(er(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),Fe(n))Pt(e,!1,t);else if(n<256&&Pg[n])e.result+=Dg[n],e.position++;else if((a=Og(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=$g(n))>=0?s=(s<<4)+a:nt(e,"expected hexadecimal character");e.result+=Ig(s),e.position++}else nt(e,"unknown escape sequence");r=i=e.position}else Fe(n)?(er(e,r,i,!0),fa(e,Pt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Ro(e)?nt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}nt(e,"unexpected end of the stream within a double quoted scalar")}p(jg,"readDoubleQuotedScalar");function Wg(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,d,f,u,g=Object.create(null),m,y,x,C;if(C=e.input.charCodeAt(e.position),C===91)h=93,u=!1,n=[];else if(C===123)h=125,u=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),C=e.input.charCodeAt(++e.position);C!==0;){if(Pt(e,!0,t),C=e.input.charCodeAt(e.position),C===h)return e.position++,e.tag=a,e.anchor=l,e.kind=u?"mapping":"sequence",e.result=n,!0;r?C===44&&nt(e,"expected the node content, but found ','"):nt(e,"missed comma between flow collection entries"),y=m=x=null,d=f=!1,C===63&&(c=e.input.charCodeAt(e.position+1),ae(c)&&(d=f=!0,e.position++,Pt(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Nr(e,t,Ps,!1,!0),y=e.tag,m=e.result,Pt(e,!0,t),C=e.input.charCodeAt(e.position),(f||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),Pt(e,!0,t),Nr(e,t,Ps,!1,!0),x=e.result),u?Mr(e,n,g,y,m,x,i,o,s):d?n.push(Mr(e,null,g,y,m,x,i,o,s)):n.push(m),Pt(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}nt(e,"unexpected end of the stream within a flow collection")}p(Wg,"readFlowCollection");function Hg(e,t){var r,i,o=Ua,s=!1,a=!1,n=t,l=0,c=!1,h,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Ua===o?o=d===43?$c:Lv:nt(e,"repeat of a chomping mode identifier");else if((h=Rg(d))>=0)h===0?nt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?nt(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(dr(d)){do d=e.input.charCodeAt(++e.position);while(dr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Fe(d)&&d!==0)}for(;d!==0;){for(ua(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!a||e.lineIndent<n)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>n&&(n=e.lineIndent),Fe(d)){l++;continue}if(e.lineIndent<n){o===$c?e.result+=Wt.repeat(`
|
|
141
|
+
`,s?1+l:l):o===Ua&&s&&(e.result+=`
|
|
142
142
|
`);break}for(i?dr(d)?(c=!0,e.result+=Wt.repeat(`
|
|
143
143
|
`,s?1+l:l)):c?(c=!1,e.result+=Wt.repeat(`
|
|
144
144
|
`,l+1)):l===0?s&&(e.result+=" "):e.result+=Wt.repeat(`
|
|
145
145
|
`,l):e.result+=Wt.repeat(`
|
|
146
|
-
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Fe(d)&&d!==0;)d=e.input.charCodeAt(++e.position);er(e,r,e.position,!1)}return!0}
|
|
147
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
146
|
+
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Fe(d)&&d!==0;)d=e.input.charCodeAt(++e.position);er(e,r,e.position,!1)}return!0}p(Hg,"readBlockScalar");function qn(e,t){var r,i=e.tag,o=e.anchor,s=[],a,n=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,nt(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!ae(a))));){if(n=!0,e.position++,Pt(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Nr(e,t,Fg,!1,!0),s.push(e.result),Pt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)nt(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return n?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}p(qn,"readBlockSequence");function Yg(e,t,r){var i,o,s,a,n,l,c=e.tag,h=e.anchor,d={},f=Object.create(null),u=null,g=null,m=null,y=!1,x=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),C=e.input.charCodeAt(e.position);C!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,nt(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&ae(i))C===63?(y&&(Mr(e,d,f,u,g,null,a,n,l),u=g=m=null),x=!0,y=!0,o=!0):y?(y=!1,o=!0):nt(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=i;else{if(a=e.line,n=e.lineStart,l=e.position,!Nr(e,r,Eg,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);dr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),ae(C)||nt(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Mr(e,d,f,u,g,null,a,n,l),u=g=m=null),x=!0,y=!1,o=!1,u=e.tag,g=e.result;else if(x)nt(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)nt(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=h,!0}if((e.line===s||e.lineIndent>t)&&(y&&(a=e.line,n=e.lineStart,l=e.position),Nr(e,t,Ds,!0,o)&&(y?g=e.result:m=e.result),y||(Mr(e,d,f,u,g,m,a,n,l),u=g=m=null),Pt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)nt(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Mr(e,d,f,u,g,null,a,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}p(Yg,"readBlockMapping");function Ug(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&nt(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):nt(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!ae(a);)a===33&&(i?nt(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Ag.test(o)||nt(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Av.test(s)&&nt(e,"tag suffix cannot contain flow indicator characters")}s&&!Mg.test(s)&&nt(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{nt(e,"tag name is malformed: "+s)}return r?e.tag=s:fr.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:nt(e,'undeclared tag handle "'+o+'"'),!0}p(Ug,"readTagProperty");function Gg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&nt(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ae(r)&&!Ar(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&nt(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}p(Gg,"readAnchorProperty");function Xg(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!ae(i)&&!Ar(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&nt(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),fr.call(e.anchorMap,r)||nt(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Pt(e,!0,-1),!0}p(Xg,"readAlias");function Nr(e,t,r,i,o){var s,a,n,l=1,c=!1,h=!1,d,f,u,g,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=n=Ds===r||Fg===r,i&&Pt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Ug(e)||Gg(e);)Pt(e,!0,-1)?(c=!0,n=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):n=!1;if(n&&(n=c||o),(l===1||Ds===r)&&(Ps===r||Eg===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?n&&(qn(e,y)||Yg(e,y,m))||Wg(e,m)?h=!0:(a&&Hg(e,m)||zg(e,m)||jg(e,m)?h=!0:Xg(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&nt(e,"alias node should not have any properties")):qg(e,m,Ps===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=n&&qn(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&nt(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(g=e.implicitTypes[d],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(fr.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,u=e.typeMap.multi[e.kind||"fallback"],d=0,f=u.length;d<f;d+=1)if(e.tag.slice(0,u[d].tag.length)===u[d].tag){g=u[d];break}g||nt(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&nt(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):nt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}p(Nr,"composeNode");function Vg(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Pt(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!ae(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&nt(e,"directive name must not be less than one character in length");a!==0;){for(;dr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Fe(a));break}if(Fe(a))break;for(r=e.position;a!==0&&!ae(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&ua(e),fr.call(Oc,i)?Oc[i](e,i,o):vo(e,'unknown document directive "'+i+'"')}if(Pt(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Pt(e,!0,-1)):s&&nt(e,"directives end mark is expected"),Nr(e,e.lineIndent-1,Ds,!1,!0),Pt(e,!0,-1),e.checkLineBreaks&&Fv.test(e.input.slice(t,e.position))&&vo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ro(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Pt(e,!0,-1));return}if(e.position<e.length-1)nt(e,"end of the stream or a document separator is expected");else return}p(Vg,"readDocument");function th(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
147
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Ng(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,nt(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Vg(r);return r.documents}p(th,"loadDocuments");function Mv(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=th(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}p(Mv,"loadAll$1");function Kg(e,t){var r=th(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new de("expected a single document in the stream, but found more")}}p(Kg,"load$1");var $v=Kg,Ov={load:$v},Zg=Object.prototype.toString,Qg=Object.prototype.hasOwnProperty,eh=65279,Rv=9,To=10,Iv=13,Pv=32,Dv=33,Nv=34,zn=35,qv=37,zv=38,jv=39,Wv=42,Jg=44,Hv=45,Ns=58,Yv=61,Uv=62,Gv=63,Xv=64,tp=91,ep=93,Vv=96,rp=123,Kv=124,ip=125,re={};re[0]="\\0";re[7]="\\a";re[8]="\\b";re[9]="\\t";re[10]="\\n";re[11]="\\v";re[12]="\\f";re[13]="\\r";re[27]="\\e";re[34]='\\"';re[92]="\\\\";re[133]="\\N";re[160]="\\_";re[8232]="\\L";re[8233]="\\P";var Zv=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Qv=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function op(e,t){var r,i,o,s,a,n,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],n=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&Qg.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[a]=n;return r}p(op,"compileStyleMap");function sp(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new de("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Wt.repeat("0",i-t.length)+t}p(sp,"encodeHex");var Jv=1,_o=2;function ap(e){this.schema=e.schema||Lg,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Wt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=op(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?_o:Jv,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}p(ap,"State");function jn(e,t){for(var r=Wt.repeat(" ",t),i=0,o=-1,s="",a,n=e.length;i<n;)o=e.indexOf(`
|
|
148
148
|
`,i),o===-1?(a=e.slice(i),i=n):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
|
|
149
|
-
`&&(s+=r),s+=a;return s}
|
|
150
|
-
`+Wt.repeat(" ",e.indent*t)}
|
|
149
|
+
`&&(s+=r),s+=a;return s}p(jn,"indentString");function qs(e,t){return`
|
|
150
|
+
`+Wt.repeat(" ",e.indent*t)}p(qs,"generateNextLine");function np(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}p(np,"testImplicitResolving");function Bo(e){return e===Pv||e===Rv}p(Bo,"isWhitespace");function $i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==eh||65536<=e&&e<=1114111}p($i,"isPrintable");function Wn(e){return $i(e)&&e!==eh&&e!==Iv&&e!==To}p(Wn,"isNsCharOrWhitespace");function Hn(e,t,r){var i=Wn(e),o=i&&!Bo(e);return(r?i:i&&e!==Jg&&e!==tp&&e!==ep&&e!==rp&&e!==ip)&&e!==zn&&!(t===Ns&&!o)||Wn(t)&&!Bo(t)&&e===zn||t===Ns&&o}p(Hn,"isPlainSafe");function lp(e){return $i(e)&&e!==eh&&!Bo(e)&&e!==Hv&&e!==Gv&&e!==Ns&&e!==Jg&&e!==tp&&e!==ep&&e!==rp&&e!==ip&&e!==zn&&e!==zv&&e!==Wv&&e!==Dv&&e!==Kv&&e!==Yv&&e!==Uv&&e!==jv&&e!==Nv&&e!==qv&&e!==Xv&&e!==Vv}p(lp,"isPlainSafeFirst");function hp(e){return!Bo(e)&&e!==Ns}p(hp,"isPlainSafeLast");function si(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}p(si,"codePointAt");function rh(e){var t=/^\n* /;return t.test(e)}p(rh,"needIndentIndicator");var cp=1,Yn=2,dp=3,up=4,ti=5;function fp(e,t,r,i,o,s,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,g=-1,m=lp(si(e,0))&&hp(si(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=si(e,l),!$i(c))return ti;m=m&&Hn(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=si(e,l),c===To)d=!0,u&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!$i(c))return ti;m=m&&Hn(c,h,n),h=c}f=f||u&&l-g-1>i&&e[g+1]!==" "}return!d&&!f?m&&!a&&!o(e)?cp:s===_o?ti:Yn:r>9&&rh(e)?ti:a?s===_o?ti:Yn:f?up:dp}p(fp,"chooseScalarStyle");function gp(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===_o?'""':"''";if(!e.noCompatMode&&(Zv.indexOf(t)!==-1||Qv.test(t)))return e.quotingType===_o?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return np(e,c)}switch(p(l,"testAmbiguity"),fp(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case cp:return t;case Yn:return"'"+t.replace(/'/g,"''")+"'";case dp:return"|"+Un(t,e.indent)+Gn(jn(t,s));case up:return">"+Un(t,e.indent)+Gn(jn(pp(t,a),s));case ti:return'"'+mp(t)+'"';default:throw new de("impossible error: invalid scalar style")}})()}p(gp,"writeScalar");function Un(e,t){var r=rh(e)?String(t):"",i=e[e.length-1]===`
|
|
151
151
|
`,o=i&&(e[e.length-2]===`
|
|
152
152
|
`||e===`
|
|
153
153
|
`),s=o?"+":i?"":"-";return r+s+`
|
|
154
|
-
`}
|
|
155
|
-
`?e.slice(0,-1):e}
|
|
154
|
+
`}p(Un,"blockHeader");function Gn(e){return e[e.length-1]===`
|
|
155
|
+
`?e.slice(0,-1):e}p(Gn,"dropEndingNewline");function pp(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
|
|
156
156
|
`);return c=c!==-1?c:e.length,r.lastIndex=c,Xn(e.slice(0,c),t)})(),o=e[0]===`
|
|
157
157
|
`||e[0]===" ",s,a;a=r.exec(e);){var n=a[1],l=a[2];s=l[0]===" ",i+=n+(!o&&!s&&l!==""?`
|
|
158
|
-
`:"")+Xn(l,t),o=s}return i}
|
|
158
|
+
`:"")+Xn(l,t),o=s}return i}p(pp,"foldString");function Xn(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-o>t&&(s=a>o?a:n,l+=`
|
|
159
159
|
`+e.slice(o,s),o=s+1),a=n;return l+=`
|
|
160
160
|
`,e.length-o>t&&a>o?l+=e.slice(o,a)+`
|
|
161
|
-
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}
|
|
162
|
-
`:""}g(Zv,"dump$1");function Qv(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}g(Qv,"renamed");var xg=lp,Cg=Av.load;var Jv=g(e=>{const{handDrawnSeed:t}=kt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ni=g(e=>{const t=tT([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),tT=g(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),rh=g(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),ot=g(e=>{const{stylesArray:t}=Ni(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];rh(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),et=g((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=kt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=Ni(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:eT(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),eT=g(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),Go={},jt={},Oc;function rT(){return Oc||(Oc=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.BLANK_URL=jt.relativeFirstCharacters=jt.whitespaceEscapeCharsRegex=jt.urlSchemeRegex=jt.ctrlCharactersRegex=jt.htmlCtrlEntityRegex=jt.htmlEntitiesRegex=jt.invalidProtocolRegex=void 0,jt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,jt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,jt.htmlCtrlEntityRegex=/&(newline|tab);/gi,jt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,jt.urlSchemeRegex=/^.+(:|:)/gim,jt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,jt.relativeFirstCharacters=[".","/"],jt.BLANK_URL="about:blank"),jt}var Rc;function iT(){if(Rc)return Go;Rc=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.sanitizeUrl=s;var e=rT();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}return Go}var bg=iT();function Ua(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function oT(){}function kg(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function fa(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const wg="[object RegExp]",ih="[object String]",oh="[object Number]",sh="[object Boolean]",ah="[object Arguments]",Sg="[object Symbol]",vg="[object Date]",Tg="[object Map]",_g="[object Set]",Bg="[object Array]",Lg="[object ArrayBuffer]",Eg="[object Object]",Fg="[object DataView]",Ag="[object Uint8Array]",Mg="[object Uint8ClampedArray]",$g="[object Uint16Array]",Og="[object Uint32Array]",Rg="[object Int8Array]",Ig="[object Int16Array]",Pg="[object Int32Array]",Dg="[object Float32Array]",Ng="[object Float64Array]",Ic=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function nh(e){return typeof Ic.Buffer<"u"&&Ic.Buffer.isBuffer(e)}function sT(e){return Number.isSafeInteger(e)&&e>=0}function qg(e){return e!=null&&typeof e!="function"&&sT(e.length)}function aT(e){return e==="__proto__"}function pa(e){return e==null||typeof e!="object"&&typeof e!="function"}function lh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nT(e,t){return ai(e,void 0,e,new Map,t)}function ai(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(pa(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const a=new Array(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ai(e[n],n,r,i,o);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;i.set(e,a);for(const[n,l]of e)a.set(n,ai(l,n,r,i,o));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(ai(n,void 0,r,i,o));return a}if(nh(e))return e.subarray();if(lh(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ai(e[n],n,r,i,o);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,a),_e(a,e,r,i,o),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return i.set(e,a),_e(a,e,r,i,o),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof Error){const a=structuredClone(e);return i.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,_e(a,e,r,i,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(typeof e=="object"&&lT(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),_e(a,e,r,i,o),a}return e}function _e(e,t,r=e,i,o){const s=[...Object.keys(t),...kg(t)];for(let a=0;a<s.length;a++){const n=s[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=ai(t[n],n,r,i,o))}}function lT(e){switch(fa(e)){case ah:case Bg:case Lg:case Fg:case sh:case vg:case Dg:case Ng:case Rg:case Ig:case Pg:case Tg:case oh:case Eg:case wg:case _g:case ih:case Sg:case Ag:case Mg:case $g:case Og:return!0;default:return!1}}function hT(e,t){return nT(e,(r,i,o,s)=>{if(typeof e=="object"){if(fa(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),_e(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case oh:case ih:case sh:{const a=new e.constructor(e?.valueOf());return _e(a,e),a}case ah:{const a={};return _e(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Pc(e){return hT(e)}function Kn(e){return e!==null&&typeof e=="object"&&fa(e)==="[object Arguments]"}function Zn(e){return typeof e=="object"&&e!==null}function cT(e){return Zn(e)&&qg(e)}function Ro(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Ro.Cache||Map),r}Ro.Cache=Map;function mo(e){return lh(e)}function dT(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function uT(e){if(pa(e))return e;if(Array.isArray(e)||lh(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function fT(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;s<r.length;s++){const a=r[s];o=us(o,a,i,new Map)}return o}function us(e,t,r,i){if(pa(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return uT(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}const o=[...Object.keys(t),...kg(t)];for(let s=0;s<o.length;s++){const a=o[s];if(aT(a))continue;let n=t[a],l=e[a];if(Kn(n)&&(n={...n}),Kn(l)&&(l={...l}),nh(n)&&(n=Pc(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const f=d[u];h[f]=l[f]}l=h}else if(cT(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,a,e,t,i);c!==void 0?e[a]=c:Array.isArray(n)||Zn(l)&&Zn(n)&&(Ua(l)||Ua(n)||mo(l)||mo(n))?e[a]=us(l,n,r,i):l==null&&Ua(n)?e[a]=us({},n,r,i):l==null&&mo(n)?e[a]=Pc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function pT(e,...t){return fT(e,...t,oT)}function Dc(e){if(e==null)return!0;if(qg(e))return typeof e.splice!="function"&&typeof e!="string"&&!nh(e)&&!mo(e)&&!Kn(e)?!1:e.length===0;if(typeof e=="object"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return dT(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var zg="",gT={curveBasis:Ms,curveBasisClosed:qS,curveBasisOpen:zS,curveBumpX:mf,curveBumpY:yf,curveBundle:jS,curveCardinalClosed:WS,curveCardinalOpen:HS,curveCardinal:kf,curveCatmullRomClosed:YS,curveCatmullRomOpen:US,curveCatmullRom:Sf,curveLinear:go,curveLinearClosed:XS,curveMonotoneX:Ef,curveMonotoneY:Ff,curveNatural:Mf,curveStep:$f,curveStepAfter:Rf,curveStepBefore:Of},mT=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,yT=g(function(e,t){const r=jg(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);bs(a),i=qt(i,[...a])}else i=r.args;if(!i)return;let o=Ll(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),jg=g(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${mT.source})(?=[}][%]{2}).*
|
|
163
|
-
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=po.exec(e))!==null;)if(i.index===po.lastIndex&&po.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),xT=g(function(e){return e.replace(po,"")},"removeDirectives"),CT=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function hh(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return gT[r]??t}g(hh,"interpolateToCurve");function Wg(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?bg.sanitizeUrl(r):r}g(Wg,"formatUrl");var bT=g((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){V.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function ch(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}g(ch,"distance");function Hg(e){let t,r=0;e.forEach(o=>{r+=ch(o,t),t=o});const i=r/2;return dh(e,i)}g(Hg,"traverseEdge");function Yg(e){return e.length===1?e[0]:Hg(e)}g(Yg,"calcLabelPosition");var Nc=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),dh=g((e,t)=>{let r,i=t;for(const o of e){if(r){const s=ch(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:Nc((1-a)*r.x+a*o.x,5),y:Nc((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),kT=g((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=dh(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Ug(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=dh(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}g(Ug,"calcTerminalLabelPosition");function uh(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}g(uh,"getStylesFromArray");var qc=0,Xg=g(()=>(qc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+qc),"generateId");function Gg(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}g(Gg,"makeRandomHex");var Vg=g(e=>Gg(e.length),"random"),wT=g(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),ST=g(function(e,t){const r=t.text.replace(Pi.lineBreakRegex," "),[,i]=Io(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),Kg=Ro((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Pi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=je(`${a} `,r),c=je(s,r);if(l>t){const{hyphenatedStrings:u,remainingWord:f}=vT(a,t,"-",r);o.push(s,...u),s=f}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),vT=Ro((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(je(c,i)>=t){const d=l+1,u=o.length===d,f=`${c}${r}`;s.push(u?c:f),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function fh(e,t){return ga(e,t).height}g(fh,"calculateTextHeight");function je(e,t){return ga(e,t).width}g(je,"calculateTextWidth");var ga=Ro((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=Io(r),a=["sans-serif",i],n=e.split(Pi.lineBreakRegex),l=[],c=yt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of a){let f=0;const p={width:0,height:0,lineHeight:0};for(const m of n){const y=wT();y.text=m||zg;const x=ST(h,y).style("font-size",s).style("font-weight",o).style("font-family",u),C=(x._groups||x)[0][0].getBBox();if(C.width===0&&C.height===0)throw new Error("svg element not in render tree");p.width=Math.round(Math.max(p.width,C.width)),f=Math.round(C.height),p.height+=f,p.lineHeight=Math.round(Math.max(p.lineHeight,f))}l.push(p)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Si,TT=(Si=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},g(Si,"InitIDGenerator"),Si),Vo,_T=g(function(e){return Vo=Vo||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Vo.innerHTML=e,unescape(Vo.textContent)},"entityDecode");function ph(e){return"str"in e}g(ph,"isDetailedError");var BT=g((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Io=g(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function ma(e,t){return pT({},e,t)}g(ma,"cleanAndMerge");var xe={assignWithDepth:qt,wrapLabel:Kg,calculateTextHeight:fh,calculateTextWidth:je,calculateTextDimensions:ga,cleanAndMerge:ma,detectInit:yT,detectDirective:jg,isSubstringInArray:CT,interpolateToCurve:hh,calcLabelPosition:Yg,calcCardinalityPosition:kT,calcTerminalLabelPosition:Ug,formatUrl:Wg,getStylesFromArray:uh,generateId:Xg,random:Vg,runFunc:bT,entityDecode:_T,insertTitle:BT,isLabelCoordinateInPath:Zg,parseFontSize:Io,InitIDGenerator:TT},LT=g(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),pr=g(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),ET=g((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Xt(e){return e??null}g(Xt,"handleUndefinedAttr");function Zg(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}g(Zg,"isLabelCoordinateInPath");var ya=g(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function gh(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...r].map(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=kt().fontSize?kt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Bl.fontSize]=Io(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}g(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}g(gh,"configureLabelImages");const FT=Object.freeze({left:0,top:0,width:16,height:16}),zs=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Qg=Object.freeze({...FT,...zs}),AT=Object.freeze({...Qg,body:"",hidden:!1}),MT=Object.freeze({width:null,height:null}),$T=Object.freeze({...MT,...zs}),OT=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Xa(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return Xa(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return Xa(n,r)?n:null}return null},Xa=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function RT(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function zc(e,t){const r=RT(e,t);for(const i in AT)i in zs?i in e&&!(i in r)&&(r[i]=zs[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function IT(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function jc(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=zc(i[n]||o[n],s)}return a(t),r.forEach(a),zc(e,s)}function PT(e,t){if(e.icons[t])return jc(e,t,[]);const r=IT(e,[t])[t];return r?jc(e,t,r):null}const DT=/(-?[0-9.]*[0-9]+[0-9.]*)/g,NT=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Wc(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(DT);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=NT.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function qT(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("</"+t);if(o===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function zT(e,t){return e?"<defs>"+e+"</defs>"+t:t}function jT(e,t,r){const i=qT(e);return zT(i.defs,t+i.content+r)}const WT=e=>e==="unset"||e==="undefined"||e==="none";function HT(e,t){const r={...Qg,...e},i={...$T,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,C=m.vFlip;let k=m.rotate;x?C?k+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):C&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let S;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:S=o.height/2+o.top,y.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,y.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}k%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),y.length&&(s=jT(s,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Wc(d,l/c)):(h=a==="auto"?l:a,d=n===null?Wc(h,c/l):n==="auto"?c:n);const u={},f=(m,y)=>{WT(y)||(u[m]=y.toString())};f("width",h),f("height",d);const p=[o.left,o.top,l,c];return u.viewBox=p.join(" "),{attributes:u,viewBox:p,body:s}}const YT=/\sid="(\S+)"/g,Hc=new Map;function UT(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Hc.get(e)||0;return Hc.set(e,t+1),t?`${e}${t}`:e}function XT(e){const t=[];let r;for(;r=YT.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=UT(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function GT(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var Jg={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},Qn=new Map,tm=new Map,em=g(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(V.debug("Registering icon pack:",t.name),"loader"in t)tm.set(t.name,t.loader);else if("icons"in t)Qn.set(t.name,t.icons);else throw V.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),rm=g(async(e,t)=>{const r=OT(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=Qn.get(i);if(!o){const a=tm.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},Qn.set(i,o)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=PT(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),VT=g(async e=>{try{return await rm(e),!0}catch{return!1}},"isIconAvailable"),qi=g(async(e,t,r)=>{let i;try{i=await rm(e,t?.fallbackPrefix)}catch(a){V.error(a),i=Jg}const o=HT(i,t),s=GT(XT(o.body),{...o.attributes,...r});return Ce(s,Ot())},"getIconSVG");function mh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wr=mh();function im(e){Wr=e}var yo={exec:()=>null};function vt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ne.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var KT=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ne={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},ZT=/^(?:[ \t]*(?:\n|$))+/,QT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,JT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Po=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,t_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yh=/(?:[*+-]|\d{1,9}[.)])/,om=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,sm=vt(om).replace(/bull/g,yh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),e_=vt(om).replace(/bull/g,yh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,r_=/^[^\n]+/,Ch=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,i_=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ch).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),o_=vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yh).getRegex(),xa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,s_=vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",bh).replace("tag",xa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),am=vt(xh).replace("hr",Po).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xa).getRegex(),a_=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",am).getRegex(),kh={blockquote:a_,code:QT,def:i_,fences:JT,heading:t_,hr:Po,html:s_,lheading:sm,list:o_,newline:ZT,paragraph:am,table:yo,text:r_},Yc=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Po).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xa).getRegex(),n_={...kh,lheading:e_,table:Yc,paragraph:vt(xh).replace("hr",Po).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xa).getRegex()},l_={...kh,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bh).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:yo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(xh).replace("hr",Po).replace("heading",` *#{1,6} *[^
|
|
164
|
-
]`).replace("lheading",
|
|
161
|
+
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}p(Xn,"foldLine");function mp(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=si(e,o),i=re[r],!i&&$i(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||sp(r);return t}p(mp,"escapeString");function yp(e,t,r){var i="",o=e.tag,s,a,n;for(s=0,a=r.length;s<a;s+=1)n=r[s],e.replacer&&(n=e.replacer.call(r,String(s),n)),(ze(e,t,n,!1,!1)||typeof n>"u"&&ze(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}p(yp,"writeFlowSequence");function Vn(e,t,r,i){var o="",s=e.tag,a,n,l;for(a=0,n=r.length;a<n;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(ze(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&ze(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=qs(e,t)),e.dump&&To===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}p(Vn,"writeBlockSequence");function xp(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,n,l,c,h;for(a=0,n=s.length;a<n;a+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=s[a],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),ze(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ze(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}p(xp,"writeFlowMapping");function Cp(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),n,l,c,h,d,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new de("sortKeys must be a boolean or a function");for(n=0,l=a.length;n<l;n+=1)f="",(!i||o!=="")&&(f+=qs(e,t)),c=a[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),ze(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&To===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=qs(e,t)),ze(e,t+1,h,!0,d)&&(e.dump&&To===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}p(Cp,"writeBlockMapping");function Kn(e,t,r){var i,o,s,a,n,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(n=o[s],(n.instanceOf||n.predicate)&&(!n.instanceOf||typeof t=="object"&&t instanceof n.instanceOf)&&(!n.predicate||n.predicate(t))){if(r?n.multi&&n.representName?e.tag=n.representName(t):e.tag=n.tag:e.tag="?",n.represent){if(l=e.styleMap[n.tag]||n.defaultStyle,Zg.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(Qg.call(n.represent,l))i=n.represent[l](t,l);else throw new de("!<"+n.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(Kn,"detectType");function ze(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Kn(e,r,!1)||Kn(e,r,!0);var n=Zg.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",d,f;if(h&&(d=e.duplicates.indexOf(r),f=d!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(o=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(h&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(Cp(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(xp(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Vn(e,t-1,e.dump,o):Vn(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(yp(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&gp(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new de("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}p(ze,"writeNode");function bp(e,t){var r=[],i=[],o,s;for(zs(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}p(bp,"getDuplicateReferences");function zs(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)zs(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)zs(e[i[o]],t,r)}p(zs,"inspectNode");function tT(e,t){t=t||{};var r=new ap(t);r.noRefs||bp(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),ze(r,0,i,!0,!0)?r.dump+`
|
|
162
|
+
`:""}p(tT,"dump$1");function eT(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}p(eT,"renamed");var kp=dg,wp=Ov.load;var rT=p(e=>{const{handDrawnSeed:t}=kt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ni=p(e=>{const t=iT([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),iT=p(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),ih=p(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),ot=p(e=>{const{stylesArray:t}=Ni(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];ih(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),et=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=kt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=Ni(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:oT(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),oT=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),Vo={},jt={},Rc;function sT(){return Rc||(Rc=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.BLANK_URL=jt.relativeFirstCharacters=jt.whitespaceEscapeCharsRegex=jt.urlSchemeRegex=jt.ctrlCharactersRegex=jt.htmlCtrlEntityRegex=jt.htmlEntitiesRegex=jt.invalidProtocolRegex=void 0,jt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,jt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,jt.htmlCtrlEntityRegex=/&(newline|tab);/gi,jt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,jt.urlSchemeRegex=/^.+(:|:)/gim,jt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,jt.relativeFirstCharacters=[".","/"],jt.BLANK_URL="about:blank"),jt}var Ic;function aT(){if(Ic)return Vo;Ic=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.sanitizeUrl=s;var e=sT();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var f=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var u=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return u;if(f==="http:"||f==="https:"){if(!i(u))return e.BLANK_URL;var g=new URL(u);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return u}return Vo}var Sp=aT();function Ga(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function nT(){}function vp(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ga(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Tp="[object RegExp]",oh="[object String]",sh="[object Number]",ah="[object Boolean]",nh="[object Arguments]",_p="[object Symbol]",Bp="[object Date]",Lp="[object Map]",Ep="[object Set]",Fp="[object Array]",Ap="[object ArrayBuffer]",Mp="[object Object]",$p="[object DataView]",Op="[object Uint8Array]",Rp="[object Uint8ClampedArray]",Ip="[object Uint16Array]",Pp="[object Uint32Array]",Dp="[object Int8Array]",Np="[object Int16Array]",qp="[object Int32Array]",zp="[object Float32Array]",jp="[object Float64Array]",Pc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function lh(e){return typeof Pc.Buffer<"u"&&Pc.Buffer.isBuffer(e)}function lT(e){return Number.isSafeInteger(e)&&e>=0}function Wp(e){return e!=null&&typeof e!="function"&&lT(e.length)}function hT(e){return e==="__proto__"}function pa(e){return e==null||typeof e!="object"&&typeof e!="function"}function hh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cT(e,t){return ai(e,void 0,e,new Map,t)}function ai(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(pa(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const a=new Array(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ai(e[n],n,r,i,o);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;i.set(e,a);for(const[n,l]of e)a.set(n,ai(l,n,r,i,o));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(ai(n,void 0,r,i,o));return a}if(lh(e))return e.subarray();if(hh(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ai(e[n],n,r,i,o);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,a),_e(a,e,r,i,o),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return i.set(e,a),_e(a,e,r,i,o),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof Error){const a=structuredClone(e);return i.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,_e(a,e,r,i,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(typeof e=="object"&&dT(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),_e(a,e,r,i,o),a}return e}function _e(e,t,r=e,i,o){const s=[...Object.keys(t),...vp(t)];for(let a=0;a<s.length;a++){const n=s[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=ai(t[n],n,r,i,o))}}function dT(e){switch(ga(e)){case nh:case Fp:case Ap:case $p:case ah:case Bp:case zp:case jp:case Dp:case Np:case qp:case Lp:case sh:case Mp:case Tp:case Ep:case oh:case _p:case Op:case Rp:case Ip:case Pp:return!0;default:return!1}}function uT(e,t){return cT(e,(r,i,o,s)=>{if(typeof e=="object"){if(ga(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),_e(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case sh:case oh:case ah:{const a=new e.constructor(e?.valueOf());return _e(a,e),a}case nh:{const a={};return _e(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Dc(e){return uT(e)}function Zn(e){return e!==null&&typeof e=="object"&&ga(e)==="[object Arguments]"}function Qn(e){return typeof e=="object"&&e!==null}function fT(e){return Qn(e)&&Wp(e)}function Io(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Io.Cache||Map),r}Io.Cache=Map;function mo(e){return hh(e)}function gT(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function pT(e){if(pa(e))return e;if(Array.isArray(e)||hh(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function mT(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;s<r.length;s++){const a=r[s];o=fs(o,a,i,new Map)}return o}function fs(e,t,r,i){if(pa(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return pT(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}const o=[...Object.keys(t),...vp(t)];for(let s=0;s<o.length;s++){const a=o[s];if(hT(a))continue;let n=t[a],l=e[a];if(Zn(n)&&(n={...n}),Zn(l)&&(l={...l}),lh(n)&&(n=Dc(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let f=0;f<d.length;f++){const u=d[f];h[u]=l[u]}l=h}else if(fT(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,a,e,t,i);c!==void 0?e[a]=c:Array.isArray(n)||Qn(l)&&Qn(n)&&(Ga(l)||Ga(n)||mo(l)||mo(n))?e[a]=fs(l,n,r,i):l==null&&Ga(n)?e[a]=fs({},n,r,i):l==null&&mo(n)?e[a]=Dc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function yT(e,...t){return mT(e,...t,nT)}function Nc(e){if(e==null)return!0;if(Wp(e))return typeof e.splice!="function"&&typeof e!="string"&&!lh(e)&&!mo(e)&&!Zn(e)?!1:e.length===0;if(typeof e=="object"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return gT(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var Hp="",xT={curveBasis:$s,curveBasisClosed:WS,curveBasisOpen:HS,curveBumpX:Cf,curveBumpY:bf,curveBundle:YS,curveCardinalClosed:US,curveCardinalOpen:GS,curveCardinal:vf,curveCatmullRomClosed:XS,curveCatmullRomOpen:VS,curveCatmullRom:_f,curveLinear:po,curveLinearClosed:KS,curveMonotoneX:Mf,curveMonotoneY:$f,curveNatural:Rf,curveStep:If,curveStepAfter:Df,curveStepBefore:Pf},CT=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,bT=p(function(e,t){const r=Yp(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);ks(a),i=qt(i,[...a])}else i=r.args;if(!i)return;let o=El(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),Yp=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${CT.source})(?=[}][%]{2}).*
|
|
163
|
+
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=go.exec(e))!==null;)if(i.index===go.lastIndex&&go.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),kT=p(function(e){return e.replace(go,"")},"removeDirectives"),wT=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function ch(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return xT[r]??t}p(ch,"interpolateToCurve");function Up(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?Sp.sanitizeUrl(r):r}p(Up,"formatUrl");var ST=p((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){V.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function dh(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}p(dh,"distance");function Gp(e){let t,r=0;e.forEach(o=>{r+=dh(o,t),t=o});const i=r/2;return uh(e,i)}p(Gp,"traverseEdge");function Xp(e){return e.length===1?e[0]:Gp(e)}p(Xp,"calcLabelPosition");var qc=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),uh=p((e,t)=>{let r,i=t;for(const o of e){if(r){const s=dh(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:qc((1-a)*r.x+a*o.x,5),y:qc((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),vT=p((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=uh(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Vp(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=uh(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}p(Vp,"calcTerminalLabelPosition");function fh(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(fh,"getStylesFromArray");var zc=0,Kp=p(()=>(zc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+zc),"generateId");function Zp(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}p(Zp,"makeRandomHex");var Qp=p(e=>Zp(e.length),"random"),TT=p(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),_T=p(function(e,t){const r=t.text.replace(Pi.lineBreakRegex," "),[,i]=Po(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),Jp=Io((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Pi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=je(`${a} `,r),c=je(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=BT(a,t,"-",r);o.push(s,...f),s=u}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),BT=Io((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(je(c,i)>=t){const d=l+1,f=o.length===d,u=`${c}${r}`;s.push(f?c:u),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function gh(e,t){return ma(e,t).height}p(gh,"calculateTextHeight");function je(e,t){return ma(e,t).width}p(je,"calculateTextWidth");var ma=Io((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=Po(r),a=["sans-serif",i],n=e.split(Pi.lineBreakRegex),l=[],c=yt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of a){let u=0;const g={width:0,height:0,lineHeight:0};for(const m of n){const y=TT();y.text=m||Hp;const x=_T(h,y).style("font-size",s).style("font-weight",o).style("font-family",f),C=(x._groups||x)[0][0].getBBox();if(C.width===0&&C.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,C.width)),u=Math.round(C.height),g.height+=u,g.lineHeight=Math.round(Math.max(g.lineHeight,u))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Si,LT=(Si=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},p(Si,"InitIDGenerator"),Si),Ko,ET=p(function(e){return Ko=Ko||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ko.innerHTML=e,unescape(Ko.textContent)},"entityDecode");function ph(e){return"str"in e}p(ph,"isDetailedError");var FT=p((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Po=p(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function ya(e,t){return yT({},e,t)}p(ya,"cleanAndMerge");var xe={assignWithDepth:qt,wrapLabel:Jp,calculateTextHeight:gh,calculateTextWidth:je,calculateTextDimensions:ma,cleanAndMerge:ya,detectInit:bT,detectDirective:Yp,isSubstringInArray:wT,interpolateToCurve:ch,calcLabelPosition:Xp,calcCardinalityPosition:vT,calcTerminalLabelPosition:Vp,formatUrl:Up,getStylesFromArray:fh,generateId:Kp,random:Qp,runFunc:ST,entityDecode:ET,insertTitle:FT,isLabelCoordinateInPath:tm,parseFontSize:Po,InitIDGenerator:LT},AT=p(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),gr=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),MT=p((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Gt(e){return e??null}p(Gt,"handleUndefinedAttr");function tm(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}p(tm,"isLabelCoordinateInPath");var xa=p(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function mh(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...r].map(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=kt().fontSize?kt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Ll.fontSize]=Po(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}p(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}p(mh,"configureLabelImages");const $T=Object.freeze({left:0,top:0,width:16,height:16}),js=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),em=Object.freeze({...$T,...js}),OT=Object.freeze({...em,body:"",hidden:!1}),RT=Object.freeze({width:null,height:null}),IT=Object.freeze({...RT,...js}),PT=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Xa(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return Xa(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return Xa(n,r)?n:null}return null},Xa=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function DT(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function jc(e,t){const r=DT(e,t);for(const i in OT)i in js?i in e&&!(i in r)&&(r[i]=js[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function NT(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function Wc(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=jc(i[n]||o[n],s)}return a(t),r.forEach(a),jc(e,s)}function qT(e,t){if(e.icons[t])return Wc(e,t,[]);const r=NT(e,[t])[t];return r?Wc(e,t,r):null}const zT=/(-?[0-9.]*[0-9]+[0-9.]*)/g,jT=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Hc(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(zT);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=jT.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function WT(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("</"+t);if(o===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function HT(e,t){return e?"<defs>"+e+"</defs>"+t:t}function YT(e,t,r){const i=WT(e);return HT(i.defs,t+i.content+r)}const UT=e=>e==="unset"||e==="undefined"||e==="none";function GT(e,t){const r={...em,...e},i={...IT,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,C=m.vFlip;let w=m.rotate;x?C?w+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):C&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let S;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:S=o.height/2+o.top,y.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,y.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}w%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),y.length&&(s=YT(s,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Hc(d,l/c)):(h=a==="auto"?l:a,d=n===null?Hc(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{UT(y)||(f[m]=y.toString())};u("width",h),u("height",d);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const XT=/\sid="(\S+)"/g,Yc=new Map;function VT(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Yc.get(e)||0;return Yc.set(e,t+1),t?`${e}${t}`:e}function KT(e){const t=[];let r;for(;r=XT.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=VT(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function ZT(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var rm={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},Jn=new Map,im=new Map,om=p(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(V.debug("Registering icon pack:",t.name),"loader"in t)im.set(t.name,t.loader);else if("icons"in t)Jn.set(t.name,t.icons);else throw V.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),sm=p(async(e,t)=>{const r=PT(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=Jn.get(i);if(!o){const a=im.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},Jn.set(i,o)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=qT(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),QT=p(async e=>{try{return await sm(e),!0}catch{return!1}},"isIconAvailable"),qi=p(async(e,t,r)=>{let i;try{i=await sm(e,t?.fallbackPrefix)}catch(a){V.error(a),i=rm}const o=GT(i,t),s=ZT(KT(o.body),{...o.attributes,...r});return Ce(s,Ot())},"getIconSVG");function yh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wr=yh();function am(e){Wr=e}var yo={exec:()=>null};function vt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ne.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var JT=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ne={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},t_=/^(?:[ \t]*(?:\n|$))+/,e_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,r_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Do=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,i_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,xh=/(?:[*+-]|\d{1,9}[.)])/,nm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lm=vt(nm).replace(/bull/g,xh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),o_=vt(nm).replace(/bull/g,xh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ch=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,s_=/^[^\n]+/,bh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,a_=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),n_=vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xh).getRegex(),Ca="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",kh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,l_=vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",kh).replace("tag",Ca).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hm=vt(Ch).replace("hr",Do).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ca).getRegex(),h_=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hm).getRegex(),wh={blockquote:h_,code:e_,def:a_,fences:r_,heading:i_,hr:Do,html:l_,lheading:lm,list:n_,newline:t_,paragraph:hm,table:yo,text:s_},Uc=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Do).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ca).getRegex(),c_={...wh,lheading:o_,table:Uc,paragraph:vt(Ch).replace("hr",Do).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Uc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ca).getRegex()},d_={...wh,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",kh).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:yo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(Ch).replace("hr",Do).replace("heading",` *#{1,6} *[^
|
|
164
|
+
]`).replace("lheading",lm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},u_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,f_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cm=/^( {2,}|\\)\n(?!\s*$)/,g_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ba=/[\p{P}\p{S}]/u,Sh=/[\s\p{P}\p{S}]/u,dm=/[^\s\p{P}\p{S}]/u,p_=vt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Sh).getRegex(),um=/(?!~)[\p{P}\p{S}]/u,m_=/(?!~)[\s\p{P}\p{S}]/u,y_=/(?:[^\s\p{P}\p{S}]|~)/u,x_=vt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",JT?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fm=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,C_=vt(fm,"u").replace(/punct/g,ba).getRegex(),b_=vt(fm,"u").replace(/punct/g,um).getRegex(),gm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",k_=vt(gm,"gu").replace(/notPunctSpace/g,dm).replace(/punctSpace/g,Sh).replace(/punct/g,ba).getRegex(),w_=vt(gm,"gu").replace(/notPunctSpace/g,y_).replace(/punctSpace/g,m_).replace(/punct/g,um).getRegex(),S_=vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,dm).replace(/punctSpace/g,Sh).replace(/punct/g,ba).getRegex(),v_=vt(/\\(punct)/,"gu").replace(/punct/g,ba).getRegex(),T_=vt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),__=vt(kh).replace("(?:-->|$)","-->").getRegex(),B_=vt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",__).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ws=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,L_=vt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ws).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pm=vt(/^!?\[(label)\]\[(ref)\]/).replace("label",Ws).replace("ref",bh).getRegex(),mm=vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",bh).getRegex(),E_=vt("reflink|nolink(?!\\()","g").replace("reflink",pm).replace("nolink",mm).getRegex(),Gc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vh={_backpedal:yo,anyPunctuation:v_,autolink:T_,blockSkip:x_,br:cm,code:f_,del:yo,emStrongLDelim:C_,emStrongRDelimAst:k_,emStrongRDelimUnd:S_,escape:u_,link:L_,nolink:mm,punctuation:p_,reflink:pm,reflinkSearch:E_,tag:B_,text:g_,url:yo},F_={...vh,link:vt(/^!?\[(label)\]\((.*?)\)/).replace("label",Ws).getRegex(),reflink:vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ws).getRegex()},tl={...vh,emStrongRDelimAst:w_,emStrongLDelim:b_,url:vt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Gc).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:vt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Gc).getRegex()},A_={...tl,br:vt(cm).replace("{2,}","*").getRegex(),text:vt(tl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Zo={normal:wh,gfm:c_,pedantic:d_},Ki={normal:vh,gfm:tl,breaks:A_,pedantic:F_},M_={"&":"&","<":"<",">":">",'"':""","'":"'"},Xc=e=>M_[e];function Ie(e,t){if(t){if(ne.escapeTest.test(e))return e.replace(ne.escapeReplace,Xc)}else if(ne.escapeTestNoEncode.test(e))return e.replace(ne.escapeReplaceNoEncode,Xc);return e}function Vc(e){try{e=encodeURI(e).replace(ne.percentDecode,"%")}catch{return null}return e}function Kc(e,t){let r=e.replace(ne.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ne.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(ne.slashPipe,"|");return i}function Zi(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function $_(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function Zc(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function O_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
|
|
165
165
|
`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(`
|
|
166
|
-
`)}var
|
|
167
|
-
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=
|
|
166
|
+
`)}var Hs=class{options;rules;lexer;constructor(t){this.options=t||Wr}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Zi(i,`
|
|
167
|
+
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=O_(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=Zi(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Zi(r[0],`
|
|
168
168
|
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Zi(r[0],`
|
|
169
169
|
`).split(`
|
|
170
170
|
`),o="",s="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
|
|
171
171
|
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
172
172
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
173
173
|
${h}`:h,s=s?`${s}
|
|
174
|
-
${d}`:d;let
|
|
174
|
+
${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=f,i.length===0)break;let u=a.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let g=u,m=g.raw+`
|
|
175
175
|
`+i.join(`
|
|
176
|
-
`),y=this.blockquote(m);a[a.length-1]=y,o=o.substring(0,o.length-
|
|
176
|
+
`),y=this.blockquote(m);a[a.length-1]=y,o=o.substring(0,o.length-g.raw.length)+y.raw,s=s.substring(0,s.length-g.text.length)+y.text;break}else if(u?.type==="list"){let g=u,m=g.raw+`
|
|
177
177
|
`+i.join(`
|
|
178
|
-
`),y=this.list(m);a[a.length-1]=y,o=o.substring(0,o.length-
|
|
179
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:a,text:s}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),o=i.length>1,s={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let
|
|
180
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),
|
|
181
|
-
`,1)[0],
|
|
182
|
-
`,t=t.substring(
|
|
183
|
-
`,1)[0],B;if(
|
|
184
|
-
`+B.slice(m);else{if(
|
|
185
|
-
`+
|
|
186
|
-
`,t=t.substring(E.length+1),
|
|
187
|
-
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let n of o)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of s)a.rows.push(
|
|
188
|
-
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=Zi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a
|
|
178
|
+
`),y=this.list(m);a[a.length-1]=y,o=o.substring(0,o.length-u.raw.length)+y.raw,s=s.substring(0,s.length-g.raw.length)+y.raw,i=m.substring(a.at(-1).raw.length).split(`
|
|
179
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:a,text:s}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),o=i.length>1,s={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(`
|
|
180
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),u=t.split(`
|
|
181
|
+
`,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(u)&&(h+=u+`
|
|
182
|
+
`,t=t.substring(u.length+1),c=!0),!c){let C=this.rules.other.nextBulletRegex(m),w=this.rules.other.hrRegex(m),S=this.rules.other.fencesBeginRegex(m),v=this.rules.other.headingBeginRegex(m),_=this.rules.other.htmlBeginRegex(m);for(;t;){let E=t.split(`
|
|
183
|
+
`,1)[0],B;if(u=E,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),B=u):B=u.replace(this.rules.other.tabCharGlobal," "),S.test(u)||v.test(u)||_.test(u)||C.test(u)||w.test(u))break;if(B.search(this.rules.other.nonSpaceChar)>=m||!u.trim())d+=`
|
|
184
|
+
`+B.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(f)||v.test(f)||w.test(f))break;d+=`
|
|
185
|
+
`+u}!g&&!u.trim()&&(g=!0),h+=E+`
|
|
186
|
+
`,t=t.substring(E.length+1),f=B.slice(m)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(x=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){let h=s.items[c].tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:o,title:s}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=Kc(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
187
|
+
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let n of o)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of s)a.rows.push(Kc(n,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
188
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=Zi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=$_(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),Zc(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return Zc(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,l=s,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(o=h.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){l+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...o[0]][0].length,f=t.slice(0,s+o.index+d+n);if(Math.min(s,n)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Be=class el{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Wr,this.options.tokenizer=this.options.tokenizer||new Hs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ne,block:Zo.normal,inline:Ki.normal};this.options.pedantic?(r.block=Zo.pedantic,r.inline=Ki.pedantic):this.options.gfm&&(r.block=Zo.gfm,this.options.breaks?r.inline=Ki.breaks:r.inline=Ki.gfm),this.tokenizer.rules=r}static get rules(){return{block:Zo,inline:Ki}}static lex(t,r){return new el(r).lex(t)}static lexInline(t,r){return new el(r).inlineTokens(t)}lex(t){t=t.replace(ne.carriageReturn,`
|
|
189
189
|
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(ne.tabCharGlobal," ").replace(ne.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
190
190
|
`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
191
191
|
`)?"":`
|
|
@@ -199,7 +199,7 @@ ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
199
199
|
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),i=s.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
200
200
|
`)?"":`
|
|
201
201
|
`)+o.raw,a.text+=`
|
|
202
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),
|
|
202
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(u=>{f=u.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},Ys=class{options;parser;constructor(t){this.options=t||Wr}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(ne.notSpaceStart)?.[0],s=t.replace(ne.endingNewline,"")+`
|
|
203
203
|
`;return o?'<pre><code class="language-'+Ie(o)+'">'+(i?s:Ie(s,!0))+`</code></pre>
|
|
204
204
|
`:"<pre><code>"+(i?s:Ie(s,!0))+`</code></pre>
|
|
205
205
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -217,60 +217,60 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
217
217
|
`}tablerow({text:t}){return`<tr>
|
|
218
218
|
${t}</tr>
|
|
219
219
|
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
|
|
220
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ie(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=
|
|
221
|
-
`+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let a=s;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},no=class{options;block;constructor(t){this.options=t||Wr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Be.lex:Be.lexInline}provideParser(){return this.block?Le.parse:Le.parseInline}},
|
|
222
|
-
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Ie(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},qr=new
|
|
220
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ie(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=Vc(t);if(s===null)return o;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+Ie(r)+'"'),a+=">"+o+"</a>",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=Vc(t);if(s===null)return Ie(i);t=s;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${Ie(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ie(t.text)}},Th=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Le=class rl{options;renderer;textRenderer;constructor(t){this.options=t||Wr,this.options.renderer=this.options.renderer||new Ys,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Th}static parse(t,r){return new rl(r).parse(t)}static parseInline(t,r){return new rl(r).parseInline(t)}parse(t,r=!0){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=s,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let a=s;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,l=this.renderer.text(n);for(;o+1<t.length&&t[o+1].type==="text";)n=t[++o],l+=`
|
|
221
|
+
`+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let a=s;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},no=class{options;block;constructor(t){this.options=t||Wr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Be.lex:Be.lexInline}provideParser(){return this.block?Le.parse:Le.parseInline}},R_=class{defaults=yh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Le;Renderer=Ys;TextRenderer=Th;Lexer=Be;Tokenizer=Hs;Hooks=no;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let a of s.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of s.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let s=o;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=o;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new Ys(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new Hs(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new no;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=s[n];no.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&no.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return c.call(s,f)})();let d=l.call(s,h);return c.call(s,d)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await c.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Be.lex(t,r??this.defaults)}parser(t,r){return Le.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?Be.lex:Be.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?Le.parse:Le.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?Be.lex:Be.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?Le.parse:Le.parseInline)(n,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=`
|
|
222
|
+
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Ie(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},qr=new R_;function Bt(e,t){return qr.parse(e,t)}Bt.options=Bt.setOptions=function(e){return qr.setOptions(e),Bt.defaults=qr.defaults,am(Bt.defaults),Bt};Bt.getDefaults=yh;Bt.defaults=Wr;Bt.use=function(...e){return qr.use(...e),Bt.defaults=qr.defaults,am(Bt.defaults),Bt};Bt.walkTokens=function(e,t){return qr.walkTokens(e,t)};Bt.parseInline=qr.parseInline;Bt.Parser=Le;Bt.parser=Le.parse;Bt.Renderer=Ys;Bt.TextRenderer=Th;Bt.Lexer=Be;Bt.lexer=Be.lex;Bt.Tokenizer=Hs;Bt.Hooks=no;Bt.parse=Bt;Bt.options;Bt.setOptions;Bt.use;Bt.walkTokens;Bt.parseInline;Le.parse;Be.lex;function ym(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var o=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):n},[]);if(o.length){var s=new RegExp(`
|
|
223
223
|
[ ]{`+Math.min.apply(Math,o)+"}","g");i=i.map(function(n){return n.replace(s,`
|
|
224
224
|
`)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(n,l){var c=a.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=n;typeof n=="string"&&n.includes(`
|
|
225
225
|
`)&&(d=String(n).split(`
|
|
226
|
-
`).map(function(u
|
|
227
|
-
`)),a+=d+i[l+1]}),a}function
|
|
226
|
+
`).map(function(f,u){return u===0?f:""+h+f}).join(`
|
|
227
|
+
`)),a+=d+i[l+1]}),a}function xm(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
|
|
228
228
|
`).replace(/\n{2,}/g,`
|
|
229
|
-
`);return
|
|
230
|
-
`).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(
|
|
231
|
-
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return
|
|
232
|
-
`),s):Ce(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),rl(h,t.labelStyle),h.attr("class",`${c} ${i}`),rl(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}g(Sm,"addHtmlSpan");function ba(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}g(ba,"createTspan");function vm(e,t,r){const i=e.append("text"),o=ba(i,1,t);ka(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}g(vm,"computeWidthOfText");function Tm(e,t,r){const i=e.append("text"),o=ba(i,1,t);ka(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}g(Tm,"computeDimensionOfText");function _m(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=g(f=>vm(a,1.1,f)<=e,"checkWidth"),u=d(h)?[h]:wm(h,d);for(const f of u){const p=ba(l,c,1.1,o);ka(p,f),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}g(_m,"createFormattedText");function il(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}g(il,"decodeHTMLEntities");function ka(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(il(r.content)):o.text(" "+il(r.content))})}g(ka,"updateTextContentAndStyles");async function Bm(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await VT(n)?await qi(n,void 0,{class:"label-icon"}):`<i class='${Ce(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}g(Bm,"replaceIconSubstring");var Oe=g(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?Cm(t,h):xm(t),u=await Bm(pr(d),h),f=t.replace(/\\\\/g,"\\"),p={isNode:n,label:Li(t)?f:u,labelStyle:r.replace("fill:","color:")};return await Sm(e,p,l,o,c,h)}else{const d=pr(t.replace(/<br\s*\/?>/g,"<br/>")),u=a?ym(d.replace("<br>","<br/>"),h):mm(d),f=_m(l,e,u,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(f).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(f).select("rect").attr("style",p.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(f).select("text").attr("style",m)}return i?yt(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");function Ga(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function $_(e,t){return e[0]===t[0]&&e[1]===t[1]}function O_(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)Ga(c,n,o);const l=(function(c,h,d){const u=[];for(const C of c){const k=[...C];$_(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&u.push(k)}const f=[];h=Math.max(h,.1);const p=[];for(const C of u)for(let k=0;k<C.length-1;k++){const S=C[k],v=C[k+1];if(S[1]!==v[1]){const _=Math.min(S[1],v[1]);p.push({ymin:_,ymax:Math.max(S[1],v[1]),x:_===S[1]?S[0]:v[0],islope:(v[0]-S[0])/(v[1]-S[1])})}}if(p.sort(((C,k)=>C.ymin<k.ymin?-1:C.ymin>k.ymin?1:C.x<k.x?-1:C.x>k.x?1:C.ymax===k.ymax?0:(C.ymax-k.ymax)/Math.abs(C.ymax-k.ymax))),!p.length)return f;let m=[],y=p[0].ymin,x=0;for(;m.length||p.length;){if(p.length){let C=-1;for(let k=0;k<p.length&&!(p[k].ymin>y);k++)C=k;p.splice(0,C+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((C=>!(C.edge.ymax<=y))),m.sort(((C,k)=>C.edge.x===k.edge.x?0:(C.edge.x-k.edge.x)/Math.abs(C.edge.x-k.edge.x))),(d!==1||x%h==0)&&m.length>1)for(let C=0;C<m.length;C+=2){const k=C+1;if(k>=m.length)break;const S=m[C].edge,v=m[k].edge;f.push([[Math.round(S.x),y],[Math.round(v.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return f})(a,s,i);if(o){for(const c of a)Ga(c,n,-o);(function(c,h,d){const u=[];c.forEach((f=>u.push(...f))),Ga(u,h,d)})(l,n,-o)}return l}function Do(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),O_(e,o,i,s||1)}class _h{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Do(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function wa(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class R_ extends _h{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Do(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)wa([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class I_ extends _h{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class P_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Do(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=wa(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,u=(n[0][0]+n[1][0])/2-o/4,f=Math.min(n[0][1],n[1][1]);for(let p=0;p<h;p++){const m=f+d+p*o,y=u-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,s,s,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class D_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Do(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=wa(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let f=0;f<l;f++){const p=f*(i+o),m=p+i,y=[h[0]+p*Math.cos(u)+c*Math.cos(u),h[1]+p*Math.sin(u)+c*Math.sin(u)],x=[h[0]+m*Math.cos(u)+c*Math.cos(u),h[1]+m*Math.sin(u)+c*Math.sin(u)];s.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),s}}class N_{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=Do(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=wa(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,p=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],y=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],x=[m[0]+p*Math.cos(h+Math.PI/4),m[1]+p*Math.sin(h+Math.PI/4)];o.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i),...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],i))}})),o}}const he={};class q_{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const z_=0,Va=1,Qc=2,Zo={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Ka(e,t){return e.type===t}function Bh(e){const t=[],r=(function(a){const n=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:z_,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:Va,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:Qc,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!Ka(s,Qc);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return Bh("M0,0"+e);o++,a=Zo[s.text],i=s.text}else Ka(s,Va)?a=Zo[i]:(o++,a=Zo[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let l=o;l<o+a;l++){const c=r[l];if(!Ka(c,Va))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Zo[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function Lm(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function Em(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=o+(o-l)):(d=i,u=o),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,u]=h;let f=0,p=0;r==="Q"||r==="T"?(f=i+(i-n),p=o+(o-l)):(f=i,p=o);const m=i+2*(f-i)/3,y=o+2*(p-o)/3,x=d+2*(f-d)/3,C=u+2*(p-u)/3;t.push({key:"C",data:[m,y,x,C,d,u]}),n=f,l=p,i=d,o=u;break}case"Q":{const[d,u,f,p]=h,m=i+2*(d-i)/3,y=o+2*(u-o)/3,x=f+2*(d-f)/3,C=p+2*(u-p)/3;t.push({key:"C",data:[m,y,x,C,f,p]}),n=d,l=u,i=f,o=p;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),f=h[2],p=h[3],m=h[4],y=h[5],x=h[6];d===0||u===0?(t.push({key:"C",data:[i,o,y,x,y,x]}),i=y,o=x):(i!==y||o!==x)&&(Fm(i,o,y,x,d,u,f,p,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,o=x);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function Qi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Fm(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let u=[],f=0,p=0,m=0,y=0;if(c)[f,p,m,y]=c;else{[e,t]=Qi(e,t,-h),[r,i]=Qi(r,i,-h);const q=(e-r)/2,N=(t-i)/2;let A=q*q/(o*o)+N*N/(s*s);A>1&&(A=Math.sqrt(A),o*=A,s*=A);const F=o*o,P=s*s,O=F*P-F*N*N-P*q*q,$=F*N*N+P*q*q,j=(n===l?-1:1)*Math.sqrt(Math.abs(O/$));m=j*o*N/s+(e+r)/2,y=j*-s*q/o+(t+i)/2,f=Math.asin(parseFloat(((t-y)/s).toFixed(9))),p=Math.asin(parseFloat(((i-y)/s).toFixed(9))),e<m&&(f=Math.PI-f),r<m&&(p=Math.PI-p),f<0&&(f=2*Math.PI+f),p<0&&(p=2*Math.PI+p),l&&f>p&&(f-=2*Math.PI),!l&&p>f&&(p-=2*Math.PI)}let x=p-f;if(Math.abs(x)>120*Math.PI/180){const q=p,N=r,A=i;p=l&&p>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=Fm(r=m+o*Math.cos(p),i=y+s*Math.sin(p),N,A,o,s,a,0,l,[p,q,m,y])}x=p-f;const C=Math.cos(f),k=Math.sin(f),S=Math.cos(p),v=Math.sin(p),_=Math.tan(x/4),E=4/3*o*_,B=4/3*s*_,I=[e,t],M=[e+E*k,t-B*C],D=[r+E*v,i-B*S],U=[r,i];if(M[0]=2*I[0]-M[0],M[1]=2*I[1]-M[1],c)return[M,D,U].concat(u);{u=[M,D,U].concat(u);const q=[];for(let N=0;N<u.length;N+=3){const A=Qi(u[N][0],u[N][1],h),F=Qi(u[N+1][0],u[N+1][1],h),P=Qi(u[N+2][0],u[N+2][1],h);q.push([A[0],A[1],F[0],F[1],P[0],P[1]])}return q}}const j_={randOffset:function(e,t){return ct(e,t)},randOffsetWithRange:function(e,t,r){return Us(e,t,r)},ellipse:function(e,t,r,i,o){const s=Mm(r,i,o);return ol(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return gr(e,t,r,i,o,!0)}};function Am(e,t,r,i,o){return{type:"path",ops:gr(e,t,r,i,o)}}function fs(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...gr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...gr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?Am(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function W_(e,t,r,i,o){return(function(s,a){return fs(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function Jc(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Qo(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:Qo(r[0],1.5*(1+.22*t.roughness),rd(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=Qo(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Qo(a,1.5*(1+.22*t.roughness),rd(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function Mm(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=ct(a*l,r),n+=ct(n*l,r),{increment:s,rx:a,ry:n}}function ol(e,t,r,i){const[o,s]=id(i.increment,e,t,i.rx,i.ry,1,i.increment*Us(.1,Us(.4,1,r),r),r);let a=Xs(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=id(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Xs(n,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function td(e,t,r,i,o,s,a,n,l){const c=e,h=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=ct(.01*d,l),u+=ct(.01*u,l);let f=o,p=s;for(;f<0;)f+=2*Math.PI,p+=2*Math.PI;p-f>2*Math.PI&&(f=0,p=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(p-f)/2),x=od(y,c,h,d,u,f,p,1,l);if(!l.disableMultiStroke){const C=od(y,c,h,d,u,f,p,1.5,l);x.push(...C)}return a&&(n?x.push(...gr(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l),...gr(c,h,c+d*Math.cos(p),h+u*Math.sin(p),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(f),h+u*Math.sin(f)]})),{type:"path",ops:x}}function ed(e,t){const r=Em(Lm(Bh(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...gr(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,f]=n;i.push(...H_(l,c,h,d,u,f,s,t)),s=[u,f];break}case"Z":i.push(...gr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function Za(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+ct(o,t),i[0][1]+ct(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+ct(o,t),i[a][1]+ct(o,t)]})}}return{type:"fillPath",ops:r}}function Kr(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!he[o])switch(o){case"zigzag":he[o]||(he[o]=new R_(i));break;case"cross-hatch":he[o]||(he[o]=new I_(i));break;case"dots":he[o]||(he[o]=new P_(i));break;case"dashed":he[o]||(he[o]=new D_(i));break;case"zigzag-line":he[o]||(he[o]=new N_(i));break;default:o="hachure",he[o]||(he[o]=new _h(i))}return he[o]})(t,j_).fillPolygons(e,t)}function rd(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function $m(e){return e.randomizer||(e.randomizer=new q_(e.seed||0)),e.randomizer.next()}function Us(e,t,r,i=1){return r.roughness*i*($m(r)*(t-e)+e)}function ct(e,t,r=1){return Us(-e,e,t,r)}function gr(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=sl(e,t,r,i,o,!0,!1);if(a)return n;const l=sl(e,t,r,i,o,!0,!0);return n.concat(l)}function sl(e,t,r,i,o,s,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*$m(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,p=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=ct(f,o,c),p=ct(p,o,c);const m=[],y=()=>ct(d,o,c),x=()=>ct(h,o,c),C=o.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:ct(h,o,c)),t+(C?0:ct(h,o,c))]}),a?m.push({op:"bcurveTo",data:[f+e+(r-e)*u+y(),p+t+(i-t)*u+y(),f+e+2*(r-e)*u+y(),p+t+2*(i-t)*u+y(),r+(C?0:y()),i+(C?0:y())]}):m.push({op:"bcurveTo",data:[f+e+(r-e)*u+x(),p+t+(i-t)*u+x(),f+e+2*(r-e)*u+x(),p+t+2*(i-t)*u+x(),r+(C?0:x()),i+(C?0:x())]}),m}function Qo(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ct(t,r),e[0][1]+ct(t,r)]),i.push([e[0][0]+ct(t,r),e[0][1]+ct(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+ct(t,r),e[o][1]+ct(t,r)]),o===e.length-1&&i.push([e[o][0]+ct(t,r),e[o][1]+ct(t,r)]);return Xs(i,null,r)}function Xs(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],s[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...sl(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function id(e,t,r,i,o,s,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=ct(.5,n)-Math.PI/2;c.push([ct(s,n)+t+.9*i*Math.cos(h-e),ct(s,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const f=[ct(s,n)+t+i*Math.cos(u),ct(s,n)+r+o*Math.sin(u)];l.push(f),c.push(f)}c.push([ct(s,n)+t+i*Math.cos(h+2*Math.PI+.5*a),ct(s,n)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([ct(s,n)+t+.98*i*Math.cos(h+a),ct(s,n)+r+.98*o*Math.sin(h+a)]),c.push([ct(s,n)+t+.9*i*Math.cos(h+.5*a),ct(s,n)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function od(e,t,r,i,o,s,a,n,l){const c=s+ct(.1,l),h=[];h.push([ct(n,l)+t+.9*i*Math.cos(c-e),ct(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([ct(n,l)+t+i*Math.cos(d),ct(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),Xs(h,null,l)}function H_(e,t,r,i,o,s,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(u?0:ct(c[0],n)),a[1]+(u?0:ct(c[0],n))]}),h=u?[o,s]:[o+ct(c[f],n),s+ct(c[f],n)],l.push({op:"bcurveTo",data:[e+ct(c[f],n),t+ct(c[f],n),r+ct(c[f],n),i+ct(c[f],n),h[0],h[1]]});return l}function Ji(e){return[...e]}function sd(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Ji(e[0]),Ji(e[1]),Ji(e[2]),Ji(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(Ji(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*o[n+1][0]-a*o[n-1][0])/6,l[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function ps(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function Y_(e,t,r){const i=ps(t,r);if(i===0)return ps(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),ps(e,Br(t,r,o))}function Br(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function al(e,t,r,i){const o=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let f=3*h[0]-2*c[0]-u[0];f*=f;let p=3*h[1]-2*c[1]-u[1];p*=p;let m=3*d[0]-2*u[0]-c[0];m*=m;let y=3*d[1]-2*u[1]-c[1];return y*=y,f<m&&(f=m),p<y&&(p=y),f+p})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(ps(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=Br(l,c,.5),f=Br(c,h,.5),p=Br(h,d,.5),m=Br(u,f,.5),y=Br(f,p,.5),x=Br(m,y,.5);al([l,u,m,x],0,r,o),al([x,y,p,d],0,r,o)}var s,a;return o}function U_(e,t){return Gs(e,0,e.length,t)}function Gs(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=Y_(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Gs(e,t,c+1,i,s),Gs(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function Qa(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)al(e,3*s,t,i);return r&&r>0?Gs(i,0,i.length,r):i}const ue="none";class Vs{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[Am(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=W_(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(Za([c],a)):n.push(Kr([c],a))}return a.stroke!==ue&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=Mm(i,o,a),c=ol(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=ol(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Kr([c.estimatedPoints],a));return a.stroke!==ue&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[fs(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=td(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=td(t,r,i,o,s,a,!0,!1,u);f.type="fillPath",h.push(f)}else h.push((function(u,f,p,m,y,x,C){const k=u,S=f;let v=Math.abs(p/2),_=Math.abs(m/2);v+=ct(.01*v,C),_+=ct(.01*_,C);let E=y,B=x;for(;E<0;)E+=2*Math.PI,B+=2*Math.PI;B-E>2*Math.PI&&(E=0,B=2*Math.PI);const I=(B-E)/C.curveStepCount,M=[];for(let D=E;D<=B;D+=I)M.push([k+v*Math.cos(D),S+_*Math.sin(D)]);return M.push([k+v*Math.cos(B),S+_*Math.sin(B)]),M.push([k,S]),Kr([M],C)})(t,r,i,o,s,a,c));return c.stroke!==ue&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=Jc(t,i);if(i.fill&&i.fill!==ue)if(i.fillStyle==="solid"){const a=Jc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...Qa(sd([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Qa(sd(c),10,(1+i.roughness)/2))}a.length&&o.push(Kr([a],i))}return i.stroke!==ue&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=fs(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Za([t],i)):o.push(Kr([t],i))),i.stroke!==ue&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ue,a=i.stroke!==ue,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,u){const f=Em(Lm(Bh(h))),p=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...Qa(x,d)),x=[]},k=()=>{C(),m.length&&(p.push(m),m=[])};for(const{key:v,data:_}of f)switch(v){case"M":k(),y=[_[0],_[1]],m.push(y);break;case"L":C(),m.push([_[0],_[1]]);break;case"C":if(!x.length){const E=m.length?m[m.length-1]:y;x.push([E[0],E[1]])}x.push([_[0],_[1]]),x.push([_[2],_[3]]),x.push([_[4],_[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(k(),!u)return p;const S=[];for(const v of p){const _=U_(v,u);_.length&&S.push(_)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=ed(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=ed(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(Za(l,i));else o.push(Kr(l,i));return a&&(n?l.forEach((h=>{o.push(fs(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ue};break;case"fillPath":a={d:this.opsToPath(s),stroke:ue,strokeWidth:0,fill:i.fill||ue};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ue,strokeWidth:i,fill:ue}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class X_{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Vs(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Jo="http://www.w3.org/2000/svg";class G_{constructor(t,r){this.svg=t,this.gen=new Vs(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(Jo,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(Jo,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(Jo,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(Jo,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var rt={canvas:(e,t)=>new X_(e,t),svg:(e,t)=>new G_(e,t),generator:e=>new Vs(e),newSeed:()=>Vs.newSeed()},ht=g(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ye(kt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Xt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await Oe(a,Ce(pr(n),kt()),{useHtmlLabels:o,width:t.width||kt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},kt());let d=h.getBBox();const u=(t?.padding??0)/2;if(o){const f=h.children[0],p=yt(h);await gh(f,n),d=f.getBoundingClientRect(),p.attr("width",d.width),p.attr("height",d.height)}return o?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:u,label:a}},"labelHelper"),Ja=g(async(e,t,r)=>{const i=r.useHtmlLabels??ee(kt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Oe(o,Ce(pr(t),kt()),{useHtmlLabels:i,width:r.width||kt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(ee(kt())){const l=s.children[0],c=yt(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),st=g((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),lt=g((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function bt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}g(bt,"createPathFromPoints");function mr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,u=t+c/2;for(let f=0;f<=50;f++){const p=f/50,m=e+p*l,y=u+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}g(mr,"generateFullSineWavePoints");function Bo(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Bo,"generateCirclePoints");function nl(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=g((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}g(nl,"mergePaths");var V_=g((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),Hr=V_,K_=g(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=kt(),n=ee(a);return await Oe(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),lr=K_,yr=g((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),Z_=g(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=ot(t),u=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),f=Ye(r.flowchart.htmlLabels),p=t.direction==="LR",m=u.insert("g").attr("class","cluster-label swimlane-label"),y=await Oe(m,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let x=y.getBBox();if(f){const q=y.children[0],N=yt(y);x=q.getBoundingClientRect(),N.attr("width",x.width),N.attr("height",x.height)}const C=t.padding??0,k=t.width<=x.width+C?x.width+C:t.width;t.width<=x.width+C?t.diff=(k-t.width)/2-C:t.diff=-C;const S=t.height,v=t.y-S/2,_=t.y+S/2,E=t.x-k/2,B=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+S/3,I=p?4:0,M=x.height+2*I;let D,U;if(p){const q=Math.max(M,x.height+2*I),N=E+q,A=Math.max(0,k-q);if(t.look==="handDrawn"){const O=rt.svg(u),$=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),j=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),T=O.rectangle(E,v,q,S,$);D=u.insert(()=>T,":first-child");const W=O.rectangle(N,v,A,S,j);U=u.insert(()=>W,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=u.insert("rect",":first-child"),U=u.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",E).attr("y",v).attr("width",q).attr("height",S).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",N).attr("y",v).attr("width",A).attr("height",S).attr("fill","none").attr("stroke",n);const F=E+q/2,P=t.y;m.attr("transform",`translate(${F}, ${P}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const q=Math.max(0,B-v),N=Math.min(M,q),A=v+N,F=Math.max(0,_-A),P=t.x-k/2;if(t.look==="handDrawn"){const j=rt.svg(u),T=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),W=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),z=j.rectangle(P,v,k,N,T);D=u.insert(()=>z,":first-child");const G=j.rectangle(P,A,k,F,W);U=u.insert(()=>G,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=u.insert("rect",":first-child"),U=u.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",P).attr("y",v).attr("width",k).attr("height",N).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",P).attr("y",A).attr("width",k).attr("height",F).attr("fill","none").attr("stroke",n);const O=t.x-x.width/2,$=v+(N-x.height)/2;m.attr("transform",`translate(${O}, ${$})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const q=m.select("span");q&&q.attr("style",l)}return t.offsetX=0,t.width=k,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(q){return Hr(t,q)},{cluster:u,labelBBox:x}},"swimlane"),Om=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ot(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=ee(r),f=d.insert("g").attr("class","cluster-label ");let p;t.labelType==="markdown"?p=await Oe(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width}):p=await lr(f,t.label,t.labelStyle||"",!1,!0);let m=p.getBBox();if(ee(r)){const E=p.children[0],B=yt(p);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,k=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),I=E.path(yr(C,k,y,x,0),B);S=d.insert(()=>(V.debug("Rough node insert CXC",I),I),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=ya(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=f.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Hr(t,E)},{cluster:d,labelBBox:m}},"rect"),Q_=g((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return Hr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),J_=g(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let u=c.append("rect");const f=await lr(d,t.label,t.labelStyle,void 0,!0);let p=f.getBBox();if(ee(r)){const I=f.children[0],M=yt(f);p=I.getBoundingClientRect(),M.attr("width",p.width),M.attr("height",p.height)}const m=0*t.padding,y=m/2,x=(t.width<=p.width+t.padding?p.width+t.padding:t.width)+m;t.width<=p.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height+m,k=t.height+m-p.height-6,S=t.x-x/2,v=t.y-C/2;t.width=x;const _=t.y-t.height/2-y+p.height+2;let E;if(t.look==="handDrawn"){const I=t.cssClasses.includes("statediagram-cluster-alt"),M=rt.svg(c),D=t.rx||t.ry?M.path(yr(S,v,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):M.rectangle(S,v,x,C,{seed:o});E=c.insert(()=>D,":first-child");const U=M.rectangle(S,_,x,k,{fill:I?s:a,fillStyle:I?"hachure":"solid",stroke:l,seed:o});E=c.insert(()=>D,":first-child"),u=c.insert(()=>U)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",S).attr("y",v).attr("width",x).attr("height",C).attr("data-look",t.look),u.attr("class","inner").attr("x",S).attr("y",_).attr("width",x).attr("height",k);d.attr("transform",`translate(${t.x-p.width/2}, ${v+1-(ee(r)?0:3)})`);const B=E.node().getBBox();return t.height=B.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(I){return Hr(t,I)},{cluster:c,labelBBox:p}},"roundedWithTitle"),tB=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ot(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=ee(r),f=d.insert("g").attr("class","cluster-label "),p=await Oe(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let m=p.getBBox();if(ee(r)){const E=p.children[0],B=yt(p);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,k=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),I=E.path(yr(C,k,y,x,t.rx),B);S=d.insert(()=>(V.debug("Rough node insert CXC",I),I),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=ya(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=f.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Hr(t,E)},{cluster:d,labelBBox:m}},"kanbanSection"),eB=g((e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,u=t.y-h/2;t.width=c;let f;if(t.look==="handDrawn"){const y=rt.svg(a).rectangle(d,u,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});f=a.insert(()=>y,":first-child")}else{f=n.insert("rect",":first-child");let m="outer";t.look,m="divider",f.attr("class",m).attr("x",d).attr("y",u).attr("width",c).attr("height",h).attr("data-look",t.look)}const p=f.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Hr(t,m)},{cluster:a,labelBBox:{}}},"divider"),rB=Om,iB={rect:Om,squareRect:rB,roundedWithTitle:J_,noteGroup:Q_,divider:eB,kanbanSection:tB,swimlane:Z_},Rm=new Map,Im=g(async(e,t)=>{const r=t.shape||"rect",i=await iB[r](e,t);return Rm.set(t.id,i),i},"insertCluster"),oB=g(()=>{Rm=new Map},"clear");function Pm(e,t){return e.intersect(t)}g(Pm,"intersectNode");var sB=Pm;function Dm(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<s&&(h=-h),{x:o+c,y:s+h}}g(Dm,"intersectEllipse");var Nm=Dm;function qm(e,t,r){return Nm(e,t,t,r)}g(qm,"intersectCircle");var aB=qm;function zm(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,l=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&l!==0&&ll(n,l))return;const h=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=h*e.x+d*e.y+u,p=h*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(p)<c&&ll(f,p))return;const m=o*d-h*s;if(m===0)return;const y=Math.abs(m/2);let x=s*u-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-o*u;const k=x<0?(x-y)/m:(x+y)/m;return{x:C,y:k}}}g(zm,"intersectLine");function ll(e,t){return e*t>0}g(ll,"sameSign");var nB=zm;function jm(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],f=nB(e,r,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});f&&s.push(f)}return s.length?(s.length>1&&s.sort(function(h,d){let u=h.x-r.x,f=h.y-r.y,p=Math.sqrt(u*u+f*f),m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y);return p<x?-1:p===x?0:1}),s[0]):e}g(jm,"intersectPolygon");var lB=jm,tt={node:sB,circle:aB,ellipse:Nm,polygon:lB,rect:Hr};function Wm(e,t){const{labelStyles:r}=ot(t);t.labelStyle=r;const i=lt(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=rt.svg(s),c=et(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=s.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Xt(n)),st(t,d),t.intersect=function(u){return V.info("Circle intersect",t,a,u),tt.circle(t,a,u)},s}g(Wm,"anchor");function hl(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/o,p=u/s,m=Math.sqrt(f**2+p**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*s*Math.sin(h)*(a?-1:1),C=c-y*o*Math.cos(h)*(a?-1:1),k=Math.atan2((t-C)/s,(e-x)/o);let v=Math.atan2((i-C)/s,(r-x)/o)-k;a&&v<0&&(v+=2*Math.PI),!a&&v>0&&(v-=2*Math.PI);const _=[];for(let E=0;E<20;E++){const B=E/19,I=k+B*v,M=x+o*Math.cos(I),D=C+s*Math.sin(I);_.push({x:M,y:D})}return _}g(hl,"generateArcPoints");function Hm(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}g(Hm,"calculateArcSagitta");async function Ym(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=g(I=>I+a,"calcTotalHeight"),l=g(I=>{const M=I/2;return[M/(2.5+I/50),M]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=n(t?.height?t?.height:h.height),[u,f]=l(d),p=Hm(d,u,f),y=(t?.width?t?.width:h.width)+s*2+p-p,x=d,{cssStyles:C}=t,k=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...hl(-y/2,-x/2,-y/2,x/2,u,f,!1),{x:y/2,y:x/2},...hl(y/2,x/2,y/2,-x/2,u,f,!0)],S=rt.svg(c),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=bt(k),E=S.path(_,v),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${u/2}, 0)`),st(t,B),t.intersect=function(I){return tt.polygon(t,k,I)},c}g(Ym,"bowTieRect");function or(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(or,"insertPolygonShape");var ts=12;async function Um(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+ts),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,u=c,f=-h,p=0,m=[{x:d+ts,y:f},{x:u,y:f},{x:u,y:p},{x:d,y:p},{x:d,y:f+ts},{x:d+ts,y:f}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),k=et(t,{}),S=bt(m),v=C.path(S,k);y=n.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=or(n,c,h,m);return i&&y.attr("style",i),st(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},n}g(Um,"card");function Xm(e,t){const{nodeStyles:r}=ot(t);t.label="";const i=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=rt.svg(i),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=bt(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return tt.polygon(t,a,u)},i}g(Xm,"choice");async function Lh(e,t,r){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await ht(e,t,lt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(s),p=et(t,{}),m=f.circle(0,0,h*2,p);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Xt(u))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return st(t,d),t.calcIntersect=function(f,p){const m=f.width/2;return tt.circle(f,m,p)},t.intersect=function(f){return V.info("Circle intersect",t,h,f),tt.circle(t,h,f)},s}g(Lh,"circle");function Gm(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y}
|
|
233
|
-
M ${o.x},${o.y} L ${a.x},${a.y}`}g(Gm,"createLine");function Vm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(o),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=Gm(s),d=n.path(h,l),u=o.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),st(t,u),t.intersect=function(f){return V.info("crossedCircle intersect",t,{radius:s,point:f}),tt.circle(t,s,f)},o}g(Vm,"crossedCircle");function Ke(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Ke,"generateCirclePoints");async function Km(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+n,h=s.height+l,d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Ke(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Ke(c/2+d*2,-d,d,20,-180,-270),...Ke(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Ke(c/2,h/2,d,20,0,90)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Ke(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Ke(c/2+c*.1,-d,d,20,-180,-270),...Ke(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Ke(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],m=rt.svg(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(f).replace("Z",""),k=m.path(C,y),S=bt(p),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,p,E)},o}g(Km,"curlyBraceLeft");function Ze(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:f,y:p})}return a}g(Ze,"generateCirclePoints");async function Zm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Ze(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Ze(c/2+d*2,-d,d,20,-180,-270),...Ze(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Ze(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...Ze(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Ze(c/2+d*2,-d,d,20,-180,-270),...Ze(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Ze(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],m=rt.svg(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(f).replace("Z",""),k=m.path(C,y),S=bt(p),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,p,E)},o}g(Zm,"curlyBraceRight");function Kt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Kt,"generateCirclePoints");async function Qm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Kt(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Kt(c/2+d*2,-d,d,20,-180,-270),...Kt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Kt(c/2,h/2,d,20,0,90)],p=[...Kt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Kt(-c/2-d/2,-d,d,20,0,90),...Kt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Kt(-c/2+d+d/2,h/2,d,30,-180,-270)],m=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Kt(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Kt(c/2+d*2,-d,d,20,-180,-270),...Kt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Kt(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2-d-d/2,y:h/2+d},...Kt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Kt(-c/2-d/2,-d,d,20,0,90),...Kt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Kt(-c/2+d+d/2,h/2,d,30,-180,-270)],y=rt.svg(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=bt(f).replace("Z",""),S=y.path(k,x),_=bt(p).replace("Z",""),E=y.path(_,x),B=bt(m),I=y.path(B,{...x}),M=o.insert("g",":first-child");return M.insert(()=>I,":first-child").attr("stroke-opacity",0),M.insert(()=>S,":first-child"),M.insert(()=>E,":first-child"),M.attr("class","text"),u&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,M),t.intersect=function(D){return tt.polygon(t,m,D)},o}g(Qm,"curlyBraces");async function Jm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),u=Math.max(l,h.height+a*2,t?.height??0),f=u/2,{cssStyles:p}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=u,k=x-f,S=C/4,v=[{x:k,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:k,y:C},...Bo(-k,-C/2,f,50,270,90)],_=bt(v),E=m.path(_,y),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-d/2}, ${-u/2})`),st(t,B),t.intersect=function(I){return tt.polygon(t,v,I)},c}g(Jm,"curvedTrapezoid");var hB=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),cB=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),dB=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),ad=8,nd=8;async function ty(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<nd&&(t.width=nd);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<ad&&(t.height=ad)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t.width?t.width:l.width)+a,d=h/2,u=d/(2.5+h/50),f=(t.height?t.height:l.height)+s+u;let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=rt.svg(n),x=cB(0,0,h,f,d,u),C=dB(0,u,h,f,d,u),k=et(t,{}),S=y.path(x,k),v=y.path(C,et(t,{fill:"none"}));p=n.insert(()=>v,":first-child"),p=n.insert(()=>S,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=hB(0,0,h,f,d,u);p=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Xt(m)).attr("style",i)}return p.attr("label-offset-y",u),p.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),st(t,p),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const x=tt.rect(t,y),C=x.x-(t.x??0);if(d!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-u)){let k=u*u*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=u-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}g(ty,"cylinder");async function zi(e,t,r){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await ht(e,t,lt(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:u,ry:f}=t;const{cssStyles:p}=t;if(r?.rx&&r.ry&&(u=r.rx,f=r.ry),t.look==="handDrawn"){const m=rt.svg(s),y=et(t,{}),x=u||f?m.path(yr(c,h,n,l,u||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Xt(p))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Xt(u)).attr("ry",Xt(f)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return st(t,d),t.calcIntersect=function(m,y){return tt.rect(m,y)},t.intersect=function(m){return tt.rect(t,m)},s}g(zi,"drawRect");async function ey(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await zi(e,t,l);if(t.look==="handDrawn"){const f=rt.svg(c),p=et(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let x=null;if(y instanceof SVGGraphicsElement)x=y.getBBox();else return c;return c.insert(()=>f.line(x.x,x.y,x.x+x.width,x.y,p),".basic.label-container g.label"),c.insert(()=>f.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,p),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,u=(Number(h.attr("height"))||n)??0;return d>0&&u>0&&h.attr("stroke-dasharray",`${d} ${u}`),c}g(ey,"datastore");async function ry(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=n.width+o,h=n.height+s,d=h*.2,u=-c/2,f=-h/2-d/2,{cssStyles:p}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:u,y:f+d},{x:-u,y:f+d},{x:-u,y:-f},{x:u,y:-f},{x:u,y:f},{x:-u,y:f},{x:-u,y:f+d}],C=m.polygon(x.map(S=>[S.x,S.y]),y),k=a.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${f+d+(t.padding??0)/2-(n.y-(n.top??0))})`),st(t,k),t.intersect=function(S){return tt.rect(t,S)},a}g(ry,"dividedRectangle");async function iy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(n),p=et(t,{roughness:.2,strokeWidth:2.5}),m=et(t,{roughness:.2,strokeWidth:1.5}),y=f.circle(0,0,c*2,p),x=f.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Xt(t.cssClasses)).attr("style",Xt(u)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const f=d.insert("circle",":first-child"),p=d.insert("circle");d.attr("class","basic label-container").attr("style",i),f.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),p.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return st(t,d),t.intersect=function(f){return V.info("DoubleCircle intersect",t,c,f),tt.circle(t,c,f)},n}g(iy,"doublecircle");function oy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=rt.svg(s),{nodeBorder:c}=r,h=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),u=s.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),st(t,u),t.intersect=function(f){return V.info("filledCircle intersect",t,{radius:a,point:f}),tt.circle(t,a,f)},s}g(oy,"filledCircle");var ld=10,hd=10;async function sy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<ld&&(t.height=ld),t.width=(t?.width??0)-s-s/2,t.width<hd&&(t.width=hd));const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width:n.width)+(s??0),h=t?.height?t?.height:c+n.height,d=h,u=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:f}=t,p=rt.svg(a),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(u),x=p.path(y,m),C=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=c,t.height=h,st(t,C),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(k){return V.info("Triangle intersect",t,u,k),tt.polygon(t,u,k)},a}g(sy,"flippedTriangle");function ay(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=ot(t);t.label="";const a=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,u=rt.svg(a),f=et(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=u.rectangle(h,d,l,c,f),m=a.insert(()=>p,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),st(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(x){return tt.rect(t,x)},a}g(ay,"forkJoin");async function ny(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,u=d/2,{cssStyles:f}=t,p=rt.svg(l),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2,y:-d/2},{x:h/2-u,y:-d/2},...Bo(-h/2+u,0,u,50,90,270),{x:h/2-u,y:d/2},{x:-h/2,y:d/2}],x=bt(y),C=p.path(x,m),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),st(t,k),t.intersect=function(S){return V.info("Pill intersect",t,{radius:u,point:S}),tt.polygon(t,y,S)},l}g(ny,"halfRoundedRectangle");var uB=g((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function ly(e,t){const{labelStyles:r,nodeStyles:i}=ot(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const k=(t.height??0)/o;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await ht(e,t,lt(t)),u=(t?.height?t?.height:d.height)+l,f=u/o,p=(t?.width?t?.width:d.width)+2*f+c,m=[{x:f,y:0},{x:p-f,y:0},{x:p,y:-u/2},{x:p-f,y:-u},{x:f,y:-u},{x:0,y:-u/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),k=et(t,{}),S=uB(0,0,p,u,f),v=C.path(S,k);y=h.insert(()=>v,":first-child").attr("transform",`translate(${-p/2}, ${u/2})`),x&&y.attr("style",x)}else y=or(h,p,u,m);return i&&y.attr("style",i),t.width=p,t.height=u,st(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}g(ly,"hexagon");async function hy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await ht(e,t,lt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=rt.svg(o),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=bt(h),u=l.path(d,c),f=o.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-s/2}, ${-a/2})`),st(t,f),t.intersect=function(p){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,p)},o}g(hy,"hourglass");async function cy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ht(e,t,"icon-shape default"),u=t.pos==="t",f=n,p=n,{nodeBorder:m}=r,{stylesMap:y}=Ni(t),x=-p/2,C=-f/2,k=t.label?8:0,S=rt.svg(c),v=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=S.rectangle(x,C,p,f,v),E=Math.max(p,h.width),B=f+h.height+k,I=S.rectangle(-E/2,-B/2,E,B,{...v,fill:"transparent",stroke:"none"}),M=c.insert(()=>_,":first-child"),D=c.insert(()=>I);if(t.icon){const U=c.append("g");U.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const q=U.node().getBBox(),N=q.width,A=q.height,F=q.x,P=q.y;U.attr("transform",`translate(${-N/2-F},${u?h.height/2+k/2-A/2-P:-h.height/2-k/2-A/2-P})`),U.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-B/2:B/2-h.height})`),M.attr("transform",`translate(0,${u?h.height/2+k/2:-h.height/2-k/2})`),st(t,D),t.intersect=function(U){if(V.info("iconSquare intersect",t,U),!t.label)return tt.rect(t,U);const q=t.x??0,N=t.y??0,A=t.height??0;let F=[];return u?F=[{x:q-h.width/2,y:N-A/2},{x:q+h.width/2,y:N-A/2},{x:q+h.width/2,y:N-A/2+h.height+k},{x:q+p/2,y:N-A/2+h.height+k},{x:q+p/2,y:N+A/2},{x:q-p/2,y:N+A/2},{x:q-p/2,y:N-A/2+h.height+k},{x:q-h.width/2,y:N-A/2+h.height+k}]:F=[{x:q-p/2,y:N-A/2},{x:q+p/2,y:N-A/2},{x:q+p/2,y:N-A/2+f},{x:q+h.width/2,y:N-A/2+f},{x:q+h.width/2/2,y:N+A/2},{x:q-h.width/2,y:N+A/2},{x:q-h.width/2,y:N-A/2+f},{x:q-p/2,y:N-A/2+f}],tt.polygon(t,F,U)},c}g(cy,"icon");async function dy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ht(e,t,"icon-shape default"),u=20,f=t.label?8:0,p=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Ni(t),C=rt.svg(c),k=et(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=x.get("fill");k.stroke=S??y;const v=c.append("g");t.icon&&v.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const _=v.node().getBBox(),E=_.width,B=_.height,I=_.x,M=_.y,D=Math.max(E,B)*Math.SQRT2+u*2,U=C.circle(0,0,D,k),q=Math.max(D,h.width),N=D+h.height+f,A=C.rectangle(-q/2,-N/2,q,N,{...k,fill:"transparent",stroke:"none"}),F=c.insert(()=>U,":first-child"),P=c.insert(()=>A);return v.attr("transform",`translate(${-E/2-I},${p?h.height/2+f/2-B/2-M:-h.height/2-f/2-B/2-M})`),v.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-N/2:N/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+f/2:-h.height/2-f/2})`),st(t,P),t.intersect=function(O){return V.info("iconSquare intersect",t,O),tt.rect(t,O)},c}g(dy,"iconCircle");async function uy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await ht(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ni(t),k=-m/2,S=-p/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const I=_.path(yr(k,S,m,p,5),E),M=Math.max(m,h.width),D=p+h.height+v,U=_.rectangle(-M/2,-D/2,M,D,{...E,fill:"transparent",stroke:"none"}),q=c.insert(()=>I,":first-child").attr("class","icon-shape2"),N=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=A.node().getBBox(),P=F.width,O=F.height,$=F.x,j=F.y;A.attr("transform",`translate(${-P/2-$},${f?h.height/2+v/2-O/2-j:-h.height/2-v/2-O/2-j})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),q.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),st(t,N),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const F=t.x??0,P=t.y??0,O=t.height??0;let $=[];return f?$=[{x:F-h.width/2,y:P-O/2},{x:F+h.width/2,y:P-O/2},{x:F+h.width/2,y:P-O/2+h.height+v},{x:F+m/2,y:P-O/2+h.height+v},{x:F+m/2,y:P+O/2},{x:F-m/2,y:P+O/2},{x:F-m/2,y:P-O/2+h.height+v},{x:F-h.width/2,y:P-O/2+h.height+v}]:$=[{x:F-m/2,y:P-O/2},{x:F+m/2,y:P-O/2},{x:F+m/2,y:P-O/2+p},{x:F+h.width/2,y:P-O/2+p},{x:F+h.width/2/2,y:P+O/2},{x:F-h.width/2,y:P+O/2},{x:F-h.width/2,y:P-O/2+p},{x:F-m/2,y:P-O/2+p}],tt.polygon(t,$,A)},c}g(uy,"iconRounded");async function fy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await ht(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ni(t),k=-m/2,S=-p/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const I=_.path(yr(k,S,m,p,.1),E),M=Math.max(m,h.width),D=p+h.height+v,U=_.rectangle(-M/2,-D/2,M,D,{...E,fill:"transparent",stroke:"none"}),q=c.insert(()=>I,":first-child"),N=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=A.node().getBBox(),P=F.width,O=F.height,$=F.x,j=F.y;A.attr("transform",`translate(${-P/2-$},${f?h.height/2+v/2-O/2-j:-h.height/2-v/2-O/2-j})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),q.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),st(t,N),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const F=t.x??0,P=t.y??0,O=t.height??0;let $=[];return f?$=[{x:F-h.width/2,y:P-O/2},{x:F+h.width/2,y:P-O/2},{x:F+h.width/2,y:P-O/2+h.height+v},{x:F+m/2,y:P-O/2+h.height+v},{x:F+m/2,y:P+O/2},{x:F-m/2,y:P+O/2},{x:F-m/2,y:P-O/2+h.height+v},{x:F-h.width/2,y:P-O/2+h.height+v}]:$=[{x:F-m/2,y:P-O/2},{x:F+m/2,y:P-O/2},{x:F+m/2,y:P-O/2+p},{x:F+h.width/2,y:P-O/2+p},{x:F+h.width/2/2,y:P+O/2},{x:F-h.width/2,y:P+O/2},{x:F-h.width/2,y:P-O/2+p},{x:F-m/2,y:P-O/2+p}],tt.polygon(t,$,A)},c}g(fy,"iconSquare");async function py(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=ot(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:f}=await ht(e,t,"image-shape default"),p=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,C=rt.svg(d),k=et(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=C.rectangle(m,y,c,h,k),v=Math.max(c,u.width),_=h+u.height+x,E=C.rectangle(-v/2,-_/2,v,_,{...k,fill:"none",stroke:"none"}),B=d.insert(()=>S,":first-child"),I=d.insert(()=>E);if(t.img){const M=d.append("image");M.attr("href",t.img),M.attr("width",c),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-c/2},${p?_/2-h:-_/2})`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-h/2-u.height/2-x/2:h/2-u.height/2+x/2})`),B.attr("transform",`translate(0,${p?u.height/2+x/2:-u.height/2-x/2})`),st(t,I),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return tt.rect(t,M);const D=t.x??0,U=t.y??0,q=t.height??0;let N=[];return p?N=[{x:D-u.width/2,y:U-q/2},{x:D+u.width/2,y:U-q/2},{x:D+u.width/2,y:U-q/2+u.height+x},{x:D+c/2,y:U-q/2+u.height+x},{x:D+c/2,y:U+q/2},{x:D-c/2,y:U+q/2},{x:D-c/2,y:U-q/2+u.height+x},{x:D-u.width/2,y:U-q/2+u.height+x}]:N=[{x:D-c/2,y:U-q/2},{x:D+c/2,y:U-q/2},{x:D+c/2,y:U-q/2+h},{x:D+u.width/2,y:U-q/2+h},{x:D+u.width/2/2,y:U+q/2},{x:D-u.width/2,y:U+q/2},{x:D-u.width/2,y:U-q/2+h},{x:D-c/2,y:U-q/2+h}],tt.polygon(t,N,M)},d}g(py,"imageSquare");async function gy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),f&&u.attr("style",f)}else u=or(n,c,h,d);return i&&u.attr("style",i),t.width=c,t.height=h,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(gy,"inv_trapezoid");async function my(e,t){const{shapeSvg:r,bbox:i,label:o}=await ht(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),st(t,s),t.intersect=function(l){return tt.rect(t,l)},r}g(my,"labelRect");async function yy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=or(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(yy,"lean_left");async function xy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=or(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(xy,"lean_right");function Cy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=rt.svg(o),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=bt(c),f=h.path(u,d),p=o.insert(()=>f,":first-child");return p.attr("class","outer-path"),s&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${a/2},${-n})`),st(t,p),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},o}g(Cy,"lightningBolt");var fB=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),pB=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),gB=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),cd=10,dd=10;async function by(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-s,t.width<dd&&(t.width=dd);const k=x/2/(2.5+x/50);t.height=(t.height??0)-a-k*3,t.height<cd&&(t.height=cd)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+s*2,d=h/2,u=d/(2.5+h/50),f=(t?.height?t?.height:l.height)+u+a*2,p=f*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=rt.svg(n),C=pB(0,0,h,f,d,u,p),k=gB(0,u,h,f,d,u),S=et(t,{}),v=x.path(C,S),_=x.path(k,S);n.insert(()=>_,":first-child").attr("class","line"),m=n.insert(()=>v,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=fB(0,0,h,f,d,u,p);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Xt(y)).attr("style",i)}return m.attr("label-offset-y",u),m.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),st(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+u-(l.y-(l.top??0))})`),t.intersect=function(x){const C=tt.rect(t,x),k=C.x-(t.x??0);if(d!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-u)){let S=u*u*(1-k*k/(d*d));S>0&&(S=Math.sqrt(S)),S=u-S,x.y-(t.y??0)>0&&(S=-S),C.y+=S}return C},n}g(by,"linedCylinder");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const S=t.width;t.width=(S??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{cssStyles:p}=t,m=rt.svg(n),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-h/2-h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:f/2},...mr(-h/2-h/2*.1,f/2,h/2+h/2*.1,f/2,u,.8),{x:h/2+h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:-f/2},{x:-h/2,y:-f/2},{x:-h/2,y:f/2*1.1},{x:-h/2,y:-f/2}],C=m.polygon(x.map(S=>[S.x,S.y]),y),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-u/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-u/2-(l.y-(l.top??0))})`),st(t,k),t.intersect=function(S){return tt.polygon(t,x,S)},n}g(ky,"linedWaveEdgedRect");async function wy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await ht(e,t,lt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,u=(t?.height?t?.height:c.height)+a*2+2*n,f=d-2*n,p=u-2*n,m=-f/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(l),k=et(t,{}),S=[{x:m-n,y:y+n},{x:m-n,y:y+p+n},{x:m+f-n,y:y+p+n},{x:m+f-n,y:y+p},{x:m+f,y:y+p},{x:m+f,y:y+p-n},{x:m+f+n,y:y+p-n},{x:m+f+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],v=[{x:m,y:y+n},{x:m+f-n,y:y+n},{x:m+f-n,y:y+p},{x:m+f,y:y+p},{x:m+f,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=bt(S);let E=C.path(_,k);const B=bt(v);let I=C.path(B,k);t.look!=="handDrawn"&&(E=nl(E),I=nl(I));const M=l.insert("g",":first-child");return M.insert(()=>E),M.insert(()=>I),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),st(t,M),t.intersect=function(D){return tt.polygon(t,S,D)},l}g(wy,"multiRect");async function Sy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(s.width,t?.width??0)+l*2,u=Math.max(s.height,t?.height??0)+c*3,f=t.look==="neo"?u/4:u/8,p=u+(h?f/2:-f/2),m=-d/2,y=-p/2,x=10,{cssStyles:C}=t,k=mr(m-x,y+p+x,m+d-x,y+p+x,f,.8),S=k?.[k.length-1],v=[{x:m-x,y:y+x},{x:m-x,y:y+p+x},...k,{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y:S.y-2*x},{x:m+d+x,y:S.y-2*x},{x:m+d+x,y:y-x},{x:m+x,y:y-x},{x:m+x,y},{x:m,y},{x:m,y:y+x}],_=[{x:m,y:y+x},{x:m+d-x,y:y+x},{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y},{x:m,y}],E=rt.svg(o),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const I=bt(v),M=E.path(I,B),D=bt(_),U=E.path(D,B),q=o.insert(()=>M,":first-child");return q.insert(()=>U),q.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&q.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&q.selectAll("path").attr("style",i),q.attr("transform",`translate(0,${-f/2})`),a.attr("transform",`translate(${-(s.width/2)-x-(s.x-(s.left??0))}, ${-(s.height/2)+x-f/2-(s.y-(s.top??0))})`),st(t,q),t.intersect=function(N){return tt.polygon(t,v,N)},o}g(Sy,"multiWaveEdgedRectangle");async function vy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i,t.useHtmlLabels||ee(Ot())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,u=-h/2,{cssStyles:f}=t,p=rt.svg(a),m=et(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=p.rectangle(d,u,c,h,m),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,x),t.intersect=function(C){return tt.rect(t,C)},a}g(vy,"note");var mB=g((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Ty(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ht(e,t,lt(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(o),p=et(t,{}),m=mB(0,0,l),y=f.path(m,p);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),u&&d.attr("style",u)}else d=or(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),st(t,d),t.calcIntersect=function(f,p){const m=f.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],x=tt.polygon(f,y,p);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(f){return this.calcIntersect(t,f)},o}g(Ty,"question");async function _y(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),u=-h/2,f=-d/2,p=f/2,m=[{x:u+p,y:f},{x:u,y:0},{x:u+p,y:-f},{x:-u,y:-f},{x:-u,y:f}],{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=bt(m),S=x.path(k,C),v=n.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${-p/2},0)`),c.attr("transform",`translate(${-p/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),st(t,v),t.intersect=function(_){return tt.polygon(t,m,_)},n}g(_y,"rect_left_inv_arrow");async function By(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await lr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ee(kt())){const B=h.children[0],I=yt(h);d=B.getBoundingClientRect(),I.attr("width",d.width),I.attr("height",d.height)}V.info("Text 2",l);const u=l||[],f=h.getBBox(),p=await lr(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),m=p.children[0],y=yt(p);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;yt(p).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+x+5)+")"),yt(h).attr("transform","translate( "+(d.width<f.width?0:-(f.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")");const C=d.width+(t.padding||0),k=d.height+(t.padding||0),S=-d.width/2-x,v=-d.height/2-x;let _,E;if(t.look==="handDrawn"){const B=rt.svg(s),I=et(t,{}),M=B.path(yr(S,v,C,k,t.rx||0),I),D=B.line(-d.width/2-x,-d.height/2-x+f.height+x,d.width/2+x,-d.height/2-x+f.height+x,I);E=s.insert(()=>(V.debug("Rough node insert CXC",M),D),":first-child"),_=s.insert(()=>(V.debug("Rough node insert CXC",M),M),":first-child")}else _=a.insert("rect",":first-child"),E=a.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),E.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+f.height+x).attr("y2",-d.height/2-x+f.height+x);return st(t,_),t.intersect=function(B){return tt.rect(t,B)},s}g(By,"rectWithTitle");async function Ly(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return zi(e,t,o)}g(Ly,"roundedRect");var Sr=8;async function Ey(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?Sr:Sr*2),h=(t?.height??n.height)+s*2,d=c-Sr,u=h,f=Sr-c/2,p=-h/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:f,y:p},{x:f+d,y:p},{x:f+d,y:p+u},{x:f-Sr,y:p+u},{x:f-Sr,y:p},{x:f,y:p},{x:f,y:p+u}],k=y.polygon(C.map(v=>[v.x,v.y]),x),S=a.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Xt(m)),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${Sr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,S),t.intersect=function(v){return tt.rect(t,v)},a}g(Ey,"shadedProcess");async function Fy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,u=h,f=d/1.5,p=-u/2,m=-f/2,{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=[{x:p,y:m},{x:p,y:m+f},{x:p+u,y:m+f},{x:p+u,y:m-f/2}],S=bt(k),v=x.path(S,C),_=n.insert(()=>v,":first-child");return _.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(0, ${f/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(l.x-(l.left??0))}, ${-f/4+(t.padding??0)-(l.y-(l.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,k,E)},n}g(Fy,"slopedRect");async function Ay(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return zi(e,t,s)}g(Ay,"squareRect");async function My(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:u}=t,f=rt.svg(n),p=et(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...Bo(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Bo(h/2-d,0,d,50,270,450)],y=bt(m),x=f.path(y,p),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),st(t,C),t.intersect=function(k){return tt.polygon(t,m,k)},n}g(My,"stadium");async function $y(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return zi(e,t,r)}g($y,"state");function Oy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=rt.svg(h),u=et(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:a,strokeWidth:2}),p=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...u,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>f,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),s&&x.selectAll("path").attr("style",s),o&&x.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const C=e.node()?.ownerSVGElement?.id??"",k=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${k})`)}return st(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}g(Oy,"stateEnd");function Ry(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=rt.svg(s).circle(0,0,t.width,Jv(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return st(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}g(Ry,"stateStart");var Zr=8;async function Iy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width??l.width)+2*Zr+s,h=(t?.height??l.height)+a,d=c-2*Zr,u=h,f=-c/2,p=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const y=rt.svg(n),x=et(t,{}),C=y.rectangle(f,p,d+16,u,x),k=y.line(f+Zr,p,f+Zr,p+u,x),S=y.line(f+Zr+d,p,f+Zr+d,p+u,x);n.insert(()=>k,":first-child"),n.insert(()=>S,":first-child");const v=n.insert(()=>C,":first-child"),{cssStyles:_}=t;v.attr("class","basic label-container").attr("style",Xt(_)),st(t,v)}else{const y=or(n,d,u,m);i&&y.attr("style",i),st(t,y)}return t.intersect=function(y){return tt.polygon(t,m,y)},n}g(Iy,"subroutine");var tn=.2;async function Py(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-tn*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height?t?.height:l.height)+a*2,h=tn*c,d=tn*c,f=(t?.width?t?.width:l.width)+s*2+h-h,p=c,m=-f/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(n),k=et(t,{}),S=[{x:m-h/2,y},{x:m+f+h/2,y},{x:m+f+h/2,y:y+p},{x:m-h/2,y:y+p}],v=[{x:m+f-h/2,y:y+p},{x:m+f+h/2,y:y+p},{x:m+f+h/2,y:y+p-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=bt(S),E=C.path(_,k),B=bt(v),I=C.path(B,{...k,fillStyle:"solid"}),M=n.insert(()=>I,":first-child");return M.insert(()=>E,":first-child"),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),st(t,M),t.intersect=function(D){return tt.polygon(t,S,D)},n}g(Py,"taggedRect");async function Dy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,u=l+c,{cssStyles:f}=t,p=rt.svg(o),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:u/2},...mr(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],x=-n/2+n/2*.1,C=-u/2-d*.4,k=[{x:x+n-h,y:(C+l)*1.3},{x:x+n,y:C+l-d},{x:x+n,y:(C+l)*.9},...mr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],S=bt(y),v=p.path(S,m),_=bt(k),E=p.path(_,{...m,fillStyle:"solid"}),B=o.insert(()=>E,":first-child");return B.insert(()=>v,":first-child"),B.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),st(t,B),t.intersect=function(I){return tt.polygon(t,y,I)},o}g(Dy,"taggedWaveEdgedRectangle");async function Ny(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ht(e,t,lt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),st(t,h),t.intersect=function(d){return tt.rect(t,d)},o}g(Ny,"text");var yB=g((e,t,r,i,o,s)=>`M${e},${t}
|
|
229
|
+
`);return ym(i)}p(xm,"preprocessMarkdown");function Cm(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(Cm,"nonMarkdownToLines");function bm(e,t={}){const r=xm(e,t),i=Bt.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
|
|
230
|
+
`).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&o[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}p(bm,"markdownToLines");function km(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}p(km,"nonMarkdownToHTML");function wm(e,{markdownAutoWrap:t}={}){const r=Bt.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g," "):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(V.warn(`Unsupported markdown: ${o.type}`),o.raw)}return p(i,"output"),r.map(i).join("")}p(wm,"markdownToHTML");function Sm(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(Sm,"splitTextToChars");function vm(e,t){const r=Sm(t.content);return _h(e,[],r,t.type)}p(vm,"splitWordToFitWidth");function _h(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?_h(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(_h,"splitWordToFitWidthRecursion");function Tm(e,t){if(e.some(({content:r})=>r.includes(`
|
|
231
|
+
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Us(e,t)}p(Tm,"splitLineToFitWidth");function Us(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return Us(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=vm(t,s);r.push([n]),l.content&&e.unshift(l)}return Us(e,t,r)}p(Us,"splitLineToFitWidthRecursion");function il(e,t){t&&e.attr("style",t)}p(il,"applyStyle");var Qc=16384;async function _m(e,t,r,i,o=!1,s=Ot()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,Qc)}px`),a.attr("height",`${Math.min(10*r,Qc)}px`);const n=a.append("xhtml:div"),l=Li(t.label)?await Fl(t.label.replace(Pi.lineBreakRegex,`
|
|
232
|
+
`),s):Ce(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),il(h,t.labelStyle),h.attr("class",`${c} ${i}`),il(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}p(_m,"addHtmlSpan");function ka(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}p(ka,"createTspan");function Bm(e,t,r){const i=e.append("text"),o=ka(i,1,t);wa(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(Bm,"computeWidthOfText");function Lm(e,t,r){const i=e.append("text"),o=ka(i,1,t);wa(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(Lm,"computeDimensionOfText");function Em(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=p(u=>Bm(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:Tm(h,d);for(const u of f){const g=ka(l,c,1.1,o);wa(g,u),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}p(Em,"createFormattedText");function ol(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}p(ol,"decodeHTMLEntities");function wa(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(ol(r.content)):o.text(" "+ol(r.content))})}p(wa,"updateTextContentAndStyles");async function Fm(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await QT(n)?await qi(n,void 0,{class:"label-icon"}):`<i class='${Ce(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(Fm,"replaceIconSubstring");var Oe=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?wm(t,h):km(t),f=await Fm(gr(d),h),u=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Li(t)?u:f,labelStyle:r.replace("fill:","color:")};return await _m(e,g,l,o,c,h)}else{const d=gr(t.replace(/<br\s*\/?>/g,"<br/>")),f=a?bm(d.replace("<br>","<br/>"),h):Cm(d),u=Em(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(u).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(u).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(u).select("text").attr("style",m)}return i?yt(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function Va(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function I_(e,t){return e[0]===t[0]&&e[1]===t[1]}function P_(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)Va(c,n,o);const l=(function(c,h,d){const f=[];for(const C of c){const w=[...C];I_(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&f.push(w)}const u=[];h=Math.max(h,.1);const g=[];for(const C of f)for(let w=0;w<C.length-1;w++){const S=C[w],v=C[w+1];if(S[1]!==v[1]){const _=Math.min(S[1],v[1]);g.push({ymin:_,ymax:Math.max(S[1],v[1]),x:_===S[1]?S[0]:v[0],islope:(v[0]-S[0])/(v[1]-S[1])})}}if(g.sort(((C,w)=>C.ymin<w.ymin?-1:C.ymin>w.ymin?1:C.x<w.x?-1:C.x>w.x?1:C.ymax===w.ymax?0:(C.ymax-w.ymax)/Math.abs(C.ymax-w.ymax))),!g.length)return u;let m=[],y=g[0].ymin,x=0;for(;m.length||g.length;){if(g.length){let C=-1;for(let w=0;w<g.length&&!(g[w].ymin>y);w++)C=w;g.splice(0,C+1).forEach((w=>{m.push({s:y,edge:w})}))}if(m=m.filter((C=>!(C.edge.ymax<=y))),m.sort(((C,w)=>C.edge.x===w.edge.x?0:(C.edge.x-w.edge.x)/Math.abs(C.edge.x-w.edge.x))),(d!==1||x%h==0)&&m.length>1)for(let C=0;C<m.length;C+=2){const w=C+1;if(w>=m.length)break;const S=m[C].edge,v=m[w].edge;u.push([[Math.round(S.x),y],[Math.round(v.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return u})(a,s,i);if(o){for(const c of a)Va(c,n,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),Va(f,h,d)})(l,n,-o)}return l}function No(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),P_(e,o,i,s||1)}class Bh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=No(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function Sa(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class D_ extends Bh{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=No(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)Sa([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class N_ extends Bh{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class q_{constructor(t){this.helper=t}fillPolygons(t,r){const i=No(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=Sa(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,f=(n[0][0]+n[1][0])/2-o/4,u=Math.min(n[0][1],n[1][1]);for(let g=0;g<h;g++){const m=u+d+g*o,y=f-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,s,s,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class z_{constructor(t){this.helper=t}fillPolygons(t,r){const i=No(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=Sa(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u<l;u++){const g=u*(i+o),m=g+i,y=[h[0]+g*Math.cos(f)+c*Math.cos(f),h[1]+g*Math.sin(f)+c*Math.sin(f)],x=[h[0]+m*Math.cos(f)+c*Math.cos(f),h[1]+m*Math.sin(f)+c*Math.sin(f)];s.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),s}}class j_{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=No(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=Sa(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const f=2*d*r,u=2*(d+1)*r,g=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],x=[m[0]+g*Math.cos(h+Math.PI/4),m[1]+g*Math.sin(h+Math.PI/4)];o.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i),...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],i))}})),o}}const he={};class W_{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const H_=0,Ka=1,Jc=2,Qo={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Za(e,t){return e.type===t}function Lh(e){const t=[],r=(function(a){const n=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:H_,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:Ka,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:Jc,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!Za(s,Jc);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return Lh("M0,0"+e);o++,a=Qo[s.text],i=s.text}else Za(s,Ka)?a=Qo[i]:(o++,a=Qo[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let l=o;l<o+a;l++){const c=r[l];if(!Za(c,Ka))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Qo[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function Am(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function Mm(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=o+(o-l)):(d=i,f=o),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,f]=h;let u=0,g=0;r==="Q"||r==="T"?(u=i+(i-n),g=o+(o-l)):(u=i,g=o);const m=i+2*(u-i)/3,y=o+2*(g-o)/3,x=d+2*(u-d)/3,C=f+2*(g-f)/3;t.push({key:"C",data:[m,y,x,C,d,f]}),n=u,l=g,i=d,o=f;break}case"Q":{const[d,f,u,g]=h,m=i+2*(d-i)/3,y=o+2*(f-o)/3,x=u+2*(d-u)/3,C=g+2*(f-g)/3;t.push({key:"C",data:[m,y,x,C,u,g]}),n=d,l=f,i=u,o=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],g=h[3],m=h[4],y=h[5],x=h[6];d===0||f===0?(t.push({key:"C",data:[i,o,y,x,y,x]}),i=y,o=x):(i!==y||o!==x)&&($m(i,o,y,x,d,f,u,g,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,o=x);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function Qi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function $m(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,g=0,m=0,y=0;if(c)[u,g,m,y]=c;else{[e,t]=Qi(e,t,-h),[r,i]=Qi(r,i,-h);const N=(e-r)/2,q=(t-i)/2;let A=N*N/(o*o)+q*q/(s*s);A>1&&(A=Math.sqrt(A),o*=A,s*=A);const $=o*o,O=s*s,F=$*O-$*q*q-O*N*N,R=$*q*q+O*N*N,j=(n===l?-1:1)*Math.sqrt(Math.abs(F/R));m=j*o*q/s+(e+r)/2,y=j*-s*N/o+(t+i)/2,u=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),e<m&&(u=Math.PI-u),r<m&&(g=Math.PI-g),u<0&&(u=2*Math.PI+u),g<0&&(g=2*Math.PI+g),l&&u>g&&(u-=2*Math.PI),!l&&g>u&&(g-=2*Math.PI)}let x=g-u;if(Math.abs(x)>120*Math.PI/180){const N=g,q=r,A=i;g=l&&g>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=$m(r=m+o*Math.cos(g),i=y+s*Math.sin(g),q,A,o,s,a,0,l,[g,N,m,y])}x=g-u;const C=Math.cos(u),w=Math.sin(u),S=Math.cos(g),v=Math.sin(g),_=Math.tan(x/4),E=4/3*o*_,B=4/3*s*_,D=[e,t],M=[e+E*w,t-B*C],P=[r+E*v,i-B*S],U=[r,i];if(M[0]=2*D[0]-M[0],M[1]=2*D[1]-M[1],c)return[M,P,U].concat(f);{f=[M,P,U].concat(f);const N=[];for(let q=0;q<f.length;q+=3){const A=Qi(f[q][0],f[q][1],h),$=Qi(f[q+1][0],f[q+1][1],h),O=Qi(f[q+2][0],f[q+2][1],h);N.push([A[0],A[1],$[0],$[1],O[0],O[1]])}return N}}const Y_={randOffset:function(e,t){return ct(e,t)},randOffsetWithRange:function(e,t,r){return Gs(e,t,r)},ellipse:function(e,t,r,i,o){const s=Rm(r,i,o);return sl(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return pr(e,t,r,i,o,!0)}};function Om(e,t,r,i,o){return{type:"path",ops:pr(e,t,r,i,o)}}function gs(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...pr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...pr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?Om(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function U_(e,t,r,i,o){return(function(s,a){return gs(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function td(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Jo(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:Jo(r[0],1.5*(1+.22*t.roughness),id(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=Jo(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Jo(a,1.5*(1+.22*t.roughness),id(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function Rm(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=ct(a*l,r),n+=ct(n*l,r),{increment:s,rx:a,ry:n}}function sl(e,t,r,i){const[o,s]=od(i.increment,e,t,i.rx,i.ry,1,i.increment*Gs(.1,Gs(.4,1,r),r),r);let a=Xs(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=od(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Xs(n,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function ed(e,t,r,i,o,s,a,n,l){const c=e,h=t;let d=Math.abs(r/2),f=Math.abs(i/2);d+=ct(.01*d,l),f+=ct(.01*f,l);let u=o,g=s;for(;u<0;)u+=2*Math.PI,g+=2*Math.PI;g-u>2*Math.PI&&(u=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-u)/2),x=sd(y,c,h,d,f,u,g,1,l);if(!l.disableMultiStroke){const C=sd(y,c,h,d,f,u,g,1.5,l);x.push(...C)}return a&&(n?x.push(...pr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...pr(c,h,c+d*Math.cos(g),h+f*Math.sin(g),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(u),h+f*Math.sin(u)]})),{type:"path",ops:x}}function rd(e,t){const r=Mm(Am(Lh(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...pr(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...G_(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...pr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function Qa(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+ct(o,t),i[0][1]+ct(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+ct(o,t),i[a][1]+ct(o,t)]})}}return{type:"fillPath",ops:r}}function Kr(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!he[o])switch(o){case"zigzag":he[o]||(he[o]=new D_(i));break;case"cross-hatch":he[o]||(he[o]=new N_(i));break;case"dots":he[o]||(he[o]=new q_(i));break;case"dashed":he[o]||(he[o]=new z_(i));break;case"zigzag-line":he[o]||(he[o]=new j_(i));break;default:o="hachure",he[o]||(he[o]=new Bh(i))}return he[o]})(t,Y_).fillPolygons(e,t)}function id(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Im(e){return e.randomizer||(e.randomizer=new W_(e.seed||0)),e.randomizer.next()}function Gs(e,t,r,i=1){return r.roughness*i*(Im(r)*(t-e)+e)}function ct(e,t,r=1){return Gs(-e,e,t,r)}function pr(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=al(e,t,r,i,o,!0,!1);if(a)return n;const l=al(e,t,r,i,o,!0,!0);return n.concat(l)}function al(e,t,r,i,o,s,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*Im(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=ct(u,o,c),g=ct(g,o,c);const m=[],y=()=>ct(d,o,c),x=()=>ct(h,o,c),C=o.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:ct(h,o,c)),t+(C?0:ct(h,o,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),g+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),g+t+2*(i-t)*f+y(),r+(C?0:y()),i+(C?0:y())]}):m.push({op:"bcurveTo",data:[u+e+(r-e)*f+x(),g+t+(i-t)*f+x(),u+e+2*(r-e)*f+x(),g+t+2*(i-t)*f+x(),r+(C?0:x()),i+(C?0:x())]}),m}function Jo(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ct(t,r),e[0][1]+ct(t,r)]),i.push([e[0][0]+ct(t,r),e[0][1]+ct(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+ct(t,r),e[o][1]+ct(t,r)]),o===e.length-1&&i.push([e[o][0]+ct(t,r),e[o][1]+ct(t,r)]);return Xs(i,null,r)}function Xs(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],s[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...al(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function od(e,t,r,i,o,s,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=ct(.5,n)-Math.PI/2;c.push([ct(s,n)+t+.9*i*Math.cos(h-e),ct(s,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=e){const u=[ct(s,n)+t+i*Math.cos(f),ct(s,n)+r+o*Math.sin(f)];l.push(u),c.push(u)}c.push([ct(s,n)+t+i*Math.cos(h+2*Math.PI+.5*a),ct(s,n)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([ct(s,n)+t+.98*i*Math.cos(h+a),ct(s,n)+r+.98*o*Math.sin(h+a)]),c.push([ct(s,n)+t+.9*i*Math.cos(h+.5*a),ct(s,n)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function sd(e,t,r,i,o,s,a,n,l){const c=s+ct(.1,l),h=[];h.push([ct(n,l)+t+.9*i*Math.cos(c-e),ct(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([ct(n,l)+t+i*Math.cos(d),ct(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),Xs(h,null,l)}function G_(e,t,r,i,o,s,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,f=n.preserveVertices;for(let u=0;u<d;u++)u===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(f?0:ct(c[0],n)),a[1]+(f?0:ct(c[0],n))]}),h=f?[o,s]:[o+ct(c[u],n),s+ct(c[u],n)],l.push({op:"bcurveTo",data:[e+ct(c[u],n),t+ct(c[u],n),r+ct(c[u],n),i+ct(c[u],n),h[0],h[1]]});return l}function Ji(e){return[...e]}function ad(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Ji(e[0]),Ji(e[1]),Ji(e[2]),Ji(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(Ji(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*o[n+1][0]-a*o[n-1][0])/6,l[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function ps(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function X_(e,t,r){const i=ps(t,r);if(i===0)return ps(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),ps(e,Br(t,r,o))}function Br(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function nl(e,t,r,i){const o=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],f=n[l+3];let u=3*h[0]-2*c[0]-f[0];u*=u;let g=3*h[1]-2*c[1]-f[1];g*=g;let m=3*d[0]-2*f[0]-c[0];m*=m;let y=3*d[1]-2*f[1]-c[1];return y*=y,u<m&&(u=m),g<y&&(g=y),u+g})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(ps(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=Br(l,c,.5),u=Br(c,h,.5),g=Br(h,d,.5),m=Br(f,u,.5),y=Br(u,g,.5),x=Br(m,y,.5);nl([l,f,m,x],0,r,o),nl([x,y,g,d],0,r,o)}var s,a;return o}function V_(e,t){return Vs(e,0,e.length,t)}function Vs(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=X_(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Vs(e,t,c+1,i,s),Vs(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function Ja(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)nl(e,3*s,t,i);return r&&r>0?Vs(i,0,i.length,r):i}const ue="none";class Ks{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[Om(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=U_(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(Qa([c],a)):n.push(Kr([c],a))}return a.stroke!==ue&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=Rm(i,o,a),c=sl(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=sl(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Kr([c.estimatedPoints],a));return a.stroke!==ue&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[gs(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=ed(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=ed(t,r,i,o,s,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,g,m,y,x,C){const w=f,S=u;let v=Math.abs(g/2),_=Math.abs(m/2);v+=ct(.01*v,C),_+=ct(.01*_,C);let E=y,B=x;for(;E<0;)E+=2*Math.PI,B+=2*Math.PI;B-E>2*Math.PI&&(E=0,B=2*Math.PI);const D=(B-E)/C.curveStepCount,M=[];for(let P=E;P<=B;P+=D)M.push([w+v*Math.cos(P),S+_*Math.sin(P)]);return M.push([w+v*Math.cos(B),S+_*Math.sin(B)]),M.push([w,S]),Kr([M],C)})(t,r,i,o,s,a,c));return c.stroke!==ue&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=td(t,i);if(i.fill&&i.fill!==ue)if(i.fillStyle==="solid"){const a=td(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...Ja(ad([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Ja(ad(c),10,(1+i.roughness)/2))}a.length&&o.push(Kr([a],i))}return i.stroke!==ue&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=gs(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Qa([t],i)):o.push(Kr([t],i))),i.stroke!==ue&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ue,a=i.stroke!==ue,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=Mm(Am(Lh(h))),g=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...Ja(x,d)),x=[]},w=()=>{C(),m.length&&(g.push(m),m=[])};for(const{key:v,data:_}of u)switch(v){case"M":w(),y=[_[0],_[1]],m.push(y);break;case"L":C(),m.push([_[0],_[1]]);break;case"C":if(!x.length){const E=m.length?m[m.length-1]:y;x.push([E[0],E[1]])}x.push([_[0],_[1]]),x.push([_[2],_[3]]),x.push([_[4],_[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(w(),!f)return g;const S=[];for(const v of g){const _=V_(v,f);_.length&&S.push(_)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=rd(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=rd(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(Qa(l,i));else o.push(Kr(l,i));return a&&(n?l.forEach((h=>{o.push(gs(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ue};break;case"fillPath":a={d:this.opsToPath(s),stroke:ue,strokeWidth:0,fill:i.fill||ue};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ue,strokeWidth:i,fill:ue}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class K_{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Ks(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const ts="http://www.w3.org/2000/svg";class Z_{constructor(t,r){this.svg=t,this.gen=new Ks(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(ts,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(ts,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(ts,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(ts,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var rt={canvas:(e,t)=>new K_(e,t),svg:(e,t)=>new Z_(e,t),generator:e=>new Ks(e),newSeed:()=>Ks.newSeed()},ht=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ye(kt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Gt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await Oe(a,Ce(gr(n),kt()),{useHtmlLabels:o,width:t.width||kt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},kt());let d=h.getBBox();const f=(t?.padding??0)/2;if(o){const u=h.children[0],g=yt(h);await mh(u,n),d=u.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),tn=p(async(e,t,r)=>{const i=r.useHtmlLabels??ee(kt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Oe(o,Ce(gr(t),kt()),{useHtmlLabels:i,width:r.width||kt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(ee(kt())){const l=s.children[0],c=yt(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),st=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),lt=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function bt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(bt,"createPathFromPoints");function mr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const g=u/50,m=e+g*l,y=f+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}p(mr,"generateFullSineWavePoints");function Lo(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(Lo,"generateCirclePoints");function ll(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}p(ll,"mergePaths");var Q_=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),Hr=Q_,J_=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=kt(),n=ee(a);return await Oe(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),lr=J_,yr=p((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),tB=p(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=ot(t),f=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),u=Ye(r.flowchart.htmlLabels),g=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Oe(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let x=y.getBBox();if(u){const N=y.children[0],q=yt(y);x=N.getBoundingClientRect(),q.attr("width",x.width),q.attr("height",x.height)}const C=t.padding??0,w=t.width<=x.width+C?x.width+C:t.width;t.width<=x.width+C?t.diff=(w-t.width)/2-C:t.diff=-C;const S=t.height,v=t.y-S/2,_=t.y+S/2,E=t.x-w/2,B=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+S/3,D=g?4:0,M=x.height+2*D;let P,U;if(g){const N=Math.max(M,x.height+2*D),q=E+N,A=Math.max(0,w-N);if(t.look==="handDrawn"){const F=rt.svg(f),R=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),j=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),T=F.rectangle(E,v,N,S,R);P=f.insert(()=>T,":first-child");const W=F.rectangle(q,v,A,S,j);U=f.insert(()=>W,":first-child"),P.select("path:nth-child(2)").attr("style",h.join(";")),P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else P=f.insert("rect",":first-child"),U=f.insert("rect",":first-child"),P.attr("class","swimlane-title").attr("style",c).attr("x",E).attr("y",v).attr("width",N).attr("height",S).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",q).attr("y",v).attr("width",A).attr("height",S).attr("fill","none").attr("stroke",n);const $=E+N/2,O=t.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const N=Math.max(0,B-v),q=Math.min(M,N),A=v+q,$=Math.max(0,_-A),O=t.x-w/2;if(t.look==="handDrawn"){const j=rt.svg(f),T=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),W=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),z=j.rectangle(O,v,w,q,T);P=f.insert(()=>z,":first-child");const X=j.rectangle(O,A,w,$,W);U=f.insert(()=>X,":first-child"),P.select("path:nth-child(2)").attr("style",h.join(";")),P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else P=f.insert("rect",":first-child"),U=f.insert("rect",":first-child"),P.attr("class","swimlane-title").attr("style",c).attr("x",O).attr("y",v).attr("width",w).attr("height",q).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",O).attr("y",A).attr("width",w).attr("height",$).attr("fill","none").attr("stroke",n);const F=t.x-x.width/2,R=v+(q-x.height)/2;m.attr("transform",`translate(${F}, ${R})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const N=m.select("span");N&&N.attr("style",l)}return t.offsetX=0,t.width=w,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(N){return Hr(t,N)},{cluster:f,labelBBox:x}},"swimlane"),Pm=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ot(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ee(r),u=d.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await Oe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await lr(u,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(ee(r)){const E=g.children[0],B=yt(g);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,w=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),D=E.path(yr(C,w,y,x,0),B);S=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",w).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=xa(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=u.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Hr(t,E)},{cluster:d,labelBBox:m}},"rect"),eB=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return Hr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),rB=p(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await lr(d,t.label,t.labelStyle,void 0,!0);let g=u.getBBox();if(ee(r)){const D=u.children[0],M=yt(u);g=D.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}const m=0*t.padding,y=m/2,x=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height+m,w=t.height+m-g.height-6,S=t.x-x/2,v=t.y-C/2;t.width=x;const _=t.y-t.height/2-y+g.height+2;let E;if(t.look==="handDrawn"){const D=t.cssClasses.includes("statediagram-cluster-alt"),M=rt.svg(c),P=t.rx||t.ry?M.path(yr(S,v,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):M.rectangle(S,v,x,C,{seed:o});E=c.insert(()=>P,":first-child");const U=M.rectangle(S,_,x,w,{fill:D?s:a,fillStyle:D?"hachure":"solid",stroke:l,seed:o});E=c.insert(()=>P,":first-child"),f=c.insert(()=>U)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",S).attr("y",v).attr("width",x).attr("height",C).attr("data-look",t.look),f.attr("class","inner").attr("x",S).attr("y",_).attr("width",x).attr("height",w);d.attr("transform",`translate(${t.x-g.width/2}, ${v+1-(ee(r)?0:3)})`);const B=E.node().getBBox();return t.height=B.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(D){return Hr(t,D)},{cluster:c,labelBBox:g}},"roundedWithTitle"),iB=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ot(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ee(r),u=d.insert("g").attr("class","cluster-label "),g=await Oe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(ee(r)){const E=g.children[0],B=yt(g);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,w=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),D=E.path(yr(C,w,y,x,t.rx),B);S=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",w).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=xa(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=u.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Hr(t,E)},{cluster:d,labelBBox:m}},"kanbanSection"),oB=p((e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=rt.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});u=a.insert(()=>y,":first-child")}else{u=n.insert("rect",":first-child");let m="outer";t.look,m="divider",u.attr("class",m).attr("x",d).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look)}const g=u.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Hr(t,m)},{cluster:a,labelBBox:{}}},"divider"),sB=Pm,aB={rect:Pm,squareRect:sB,roundedWithTitle:rB,noteGroup:eB,divider:oB,kanbanSection:iB,swimlane:tB},Dm=new Map,Nm=p(async(e,t)=>{const r=t.shape||"rect",i=await aB[r](e,t);return Dm.set(t.id,i),i},"insertCluster"),nB=p(()=>{Dm=new Map},"clear");function qm(e,t){return e.intersect(t)}p(qm,"intersectNode");var lB=qm;function zm(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<s&&(h=-h),{x:o+c,y:s+h}}p(zm,"intersectEllipse");var jm=zm;function Wm(e,t,r){return jm(e,t,t,r)}p(Wm,"intersectCircle");var hB=Wm;function Hm(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,l=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&l!==0&&hl(n,l))return;const h=i.y-r.y,d=r.x-i.x,f=i.x*r.y-r.x*i.y,u=h*e.x+d*e.y+f,g=h*t.x+d*t.y+f;if(Math.abs(u)<c&&Math.abs(g)<c&&hl(u,g))return;const m=o*d-h*s;if(m===0)return;const y=Math.abs(m/2);let x=s*f-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-o*f;const w=x<0?(x-y)/m:(x+y)/m;return{x:C,y:w}}}p(Hm,"intersectLine");function hl(e,t){return e*t>0}p(hl,"sameSign");var cB=Hm;function Ym(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],f=t[h<t.length-1?h+1:0],u=cB(e,r,{x:l+d.x,y:c+d.y},{x:l+f.x,y:c+f.y});u&&s.push(u)}return s.length?(s.length>1&&s.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,g=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y);return g<x?-1:g===x?0:1}),s[0]):e}p(Ym,"intersectPolygon");var dB=Ym,tt={node:lB,circle:hB,ellipse:jm,polygon:dB,rect:Hr};function Um(e,t){const{labelStyles:r}=ot(t);t.labelStyle=r;const i=lt(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=rt.svg(s),c=et(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=s.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Gt(n)),st(t,d),t.intersect=function(f){return V.info("Circle intersect",t,a,f),tt.circle(t,a,f)},s}p(Um,"anchor");function cl(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/o,g=f/s,m=Math.sqrt(u**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*s*Math.sin(h)*(a?-1:1),C=c-y*o*Math.cos(h)*(a?-1:1),w=Math.atan2((t-C)/s,(e-x)/o);let v=Math.atan2((i-C)/s,(r-x)/o)-w;a&&v<0&&(v+=2*Math.PI),!a&&v>0&&(v-=2*Math.PI);const _=[];for(let E=0;E<20;E++){const B=E/19,D=w+B*v,M=x+o*Math.cos(D),P=C+s*Math.sin(D);_.push({x:M,y:P})}return _}p(cl,"generateArcPoints");function Gm(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(Gm,"calculateArcSagitta");async function Xm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=p(D=>D+a,"calcTotalHeight"),l=p(D=>{const M=D/2;return[M/(2.5+D/50),M]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),g=Gm(d,f,u),y=(t?.width?t?.width:h.width)+s*2+g-g,x=d,{cssStyles:C}=t,w=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...cl(-y/2,-x/2,-y/2,x/2,f,u,!1),{x:y/2,y:x/2},...cl(y/2,x/2,y/2,-x/2,f,u,!0)],S=rt.svg(c),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=bt(w),E=S.path(_,v),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${f/2}, 0)`),st(t,B),t.intersect=function(D){return tt.polygon(t,w,D)},c}p(Xm,"bowTieRect");function or(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(or,"insertPolygonShape");var es=12;async function Vm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+es),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,g=0,m=[{x:d+es,y:u},{x:f,y:u},{x:f,y:g},{x:d,y:g},{x:d,y:u+es},{x:d+es,y:u}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),w=et(t,{}),S=bt(m),v=C.path(S,w);y=n.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=or(n,c,h,m);return i&&y.attr("style",i),st(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},n}p(Vm,"card");function Km(e,t){const{nodeStyles:r}=ot(t);t.label="";const i=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=rt.svg(i),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=bt(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return tt.polygon(t,a,f)},i}p(Km,"choice");async function Eh(e,t,r){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await ht(e,t,lt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(s),g=et(t,{}),m=u.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Gt(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return st(t,d),t.calcIntersect=function(u,g){const m=u.width/2;return tt.circle(u,m,g)},t.intersect=function(u){return V.info("Circle intersect",t,h,u),tt.circle(t,h,u)},s}p(Eh,"circle");function Zm(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y}
|
|
233
|
+
M ${o.x},${o.y} L ${a.x},${a.y}`}p(Zm,"createLine");function Qm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(o),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=Zm(s),d=n.path(h,l),f=o.insert(()=>c,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),st(t,f),t.intersect=function(u){return V.info("crossedCircle intersect",t,{radius:s,point:u}),tt.circle(t,s,u)},o}p(Qm,"crossedCircle");function Ke(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(Ke,"generateCirclePoints");async function Jm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+n,h=s.height+l,d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Ke(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Ke(c/2+d*2,-d,d,20,-180,-270),...Ke(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Ke(c/2,h/2,d,20,0,90)],g=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Ke(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Ke(c/2+c*.1,-d,d,20,-180,-270),...Ke(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Ke(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],m=rt.svg(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),w=m.path(C,y),S=bt(g),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>w,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,g,E)},o}p(Jm,"curlyBraceLeft");function Ze(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:u,y:g})}return a}p(Ze,"generateCirclePoints");async function ty(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Ze(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Ze(c/2+d*2,-d,d,20,-180,-270),...Ze(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Ze(c/2,h/2,d,20,0,90)],g=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...Ze(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Ze(c/2+d*2,-d,d,20,-180,-270),...Ze(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Ze(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],m=rt.svg(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),w=m.path(C,y),S=bt(g),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>w,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,g,E)},o}p(ty,"curlyBraceRight");function Kt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(Kt,"generateCirclePoints");async function ey(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Kt(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Kt(c/2+d*2,-d,d,20,-180,-270),...Kt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Kt(c/2,h/2,d,20,0,90)],g=[...Kt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Kt(-c/2-d/2,-d,d,20,0,90),...Kt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Kt(-c/2+d+d/2,h/2,d,30,-180,-270)],m=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Kt(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Kt(c/2+d*2,-d,d,20,-180,-270),...Kt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Kt(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2-d-d/2,y:h/2+d},...Kt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Kt(-c/2-d/2,-d,d,20,0,90),...Kt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Kt(-c/2+d+d/2,h/2,d,30,-180,-270)],y=rt.svg(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=bt(u).replace("Z",""),S=y.path(w,x),_=bt(g).replace("Z",""),E=y.path(_,x),B=bt(m),D=y.path(B,{...x}),M=o.insert("g",":first-child");return M.insert(()=>D,":first-child").attr("stroke-opacity",0),M.insert(()=>S,":first-child"),M.insert(()=>E,":first-child"),M.attr("class","text"),f&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,M),t.intersect=function(P){return tt.polygon(t,m,P)},o}p(ey,"curlyBraces");async function ry(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:g}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=f,w=x-u,S=C/4,v=[{x:w,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:w,y:C},...Lo(-w,-C/2,u,50,270,90)],_=bt(v),E=m.path(_,y),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-d/2}, ${-f/2})`),st(t,B),t.intersect=function(D){return tt.polygon(t,v,D)},c}p(ry,"curvedTrapezoid");var uB=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),fB=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),gB=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),nd=8,ld=8;async function iy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<ld&&(t.width=ld);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<nd&&(t.height=nd)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t.width?t.width:l.width)+a,d=h/2,f=d/(2.5+h/50),u=(t.height?t.height:l.height)+s+f;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=rt.svg(n),x=fB(0,0,h,u,d,f),C=gB(0,f,h,u,d,f),w=et(t,{}),S=y.path(x,w),v=y.path(C,et(t,{fill:"none"}));g=n.insert(()=>v,":first-child"),g=n.insert(()=>S,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=uB(0,0,h,u,d,f);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Gt(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),st(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const x=tt.rect(t,y),C=x.x-(t.x??0);if(d!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-f)){let w=f*f*(1-C*C/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(t.y??0)>0&&(w=-w),x.y+=w}return x},n}p(iy,"cylinder");async function zi(e,t,r){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await ht(e,t,lt(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:f,ry:u}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=rt.svg(s),y=et(t,{}),x=f||u?m.path(yr(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Gt(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Gt(f)).attr("ry",Gt(u)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return st(t,d),t.calcIntersect=function(m,y){return tt.rect(m,y)},t.intersect=function(m){return tt.rect(t,m)},s}p(zi,"drawRect");async function oy(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await zi(e,t,l);if(t.look==="handDrawn"){const u=rt.svg(c),g=et(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let x=null;if(y instanceof SVGGraphicsElement)x=y.getBBox();else return c;return c.insert(()=>u.line(x.x,x.y,x.x+x.width,x.y,g),".basic.label-container g.label"),c.insert(()=>u.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,g),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||n)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}p(oy,"datastore");async function sy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=n.width+o,h=n.height+s,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:g}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],C=m.polygon(x.map(S=>[S.x,S.y]),y),w=a.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+d+(t.padding??0)/2-(n.y-(n.top??0))})`),st(t,w),t.intersect=function(S){return tt.rect(t,S)},a}p(sy,"dividedRectangle");async function ay(e,t){const{labelStyles:r,nodeStyles:i}=ot(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(n),g=et(t,{roughness:.2,strokeWidth:2.5}),m=et(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,g),x=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Gt(t.cssClasses)).attr("style",Gt(f)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),g=d.insert("circle");d.attr("class","basic label-container").attr("style",i),u.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return st(t,d),t.intersect=function(u){return V.info("DoubleCircle intersect",t,c,u),tt.circle(t,c,u)},n}p(ay,"doublecircle");function ny(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=rt.svg(s),{nodeBorder:c}=r,h=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),st(t,f),t.intersect=function(u){return V.info("filledCircle intersect",t,{radius:a,point:u}),tt.circle(t,a,u)},s}p(ny,"filledCircle");var hd=10,cd=10;async function ly(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<hd&&(t.height=hd),t.width=(t?.width??0)-s-s/2,t.width<cd&&(t.width=cd));const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width:n.width)+(s??0),h=t?.height?t?.height:c+n.height,d=h,f=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:u}=t,g=rt.svg(a),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(f),x=g.path(y,m),C=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return u&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=c,t.height=h,st(t,C),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(w){return V.info("Triangle intersect",t,f,w),tt.polygon(t,f,w)},a}p(ly,"flippedTriangle");function hy(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=ot(t);t.label="";const a=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=rt.svg(a),u=et(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const g=f.rectangle(h,d,l,c,u),m=a.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),st(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(x){return tt.rect(t,x)},a}p(hy,"forkJoin");async function cy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,f=d/2,{cssStyles:u}=t,g=rt.svg(l),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2,y:-d/2},{x:h/2-f,y:-d/2},...Lo(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],x=bt(y),C=g.path(x,m),w=l.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),st(t,w),t.intersect=function(S){return V.info("Pill intersect",t,{radius:f,point:S}),tt.polygon(t,y,S)},l}p(cy,"halfRoundedRectangle");var pB=p((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function dy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const w=(t.height??0)/o;t.width=(t?.width??0)-2*w-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await ht(e,t,lt(t)),f=(t?.height?t?.height:d.height)+l,u=f/o,g=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:g-u,y:0},{x:g,y:-f/2},{x:g-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),w=et(t,{}),S=pB(0,0,g,f,u),v=C.path(S,w);y=h.insert(()=>v,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),x&&y.attr("style",x)}else y=or(h,g,f,m);return i&&y.attr("style",i),t.width=g,t.height=f,st(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}p(dy,"hexagon");async function uy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await ht(e,t,lt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=rt.svg(o),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=bt(h),f=l.path(d,c),u=o.insert(()=>f,":first-child");return u.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",i),u.attr("transform",`translate(${-s/2}, ${-a/2})`),st(t,u),t.intersect=function(g){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,g)},o}p(uy,"hourglass");async function fy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ht(e,t,"icon-shape default"),f=t.pos==="t",u=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=Ni(t),x=-g/2,C=-u/2,w=t.label?8:0,S=rt.svg(c),v=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=S.rectangle(x,C,g,u,v),E=Math.max(g,h.width),B=u+h.height+w,D=S.rectangle(-E/2,-B/2,E,B,{...v,fill:"transparent",stroke:"none"}),M=c.insert(()=>_,":first-child"),P=c.insert(()=>D);if(t.icon){const U=c.append("g");U.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const N=U.node().getBBox(),q=N.width,A=N.height,$=N.x,O=N.y;U.attr("transform",`translate(${-q/2-$},${f?h.height/2+w/2-A/2-O:-h.height/2-w/2-A/2-O})`),U.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-B/2:B/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+w/2:-h.height/2-w/2})`),st(t,P),t.intersect=function(U){if(V.info("iconSquare intersect",t,U),!t.label)return tt.rect(t,U);const N=t.x??0,q=t.y??0,A=t.height??0;let $=[];return f?$=[{x:N-h.width/2,y:q-A/2},{x:N+h.width/2,y:q-A/2},{x:N+h.width/2,y:q-A/2+h.height+w},{x:N+g/2,y:q-A/2+h.height+w},{x:N+g/2,y:q+A/2},{x:N-g/2,y:q+A/2},{x:N-g/2,y:q-A/2+h.height+w},{x:N-h.width/2,y:q-A/2+h.height+w}]:$=[{x:N-g/2,y:q-A/2},{x:N+g/2,y:q-A/2},{x:N+g/2,y:q-A/2+u},{x:N+h.width/2,y:q-A/2+u},{x:N+h.width/2/2,y:q+A/2},{x:N-h.width/2,y:q+A/2},{x:N-h.width/2,y:q-A/2+u},{x:N-g/2,y:q-A/2+u}],tt.polygon(t,$,U)},c}p(fy,"icon");async function gy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ht(e,t,"icon-shape default"),f=20,u=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Ni(t),C=rt.svg(c),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=x.get("fill");w.stroke=S??y;const v=c.append("g");t.icon&&v.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const _=v.node().getBBox(),E=_.width,B=_.height,D=_.x,M=_.y,P=Math.max(E,B)*Math.SQRT2+f*2,U=C.circle(0,0,P,w),N=Math.max(P,h.width),q=P+h.height+u,A=C.rectangle(-N/2,-q/2,N,q,{...w,fill:"transparent",stroke:"none"}),$=c.insert(()=>U,":first-child"),O=c.insert(()=>A);return v.attr("transform",`translate(${-E/2-D},${g?h.height/2+u/2-B/2-M:-h.height/2-u/2-B/2-M})`),v.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-q/2:q/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+u/2:-h.height/2-u/2})`),st(t,O),t.intersect=function(F){return V.info("iconSquare intersect",t,F),tt.rect(t,F)},c}p(gy,"iconCircle");async function py(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await ht(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ni(t),w=-m/2,S=-g/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const D=_.path(yr(w,S,m,g,5),E),M=Math.max(m,h.width),P=g+h.height+v,U=_.rectangle(-M/2,-P/2,M,P,{...E,fill:"transparent",stroke:"none"}),N=c.insert(()=>D,":first-child").attr("class","icon-shape2"),q=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=A.node().getBBox(),O=$.width,F=$.height,R=$.x,j=$.y;A.attr("transform",`translate(${-O/2-R},${u?h.height/2+v/2-F/2-j:-h.height/2-v/2-F/2-j})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-P/2:P/2-h.height})`),N.attr("transform",`translate(0,${u?h.height/2+v/2:-h.height/2-v/2})`),st(t,q),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const $=t.x??0,O=t.y??0,F=t.height??0;let R=[];return u?R=[{x:$-h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2+h.height+v},{x:$+m/2,y:O-F/2+h.height+v},{x:$+m/2,y:O+F/2},{x:$-m/2,y:O+F/2},{x:$-m/2,y:O-F/2+h.height+v},{x:$-h.width/2,y:O-F/2+h.height+v}]:R=[{x:$-m/2,y:O-F/2},{x:$+m/2,y:O-F/2},{x:$+m/2,y:O-F/2+g},{x:$+h.width/2,y:O-F/2+g},{x:$+h.width/2/2,y:O+F/2},{x:$-h.width/2,y:O+F/2},{x:$-h.width/2,y:O-F/2+g},{x:$-m/2,y:O-F/2+g}],tt.polygon(t,R,A)},c}p(py,"iconRounded");async function my(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await ht(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ni(t),w=-m/2,S=-g/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const D=_.path(yr(w,S,m,g,.1),E),M=Math.max(m,h.width),P=g+h.height+v,U=_.rectangle(-M/2,-P/2,M,P,{...E,fill:"transparent",stroke:"none"}),N=c.insert(()=>D,":first-child"),q=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=A.node().getBBox(),O=$.width,F=$.height,R=$.x,j=$.y;A.attr("transform",`translate(${-O/2-R},${u?h.height/2+v/2-F/2-j:-h.height/2-v/2-F/2-j})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-P/2:P/2-h.height})`),N.attr("transform",`translate(0,${u?h.height/2+v/2:-h.height/2-v/2})`),st(t,q),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const $=t.x??0,O=t.y??0,F=t.height??0;let R=[];return u?R=[{x:$-h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2+h.height+v},{x:$+m/2,y:O-F/2+h.height+v},{x:$+m/2,y:O+F/2},{x:$-m/2,y:O+F/2},{x:$-m/2,y:O-F/2+h.height+v},{x:$-h.width/2,y:O-F/2+h.height+v}]:R=[{x:$-m/2,y:O-F/2},{x:$+m/2,y:O-F/2},{x:$+m/2,y:O-F/2+g},{x:$+h.width/2,y:O-F/2+g},{x:$+h.width/2/2,y:O+F/2},{x:$-h.width/2,y:O+F/2},{x:$-h.width/2,y:O-F/2+g},{x:$-m/2,y:O-F/2+g}],tt.polygon(t,R,A)},c}p(my,"iconSquare");async function yy(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=ot(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await ht(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,C=rt.svg(d),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=C.rectangle(m,y,c,h,w),v=Math.max(c,f.width),_=h+f.height+x,E=C.rectangle(-v/2,-_/2,v,_,{...w,fill:"none",stroke:"none"}),B=d.insert(()=>S,":first-child"),D=d.insert(()=>E);if(t.img){const M=d.append("image");M.attr("href",t.img),M.attr("width",c),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-c/2},${g?_/2-h:-_/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),B.attr("transform",`translate(0,${g?f.height/2+x/2:-f.height/2-x/2})`),st(t,D),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return tt.rect(t,M);const P=t.x??0,U=t.y??0,N=t.height??0;let q=[];return g?q=[{x:P-f.width/2,y:U-N/2},{x:P+f.width/2,y:U-N/2},{x:P+f.width/2,y:U-N/2+f.height+x},{x:P+c/2,y:U-N/2+f.height+x},{x:P+c/2,y:U+N/2},{x:P-c/2,y:U+N/2},{x:P-c/2,y:U-N/2+f.height+x},{x:P-f.width/2,y:U-N/2+f.height+x}]:q=[{x:P-c/2,y:U-N/2},{x:P+c/2,y:U-N/2},{x:P+c/2,y:U-N/2+h},{x:P+f.width/2,y:U-N/2+h},{x:P+f.width/2/2,y:U+N/2},{x:P-f.width/2,y:U+N/2},{x:P-f.width/2,y:U-N/2+h},{x:P-c/2,y:U-N/2+h}],tt.polygon(t,q,M)},d}p(yy,"imageSquare");async function xy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=or(n,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,st(t,f),t.intersect=function(g){return tt.polygon(t,d,g)},n}p(xy,"inv_trapezoid");async function Cy(e,t){const{shapeSvg:r,bbox:i,label:o}=await ht(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),st(t,s),t.intersect=function(l){return tt.rect(t,l)},r}p(Cy,"labelRect");async function by(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=or(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,st(t,f),t.intersect=function(g){return tt.polygon(t,d,g)},n}p(by,"lean_left");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=or(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,st(t,f),t.intersect=function(g){return tt.polygon(t,d,g)},n}p(ky,"lean_right");function wy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=rt.svg(o),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=bt(c),u=h.path(f,d),g=o.insert(()=>u,":first-child");return g.attr("class","outer-path"),s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${a/2},${-n})`),st(t,g),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},o}p(wy,"lightningBolt");var mB=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),yB=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),xB=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),dd=10,ud=10;async function Sy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-s,t.width<ud&&(t.width=ud);const w=x/2/(2.5+x/50);t.height=(t.height??0)-a-w*3,t.height<dd&&(t.height=dd)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+s*2,d=h/2,f=d/(2.5+h/50),u=(t?.height?t?.height:l.height)+f+a*2,g=u*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=rt.svg(n),C=yB(0,0,h,u,d,f,g),w=xB(0,f,h,u,d,f),S=et(t,{}),v=x.path(C,S),_=x.path(w,S);n.insert(()=>_,":first-child").attr("class","line"),m=n.insert(()=>v,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=mB(0,0,h,u,d,f,g);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Gt(y)).attr("style",i)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),st(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(x){const C=tt.rect(t,x),w=C.x-(t.x??0);if(d!=0&&(Math.abs(w)<(t.width??0)/2||Math.abs(w)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let S=f*f*(1-w*w/(d*d));S>0&&(S=Math.sqrt(S)),S=f-S,x.y-(t.y??0)>0&&(S=-S),C.y+=S}return C},n}p(Sy,"linedCylinder");async function vy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const S=t.width;t.width=(S??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:g}=t,m=rt.svg(n),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...mr(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],C=m.polygon(x.map(S=>[S.x,S.y]),y),w=n.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),w.attr("transform",`translate(0,${-f/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),st(t,w),t.intersect=function(S){return tt.polygon(t,x,S)},n}p(vy,"linedWaveEdgedRect");async function Ty(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await ht(e,t,lt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,g=f-2*n,m=-u/2,y=-g/2,{cssStyles:x}=t,C=rt.svg(l),w=et(t,{}),S=[{x:m-n,y:y+n},{x:m-n,y:y+g+n},{x:m+u-n,y:y+g+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y:y+g-n},{x:m+u+n,y:y+g-n},{x:m+u+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],v=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const _=bt(S);let E=C.path(_,w);const B=bt(v);let D=C.path(B,w);t.look!=="handDrawn"&&(E=ll(E),D=ll(D));const M=l.insert("g",":first-child");return M.insert(()=>E),M.insert(()=>D),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),st(t,M),t.intersect=function(P){return tt.polygon(t,S,P)},l}p(Ty,"multiRect");async function _y(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(s.width,t?.width??0)+l*2,f=Math.max(s.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,g=f+(h?u/2:-u/2),m=-d/2,y=-g/2,x=10,{cssStyles:C}=t,w=mr(m-x,y+g+x,m+d-x,y+g+x,u,.8),S=w?.[w.length-1],v=[{x:m-x,y:y+x},{x:m-x,y:y+g+x},...w,{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y:S.y-2*x},{x:m+d+x,y:S.y-2*x},{x:m+d+x,y:y-x},{x:m+x,y:y-x},{x:m+x,y},{x:m,y},{x:m,y:y+x}],_=[{x:m,y:y+x},{x:m+d-x,y:y+x},{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y},{x:m,y}],E=rt.svg(o),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const D=bt(v),M=E.path(D,B),P=bt(_),U=E.path(P,B),N=o.insert(()=>M,":first-child");return N.insert(()=>U),N.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),N.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(s.width/2)-x-(s.x-(s.left??0))}, ${-(s.height/2)+x-u/2-(s.y-(s.top??0))})`),st(t,N),t.intersect=function(q){return tt.polygon(t,v,q)},o}p(_y,"multiWaveEdgedRectangle");async function By(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i,t.useHtmlLabels||ee(Ot())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,f=-h/2,{cssStyles:u}=t,g=rt.svg(a),m=et(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,c,h,m),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),u&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",u),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,x),t.intersect=function(C){return tt.rect(t,C)},a}p(By,"note");var CB=p((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ht(e,t,lt(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(o),g=et(t,{}),m=CB(0,0,l),y=u.path(m,g);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=or(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),st(t,d),t.calcIntersect=function(u,g){const m=u.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],x=tt.polygon(u,y,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}p(Ly,"question");async function Ey(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,g=u/2,m=[{x:f+g,y:u},{x:f,y:0},{x:f+g,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=bt(m),S=x.path(w,C),v=n.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),st(t,v),t.intersect=function(_){return tt.polygon(t,m,_)},n}p(Ey,"rect_left_inv_arrow");async function Fy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await lr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ee(kt())){const B=h.children[0],D=yt(h);d=B.getBoundingClientRect(),D.attr("width",d.width),D.attr("height",d.height)}V.info("Text 2",l);const f=l||[],u=h.getBBox(),g=await lr(n,Array.isArray(f)?f.join("<br/>"):f,t.labelStyle,!0,!0),m=g.children[0],y=yt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;yt(g).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+x+5)+")"),yt(h).attr("transform","translate( "+(d.width<u.width?0:-(u.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")");const C=d.width+(t.padding||0),w=d.height+(t.padding||0),S=-d.width/2-x,v=-d.height/2-x;let _,E;if(t.look==="handDrawn"){const B=rt.svg(s),D=et(t,{}),M=B.path(yr(S,v,C,w,t.rx||0),D),P=B.line(-d.width/2-x,-d.height/2-x+u.height+x,d.width/2+x,-d.height/2-x+u.height+x,D);E=s.insert(()=>(V.debug("Rough node insert CXC",M),P),":first-child"),_=s.insert(()=>(V.debug("Rough node insert CXC",M),M),":first-child")}else _=a.insert("rect",":first-child"),E=a.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),E.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+u.height+x).attr("y2",-d.height/2-x+u.height+x);return st(t,_),t.intersect=function(B){return tt.rect(t,B)},s}p(Fy,"rectWithTitle");async function Ay(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return zi(e,t,o)}p(Ay,"roundedRect");var Sr=8;async function My(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?Sr:Sr*2),h=(t?.height??n.height)+s*2,d=c-Sr,f=h,u=Sr-c/2,g=-h/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:u,y:g},{x:u+d,y:g},{x:u+d,y:g+f},{x:u-Sr,y:g+f},{x:u-Sr,y:g},{x:u,y:g},{x:u,y:g+f}],w=y.polygon(C.map(v=>[v.x,v.y]),x),S=a.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Gt(m)),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${Sr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,S),t.intersect=function(v){return tt.rect(t,v)},a}p(My,"shadedProcess");async function $y(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,g=-f/2,m=-u/2,{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=[{x:g,y:m},{x:g,y:m+u},{x:g+f,y:m+u},{x:g+f,y:m-u/2}],S=bt(w),v=x.path(S,C),_=n.insert(()=>v,":first-child");return _.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,w,E)},n}p($y,"slopedRect");async function Oy(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return zi(e,t,s)}p(Oy,"squareRect");async function Ry(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:f}=t,u=rt.svg(n),g=et(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...Lo(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Lo(h/2-d,0,d,50,270,450)],y=bt(m),x=u.path(y,g),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),st(t,C),t.intersect=function(w){return tt.polygon(t,m,w)},n}p(Ry,"stadium");async function Iy(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return zi(e,t,r)}p(Iy,"state");function Py(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=rt.svg(h),f=et(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),g=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>u,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),s&&x.selectAll("path").attr("style",s),o&&x.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const C=e.node()?.ownerSVGElement?.id??"",w=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${w})`)}return st(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}p(Py,"stateEnd");function Dy(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=rt.svg(s).circle(0,0,t.width,rT(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return st(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}p(Dy,"stateStart");var Zr=8;async function Ny(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width??l.width)+2*Zr+s,h=(t?.height??l.height)+a,d=c-2*Zr,f=h,u=-c/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=rt.svg(n),x=et(t,{}),C=y.rectangle(u,g,d+16,f,x),w=y.line(u+Zr,g,u+Zr,g+f,x),S=y.line(u+Zr+d,g,u+Zr+d,g+f,x);n.insert(()=>w,":first-child"),n.insert(()=>S,":first-child");const v=n.insert(()=>C,":first-child"),{cssStyles:_}=t;v.attr("class","basic label-container").attr("style",Gt(_)),st(t,v)}else{const y=or(n,d,f,m);i&&y.attr("style",i),st(t,y)}return t.intersect=function(y){return tt.polygon(t,m,y)},n}p(Ny,"subroutine");var en=.2;async function qy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-en*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height?t?.height:l.height)+a*2,h=en*c,d=en*c,u=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-u/2,y=-g/2,{cssStyles:x}=t,C=rt.svg(n),w=et(t,{}),S=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+g},{x:m-h/2,y:y+g}],v=[{x:m+u-h/2,y:y+g},{x:m+u+h/2,y:y+g},{x:m+u+h/2,y:y+g-d}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const _=bt(S),E=C.path(_,w),B=bt(v),D=C.path(B,{...w,fillStyle:"solid"}),M=n.insert(()=>D,":first-child");return M.insert(()=>E,":first-child"),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),st(t,M),t.intersect=function(P){return tt.polygon(t,S,P)},n}p(qy,"taggedRect");async function zy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,g=rt.svg(o),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...mr(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],x=-n/2+n/2*.1,C=-f/2-d*.4,w=[{x:x+n-h,y:(C+l)*1.3},{x:x+n,y:C+l-d},{x:x+n,y:(C+l)*.9},...mr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],S=bt(y),v=g.path(S,m),_=bt(w),E=g.path(_,{...m,fillStyle:"solid"}),B=o.insert(()=>E,":first-child");return B.insert(()=>v,":first-child"),B.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),st(t,B),t.intersect=function(D){return tt.polygon(t,y,D)},o}p(zy,"taggedWaveEdgedRectangle");async function jy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ht(e,t,lt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),st(t,h),t.intersect=function(d){return tt.rect(t,d)},o}p(jy,"text");var bB=p((e,t,r,i,o,s)=>`M${e},${t}
|
|
234
234
|
a${o},${s} 0,0,1 0,${-i}
|
|
235
235
|
l${r},0
|
|
236
236
|
a${o},${s} 0,0,1 0,${i}
|
|
237
237
|
M${r},${-i}
|
|
238
238
|
a${o},${s} 0,0,0 0,${i}
|
|
239
|
-
l${-r},0`,"createCylinderPathD"),
|
|
240
|
-
M${
|
|
241
|
-
M${f},${p-Rt} L${f},${p+u}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(k,x),v=a.insert(()=>S,":first-child");return v.attr("transform",`translate(${Rt/2}, ${Rt/2})`),v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Rt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Rt/2-(n.y-(n.top??0))})`),st(t,v),t.intersect=function(_){return tt.polygon(t,C,_)},a}g(Uy,"windowPane");var md=new Set(["redux-color","redux-dark-color"]),bB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Eh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Ot(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:K}=Ot(),{background:Q}=K,nt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Q}`]};await Eh(e,nt)}const c=Ot();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:u}=t,{labelStyles:f,nodeStyles:p}=ot(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};je(t.label,c)+K.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Q=await zi(e,t,K);if(i!=null&&md.has(i)){const nt=r.colorIndex??0;Q.attr("data-color-id",`color-${nt%l.length}`)}if(!Ye(c.htmlLabels)){const nt=Q.select("text"),gt=nt.node()?.getBBox();nt.attr("transform",`translate(${-gt.width/2}, 0)`)}return Q}c.htmlLabels||(h*=1.25,d*=1.25);let m=lt(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await ei(y,t.label??"",c,0,0,["name"],f);x.height+=d;let C=0;const k=[],S=[];let v=0,_=0,E=0,B=0,I=!0,M=!0;for(const K of r.attributes){const Q=await ei(y,K.type,c,0,C,["attribute-type"],f);v=Math.max(v,Q.width+h);const nt=await ei(y,K.name,c,0,C,["attribute-name"],f);_=Math.max(_,nt.width+h);const gt=await ei(y,K.keys.join(),c,0,C,["attribute-keys"],f);E=Math.max(E,gt.width+h);const ut=await ei(y,K.comment,c,0,C,["attribute-comment"],f);B=Math.max(B,ut.width+h);const mt=Math.max(Q.height,nt.height,gt.height,ut.height)+d;S.push({yOffset:C,rowHeight:mt}),C+=mt}let D=4;E<=h&&(I=!1,E=0,D--),B<=h&&(M=!1,B=0,D--);const U=y.node().getBBox();if(x.width+h*2-(v+_+E+B)>0){const K=x.width+h*2-(v+_+E+B);v+=K/D,_+=K/D,E>0&&(E+=K/D),B>0&&(B+=K/D)}const q=v+_+E+B,N=rt.svg(y),A=et(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let F=0;S.length>0&&(F=S.reduce((K,Q)=>K+(Q?.rowHeight??0),0));const P=Math.max(U.width+h*2,t?.width||0,q),O=Math.max((F??0)+x.height,t?.height||0),$=-P/2,j=-O/2;if(y.selectAll("g:not(:first-child)").each((K,Q,nt)=>{const gt=yt(nt[Q]),ut=gt.attr("transform");let mt=0,Lt=0;if(ut){const Mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ut);Mt&&(mt=parseFloat(Mt[1]),Lt=parseFloat(Mt[2]),gt.attr("class").includes("attribute-name")?mt+=v:gt.attr("class").includes("attribute-keys")?mt+=v+_:gt.attr("class").includes("attribute-comment")&&(mt+=v+_+E))}gt.attr("transform",`translate(${$+h/2+mt}, ${Lt+j+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(j+d/2)+")"),i!=null&&md.has(i)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const T=N.rectangle($,j,P,O,A),W=y.insert(()=>T,":first-child").attr("class","outer-path").attr("style",u.join(""));k.push(0);for(const[K,Q]of S.entries()){const gt=(K+1)%2===0&&Q.yOffset!==0,ut=N.rectangle($,x.height+j+Q?.yOffset,P,Q?.rowHeight,{...A,fill:gt?s:a,stroke:n});y.insert(()=>ut,"g.label").attr("style",u.join("")).attr("class",`row-rect-${gt?"even":"odd"}`)}const z=1e-4;let G=ri($,x.height+j,P+$,x.height+j,z),X=N.polygon(G.map(K=>[K.x,K.y]),A);if(y.insert(()=>X).attr("class","divider"),G=ri(v+$,x.height+j,v+$,O+j,z),X=N.polygon(G.map(K=>[K.x,K.y]),A),y.insert(()=>X).attr("class","divider"),I){const K=v+_+$;G=ri(K,x.height+j,K,O+j,z),X=N.polygon(G.map(Q=>[Q.x,Q.y]),A),y.insert(()=>X).attr("class","divider")}if(M){const K=v+_+E+$;G=ri(K,x.height+j,K,O+j,z),X=N.polygon(G.map(Q=>[Q.x,Q.y]),A),y.insert(()=>X).attr("class","divider")}for(const K of k){const Q=x.height+j+K;G=ri($,Q,P+$,Q,z),X=N.polygon(G.map(nt=>[nt.x,nt.y]),A),y.insert(()=>X).attr("class","divider")}if(st(t,W),p&&t.look!=="handDrawn")if(i!=null&&bB.has(i))y.selectAll("path").attr("style",p);else{const Q=p.split(";")?.filter(nt=>nt.includes("stroke"))?.map(nt=>`${nt}`).join("; ");y.selectAll("path").attr("style",Q??""),y.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(K){return tt.rect(t,K)},y}g(Eh,"erBox");async function ei(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==xn(t)&&(t=xn(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await Oe(n,t,{width:je(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(Ye(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=yt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}g(ei,"addText");function ri(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}g(ri,"lineToPolygon");async function Xy(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",lt(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,u=0,f=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await lo(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await lo(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();u=p.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const k=await lo(c,C,m,[C.parseClassifier()]);m+=k+s}f=c.node().getBBox().height,f<=0&&(f=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const k=await lo(h,C,y,[C.parseClassifier()]);y+=k+s}let x=a.node().getBBox();if(n!==null){const C=n.node().getBBox();n.attr("transform",`translate(${-C.width/2})`)}return l.attr("transform",`translate(${-p.width/2}, ${d})`),x=a.node().getBBox(),c.attr("transform",`translate(0, ${d+u+o*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+u+(f?f+o*4:o*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}g(Xy,"textHelper");async function lo(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Ot();let a="useHtmlLabels"in t?t.useHtmlLabels:Ye(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Li(n)&&(a=!0);const l=await Oe(o,Il(pr(n)),{width:je(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],u=yt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const f=d.getElementsByTagName("img");if(f){const p=n.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",p){const C=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,S=parseInt(C,10)*5+"px";m.style.minWidth=S,m.style.maxWidth=S}else m.style.width="100%";y(m)}g(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}c=d.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}else{i.includes("font-weight: bolder")&&yt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}g(lo,"addText");async function Gy(e,t){const r=kt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ye(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Xy(e,t,r,n,a),{labelStyles:d,nodeStyles:u}=ot(t);t.labelStyle=d,t.cssStyles=l.styles||"";const f=l.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=f.replaceAll("!important","").split(";"));const p=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Math.max(t.width??0,h.width);let C=Math.max(t.height??0,h.height);const k=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?C+=a:l.members.length>0&&l.methods.length===0&&(C+=a*2);const S=-x/2,v=-C/2;let _=p?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(_=s*2);const E=m.rectangle(S-s,v-s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+_,y),B=c.insert(()=>E,":first-child");B.attr("class","basic label-container outer-path");const I=B.node().getBBox(),M=c.select(".annotation-group").node().getBBox().height-(p?s/2:0)||0,D=c.select(".label-group").node().getBBox().height-(p?s/2:0)||0,U=c.select(".members-group").node().getBBox().height-(p?s/2:0)||0,q=(M+D+v+s-(v-s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((N,A,F)=>{const P=yt(F[A]),O=P.attr("transform");let $=0;if(O){const z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);z&&($=parseFloat(z[2]))}let j=$+v+s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(P.attr("class").includes("methods-group")){const W=Math.max(U,a/2);k?j=Math.max(q,M+D+W+v+a*2+s)+a*2:j=M+D+W+v+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?j=$-a:j=$),n||(j-=4);let T=S;(P.attr("class").includes("label-group")||P.attr("class").includes("annotation-group"))&&(T=-P.node()?.getBBox().width/2||0,c.selectAll("text").each(function(W,z,G){window.getComputedStyle(G[z]).textAnchor==="middle"&&(T=0)})),P.attr("transform",`translate(${T}, ${j})`)}),l.members.length>0||l.methods.length>0||p){const N=M+D+v+s,A=m.line(I.x,N,I.x+I.width,N+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(p||l.members.length>0||l.methods.length>0){const N=M+D+U+v+a*2+s,A=m.line(I.x,k?Math.max(q,N):N,I.x+I.width,(k?Math.max(q,N):N)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",f),B.select(":nth-child(2)").attr("style",f),c.selectAll(".divider").select("path").attr("style",f),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",f),!n){const N=RegExp(/color\s*:\s*([^;]*)/),A=N.exec(f);if(A){const F=A[0].replace("color","fill");c.selectAll("tspan").attr("style",F)}else if(d){const F=N.exec(d);if(F){const P=F[0].replace("color","fill");c.selectAll("tspan").attr("style",P)}}}return st(t,B),t.intersect=function(N){return tt.rect(t,N)},c}g(Gy,"classBox");async function Vy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=lt(t),{themeVariables:h}=kt(),{borderColorArray:d,requirementEdgeLabelBackground:u}=h,f=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let p;l?p=await Pe(f,`<<${o.type}>>`,0,t.labelStyle):p=await Pe(f,"<<Element>>",0,t.labelStyle);let m=p;const y=await Pe(f,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const I=await Pe(f,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=I;const M=await Pe(f,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=M;const D=await Pe(f,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=D,await Pe(f,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const I=await Pe(f,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=I,await Pe(f,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(f.node()?.getBBox().width??200)+a,C=(f.node()?.getBBox().height??200)+a,k=-x/2,S=-C/2,v=rt.svg(f),_=et(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const E=v.rectangle(k,S,x,C,_),B=f.insert(()=>E,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",i),d?.length){const I=t.colorIndex??0;f.attr("data-color-id",`color-${I%d.length}`)}if(f.selectAll(".label").each((I,M,D)=>{const U=yt(D[M]),q=U.attr("transform");let N=0,A=0;if(q){const $=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(q);$&&(N=parseFloat($[1]),A=parseFloat($[2]))}const F=A-C/2;let P=k+a/2;(M===0||M===1)&&(P=N),U.attr("transform",`translate(${P}, ${F+a})`)}),m>p+y+n){const I=S+p+y+n;let M;if(t.look==="neo"){const q=[[k,I],[k+x,I],[k+x,I+.001],[k,I+.001]];M=v.polygon(q,_)}else M=v.line(k,I,k+x,I,_);f.insert(()=>M).attr("class","divider")}return st(t,B),t.intersect=function(I){return tt.rect(t,I)},i&&t.look!=="handDrawn"&&(u||d?.length)&&f.selectAll("path").attr("style",i),f}g(Vy,"requirementBox");async function Pe(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=kt(),a=s.htmlLabels??!0,n=await Oe(o,Il(pr(t)),{width:je(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=yt(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}g(Pe,"addText");var kB=g(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Ky(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=t.padding||10;let d="",u;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,m;u?{label:p,bbox:m}=await Ja(u,"ticket"in t&&t.ticket||"",f):{label:p,bbox:m}=await Ja(n,"ticket"in t&&t.ticket||"",f);const{label:y,bbox:x}=await Ja(n,"assigned"in t&&t.assigned||"",f);t.width=a;const C=10,k=t?.width||0,S=Math.max(m.height,x.height)/2,v=Math.max(l.height+C*2,t?.height||0)+S,_=-k/2,E=-v/2;c.attr("transform","translate("+(h-k/2)+", "+(-S-l.height/2)+")"),p.attr("transform","translate("+(h-k/2)+", "+(-S+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-x.width-2*s)+", "+(-S+l.height/2)+")");let B;const{rx:I,ry:M}=t,{cssStyles:D}=t;if(t.look==="handDrawn"){const U=rt.svg(n),q=et(t,{}),N=I||M?U.path(yr(_,E,k,v,I||0),q):U.rectangle(_,E,k,v,q);B=n.insert(()=>N,":first-child"),B.attr("class","basic label-container").attr("style",D||null)}else{B=n.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",o).attr("rx",I??5).attr("ry",M??5).attr("x",_).attr("y",E).attr("width",k).attr("height",v);const U="priority"in t&&t.priority;if(U){const q=n.append("line"),N=_+2,A=E+Math.floor((I??0)/2),F=E+v-Math.floor((I??0)/2);q.attr("x1",N).attr("y1",A).attr("x2",N).attr("y2",F).attr("stroke-width","4").attr("stroke",kB(U))}}return st(t,B),t.height=v,t.intersect=function(U){return tt.rect(t,U)},n}g(Ky,"kanbanItem");async function Zy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ht(e,t,lt(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,u=s.width+20,f=s.height+20,p=Math.max(l,u),m=Math.max(c,f);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const x=`M0 0
|
|
242
|
-
a${h},${h} 1 0,0 ${
|
|
243
|
-
a${h},${h} 1 0,0 ${
|
|
244
|
-
a${h},${h} 1 0,0 ${
|
|
245
|
-
a${h},${h} 1 0,0 ${
|
|
239
|
+
l${-r},0`,"createCylinderPathD"),kB=p((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),wB=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),fd=5,gd=10;async function Wy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.height<fd&&(t.height=fd);const x=m/2/(2.5+m/50);t.width=(t.width??0)-s-x*3,t.width<gd&&(t.width=gd)}const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t.height?t.height:n.height)+s,h=c/2,d=h/(2.5+c/50),f=(t.width?t.width:n.width)+d+s,{cssStyles:u}=t;let g;if(t.look==="handDrawn"){const m=rt.svg(a),y=kB(0,0,f,c,d,h),x=wB(0,0,f,c,d,h),C=m.path(y,et(t,{})),w=m.path(x,et(t,{fill:"none"}));g=a.insert(()=>w,":first-child"),g=a.insert(()=>C,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{const m=bB(0,0,f,c,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Gt(u)).attr("style",i),g.attr("class","basic label-container outer-path"),u&&g.selectAll("path").attr("style",u),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,g),t.intersect=function(m){const y=tt.rect(t,m),x=y.y-(t.y??0);if(h!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-d)){let C=d*d*(1-x*x/(h*h));C!=0&&(C=Math.sqrt(Math.abs(C))),C=d-C,m.x-(t.x??0)>0&&(C=-C),y.x+=C}return y},a}p(Wy,"tiltedCylinder");async function Hy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=or(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,st(t,f),t.intersect=function(g){return tt.polygon(t,d,g)},n}p(Hy,"trapezoid");async function Yy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-s*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=(t?.width?t?.width:h.width)+s*2,f=(t?.height?t?.height:h.height)+a*2,{cssStyles:u}=t,g=rt.svg(c),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],x=bt(y),C=g.path(x,m),w=c.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),st(t,w),t.intersect=function(S){return tt.polygon(t,y,S)},c}p(Yy,"trapezoidalPentagon");var pd=10,md=10;async function Uy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<md&&(t.width=md),t.height=t?.height??0,t.height<pd&&(t.height=pd));const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=Ye(kt().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+s,d=t?.height?t?.height:h+n.height,f=d,u=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:g}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=bt(u),C=m.path(x,y),w=a.insert(()=>C,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),t.width=h,t.height=d,st(t,w),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(S){return V.info("Triangle intersect",t,u,S),tt.polygon(t,u,S)},a}p(Uy,"triangle");async function Gy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await ht(e,t,lt(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,g=f+(n?u:-u),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,w=rt.svg(l),S=et(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const v=[{x:-d/2-C,y:g/2},...mr(-d/2-C,g/2,d/2+C,g/2,u,.8),{x:d/2+C,y:-g/2},{x:-d/2-C,y:-g/2}],_=bt(v),E=w.path(_,S),B=l.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-u/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-f/2+(t.padding??0)-u-(c.y-(c.top??0))})`),st(t,B),t.intersect=function(D){return tt.polygon(t,v,D)},l}p(Gy,"waveEdgedRectangle");async function Xy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const S=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-S*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,g=rt.svg(n),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...mr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...mr(c/2,-f/2,-c/2,-f/2,d,-1)],x=bt(y),C=g.path(x,m),w=n.insert(()=>C,":first-child");return w.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),st(t,w),t.intersect=function(S){return tt.polygon(t,y,S)},n}p(Xy,"waveRectangle");var Rt=10;async function Vy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Rt,10),t.height=Math.max((t?.height??0)-s*2-Rt,10));const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width:n.width)+o*2+Rt,h=(t?.height?t?.height:n.height)+s*2+Rt,d=c-Rt,f=h-Rt,u=-d/2,g=-f/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{}),C=[{x:u-Rt,y:g-Rt},{x:u-Rt,y:g+f},{x:u+d,y:g+f},{x:u+d,y:g-Rt}],w=`M${u-Rt},${g-Rt} L${u+d},${g-Rt} L${u+d},${g+f} L${u-Rt},${g+f} L${u-Rt},${g-Rt}
|
|
240
|
+
M${u-Rt},${g} L${u+d},${g}
|
|
241
|
+
M${u},${g-Rt} L${u},${g+f}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(w,x),v=a.insert(()=>S,":first-child");return v.attr("transform",`translate(${Rt/2}, ${Rt/2})`),v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Rt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Rt/2-(n.y-(n.top??0))})`),st(t,v),t.intersect=function(_){return tt.polygon(t,C,_)},a}p(Vy,"windowPane");var yd=new Set(["redux-color","redux-dark-color"]),SB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Fh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Ot(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:K}=Ot(),{background:Z}=K,at={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await Fh(e,at)}const c=Ot();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:g}=ot(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};je(t.label,c)+K.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Z=await zi(e,t,K);if(i!=null&&yd.has(i)){const at=r.colorIndex??0;Z.attr("data-color-id",`color-${at%l.length}`)}if(!Ye(c.htmlLabels)){const at=Z.select("text"),pt=at.node()?.getBBox();at.attr("transform",`translate(${-pt.width/2}, 0)`)}return Z}c.htmlLabels||(h*=1.25,d*=1.25);let m=lt(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await ei(y,t.label??"",c,0,0,["name"],u);x.height+=d;let C=0;const w=[],S=[];let v=0,_=0,E=0,B=0,D=!0,M=!0;for(const K of r.attributes){const Z=await ei(y,K.type,c,0,C,["attribute-type"],u);v=Math.max(v,Z.width+h);const at=await ei(y,K.name,c,0,C,["attribute-name"],u);_=Math.max(_,at.width+h);const pt=await ei(y,K.keys.join(),c,0,C,["attribute-keys"],u);E=Math.max(E,pt.width+h);const ut=await ei(y,K.comment,c,0,C,["attribute-comment"],u);B=Math.max(B,ut.width+h);const mt=Math.max(Z.height,at.height,pt.height,ut.height)+d;S.push({yOffset:C,rowHeight:mt}),C+=mt}let P=4;E<=h&&(D=!1,E=0,P--),B<=h&&(M=!1,B=0,P--);const U=y.node().getBBox();if(x.width+h*2-(v+_+E+B)>0){const K=x.width+h*2-(v+_+E+B);v+=K/P,_+=K/P,E>0&&(E+=K/P),B>0&&(B+=K/P)}const N=v+_+E+B,q=rt.svg(y),A=et(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let $=0;S.length>0&&($=S.reduce((K,Z)=>K+(Z?.rowHeight??0),0));const O=Math.max(U.width+h*2,t?.width||0,N),F=Math.max(($??0)+x.height,t?.height||0),R=-O/2,j=-F/2;if(y.selectAll("g:not(:first-child)").each((K,Z,at)=>{const pt=yt(at[Z]),ut=pt.attr("transform");let mt=0,Lt=0;if(ut){const Mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ut);Mt&&(mt=parseFloat(Mt[1]),Lt=parseFloat(Mt[2]),pt.attr("class").includes("attribute-name")?mt+=v:pt.attr("class").includes("attribute-keys")?mt+=v+_:pt.attr("class").includes("attribute-comment")&&(mt+=v+_+E))}pt.attr("transform",`translate(${R+h/2+mt}, ${Lt+j+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(j+d/2)+")"),i!=null&&yd.has(i)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const T=q.rectangle(R,j,O,F,A),W=y.insert(()=>T,":first-child").attr("class","outer-path").attr("style",f.join(""));w.push(0);for(const[K,Z]of S.entries()){const pt=(K+1)%2===0&&Z.yOffset!==0,ut=q.rectangle(R,x.height+j+Z?.yOffset,O,Z?.rowHeight,{...A,fill:pt?s:a,stroke:n});y.insert(()=>ut,"g.label").attr("style",f.join("")).attr("class",`row-rect-${pt?"even":"odd"}`)}const z=1e-4;let X=ri(R,x.height+j,O+R,x.height+j,z),G=q.polygon(X.map(K=>[K.x,K.y]),A);if(y.insert(()=>G).attr("class","divider"),X=ri(v+R,x.height+j,v+R,F+j,z),G=q.polygon(X.map(K=>[K.x,K.y]),A),y.insert(()=>G).attr("class","divider"),D){const K=v+_+R;X=ri(K,x.height+j,K,F+j,z),G=q.polygon(X.map(Z=>[Z.x,Z.y]),A),y.insert(()=>G).attr("class","divider")}if(M){const K=v+_+E+R;X=ri(K,x.height+j,K,F+j,z),G=q.polygon(X.map(Z=>[Z.x,Z.y]),A),y.insert(()=>G).attr("class","divider")}for(const K of w){const Z=x.height+j+K;X=ri(R,Z,O+R,Z,z),G=q.polygon(X.map(at=>[at.x,at.y]),A),y.insert(()=>G).attr("class","divider")}if(st(t,W),g&&t.look!=="handDrawn")if(i!=null&&SB.has(i))y.selectAll("path").attr("style",g);else{const Z=g.split(";")?.filter(at=>at.includes("stroke"))?.map(at=>`${at}`).join("; ");y.selectAll("path").attr("style",Z??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(K){return tt.rect(t,K)},y}p(Fh,"erBox");async function ei(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==Cn(t)&&(t=Cn(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await Oe(n,t,{width:je(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(Ye(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=yt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}p(ei,"addText");function ri(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}p(ri,"lineToPolygon");async function Ky(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",lt(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,f=0,u=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await lo(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await lo(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const w=await lo(c,C,m,[C.parseClassifier()]);m+=w+s}u=c.node().getBBox().height,u<=0&&(u=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const w=await lo(h,C,y,[C.parseClassifier()]);y+=w+s}let x=a.node().getBBox();if(n!==null){const C=n.node().getBBox();n.attr("transform",`translate(${-C.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),x=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+o*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+o*4:o*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}p(Ky,"textHelper");async function lo(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Ot();let a="useHtmlLabels"in t?t.useHtmlLabels:Ye(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Li(n)&&(a=!0);const l=await Oe(o,Pl(gr(n)),{width:je(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],f=yt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const u=d.getElementsByTagName("img");if(u){const g=n.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...u].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",g){const C=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,S=parseInt(C,10)*5+"px";m.style.minWidth=S,m.style.maxWidth=S}else m.style.width="100%";y(m)}p(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}c=d.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&yt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(lo,"addText");async function Zy(e,t){const r=kt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ye(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Ky(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=ot(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Math.max(t.width??0,h.width);let C=Math.max(t.height??0,h.height);const w=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?C+=a:l.members.length>0&&l.methods.length===0&&(C+=a*2);const S=-x/2,v=-C/2;let _=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;w&&(_=s*2);const E=m.rectangle(S-s,v-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+_,y),B=c.insert(()=>E,":first-child");B.attr("class","basic label-container outer-path");const D=B.node().getBBox(),M=c.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,P=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,U=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(M+P+v+s-(v-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((q,A,$)=>{const O=yt($[A]),F=O.attr("transform");let R=0;if(F){const z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(F);z&&(R=parseFloat(z[2]))}let j=R+v+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(O.attr("class").includes("methods-group")){const W=Math.max(U,a/2);w?j=Math.max(N,M+P+W+v+a*2+s)+a*2:j=M+P+W+v+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?j=R-a:j=R),n||(j-=4);let T=S;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(T=-O.node()?.getBBox().width/2||0,c.selectAll("text").each(function(W,z,X){window.getComputedStyle(X[z]).textAnchor==="middle"&&(T=0)})),O.attr("transform",`translate(${T}, ${j})`)}),l.members.length>0||l.methods.length>0||g){const q=M+P+v+s,A=m.line(D.x,q,D.x+D.width,q+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(g||l.members.length>0||l.methods.length>0){const q=M+P+U+v+a*2+s,A=m.line(D.x,w?Math.max(N,q):q,D.x+D.width,(w?Math.max(N,q):q)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),B.select(":nth-child(2)").attr("style",u),c.selectAll(".divider").select("path").attr("style",u),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",u),!n){const q=RegExp(/color\s*:\s*([^;]*)/),A=q.exec(u);if(A){const $=A[0].replace("color","fill");c.selectAll("tspan").attr("style",$)}else if(d){const $=q.exec(d);if($){const O=$[0].replace("color","fill");c.selectAll("tspan").attr("style",O)}}}return st(t,B),t.intersect=function(q){return tt.rect(t,q)},c}p(Zy,"classBox");async function Qy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=lt(t),{themeVariables:h}=kt(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let g;l?g=await Pe(u,`<<${o.type}>>`,0,t.labelStyle):g=await Pe(u,"<<Element>>",0,t.labelStyle);let m=g;const y=await Pe(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const D=await Pe(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=D;const M=await Pe(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=M;const P=await Pe(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=P,await Pe(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const D=await Pe(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=D,await Pe(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(u.node()?.getBBox().width??200)+a,C=(u.node()?.getBBox().height??200)+a,w=-x/2,S=-C/2,v=rt.svg(u),_=et(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const E=v.rectangle(w,S,x,C,_),B=u.insert(()=>E,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",i),d?.length){const D=t.colorIndex??0;u.attr("data-color-id",`color-${D%d.length}`)}if(u.selectAll(".label").each((D,M,P)=>{const U=yt(P[M]),N=U.attr("transform");let q=0,A=0;if(N){const R=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(N);R&&(q=parseFloat(R[1]),A=parseFloat(R[2]))}const $=A-C/2;let O=w+a/2;(M===0||M===1)&&(O=q),U.attr("transform",`translate(${O}, ${$+a})`)}),m>g+y+n){const D=S+g+y+n;let M;if(t.look==="neo"){const N=[[w,D],[w+x,D],[w+x,D+.001],[w,D+.001]];M=v.polygon(N,_)}else M=v.line(w,D,w+x,D,_);u.insert(()=>M).attr("class","divider")}return st(t,B),t.intersect=function(D){return tt.rect(t,D)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}p(Qy,"requirementBox");async function Pe(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=kt(),a=s.htmlLabels??!0,n=await Oe(o,Pl(gr(t)),{width:je(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=yt(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(Pe,"addText");var vB=p(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Jy(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=t.padding||10;let d="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const u={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await tn(f,"ticket"in t&&t.ticket||"",u):{label:g,bbox:m}=await tn(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:x}=await tn(n,"assigned"in t&&t.assigned||"",u);t.width=a;const C=10,w=t?.width||0,S=Math.max(m.height,x.height)/2,v=Math.max(l.height+C*2,t?.height||0)+S,_=-w/2,E=-v/2;c.attr("transform","translate("+(h-w/2)+", "+(-S-l.height/2)+")"),g.attr("transform","translate("+(h-w/2)+", "+(-S+l.height/2)+")"),y.attr("transform","translate("+(h+w/2-x.width-2*s)+", "+(-S+l.height/2)+")");let B;const{rx:D,ry:M}=t,{cssStyles:P}=t;if(t.look==="handDrawn"){const U=rt.svg(n),N=et(t,{}),q=D||M?U.path(yr(_,E,w,v,D||0),N):U.rectangle(_,E,w,v,N);B=n.insert(()=>q,":first-child"),B.attr("class","basic label-container").attr("style",P||null)}else{B=n.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",o).attr("rx",D??5).attr("ry",M??5).attr("x",_).attr("y",E).attr("width",w).attr("height",v);const U="priority"in t&&t.priority;if(U){const N=n.append("line"),q=_+2,A=E+Math.floor((D??0)/2),$=E+v-Math.floor((D??0)/2);N.attr("x1",q).attr("y1",A).attr("x2",q).attr("y2",$).attr("stroke-width","4").attr("stroke",vB(U))}}return st(t,B),t.height=v,t.intersect=function(U){return tt.rect(t,U)},n}p(Jy,"kanbanItem");async function t0(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ht(e,t,lt(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,f=s.width+20,u=s.height+20,g=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const x=`M0 0
|
|
242
|
+
a${h},${h} 1 0,0 ${g*.25},${-1*m*.1}
|
|
243
|
+
a${h},${h} 1 0,0 ${g*.25},0
|
|
244
|
+
a${h},${h} 1 0,0 ${g*.25},0
|
|
245
|
+
a${h},${h} 1 0,0 ${g*.25},${m*.1}
|
|
246
246
|
|
|
247
|
-
a${h},${h} 1 0,0 ${
|
|
247
|
+
a${h},${h} 1 0,0 ${g*.15},${m*.33}
|
|
248
248
|
a${h*.8},${h*.8} 1 0,0 0,${m*.34}
|
|
249
|
-
a${h},${h} 1 0,0 ${-1*
|
|
249
|
+
a${h},${h} 1 0,0 ${-1*g*.15},${m*.33}
|
|
250
250
|
|
|
251
|
-
a${h},${h} 1 0,0 ${-1*
|
|
252
|
-
a${h},${h} 1 0,0 ${-1*
|
|
253
|
-
a${h},${h} 1 0,0 ${-1*
|
|
254
|
-
a${h},${h} 1 0,0 ${-1*
|
|
251
|
+
a${h},${h} 1 0,0 ${-1*g*.25},${m*.15}
|
|
252
|
+
a${h},${h} 1 0,0 ${-1*g*.25},0
|
|
253
|
+
a${h},${h} 1 0,0 ${-1*g*.25},0
|
|
254
|
+
a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15}
|
|
255
255
|
|
|
256
|
-
a${h},${h} 1 0,0 ${-1*
|
|
256
|
+
a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33}
|
|
257
257
|
a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
|
|
258
|
-
a${h},${h} 1 0,0 ${
|
|
259
|
-
H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),
|
|
258
|
+
a${h},${h} 1 0,0 ${g*.1},${-1*m*.33}
|
|
259
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),w=et(t,{}),S=C.path(x,w);y=o.insert(()=>S,":first-child"),y.attr("class","basic label-container").attr("style",Gt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),st(t,y),t.calcIntersect=function(C,w){return tt.rect(C,w)},t.intersect=function(C){return V.info("Bang intersect",t,C),tt.rect(t,C)},o}p(t0,"bang");async function e0(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ht(e,t,lt(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:g}=t;let m;const y=`M0 0
|
|
260
260
|
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
|
|
261
|
-
a${
|
|
261
|
+
a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}
|
|
262
262
|
a${d},${d} 1 0,1 ${l*.35},${l*.2}
|
|
263
263
|
|
|
264
264
|
a${h},${h} 1 0,1 ${l*.15},${c*.35}
|
|
265
|
-
a${
|
|
265
|
+
a${u},${u} 1 0,1 ${-1*l*.15},${c*.65}
|
|
266
266
|
|
|
267
267
|
a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
|
|
268
|
-
a${
|
|
268
|
+
a${f},${f} 1 0,1 ${-1*l*.5},0
|
|
269
269
|
a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
|
|
270
270
|
|
|
271
271
|
a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
|
|
272
|
-
a${
|
|
273
|
-
H0 V0 Z`;if(t.look==="handDrawn"){const x=rt.svg(o),C=et(t,{}),
|
|
272
|
+
a${u},${u} 1 0,1 ${l*.1},${-1*c*.65}
|
|
273
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const x=rt.svg(o),C=et(t,{}),w=x.path(y,C);m=o.insert(()=>w,":first-child"),m.attr("class","basic label-container").attr("style",Gt(g))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),st(t,m),t.calcIntersect=function(x,C){return tt.rect(x,C)},t.intersect=function(x){return V.info("Cloud intersect",t,x),tt.rect(t,x)},o}p(e0,"cloud");async function r0(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ht(e,t,lt(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?`
|
|
274
274
|
M${-l/2} ${c/2-h}
|
|
275
275
|
v${-c+2*h}
|
|
276
276
|
q0,-${h} ${h},-${h}
|
|
@@ -290,26 +290,26 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
|
|
|
290
290
|
h${-(l-2*h)}
|
|
291
291
|
q${-h},0 ${-h},${-h}
|
|
292
292
|
Z
|
|
293
|
-
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),st(t,u),t.calcIntersect=function(f,p){return tt.rect(f,p)},t.intersect=function(f){return tt.rect(t,f)},o}g(Jy,"defaultMindmapNode");async function t0(e,t){const r={padding:t.padding??0};return Lh(e,t,r)}g(t0,"mindmapCircle");var wB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Ay},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Ly},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:My},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Iy},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:ty},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:ey},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Lh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Zy},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Qy},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Ty},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ly},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:xy},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:yy},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:zy},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:gy},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:iy},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Ny},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Um},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Ey},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Ry},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Oy},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:ay},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:hy},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Km},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Zm},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Qm},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Cy},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Hy},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ny},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:qy},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:by},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Jm},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ry},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Wy},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Uy},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:oy},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:jy},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:sy},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Fy},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Sy},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:wy},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Ym},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Vm},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Dy},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Py},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Yy},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:_y},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ky}],SB=g(()=>{const t=[...Object.entries({state:$y,choice:Xm,note:vy,rectWithTitle:By,labelRect:my,iconSquare:fy,iconCircle:dy,icon:cy,iconRounded:uy,imageSquare:py,anchor:Wm,kanbanItem:Ky,mindmapCircle:t0,defaultMindmapNode:Jy,classBox:Gy,erBox:Eh,requirementBox:Vy}),...wB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),e0=SB();function r0(e){return e in e0}g(r0,"isValidShape");var Sa=new Map;async function Fh(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?e0[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Xt(t.look)),t.tooltip&&o.attr("title",t.tooltip),Sa.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(Fh,"insertNode");var vB=g((e,t)=>{Sa.set(t.id,e)},"setNodeElem"),TB=g(()=>{Sa.clear()},"clear"),_B=g(e=>{const t=Sa.get(e.id);V.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),ii=g((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Zt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},yd={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ho(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=$t(e),t=$t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}g(ho,"calculateDeltaAndAngle");var $t=g(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),i0=g(e=>({x:g(function(t,r,i){let o=0;const s=$t(i[0]).x<$t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Zt,e.arrowTypeStart)){const{angle:f,deltaX:p}=ho(i[0],i[1]);o=Zt[e.arrowTypeStart]*Math.cos(f)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:f,deltaX:p}=ho(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.cos(f)*(p>=0?1:-1)}const a=Math.abs($t(t).x-$t(i[i.length-1]).x),n=Math.abs($t(t).y-$t(i[i.length-1]).y),l=Math.abs($t(t).x-$t(i[0]).x),c=Math.abs($t(t).y-$t(i[0]).y),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="right"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=s==="right"?-1:1,o+=f}return $t(t).x+o},"x"),y:g(function(t,r,i){let o=0;const s=$t(i[0]).y<$t(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Zt,e.arrowTypeStart)){const{angle:f,deltaY:p}=ho(i[0],i[1]);o=Zt[e.arrowTypeStart]*Math.abs(Math.sin(f))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:f,deltaY:p}=ho(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(p>=0?1:-1)}const a=Math.abs($t(t).y-$t(i[i.length-1]).y),n=Math.abs($t(t).x-$t(i[i.length-1]).x),l=Math.abs($t(t).y-$t(i[0]).y),c=Math.abs($t(t).x-$t(i[0]).x),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="up"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=s==="up"?-1:1,o+=f}return $t(t).y+o},"y")}),"getLineFunctionsWithOffset"),BB=g((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&xd(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&xd(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),LB={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},EB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],xd=g((e,t,r,i,o,s,a=!1,n)=>{const l=LB[r],c=l&&EB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const p=n.replace(/[^\dA-Za-z]/g,"_"),m=`${f}_${p}`;if(!document.getElementById(m)){const y=document.getElementById(f);if(y){const x=y.cloneNode(!0);x.id=m,x.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",n),l.fill&&k.setAttribute("fill",n)}),y.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${f})`)},"addEdgeMarker"),FB=g(e=>typeof e=="string"?e:kt()?.flowchart?.curve,"resolveEdgeCurveType"),Lo=new Map,Ut=new Map,AB=g(()=>{Lo.clear(),Ut.clear()},"clear"),to=g(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),o0=g(async(e,t)=>{const r=kt();let i=ee(r);const{labelStyles:o}=ot(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Oe(e,t.label,{style:to(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),V.info("abc82",t,t.labelType);let h=c.getBBox(),d=h;if(i){const f=c.children[0],p=yt(c);h=f.getBoundingClientRect(),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const f=yt(c).select("text").node();f&&typeof f.getBBox=="function"&&(d=f.getBBox())}a.attr("transform",ii(d,i)),Lo.set(t.id,s),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(p,t.startLabelLeft,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startLeft=f,co(u,t.startLabelLeft)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(p,t.startLabelRight,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startRight=f,co(u,t.startLabelRight)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(f,t.endLabelLeft,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endLeft=f,co(u,t.endLabelLeft)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(f,t.endLabelRight,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endRight=f,co(u,t.endLabelRight)}return c},"insertEdgeLabel");function co(e,t){ee(kt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(co,"setTerminalWidth");var s0=g((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Lo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=kt(),{subGraphTitleTotalMargin:o}=ya(i);if(e.label){const s=Lo.get(e.id);let a=e.x,n=e.y;if(r){const l=xe.calcLabelPosition(r);V.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Ut.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Ut.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Ut.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Ut.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),MB=g((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),$B=g((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),OB=g((e,t,r)=>{V.debug(`intersection calc abc89:
|
|
293
|
+
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),st(t,f),t.calcIntersect=function(u,g){return tt.rect(u,g)},t.intersect=function(u){return tt.rect(t,u)},o}p(r0,"defaultMindmapNode");async function i0(e,t){const r={padding:t.padding??0};return Eh(e,t,r)}p(i0,"mindmapCircle");var TB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Oy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Ay},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Ry},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Ny},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:iy},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:oy},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Eh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:t0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:e0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Ly},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:dy},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:ky},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:by},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Hy},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:xy},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:ay},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:jy},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Vm},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:My},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Dy},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Py},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:hy},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:uy},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Jm},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:ty},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:ey},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:wy},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Gy},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:cy},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Wy},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Sy},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:ry},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:sy},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Uy},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Vy},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:ny},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Yy},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:ly},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:$y},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:_y},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Ty},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Xm},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Qm},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:zy},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:qy},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Xy},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Ey},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:vy}],_B=p(()=>{const t=[...Object.entries({state:Iy,choice:Km,note:By,rectWithTitle:Fy,labelRect:Cy,iconSquare:my,iconCircle:gy,icon:fy,iconRounded:py,imageSquare:yy,anchor:Um,kanbanItem:Jy,mindmapCircle:i0,defaultMindmapNode:r0,classBox:Zy,erBox:Fh,requirementBox:Qy}),...TB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),o0=_B();function s0(e){return e in o0}p(s0,"isValidShape");var va=new Map;async function Ah(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?o0[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Gt(t.look)),t.tooltip&&o.attr("title",t.tooltip),va.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(Ah,"insertNode");var BB=p((e,t)=>{va.set(t.id,e)},"setNodeElem"),LB=p(()=>{va.clear()},"clear"),EB=p(e=>{const t=va.get(e.id);V.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),ii=p((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Zt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},xd={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ho(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=$t(e),t=$t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}p(ho,"calculateDeltaAndAngle");var $t=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),a0=p(e=>({x:p(function(t,r,i){let o=0;const s=$t(i[0]).x<$t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Zt,e.arrowTypeStart)){const{angle:u,deltaX:g}=ho(i[0],i[1]);o=Zt[e.arrowTypeStart]*Math.cos(u)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:u,deltaX:g}=ho(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.cos(u)*(g>=0?1:-1)}const a=Math.abs($t(t).x-$t(i[i.length-1]).x),n=Math.abs($t(t).y-$t(i[i.length-1]).y),l=Math.abs($t(t).x-$t(i[0]).x),c=Math.abs($t(t).y-$t(i[0]).y),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=s==="right"?-1:1,o-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=s==="right"?-1:1,o+=u}return $t(t).x+o},"x"),y:p(function(t,r,i){let o=0;const s=$t(i[0]).y<$t(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Zt,e.arrowTypeStart)){const{angle:u,deltaY:g}=ho(i[0],i[1]);o=Zt[e.arrowTypeStart]*Math.abs(Math.sin(u))*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:u,deltaY:g}=ho(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(g>=0?1:-1)}const a=Math.abs($t(t).y-$t(i[i.length-1]).y),n=Math.abs($t(t).x-$t(i[i.length-1]).x),l=Math.abs($t(t).y-$t(i[0]).y),c=Math.abs($t(t).x-$t(i[0]).x),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=s==="up"?-1:1,o-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=s==="up"?-1:1,o+=u}return $t(t).y+o},"y")}),"getLineFunctionsWithOffset"),FB=p((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&Cd(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&Cd(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),AB={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},MB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Cd=p((e,t,r,i,o,s,a=!1,n)=>{const l=AB[r],c=l&&MB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${g}`;if(!document.getElementById(m)){const y=document.getElementById(u);if(y){const x=y.cloneNode(!0);x.id=m,x.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",n),l.fill&&w.setAttribute("fill",n)}),y.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),$B=p(e=>typeof e=="string"?e:kt()?.flowchart?.curve,"resolveEdgeCurveType"),Eo=new Map,Ut=new Map,OB=p(()=>{Eo.clear(),Ut.clear()},"clear"),to=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),n0=p(async(e,t)=>{const r=kt();let i=ee(r);const{labelStyles:o}=ot(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Oe(e,t.label,{style:to(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),V.info("abc82",t,t.labelType);let h=c.getBBox(),d=h;if(i){const u=c.children[0],g=yt(c);h=u.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const u=yt(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",ii(d,i)),Eo.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await lr(g,t.startLabelLeft,to(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startLeft=u,co(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await lr(g,t.startLabelRight,to(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startRight=u,co(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await lr(u,t.endLabelLeft,to(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endLeft=u,co(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await lr(u,t.endLabelRight,to(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endRight=u,co(f,t.endLabelRight)}return c},"insertEdgeLabel");function co(e,t){ee(kt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(co,"setTerminalWidth");var l0=p((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Eo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=kt(),{subGraphTitleTotalMargin:o}=xa(i);if(e.label){const s=Eo.get(e.id);let a=e.x,n=e.y;if(r){const l=xe.calcLabelPosition(r);V.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Ut.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Ut.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Ut.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Ut.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),RB=p((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),IB=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),PB=p((e,t,r)=>{V.debug(`intersection calc abc89:
|
|
294
294
|
outsidePoint: ${JSON.stringify(t)}
|
|
295
295
|
insidePoint : ${JSON.stringify(r)}
|
|
296
|
-
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const u={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(u.x=t.x,u.y=t.y),h===0&&(u.x=t.x),c===0&&(u.y=t.y),V.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,u),u}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/h,u=r.x<t.x?r.x+h-n:r.x-h+n,f=r.y<t.y?r.y+d:r.y-d;return V.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:u,_y:f}),n===0&&(u=t.x,f=t.y),h===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),Cd=g((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(V.info("abc88 checking point",s,t),!$B(t,s)&&!o){const a=OB(t,i,s);V.debug("abc88 inside",s,i,a),V.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?V.warn("abc88 no intersect",a,r):r.push(a),o=!0}else V.warn("abc88 outside",s,i),i=s,o||r.push(s)}),V.debug("returning points",r),r},"cutPathAtIntersect");function a0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}g(a0,"extractCornerPoints");var bd=g(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),RB=g(function(e){const{cornerPointPositions:t}=a0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=bd(o,a,5),l=bd(s,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let u={x:a.x,y:a.y};if(Math.abs(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){V.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const f=5;a.x===n.x?u={x:c<0?n.x-f+d:n.x+f-d,y:h<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:h<0?n.y-f+d:n.y+f-d}}else V.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(u,l)}else r.push(e[i]);return r},"fixCorners"),IB=g((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),n0=g(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=kt();let h=t.points,d=!1;const u=o;var f=s;const p=[];for(const O in t.cssCompiledStyles)rh(O)||p.push(t.cssCompiledStyles[O]);if(c==="swimlane"){if(f.intersect&&u.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[u.intersect(h[0]),f.intersect(h[1])];else{const O=h.slice(1,-1),$=O[0],j=O[O.length-1],T=.5,W=Math.abs(h[h.length-1].x-j.x)<T&&Math.abs(h[h.length-1].y-j.y)<T,z=u.intersect($),G=W?j:f.intersect(j),X=Math.abs(G.x-j.x)<T&&Math.abs(G.y-j.y)<T,Q=Math.abs(z.x-$.x)<T&&Math.abs(z.y-$.y)<T?[]:[z],nt=X?[]:[G];h=[...Q,...O,...nt]}h=MB(t,h)}else f.intersect&&u.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(u.intersect(h[0])),h.push(f.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));t.toCluster&&(V.info("to cluster abc88",r.get(t.toCluster)),h=Cd(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(V.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=Cd(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(O=>!Number.isNaN(O.y));const x=FB(t.curve);x!=="rounded"&&(y=RB(y));let C=go;switch(x){case"linear":C=go;break;case"basis":C=Ms;break;case"cardinal":C=kf;break;case"bumpX":C=mf;break;case"bumpY":C=yf;break;case"catmullRom":C=Sf;break;case"monotoneX":C=Ef;break;case"monotoneY":C=Ff;break;case"natural":C=Mf;break;case"step":C=$f;break;case"stepAfter":C=Rf;break;case"stepBefore":C=Of;break;case"rounded":C=go;break;default:C=Ms}const{x:k,y:S}=i0(t),v=pf().x(k).y(S).curve(C);let _;switch(t.thickness){case"normal":_="edge-thickness-normal";break;case"thick":_="edge-thickness-thick";break;case"invisible":_="edge-thickness-invisible";break;default:_="edge-thickness-normal"}switch(t.pattern){case"solid":_+=" edge-pattern-solid";break;case"dotted":_+=" edge-pattern-dotted";break;case"dashed":_+=" edge-pattern-dashed";break;default:_+=" edge-pattern-solid"}let E,B=x==="rounded"?l0(h0(y,t),5):v(y);const I=Array.isArray(t.style)?t.style:[t.style];let M=I.find(O=>O?.startsWith("stroke:")),D="";t.animate&&(D="edge-animation-fast"),t.animation&&(D="edge-animation-"+t.animation);let U=!1;if(t.look==="handDrawn"){const O=rt.svg(e);Object.assign([],y);const $=O.path(B,{roughness:.3,seed:l});_+=" transition",E=yt($).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",I?I.reduce((T,W)=>T+";"+W,""):"");let j=E.attr("d");E.attr("d",j),e.node().appendChild(E.node())}else{const O=p.join(";"),$=I?I.reduce((X,K)=>X+K+";",""):"",j=(O?O+";"+$+";":$)+";"+(I?I.reduce((X,K)=>X+";"+K,""):"");E=e.append("path").attr("d",B).attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",j),M=j.match(/stroke:([^;]+)/)?.[1],U=t.animate===!0||!!t.animation||O.includes("animation");const T=E.node(),W=typeof T.getTotalLength=="function"?T.getTotalLength():0,z=yd[t.arrowTypeStart]||0,G=yd[t.arrowTypeEnd]||0;if(t.look==="neo"&&!U){const K=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?IB(W,z,G):`0 ${z} ${W-z-G} ${G}`}; stroke-dashoffset: 0;`;E.attr("style",K+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",t.id),E.attr("data-points",m),E.attr("data-look",Xt(t.look)),t.showPoints&&y.forEach(O=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",O.x).attr("cy",O.y)});let q="";(kt().flowchart.arrowMarkerAbsolute||kt().state.arrowMarkerAbsolute)&&(q=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,q=q.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const N=!U&&t?.look==="neo";BB(E,t,q,a,i,N,M);const A=Math.floor(h.length/2),F=h[A];xe.isLabelCoordinateInPath(F,E.attr("d"))||(d=!0);let P={};return d&&(P.updatedPath=h),P.originalPath=t.points,P},"insertEdge");function l0(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],l=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,h=a.y-n.y,d=l.x-a.x,u=l.y-a.y,f=Math.hypot(c,h),p=Math.hypot(d,u);if(f<o||p<o){r+=`L${a.x},${a.y}`;continue}const m=c/f,y=h/f,x=d/p,C=u/p,k=m*x+y*C,S=Math.max(-1,Math.min(1,k)),v=Math.acos(S);if(v<o||Math.abs(Math.PI-v)<o){r+=`L${a.x},${a.y}`;continue}const _=Math.min(t/Math.sin(v/2),f/2,p/2),E=a.x-m*_,B=a.y-y*_,I=a.x+x*_,M=a.y+C*_;r+=`L${E},${B}`,r+=`Q${a.x},${a.y} ${I},${M}`}}return r}g(l0,"generateRoundedPath");function cl(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}g(cl,"calculateDeltaAndAngle");function h0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Zt[t.arrowTypeStart]){const o=Zt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=cl(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Zt[t.arrowTypeEnd]){const o=Zt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=cl(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}g(h0,"applyMarkerOffsetsToPoints");var PB=g((e,t,r,i)=>{t.forEach(o=>{aL[o](e,r,i)})},"insertMarkers"),DB=g((e,t,r)=>{V.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),NB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),qB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),zB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),jB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),WB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),HB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),YB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),UB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),XB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),GB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),VB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),KB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),ZB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),QB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),JB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),tL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),eL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),rL=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
|
|
296
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const f={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(f.x=t.x,f.y=t.y),h===0&&(f.x=t.x),c===0&&(f.y=t.y),V.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,f),f}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/h,f=r.x<t.x?r.x+h-n:r.x-h+n,u=r.y<t.y?r.y+d:r.y-d;return V.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:f,_y:u}),n===0&&(f=t.x,u=t.y),h===0&&(f=t.x),c===0&&(u=t.y),{x:f,y:u}}},"intersection"),bd=p((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(V.info("abc88 checking point",s,t),!IB(t,s)&&!o){const a=PB(t,i,s);V.debug("abc88 inside",s,i,a),V.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?V.warn("abc88 no intersect",a,r):r.push(a),o=!0}else V.warn("abc88 outside",s,i),i=s,o||r.push(s)}),V.debug("returning points",r),r},"cutPathAtIntersect");function h0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(h0,"extractCornerPoints");var kd=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),DB=p(function(e){const{cornerPointPositions:t}=h0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=kd(o,a,5),l=kd(s,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let f={x:a.x,y:a.y};if(Math.abs(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){V.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const u=5;a.x===n.x?f={x:c<0?n.x-u+d:n.x+u-d,y:h<0?n.y-d:n.y+d}:f={x:c<0?n.x-d:n.x+d,y:h<0?n.y-u+d:n.y+u-d}}else V.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),NB=p((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),c0=p(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=kt();let h=t.points,d=!1;const f=o;var u=s;const g=[];for(const F in t.cssCompiledStyles)ih(F)||g.push(t.cssCompiledStyles[F]);if(c==="swimlane"){if(u.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),u.intersect(h[1])];else{const F=h.slice(1,-1),R=F[0],j=F[F.length-1],T=.5,W=Math.abs(h[h.length-1].x-j.x)<T&&Math.abs(h[h.length-1].y-j.y)<T,z=f.intersect(R),X=W?j:u.intersect(j),G=Math.abs(X.x-j.x)<T&&Math.abs(X.y-j.y)<T,Z=Math.abs(z.x-R.x)<T&&Math.abs(z.y-R.y)<T?[]:[z],at=G?[]:[X];h=[...Z,...F,...at]}h=RB(t,h)}else u.intersect&&f.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(f.intersect(h[0])),h.push(u.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));t.toCluster&&(V.info("to cluster abc88",r.get(t.toCluster)),h=bd(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(V.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=bd(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(F=>!Number.isNaN(F.y));const x=$B(t.curve);x!=="rounded"&&(y=DB(y));let C=po;switch(x){case"linear":C=po;break;case"basis":C=$s;break;case"cardinal":C=vf;break;case"bumpX":C=Cf;break;case"bumpY":C=bf;break;case"catmullRom":C=_f;break;case"monotoneX":C=Mf;break;case"monotoneY":C=$f;break;case"natural":C=Rf;break;case"step":C=If;break;case"stepAfter":C=Df;break;case"stepBefore":C=Pf;break;case"rounded":C=po;break;default:C=$s}const{x:w,y:S}=a0(t),v=yf().x(w).y(S).curve(C);let _;switch(t.thickness){case"normal":_="edge-thickness-normal";break;case"thick":_="edge-thickness-thick";break;case"invisible":_="edge-thickness-invisible";break;default:_="edge-thickness-normal"}switch(t.pattern){case"solid":_+=" edge-pattern-solid";break;case"dotted":_+=" edge-pattern-dotted";break;case"dashed":_+=" edge-pattern-dashed";break;default:_+=" edge-pattern-solid"}let E,B=x==="rounded"?d0(u0(y,t),5):v(y);const D=Array.isArray(t.style)?t.style:[t.style];let M=D.find(F=>F?.startsWith("stroke:")),P="";t.animate&&(P="edge-animation-fast"),t.animation&&(P="edge-animation-"+t.animation);let U=!1;if(t.look==="handDrawn"){const F=rt.svg(e);Object.assign([],y);const R=F.path(B,{roughness:.3,seed:l});_+=" transition",E=yt(R).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",D?D.reduce((T,W)=>T+";"+W,""):"");let j=E.attr("d");E.attr("d",j),e.node().appendChild(E.node())}else{const F=g.join(";"),R=D?D.reduce((G,K)=>G+K+";",""):"",j=(F?F+";"+R+";":R)+";"+(D?D.reduce((G,K)=>G+";"+K,""):"");E=e.append("path").attr("d",B).attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",j),M=j.match(/stroke:([^;]+)/)?.[1],U=t.animate===!0||!!t.animation||F.includes("animation");const T=E.node(),W=typeof T.getTotalLength=="function"?T.getTotalLength():0,z=xd[t.arrowTypeStart]||0,X=xd[t.arrowTypeEnd]||0;if(t.look==="neo"&&!U){const K=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?NB(W,z,X):`0 ${z} ${W-z-X} ${X}`}; stroke-dashoffset: 0;`;E.attr("style",K+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",t.id),E.attr("data-points",m),E.attr("data-look",Gt(t.look)),t.showPoints&&y.forEach(F=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let N="";(kt().flowchart.arrowMarkerAbsolute||kt().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const q=!U&&t?.look==="neo";FB(E,t,N,a,i,q,M);const A=Math.floor(h.length/2),$=h[A];xe.isLabelCoordinateInPath($,E.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=t.points,O},"insertEdge");function d0(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],l=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,h=a.y-n.y,d=l.x-a.x,f=l.y-a.y,u=Math.hypot(c,h),g=Math.hypot(d,f);if(u<o||g<o){r+=`L${a.x},${a.y}`;continue}const m=c/u,y=h/u,x=d/g,C=f/g,w=m*x+y*C,S=Math.max(-1,Math.min(1,w)),v=Math.acos(S);if(v<o||Math.abs(Math.PI-v)<o){r+=`L${a.x},${a.y}`;continue}const _=Math.min(t/Math.sin(v/2),u/2,g/2),E=a.x-m*_,B=a.y-y*_,D=a.x+x*_,M=a.y+C*_;r+=`L${E},${B}`,r+=`Q${a.x},${a.y} ${D},${M}`}}return r}p(d0,"generateRoundedPath");function dl(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}p(dl,"calculateDeltaAndAngle");function u0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Zt[t.arrowTypeStart]){const o=Zt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=dl(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Zt[t.arrowTypeEnd]){const o=Zt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=dl(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(u0,"applyMarkerOffsetsToPoints");var qB=p((e,t,r,i)=>{t.forEach(o=>{hL[o](e,r,i)})},"insertMarkers"),zB=p((e,t,r)=>{V.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),jB=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),WB=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),HB=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),YB=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),UB=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),GB=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),XB=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),VB=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),KB=p((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),ZB=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),QB=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),JB=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),tL=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),eL=p((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),rL=p((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),iL=p((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),oL=p((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),sL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
|
|
297
297
|
L20,10
|
|
298
298
|
M20,10
|
|
299
|
-
L0,20`)},"requirement_arrow"),
|
|
299
|
+
L0,20`)},"requirement_arrow"),aL=p((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
|
|
300
300
|
L20,10
|
|
301
301
|
M20,10
|
|
302
|
-
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),oL=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),sL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),aL={extension:DB,composition:NB,aggregation:qB,dependency:zB,lollipop:jB,point:WB,circle:HB,cross:YB,barb:UB,barbNeo:XB,only_one:GB,zero_or_one:VB,one_or_more:KB,zero_or_more:ZB,only_one_neo:QB,zero_or_one_neo:JB,one_or_more_neo:tL,zero_or_more_neo:eL,requirement_arrow:rL,requirement_contains:oL,requirement_arrow_neo:iL,requirement_contains_neo:sL},c0=PB,nL={common:Pi,getConfig:Ot,insertCluster:Im,insertEdge:n0,insertEdgeLabel:o0,insertMarkers:c0,insertNode:Fh,interpolateToCurve:hh,labelHelper:ht,log:V,positionEdgeLabel:s0},Eo={},d0=g(e=>{for(const t of e)Eo[t.name]=t},"registerLayoutLoaders"),lL=g(()=>{d0([{name:"dagre",loader:g(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-CfOPJOfT.cjs")),"loader")},{name:"swimlane",loader:g(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-DeNuvXGa.cjs")),"loader")},{name:"cose-bilkent",loader:g(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-DjBFwUgZ.cjs")),"loader")}])},"registerDefaultLayoutLoaders");lL();var hL=g(async(e,t,r)=>{if(!(e.layoutAlgorithm in Eo))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const u=d.domId||d.id;d.domId=`${e.diagramId}-${u}`}const i=Eo[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,nL,{algorithm:i.algorithm},r)},"render"),cL=g((e="",{fallback:t="dagre"}={})=>{if(e in Eo)return e;if(t in Eo)return V.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Ah="comm",u0="rule",f0="decl",dL="@media",uL="@import",fL="@supports",pL="@namespace",dl="@keyframes",p0="@layer",gL="@scope",mL=Math.abs,xo=String.fromCharCode;function g0(e){return e.trim()}function ul(e,t,r){return e.replace(t,r)}function hi(e,t){return e.charCodeAt(t)|0}function Oi(e,t,r){return e.slice(t,r)}function De(e){return e.length}function m0(e){return e.length}function es(e,t){return t.push(e),e}var va=1,Ri=1,y0=0,be=0,Nt=0,ji="";function Mh(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:va,column:Ri,length:a,return:"",siblings:n}}function yL(){return Nt}function xL(){return Nt=be>0?hi(ji,--be):0,Ri--,Nt===10&&(Ri=1,va--),Nt}function Ae(){return Nt=be<y0?hi(ji,be++):0,Ri++,Nt===10&&(Ri=1,va++),Nt}function hr(){return hi(ji,be)}function gs(){return be}function Ta(e,t){return Oi(ji,e,t)}function Fo(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function CL(e){return va=Ri=1,y0=De(ji=e),be=0,[]}function bL(e){return ji="",e}function en(e){return g0(Ta(be-1,fl(e===91?e+2:e===40?e+1:e)))}function kL(e){for(;(Nt=hr())&&Nt<33;)Ae();return Fo(e)>2||Fo(Nt)>3?"":" "}function wL(e,t){for(;--t&&Ae()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return Ta(e,gs()+(t<6&&hr()==32&&Ae()==32))}function fl(e){for(;Ae();)switch(Nt){case e:return be;case 34:case 39:e!==34&&e!==39&&fl(Nt);break;case 40:e===41&&fl(e);break;case 92:Ae();break}return be}function SL(e,t){for(;Ae()&&e+Nt!==57;)if(e+Nt===84&&hr()===47)break;return"/*"+Ta(t,be-1)+"*"+xo(e===47?e:Ae())}function vL(e){for(;!Fo(hr());)Ae();return Ta(e,be)}function TL(e){return bL(ms("",null,null,null,[""],e=CL(e),0,[0],e))}function ms(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,u=0,f=0,p=0,m=1,y=1,x=1,C=0,k=0,S="",v=o,_=s,E=i,B=S;y;)switch(p=k,k=Ae()){case 40:p!=108&&hi(B,d-1)==58?(C++,B+="("):B+=en(k);break;case 41:C--,B+=")";break;case 34:case 39:case 91:B+=en(k);break;case 9:case 10:case 13:case 32:if(C>0){B+=xo(k);break}B+=kL(p);break;case 92:B+=wL(gs()-1,7);continue;case 47:switch(hr()){case 42:case 47:es(_L(SL(Ae(),gs()),t,r,l),l),(Fo(p||1)==5||Fo(hr()||1)==5)&&De(B)&&Oi(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=De(B)*x;case 125*m:case 59:case 0:if(C>0&&k){B+=xo(k);break}switch(k){case 0:case 125:y=0;case 59+h:x==-1&&(B=ul(B,/\f/g,"")),f>0&&(De(B)-d||m===0)&&es(f>32?wd(B+";",i,r,d-1,l):wd(ul(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(es(E=kd(B,t,r,c,h,o,n,S,v=[],_=[],d,s),s),k===123)if(h===0)ms(B,t,E,E,v,s,d,n,_);else{switch(u){case 99:if(hi(B,3)===110)break;case 108:if(hi(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?ms(e,E,E,i&&es(kd(e,E,E,0,0,o,n,S,o,v=[],d,_),_),o,_,d,n,i?v:_):ms(B,E,E,E,[""],_,0,n,_)}}c=h=f=0,m=x=1,S=B="",d=a;break;case 58:d=1+De(B),f=p;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&xL()==125)continue}switch(B+=xo(k),k*m){case 38:x=h>0?1:(B+="\f",-1);break;case 44:if(C>0)break;n[c++]=(De(B)-1)*x,x=1;break;case 64:hr()===45&&(B+=en(Ae())),u=hr(),h=d=De(S=B+=vL(gs())),k++;break;case 45:p===45&&De(B)==2&&(m=0)}}return s}function kd(e,t,r,i,o,s,a,n,l,c,h,d){for(var u=o-1,f=o===0?s:[""],p=m0(f),m=0,y=0,x=0;m<i;++m)for(var C=0,k=Oi(e,u+1,u=mL(y=a[m])),S=e;C<p;++C)(S=g0(y>0?f[C]+" "+k:ul(k,/&\f/g,f[C])))&&(l[x++]=S);return Mh(e,t,r,o===0?u0:n,l,c,h,d)}function _L(e,t,r,i){return Mh(e,t,r,Ah,xo(yL()),Oi(e,2,-2),0,i)}function wd(e,t,r,i,o){return Mh(e,t,r,f0,Oi(e,0,i),Oi(e,i+1,-1),i,o)}function pl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function BL(e,t,r,i){switch(e.type){case p0:if(e.children.length)break;case uL:case pL:case f0:return e.return=e.return||e.value;case Ah:return"";case dl:return e.return=e.value+"{"+pl(e.children,i)+"}";case u0:if(!De(e.value=e.props.join(",")))return""}return De(r=pl(e.children,i))?e.return=e.value+"{"+r+"}":""}function LL(e){var t=m0(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var x0="c4",EL=g(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),FL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-Cr3HwHd7.cjs"));return{id:x0,diagram:e}},"loader"),AL={id:x0,detector:EL,loader:FL},ML=AL,C0="flowchart",$L=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),OL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-Cw3lE3iu.cjs"));return{id:C0,diagram:e}},"loader"),RL={id:C0,detector:$L,loader:OL},IL=RL,b0="flowchart-v2",PL=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),DL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-Cw3lE3iu.cjs"));return{id:b0,diagram:e}},"loader"),NL={id:b0,detector:PL,loader:DL},qL=NL,k0="swimlane",zL=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),jL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-Bxz106Lt.cjs"));return{id:k0,diagram:e}},"loader"),WL={id:k0,detector:zL,loader:jL},HL=WL,w0="er",YL=g(e=>/^\s*erDiagram/.test(e),"detector"),UL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-HV9x1ciI.cjs"));return{id:w0,diagram:e}},"loader"),XL={id:w0,detector:YL,loader:UL},GL=XL,S0="gitGraph",VL=g(e=>/^\s*gitGraph/.test(e),"detector"),KL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-DDgZkg3G.cjs"));return{id:S0,diagram:e}},"loader"),ZL={id:S0,detector:VL,loader:KL},QL=ZL,v0="gantt",JL=g(e=>/^\s*gantt/.test(e),"detector"),tE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-XbcZyqEG.cjs"));return{id:v0,diagram:e}},"loader"),eE={id:v0,detector:JL,loader:tE},rE=eE,T0="info",iE=g(e=>/^\s*info/.test(e),"detector"),oE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-DM1S6-Hc.cjs"));return{id:T0,diagram:e}},"loader"),sE={id:T0,detector:iE,loader:oE},_0="pie",aE=g(e=>/^\s*pie/.test(e),"detector"),nE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-CEaHvWUM.cjs"));return{id:_0,diagram:e}},"loader"),lE={id:_0,detector:aE,loader:nE},B0="quadrantChart",hE=g(e=>/^\s*quadrantChart/.test(e),"detector"),cE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-C5CTuaUm.cjs"));return{id:B0,diagram:e}},"loader"),dE={id:B0,detector:hE,loader:cE},uE=dE,L0="xychart",fE=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),pE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-DDVfULUl.cjs"));return{id:L0,diagram:e}},"loader"),gE={id:L0,detector:fE,loader:pE},mE=gE,E0="requirement",yE=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),xE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-h_ZfNqUh.cjs"));return{id:E0,diagram:e}},"loader"),CE={id:E0,detector:yE,loader:xE},bE=CE,F0="sequence",kE=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),wE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-BE2rVf2w.cjs"));return{id:F0,diagram:e}},"loader"),SE={id:F0,detector:kE,loader:wE},vE=SE,A0="class",TE=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),_E=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-CEZdsWvZ.cjs"));return{id:A0,diagram:e}},"loader"),BE={id:A0,detector:TE,loader:_E},LE=BE,M0="classDiagram",EE=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),FE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-CEZdsWvZ.cjs"));return{id:M0,diagram:e}},"loader"),AE={id:M0,detector:EE,loader:FE},ME=AE,$0="state",$E=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),OE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-Cts12p59.cjs"));return{id:$0,diagram:e}},"loader"),RE={id:$0,detector:$E,loader:OE},IE=RE,O0="stateDiagram",PE=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),DE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-B8p1-c97.cjs"));return{id:O0,diagram:e}},"loader"),NE={id:O0,detector:PE,loader:DE},qE=NE,R0="journey",zE=g(e=>/^\s*journey/.test(e),"detector"),jE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-Cis5Fa71.cjs"));return{id:R0,diagram:e}},"loader"),WE={id:R0,detector:zE,loader:jE},HE=WE,YE=g((e,t,r)=>{V.debug(`rendering svg for syntax error
|
|
303
|
-
`);const i=
|
|
304
|
-
`;try{
|
|
302
|
+
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),nL=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),lL=p((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),hL={extension:zB,composition:jB,aggregation:WB,dependency:HB,lollipop:YB,point:UB,circle:GB,cross:XB,barb:VB,barbNeo:KB,only_one:ZB,zero_or_one:QB,one_or_more:JB,zero_or_more:tL,only_one_neo:eL,zero_or_one_neo:rL,one_or_more_neo:iL,zero_or_more_neo:oL,requirement_arrow:sL,requirement_contains:nL,requirement_arrow_neo:aL,requirement_contains_neo:lL},f0=qB,cL={common:Pi,getConfig:Ot,insertCluster:Nm,insertEdge:c0,insertEdgeLabel:n0,insertMarkers:f0,insertNode:Ah,interpolateToCurve:ch,labelHelper:ht,log:V,positionEdgeLabel:l0},Fo={},g0=p(e=>{for(const t of e)Fo[t.name]=t},"registerLayoutLoaders"),dL=p(()=>{g0([{name:"dagre",loader:p(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-qi55jjuZ.cjs")),"loader")},{name:"swimlane",loader:p(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-COEdbJMp.cjs")),"loader")},{name:"cose-bilkent",loader:p(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-gLQPpHUk.cjs")),"loader")}])},"registerDefaultLayoutLoaders");dL();var uL=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Fo))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}const i=Fo[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,cL,{algorithm:i.algorithm},r)},"render"),fL=p((e="",{fallback:t="dagre"}={})=>{if(e in Fo)return e;if(t in Fo)return V.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Mh="comm",p0="rule",m0="decl",gL="@media",pL="@import",mL="@supports",yL="@namespace",ul="@keyframes",y0="@layer",xL="@scope",CL=Math.abs,xo=String.fromCharCode;function x0(e){return e.trim()}function fl(e,t,r){return e.replace(t,r)}function hi(e,t){return e.charCodeAt(t)|0}function Oi(e,t,r){return e.slice(t,r)}function De(e){return e.length}function C0(e){return e.length}function rs(e,t){return t.push(e),e}var Ta=1,Ri=1,b0=0,be=0,Nt=0,ji="";function $h(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Ta,column:Ri,length:a,return:"",siblings:n}}function bL(){return Nt}function kL(){return Nt=be>0?hi(ji,--be):0,Ri--,Nt===10&&(Ri=1,Ta--),Nt}function Ae(){return Nt=be<b0?hi(ji,be++):0,Ri++,Nt===10&&(Ri=1,Ta++),Nt}function hr(){return hi(ji,be)}function ms(){return be}function _a(e,t){return Oi(ji,e,t)}function Ao(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function wL(e){return Ta=Ri=1,b0=De(ji=e),be=0,[]}function SL(e){return ji="",e}function rn(e){return x0(_a(be-1,gl(e===91?e+2:e===40?e+1:e)))}function vL(e){for(;(Nt=hr())&&Nt<33;)Ae();return Ao(e)>2||Ao(Nt)>3?"":" "}function TL(e,t){for(;--t&&Ae()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return _a(e,ms()+(t<6&&hr()==32&&Ae()==32))}function gl(e){for(;Ae();)switch(Nt){case e:return be;case 34:case 39:e!==34&&e!==39&&gl(Nt);break;case 40:e===41&&gl(e);break;case 92:Ae();break}return be}function _L(e,t){for(;Ae()&&e+Nt!==57;)if(e+Nt===84&&hr()===47)break;return"/*"+_a(t,be-1)+"*"+xo(e===47?e:Ae())}function BL(e){for(;!Ao(hr());)Ae();return _a(e,be)}function LL(e){return SL(ys("",null,null,null,[""],e=wL(e),0,[0],e))}function ys(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,x=1,C=0,w=0,S="",v=o,_=s,E=i,B=S;y;)switch(g=w,w=Ae()){case 40:g!=108&&hi(B,d-1)==58?(C++,B+="("):B+=rn(w);break;case 41:C--,B+=")";break;case 34:case 39:case 91:B+=rn(w);break;case 9:case 10:case 13:case 32:if(C>0){B+=xo(w);break}B+=vL(g);break;case 92:B+=TL(ms()-1,7);continue;case 47:switch(hr()){case 42:case 47:rs(EL(_L(Ae(),ms()),t,r,l),l),(Ao(g||1)==5||Ao(hr()||1)==5)&&De(B)&&Oi(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=De(B)*x;case 125*m:case 59:case 0:if(C>0&&w){B+=xo(w);break}switch(w){case 0:case 125:y=0;case 59+h:x==-1&&(B=fl(B,/\f/g,"")),u>0&&(De(B)-d||m===0)&&rs(u>32?Sd(B+";",i,r,d-1,l):Sd(fl(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(rs(E=wd(B,t,r,c,h,o,n,S,v=[],_=[],d,s),s),w===123)if(h===0)ys(B,t,E,E,v,s,d,n,_);else{switch(f){case 99:if(hi(B,3)===110)break;case 108:if(hi(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?ys(e,E,E,i&&rs(wd(e,E,E,0,0,o,n,S,o,v=[],d,_),_),o,_,d,n,i?v:_):ys(B,E,E,E,[""],_,0,n,_)}}c=h=u=0,m=x=1,S=B="",d=a;break;case 58:d=1+De(B),u=g;default:if(m<1){if(w==123)--m;else if(w==125&&m++==0&&kL()==125)continue}switch(B+=xo(w),w*m){case 38:x=h>0?1:(B+="\f",-1);break;case 44:if(C>0)break;n[c++]=(De(B)-1)*x,x=1;break;case 64:hr()===45&&(B+=rn(Ae())),f=hr(),h=d=De(S=B+=BL(ms())),w++;break;case 45:g===45&&De(B)==2&&(m=0)}}return s}function wd(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=C0(u),m=0,y=0,x=0;m<i;++m)for(var C=0,w=Oi(e,f+1,f=CL(y=a[m])),S=e;C<g;++C)(S=x0(y>0?u[C]+" "+w:fl(w,/&\f/g,u[C])))&&(l[x++]=S);return $h(e,t,r,o===0?p0:n,l,c,h,d)}function EL(e,t,r,i){return $h(e,t,r,Mh,xo(bL()),Oi(e,2,-2),0,i)}function Sd(e,t,r,i,o){return $h(e,t,r,m0,Oi(e,0,i),Oi(e,i+1,-1),i,o)}function pl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function FL(e,t,r,i){switch(e.type){case y0:if(e.children.length)break;case pL:case yL:case m0:return e.return=e.return||e.value;case Mh:return"";case ul:return e.return=e.value+"{"+pl(e.children,i)+"}";case p0:if(!De(e.value=e.props.join(",")))return""}return De(r=pl(e.children,i))?e.return=e.value+"{"+r+"}":""}function AL(e){var t=C0(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var k0="c4",ML=p(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),$L=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-BvbPlr0h.cjs"));return{id:k0,diagram:e}},"loader"),OL={id:k0,detector:ML,loader:$L},RL=OL,w0="flowchart",IL=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),PL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-QtfsGltE.cjs"));return{id:w0,diagram:e}},"loader"),DL={id:w0,detector:IL,loader:PL},NL=DL,S0="flowchart-v2",qL=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),zL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-QtfsGltE.cjs"));return{id:S0,diagram:e}},"loader"),jL={id:S0,detector:qL,loader:zL},WL=jL,v0="swimlane",HL=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),YL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-C0gqMROP.cjs"));return{id:v0,diagram:e}},"loader"),UL={id:v0,detector:HL,loader:YL},GL=UL,T0="er",XL=p(e=>/^\s*erDiagram/.test(e),"detector"),VL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-Bjm6ywZL.cjs"));return{id:T0,diagram:e}},"loader"),KL={id:T0,detector:XL,loader:VL},ZL=KL,_0="gitGraph",QL=p(e=>/^\s*gitGraph/.test(e),"detector"),JL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-Dif1CkFs.cjs"));return{id:_0,diagram:e}},"loader"),tE={id:_0,detector:QL,loader:JL},eE=tE,B0="gantt",rE=p(e=>/^\s*gantt/.test(e),"detector"),iE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-DsgcCBX-.cjs"));return{id:B0,diagram:e}},"loader"),oE={id:B0,detector:rE,loader:iE},sE=oE,L0="info",aE=p(e=>/^\s*info/.test(e),"detector"),nE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-C0lktmoS.cjs"));return{id:L0,diagram:e}},"loader"),lE={id:L0,detector:aE,loader:nE},E0="pie",hE=p(e=>/^\s*pie/.test(e),"detector"),cE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-BRnxo4U8.cjs"));return{id:E0,diagram:e}},"loader"),dE={id:E0,detector:hE,loader:cE},F0="quadrantChart",uE=p(e=>/^\s*quadrantChart/.test(e),"detector"),fE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-BUFLtZUw.cjs"));return{id:F0,diagram:e}},"loader"),gE={id:F0,detector:uE,loader:fE},pE=gE,A0="xychart",mE=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),yE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-DD-HPA7H.cjs"));return{id:A0,diagram:e}},"loader"),xE={id:A0,detector:mE,loader:yE},CE=xE,M0="requirement",bE=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),kE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-8ArbyRU3.cjs"));return{id:M0,diagram:e}},"loader"),wE={id:M0,detector:bE,loader:kE},SE=wE,$0="sequence",vE=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),TE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-Gn5MDMnL.cjs"));return{id:$0,diagram:e}},"loader"),_E={id:$0,detector:vE,loader:TE},BE=_E,O0="class",LE=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),EE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-DpeVtgCa.cjs"));return{id:O0,diagram:e}},"loader"),FE={id:O0,detector:LE,loader:EE},AE=FE,R0="classDiagram",ME=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),$E=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-DpeVtgCa.cjs"));return{id:R0,diagram:e}},"loader"),OE={id:R0,detector:ME,loader:$E},RE=OE,I0="state",IE=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),PE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-DcMx4da-.cjs"));return{id:I0,diagram:e}},"loader"),DE={id:I0,detector:IE,loader:PE},NE=DE,P0="stateDiagram",qE=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),zE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-ByTp0tao.cjs"));return{id:P0,diagram:e}},"loader"),jE={id:P0,detector:qE,loader:zE},WE=jE,D0="journey",HE=p(e=>/^\s*journey/.test(e),"detector"),YE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-BWtP4L5i.cjs"));return{id:D0,diagram:e}},"loader"),UE={id:D0,detector:HE,loader:YE},GE=UE,XE=p((e,t,r)=>{V.debug(`rendering svg for syntax error
|
|
303
|
+
`);const i=Nf(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Al(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),N0={draw:XE},VE=N0,KE={db:{},renderer:N0,parser:{parse:p(()=>{},"parse")}},ZE=KE,q0="flowchart-elk",QE=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),JE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-QtfsGltE.cjs"));return{id:q0,diagram:e}},"loader"),tF={id:q0,detector:QE,loader:JE},eF=tF,z0="timeline",rF=p(e=>/^\s*timeline/.test(e),"detector"),iF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6-DZGHbSpR.cjs"));return{id:z0,diagram:e}},"loader"),oF={id:z0,detector:rF,loader:iF},sF=oF,j0="mindmap",aF=p(e=>/^\s*mindmap/.test(e),"detector"),nF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-B2fkPG93.cjs"));return{id:j0,diagram:e}},"loader"),lF={id:j0,detector:aF,loader:nF},hF=lF,W0="kanban",cF=p(e=>/^\s*kanban/.test(e),"detector"),dF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-06pnLnb8.cjs"));return{id:W0,diagram:e}},"loader"),uF={id:W0,detector:cF,loader:dF},fF=uF,H0="sankey",gF=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),pF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-DZ8GFTQp.cjs"));return{id:H0,diagram:e}},"loader"),mF={id:H0,detector:gF,loader:pF},yF=mF,Y0="packet",xF=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),CF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-Lyxwzvru.cjs"));return{id:Y0,diagram:e}},"loader"),bF={id:Y0,detector:xF,loader:CF},U0="radar",kF=p(e=>/^\s*radar-beta/.test(e),"detector"),wF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-BwyxNljM.cjs"));return{id:U0,diagram:e}},"loader"),SF={id:U0,detector:kF,loader:wF},G0="block",vF=p(e=>/^\s*block(-beta)?/.test(e),"detector"),TF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-CHxk95XA.cjs"));return{id:G0,diagram:e}},"loader"),_F={id:G0,detector:vF,loader:TF},BF=_F,X0="treeView",LF=p(e=>/^\s*treeView-beta/.test(e),"detector"),EF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-vvSPKQUH.cjs"));return{id:X0,diagram:e}},"loader"),FF={id:X0,detector:LF,loader:EF},AF=FF,V0="architecture",MF=p(e=>/^\s*architecture/.test(e),"detector"),$F=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-D2dRhNFv.cjs"));return{id:V0,diagram:e}},"loader"),OF={id:V0,detector:MF,loader:$F},RF=OF,K0="eventmodeling",IF=p(e=>/^\s*eventmodeling/.test(e),"detector"),PF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-DSSMCztI.cjs"));return{id:K0,diagram:e}},"loader"),DF={id:K0,detector:IF,loader:PF},NF=DF,Z0="ishikawa",qF=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),zF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-FxqvFozF.cjs"));return{id:Z0,diagram:e}},"loader"),jF={id:Z0,detector:qF,loader:zF},Q0="venn",WF=p(e=>/^\s*venn-beta/.test(e),"detector"),HF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-CsNtbCv1.cjs"));return{id:Q0,diagram:e}},"loader"),YF={id:Q0,detector:WF,loader:HF},UF=YF,J0="treemap",GF=p(e=>/^\s*treemap/.test(e),"detector"),XF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-B09nXJfw.cjs"));return{id:J0,diagram:e}},"loader"),VF={id:J0,detector:GF,loader:XF},tx="wardley",KF=p(e=>/^\s*wardley-beta/i.test(e),"detector"),ZF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-DJUb0osY.cjs"));return{id:tx,diagram:e}},"loader"),QF={id:tx,detector:KF,loader:ZF},JF=QF,ex="cynefin",tA=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),eA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-BYBWPdDO.cjs"));return{id:ex,diagram:e}},"loader"),rA={id:ex,detector:tA,loader:eA},rx="railroad",iA=p(e=>/^\s*railroad-beta/i.test(e),"detector"),oA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-UM6xkPjd.cjs"));return{id:rx,diagram:e}},"loader"),sA={id:rx,detector:iA,loader:oA},ix="railroadEbnf",aA=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),nA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-DdLMeyQC.cjs"));return{id:ix,diagram:e}},"loader"),lA={id:ix,detector:aA,loader:nA},ox="railroadAbnf",hA=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),cA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-RhtDe_7N.cjs"));return{id:ox,diagram:e}},"loader"),dA={id:ox,detector:hA,loader:cA},sx="railroadPeg",uA=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),fA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-mbYpu4tr.cjs"));return{id:sx,diagram:e}},"loader"),gA={id:sx,detector:uA,loader:fA},vd=!1,Ba=p(()=>{vd||(vd=!0,Ts("error",ZE,e=>e.toLowerCase().trim()==="error"),Ts("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),xn(eF,hF,RF),xn(RL,fF,RE,AE,ZL,sE,lE,dE,SE,BE,GL,WL,NL,sF,eE,WE,NE,GE,pE,yF,bF,CE,BF,NF,AF,SF,jF,VF,sA,lA,dA,gA,UF,JF,rA))},"addDiagrams"),pA=p(async()=>{V.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Pr).map(async([r,{detector:i,loader:o}])=>{if(o)try{Sn(r)}catch{try{const{diagram:s,id:a}=await o();Ts(a,s,i)}catch(s){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Pr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){V.error(`Failed to load ${t.length} external diagrams`);for(const r of t)V.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),mA="graphics-document document";function ax(e,t){e.attr("role",mA),t!==""&&e.attr("aria-roledescription",t)}p(ax,"setA11yDiagramInfo");function nx(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(nx,"addSVGa11yTitleDescription");var Or,ml=(Or=class{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static async fromText(t,r={}){const i=Ot(),o=El(t,i);t=AT(t)+`
|
|
304
|
+
`;try{Sn(o)}catch{const c=U1(o);if(!c)throw new Tu(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();Ts(h,d)}const{db:s,parser:a,renderer:n,init:l}=Sn(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new Or(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(Or,"Diagram"),Or),Td=[],yA=p(()=>{Td.forEach(e=>{e()}),Td=[]},"attachFunctions"),xA=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function lx(e){const t=e.match(vu);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
|
|
305
305
|
`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
|
|
306
|
-
`):t[2];let o=
|
|
307
|
-
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),
|
|
306
|
+
`):t[2];let o=wp(i,{schema:kp})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}p(lx,"extractFrontMatter");var CA=p(e=>e.replace(/\r\n?/g,`
|
|
307
|
+
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),bA=p(e=>{const{text:t,metadata:r}=lx(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),kA=p(e=>{const t=xe.detectInit(e)??{},r=xe.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:kT(e),directive:t}},"processDirectives");function Oh(e){const t=CA(e),r=bA(t),i=kA(r.text),o=ya(r.config,i.directive);return e=xA(i.text),{code:e,title:r.title,config:o}}p(Oh,"preprocessDiagram");function hx(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(hx,"toBase64");var wA=5e4,SA="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",vA="sandbox",TA="loose",_A="http://www.w3.org/2000/svg",BA="http://www.w3.org/1999/xlink",LA="http://www.w3.org/1999/xhtml",EA="100%",FA="100%",AA="border:0;margin:0;",MA="margin:0",$A="allow-top-navigation-by-user-activation allow-popups",OA='The "iframe" tag is not supported by your browser.',RA=["foreignobject"],IA=["dominant-baseline"];function Rh(e){const t=Oh(e);return Ss(),j1(t.config??{}),t}p(Rh,"processAndSetConfigs");async function cx(e,t){Ba();try{const{code:r,config:i}=Rh(e);return{diagramType:(await ux(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(cx,"parse");var _d=p((e,t,r=[])=>{const i=xu(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),PA=p((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=ee(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Nc(l.styles)||n.forEach(c=>{r.insertRule(_d(l.id,c,l.styles),r.cssRules.length)}),Nc(l.textStyles)||r.insertRule(_d(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=wn(o)+`
|
|
308
308
|
`}else i+=`${e.themeCSS}
|
|
309
|
-
`;return i+
|
|
310
|
-
${
|
|
311
|
-
</iframe>`},"putIntoIFrame"),_d=g((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",SA);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function ml(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(ml,"sandboxedIframe");var NA=g((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),qA=g(async function(e,t,r){_a();const i=Oh(t);t=i.code;const o=Ot();V.debug(o),t.length>(o?.maxTextSize??CA)&&(t=bA);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=g(()=>{const q=yt(u?n:c).node();q&&"remove"in q&&q.remove()},"removeTempElements");let d=yt(document.body);const u=o.securityLevel===kA,f=o.securityLevel===wA,p=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),u){const U=ml(yt(r),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);_d(d,e,l,`font-family: ${p}`,vA)}else{if(NA(document,e,l,a),u){const U=ml(yt(document.body),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");_d(d,e,l)}let m,y;try{m=await gl.fromText(t,{title:i.title})}catch(U){if(o.suppressErrorRendering)throw h(),U;m=await gl.fromText("error"),y=U}const x=d.select(c).node(),C=m.type,k=x.firstChild,S=k.firstChild,v=m.renderer.getClasses?.(t,m),_=IA(o,C,v,s),E=document.createElement("style");E.innerHTML=_,k.insertBefore(E,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(U){throw o.suppressErrorRendering?h():UE.draw(t,e,"11.16.0"),U}const B=d.select(`${c} svg`),I=m.db.getAccTitle?.(),M=m.db.getAccDescription?.();cx(C,B,I,M),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",TA);let D=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),D=PA(D,u,Ye(o.arrowMarkerAbsolute)),u){const U=d.select(c+" svg").node();D=DA(D,U)}else f||(D=Ti.sanitize(D,{ADD_TAGS:MA,ADD_ATTR:$A,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(pA(),y)throw y;return h(),{diagramType:C,svg:D,bindFunctions:m.db.bindFunctions}},"render");function lx(e={}){const t=qt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),P1(t),t?.theme&&t.theme in tr?t.themeVariables=tr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=tr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?I1(t):mu();Tl(r.logLevel),_a()}g(lx,"initialize");var hx=g((e,t={})=>{const{code:r}=$h(e);return gl.fromText(r,t)},"getDiagramFromText");function cx(e,t,r,i){ix(t,e),ox(t,r,i,t.attr("id"))}g(cx,"addA11yInfo");var zr=Object.freeze({render:qA,parse:nx,getDiagramFromText:hx,initialize:lx,getConfig:Ot,setConfig:yu,getSiteConfig:mu,updateSiteConfig:D1,reset:g(()=>{ws()},"reset"),globalReset:g(()=>{ws(Bi)},"globalReset"),defaultConfig:Bi});Tl(Ot().logLevel);ws(Ot());var zA=g((e,t,r)=>{V.warn(e),ph(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),dx=g(async function(e={querySelector:".mermaid"}){try{await jA(e)}catch(t){if(ph(t)&&V.error(t.str),ir.parseError&&ir.parseError(t),!e.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),t}},"run"),jA=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=zr.getConfig();V.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),zr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new xe.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=pm(xe.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=xe.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:u}=await gx(c,a,l);l.innerHTML=d,e&&await e(c),u&&u(l)}catch(d){zA(d,n,ir.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),ux=g(function(e){zr.initialize(e)},"initialize"),WA=g(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&ux(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await dx(i)},"init"),HA=g(async(e,{lazyLoad:t=!0}={})=>{_a(),yn(...e),t===!1&&await uA()},"registerExternalDiagrams"),fx=g(function(){if(ir.startOnLoad){const{startOnLoad:e}=zr.getConfig();e&&ir.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",fx,!1);var YA=g(function(e){ir.parseError=e},"setParseErrorHandler"),Ks=[],rn=!1,px=g(async()=>{if(!rn){for(rn=!0;Ks.length>0;){const e=Ks.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}rn=!1}},"executeQueue"),UA=g(async(e,t)=>new Promise((r,i)=>{const o=g(()=>new Promise((s,a)=>{zr.parse(e,t).then(n=>{s(n),r(n)},n=>{V.error("Error parsing",n),ir.parseError?.(n),a(n),i(n)})}),"performCall");Ks.push(o),px().catch(i)}),"parse"),gx=g((e,t,r)=>new Promise((i,o)=>{const s=g(()=>new Promise((a,n)=>{zr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),ir.parseError?.(l),n(l),o(l)})}),"performCall");Ks.push(s),px().catch(o)}),"render"),XA=g(()=>Object.keys(Pr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ir={startOnLoad:!0,mermaidAPI:zr,parse:UA,render:gx,init:WA,run:dx,registerExternalDiagrams:HA,registerLayoutLoaders:d0,initialize:ux,parseError:void 0,contentLoaded:fx,setParseErrorHandler:YA,detectType:Ll,registerIconPacks:em,getRegisteredDiagramsMetadata:XA},yl=ir;const jr="flex size-11 items-center justify-center rounded border p-1 shadow",GA="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",VA="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Bd="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",mx="both-shift",Ld=Object.freeze({none:Object.freeze({panTrigger:null,zoom:!1}),zoom:Object.freeze({panTrigger:null,zoom:!0}),pan:Object.freeze({panTrigger:"drag",zoom:!1}),"pan-shift":Object.freeze({panTrigger:"shift-drag",zoom:!1}),both:Object.freeze({panTrigger:"drag",zoom:!0}),"both-shift":Object.freeze({panTrigger:"shift-drag",zoom:!0})}),KA=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),ZA=Object.freeze(["none","zoom","pan","both"]),QA=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),ys=.3,JA=3,tM=2,Lr=.5,eM=1;function Ed(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const rM=0;function on(e,t,r){return e.panTrigger===null||t.button!==rM?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function iM(e,t){return e.zoom&&t.shiftKey}function oM(e){if(e===null)return null;const t=e.trim().split(/[\s,]+/u),r=t.length===4?Number(t[2]):Number.NaN;if(!(Number.isFinite(r)&&r>0))throw new Error(`[@aiquants/markdown] MermaidDiagram: the drawing has no usable viewBox (${JSON.stringify(e)})`);return r}function sM(e,t){if(!(Number.isFinite(e)&&e>0&&(t===null||Number.isFinite(t)&&t>0)))throw new Error(`[@aiquants/markdown] MermaidDiagram: cannot fit a drawing ${t} px wide into a frame ${e} px wide`);return t===null?1:Math.min(1,e/t)}function aM(e){if(!(Number.isFinite(e)&&e>0&&e<=1))throw new Error(`[@aiquants/markdown] MermaidDiagram: the fit scale must be in (0, 1], got ${e}`);return{minScale:1,maxScale:tM/e}}function sn(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function eo(e,t,r,i,o){return{scale:t,x:e.x+(i.x-o.origin.x)/t-(r.x-o.origin.x)/e.scale,y:e.y+(i.y-o.origin.y)/t-(r.y-o.origin.y)/e.scale}}function nM(e,t,r){const i=(o,s,a,n)=>{const l=(0-s)/e.scale,c=(n-s-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),o))};return{scale:e.scale,x:i(e.x,t.origin.x,t.inline,r.inline),y:i(e.y,t.origin.y,t.block,r.block)}}function lM(e,t,r){return e*t.inline-r.inline>Lr||e*t.block-r.block>Lr}function hM(e,t){const r=s=>Math.hypot(s[1].x-s[0].x,s[1].y-s[0].y),i=s=>({x:(s[0].x+s[1].x)/2,y:(s[0].y+s[1].y)/2}),o=r(e);return o<eM?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function Fd(e){return e*(1-Math.exp(-ys))}function Ad(e,t,r){const i=e<-Lr||e>Lr;return t-e>r+Lr?i?0-e:0:e<-Lr?0-e:t>r+Lr?r-t:0}const Ba=Object.freeze({interactionMode:{text:"マウス操作モード",lang:"ja"},interactionModeTouch:{text:"タッチ操作モード",lang:"ja"},modeNone:{text:"操作なし",lang:"ja"},modeZoom:{text:"拡大縮小のみ",lang:"ja"},modePan:{text:"移動のみ (左ドラッグ)",lang:"ja"},modePanShift:{text:"移動のみ (Shift+ドラッグ)",lang:"ja"},modeBoth:{text:"拡大縮小+移動 (左ドラッグ)",lang:"ja"},modeBothShift:{text:"拡大縮小+移動 (Shift+ドラッグ)",lang:"ja"},modeNoneTouch:{text:"操作なし (指はページをスクロール)",lang:"ja"},modeZoomTouch:{text:"拡大縮小のみ (2 本指)",lang:"ja"},modePanTouch:{text:"移動のみ (はみ出す図を 1 本指でドラッグ)",lang:"ja"},modeBothTouch:{text:"拡大縮小+移動 (2 本指・はみ出す図は 1 本指)",lang:"ja"},zoomIn:{text:"Zoom In",lang:"en"},zoomOut:{text:"Zoom Out",lang:"en"},resetView:{text:"Reset View",lang:"en"},panUp:{text:"Pan Up",lang:"en"},panDown:{text:"Pan Down",lang:"en"},panLeft:{text:"Pan Left",lang:"en"},panRight:{text:"Pan Right",lang:"en"},diagram:{text:"Diagram (arrow keys pan, + and - zoom, 0 resets)",lang:"en"},retry:{text:"再試行",lang:"ja"}}),cM=Qs(Ba),dM=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),uM=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),yx="(pointer: coarse)",fM=e=>{const t=window.matchMedia(yx);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},pM=()=>window.matchMedia(yx).matches,gM=()=>!1,mM=()=>L.useSyncExternalStore(fM,pM,gM),Rh=(e,t)=>{const[r,i]=L.useState(null),o=r!==null&&e.includes(r)?r:e[0],s=l=>l instanceof Element?l.getAttribute(t):null;return{onKeyDown:l=>{const c=s(l.target);if(c===null||l.altKey||l.ctrlKey||l.metaKey||l.shiftKey)return;const h=e.indexOf(c);if(h===-1)return;const d=l.currentTarget.ownerDocument.defaultView?.getComputedStyle(l.currentTarget).direction==="rtl",u=d?"ArrowLeft":"ArrowRight",f=d?"ArrowRight":"ArrowLeft";let p;switch(l.key){case u:p=(h+1)%e.length;break;case f:p=(h-1+e.length)%e.length;break;case"Home":p=0;break;case"End":p=e.length-1;break;default:return}l.preventDefault(),l.currentTarget.querySelector(`[${t}="${e[p]}"]`)?.focus()},onFocus:l=>{const c=s(l.target);c!==null&&e.includes(c)&&i(c)},tabIndexOf:l=>l===o?0:-1}},xx=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[a,n]=L.useState(null),[l,c]=L.useState(!1),h=a!==null,d=L.useId(),u=L.useId(),f=L.useRef(null),p=L.useRef(null),m=L.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{n(null),c(!1),S&&p.current?.focus()};L.useLayoutEffect(()=>{const S=m.current;if(a===null||S===null)return;const v=S.ownerDocument.defaultView,_=S.ownerDocument.documentElement.clientWidth,E=S.getBoundingClientRect();(v?.getComputedStyle(S).direction==="rtl"?E.left<0:E.right>_)&&c(!0);const I=y(),M=I.findIndex(U=>U.getAttribute("aria-checked")==="true"),D=a==="last"?I.length-1:Math.max(M,0);I[D]?.focus()},[a]),L.useEffect(()=>{const S=f.current?.ownerDocument;if(!h||S===void 0)return;const v=_=>{_.target instanceof Node&&f.current?.contains(_.target)===!0||(n(null),c(!1))};return S.addEventListener("pointerdown",v,!0),S.addEventListener("focusin",v,!0),()=>{S.removeEventListener("pointerdown",v,!0),S.removeEventListener("focusin",v,!0)}},[h]);const C=S=>{if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),n(S.key==="ArrowUp"?"last":"chosen");return}S.key==="Escape"&&h&&(S.preventDefault(),S.stopPropagation(),x(!1))},k=S=>{const v=y(),_=v.indexOf(S.target);let E;switch(S.key){case"ArrowDown":E=(_+1)%v.length;break;case"ArrowUp":E=(_-1+v.length)%v.length;break;case"Home":E=0;break;case"End":E=v.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),v[E]?.focus()};return w.jsxs("div",{ref:f,className:"relative",children:[w.jsx("button",{ref:p,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):n("chosen"),onKeyDown:C,className:jr,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?u:void 0,children:i}),h&&w.jsx("div",{ref:m,id:u,role:"menu","aria-labelledby":d,...t,"data-aqmd-control-menu":l?"end":"start",onKeyDown:k,className:VA,children:s.map(S=>{const v=()=>{x(!0),S.onSelect()};return S.checked===void 0?w.jsx("button",{type:"button",role:"menuitem",tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Bd,children:w.jsx("span",{children:S.label.text})},S.key):w.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":S.checked,tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Bd,children:[w.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),w.jsx("span",{children:S.label.text})]},S.key)})})]})},Md=new Set(["gantt"]),yM=200,xM=300,CM=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),bM="data-aqmd-mermaid-host",kM=e=>{const t=document.createElement("div");return t.setAttribute(bM,""),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.insetBlockStart="0",t.style.insetInlineStart=`${-e}px`,t.style.width=`${e}px`,t.style.visibility="hidden",t.style.contain="strict",document.body.append(t),t};let $d=Promise.resolve();const wM=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},Od=e=>{e.resetStyle(),e.destroy()},an=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",SM=Object.freeze({visibility:"hidden"});let Cx=!1,xl=null;if(yl?.initialize)try{yl.initialize({startOnLoad:!1}),Cx=!0}catch(e){xl=e instanceof Error?e:new Error(String(e))}else xl=new Error("Mermaid library or mermaid.initialize is not available.");const bx=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=L.useMemo(()=>_i(Ba,i),[i]),a=L.useId(),n=L.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),l=L.useRef(0),c=L.useRef(null),h=L.useRef(null),d=L.useRef(null),u=L.useRef(null),[f,p]=L.useState(!0),[m,y]=L.useState(null),[x,C]=L.useState(null),[k,S]=L.useState(0),v=L.useRef(!1),_=mM(),[E,B]=L.useState(t??mx),I=L.useRef(Ld[E]),M=L.useRef(!1),[D,U]=L.useState(!1);L.useEffect(()=>{t&&B(t)},[t]),L.useEffect(()=>{I.current=Ld[E],u.current?.refresh()},[E]),L.useEffect(()=>{if(p(!0),y(null),C(null),!Cx){y(xl?.message||"Mermaid failed to initialize globally."),p(!1);return}const T=e.trim();if(T===""){p(!1);return}const W=c.current;if(!W)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let z=!1,G=0,X=null,K=W.offsetWidth,Q=null,nt,gt;const ut=()=>{Ht.disconnect(),clearTimeout(nt)},mt=Yt=>{Q=null,ut(),y(Yt),C(null),p(!1)},Lt=Yt=>{l.current+=1;const Qt=l.current;G=Qt,X=Yt;const we=()=>!z&&Qt===G,Se=async()=>{const _t=kM(Yt);try{return await yl.render(`${n.current}-${Qt}`,T,_t)}finally{_t.remove()}};$d=$d.then(()=>we()?Se().then(_t=>{if(we()){if(typeof _t.svg!="string"||_t.svg.length===0){mt("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}Q=_t.diagramType,C({svg:_t.svg,bindFunctions:typeof _t.bindFunctions=="function"?_t.bindFunctions:null}),p(!1),Md.has(_t.diagramType)?K!==Yt&&Ft():Ht.disconnect()}}).catch(_t=>{if(we()){if(console.error(`[MermaidDiagram ${n.current}] Error rendering Mermaid diagram:`,_t),wM(_t)&&!v.current){v.current=!0,gt=setTimeout(()=>S(Ct=>Ct+1),xM);return}mt(_t instanceof Error?_t.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Ft=()=>{clearTimeout(nt),nt=setTimeout(()=>{K>0&&K!==X&&Lt(K)},yM)},Mt=()=>{const Yt=W.offsetWidth;if(Yt!==K){if(K=Yt,X===null){Yt>0&&Lt(Yt);return}Q!==null&&Md.has(Q)&&Ft()}},Ht=new ResizeObserver(Mt);return Ht.observe(W),K>0&&Lt(K),()=>{z=!0,ut(),clearTimeout(gt)}},[e,k]),L.useEffect(()=>{const T=h.current;if(!T)return;const W=()=>{u.current=null,d.current&&(Od(d.current),d.current=null),M.current=!1,U(!1)};if(!x){T.innerHTML="",W();return}T.innerHTML=x.svg;const z=T.querySelector("svg");let G=!1,X;const K=[];if(z){let Q;try{Q=oM(z.getAttribute("viewBox"))}catch(ut){console.error(`[MermaidDiagram ${n.current}] Cannot size the drawing:`,ut),y(ut instanceof Error?ut.message:String(ut)),C(null);return}const nt=Q,gt=()=>{if(G)return;const ut=z.getBBox();if(!ut||ut.width===0||ut.height===0){X=setTimeout(gt,100);return}d.current&&Od(d.current);const mt=su(z,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:ys,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:Ed(I.current,!1)});d.current=mt;let Lt={minScale:1,maxScale:1};const Ft=()=>{const J=mt.getPan();return{scale:mt.getScale(),x:J.x,y:J.y}},Mt=()=>{const J=T.getBoundingClientRect(),ft=z.getBoundingClientRect(),{scale:xt,x:Dt,y:At}=Ft();return{frameRect:J,frame:{inline:J.width,block:J.height},drawing:{origin:{x:ft.left-J.left-xt*Dt,y:ft.top-J.top-xt*At},inline:ft.width/xt,block:ft.height/xt}}},Ht=()=>{if(G)return;const{frame:J,drawing:ft}=Mt(),xt=lM(mt.getScale(),ft,J);M.current=xt,U(xt),br(xt),mt.setOptions({touchAction:Ed(I.current,xt)}),T.style.cursor=an(I.current,Ct?.kind==="pan"&&Ct.mouse)},Yt=()=>{const J=T.getBoundingClientRect().width;J<=0||(Lt=aM(sM(J,nt)),mt.setOptions({minScale:Lt.minScale,maxScale:Lt.maxScale}))},Qt=J=>{const ft=Ft(),{frame:xt,drawing:Dt}=Mt(),At=nM({...J,scale:sn(J.scale,Lt)},Dt,xt);return At.scale===ft.scale&&At.x===ft.x&&At.y===ft.y?!1:(mt.zoom(At.scale,{animate:!1,force:!0,silent:!0}),mt.pan(At.x,At.y,{animate:!1,force:!0}),Ht(),!0)},we=(J,ft)=>{const{drawing:xt}=Mt();return Qt(eo(Ft(),sn(J,Lt),ft,ft,xt))},Se=J=>{const ft=T.getBoundingClientRect();return{x:J.x-ft.left,y:J.y-ft.top}};u.current={zoomBy:J=>{const{frame:ft}=Mt();we(mt.getScale()*Math.exp(J*ys),{x:ft.inline/2,y:ft.block/2})},panBy:(J,ft)=>{const{drawing:xt}=Mt(),Dt=Ft();return Qt(eo(Dt,Dt.scale,{x:0,y:0},{x:J,y:ft},xt))},reset:()=>{Qt({scale:1,x:0,y:0})},panSteps:()=>{const{frame:J}=Mt();return{x:Fd(J.inline),y:Fd(J.block)}},refresh:Ht};const _t=new Map;let Ct=null;const ve=J=>({x:J.clientX,y:J.clientY}),Yr=()=>{const J=[..._t.values()];return J.length===2?[J[0],J[1]]:null},ge=J=>{if(_t.has(J.pointerId)&&_t.set(J.pointerId,ve(J)),Ct?.kind==="pinch"){const ft=Yr();if(ft===null)return;const xt=hM(Ct.last,ft);if(Ct={kind:"pinch",last:ft},xt===null)return;const{drawing:Dt}=Mt(),At=Ft();Qt(eo(At,sn(At.scale*xt.ratio,Lt),Se(xt.from),Se(xt.to),Dt));return}if(Ct?.kind==="pan"&&Ct.pointerId===J.pointerId){const ft=ve(J),{drawing:xt}=Mt(),Dt=Ft();Qt(eo(Dt,Dt.scale,Se(Ct.last),Se(ft),xt)),Ct={...Ct,last:ft}}},sr=()=>{window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",Xe),window.removeEventListener("pointercancel",Xe)},xr=()=>{sr(),window.addEventListener("pointermove",ge),window.addEventListener("pointerup",Xe),window.addEventListener("pointercancel",Xe)},Xe=J=>{if(_t.delete(J.pointerId),Ct?.kind==="pinch"){const[ft]=[..._t.entries()];Ct=ft!==void 0&&on(I.current,{button:0,shiftKey:!1,pointerType:J.pointerType},M.current)?{kind:"pan",pointerId:ft[0],last:ft[1],mouse:!1}:null}else Ct?.kind==="pan"&&Ct.pointerId===J.pointerId&&(Ct=null);Ct===null&&_t.size===0&&sr(),T.style.cursor=an(I.current,Ct?.kind==="pan"&&Ct.mouse)},Cr=J=>{const ft=I.current;if(J.pointerType==="touch"||J.pointerType==="pen"){_t.set(J.pointerId,ve(J)),xr();const xt=Yr();xt!==null&&ft.zoom?Ct={kind:"pinch",last:xt}:_t.size>1?Ct?.kind==="pan"&&!Ct.mouse&&(Ct=null):on(ft,J,M.current)&&(Ct={kind:"pan",pointerId:J.pointerId,last:ve(J),mouse:!1});return}on(ft,J,M.current)&&(Ct={kind:"pan",pointerId:J.pointerId,last:ve(J),mouse:!0},T.style.cursor=an(ft,!0),xr(),J.preventDefault())},Ur=J=>{Ct!==null&&!(Ct.kind==="pan"&&Ct.mouse)&&J.cancelable&&J.preventDefault()};let ar=!1;const br=J=>{J!==ar&&(ar=J,J?T.addEventListener("touchmove",Ur,{passive:!1}):T.removeEventListener("touchmove",Ur))},Re=J=>{const ft=J.target;if(!(ft instanceof Element)||ft===z||!z.contains(ft))return;const xt=T.getBoundingClientRect(),Dt=ft.getBoundingClientRect(),At={x:Ad(Dt.left-xt.left,Dt.right-xt.left,xt.width),y:Ad(Dt.top-xt.top,Dt.bottom-xt.top,xt.height)};if(At.x===0&&At.y===0)return;const{drawing:Xr}=Mt(),Gr=Ft();Qt(eo(Gr,Gr.scale,{x:0,y:0},At,Xr))},Te=J=>{if(!iM(I.current,J))return;const ft=J.deltaY===0?J.deltaX:J.deltaY;ft!==0&&(J.preventDefault(),we(mt.getScale()*Math.exp(Math.sign(-ft)*ys/JA),Se(ve(J))))},kr=new ResizeObserver(()=>{Yt(),Qt(Ft()),Ht()});T.addEventListener("pointerdown",Cr),T.addEventListener("focusin",Re),T.addEventListener("wheel",Te,{passive:!1}),z.addEventListener("panzoomchange",Ht),kr.observe(T),K.push(()=>{T.removeEventListener("pointerdown",Cr),T.removeEventListener("focusin",Re),br(!1),T.removeEventListener("wheel",Te),z.removeEventListener("panzoomchange",Ht),kr.disconnect(),sr()}),Yt(),Ht()};gt()}return x.bindFunctions&&x.bindFunctions(T),()=>{G=!0,clearTimeout(X);for(const Q of K)Q();W()}},[x]);const q=L.useCallback(T=>{const W=u.current;if(W===null||T.target!==T.currentTarget||T.altKey||T.ctrlKey||T.metaKey)return;const z=W.panSteps();let G;switch(T.key){case"ArrowLeft":G=W.panBy(z.x,0);break;case"ArrowRight":G=W.panBy(-z.x,0);break;case"ArrowUp":G=W.panBy(0,z.y);break;case"ArrowDown":G=W.panBy(0,-z.y);break;case"+":case"=":W.zoomBy(1),G=!0;break;case"-":W.zoomBy(-1),G=!0;break;case"0":W.reset(),G=!0;break;default:G=!1}G&&T.preventDefault()},[]),N=L.useMemo(()=>[...r?[]:["mode"],"zoom-in","zoom-out","reset",...D?["pan-left","pan-up","pan-down","pan-right"]:[]],[r,D]),{onKeyDown:A,onFocus:F,tabIndexOf:P}=Rh(N,"data-aqmd-mermaid-control"),O=(T,W,z,G,X=!1)=>w.jsx("button",{type:"button","data-aqmd-mermaid-control":T,tabIndex:P(T),onClick:z,style:X?SM:void 0,className:jr,"aria-label":s[W].text,lang:s[W].lang,children:G},T),$=T=>{const W=u.current;if(W===null)return;const z=W.panSteps();W.panBy(T.x*z.x,T.y*z.y)};let j;if(f)j=w.jsx("div",{className:"flex h-32 items-center justify-center bg-white dark:bg-gray-800 dark:text-white",children:"🌀 Loading diagram..."});else if(m)j=w.jsxs("div",{"data-aqmd-mermaid-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[w.jsxs("div",{children:["Error: ",m]}),w.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{v.current=!1,y(null),S(T=>T+1)},lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[w.jsx(gn,{className:"h-4 w-4"}),s.retry.text]})]});else{const T=s[_?"interactionModeTouch":"interactionMode"],W=_?ZA.map(z=>({value:z,label:s[uM[z]],checked:QA[E]===z})):KA.map(z=>({value:z,label:s[dM[z]],checked:E===z}));j=w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":a,onKeyDown:A,onFocus:F,className:"mb-1 flex flex-wrap items-start gap-1",children:[!r&&w.jsx(xx,{buttonHook:{"data-aqmd-mermaid-control":"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:T,icon:w.jsx(Jb,{size:18}),tabIndex:P("mode"),items:W.map(({value:z,label:G,checked:X})=>({key:z,label:G,checked:X,onSelect:()=>B(z)}))}),O("zoom-in","zoomIn",()=>u.current?.zoomBy(1),w.jsx(au,{size:20})),O("zoom-out","zoomOut",()=>u.current?.zoomBy(-1),w.jsx(nu,{size:20})),O("reset","resetView",()=>u.current?.reset(),w.jsx(gn,{size:18})),O("pan-left","panLeft",()=>$({x:1,y:0}),w.jsx(Ub,{size:18}),!D),O("pan-up","panUp",()=>$({x:0,y:1}),w.jsx(Kb,{size:18}),!D),O("pan-down","panDown",()=>$({x:0,y:-1}),w.jsx(Hb,{size:18}),!D),O("pan-right","panRight",()=>$({x:-1,y:0}),w.jsx(Gb,{size:18}),!D)]}),w.jsx("span",{id:a,hidden:!0,lang:s.diagram.lang,children:s.diagram.text}),w.jsx("div",{ref:h,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":D?"true":"false",role:"group",tabIndex:0,"aria-labelledby":a,onKeyDown:q,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return w.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":o,children:[w.jsx("div",{ref:c,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:CM}),j]})};bx.displayName="MermaidDiagramInternal";const Ih=L.memo(bx),vM="unicodeTextInMathMode",TM="noCharacterMetrics",_M=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,BM="consoleCommand",LM=e=>{const t=(r,i)=>o=>(i(o),e(BM,`${r} is ignored: a formula does not write to the console`),"");return{"\\message":t("\\message",r=>r.consumeArgs(1)),"\\errmessage":t("\\errmessage",r=>r.consumeArgs(1)),"\\show":t("\\show",r=>r.popToken())}},kx=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=vr.get(r);if(i!==void 0)return vr.delete(r),vr.set(r,i),i;const o=FM(e,t);return vr.set(r,o),vr.size>EM&&vr.delete(vr.keys().next().value),o},EM=610,vr=new Map,FM=(e,t)=>{const r=[],i=(s,a)=>{r.push({code:s,message:a,formula:e,displayMode:t})},o=console.warn;console.warn=(...s)=>{const[a]=s;if(s.length===1&&typeof a=="string"&&_M.test(a)){i(TM,a);return}o.apply(console,s)};try{const s=yC.renderToString(e,{displayMode:t,throwOnError:!1,macros:LM(i),strict:(a,n)=>(a!==vM&&i(a,n),"ignore")});return Object.freeze({html:s,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=o}};const AM=[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]],MM=Tt("align-horizontal-space-around",AM);const $M=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],OM=Tt("chevron-down",$M);const RM=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],wx=Tt("copy",RM);const IM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],PM=Tt("download",IM);const DM=[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]],NM=Tt("fold-horizontal",DM);const qM=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],zM=Tt("fold-vertical",qM);const jM=[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]],WM=Tt("highlighter",jM);const HM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],YM=Tt("maximize-2",HM);const UM=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],XM=Tt("minimize-2",UM);const GM=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],VM=Tt("ruler",GM);const KM=[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]],ZM=Tt("unfold-horizontal",KM);const QM=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],JM=Tt("unfold-vertical",QM),Sx=24,t5=1,e5=1,r5=Object.freeze({}),nn=e=>{const{rows:t,cols:r}=Zs.measureTsv(e);return t*r},i5=26,o5=(e,t,r)=>{const i=e.length>t?Math.min(r,t):0,o=e.slice(0,t-i).map((a,n)=>({index:n,cells:a})),s=e.slice(e.length-i).map((a,n)=>({index:e.length-i+n,cells:a}));return[...o,...s]},s5=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),a5=3,n5=e=>Math.max(1,Math.min(a5,e)),l5=(e,t)=>(oe.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX+e*Sx)*t+oe.SPREADSHEET_SCROLLBAR_SIZE_PX,Cl=e=>Math.round(e*100),h5=(e,t,r)=>{if(t===0&&r===0)return e;const i=(e[0]?.length??0)+r,o=r===0?[...e]:e.map(s=>[...s,...Array(r).fill("")]);for(let s=0;s<t;s+=1)o.push(Array(i).fill(""));return o},Ph=e=>{let t=e.length;for(;t>1&&e[t-1].every(s=>s==="");)t-=1;const r=e[0]?.length??0;let i=r;const o=s=>{for(let a=0;a<t;a+=1)if(e[a][s]!=="")return!1;return!0};for(;i>1&&o(i-1);)i-=1;return t===0||i===0?[[""]]:t===e.length&&i===r?e:e.slice(0,t).map(s=>i===r?s:s.slice(0,i))},rs=e=>Ph(Zs.parseTsv(e)),c5=["format","hyperlink","note","comments","validation"],d5=(e,t)=>{const r=new Map;let i=!1,o=!1;for(const s of t){if(!(Number.isInteger(s.row)&&Number.isInteger(s.col))||s.row<0||s.row>=e.length||s.col<0||s.col>=e[s.row].length)throw new RangeError(`[@aiquants/markdown] spreadsheet edit outside the table: row ${s.row}, column ${s.col}`);if(c5.some(l=>s[l]!==void 0&&s[l]!==null)&&(i=!0),s.text===void 0)continue;o=!0;const a=s.text.replace(/\r\n?/gu,`
|
|
312
|
-
`),n=r.get(s.row);if(n!==void 0)n[s.col]=a;else if(e[s.row][s.col]!==a){const l=[...e[s.row]];l[s.col]=a,r.set(s.row,l)}}if(r.size>0){const s=[...e];for(const[a,n]of r)s[a]=n;return{kind:"applied",matrix:s}}return i&&!o?{kind:"format-only"}:{kind:"unchanged"}},
|
|
309
|
+
`;return i+wn(r)},"createCssStyles"),DA=p((e,t)=>pl(LL(`${e}{${t}}`),AL([p(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===ul)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[gL,mL,y0,xL,"@container","@starting-style"],ul].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Mh))},"addNamespace"),FL])),"compileCSS"),NA=p((e,t,r,i)=>{const o=PA(e,r),s=hk(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return DA(i,s)},"createUserStyles"),qA=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=gr(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),zA=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":FA,i=hx(`<body style="${MA}">${e}</body>`);return`<iframe style="width:${EA};height:${r};${AA}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${$A}">
|
|
310
|
+
${OA}
|
|
311
|
+
</iframe>`},"putIntoIFrame"),Bd=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",_A);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function yl(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(yl,"sandboxedIframe");var jA=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),WA=p(async function(e,t,r){Ba();const i=Rh(t);t=i.code;const o=Ot();V.debug(o),t.length>(o?.maxTextSize??wA)&&(t=SA);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const N=yt(f?n:c).node();N&&"remove"in N&&N.remove()},"removeTempElements");let d=yt(document.body);const f=o.securityLevel===vA,u=o.securityLevel===TA,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const U=yl(yt(r),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);Bd(d,e,l,`font-family: ${g}`,BA)}else{if(jA(document,e,l,a),f){const U=yl(yt(document.body),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");Bd(d,e,l)}let m,y;try{m=await ml.fromText(t,{title:i.title})}catch(U){if(o.suppressErrorRendering)throw h(),U;m=await ml.fromText("error"),y=U}const x=d.select(c).node(),C=m.type,w=x.firstChild,S=w.firstChild,v=m.renderer.getClasses?.(t,m),_=NA(o,C,v,s),E=document.createElement("style");E.innerHTML=_,w.insertBefore(E,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(U){throw o.suppressErrorRendering?h():VE.draw(t,e,"11.16.0"),U}const B=d.select(`${c} svg`),D=m.db.getAccTitle?.(),M=m.db.getAccDescription?.();fx(C,B,D,M),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",LA);let P=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),P=qA(P,f,Ye(o.arrowMarkerAbsolute)),f){const U=d.select(c+" svg").node();P=zA(P,U)}else u||(P=Ti.sanitize(P,{ADD_TAGS:RA,ADD_ATTR:IA,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(yA(),y)throw y;return h(),{diagramType:C,svg:P,bindFunctions:m.db.bindFunctions}},"render");function dx(e={}){const t=qt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),q1(t),t?.theme&&t.theme in tr?t.themeVariables=tr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=tr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?N1(t):Cu();_l(r.logLevel),Ba()}p(dx,"initialize");var ux=p((e,t={})=>{const{code:r}=Oh(e);return ml.fromText(r,t)},"getDiagramFromText");function fx(e,t,r,i){ax(t,e),nx(t,r,i,t.attr("id"))}p(fx,"addA11yInfo");var zr=Object.freeze({render:WA,parse:cx,getDiagramFromText:ux,initialize:dx,getConfig:Ot,setConfig:bu,getSiteConfig:Cu,updateSiteConfig:z1,reset:p(()=>{Ss()},"reset"),globalReset:p(()=>{Ss(Bi)},"globalReset"),defaultConfig:Bi});_l(Ot().logLevel);Ss(Ot());var HA=p((e,t,r)=>{V.warn(e),ph(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),gx=p(async function(e={querySelector:".mermaid"}){try{await YA(e)}catch(t){if(ph(t)&&V.error(t.str),ir.parseError&&ir.parseError(t),!e.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),t}},"run"),YA=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=zr.getConfig();V.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),zr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new xe.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=ym(xe.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=xe.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await xx(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){HA(d,n,ir.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),px=p(function(e){zr.initialize(e)},"initialize"),UA=p(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&px(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await gx(i)},"init"),GA=p(async(e,{lazyLoad:t=!0}={})=>{Ba(),xn(...e),t===!1&&await pA()},"registerExternalDiagrams"),mx=p(function(){if(ir.startOnLoad){const{startOnLoad:e}=zr.getConfig();e&&ir.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",mx,!1);var XA=p(function(e){ir.parseError=e},"setParseErrorHandler"),Zs=[],on=!1,yx=p(async()=>{if(!on){for(on=!0;Zs.length>0;){const e=Zs.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}on=!1}},"executeQueue"),VA=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,a)=>{zr.parse(e,t).then(n=>{s(n),r(n)},n=>{V.error("Error parsing",n),ir.parseError?.(n),a(n),i(n)})}),"performCall");Zs.push(o),yx().catch(i)}),"parse"),xx=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((a,n)=>{zr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),ir.parseError?.(l),n(l),o(l)})}),"performCall");Zs.push(s),yx().catch(o)}),"render"),KA=p(()=>Object.keys(Pr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ir={startOnLoad:!0,mermaidAPI:zr,parse:VA,render:xx,init:UA,run:gx,registerExternalDiagrams:GA,registerLayoutLoaders:g0,initialize:px,parseError:void 0,contentLoaded:mx,setParseErrorHandler:XA,detectType:El,registerIconPacks:om,getRegisteredDiagramsMetadata:KA},xl=ir;const jr="flex size-11 items-center justify-center rounded border p-1 shadow",ZA="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",QA="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Ld="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",Cx="both-shift",Ed=Object.freeze({none:Object.freeze({panTrigger:null,zoom:!1}),zoom:Object.freeze({panTrigger:null,zoom:!0}),pan:Object.freeze({panTrigger:"drag",zoom:!1}),"pan-shift":Object.freeze({panTrigger:"shift-drag",zoom:!1}),both:Object.freeze({panTrigger:"drag",zoom:!0}),"both-shift":Object.freeze({panTrigger:"shift-drag",zoom:!0})}),JA=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),tM=Object.freeze(["none","zoom","pan","both"]),eM=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),xs=.3,rM=3,iM=2,Lr=.5,oM=1;function Fd(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const sM=0;function sn(e,t,r){return e.panTrigger===null||t.button!==sM?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function aM(e,t){return e.zoom&&t.shiftKey}function nM(e){if(e===null)return null;const t=e.trim().split(/[\s,]+/u),r=t.length===4?Number(t[2]):Number.NaN;if(!(Number.isFinite(r)&&r>0))throw new Error(`[@aiquants/markdown] MermaidDiagram: the drawing has no usable viewBox (${JSON.stringify(e)})`);return r}function lM(e,t){if(!(Number.isFinite(e)&&e>0&&(t===null||Number.isFinite(t)&&t>0)))throw new Error(`[@aiquants/markdown] MermaidDiagram: cannot fit a drawing ${t} px wide into a frame ${e} px wide`);return t===null?1:Math.min(1,e/t)}function hM(e){if(!(Number.isFinite(e)&&e>0&&e<=1))throw new Error(`[@aiquants/markdown] MermaidDiagram: the fit scale must be in (0, 1], got ${e}`);return{minScale:1,maxScale:iM/e}}function an(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function eo(e,t,r,i,o){return{scale:t,x:e.x+(i.x-o.origin.x)/t-(r.x-o.origin.x)/e.scale,y:e.y+(i.y-o.origin.y)/t-(r.y-o.origin.y)/e.scale}}function cM(e,t,r){const i=(o,s,a,n)=>{const l=(0-s)/e.scale,c=(n-s-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),o))};return{scale:e.scale,x:i(e.x,t.origin.x,t.inline,r.inline),y:i(e.y,t.origin.y,t.block,r.block)}}function dM(e,t,r){return e*t.inline-r.inline>Lr||e*t.block-r.block>Lr}function uM(e,t){const r=s=>Math.hypot(s[1].x-s[0].x,s[1].y-s[0].y),i=s=>({x:(s[0].x+s[1].x)/2,y:(s[0].y+s[1].y)/2}),o=r(e);return o<oM?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function Ad(e){return e*(1-Math.exp(-xs))}function Md(e,t,r){const i=e<-Lr||e>Lr;return t-e>r+Lr?i?0-e:0:e<-Lr?0-e:t>r+Lr?r-t:0}const La=Object.freeze({interactionMode:{text:"マウス操作モード",lang:"ja"},interactionModeTouch:{text:"タッチ操作モード",lang:"ja"},modeNone:{text:"操作なし",lang:"ja"},modeZoom:{text:"拡大縮小のみ",lang:"ja"},modePan:{text:"移動のみ (左ドラッグ)",lang:"ja"},modePanShift:{text:"移動のみ (Shift+ドラッグ)",lang:"ja"},modeBoth:{text:"拡大縮小+移動 (左ドラッグ)",lang:"ja"},modeBothShift:{text:"拡大縮小+移動 (Shift+ドラッグ)",lang:"ja"},modeNoneTouch:{text:"操作なし (指はページをスクロール)",lang:"ja"},modeZoomTouch:{text:"拡大縮小のみ (2 本指)",lang:"ja"},modePanTouch:{text:"移動のみ (はみ出す図を 1 本指でドラッグ)",lang:"ja"},modeBothTouch:{text:"拡大縮小+移動 (2 本指・はみ出す図は 1 本指)",lang:"ja"},zoomIn:{text:"Zoom In",lang:"en"},zoomOut:{text:"Zoom Out",lang:"en"},resetView:{text:"Reset View",lang:"en"},panUp:{text:"Pan Up",lang:"en"},panDown:{text:"Pan Down",lang:"en"},panLeft:{text:"Pan Left",lang:"en"},panRight:{text:"Pan Right",lang:"en"},diagram:{text:"Diagram (arrow keys pan, + and - zoom, 0 resets)",lang:"en"},retry:{text:"再試行",lang:"ja"}}),fM=Js(La),gM=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),pM=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),bx="(pointer: coarse)",mM=e=>{const t=window.matchMedia(bx);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},yM=()=>window.matchMedia(bx).matches,xM=()=>!1,CM=()=>L.useSyncExternalStore(mM,yM,xM),Ih=(e,t)=>{const[r,i]=L.useState(null),o=r!==null&&e.includes(r)?r:e[0],s=l=>l instanceof Element?l.getAttribute(t):null;return{onKeyDown:l=>{const c=s(l.target);if(c===null||l.altKey||l.ctrlKey||l.metaKey||l.shiftKey)return;const h=e.indexOf(c);if(h===-1)return;const d=l.currentTarget.ownerDocument.defaultView?.getComputedStyle(l.currentTarget).direction==="rtl",f=d?"ArrowLeft":"ArrowRight",u=d?"ArrowRight":"ArrowLeft";let g;switch(l.key){case f:g=(h+1)%e.length;break;case u:g=(h-1+e.length)%e.length;break;case"Home":g=0;break;case"End":g=e.length-1;break;default:return}l.preventDefault(),l.currentTarget.querySelector(`[${t}="${e[g]}"]`)?.focus()},onFocus:l=>{const c=s(l.target);c!==null&&e.includes(c)&&i(c)},tabIndexOf:l=>l===o?0:-1}},Co={side:"start",offset:0,maxWidth:null},bM=(e,t,r,i)=>{const o=l=>l>=r.low&&l+t<=r.high;if(o(i?e.right-t:e.left))return Co;if(o(i?e.left:e.right-t))return{side:"end",offset:e.right-e.left-t,maxWidth:null};const s=r.high-r.low;if(s<=0)return Co;const a=Math.min(t,s),n=Math.min(Math.max(i?e.right-a:e.left,r.low),r.high-a);return{side:"inside",offset:i?e.right-n-a:n-e.left,maxWidth:a<t?a:null}},kx=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[a,n]=L.useState(null),[l,c]=L.useState(Co),h=a!==null,d=L.useId(),f=L.useId(),u=L.useRef(null),g=L.useRef(null),m=L.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{n(null),c(Co),S&&g.current?.focus()};L.useLayoutEffect(()=>{const S=u.current,v=m.current;if(a===null||S===null||v===null)return;const _=v.ownerDocument.documentElement.clientWidth,E=S.closest('[role="toolbar"]')?.getBoundingClientRect(),B=E===void 0?{low:0,high:_}:{low:Math.max(0,E.left),high:Math.min(_,E.right)},D=v.ownerDocument.defaultView?.getComputedStyle(v).direction==="rtl";c(bM(S.getBoundingClientRect(),v.getBoundingClientRect().width,B,D));const M=y(),P=M.findIndex(N=>N.getAttribute("aria-checked")==="true"),U=a==="last"?M.length-1:Math.max(P,0);M[U]?.focus()},[a]),L.useEffect(()=>{const S=u.current?.ownerDocument;if(!h||S===void 0)return;const v=_=>{_.target instanceof Node&&u.current?.contains(_.target)===!0||(n(null),c(Co))};return S.addEventListener("pointerdown",v,!0),S.addEventListener("focusin",v,!0),()=>{S.removeEventListener("pointerdown",v,!0),S.removeEventListener("focusin",v,!0)}},[h]);const C=S=>{if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),n(S.key==="ArrowUp"?"last":"chosen");return}S.key==="Escape"&&h&&(S.preventDefault(),S.stopPropagation(),x(!1))},w=S=>{const v=y(),_=v.indexOf(S.target);let E;switch(S.key){case"ArrowDown":E=(_+1)%v.length;break;case"ArrowUp":E=(_-1+v.length)%v.length;break;case"Home":E=0;break;case"End":E=v.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),v[E]?.focus()};return k.jsxs("div",{ref:u,className:"relative",children:[k.jsx("button",{ref:g,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):n("chosen"),onKeyDown:C,className:jr,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?f:void 0,children:i}),h&&k.jsx("div",{ref:m,id:f,role:"menu","aria-labelledby":d,...t,"data-aqmd-control-menu":l.side,style:l.maxWidth===null?{insetInlineStart:l.offset}:{insetInlineStart:l.offset,maxInlineSize:l.maxWidth},onKeyDown:w,className:QA,children:s.map(S=>{const v=()=>{x(!0),S.onSelect()};return S.checked===void 0?k.jsx("button",{type:"button",role:"menuitem",tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Ld,children:k.jsx("span",{children:S.label.text})},S.key):k.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":S.checked,tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Ld,children:[k.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),k.jsx("span",{children:S.label.text})]},S.key)})})]})},$d=new Set(["gantt"]),kM=200,wM=300,SM=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),vM="data-aqmd-mermaid-host",TM=e=>{const t=document.createElement("div");return t.setAttribute(vM,""),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.insetBlockStart="0",t.style.insetInlineStart=`${-e}px`,t.style.width=`${e}px`,t.style.visibility="hidden",t.style.contain="strict",document.body.append(t),t};let Od=Promise.resolve();const _M=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},Rd=e=>{e.resetStyle(),e.destroy()},nn=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",BM=Object.freeze({visibility:"hidden"});let wx=!1,Cl=null;if(xl?.initialize)try{xl.initialize({startOnLoad:!1}),wx=!0}catch(e){Cl=e instanceof Error?e:new Error(String(e))}else Cl=new Error("Mermaid library or mermaid.initialize is not available.");const Sx=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=L.useMemo(()=>_i(La,i),[i]),a=L.useId(),n=L.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),l=L.useRef(0),c=L.useRef(null),h=L.useRef(null),d=L.useRef(null),f=L.useRef(null),[u,g]=L.useState(!0),[m,y]=L.useState(null),[x,C]=L.useState(null),[w,S]=L.useState(0),v=L.useRef(!1),_=CM(),[E,B]=L.useState(t??Cx),D=L.useRef(Ed[E]),M=L.useRef(!1),[P,U]=L.useState(!1);L.useEffect(()=>{t&&B(t)},[t]),L.useEffect(()=>{D.current=Ed[E],f.current?.refresh()},[E]),L.useEffect(()=>{if(g(!0),y(null),C(null),!wx){y(Cl?.message||"Mermaid failed to initialize globally."),g(!1);return}const T=e.trim();if(T===""){g(!1);return}const W=c.current;if(!W)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let z=!1,X=0,G=null,K=W.offsetWidth,Z=null,at,pt;const ut=()=>{Ht.disconnect(),clearTimeout(at)},mt=Yt=>{Z=null,ut(),y(Yt),C(null),g(!1)},Lt=Yt=>{l.current+=1;const Qt=l.current;X=Qt,G=Yt;const we=()=>!z&&Qt===X,Se=async()=>{const _t=TM(Yt);try{return await xl.render(`${n.current}-${Qt}`,T,_t)}finally{_t.remove()}};Od=Od.then(()=>we()?Se().then(_t=>{if(we()){if(typeof _t.svg!="string"||_t.svg.length===0){mt("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}Z=_t.diagramType,C({svg:_t.svg,bindFunctions:typeof _t.bindFunctions=="function"?_t.bindFunctions:null}),g(!1),$d.has(_t.diagramType)?K!==Yt&&Ft():Ht.disconnect()}}).catch(_t=>{if(we()){if(console.error(`[MermaidDiagram ${n.current}] Error rendering Mermaid diagram:`,_t),_M(_t)&&!v.current){v.current=!0,pt=setTimeout(()=>S(Ct=>Ct+1),wM);return}mt(_t instanceof Error?_t.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Ft=()=>{clearTimeout(at),at=setTimeout(()=>{K>0&&K!==G&&Lt(K)},kM)},Mt=()=>{const Yt=W.offsetWidth;if(Yt!==K){if(K=Yt,G===null){Yt>0&&Lt(Yt);return}Z!==null&&$d.has(Z)&&Ft()}},Ht=new ResizeObserver(Mt);return Ht.observe(W),K>0&&Lt(K),()=>{z=!0,ut(),clearTimeout(pt)}},[e,w]),L.useEffect(()=>{const T=h.current;if(!T)return;const W=()=>{f.current=null,d.current&&(Rd(d.current),d.current=null),M.current=!1,U(!1)};if(!x){T.innerHTML="",W();return}T.innerHTML=x.svg;const z=T.querySelector("svg");let X=!1,G;const K=[];if(z){let Z;try{Z=nM(z.getAttribute("viewBox"))}catch(ut){console.error(`[MermaidDiagram ${n.current}] Cannot size the drawing:`,ut),y(ut instanceof Error?ut.message:String(ut)),C(null);return}const at=Z,pt=()=>{if(X)return;const ut=z.getBBox();if(!ut||ut.width===0||ut.height===0){G=setTimeout(pt,100);return}d.current&&Rd(d.current);const mt=lu(z,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:xs,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:Fd(D.current,!1)});d.current=mt;let Lt={minScale:1,maxScale:1};const Ft=()=>{const J=mt.getPan();return{scale:mt.getScale(),x:J.x,y:J.y}},Mt=()=>{const J=T.getBoundingClientRect(),ft=z.getBoundingClientRect(),{scale:xt,x:Dt,y:At}=Ft();return{frameRect:J,frame:{inline:J.width,block:J.height},drawing:{origin:{x:ft.left-J.left-xt*Dt,y:ft.top-J.top-xt*At},inline:ft.width/xt,block:ft.height/xt}}},Ht=()=>{if(X)return;const{frame:J,drawing:ft}=Mt(),xt=dM(mt.getScale(),ft,J);M.current=xt,U(xt),br(xt),mt.setOptions({touchAction:Fd(D.current,xt)}),T.style.cursor=nn(D.current,Ct?.kind==="pan"&&Ct.mouse)},Yt=()=>{const J=T.getBoundingClientRect().width;J<=0||(Lt=hM(lM(J,at)),mt.setOptions({minScale:Lt.minScale,maxScale:Lt.maxScale}))},Qt=J=>{const ft=Ft(),{frame:xt,drawing:Dt}=Mt(),At=cM({...J,scale:an(J.scale,Lt)},Dt,xt);return At.scale===ft.scale&&At.x===ft.x&&At.y===ft.y?!1:(mt.zoom(At.scale,{animate:!1,force:!0,silent:!0}),mt.pan(At.x,At.y,{animate:!1,force:!0}),Ht(),!0)},we=(J,ft)=>{const{drawing:xt}=Mt();return Qt(eo(Ft(),an(J,Lt),ft,ft,xt))},Se=J=>{const ft=T.getBoundingClientRect();return{x:J.x-ft.left,y:J.y-ft.top}};f.current={zoomBy:J=>{const{frame:ft}=Mt();we(mt.getScale()*Math.exp(J*xs),{x:ft.inline/2,y:ft.block/2})},panBy:(J,ft)=>{const{drawing:xt}=Mt(),Dt=Ft();return Qt(eo(Dt,Dt.scale,{x:0,y:0},{x:J,y:ft},xt))},reset:()=>{Qt({scale:1,x:0,y:0})},panSteps:()=>{const{frame:J}=Mt();return{x:Ad(J.inline),y:Ad(J.block)}},refresh:Ht};const _t=new Map;let Ct=null;const ve=J=>({x:J.clientX,y:J.clientY}),Yr=()=>{const J=[..._t.values()];return J.length===2?[J[0],J[1]]:null},pe=J=>{if(_t.has(J.pointerId)&&_t.set(J.pointerId,ve(J)),Ct?.kind==="pinch"){const ft=Yr();if(ft===null)return;const xt=uM(Ct.last,ft);if(Ct={kind:"pinch",last:ft},xt===null)return;const{drawing:Dt}=Mt(),At=Ft();Qt(eo(At,an(At.scale*xt.ratio,Lt),Se(xt.from),Se(xt.to),Dt));return}if(Ct?.kind==="pan"&&Ct.pointerId===J.pointerId){const ft=ve(J),{drawing:xt}=Mt(),Dt=Ft();Qt(eo(Dt,Dt.scale,Se(Ct.last),Se(ft),xt)),Ct={...Ct,last:ft}}},sr=()=>{window.removeEventListener("pointermove",pe),window.removeEventListener("pointerup",Ge),window.removeEventListener("pointercancel",Ge)},xr=()=>{sr(),window.addEventListener("pointermove",pe),window.addEventListener("pointerup",Ge),window.addEventListener("pointercancel",Ge)},Ge=J=>{if(_t.delete(J.pointerId),Ct?.kind==="pinch"){const[ft]=[..._t.entries()];Ct=ft!==void 0&&sn(D.current,{button:0,shiftKey:!1,pointerType:J.pointerType},M.current)?{kind:"pan",pointerId:ft[0],last:ft[1],mouse:!1}:null}else Ct?.kind==="pan"&&Ct.pointerId===J.pointerId&&(Ct=null);Ct===null&&_t.size===0&&sr(),T.style.cursor=nn(D.current,Ct?.kind==="pan"&&Ct.mouse)},Cr=J=>{const ft=D.current;if(J.pointerType==="touch"||J.pointerType==="pen"){_t.set(J.pointerId,ve(J)),xr();const xt=Yr();xt!==null&&ft.zoom?Ct={kind:"pinch",last:xt}:_t.size>1?Ct?.kind==="pan"&&!Ct.mouse&&(Ct=null):sn(ft,J,M.current)&&(Ct={kind:"pan",pointerId:J.pointerId,last:ve(J),mouse:!1});return}sn(ft,J,M.current)&&(Ct={kind:"pan",pointerId:J.pointerId,last:ve(J),mouse:!0},T.style.cursor=nn(ft,!0),xr(),J.preventDefault())},Ur=J=>{Ct!==null&&!(Ct.kind==="pan"&&Ct.mouse)&&J.cancelable&&J.preventDefault()};let ar=!1;const br=J=>{J!==ar&&(ar=J,J?T.addEventListener("touchmove",Ur,{passive:!1}):T.removeEventListener("touchmove",Ur))},Re=J=>{const ft=J.target;if(!(ft instanceof Element)||ft===z||!z.contains(ft))return;const xt=T.getBoundingClientRect(),Dt=ft.getBoundingClientRect(),At={x:Md(Dt.left-xt.left,Dt.right-xt.left,xt.width),y:Md(Dt.top-xt.top,Dt.bottom-xt.top,xt.height)};if(At.x===0&&At.y===0)return;const{drawing:Gr}=Mt(),Xr=Ft();Qt(eo(Xr,Xr.scale,{x:0,y:0},At,Gr))},Te=J=>{if(!aM(D.current,J))return;const ft=J.deltaY===0?J.deltaX:J.deltaY;ft!==0&&(J.preventDefault(),we(mt.getScale()*Math.exp(Math.sign(-ft)*xs/rM),Se(ve(J))))},kr=new ResizeObserver(()=>{Yt(),Qt(Ft()),Ht()});T.addEventListener("pointerdown",Cr),T.addEventListener("focusin",Re),T.addEventListener("wheel",Te,{passive:!1}),z.addEventListener("panzoomchange",Ht),kr.observe(T),K.push(()=>{T.removeEventListener("pointerdown",Cr),T.removeEventListener("focusin",Re),br(!1),T.removeEventListener("wheel",Te),z.removeEventListener("panzoomchange",Ht),kr.disconnect(),sr()}),Yt(),Ht()};pt()}return x.bindFunctions&&x.bindFunctions(T),()=>{X=!0,clearTimeout(G);for(const Z of K)Z();W()}},[x]);const N=L.useCallback(T=>{const W=f.current;if(W===null||T.target!==T.currentTarget||T.altKey||T.ctrlKey||T.metaKey)return;const z=W.panSteps();let X;switch(T.key){case"ArrowLeft":X=W.panBy(z.x,0);break;case"ArrowRight":X=W.panBy(-z.x,0);break;case"ArrowUp":X=W.panBy(0,z.y);break;case"ArrowDown":X=W.panBy(0,-z.y);break;case"+":case"=":W.zoomBy(1),X=!0;break;case"-":W.zoomBy(-1),X=!0;break;case"0":W.reset(),X=!0;break;default:X=!1}X&&T.preventDefault()},[]),q=L.useMemo(()=>[...P?["pan-left","pan-up","pan-down","pan-right"]:[],...r?[]:["mode"],"zoom-in","zoom-out","reset"],[r,P]),{onKeyDown:A,onFocus:$,tabIndexOf:O}=Ih(q,"data-aqmd-mermaid-control"),F=(T,W,z,X,G=!1)=>k.jsx("button",{type:"button","data-aqmd-mermaid-control":T,tabIndex:O(T),onClick:z,style:G?BM:void 0,className:jr,"aria-label":s[W].text,lang:s[W].lang,children:X},T),R=T=>{const W=f.current;if(W===null)return;const z=W.panSteps();W.panBy(T.x*z.x,T.y*z.y)};let j;if(u)j=k.jsx("div",{className:"flex h-32 items-center justify-center bg-white dark:bg-gray-800 dark:text-white",children:"🌀 Loading diagram..."});else if(m)j=k.jsxs("div",{"data-aqmd-mermaid-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[k.jsxs("div",{children:["Error: ",m]}),k.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{v.current=!1,y(null),S(T=>T+1)},lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[k.jsx(mn,{className:"h-4 w-4"}),s.retry.text]})]});else{const T=s[_?"interactionModeTouch":"interactionMode"],W=_?tM.map(z=>({value:z,label:s[pM[z]],checked:eM[E]===z})):JA.map(z=>({value:z,label:s[gM[z]],checked:E===z}));j=k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":a,onKeyDown:A,onFocus:$,className:"mb-1 flex flex-wrap items-start justify-end gap-1",children:[k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[F("pan-left","panLeft",()=>R({x:1,y:0}),k.jsx(Vb,{size:18}),!P),F("pan-up","panUp",()=>R({x:0,y:1}),k.jsx(Jb,{size:18}),!P),F("pan-down","panDown",()=>R({x:0,y:-1}),k.jsx(Gb,{size:18}),!P),F("pan-right","panRight",()=>R({x:-1,y:0}),k.jsx(Zb,{size:18}),!P)]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[!r&&k.jsx(kx,{buttonHook:{"data-aqmd-mermaid-control":"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:T,icon:k.jsx(r1,{size:18}),tabIndex:O("mode"),items:W.map(({value:z,label:X,checked:G})=>({key:z,label:X,checked:G,onSelect:()=>B(z)}))}),F("zoom-in","zoomIn",()=>f.current?.zoomBy(1),k.jsx(hu,{size:20})),F("zoom-out","zoomOut",()=>f.current?.zoomBy(-1),k.jsx(cu,{size:20})),F("reset","resetView",()=>f.current?.reset(),k.jsx(mn,{size:18}))]})]}),k.jsx("span",{id:a,hidden:!0,lang:s.diagram.lang,children:s.diagram.text}),k.jsx("div",{ref:h,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":P?"true":"false",role:"group",tabIndex:0,"aria-labelledby":a,onKeyDown:N,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return k.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":o,children:[k.jsx("div",{ref:c,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:SM}),j]})};Sx.displayName="MermaidDiagramInternal";const Ph=L.memo(Sx),LM="unicodeTextInMathMode",EM="noCharacterMetrics",FM=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,AM="consoleCommand",MM=e=>{const t=(r,i)=>o=>(i(o),e(AM,`${r} is ignored: a formula does not write to the console`),"");return{"\\message":t("\\message",r=>r.consumeArgs(1)),"\\errmessage":t("\\errmessage",r=>r.consumeArgs(1)),"\\show":t("\\show",r=>r.popToken())}},vx=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=vr.get(r);if(i!==void 0)return vr.delete(r),vr.set(r,i),i;const o=OM(e,t);return vr.set(r,o),vr.size>$M&&vr.delete(vr.keys().next().value),o},$M=610,vr=new Map,OM=(e,t)=>{const r=[],i=(s,a)=>{r.push({code:s,message:a,formula:e,displayMode:t})},o=console.warn;console.warn=(...s)=>{const[a]=s;if(s.length===1&&typeof a=="string"&&FM.test(a)){i(EM,a);return}o.apply(console,s)};try{const s=bC.renderToString(e,{displayMode:t,throwOnError:!1,macros:MM(i),strict:(a,n)=>(a!==LM&&i(a,n),"ignore")});return Object.freeze({html:s,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=o}};const RM=[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]],IM=Tt("align-horizontal-space-around",RM);const PM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],DM=Tt("chevron-down",PM);const NM=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Tx=Tt("copy",NM);const qM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],zM=Tt("download",qM);const jM=[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]],WM=Tt("fold-horizontal",jM);const HM=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],YM=Tt("fold-vertical",HM);const UM=[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]],GM=Tt("highlighter",UM);const XM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],VM=Tt("maximize-2",XM);const KM=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],ZM=Tt("minimize-2",KM);const QM=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],JM=Tt("ruler",QM);const t5=[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]],e5=Tt("unfold-horizontal",t5);const r5=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],i5=Tt("unfold-vertical",r5),_x=24,o5=1,s5=1,a5=Object.freeze({}),ln=e=>{const{rows:t,cols:r}=Qs.measureTsv(e);return t*r},n5=26,l5=(e,t,r)=>{const i=e.length>t?Math.min(r,t):0,o=e.slice(0,t-i).map((a,n)=>({index:n,cells:a})),s=e.slice(e.length-i).map((a,n)=>({index:e.length-i+n,cells:a}));return[...o,...s]},h5=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),c5=3,d5=e=>Math.max(1,Math.min(c5,e)),u5=(e,t)=>(oe.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX+e*_x)*t+oe.SPREADSHEET_SCROLLBAR_SIZE_PX,bl=e=>Math.round(e*100),f5=(e,t,r)=>{if(t===0&&r===0)return e;const i=(e[0]?.length??0)+r,o=r===0?[...e]:e.map(s=>[...s,...Array(r).fill("")]);for(let s=0;s<t;s+=1)o.push(Array(i).fill(""));return o},Dh=e=>{let t=e.length;for(;t>1&&e[t-1].every(s=>s==="");)t-=1;const r=e[0]?.length??0;let i=r;const o=s=>{for(let a=0;a<t;a+=1)if(e[a][s]!=="")return!1;return!0};for(;i>1&&o(i-1);)i-=1;return t===0||i===0?[[""]]:t===e.length&&i===r?e:e.slice(0,t).map(s=>i===r?s:s.slice(0,i))},is=e=>Dh(Qs.parseTsv(e)),g5=["format","hyperlink","note","comments","validation"],p5=(e,t)=>{const r=new Map;let i=!1,o=!1;for(const s of t){if(!(Number.isInteger(s.row)&&Number.isInteger(s.col))||s.row<0||s.row>=e.length||s.col<0||s.col>=e[s.row].length)throw new RangeError(`[@aiquants/markdown] spreadsheet edit outside the table: row ${s.row}, column ${s.col}`);if(g5.some(l=>s[l]!==void 0&&s[l]!==null)&&(i=!0),s.text===void 0)continue;o=!0;const a=s.text.replace(/\r\n?/gu,`
|
|
312
|
+
`),n=r.get(s.row);if(n!==void 0)n[s.col]=a;else if(e[s.row][s.col]!==a){const l=[...e[s.row]];l[s.col]=a,r.set(s.row,l)}}if(r.size>0){const s=[...e];for(const[a,n]of r)s[a]=n;return{kind:"applied",matrix:s}}return i&&!o?{kind:"format-only"}:{kind:"unchanged"}},m5=e=>{const t=Dh(e).map(r=>{let i=r.length;for(;i>0&&r[i-1]==="";)i-=1;return i===r.length?r:r.slice(0,i)});return Qs.serializeTsv(t).replaceAll(`\r
|
|
313
313
|
`,`
|
|
314
|
-
`)},
|
|
315
|
-
${e}`,y=f===m,x=i!==void 0&&u!==null&&!y?i:void 0,C=x!==void 0,k=C&&l!==null&&l.footerRows===0?t5:0,S=C?e5:0,[v,_]=L.useState(()=>d?Dd:rs(e)),[E,B]=L.useState(0),I=L.useRef(e),M=L.useRef([]),D=L.useMemo(()=>h5(v,k,S),[v,k,S]),U=L.useRef(D);U.current=D;const q=L.useSyncExternalStore(F5,()=>xs,()=>null),[N,A]=L.useState(!1),F=N&&q===null,[P,O]=L.useState(1),[$,j]=L.useState(Pd),[T,W]=L.useState(!1),[z,G]=L.useState(null),X=L.useRef(null),K=L.useId(),Q=L.useCallback((Z,it={})=>{G(St=>({text:It.fillLabel(n[Z].text,it),lang:n[Z].lang,serial:(St?.serial??0)+1}))},[n]);L.useEffect(()=>{if(q!==null||l===null||d)return;let Z=!0;return Rd().catch(it=>{Z&&(Id(it),A(!0))}),()=>{Z=!1}},[q,l,d]),L.useEffect(()=>{const Z=f5(M.current,e);if(Z.echo){M.current=Z.pending;return}const it=x===void 0||u===null?null:x.read(u),St=it!==null&&nn(it)<=oe.SPREADSHEET_MAX_OPERATION_CELLS?it:null;if(St!==null&&St===M.current.at(-1))return;M.current=[];const Et=St===null?e:St;Et!==I.current&&(I.current=Et,_(St===null&&d?Dd:rs(Et)),B(ie=>ie+1))},[e,d,x,u]);const nt=L.useCallback(()=>{if(x===void 0||u===null)return;const Z=x.read(u);Z===null||Z===I.current||nn(Z)>oe.SPREADSHEET_MAX_OPERATION_CELLS||(M.current=[],I.current=Z,_(rs(Z)),B(it=>it+1))},[x,u]);L.useEffect(()=>x?.subscribe(()=>{M.current.length>0&&nt()}),[x,nt]);const gt=L.useCallback(Z=>{Z(),nt()},[nt]),ut=L.useMemo(()=>x===void 0?void 0:()=>gt(()=>x.undo()),[x,gt]),mt=L.useMemo(()=>x===void 0?void 0:()=>gt(()=>x.redo()),[x,gt]),Lt=L.useRef(()=>{});Lt.current=Z=>{if(x===void 0||u===null)throw new Qr("readOnly");const it=d5(U.current,Z);if(it.kind==="format-only")throw new Qr("formatRefused");if(it.kind==="unchanged")return;const St=Ph(it.matrix),Et=u5(St),ie=x.write({fenceLine:u,expected:I.current,text:Et});switch(ie){case"written":{const le=x.read(u);if(le===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");I.current=le,M.current=[...M.current,le],_(le===Et?St:rs(le)),B(Vr=>Vr+1),G(null);return}case"changed":throw nt(),new Qr("editConflict");case"closesFence":throw new Qr("fenceRefused");case"unwritable":throw p(m),new Qr("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(ie)} (written, changed, closesFence or unwritable)`)}};const[Ft]=L.useState(()=>({get rowCount(){return U.current.length},get colCount(){return U.current[0].length},getCellText:(Z,it)=>U.current[Z][it],applyEdits:(Z,it)=>Lt.current(Z),getCellFormat:()=>r5,getCellHyperlink:(Z,it)=>m5(U.current[Z][it]),findDataEdge:(Z,it)=>p5((St,Et)=>U.current[St][Et],U.current.length,U.current[0].length,Z,it)})),Mt=L.useCallback(Z=>{if(!(Z instanceof Qr))throw Z;Q(Z.reason)},[Q]),Ht=L.useCallback(Z=>Q(y?"unwritable":"readOnly"),[Q,y]),Yt=L.useCallback(Z=>{X.current?.ownerDocument.defaultView?.open(Z,"_blank","noopener,noreferrer")},[]),Qt=L.useCallback(({row:Z,displayText:it,columnName:St,readOnly:Et})=>It.fillLabel((Et===!0?n.readOnlyCellAnnouncement:n.cellAnnouncement).text,{cell:`${St}${Z+1}`,value:it===""?n.emptyCell.text:it}),[n]),we=L.useCallback(({range:Z})=>It.fillLabel(n.selectionAnnouncement.text,{range:y5(Z,oe.columnIndexToName)}),[n]),Se=L.useCallback(({axis:Z,index:it,size:St})=>Z==="column"?It.fillLabel(n.columnResized.text,{column:oe.columnIndexToName(it),size:St}):It.fillLabel(n.rowResized.text,{row:it+1,size:St}),[n]),_t=L.useRef(null),[Ct]=L.useState(C5),ve=L.useCallback(Z=>Ct.set(Z.active),[Ct]),Yr=L.useCallback(Z=>{_t.current?.executeCommand(Z)},[]),ge=Cl(P),sr=L.useRef(ge);L.useEffect(()=>{sr.current!==ge&&(sr.current=ge,Q("zoomed",{percent:ge}))},[Q,ge]);const xr=L.useCallback(Z=>O(it=>oe.clampSpreadsheetZoom(oe.stepSpreadsheetZoom(it,Z))),[]),Xe=L.useCallback(()=>O(1),[]),Cr=$.row||$.column,Ur=L.useCallback(()=>j(Z=>Z.row||Z.column?A5:Pd),[]),ar=L.useCallback(()=>{if(q===null)return;const Z=X.current?.ownerDocument.defaultView;(async()=>{if(Z==null)throw new Error("no window");const St=v5(v,q,Z.crypto.randomUUID());await T5(St,Z.navigator.clipboard,Et=>new Z.ClipboardItem(Et))})().then(()=>Q("copied"),St=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",St),Q("copyFailed")})},[Q,v,q]),br=L.useCallback(Z=>{const it=X.current?.ownerDocument;it!==void 0&&E5(L5(v,Z),n.fileName.text,it)},[v,n]),Re=L.useRef(!1);L.useEffect(()=>{Re.current&&(Re.current=!1,X.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[T]);const Te=L.useCallback(Z=>{const it=X.current;it!==null&&(it.close(),Z?it.showModal():it.show(),Re.current=!0,W(Z))},[]),kr=L.useCallback(()=>Te(!T),[T,Te]),J=L.useCallback(Z=>{!T||Z.key!=="Escape"||Z.defaultPrevented||Z.nativeEvent.isComposing||Z.keyCode===$5||(Z.preventDefault(),Z.stopPropagation(),Te(!1))},[T,Te]),ft=L.useCallback(Z=>{Z.preventDefault(),Te(!1)},[Te]),xt=v.length,Dt=v[0].length,At=l===null?0:s5(l,D.length),Xr=D.length,Gr=L.useMemo(()=>{const[Z,it]=a==="inline"?["--aqmd-spreadsheet-box-height",At]:["--aqmd-spreadsheet-box-min-height",n5(Xr)];return{[Z]:`${l5(it,P)}px`}},[a,At,Xr,P]),No=T?n.fullscreenDialog:n.table,Wi=q?.Spreadsheet;return w.jsxs("div",{"data-aqmd-spreadsheet":"","data-aqmd-spreadsheet-layout":a,"data-source-lines":r,"data-aqmd-spreadsheet-editable":C?"":void 0,"data-aqmd-spreadsheet-fullscreen":T?"":void 0,children:[w.jsx("span",{id:K,hidden:!0,lang:No.lang,children:No.text}),w.jsxs("dialog",{ref:X,open:!0,"data-aqmd-spreadsheet-dialog":"",role:T?void 0:"group","aria-labelledby":K,onKeyDown:J,onCancel:ft,children:[l===null?w.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:n.optionsError.lang,children:It.fillLabel(n.optionsError.text,{word:c,frozenMax:It.SPREADSHEET_OPTION_RULES.header.max,heightMax:It.SPREADSHEET_OPTION_RULES.height.max})}):d?w.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:n.tooLarge.lang,children:It.fillLabel(n.tooLarge.text,{cells:new Intl.NumberFormat(o).format(h),max:new Intl.NumberFormat(o).format(oe.SPREADSHEET_MAX_OPERATION_CELLS)})}):w.jsxs(w.Fragment,{children:[w.jsx(k5,{labels:n,labelledBy:K,rows:xt,cols:Dt,canZoomIn:P<oe.SPREADSHEET_ZOOM_MAX,canZoomOut:P>oe.SPREADSHEET_ZOOM_MIN,zoom:P,onZoom:xr,onResetZoom:Xe,highlighted:Cr,onToggleHighlight:Ur,onCopy:ar,onSave:br,fullscreen:T,onToggleFullscreen:kr,gridReady:Wi!==void 0,activeCell:Ct,onTrackSize:Yr}),w.jsx("div",{"data-aqmd-spreadsheet-box":"",style:Gr,children:Wi===void 0?w.jsx(O5,{matrix:v,headerRows:l.headerRows,footerRows:l.footerRows,visibleRows:At}):w.jsx(Wi,{ref:_t,adapter:Ft,dataVersion:E,defaultRowHeight:Sx,frozenRows:l.headerRows,headerRows:l.headerRows,frozenTrailingRows:l.footerRows,frozenColumns:l.frozenColumns,enableFillHandle:C,readOnly:!C,labelledBy:K,enableResizeUI:!0,zoom:P,onZoomChange:O,highlight:$,onHighlightChange:j,popovers:M5,onHyperlinkOpen:Yt,onEditRejected:Mt,onReadOnlyRejected:Ht,onUndoRequest:ut,onRedoRequest:mt,formatCellAnnouncement:Qt,formatSelectionAnnouncement:we,formatResizeAnnouncement:Se,onSelectionChange:ve,locale:o})})]}),F&&w.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[w.jsx("span",{lang:n.loadFailed.lang,children:n.loadFailed.text}),w.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:n.retry.lang,className:"ms-2 inline-flex min-h-11 min-w-11 items-center justify-center rounded border px-3 py-1 text-sm",onClick:()=>{A(!1),Rd().catch(Z=>{Id(Z),A(!0)})},children:n.retry.text})]}),w.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:z!==null&&w.jsx("span",{lang:z.lang,children:z.text},z.serial)})]})]})};Tx.displayName="SpreadsheetBlock";const Dh=L.memo(Tx),I5=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),P5=Object.freeze({"solarized-light":Object.freeze({"#657b83":"#435860","#93a1a1":"#4b5757","#2aa198":"#005f59","#dc322f":"#ae0010","#d33682":"#a70060","#268bd2":"#00588e","#859900":"#4e5a00","#586e75":"#43585f","#cb4b16":"#9a3100","#b58900":"#6c5100","#6c71c4":"#4a4c9c"}),"github-dark-high-contrast":Object.freeze({"#272b33":"#abb1bb"})});function D5(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const o={};for(const s of i.split(";")){const a=s.indexOf(":");if(a<=0)continue;const n=s.slice(0,a).trim(),l=s.slice(a+1).trim();n===""||l===""||(o[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=o;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const N5=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return w.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute top-2 right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-sm transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},q5=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const o=L.use(e),s={replace:a=>{if(a instanceof wt.Element&&a.name==="pre"){const n=D5(a.attribs),l=t?"2.2rem 0 1rem 0":"1rem 0";return n.style={...typeof n.style=="object"?n.style:{},margin:"0",padding:"0.8rem 0"},w.jsxs("div",{className:"relative",style:{margin:l},"data-aqmd-code-block":"","data-source-lines":i,children:[t&&w.jsx("div",{"data-aqmd-code-filename":"",className:"absolute -top-4 left-0 z-0 rounded-md px-2 py-0.5 text-sm",children:t}),w.jsx(N5,{code:r}),w.jsx("pre",{...n,children:wt.domToReact(a.children,s)})]})}},htmlparser2:{lowerCaseTags:!0}};return w.jsx(w.Fragment,{children:wt(o,s)})},z5=/^(diff)?:?(\w+):?([\w.-]*)?/,j5=new Map([["svg","xml"]]),W5="text",H5=e=>{const t=j5.get(e),r=t===void 0?e:t;return fn.isSpecialLang(r)||Object.hasOwn(fn.bundledLanguages,r)?r:W5},Y5=()=>({code(e){for(const t of e.children){if(t.type!=="element")continue;const r=t.children[0];if(r?.type!=="element")continue;const i=r.children[0];if(i?.type!=="text")continue;const o=i.value;let s,a,n="";if(o.startsWith("+")?(s="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):o.startsWith("-")&&(s="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),s&&a){t.properties.dataAqmdDiff=a,i.value=o.substring(1).trimStart();const l={type:"element",tagName:"span",properties:{className:`inline-flex items-center justify-center w-4 h-4 rounded-full select-none font-bold text-[0.5rem] mr-2 ${n}`},children:[{type:"text",value:s==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),U5=e=>{const t=z5.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},Nh=({lang:e,code:t,node:r,sourceLines:i})=>{const o=e??r?.lang??void 0,s=t??r?.value??"",{isDiff:a,lang:n,filename:l}=U5(o);return n===It.SPREADSHEETS_LANGUAGE?w.jsx(Dh,{tsv:s,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?w.jsx(Ih,{chartContent:s,sourceLines:i}):w.jsx(X5,{code:s,lang:n,isDiff:a,filename:l,sourceLines:i})},X5=({code:e,lang:t,isDiff:r,filename:i,sourceLines:o})=>{const s=L.useMemo(async()=>{const a=[];return r&&a.push(Y5()),await fn.codeToHtml(e,{lang:H5(t),themes:I5,defaultColor:!1,colorReplacements:P5,transformers:a})},[e,t,r]);return w.jsx(L.Suspense,{fallback:w.jsx("div",{className:"dark:text-white","data-source-lines":o,children:"🌀 Loading code..."}),children:w.jsx(q5,{htmlPromise:s,filename:i,code:e,sourceLines:o})})},_x=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return w.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-xs transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},Bx=(e,t)=>{const r=L.useMemo(()=>{try{return{kind:"rendered",html:kx(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return L.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},G5=({node:e})=>{const t=Bx(e.value,!0),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return w.jsxs("div",{className:"relative",children:[w.jsx(_x,{code:e.value}),t.kind==="rendered"?w.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("article",{className:r,children:t.message})]})},V5=/^[a-z][a-z0-9+.-]*:/i,K5=/^[/\\]{2}/,Z5=/[\t\n\r]/g,Nd=32,Q5=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=Nd;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=Nd;)r-=1;return e.slice(t,r)},Lx=e=>{const t=Q5(e).replace(Z5,"");return V5.test(t)||K5.test(t)},J5="text-link underline visited:text-link-visited",t3="inline-block w-fit",qh=new Set(["img","picture","video","audio","svg","canvas","iframe","object","embed","address","article","aside","blockquote","details","dialog","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","menu","nav","ol","p","pre","section","table","ul"]);[...qh].join(",");const Ex=(e,t)=>[e,t?t3:void 0,J5].filter(r=>r!==void 0&&r.trim()!=="").join(" "),e3=new Set(["id","title","lang","dir","role"]),r3=["aria-","data-footnote-"],i3=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(e3.has(o)||r3.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},ye=new un.Logger(un.LogLevel.INFO,"[DifyIFramePlugin]"),o3="100%",s3="600px",a3="0",n3=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,l3=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=L.useState(!0),[o,s]=L.useState(!1),a=L.useRef(null),n=L.useRef(null),l=L.useRef(null),{src:c}=e,h=L.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!pb(x.origin,t)||n3(x.data)==="dify-chatbot-iframe-ready"&&(ye.info("Dify chatbot iframe is ready"),i(C=>C&&(s(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=L.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(k=>k&&(s(!1),!1))}catch{ye.info("Crossorigin error detected, showing auth prompt"),s(k=>k||(i(!1),!0))}},[]),u=L.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){ye.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),ye.info("ポップアップが閉じられました");try{ye.info("ポップアップURL:",x.location.href)}catch(S){ye.info("クロスオリジンのためURLにアクセスできません:",S)}const k=a.current;if(k?.src){const S=k.src;i(v=>v||!0),s(v=>v&&!1),k.src="",setTimeout(()=>{k.src=S,n.current=setTimeout(()=>{ye.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);ye.info("ポップアップを開きました:"),ye.info("- 初期URL:",c),ye.info("- ウィンドウ名:","dify-oauth"),ye.info("- ウィンドウサイズ: 500x600")},[d,c]);L.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),L.useEffect(()=>{const x=setTimeout(()=>{ye.warn("Timeout: dify-chatbot-iframe-ready not received, checking iframe access"),d()},5e3);return l.current=x,()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[d]),L.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:f=o3,height:p=s3,frameborder:m=a3,...y}=e.attributes;return w.jsxs("div",{className:"dify-iframe-container",children:[r&&!o&&w.jsxs("div",{className:"flex items-center justify-center rounded-lg bg-gray-50 p-8",children:[w.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-blue-600 border-b-2"}),w.jsx("span",{className:"ml-3 text-gray-600",children:"Dify チャットボットを読み込み中..."})]}),o&&w.jsxs("div",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 p-6",children:[w.jsx("div",{className:"flex items-center",children:w.jsxs("div",{className:"text-blue-800",children:[w.jsx("h3",{className:"font-medium",children:"認証が必要です"}),w.jsx("p",{className:"mt-1 text-sm",children:"Dify チャットボットにアクセスするには OAuth 認証が必要です。 ポップアップウィンドウで認証を完了してください。"})]})}),w.jsx("div",{className:"mt-4",children:w.jsx("button",{type:"button",onClick:u,className:"rounded-md border border-gray-700 bg-gray-900 px-4 py-2 font-medium text-sm text-white shadow-lg transition-colors hover:bg-gray-800",children:"OAuth 認証を開始"})})]}),w.jsx("div",{className:`${r||o?"hidden":"block"}`,children:w.jsx("iframe",{ref:a,...wt.attributesToProps({...y,width:f,height:p,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},qd=Object.freeze({dify:l3}),h3=e=>Object.hasOwn(qd,e)?qd[e]:null,c3=w.jsx(L.Fragment,{}),d3=(e,t,r,i,o)=>{const s=t===null?null:h3(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return w.jsx(QC,{embed:e,label:i,insideAnchor:o,children:s!==null?w.jsx(s,{embed:e,iFrameAllowedDomains:r}):w.jsx("iframe",{...wt.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},Fx=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof wt.Element&&t.name.toLowerCase()==="a")return!0;return!1},Ax=e=>e.some(t=>t instanceof wt.Element&&(qh.has(t.name)||Ax(t.children))),u3=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":a,...n}=e.attribs,l=Ex(i,Ax(e.children)),c=n.href??"",h=o,d=h==="external"||Lx(c),u=wt.domToReact(e.children,t);if(r&&c&&!d)return w.jsx(r,{href:c,kind:h,docPath:s,docExists:a===void 0?void 0:a==="true",className:l,attributes:i3(n),children:u});d&&(n.target="_blank",n.rel="noreferrer");const f={};return o!==void 0&&(f["data-link-kind"]=o),s!==void 0&&(f["data-doc-path"]=s),a!==void 0&&(f["data-doc-exists"]=a),w.jsx("a",{...wt.attributesToProps(n,"a"),className:l,...f,children:u})},Mx=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:a=>{if(!(a instanceof wt.Element))return;const n=a.parent instanceof wt.Element?a.parent.name:null,l=ta(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return c3;case"unwrap":return w.jsx(L.Fragment,{children:wt.domToReact(a.children,s)});case"embed":return d3(l.embed,l.pluginType,e,t.embeddedFrame,Fx(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,s);if(h!==void 0)return h}const c=o?.(a,s);if(c!==void 0)return c;if(a.name==="a")return u3(a,s,r)}};return s};const f3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],p3=Tt("code-xml",f3),g3=e=>/\.[Ss][Vv][Gg]$/u.test(e),$x=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0;return L.useMemo(()=>{if(r)return{read:(i,o)=>{const s=t.current;return s===void 0?Promise.reject(new Error("[@aiquants/markdown] the image source stand-in was called after its reader was removed")):s.read(i,o)}}},[r])},hn="data-aqmd-svg-image-control",m3=Object.freeze(["copy","source"]),y3=Object.freeze(["source"]),x3=Object.freeze({kind:"failure",retryable:!0}),zd=(e,t,r)=>new Promise(i=>i(e.read(t,r))),C3=({paragraph:e,image:t,path:r,name:i,reader:o,labels:s})=>{const{[vi.SOURCE_LINES_ATTRIBUTE]:a,...n}=e,[l,c]=L.useState(!1),[h,d]=L.useState(0),[u,f]=L.useState(null),[p,m]=L.useState(null),y=L.useId(),x=L.useId(),C=L.useRef(null),k=L.useRef(null);L.useEffect(()=>()=>k.current?.abort(),[]),L.useEffect(()=>{if(!l)return;const F=new AbortController;return zd(o,r,F.signal).then(P=>{F.signal.aborted||f({read:h,answer:P})},P=>{F.signal.aborted||(console.error("[@aiquants/markdown] the image source reader failed without an abort",P),f({read:h,answer:x3}))}),()=>F.abort()},[l,h,r,o]);const S=l&&u!==null&&u.read===h?u.answer:null,v=S!==null&&S.kind==="text"&&!S.truncated?S.text:null,_=!l||v!==null,{onKeyDown:E,onFocus:B,tabIndexOf:I}=Rh(_?m3:y3,hn),M=F=>{m(P=>({text:s[F].text,lang:s[F].lang,serial:P===null?1:P.serial+1}))},D=()=>{if(m(null),l){c(!1);return}d(F=>F+1),c(!0)},U=()=>{C.current?.focus(),d(F=>F+1)},q=(F,P)=>{const O=F.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(O===void 0){M("copyFailed");return}O.writeText(P).then(()=>M("copied"),$=>{console.error("[@aiquants/markdown] could not copy the image source",$),M("copyFailed")})},N=F=>{const P=F.currentTarget.ownerDocument.defaultView,O=P?.navigator.clipboard;if(P===null||O===void 0||typeof P.ClipboardItem!="function"||typeof O.write!="function"){M("copyFailed");return}k.current?.abort();const $=new AbortController;k.current=$;let j=!1;const T=zd(o,r,$.signal).then(W=>{if(W.kind==="text"&&!W.truncated)return new Blob([W.text],{type:"text/plain"});throw j=!0,new Error("[@aiquants/markdown] the image source cannot be copied whole")},W=>{throw j=!0,$.signal.aborted||console.error("[@aiquants/markdown] the image source reader failed without an abort",W),W});T.catch(()=>{}),O.write([new P.ClipboardItem({"text/plain":T})]).then(()=>{$.signal.aborted||M("copied")},W=>{$.signal.aborted||(j||console.error("[@aiquants/markdown] could not copy the image source",W),M("copyFailed"))})};let A;return l?S===null?A=w.jsx("p",{"data-aqmd-svg-image-loading":"",lang:s.loading.lang,children:s.loading.text}):S.kind==="failure"?A=w.jsxs("div",{"data-aqmd-svg-image-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[w.jsx("p",{lang:s.failed.lang,children:s.failed.text}),S.retryable&&w.jsxs("button",{type:"button","data-aqmd-svg-image-retry":"",onClick:U,lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[w.jsx(gn,{className:"h-4 w-4"}),s.retry.text]})]}):A=w.jsxs(w.Fragment,{children:[w.jsx("span",{id:x,hidden:!0,lang:s.sourceRegion.lang,children:It.fillLabel(s.sourceRegion.text,{name:i})}),w.jsx("pre",{"data-aqmd-svg-image-source":"",tabIndex:0,role:"region","aria-labelledby":x,children:S.text}),S.truncated&&w.jsx("p",{"data-aqmd-svg-image-truncated":"",lang:s.truncated.lang,children:s.truncated.text})]}):A=w.jsx("p",{...wt.attributesToProps(n,"p"),children:t}),w.jsxs("div",{"data-aqmd-svg-image":"","data-aqmd-svg-image-view":l?"source":"image","data-source-lines":a,children:[w.jsx("span",{id:y,hidden:!0,lang:s.toolbar.lang,children:s.toolbar.text}),w.jsxs("div",{"data-aqmd-svg-image-toolbar":"",role:"toolbar","aria-labelledby":y,onKeyDown:E,onFocus:B,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[_&&w.jsx("button",{type:"button",[hn]:"copy",tabIndex:I("copy"),onClick:F=>v===null?N(F):q(F,v),className:jr,"aria-label":s.copy.text,lang:s.copy.lang,children:w.jsx(wx,{size:18})}),w.jsx("button",{ref:C,type:"button",[hn]:"source",tabIndex:I("source"),"aria-pressed":l,onClick:D,className:jr,"aria-label":s.source.text,lang:s.source.lang,children:w.jsx(p3,{size:20})})]}),A,w.jsx("p",{"data-aqmd-svg-image-notice":"",role:"status",children:p!==null&&w.jsx("span",{lang:p.lang,children:p.text},p.serial)})]})},La=Object.freeze({toolbar:{text:"SVG image",lang:"en"},source:{text:"Source",lang:"en"},sourceRegion:{text:"Source of {name}",lang:"en"},loading:{text:"Loading the source…",lang:"en"},failed:{text:"The source could not be read.",lang:"en"},retry:{text:"Try again",lang:"en"},truncated:{text:"Only the beginning of this file is shown.",lang:"en"},copy:{text:"Copy the source",lang:"en"},copied:{text:"Copied the source.",lang:"en"},copyFailed:{text:"Could not copy the source.",lang:"en"}}),b3=Qs(La),k3=({alt:e,target:t,label:r})=>w.jsxs("span",{"data-testid":"markdown-missing-image","data-asset-src":t||void 0,role:"img","aria-label":`${e?`${r} (${e})`:r}${t?`: ${t}`:""}`,className:"my-1 inline-flex max-w-full items-center gap-2 rounded-lg border border-gray-300 border-dashed bg-gray-50 px-3 py-2 text-gray-600 text-sm dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400",children:[w.jsx(PC,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),w.jsxs("span",{className:"min-w-0",children:[w.jsx("span",{className:"font-medium",children:e?`${r} (${e})`:r}),t&&w.jsx("span",{className:"ml-2 break-all font-mono text-xs dark:text-gray-300",children:t})]})]}),w3=(e,t,r)=>{const{src:i,alt:o,"data-asset-exists":s,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||s==="false")return w.jsx(k3,{alt:o,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,w.jsx("img",{alt:"",...wt.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},Ao=e=>e.map(t=>t instanceof wt.Text?t.data:t instanceof wt.Element?Ao(t.children):"").join(""),S3=(e,t)=>e.map(r=>{if(r instanceof wt.Text)return{kind:"text",text:r.data};if(!(r instanceof wt.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=ta(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),v3=(e,t,r,i)=>{const o=e.children,s=cr.placeholderLinkOf(t,S3(o,i.iFrameAllowedDomains));if(s===null)return;const a=wt.domToReact(o,r),n=w.jsx("p",{...wt.attributesToProps(e.attribs,"p"),children:a}),l=o.find(u=>u instanceof wt.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&cr.isBareLink(Ao(l.children),s)?w.jsx(ib,{href:t,endpoint:c,size:Ne.linkCardSizeOf(i.embeds),fallback:n}):n,d=Rr.resolveEmbed(s,i.embeds.providers);return d===null?h:w.jsx(ub,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},T3=(e,t)=>{if(Fx(e))return null;const r=e.children.filter(c=>!(c instanceof wt.Text&&kl.test(c.data))),[i]=r;if(r.length!==1||!(i instanceof wt.Element)||i.name.toLowerCase()!=="img")return null;const o=ta(i.name,i.attribs,{parentName:"p",iFrameAllowedDomains:t});if(o.action!=="keep")return null;const{src:s,alt:a,"data-asset-src":n,"data-asset-exists":l}=o.attributes;return n===void 0||!g3(n)||s===void 0||s.trim()===""||l==="false"?null:{node:i,path:n,name:a!==void 0&&a.trim()!==""?a:n.slice(n.lastIndexOf("/")+1)}},_3={lowerCaseAttributeNames:!1},jd=2166136261,Wd=16777619,kl=/^[\t\n\f\r ]*$/u,B3=`language-${It.SPREADSHEETS_LANGUAGE}`,Ox=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(B3),L3=e=>{let t=jd,r=jd;const i=(s,a)=>{for(let n=0;n<s.length;n+=1){const l=s.charCodeAt(n);r=Math.imul(r^l,Wd),a&&(t=Math.imul(t^l,Wd))}},o=(s,a)=>{if(s instanceof wt.Text)i("",a),i(s.data,a);else if(s instanceof wt.Element){i("",a),i(s.name,a);for(const[l,c]of Object.entries(s.attribs))l!==vi.SOURCE_LINES_ATTRIBUTE&&(i("",a),i(l,a),i("",a),i(c,a));i("",a);const n=a&&!Ox(s);for(const l of s.children)o(l,n);i("",a)}else i("\x07",a),i(s.data,a)};return o(e,!0),{fingerprint:(t>>>0).toString(36),content:(r>>>0).toString(36)}},E3=(e,t,r,i)=>{if(e==="")return{nodes:[],keys:[]};const o=wt.htmlToDOM(e,_3),s=o.filter(l=>!(l instanceof wt.Text&&kl.test(l.data))),a=jC(s.map(L3),r);let n=0;return{nodes:o.map(l=>{if(l instanceof wt.Text&&kl.test(l.data))return l.data;const{key:c,content:h}=a[n];return n+=1,w.jsx(DC,{content:h,label:i,text:()=>Ao([l]),children:wt.domToReact([l],t)},c)}),keys:a}},Rx=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=Ne.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",blockFailedLabel:u,imageSource:f,svgImageLabels:p,onMathDiagnostics:m})=>{ru(i);const y=Kd(o),x=vx(n),C=$x(f),k=L.useMemo(()=>_i(La,p),[p]),{blockFailed:S}=_i(tu,{blockFailed:u}),v={rendered:0},_=[],E=L.useRef(null),B=L.useEffectEvent(q=>{m?.(q)}),I=Mx({iFrameAllowedDomains:r,embedLabels:y,linkComponent:h,renderPlaceholder:(q,N,A)=>v3(q,N,A,{embeds:i,theme:t,embedLabels:y,iFrameAllowedDomains:r}),renderKept:(q,N)=>{if(q.name==="p"&&C!==void 0){const A=T3(q,r);if(A!==null)return w.jsx(C3,{paragraph:q.attribs,image:wt.domToReact([A.node],N),path:A.path,name:A.name,reader:C,labels:k})}if(q.name==="pre"&&q.children.length===1){const A=q.children[0];if(A instanceof wt.Element&&A.name==="code"){const F=A.attribs.class??"",P=Ao(A.children),O=q.attribs[vi.SOURCE_LINES_ATTRIBUTE];return Ox(A)?w.jsx(Dh,{tsv:P,meta:A.attribs[It.CODE_META_ATTRIBUTE],sourceLines:O,editor:x,locale:l,labels:c}):F.includes("language-mermaid")?w.jsx(Ih,{chartContent:P,interaction:s,labels:a,sourceLines:O}):w.jsx(Nh,{lang:F.replace("language-",""),code:P,theme:t,sourceLines:O})}}if(q.name==="img")return w3(q,d,v);if(q.name==="span"&&q.attribs.class?.includes("math")){const A=q.attribs.class.includes("display");let F=Ao(q.children).trim();A?F=F.replace(/^\\\[/,"").replace(/\\\]$/,""):F=F.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:P,diagnostics:O}=kx(F,A);return _.push(...O),A?w.jsxs("span",{className:"group relative block",children:[w.jsx(_x,{code:F}),w.jsx("span",{dangerouslySetInnerHTML:{__html:P}})]}):w.jsx("span",{dangerouslySetInnerHTML:{__html:P}})}catch(P){console.error("Failed to render math:",P);return}}}}),M=L.useRef([]),{nodes:D,keys:U}=E3(e,I,M.current,S);return L.useEffect(()=>{M.current=U},[U]),L.useEffect(()=>{E.current!==e&&(E.current=e,_.length>0&&B(_))},[e,_]),w.jsx("div",{className:"markdown-body","data-theme":t,children:D})};const F3=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],A3=Tt("triangle-alert",F3);const M3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],$3=Tt("text-align-center",M3);const O3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],R3=Tt("text-align-start",O3);const I3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],P3=Tt("text-align-end",I3);const D3=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],N3=Tt("list",D3);const q3=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],z3=Tt("palette",q3);const j3=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],W3=Tt("pin",j3);const H3=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],Y3=Tt("pin-off",H3),U3=e=>`#${e.id}`,X3=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},Hd="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Ix=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=U3,label:o,labelledBy:s})=>{if(e.length===0)return null;const a=X3(e);return w.jsx("nav",{className:`toc ${t}`,"aria-label":o,"aria-labelledby":s,children:w.jsx("ul",{className:"m-0 list-none p-0",children:e.map((n,l)=>{const c=n.id===""?null:i(n);return w.jsx("li",{style:{paddingLeft:`${(n.depth-a)*1}rem`},children:c===null?w.jsx("span",{className:`${Hd} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):w.jsx("a",{href:Mo(c)?c:void 0,className:`${Hd} text-gray-600 no-underline hover:text-blue-800 dark:text-gray-300 dark:hover:text-blue-300`,onClick:r===void 0?void 0:h=>r(n,h),title:n.text,children:n.text})},l)})})})},cn="--aqmd-toolbar-block-overlap",G3=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const o=e.left<t.right&&e.right>t.left,s=e.top<r+e.height&&e.top<i,a=e.bottom-r;return o&&s&&a>0?Math.ceil(a):0},Px=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,Dx=Object.keys(Ba),V3=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,K3=Object.keys(It.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),Nx=e=>`svgImage${e.charAt(0).toUpperCase()}${e.slice(1)}`,qx=Object.keys(La),zx=Object.freeze({loading:{text:"Loading data...",lang:"en"},errorPrefix:{text:"Error: ",lang:"en"},defaultErrorTitle:{text:"An error occurred",lang:"en"},missingImage:{text:"Image not found",lang:"en"},...tu,styleTitle:{text:"Display Style",lang:"en"},selectStyleAria:{text:"Select display style",lang:"en"},pinStyleAria:{text:"Pin style selector",lang:"en"},unpinStyleAria:{text:"Unpin style selector",lang:"en"},openTocAria:{text:"目次を開く",lang:"ja"},tocTitle:{text:"目次",lang:"ja"},pinTocAria:{text:"目次をピン留め",lang:"ja"},unpinTocAria:{text:"目次のピン留めを解除",lang:"ja"},selectAlignAria:{text:"揃えを選択",lang:"ja"},alignTitle:{text:"揃え",lang:"ja"},pinAlignAria:{text:"揃え選択をピン留め",lang:"ja"},unpinAlignAria:{text:"揃え選択のピン留めを解除",lang:"ja"},alignLeft:{text:"左揃え",lang:"ja"},alignCenter:{text:"中央揃え",lang:"ja"},alignRight:{text:"右揃え",lang:"ja"},...Object.fromEntries(Dx.map(e=>[Px(e),Ba[e]])),...Object.fromEntries(qx.map(e=>[Nx(e),La[e]])),...Js}),Z3=Qs(zx),Q3=e=>_i(zx,e),J3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of Dx){const i=e[Px(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},t$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of K3){const i=e[V3(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},e$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of qx){const i=e[Nx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},r$=Object.keys(Js),i$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of r$){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},Yd=Object.freeze({left:{labelKey:"alignLeft",Icon:R3},center:{labelKey:"alignCenter",Icon:$3},right:{labelKey:"alignRight",Icon:P3}}),o$=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),s$="100%",a$=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",wl="24px",jx=e=>Object.freeze({position:"fixed",insetBlockStart:"var(--aqmd-toolbar-inset-block-start, 0px)",insetInlineEnd:`calc(var(--aqmd-toolbar-inset-inline-end, 0px) + ${e})`,zIndex:60,display:"flex",flexDirection:"row",alignItems:"flex-start",gap:"0.5rem",pointerEvents:"none"}),n$=jx(wl),l$=Object.freeze({position:"absolute",insetBlockStart:0,insetInlineStart:0,blockSize:"var(--aqmd-toolbar-inset-block-start, 0px)",inlineSize:"var(--aqmd-toolbar-inset-inline-end, 0px)",visibility:"hidden",pointerEvents:"none"}),h$=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,c$=8,Ud=800,d$=16,u$=(e,t)=>{const r=e.defaultView;let i;const o=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function s(n){o(),!(n.timeStamp-t.timeStamp>Ud||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>d$)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&o()}e.addEventListener("click",s,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(o,Ud)},f$=(e,t,r)=>{const[i,o]=L.useState(null);return L.useLayoutEffect(()=>{const s=t.current;if(!e||s===null||r===null){o(null);return}const a=s.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=s.getBoundingClientRect(),u=s.offsetHeight>0?d.height/s.offsetHeight:1,f=a?.visualViewport??null,p=f===null?Number.POSITIVE_INFINITY:f.offsetTop+f.height,m=Math.min(r.getBoundingClientRect().bottom,p);o(Math.max(0,Math.floor((m-d.top)/u-c$)))},c=()=>{a!==null&&n===0&&(n=a.requestAnimationFrame(l))};l();const h=new ResizeObserver(c);return h.observe(r),a?.addEventListener("resize",c),a?.visualViewport?.addEventListener("resize",c),a?.visualViewport?.addEventListener("scroll",c),s.ownerDocument.addEventListener("scroll",c,!0),()=>{a!==null&&n!==0&&a.cancelAnimationFrame(n),h.disconnect(),a?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("scroll",c),s.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function dn({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:o,pinLabel:s,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:u,onPinToggle:f,popoverClassName:p,scrollBarClearance:m,boundary:y,renderBody:x}){const C=L.useRef(null),k=L.useRef(null),S=L.useRef(null),v=f$(n,S,y),_=L.useCallback(()=>{d(),h()},[h,d]),E=L.useCallback(()=>{if(l)return;const I=C.current?.contains(document.activeElement)===!0;u(),I&&k.current?.focus()},[l,u]);L.useEffect(()=>{if(!n||l)return;const I=C.current;if(I===null)return;const M=U=>{I.contains(U.target)||(u(),U.pointerType==="touch"&&!(U.target instanceof Element&&U.target.closest("[data-aqmd-toolbar]")!==null)&&u$(I.ownerDocument,U))},D=U=>{U.key!=="Escape"||U.defaultPrevented||U.isComposing||(U.preventDefault(),u(),k.current?.focus())};return document.addEventListener("pointerdown",M),I.addEventListener("keydown",D),()=>{document.removeEventListener("pointerdown",M),I.removeEventListener("keydown",D)}},[n,l,u]);const B=l?a:s;return w.jsxs("div",{ref:C,"data-aqmd-toolbar-menu":e,children:[w.jsx("button",{ref:k,type:"button",className:"pointer-events-auto rounded-full border border-gray-200 bg-white p-3 shadow-lg transition-colors hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",onClick:_,"aria-label":r.text,lang:r.lang,"aria-expanded":n,children:w.jsx(t,{className:"h-5 w-5 text-gray-600 dark:text-gray-300"})}),n&&w.jsxs("div",{ref:S,"data-aqmd-toolbar-popover":e,className:`pointer-events-auto absolute end-0 top-full mt-2 box-border overflow-y-auto overscroll-contain rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-800 ${p}`,style:{zIndex:c?2:1,maxInlineSize:h$(m),maxBlockSize:v??void 0},children:[w.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[w.jsx("h3",{id:o,lang:i.lang,className:"px-2 font-bold text-gray-600 text-sm uppercase tracking-wider dark:text-gray-300",children:i.text}),w.jsx("button",{type:"button",className:"rounded p-3.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200",onClick:f,"aria-label":B.text,lang:B.lang,children:l?w.jsx(W3,{className:"h-4 w-4"}):w.jsx(Y3,{className:"h-4 w-4"})})]}),x(E)]})]})}const p$=(e,t,r,i)=>{const[o,s]=L.useState(0),a=L.useRef(null);return L.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,s(0);return}const c=()=>{const p=n.getBoundingClientRect();s(G3({toolbar:r.getBoundingClientRect(),content:l.getBoundingClientRect(),scrollportTop:p.top+n.clientTop,scrollportBottom:p.bottom}))};a.current=c;let h=null;const d=()=>{h===null&&(h=requestAnimationFrame(()=>{h=null,c()}))};c();const u=new ResizeObserver(c);u.observe(n),u.observe(l),u.observe(r);const f=r.querySelector("[data-aqmd-toolbar-inset-probe]");return f!==null&&u.observe(f),window.addEventListener("resize",c),window.addEventListener("scroll",d,{capture:!0,passive:!0}),()=>{a.current=null,u.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",d,{capture:!0}),h!==null&&cancelAnimationFrame(h)}},[e,t,r]),L.useLayoutEffect(()=>{a.current?.()},[i]),o},g$=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,m$=e=>{let t=null,r=e;for(;r!==null;)r.getAttribute("hidden")?.toLowerCase()==="until-found"&&(r.dispatchEvent(new Event("beforematch",{bubbles:!0})),r.removeAttribute("hidden")),r instanceof HTMLDetailsElement&&!r.open&&t!==null&&t!==Array.from(r.children).find(i=>i.localName==="summary")&&(r.open=!0),t=r,r=r.parentElement},y$=L.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:u,spreadsheetLabels:f,imageSource:p,svgImageLabels:m,onMathDiagnostics:y}){return w.jsx("div",{className:"w-full min-w-0",children:w.jsx("div",{className:i,"data-theme":r,children:w.jsx(Rx,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:u,spreadsheetLabels:f,imageSource:p,svgImageLabels:m,onMathDiagnostics:y})})})});function Wx(){const[e,t]=L.useState("toc"),[r,i]=L.useState(!1),[o,s]=L.useState(!1),[a,n]=L.useState(!1),[l,c]=L.useState(!1),[h,d]=L.useState(!1),[u,f]=L.useState(!1),p=L.useCallback(()=>t("toc"),[]),m=L.useCallback(()=>i(M=>!M),[]),y=L.useCallback(()=>i(!1),[]),x=L.useCallback(()=>c(M=>!M),[]),C=L.useCallback(()=>t("style"),[]),k=L.useCallback(()=>s(M=>!M),[]),S=L.useCallback(()=>s(!1),[]),v=L.useCallback(()=>d(M=>!M),[]),_=L.useCallback(()=>t("align"),[]),E=L.useCallback(()=>n(M=>!M),[]),B=L.useCallback(()=>n(!1),[]),I=L.useCallback(()=>f(M=>!M),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:u,activateToc:p,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:k,closeStyle:S,togglePinStyle:v,activateAlign:_,toggleAlign:E,closeAlign:B,togglePinAlign:I}}const x$=({error:e,labels:t})=>{if(L.isValidElement(e))return w.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,o=i.title!==void 0&&i.title!=="";return w.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-6 shadow-sm backdrop-blur-sm dark:border-red-900/50 dark:bg-red-950/30",children:w.jsxs("div",{className:"flex items-start gap-3",children:[w.jsx("div",{className:"rounded-lg bg-red-100 p-2 text-red-600 dark:bg-red-900/50 dark:text-red-400",children:w.jsx(A3,{className:"h-5 w-5"})}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("h3",{lang:o?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:o?i.title:t.defaultErrorTitle.text}),i.status&&w.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 font-medium font-mono text-red-700 text-xs dark:bg-red-900/60 dark:text-red-300",children:i.status})]}),w.jsx("p",{className:"mt-2 text-red-700 text-sm leading-relaxed dark:text-red-300/90",children:i.message})]})]})})}const r=typeof e=="string"?e:String(e);return w.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-4 text-center dark:border-red-900/50 dark:bg-red-950/30",children:w.jsxs("p",{className:"font-medium text-red-700 text-sm dark:text-red-300",children:[w.jsx("span",{lang:t.errorPrefix.lang,children:t.errorPrefix.text}),r]})})};function C$({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,style:a,onStyleChange:n,availableStyles:l=Yi.DEFAULT_MARKDOWN_STYLES,align:c=Yi.DEFAULT_CONTENT_ALIGN,onAlignChange:h,showToc:d=!0,showStyle:u=!0,showAlign:f=!0,width:p,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=Ne.NO_EMBEDS,emptyMessage:k,toolbar:S,linkComponent:v,onHeadingSelect:_,headingHref:E,onMathDiagnostics:B,spreadsheetEditor:I,spreadsheetLocale:M,imageSource:D,renderScrollBar:U}){const q=L.useRef(null),[N,A]=L.useState(null),F=L.useCallback(Z=>{q.current=Z,A(Z)},[]),[P,O]=L.useState(0),$=L.useRef(null),[j,T]=L.useState(null),W=L.useRef(null),z=L.useId(),G=Wx(),X=S??G,K=L.useMemo(()=>Q3(o),[o]),Q=L.useMemo(()=>J3(o),[o]),nt=L.useMemo(()=>t$(o),[o]),gt=L.useMemo(()=>e$(o),[o]),ut=$x(D),mt=vx(I);ru(C);const Lt=Rr.EMBED_PROVIDER_IDS.filter(Z=>C.providers.includes(Z)).join(" "),Ft=C.linkCardEndpoint,Mt=C.linkCardSize,Ht=L.useMemo(()=>{const Z=Lt.split(" "),it=Object.freeze(Rr.EMBED_PROVIDER_IDS.filter(St=>Z.includes(St)));return Object.freeze(Mt===void 0?{providers:it,linkCardEndpoint:Ft}:{providers:it,linkCardEndpoint:Ft,linkCardSize:Mt})},[Lt,Ft,Mt]),Yt=o?.embeddedVideo,Qt=o?.embeddedPost,we=o?.embeddedFrame,Se=L.useMemo(()=>i$({embeddedVideo:Yt,embeddedPost:Qt,embeddedFrame:we}),[Yt,Qt,we]),_t=L.useRef(B);L.useLayoutEffect(()=>{_t.current=B},[B]);const Ct=L.useCallback(Z=>{_t.current?.(Z)},[]),ve=k===void 0?o$:{text:k,lang:void 0},Yr=p$(q,$,j,c);if(!Yi.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${Yi.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const ge=Number.isFinite(y)&&y>=0?y:16,sr=L.useCallback(Z=>{const it=q.current;if(it){const St=it.querySelector("[data-theme]"),Et=it.getBoundingClientRect(),ie=St?.children;let le=-1,Vr=Number.POSITIVE_INFINITY;if(ie)for(let Hi=0;Hi<ie.length;Hi+=1){const Ea=ie[Hi],zh=Math.abs(Ea.getBoundingClientRect().top-Et.top);zh<Vr&&(Vr=zh,le=Hi)}if(ie&&le>=0){const Ea=ie[le].getBoundingClientRect();W.current={childIndex:le,offset:Ea.top-Et.top}}else W.current=null}n(Z)},[n]);L.useLayoutEffect(()=>{const Z=W.current;if(!Z)return;W.current=null;const it=q.current;if(!it)return;const Et=it.querySelector("[data-theme]")?.children[Z.childIndex];if(!Et)return;const ie=it.getBoundingClientRect(),Vr=Et.getBoundingClientRect().top-ie.top;it.scrollTop+=Vr-Z.offset});const{isTocPinned:xr,closeToc:Xe}=X,Cr=L.useCallback((Z,it)=>{if(xr||Xe(),_?.(Z,it)===!0)return;it.preventDefault();const Et=q.current?.querySelector(`#${CSS.escape(Z.id)}`)??document.getElementById(Z.id);Et&&(m$(Et),Et.tabIndex<0&&!Et.hasAttribute("tabindex")&&Et.setAttribute("tabindex","-1"),Et.scrollIntoView({behavior:g$()?"instant":"smooth",block:"start"}),Et.focus({preventScroll:!0}))},[Xe,xr,_]),Ur=L.useMemo(()=>l.find(it=>it.name===a)?.className??"markdown-body",[l,a]),ar=e?.headings??[],br=!(i||r),Re=br&&e!==null,Te=br&&e===null&&t!==null,kr=Re&&d&&ar.length>0,J=Re&&u,xt=(Re||Te)&&f&&typeof h=="function"&&(p!==void 0||m!==void 0),Dt=L.useMemo(()=>w.jsx(Ix,{headings:ar,className:"text-sm",labelledBy:z,onHeadingSelect:Cr,headingHref:E}),[ar,z,Cr,E]),At=U===void 0?wl:`${P}px`,Xr=L.useMemo(()=>At===wl?n$:jx(At),[At]),Gr=kr||J||xt?w.jsxs("div",{ref:T,"data-aqmd-toolbar":!0,style:Xr,children:[w.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:l$}),xt&&h&&w.jsx(dn,{menu:"align",Icon:Yd[c].Icon,buttonLabel:K.selectAlignAria,titleLabel:K.alignTitle,pinLabel:K.pinAlignAria,unpinLabel:K.unpinAlignAria,isOpen:X.isAlignOpen,isPinned:X.isAlignPinned,isFront:X.lastActiveMenu==="align",onActivate:X.activateAlign,onToggle:X.toggleAlign,onClose:X.closeAlign,onPinToggle:X.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:N,renderBody:Z=>w.jsx("div",{className:"space-y-1",children:Yi.CONTENT_ALIGNS.map(it=>{const{labelKey:St,Icon:Et}=Yd[it],ie=K[St],le=c===it;return w.jsxs("button",{type:"button","aria-pressed":le,lang:ie.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${le?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{h(it),Z()},children:[w.jsx(Et,{className:"h-4 w-4"}),ie.text]},it)})})}),J&&w.jsx(dn,{menu:"style",Icon:z3,buttonLabel:K.selectStyleAria,titleLabel:K.styleTitle,pinLabel:K.pinStyleAria,unpinLabel:K.unpinStyleAria,isOpen:X.isStyleOpen,isPinned:X.isStylePinned,isFront:X.lastActiveMenu==="style",onActivate:X.activateStyle,onToggle:X.toggleStyle,onClose:X.closeStyle,onPinToggle:X.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:N,renderBody:Z=>w.jsx("div",{className:"space-y-1",children:l.map(it=>{const St=a===it.name;return w.jsx("button",{type:"button","aria-pressed":St,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${St?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{sr(it.name),Z()},children:it.name},it.name)})})}),kr&&w.jsx(dn,{menu:"toc",Icon:N3,buttonLabel:K.openTocAria,titleLabel:K.tocTitle,titleId:z,pinLabel:K.pinTocAria,unpinLabel:K.unpinTocAria,isOpen:X.isTocOpen,isPinned:X.isTocPinned,isFront:X.lastActiveMenu==="toc",onActivate:X.activateToc,onToggle:X.toggleToc,onClose:X.closeToc,onPinToggle:X.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:At,boundary:N,renderBody:()=>Dt})]}):null,No=()=>i?w.jsxs("p",{children:[w.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",w.jsx("span",{lang:K.loading.lang,children:K.loading.text})]}):r?w.jsx(x$,{error:r,labels:K}):e?w.jsx("div",{className:"relative w-full min-w-0",children:w.jsx(y$,{parseResult:e,theme:s,styleClassName:Ur,iFrameAllowedDomains:x,embeds:Ht,embedLabels:Se,linkComponent:v,missingImageLabel:K.missingImage.text,blockFailedLabel:o?.blockFailed,mermaidLabels:Q,spreadsheetEditor:mt,spreadsheetLocale:M,spreadsheetLabels:nt,imageSource:ut,svgImageLabels:gt,onMathDiagnostics:Ct})}):t!==null?w.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):w.jsx("p",{lang:ve.lang,children:ve.text}),Wi={containerType:"inline-size",paddingInline:`${ge}px`,paddingBlockEnd:`${ge}px`,paddingBlockStart:`calc(${ge}px + var(${cn}))`,scrollPaddingBlockStart:`var(${cn})`,[cn]:`${Yr}px`};return w.jsxs(Qd,{scrollerRef:F,scrollerProps:{"data-testid":"viewer","data-aqmd-scroll-container":!0,className:"grid h-full w-full overflow-x-auto overflow-y-auto *:min-w-0",style:Wi},renderScrollBar:U,onBarInlineSizeChange:O,children:[Gr,w.jsx("div",{ref:$,"data-aqmd-content":!0,style:{width:p??s$,maxWidth:m,marginInline:a$(c)},children:No()})]})}const Hx=({node:e})=>w.jsx("del",{children:w.jsx(zt,{nodes:e.children})}),Yx=({node:e})=>w.jsx("em",{children:w.jsx(zt,{nodes:e.children})}),Ux=({node:e})=>w.jsx("sup",{children:w.jsxs("a",{id:`fnref-${e.identifier}`,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",href:`#fn-${e.identifier}`,children:["[",e.identifier,"]"]})}),b$=({nodes:e,theme:t="light"})=>e.length===0?null:w.jsx("section",{className:"border-[#171717] border-t pt-4 dark:border-[#464646]",children:w.jsx("ol",{className:"pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]",children:e.map((r,i)=>w.jsx("li",{id:`fn-${r.identifier}`,className:i===0?"":"mt-4",children:w.jsx(zt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),Xx=({node:e})=>w.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),k$=e=>e.replace(/<rt\b[^>]*>[\s\S]*?<\/rt>/gi,"").replace(/<rp\b[^>]*>[\s\S]*?<\/rp>/gi,"").replace(/<[^>]+>/g,"").replace(/ /gi," ").replace(/&/gi,"&").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&#(\d+);/g,(o,s)=>{const a=Number(s);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(o,s)=>{const a=Number.parseInt(s,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),Gx=e=>{const t=r=>{if(!r||typeof r!="object")return"";if("type"in r&&r.type==="html"){const i=r.value;return typeof i=="string"?k$(i):""}if("value"in r){const i=r.value;if(typeof i=="string")return i}return"children"in r&&Array.isArray(r.children)?r.children.map(i=>t(i)).join(""):""};return e.map(r=>t(r)).join("").replace(/\s+/g," ").trim()},w$=e=>{switch(e){case 1:return"border-b-2 border-gray-300 pb-2 text-3xl font-bold dark:border-gray-600 dark:text-gray-100";case 2:return"border-b border-gray-300 pb-2 text-2xl font-semibold dark:border-gray-600 dark:text-gray-200";case 3:return"text-xl font-semibold dark:text-gray-300";default:return"text-lg font-medium dark:text-gray-400"}},Vx=({node:e})=>{const t=new mC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(Gx(e.children));return w.jsx(r,{id:i||o,className:w$(e.depth),children:w.jsx(zt,{nodes:e.children})})},S$=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),v$=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=w.jsx(zt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=ta(e.data.tagName,S$(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(o.action==="unwrap")return i;if(o.action!=="keep"&&o.action!=="placeholder")return null;const s=e.data.tagName.toLowerCase();return w.jsx(s,{...wt.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},T$=/^\s*<(address|article|aside|blockquote|details|dialog|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h[1-6]|header|hgroup|hr|li|main|nav|ol|p|pre|section|table|ul)/i,_$=({node:e,iFrameAllowedDomains:t=[]})=>{const r=wt(e.value,Mx({iFrameAllowedDomains:t,embedLabels:CC}));return Array.isArray(r)&&r.length===0?null:T$.test(e.value)?w.jsx("div",{children:r}):w.jsx("span",{children:r})},Kx=({node:e})=>{if(!e.url||e.url.trim()===""||!Mo(e.url))return null;const t=e.title??"",r=e.data?.hProperties?.width,i=e.data?.hProperties?.height;return w.jsxs("span",{style:{width:r,height:i},className:"mt-4 mb-4 inline-block w-fit max-w-full",children:[w.jsx("img",{src:e.url,alt:e.alt??"",className:"mx-auto h-full w-full",width:r,height:i}),t&&w.jsx("em",{className:"block text-center text-gray-400 text-xs",children:t})]})},Zx=({node:e})=>w.jsx("code",{className:"rounded-md bg-gray-200 px-1.5 py-1 font-mono text-gray-800 text-sm dark:bg-gray-700 dark:text-gray-200",children:e.value}),B$=({node:e})=>{const t=Bx(e.value,!1),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return t.kind==="rendered"?w.jsx("span",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("span",{className:r,children:t.message})},L$=new RegExp(`<(?:${[...qh].join("|")})(?=[\\s/>])`,"i"),Qx=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&L$.test(t.value)||t.children!==void 0&&Qx(t.children)),Jx=({node:e})=>{const t=Mo(e.url)?e.url:void 0,r=t!==void 0&&Lx(t);return w.jsx("a",{className:Ex(void 0,Qx(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:w.jsx(zt,{nodes:e.children})})},tC=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?w.jsx("li",{children:w.jsx(zt,{nodes:e.children[0].children})}):w.jsx("li",{children:w.jsx(zt,{nodes:e.children})}),eC=({node:e})=>{const t=e.ordered?"ol":"ul";return w.jsx(t,{children:w.jsx(zt,{nodes:e.children})})},E$=({node:e})=>w.jsx("mark",{children:w.jsx(zt,{nodes:e.children})}),rC=({node:e})=>w.jsx("p",{children:w.jsx(zt,{nodes:e.children})}),iC=({node:e})=>w.jsx("strong",{children:w.jsx(zt,{nodes:e.children})}),F$=({node:e})=>w.jsx("sub",{children:w.jsx(zt,{nodes:e.children})}),A$=({node:e})=>w.jsx("sup",{children:w.jsx(zt,{nodes:e.children})}),Xd=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},oC=({node:e})=>{const[t,...r]=e.children;return w.jsx("div",{className:"overflow-x-auto",children:w.jsxs("table",{className:"w-full border-collapse border-none",children:[w.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:w.jsx("tr",{children:t.children.map((i,o)=>{const{merged:s,colSpan:a,rowSpan:n,textAlign:l}=Xd(i);return s?null:w.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[o]??void 0},className:"border border-gray-300 px-4 py-2 text-left font-semibold dark:border-gray-600 dark:text-gray-200",children:w.jsx(zt,{nodes:i.children})},`mdast-table-node-${e.type}-${o}`)})})}),w.jsx("tbody",{children:r.map((i,o)=>w.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((s,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=Xd(s);return n?null:w.jsx("td",{colSpan:l,rowSpan:c,style:{textAlign:h??e.align?.[a]??void 0},className:"border border-gray-300 px-4 py-2 dark:border-gray-600 dark:text-gray-300",children:w.jsx(zt,{nodes:s.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},sC=({node:e})=>w.jsx(w.Fragment,{children:e.value}),aC=()=>w.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),nC=({node:e})=>{const t=e.data?.title||"";return w.jsxs("details",{className:"markdown-details",children:[w.jsx("summary",{children:t}),w.jsx("div",{className:"markdown-details-content",children:w.jsx(zt,{nodes:e.children})})]})},lC=({node:e})=>{const r=["message",e.data?.messageType||"message"].filter(Boolean).join(" ");return w.jsxs("aside",{className:r,children:[w.jsx("span",{className:"message-symbol",style:{userSelect:"none"},children:"!"}),w.jsx("div",{className:"message-content",children:w.jsx(zt,{nodes:e.children})})]})},zt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,o)=>{switch(i.type){case"blockquote":return w.jsx(hC,{node:i},`mdast-node-${i.type}-${o}`);case"break":return w.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return w.jsx(Nh,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return w.jsx(Hx,{node:i},`mdast-node-${i.type}-${o}`);case"details":return w.jsx(nC,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return w.jsx(Yx,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return w.jsx(Ux,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return w.jsx(Xx,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return w.jsx(Vx,{node:i},`mdast-node-${i.type}-${o}`);case"html":return w.jsx(_$,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${o}`);case"html-block-container":{const s=i,a=`mdast-node-${s.type}-${s.position?.start?.offset??"na"}-${s.position?.end?.offset??"na"}`;return w.jsx(v$,{node:s,theme:t,iFrameAllowedDomains:r},a)}case"image":return w.jsx(Kx,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return w.jsx(Zx,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return w.jsx(B$,{node:i},`mdast-node-${i.type}-${o}`);case"link":return w.jsx(Jx,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return w.jsx(tC,{node:i},`mdast-node-${i.type}-${o}`);case"list":return w.jsx(eC,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return w.jsx(E$,{node:i},`mdast-node-${i.type}-${o}`);case"math":return w.jsx(G5,{node:i},`mdast-node-${i.type}-${o}`);case"message":return w.jsx(lC,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return w.jsx(rC,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return w.jsx(iC,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return w.jsx(F$,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return w.jsx(A$,{node:i},`mdast-node-${i.type}-${o}`);case"table":return w.jsx(oC,{node:i},`mdast-node-${i.type}-${o}`);case"text":return w.jsx(sC,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return w.jsx(aC,{},`mdast-node-${i.type}-${o}`);case"yaml":return null;default:{if(process.env.NODE_ENV==="development")return w.jsxs("div",{children:[w.jsxs("p",{style:{color:"red"},children:["Unknown node type: ",i.type]}),w.jsx("pre",{children:JSON.stringify(i,null,2)})]},`mdast-node-${i.type}-${o}`);throw new Error(`Unknown node type: ${i.type}`)}}}),hC=({node:e})=>w.jsx("blockquote",{className:"my-4 border-gray-300 border-l-4 bg-gray-50 p-4 italic dark:border-gray-500 dark:bg-gray-800 dark:text-gray-300",children:w.jsx(zt,{nodes:e.children})}),M$=/\s*\{#(.+?)\}\s*$/,$$=()=>e=>{fe.visit(e,"heading",t=>{if(t.children.length===0)return;const r=t.children[t.children.length-1];if(r?.type!=="text")return;const i=r,o=i.value.match(M$);if(o){const s=o[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=s,a.hProperties=n,i.value=i.value.substring(0,o.index).trimEnd(),i.value===""&&t.children.pop()}})},O$=()=>e=>{fe.visit(e,"footnoteDefinition",t=>{fe.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},R$=()=>e=>{fe.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const s=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(s){const[,a,n]=s,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},I$=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let o=0;for(;o<i.length;){const s=i[o];if(s.type==="html"&&s.value.startsWith("<")&&!s.value.startsWith("</")&&s.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=o;d<i.length;d++){const u=i[d];if(u.type==="html"){n+=u.value;const f=u.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const p of f){const m=p.match(/<\/?([a-zA-Z0-9]+)/);if(!m)continue;const y=m[1];p.startsWith("</")?c.length>0&&c[c.length-1]===y&&c.pop():p.startsWith("<")&&c.push(y)}}else if(u.type==="text")n+=u.value;else{c.length===0&&(h=!0);break}if(l++,c.length===0){h=!0;break}}h&&i.splice(o,l,{type:"html",value:n})}o++}};fe.visit(e,"paragraph",t),fe.visit(e,"tableCell",t),fe.visit(e,"heading",t),fe.visit(e,"emphasis",t),fe.visit(e,"strong",t),fe.visit(e,"delete",t)},Gd=/\s*=\s*(\d+)(w|h|x|y)\s*/g,P$=()=>e=>{fe.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(Gd)];return{updatedText:l.replaceAll(Gd,"").trim(),matches:c}},{updatedText:i,matches:o}=r(t.alt);t.alt=i;const{updatedText:s,matches:a}=r(t.title);t.title=s||null;const n=[...o,...a];if(n.length>0){t.data||(t.data={}),t.data.hProperties||(t.data.hProperties={});for(const l of n){const c=Number.parseInt(l[1],10),h=l[2];h==="w"||h==="x"?t.data.hProperties.width=c:(h==="h"||h==="y")&&(t.data.hProperties.height=c)}}})},D$=()=>e=>{fe.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},Vd=/^:::(message|details)\s*(.*)/,N$=()=>e=>{function t(r){const i=[];let o=0;for(;o<r.length;){const s=r[o];if(s.type==="paragraph"&&s.children[0]?.type==="text"&&s.children[0].value.trim().startsWith(":::")){const l=s.children[0].value.trim().match(Vd);if(l){const c=o;let h=-1,d=1;const u=s.children.at(-1);if(s.children.length>1&&u?.type==="text"&&u.value.trim()===":::")h=c;else for(let f=c+1;f<r.length;f++){const p=r[f];if(p.type==="paragraph"&&p.children[0]?.type==="text"){const m=p.children[0].value.trim();Vd.test(m)?d++:m===":::"&&d--}if(d===0){h=f;break}}if(h!==-1){const f=l[1],p=l[2];let m;if(h===c){const C=s.children.slice(1,-1);C[0]?.type==="break"&&C.shift(),C.at(-1)?.type==="break"&&C.pop(),m=C.length>0?[{type:"paragraph",children:C}]:[]}else{const C=s.children.slice(1);C[0]?.type==="break"&&C.shift();const k={type:"paragraph",children:C},v=r[h].children.slice(0,-1);v.at(-1)?.type==="break"&&v.pop();const _={type:"paragraph",children:v},E=r.slice(c+1,h);m=[k,...E,_].filter(B=>!(B.type==="paragraph"&&B.children.length===0))}const y=t(m);let x;if(f==="message"?x={type:"message",data:{messageType:p.trim()},children:y}:f==="details"&&(x={type:"details",data:{title:p.trim()},children:y}),x){i.push(x),o=h+1;continue}}}}const a={...s};"children"in a&&Array.isArray(a.children)&&(a.type==="blockquote"||a.type==="footnoteDefinition"||a.type==="message"||a.type==="details"?a.children=t(a.children):a.type==="list"&&(a.children=a.children.map(n=>({...n,children:t(n.children)})))),i.push(a),o++}return i}e.children=t(e.children)},q$=e=>{const t=[];return fe.visit(e,"heading",r=>{const i=Gx(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=hC;exports.CodeNode=Nh;exports.Color=Me;exports.Color$1=Di;exports.DEFAULT_MARKDOWN_EMBED_LABELS=xC;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=Z3;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=cM;exports.DEFAULT_MERMAID_INTERACTION=mx;exports.DEFAULT_SVG_IMAGE_LABELS=b3;exports.DeleteNode=Hx;exports.EmphasisNode=Yx;exports.FootnoteBackLinkNode=Xx;exports.FootnoteReferenceNode=Ux;exports.FootnotesSection=b$;exports.HeadingNode=Vx;exports.HostedScrollArea=Qd;exports.ImageNode=Kx;exports.InlineCodeNode=Zx;exports.JSON_SCHEMA=xg;exports.LinkNode=Jx;exports.ListItemNode=tC;exports.ListNode=eC;exports.MarkdownRenderer=Rx;exports.MarkdownViewer=C$;exports.MermaidDiagram=Ih;exports.NodesRenderer=zt;exports.ParagraphNode=rC;exports.Rgb=se;exports.SpreadsheetBlock=Dh;exports.StrongNode=iC;exports.TableNode=oC;exports.TableOfContents=Ix;exports.TextNode=sC;exports.ThematicBreakNode=aC;exports.Utils=pt;exports.ZERO_WIDTH_SPACE=zg;exports.ZennDetailsNode=nC;exports.ZennMessageNode=lC;exports.__export=hu;exports.__name=g;exports.abs=LS;exports.acos=IS;exports.adjustChannel=_l;exports.argumentsTag=ah;exports.array=uf;exports.arrayBufferTag=Lg;exports.arrayTag=Bg;exports.asin=PS;exports.assignWithDepth_default=qt;exports.at=rt;exports.atan2=ES;exports.booleanTag=sh;exports.calculateMathMLDimensions=tk;exports.calculateTextDimensions=ga;exports.calculateTextHeight=fh;exports.calculateTextWidth=je;exports.cleanAndMerge=ma;exports.clear=Eu;exports.clear$1=AB;exports.clear$2=oB;exports.clear2=TB;exports.color=Fi;exports.commonDb_exports=Al;exports.common_default=Pi;exports.computeDimensionOfText=Tm;exports.computeLabelTransform=ii;exports.configureLabelImages=gh;exports.configureSvgSize=Fl;exports.constant=_r;exports.constant$1=sa;exports.cos=FS;exports.createText=Oe;exports.curveBasis=Ms;exports.darken=Y;exports.dataViewTag=Fg;exports.dateTag=vg;exports.dayjs2=cu;exports.decodeEntities=pr;exports.defaultConfig2=hk;exports.defaultConfig_default=Bl;exports.define=oa;exports.distExports=bg;exports.edgeLabels=Lo;exports.epsilon=$n;exports.extend=Nl;exports.extractHeadings=q$;exports.float32ArrayTag=Dg;exports.float64ArrayTag=Ng;exports.generateId=Xg;exports.getAccDescription=$u;exports.getAccTitle=Au;exports.getConfig=Ot;exports.getConfig2=kt;exports.getDefaultExportFromCjs=Zd;exports.getDiagramTitle=Ru;exports.getEdgeId=ET;exports.getEffectiveHtmlLabels=ee;exports.getIconSVG=qi;exports.getLineFunctionsWithOffset=i0;exports.getRegisteredLayoutAlgorithm=cL;exports.getStylesFromArray=uh;exports.getSubGraphTitleMargins=ya;exports.getTag=fa;exports.getThemeVariables3=uu;exports.getUrl=Bu;exports.getUserDefinedConfig=z1;exports.halfPi=On;exports.hasKatex=Li;exports.hue=sw;exports.insertCluster=Im;exports.insertEdge=n0;exports.insertEdgeLabel=o0;exports.insertNode=Fh;exports.int16ArrayTag=Ig;exports.int32ArrayTag=Pg;exports.int8ArrayTag=Rg;exports.interpolateNumber=Qe;exports.interpolateRgb=Tn;exports.interpolateString=Ju;exports.isDark=ke;exports.isLabelStyle=rh;exports.isPrimitive=pa;exports.isTypedArray=mo;exports.isValidShape=r0;exports.lighten=H;exports.line=pf;exports.lineBreakRegex=Ii;exports.load=Cg;exports.log=V;exports.mapTag=Tg;exports.markerOffsets=Zt;exports.markers_default=c0;exports.max=AS;exports.min=MS;exports.nogamma=ql;exports.numberTag=oh;exports.objectTag=Eg;exports.parseFontSize=Io;exports.parseGenericTypes=xn;exports.pi=la;exports.positionEdgeLabel=s0;exports.positionNode=_B;exports.random=Vg;exports.regexpTag=wg;exports.registerIconPacks=em;exports.remarkCustomHeadingId=$$;exports.remarkFootnoteBackLink=O$;exports.remarkHtmlAnchorToLink=R$;exports.remarkHtmlInHtml=I$;exports.remarkImageSize=P$;exports.remarkParentNode=D$;exports.remarkZennMessage=N$;exports.render=hL;exports.renderKatexSanitized=El;exports.rgbConvert=Ku;exports.rgba=Je;exports.sanitizeText=Ce;exports.select=yt;exports.selectSvgElement=If;exports.setAccDescription=Mu;exports.setAccTitle=Fu;exports.setConfig2=lk;exports.setDiagramTitle=Ou;exports.setNodeElem=vB;exports.setTag=_g;exports.setupGraphViewbox=Lu;exports.setupGraphViewbox2=Iu;exports.sin=$S;exports.sqrt=OS;exports.stringTag=ih;exports.styles2String=ot;exports.symbolTag=Sg;exports.tau=RS;exports.terminalLabels=Ut;exports.uint16ArrayTag=$g;exports.uint32ArrayTag=Og;exports.uint8ArrayTag=Ag;exports.uint8ClampedArrayTag=Mg;exports.unknownIcon=Jg;exports.updateNodeBounds=st;exports.useMarkdownToolbarState=Wx;exports.utils_default=xe;exports.withPath=df;exports.wrapLabel=Kg;
|
|
314
|
+
`)},y5=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},x5=(e,t,r,i,o)=>{const s=o==="down"?1:o==="up"?-1:0,a=o==="right"?1:o==="left"?-1:0,n=(d,f)=>d>=0&&d<t&&f>=0&&f<r,l=(d,f)=>e(d,f)!=="";let c=i.row+s,h=i.col+a;if(!n(c,h))return{row:i.row,col:i.col};if(l(i.row,i.col)&&l(c,h)){for(;n(c+s,h+a)&&l(c+s,h+a);)c+=s,h+=a;return{row:c,col:h}}for(;n(c,h);){if(l(c,h))return{row:c,col:h};c+=s,h+=a}return{row:c-s,col:h-a}},C5=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,b5=e=>C5.test(e)?e:void 0,k5=(e,t)=>{const r=`${t(e.startCol)}${e.startRow+1}`;return e.startRow===e.endRow&&e.startCol===e.endCol?r:`${r}:${t(e.endCol)}${e.endRow+1}`},w5=Object.freeze(["decreaseColumnWidth","increaseColumnWidth","autoFitColumnWidth","decreaseRowHeight","increaseRowHeight"]),S5=()=>{let e=Object.freeze({row:0,col:0});const t=new Set;return{get:()=>e,set:r=>{if(!(r.row===e.row&&r.col===e.col)){e=Object.freeze({row:r.row,col:r.col});for(const i of[...t])i()}},subscribe:r=>(t.add(r),()=>{t.delete(r)})}},os="data-aqmd-spreadsheet-control",v5=Object.freeze(["zoom-in","zoom-out","reset-zoom","highlight","track-size","copy","save","save-menu","fullscreen"]),T5=({labels:e,labelledBy:t,rows:r,cols:i,canZoomIn:o,canZoomOut:s,zoom:a,onZoom:n,onResetZoom:l,highlighted:c,onToggleHighlight:h,onCopy:d,onSave:f,fullscreen:u,onToggleFullscreen:g,gridReady:m,activeCell:y,onTrackSize:x})=>{const{onKeyDown:C,onFocus:w,tabIndexOf:S}=Ih(v5,os),[v,_]=L.useState(!1),E=L.useId(),B=L.useRef(null),D=v&&m,M=(N,q,A,$,O,F,R=jr)=>k.jsx("button",{type:"button",[os]:N,tabIndex:S(N),onClick:O?A:void 0,"aria-disabled":O?void 0:"true","aria-pressed":F,className:R,"aria-label":q.text,lang:q.lang,children:$}),P=bl(a),U={text:It.fillLabel(e.resetZoom.text,{percent:P}),lang:e.resetZoom.lang};return k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",role:"toolbar","aria-labelledby":t,onKeyDown:C,onFocus:w,className:"mb-1 flex flex-wrap items-center gap-1",children:[M("zoom-in",e.zoomIn,()=>n(1),k.jsx(hu,{size:20}),m&&o),M("zoom-out",e.zoomOut,()=>n(-1),k.jsx(cu,{size:20}),m&&s),M("reset-zoom",U,l,k.jsxs("span",{"data-aqmd-spreadsheet-zoom":"",children:[k.jsxs("span",{"data-aqmd-spreadsheet-zoom-widest":"","aria-hidden":"true",children:[bl(oe.SPREADSHEET_ZOOM_MAX)," %"]}),k.jsxs("span",{children:[P," %"]})]}),m&&a!==1,void 0,ZA),M("highlight",e.highlight,h,k.jsx(GM,{size:18}),m,c),k.jsx("button",{type:"button",ref:B,[os]:"track-size",tabIndex:S("track-size"),onClick:m?()=>_(N=>!N):void 0,"aria-disabled":m?void 0:"true","aria-expanded":D,"aria-controls":D?E:void 0,className:jr,"aria-label":e.trackSize.text,lang:e.trackSize.lang,children:k.jsx(JM,{size:18})}),M("copy",e.copyAll,d,k.jsx(Tx,{size:18}),m),M("save",e.saveTsv,()=>f(!1),k.jsx(zM,{size:18}),!0),k.jsx(kx,{buttonHook:{[os]:"save-menu"},menuHook:{"data-aqmd-spreadsheet-menu":""},label:e.saveMenu,icon:k.jsx(DM,{size:18}),tabIndex:S("save-menu"),items:[{key:"save-with-bom",label:e.saveTsvWithBom,onSelect:()=>f(!0),hook:{"data-aqmd-spreadsheet-menu-item":"save-with-bom"}}]}),M("fullscreen",u?e.exitFullscreen:e.fullscreen,g,u?k.jsx(ZM,{size:18}):k.jsx(VM,{size:18}),!0),k.jsx("span",{"data-aqmd-spreadsheet-size":"",lang:e.size.lang,className:"ms-1 text-sm",children:It.fillLabel(e.size.text,{rows:r,cols:i})})]}),D&&k.jsx(B5,{id:E,labels:e,activeCell:y,onTrackSize:x,onClose:()=>{_(!1),B.current?.focus()}})]})},_5=Object.freeze({decreaseColumnWidth:k.jsx(WM,{size:18}),increaseColumnWidth:k.jsx(e5,{size:18}),autoFitColumnWidth:k.jsx(IM,{size:18}),decreaseRowHeight:k.jsx(YM,{size:18}),increaseRowHeight:k.jsx(i5,{size:18})}),B5=({id:e,labels:t,activeCell:r,onTrackSize:i,onClose:o})=>{const s=L.useSyncExternalStore(r.subscribe,r.get,r.get),a={column:oe.columnIndexToName(s.col),row:s.row+1},n=l=>{l.key!=="Escape"||l.defaultPrevented||(l.preventDefault(),l.stopPropagation(),o())};return k.jsx("div",{id:e,"data-aqmd-spreadsheet-track-size":"",role:"group","aria-label":t.trackSize.text,lang:t.trackSize.lang,onKeyDown:n,className:"mb-1 flex flex-wrap items-center gap-1",children:w5.map(l=>k.jsx("button",{type:"button","data-aqmd-spreadsheet-track-size-control":l,onClick:()=>i(l),className:jr,"aria-label":It.fillLabel(t[l].text,a),lang:t[l].lang,children:_5[l]},l))})},L5=(e,t,r)=>{const i={v:1,rows:e.length,cols:e[0]?.length??0,clipId:r,formats:[],validations:[],cells:e.map(s=>s.map(a=>({t:a}))),wholeRows:!1,wholeCols:!1,conditionalFormats:[]},o=t.serializeClipPayload(i);return{plain:t.serializeClipboardTsv(e),html:t.serializeHtmlTable(i,o)}},E5=async(e,t,r)=>{await t.write([r({"text/plain":new Blob([e.plain],{type:"text/plain"}),"text/html":new Blob([e.html],{type:"text/html"})})])},F5="\uFEFF",A5="text/tab-separated-values;charset=utf-8",M5=(e,t)=>`${t?F5:""}${Qs.serializeTsv(e)}`,$5=(e,t,r)=>{const i=r.defaultView;if(i===null)throw new Error("[@aiquants/markdown] saving a file needs a document with a window");const o=i.URL.createObjectURL(new Blob([e],{type:A5})),s=r.createElement("a");s.href=o,s.download=t,s.hidden=!0,r.body.append(s);try{s.click()}finally{s.remove(),i.setTimeout(()=>i.URL.revokeObjectURL(o),0)}},Bx=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0,[i]=L.useState(()=>new Set);return L.useEffect(()=>e?.subscribe(()=>{for(const o of[...i])o()}),[e,i]),L.useMemo(()=>{if(!r)return;const o=()=>{const s=t.current;if(s===void 0)throw new Error("[@aiquants/markdown] the spreadsheet editor stand-in was called after its editor was removed");return s};return{write:s=>o().write(s),read:s=>o().read(s),undo:()=>o().undo(),redo:()=>o().redo(),subscribe:s=>(i.add(s),()=>{i.delete(s)})}},[r,i])};let Cs=null,hn=null;const kl=new Set,O5=e=>(kl.add(e),()=>{kl.delete(e)}),Id=()=>Cs!==null?Promise.resolve(Cs):(hn??=import("@aiquants/spreadsheet").then(e=>{Cs=e;for(const t of kl)t();return e},e=>{throw hn=null,e}),hn);class Qr extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const Pd=e=>{console.error("[@aiquants/markdown] could not load @aiquants/spreadsheet",e)},Dd=Object.freeze({row:!0,column:!0,intersection:!1}),R5=Object.freeze({row:!1,column:!1,intersection:!1}),Nd=Object.freeze([Object.freeze([""])]),I5=Object.freeze({link:!1}),P5=229,D5=({matrix:e,headerRows:t,footerRows:r,visibleRows:i})=>{const o=Math.min(e[0].length,n5),s=l5(e,i,r),a=Array.from({length:o},(l,c)=>oe.columnIndexToName(c)),n=l=>k.jsx("td",{"aria-hidden":"true","data-aqmd-spreadsheet-static-number":"",children:l+1});return k.jsxs("table",{"data-aqmd-spreadsheet-static":"",children:[k.jsxs("thead",{children:[k.jsxs("tr",{"aria-hidden":"true","data-aqmd-spreadsheet-static-letters":"",children:[k.jsx("td",{}),a.map(l=>k.jsx("td",{children:l},l))]}),s.filter(({index:l})=>l<t).map(({index:l,cells:c})=>k.jsxs("tr",{children:[n(l),c.slice(0,o).map((h,d)=>k.jsx("th",{scope:"col",children:h},d))]},l))]}),k.jsx("tbody",{children:s.filter(({index:l})=>l>=t).map(({index:l,cells:c})=>k.jsxs("tr",{children:[n(l),c.slice(0,o).map((h,d)=>k.jsx("td",{children:h},d))]},l))})]})},N5=e=>{try{return{options:It.parseSpreadsheetOptions(e),unreadWord:null}}catch(t){if(t instanceof It.SpreadsheetOptionsError)return{options:null,unreadWord:t.word};throw t}},Lx=({tsv:e,meta:t,sourceLines:r,editor:i,locale:o="en",labels:s,layout:a="inline"})=>{if(!Object.hasOwn(It.SPREADSHEET_BLOCK_LABEL_CATALOGS,o))throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet locale "${String(o)}" (en and ja are supported)`);if(a!=="inline"&&a!=="fill")throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet layout "${String(a)}" (inline and fill are supported)`);const n=L.useMemo(()=>_i(It.SPREADSHEET_BLOCK_LABEL_CATALOGS[o],s),[o,s]),{options:l,unreadWord:c}=L.useMemo(()=>N5(t),[t]),h=L.useMemo(()=>ln(e),[e]),d=h>oe.SPREADSHEET_MAX_OPERATION_CELLS,f=L.useMemo(()=>vi.parseSourceLines(r)?.first??null,[r]),[u,g]=L.useState(null),m=`${r??""}
|
|
315
|
+
${e}`,y=u===m,x=i!==void 0&&f!==null&&!y?i:void 0,C=x!==void 0,w=C&&l!==null&&l.footerRows===0?o5:0,S=C?s5:0,[v,_]=L.useState(()=>d?Nd:is(e)),[E,B]=L.useState(0),D=L.useRef(e),M=L.useRef([]),P=L.useMemo(()=>f5(v,w,S),[v,w,S]),U=L.useRef(P);U.current=P;const N=L.useSyncExternalStore(O5,()=>Cs,()=>null),[q,A]=L.useState(!1),$=q&&N===null,[O,F]=L.useState(1),[R,j]=L.useState(Dd),[T,W]=L.useState(!1),[z,X]=L.useState(null),G=L.useRef(null),K=L.useId(),Z=L.useCallback((Q,it={})=>{X(St=>({text:It.fillLabel(n[Q].text,it),lang:n[Q].lang,serial:(St?.serial??0)+1}))},[n]);L.useEffect(()=>{if(N!==null||l===null||d)return;let Q=!0;return Id().catch(it=>{Q&&(Pd(it),A(!0))}),()=>{Q=!1}},[N,l,d]),L.useEffect(()=>{const Q=y5(M.current,e);if(Q.echo){M.current=Q.pending;return}const it=x===void 0||f===null?null:x.read(f),St=it!==null&&ln(it)<=oe.SPREADSHEET_MAX_OPERATION_CELLS?it:null;if(St!==null&&St===M.current.at(-1))return;M.current=[];const Et=St===null?e:St;Et!==D.current&&(D.current=Et,_(St===null&&d?Nd:is(Et)),B(ie=>ie+1))},[e,d,x,f]);const at=L.useCallback(()=>{if(x===void 0||f===null)return;const Q=x.read(f);Q===null||Q===D.current||ln(Q)>oe.SPREADSHEET_MAX_OPERATION_CELLS||(M.current=[],D.current=Q,_(is(Q)),B(it=>it+1))},[x,f]);L.useEffect(()=>x?.subscribe(()=>{M.current.length>0&&at()}),[x,at]);const pt=L.useCallback(Q=>{Q(),at()},[at]),ut=L.useMemo(()=>x===void 0?void 0:()=>pt(()=>x.undo()),[x,pt]),mt=L.useMemo(()=>x===void 0?void 0:()=>pt(()=>x.redo()),[x,pt]),Lt=L.useRef(()=>{});Lt.current=Q=>{if(x===void 0||f===null)throw new Qr("readOnly");const it=p5(U.current,Q);if(it.kind==="format-only")throw new Qr("formatRefused");if(it.kind==="unchanged")return;const St=Dh(it.matrix),Et=m5(St),ie=x.write({fenceLine:f,expected:D.current,text:Et});switch(ie){case"written":{const le=x.read(f);if(le===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");D.current=le,M.current=[...M.current,le],_(le===Et?St:is(le)),B(Vr=>Vr+1),X(null);return}case"changed":throw at(),new Qr("editConflict");case"closesFence":throw new Qr("fenceRefused");case"unwritable":throw g(m),new Qr("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(ie)} (written, changed, closesFence or unwritable)`)}};const[Ft]=L.useState(()=>({get rowCount(){return U.current.length},get colCount(){return U.current[0].length},getCellText:(Q,it)=>U.current[Q][it],applyEdits:(Q,it)=>Lt.current(Q),getCellFormat:()=>a5,getCellHyperlink:(Q,it)=>b5(U.current[Q][it]),findDataEdge:(Q,it)=>x5((St,Et)=>U.current[St][Et],U.current.length,U.current[0].length,Q,it)})),Mt=L.useCallback(Q=>{if(!(Q instanceof Qr))throw Q;Z(Q.reason)},[Z]),Ht=L.useCallback(Q=>Z(y?"unwritable":"readOnly"),[Z,y]),Yt=L.useCallback(Q=>{G.current?.ownerDocument.defaultView?.open(Q,"_blank","noopener,noreferrer")},[]),Qt=L.useCallback(({row:Q,displayText:it,columnName:St,readOnly:Et})=>It.fillLabel((Et===!0?n.readOnlyCellAnnouncement:n.cellAnnouncement).text,{cell:`${St}${Q+1}`,value:it===""?n.emptyCell.text:it}),[n]),we=L.useCallback(({range:Q})=>It.fillLabel(n.selectionAnnouncement.text,{range:k5(Q,oe.columnIndexToName)}),[n]),Se=L.useCallback(({axis:Q,index:it,size:St})=>Q==="column"?It.fillLabel(n.columnResized.text,{column:oe.columnIndexToName(it),size:St}):It.fillLabel(n.rowResized.text,{row:it+1,size:St}),[n]),_t=L.useRef(null),[Ct]=L.useState(S5),ve=L.useCallback(Q=>Ct.set(Q.active),[Ct]),Yr=L.useCallback(Q=>{_t.current?.executeCommand(Q)},[]),pe=bl(O),sr=L.useRef(pe);L.useEffect(()=>{sr.current!==pe&&(sr.current=pe,Z("zoomed",{percent:pe}))},[Z,pe]);const xr=L.useCallback(Q=>F(it=>oe.clampSpreadsheetZoom(oe.stepSpreadsheetZoom(it,Q))),[]),Ge=L.useCallback(()=>F(1),[]),Cr=R.row||R.column,Ur=L.useCallback(()=>j(Q=>Q.row||Q.column?R5:Dd),[]),ar=L.useCallback(()=>{if(N===null)return;const Q=G.current?.ownerDocument.defaultView;(async()=>{if(Q==null)throw new Error("no window");const St=L5(v,N,Q.crypto.randomUUID());await E5(St,Q.navigator.clipboard,Et=>new Q.ClipboardItem(Et))})().then(()=>Z("copied"),St=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",St),Z("copyFailed")})},[Z,v,N]),br=L.useCallback(Q=>{const it=G.current?.ownerDocument;it!==void 0&&$5(M5(v,Q),n.fileName.text,it)},[v,n]),Re=L.useRef(!1);L.useEffect(()=>{Re.current&&(Re.current=!1,G.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[T]);const Te=L.useCallback(Q=>{const it=G.current;it!==null&&(it.close(),Q?it.showModal():it.show(),Re.current=!0,W(Q))},[]),kr=L.useCallback(()=>Te(!T),[T,Te]),J=L.useCallback(Q=>{!T||Q.key!=="Escape"||Q.defaultPrevented||Q.nativeEvent.isComposing||Q.keyCode===P5||(Q.preventDefault(),Q.stopPropagation(),Te(!1))},[T,Te]),ft=L.useCallback(Q=>{Q.preventDefault(),Te(!1)},[Te]),xt=v.length,Dt=v[0].length,At=l===null?0:h5(l,P.length),Gr=P.length,Xr=L.useMemo(()=>{const[Q,it]=a==="inline"?["--aqmd-spreadsheet-box-height",At]:["--aqmd-spreadsheet-box-min-height",d5(Gr)];return{[Q]:`${u5(it,O)}px`}},[a,At,Gr,O]),qo=T?n.fullscreenDialog:n.table,Wi=N?.Spreadsheet;return k.jsxs("div",{"data-aqmd-spreadsheet":"","data-aqmd-spreadsheet-layout":a,"data-source-lines":r,"data-aqmd-spreadsheet-editable":C?"":void 0,"data-aqmd-spreadsheet-fullscreen":T?"":void 0,children:[k.jsx("span",{id:K,hidden:!0,lang:qo.lang,children:qo.text}),k.jsxs("dialog",{ref:G,open:!0,"data-aqmd-spreadsheet-dialog":"",role:T?void 0:"group","aria-labelledby":K,onKeyDown:J,onCancel:ft,children:[l===null?k.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:n.optionsError.lang,children:It.fillLabel(n.optionsError.text,{word:c,frozenMax:It.SPREADSHEET_OPTION_RULES.header.max,heightMax:It.SPREADSHEET_OPTION_RULES.height.max})}):d?k.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:n.tooLarge.lang,children:It.fillLabel(n.tooLarge.text,{cells:new Intl.NumberFormat(o).format(h),max:new Intl.NumberFormat(o).format(oe.SPREADSHEET_MAX_OPERATION_CELLS)})}):k.jsxs(k.Fragment,{children:[k.jsx(T5,{labels:n,labelledBy:K,rows:xt,cols:Dt,canZoomIn:O<oe.SPREADSHEET_ZOOM_MAX,canZoomOut:O>oe.SPREADSHEET_ZOOM_MIN,zoom:O,onZoom:xr,onResetZoom:Ge,highlighted:Cr,onToggleHighlight:Ur,onCopy:ar,onSave:br,fullscreen:T,onToggleFullscreen:kr,gridReady:Wi!==void 0,activeCell:Ct,onTrackSize:Yr}),k.jsx("div",{"data-aqmd-spreadsheet-box":"",style:Xr,children:Wi===void 0?k.jsx(D5,{matrix:v,headerRows:l.headerRows,footerRows:l.footerRows,visibleRows:At}):k.jsx(Wi,{ref:_t,adapter:Ft,dataVersion:E,defaultRowHeight:_x,frozenRows:l.headerRows,headerRows:l.headerRows,frozenTrailingRows:l.footerRows,frozenColumns:l.frozenColumns,enableFillHandle:C,readOnly:!C,labelledBy:K,enableResizeUI:!0,zoom:O,onZoomChange:F,highlight:R,onHighlightChange:j,popovers:I5,onHyperlinkOpen:Yt,onEditRejected:Mt,onReadOnlyRejected:Ht,onUndoRequest:ut,onRedoRequest:mt,formatCellAnnouncement:Qt,formatSelectionAnnouncement:we,formatResizeAnnouncement:Se,onSelectionChange:ve,locale:o})})]}),$&&k.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[k.jsx("span",{lang:n.loadFailed.lang,children:n.loadFailed.text}),k.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:n.retry.lang,className:"ms-2 inline-flex min-h-11 min-w-11 items-center justify-center rounded border px-3 py-1 text-sm",onClick:()=>{A(!1),Id().catch(Q=>{Pd(Q),A(!0)})},children:n.retry.text})]}),k.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:z!==null&&k.jsx("span",{lang:z.lang,children:z.text},z.serial)})]})]})};Lx.displayName="SpreadsheetBlock";const Nh=L.memo(Lx),q5=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),z5=Object.freeze({"solarized-light":Object.freeze({"#657b83":"#435860","#93a1a1":"#4b5757","#2aa198":"#005f59","#dc322f":"#ae0010","#d33682":"#a70060","#268bd2":"#00588e","#859900":"#4e5a00","#586e75":"#43585f","#cb4b16":"#9a3100","#b58900":"#6c5100","#6c71c4":"#4a4c9c"}),"github-dark-high-contrast":Object.freeze({"#272b33":"#abb1bb"})});function j5(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const o={};for(const s of i.split(";")){const a=s.indexOf(":");if(a<=0)continue;const n=s.slice(0,a).trim(),l=s.slice(a+1).trim();n===""||l===""||(o[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=o;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const W5=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return k.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute top-2 right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-sm transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},H5=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const o=L.use(e),s={replace:a=>{if(a instanceof wt.Element&&a.name==="pre"){const n=j5(a.attribs),l=t?"2.2rem 0 1rem 0":"1rem 0";return n.style={...typeof n.style=="object"?n.style:{},margin:"0",padding:"0.8rem 0"},k.jsxs("div",{className:"relative",style:{margin:l},"data-aqmd-code-block":"","data-source-lines":i,children:[t&&k.jsx("div",{"data-aqmd-code-filename":"",className:"absolute -top-4 left-0 z-0 rounded-md px-2 py-0.5 text-sm",children:t}),k.jsx(W5,{code:r}),k.jsx("pre",{...n,children:wt.domToReact(a.children,s)})]})}},htmlparser2:{lowerCaseTags:!0}};return k.jsx(k.Fragment,{children:wt(o,s)})},Y5=/^(diff)?:?(\w+):?([\w.-]*)?/,U5=new Map([["svg","xml"]]),G5="text",X5=e=>{const t=U5.get(e),r=t===void 0?e:t;return gn.isSpecialLang(r)||Object.hasOwn(gn.bundledLanguages,r)?r:G5},V5=()=>({code(e){for(const t of e.children){if(t.type!=="element")continue;const r=t.children[0];if(r?.type!=="element")continue;const i=r.children[0];if(i?.type!=="text")continue;const o=i.value;let s,a,n="";if(o.startsWith("+")?(s="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):o.startsWith("-")&&(s="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),s&&a){t.properties.dataAqmdDiff=a,i.value=o.substring(1).trimStart();const l={type:"element",tagName:"span",properties:{className:`inline-flex items-center justify-center w-4 h-4 rounded-full select-none font-bold text-[0.5rem] mr-2 ${n}`},children:[{type:"text",value:s==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),K5=e=>{const t=Y5.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},qh=({lang:e,code:t,node:r,sourceLines:i})=>{const o=e??r?.lang??void 0,s=t??r?.value??"",{isDiff:a,lang:n,filename:l}=K5(o);return n===It.SPREADSHEETS_LANGUAGE?k.jsx(Nh,{tsv:s,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?k.jsx(Ph,{chartContent:s,sourceLines:i}):k.jsx(Z5,{code:s,lang:n,isDiff:a,filename:l,sourceLines:i})},Z5=({code:e,lang:t,isDiff:r,filename:i,sourceLines:o})=>{const s=L.useMemo(async()=>{const a=[];return r&&a.push(V5()),await gn.codeToHtml(e,{lang:X5(t),themes:q5,defaultColor:!1,colorReplacements:z5,transformers:a})},[e,t,r]);return k.jsx(L.Suspense,{fallback:k.jsx("div",{className:"dark:text-white","data-source-lines":o,children:"🌀 Loading code..."}),children:k.jsx(H5,{htmlPromise:s,filename:i,code:e,sourceLines:o})})},Ex=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return k.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-xs transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},Fx=(e,t)=>{const r=L.useMemo(()=>{try{return{kind:"rendered",html:vx(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return L.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},Q5=({node:e})=>{const t=Fx(e.value,!0),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return k.jsxs("div",{className:"relative",children:[k.jsx(Ex,{code:e.value}),t.kind==="rendered"?k.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):k.jsx("article",{className:r,children:t.message})]})},J5=/^[a-z][a-z0-9+.-]*:/i,t3=/^[/\\]{2}/,e3=/[\t\n\r]/g,qd=32,r3=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=qd;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=qd;)r-=1;return e.slice(t,r)},Ax=e=>{const t=r3(e).replace(e3,"");return J5.test(t)||t3.test(t)},i3="text-link underline visited:text-link-visited",o3="inline-block w-fit",zh=new Set(["img","picture","video","audio","svg","canvas","iframe","object","embed","address","article","aside","blockquote","details","dialog","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","menu","nav","ol","p","pre","section","table","ul"]);[...zh].join(",");const Mx=(e,t)=>[e,t?o3:void 0,i3].filter(r=>r!==void 0&&r.trim()!=="").join(" "),s3=new Set(["id","title","lang","dir","role"]),a3=["aria-","data-footnote-"],n3=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(s3.has(o)||a3.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},ye=new fn.Logger(fn.LogLevel.INFO,"[DifyIFramePlugin]"),l3="100%",h3="600px",c3="0",d3=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,u3=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=L.useState(!0),[o,s]=L.useState(!1),a=L.useRef(null),n=L.useRef(null),l=L.useRef(null),{src:c}=e,h=L.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!yb(x.origin,t)||d3(x.data)==="dify-chatbot-iframe-ready"&&(ye.info("Dify chatbot iframe is ready"),i(C=>C&&(s(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=L.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(w=>w&&(s(!1),!1))}catch{ye.info("Crossorigin error detected, showing auth prompt"),s(w=>w||(i(!1),!0))}},[]),f=L.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){ye.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),ye.info("ポップアップが閉じられました");try{ye.info("ポップアップURL:",x.location.href)}catch(S){ye.info("クロスオリジンのためURLにアクセスできません:",S)}const w=a.current;if(w?.src){const S=w.src;i(v=>v||!0),s(v=>v&&!1),w.src="",setTimeout(()=>{w.src=S,n.current=setTimeout(()=>{ye.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);ye.info("ポップアップを開きました:"),ye.info("- 初期URL:",c),ye.info("- ウィンドウ名:","dify-oauth"),ye.info("- ウィンドウサイズ: 500x600")},[d,c]);L.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),L.useEffect(()=>{const x=setTimeout(()=>{ye.warn("Timeout: dify-chatbot-iframe-ready not received, checking iframe access"),d()},5e3);return l.current=x,()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[d]),L.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:u=l3,height:g=h3,frameborder:m=c3,...y}=e.attributes;return k.jsxs("div",{className:"dify-iframe-container",children:[r&&!o&&k.jsxs("div",{className:"flex items-center justify-center rounded-lg bg-gray-50 p-8",children:[k.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-blue-600 border-b-2"}),k.jsx("span",{className:"ml-3 text-gray-600",children:"Dify チャットボットを読み込み中..."})]}),o&&k.jsxs("div",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 p-6",children:[k.jsx("div",{className:"flex items-center",children:k.jsxs("div",{className:"text-blue-800",children:[k.jsx("h3",{className:"font-medium",children:"認証が必要です"}),k.jsx("p",{className:"mt-1 text-sm",children:"Dify チャットボットにアクセスするには OAuth 認証が必要です。 ポップアップウィンドウで認証を完了してください。"})]})}),k.jsx("div",{className:"mt-4",children:k.jsx("button",{type:"button",onClick:f,className:"rounded-md border border-gray-700 bg-gray-900 px-4 py-2 font-medium text-sm text-white shadow-lg transition-colors hover:bg-gray-800",children:"OAuth 認証を開始"})})]}),k.jsx("div",{className:`${r||o?"hidden":"block"}`,children:k.jsx("iframe",{ref:a,...wt.attributesToProps({...y,width:u,height:g,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},zd=Object.freeze({dify:u3}),f3=e=>Object.hasOwn(zd,e)?zd[e]:null,g3=k.jsx(L.Fragment,{}),p3=(e,t,r,i,o)=>{const s=t===null?null:f3(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return k.jsx(eb,{embed:e,label:i,insideAnchor:o,children:s!==null?k.jsx(s,{embed:e,iFrameAllowedDomains:r}):k.jsx("iframe",{...wt.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},$x=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof wt.Element&&t.name.toLowerCase()==="a")return!0;return!1},Ox=e=>e.some(t=>t instanceof wt.Element&&(zh.has(t.name)||Ox(t.children))),m3=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":a,...n}=e.attribs,l=Mx(i,Ox(e.children)),c=n.href??"",h=o,d=h==="external"||Ax(c),f=wt.domToReact(e.children,t);if(r&&c&&!d)return k.jsx(r,{href:c,kind:h,docPath:s,docExists:a===void 0?void 0:a==="true",className:l,attributes:n3(n),children:f});d&&(n.target="_blank",n.rel="noreferrer");const u={};return o!==void 0&&(u["data-link-kind"]=o),s!==void 0&&(u["data-doc-path"]=s),a!==void 0&&(u["data-doc-exists"]=a),k.jsx("a",{...wt.attributesToProps(n,"a"),className:l,...u,children:f})},Rx=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:a=>{if(!(a instanceof wt.Element))return;const n=a.parent instanceof wt.Element?a.parent.name:null,l=ea(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return g3;case"unwrap":return k.jsx(L.Fragment,{children:wt.domToReact(a.children,s)});case"embed":return p3(l.embed,l.pluginType,e,t.embeddedFrame,$x(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,s);if(h!==void 0)return h}const c=o?.(a,s);if(c!==void 0)return c;if(a.name==="a")return m3(a,s,r)}};return s};const y3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],x3=Tt("code-xml",y3),C3=4096*4096,jd=32767,Wd=e=>Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0,b3=(e,t)=>{const r=Wd(e)?e:Wd(t)?t:null;if(r===null)return null;const i=Math.min(1,Math.sqrt(C3/(r.width*r.height)),jd/r.width,jd/r.height);return{width:Math.max(1,Math.floor(r.width*i)),height:Math.max(1,Math.floor(r.height*i))}},k3=async(e,t,r)=>{const i=r.URL.createObjectURL(new r.Blob([e],{type:"image/svg+xml;charset=utf-8"}));try{const o=new r.Image;o.src=i,await o.decode();const s=b3({width:o.naturalWidth,height:o.naturalHeight},t);if(s===null)throw new Error("[@aiquants/markdown] the SVG image has no size to draw at");const a=r.document.createElement("canvas");a.width=s.width,a.height=s.height;const n=a.getContext("2d");if(n===null)throw new Error("[@aiquants/markdown] the browser gave no 2D canvas to draw the SVG image on");return n.drawImage(o,0,0,s.width,s.height),await new Promise((l,c)=>{a.toBlob(h=>h===null?c(new Error("[@aiquants/markdown] the canvas could not encode the SVG image as a PNG")):l(h),"image/png")})}finally{r.URL.revokeObjectURL(i)}},w3=e=>/\.[Ss][Vv][Gg]$/u.test(e),Ix=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0;return L.useMemo(()=>{if(r)return{read:(i,o)=>{const s=t.current;return s===void 0?Promise.reject(new Error("[@aiquants/markdown] the image source stand-in was called after its reader was removed")):s.read(i,o)}}},[r])},cn="data-aqmd-svg-image-control",S3=Object.freeze(["copy","source"]),v3=Object.freeze(["source"]),T3=Object.freeze({kind:"failure",retryable:!0}),Hd=(e,t,r)=>new Promise(i=>i(e.read(t,r))),_3=({paragraph:e,image:t,path:r,name:i,reader:o,labels:s})=>{const{[vi.SOURCE_LINES_ATTRIBUTE]:a,...n}=e,[l,c]=L.useState(!1),[h,d]=L.useState(0),[f,u]=L.useState(null),[g,m]=L.useState(null),y=L.useId(),x=L.useId(),C=L.useRef(null),w=L.useRef(null),S=L.useRef(null);L.useEffect(()=>()=>w.current?.abort(),[]),L.useEffect(()=>{if(!l)return;const O=new AbortController;return Hd(o,r,O.signal).then(F=>{O.signal.aborted||u({read:h,answer:F})},F=>{O.signal.aborted||(console.error("[@aiquants/markdown] the image source reader failed without an abort",F),u({read:h,answer:T3}))}),()=>O.abort()},[l,h,r,o]);const v=l&&f!==null&&f.read===h?f.answer:null,_=v!==null&&v.kind==="text"&&!v.truncated?v.text:null,E=!l||_!==null,{onKeyDown:B,onFocus:D,tabIndexOf:M}=Ih(E?S3:v3,cn),P=O=>{m(F=>({text:s[O].text,lang:s[O].lang,serial:F===null?1:F.serial+1}))},U=()=>{if(m(null),l){c(!1);return}d(O=>O+1),c(!0)},N=()=>{C.current?.focus(),d(O=>O+1)},q=(O,F)=>{const R=O.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(R===void 0){P("copyFailed");return}R.writeText(F).then(()=>P("copied"),j=>{console.error("[@aiquants/markdown] could not copy the image source",j),P("copyFailed")})},A=O=>{const F=O.currentTarget.ownerDocument.defaultView,R=F?.navigator.clipboard;if(F===null||R===void 0||typeof F.ClipboardItem!="function"||typeof R.write!="function"){P("copyImageFailed");return}const j=S.current,T=j===null?null:j.querySelector("img"),W=T===null?null:T.getBoundingClientRect(),z=W===null?{width:0,height:0}:{width:W.width,height:W.height};w.current?.abort();const X=new AbortController;w.current=X;let G=!1;const K=Hd(o,r,X.signal).then(Z=>{if(Z.kind!=="text"||Z.truncated)throw G=!0,new Error("[@aiquants/markdown] the SVG image cannot be copied whole");return k3(Z.text,z,F).catch(at=>{throw G=!0,console.error("[@aiquants/markdown] could not draw the SVG image as a PNG",at),at})},Z=>{throw G=!0,X.signal.aborted||console.error("[@aiquants/markdown] the image source reader failed without an abort",Z),Z});K.catch(()=>{}),R.write([new F.ClipboardItem({"image/png":K})]).then(()=>{X.signal.aborted||P("copiedImage")},Z=>{X.signal.aborted||(G||console.error("[@aiquants/markdown] could not copy the SVG image",Z),P("copyImageFailed"))})};let $;return l?v===null?$=k.jsx("p",{"data-aqmd-svg-image-loading":"",lang:s.loading.lang,children:s.loading.text}):v.kind==="failure"?$=k.jsxs("div",{"data-aqmd-svg-image-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[k.jsx("p",{lang:s.failed.lang,children:s.failed.text}),v.retryable&&k.jsxs("button",{type:"button","data-aqmd-svg-image-retry":"",onClick:N,lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[k.jsx(mn,{className:"h-4 w-4"}),s.retry.text]})]}):$=k.jsxs(k.Fragment,{children:[k.jsx("span",{id:x,hidden:!0,lang:s.sourceRegion.lang,children:It.fillLabel(s.sourceRegion.text,{name:i})}),k.jsx("pre",{"data-aqmd-svg-image-source":"",tabIndex:0,role:"region","aria-labelledby":x,children:k.jsx("code",{children:v.text})}),v.truncated&&k.jsx("p",{"data-aqmd-svg-image-truncated":"",lang:s.truncated.lang,children:s.truncated.text})]}):$=k.jsx("p",{ref:S,...wt.attributesToProps(n,"p"),children:t}),k.jsxs("div",{"data-aqmd-svg-image":"","data-aqmd-svg-image-view":l?"source":"image","data-source-lines":a,children:[k.jsx("span",{id:y,hidden:!0,lang:s.toolbar.lang,children:s.toolbar.text}),k.jsxs("div",{"data-aqmd-svg-image-toolbar":"",role:"toolbar","aria-labelledby":y,onKeyDown:B,onFocus:D,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[E&&k.jsx("button",{type:"button",[cn]:"copy",tabIndex:M("copy"),onClick:O=>_===null?A(O):q(O,_),className:jr,"aria-label":_===null?s.copyImage.text:s.copy.text,lang:_===null?s.copyImage.lang:s.copy.lang,children:k.jsx(Tx,{size:18})}),k.jsx("button",{ref:C,type:"button",[cn]:"source",tabIndex:M("source"),"aria-pressed":l,onClick:U,className:jr,"aria-label":s.source.text,lang:s.source.lang,children:k.jsx(x3,{size:20})})]}),$,k.jsx("p",{"data-aqmd-svg-image-notice":"",role:"status",children:g!==null&&k.jsx("span",{lang:g.lang,children:g.text},g.serial)})]})},Ea=Object.freeze({toolbar:{text:"SVG image",lang:"en"},source:{text:"Source",lang:"en"},sourceRegion:{text:"Source of {name}",lang:"en"},loading:{text:"Loading the source…",lang:"en"},failed:{text:"The source could not be read.",lang:"en"},retry:{text:"Try again",lang:"en"},truncated:{text:"Only the beginning of this file is shown.",lang:"en"},copy:{text:"Copy the source",lang:"en"},copied:{text:"Copied the source.",lang:"en"},copyFailed:{text:"Could not copy the source.",lang:"en"},copyImage:{text:"Copy the image",lang:"en"},copiedImage:{text:"Copied the image.",lang:"en"},copyImageFailed:{text:"Could not copy the image.",lang:"en"}}),B3=Js(Ea),L3=({alt:e,target:t,label:r})=>k.jsxs("span",{"data-testid":"markdown-missing-image","data-asset-src":t||void 0,role:"img","aria-label":`${e?`${r} (${e})`:r}${t?`: ${t}`:""}`,className:"my-1 inline-flex max-w-full items-center gap-2 rounded-lg border border-gray-300 border-dashed bg-gray-50 px-3 py-2 text-gray-600 text-sm dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400",children:[k.jsx(qC,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),k.jsxs("span",{className:"min-w-0",children:[k.jsx("span",{className:"font-medium",children:e?`${r} (${e})`:r}),t&&k.jsx("span",{className:"ml-2 break-all font-mono text-xs dark:text-gray-300",children:t})]})]}),E3=(e,t,r)=>{const{src:i,alt:o,"data-asset-exists":s,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||s==="false")return k.jsx(L3,{alt:o,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,k.jsx("img",{alt:"",...wt.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},Mo=e=>e.map(t=>t instanceof wt.Text?t.data:t instanceof wt.Element?Mo(t.children):"").join(""),F3=(e,t)=>e.map(r=>{if(r instanceof wt.Text)return{kind:"text",text:r.data};if(!(r instanceof wt.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=ea(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),A3=(e,t,r,i)=>{const o=e.children,s=cr.placeholderLinkOf(t,F3(o,i.iFrameAllowedDomains));if(s===null)return;const a=wt.domToReact(o,r),n=k.jsx("p",{...wt.attributesToProps(e.attribs,"p"),children:a}),l=o.find(f=>f instanceof wt.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&cr.isBareLink(Mo(l.children),s)?k.jsx(ab,{href:t,endpoint:c,size:Ne.linkCardSizeOf(i.embeds),fallback:n}):n,d=Rr.resolveEmbed(s,i.embeds.providers);return d===null?h:k.jsx(pb,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},M3=(e,t)=>{if($x(e))return null;const r=e.children.filter(c=>!(c instanceof wt.Text&&wl.test(c.data))),[i]=r;if(r.length!==1||!(i instanceof wt.Element)||i.name.toLowerCase()!=="img")return null;const o=ea(i.name,i.attribs,{parentName:"p",iFrameAllowedDomains:t});if(o.action!=="keep")return null;const{src:s,alt:a,"data-asset-src":n,"data-asset-exists":l}=o.attributes;return n===void 0||!w3(n)||s===void 0||s.trim()===""||l==="false"?null:{node:i,path:n,name:a!==void 0&&a.trim()!==""?a:n.slice(n.lastIndexOf("/")+1)}},$3={lowerCaseAttributeNames:!1},Yd=2166136261,Ud=16777619,wl=/^[\t\n\f\r ]*$/u,O3=`language-${It.SPREADSHEETS_LANGUAGE}`,Px=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(O3),R3=e=>{let t=Yd,r=Yd;const i=(s,a)=>{for(let n=0;n<s.length;n+=1){const l=s.charCodeAt(n);r=Math.imul(r^l,Ud),a&&(t=Math.imul(t^l,Ud))}},o=(s,a)=>{if(s instanceof wt.Text)i("",a),i(s.data,a);else if(s instanceof wt.Element){i("",a),i(s.name,a);for(const[l,c]of Object.entries(s.attribs))l!==vi.SOURCE_LINES_ATTRIBUTE&&(i("",a),i(l,a),i("",a),i(c,a));i("",a);const n=a&&!Px(s);for(const l of s.children)o(l,n);i("",a)}else i("\x07",a),i(s.data,a)};return o(e,!0),{fingerprint:(t>>>0).toString(36),content:(r>>>0).toString(36)}},I3=(e,t,r,i)=>{if(e==="")return{nodes:[],keys:[]};const o=wt.htmlToDOM(e,$3),s=o.filter(l=>!(l instanceof wt.Text&&wl.test(l.data))),a=YC(s.map(R3),r);let n=0;return{nodes:o.map(l=>{if(l instanceof wt.Text&&wl.test(l.data))return l.data;const{key:c,content:h}=a[n];return n+=1,k.jsx(zC,{content:h,label:i,text:()=>Mo([l]),children:wt.domToReact([l],t)},c)}),keys:a}},Dx=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=Ne.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",blockFailedLabel:f,imageSource:u,svgImageLabels:g,onMathDiagnostics:m})=>{su(i);const y=Jd(o),x=Bx(n),C=Ix(u),w=L.useMemo(()=>_i(Ea,g),[g]),{blockFailed:S}=_i(iu,{blockFailed:f}),v={rendered:0},_=[],E=L.useRef(null),B=L.useEffectEvent(N=>{m?.(N)}),D=Rx({iFrameAllowedDomains:r,embedLabels:y,linkComponent:h,renderPlaceholder:(N,q,A)=>A3(N,q,A,{embeds:i,theme:t,embedLabels:y,iFrameAllowedDomains:r}),renderKept:(N,q)=>{if(N.name==="p"&&C!==void 0){const A=M3(N,r);if(A!==null)return k.jsx(_3,{paragraph:N.attribs,image:wt.domToReact([A.node],q),path:A.path,name:A.name,reader:C,labels:w})}if(N.name==="pre"&&N.children.length===1){const A=N.children[0];if(A instanceof wt.Element&&A.name==="code"){const $=A.attribs.class??"",O=Mo(A.children),F=N.attribs[vi.SOURCE_LINES_ATTRIBUTE];return Px(A)?k.jsx(Nh,{tsv:O,meta:A.attribs[It.CODE_META_ATTRIBUTE],sourceLines:F,editor:x,locale:l,labels:c}):$.includes("language-mermaid")?k.jsx(Ph,{chartContent:O,interaction:s,labels:a,sourceLines:F}):k.jsx(qh,{lang:$.replace("language-",""),code:O,theme:t,sourceLines:F})}}if(N.name==="img")return E3(N,d,v);if(N.name==="span"&&N.attribs.class?.includes("math")){const A=N.attribs.class.includes("display");let $=Mo(N.children).trim();A?$=$.replace(/^\\\[/,"").replace(/\\\]$/,""):$=$.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:O,diagnostics:F}=vx($,A);return _.push(...F),A?k.jsxs("span",{className:"group relative block",children:[k.jsx(Ex,{code:$}),k.jsx("span",{dangerouslySetInnerHTML:{__html:O}})]}):k.jsx("span",{dangerouslySetInnerHTML:{__html:O}})}catch(O){console.error("Failed to render math:",O);return}}}}),M=L.useRef([]),{nodes:P,keys:U}=I3(e,D,M.current,S);return L.useEffect(()=>{M.current=U},[U]),L.useEffect(()=>{E.current!==e&&(E.current=e,_.length>0&&B(_))},[e,_]),k.jsx("div",{className:"markdown-body","data-theme":t,children:P})};const P3=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],D3=Tt("triangle-alert",P3);const N3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],q3=Tt("text-align-center",N3);const z3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],j3=Tt("text-align-start",z3);const W3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],H3=Tt("text-align-end",W3);const Y3=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],U3=Tt("list",Y3);const G3=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],X3=Tt("palette",G3);const V3=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],K3=Tt("pin",V3);const Z3=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],Q3=Tt("pin-off",Z3),J3=e=>`#${e.id}`,t$=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},Gd="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Nx=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=J3,label:o,labelledBy:s})=>{if(e.length===0)return null;const a=t$(e);return k.jsx("nav",{className:`toc ${t}`,"aria-label":o,"aria-labelledby":s,children:k.jsx("ul",{className:"m-0 list-none p-0",children:e.map((n,l)=>{const c=n.id===""?null:i(n);return k.jsx("li",{style:{paddingLeft:`${(n.depth-a)*1}rem`},children:c===null?k.jsx("span",{className:`${Gd} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):k.jsx("a",{href:$o(c)?c:void 0,className:`${Gd} text-gray-600 no-underline hover:text-blue-800 dark:text-gray-300 dark:hover:text-blue-300`,onClick:r===void 0?void 0:h=>r(n,h),title:n.text,children:n.text})},l)})})})},dn="--aqmd-toolbar-block-overlap",e$=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const o=e.left<t.right&&e.right>t.left,s=e.top<r+e.height&&e.top<i,a=e.bottom-r;return o&&s&&a>0?Math.ceil(a):0},qx=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,zx=Object.keys(La),r$=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,i$=Object.keys(It.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),jx=e=>`svgImage${e.charAt(0).toUpperCase()}${e.slice(1)}`,Wx=Object.keys(Ea),Hx=Object.freeze({loading:{text:"Loading data...",lang:"en"},errorPrefix:{text:"Error: ",lang:"en"},defaultErrorTitle:{text:"An error occurred",lang:"en"},missingImage:{text:"Image not found",lang:"en"},...iu,styleTitle:{text:"Display Style",lang:"en"},selectStyleAria:{text:"Select display style",lang:"en"},pinStyleAria:{text:"Pin style selector",lang:"en"},unpinStyleAria:{text:"Unpin style selector",lang:"en"},openTocAria:{text:"目次を開く",lang:"ja"},tocTitle:{text:"目次",lang:"ja"},pinTocAria:{text:"目次をピン留め",lang:"ja"},unpinTocAria:{text:"目次のピン留めを解除",lang:"ja"},selectAlignAria:{text:"揃えを選択",lang:"ja"},alignTitle:{text:"揃え",lang:"ja"},pinAlignAria:{text:"揃え選択をピン留め",lang:"ja"},unpinAlignAria:{text:"揃え選択のピン留めを解除",lang:"ja"},alignLeft:{text:"左揃え",lang:"ja"},alignCenter:{text:"中央揃え",lang:"ja"},alignRight:{text:"右揃え",lang:"ja"},...Object.fromEntries(zx.map(e=>[qx(e),La[e]])),...Object.fromEntries(Wx.map(e=>[jx(e),Ea[e]])),...ta}),o$=Js(Hx),s$=e=>_i(Hx,e),a$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of zx){const i=e[qx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},n$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of i$){const i=e[r$(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},l$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of Wx){const i=e[jx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},h$=Object.keys(ta),c$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of h$){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},Xd=Object.freeze({left:{labelKey:"alignLeft",Icon:j3},center:{labelKey:"alignCenter",Icon:q3},right:{labelKey:"alignRight",Icon:H3}}),d$=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),u$="100%",f$=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",Sl="24px",Yx=e=>Object.freeze({position:"fixed",insetBlockStart:"var(--aqmd-toolbar-inset-block-start, 0px)",insetInlineEnd:`calc(var(--aqmd-toolbar-inset-inline-end, 0px) + ${e})`,zIndex:60,display:"flex",flexDirection:"row",alignItems:"flex-start",gap:"0.5rem",pointerEvents:"none"}),g$=Yx(Sl),p$=Object.freeze({position:"absolute",insetBlockStart:0,insetInlineStart:0,blockSize:"var(--aqmd-toolbar-inset-block-start, 0px)",inlineSize:"var(--aqmd-toolbar-inset-inline-end, 0px)",visibility:"hidden",pointerEvents:"none"}),m$=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,y$=8,Vd=800,x$=16,C$=(e,t)=>{const r=e.defaultView;let i;const o=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function s(n){o(),!(n.timeStamp-t.timeStamp>Vd||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>x$)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&o()}e.addEventListener("click",s,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(o,Vd)},b$=(e,t,r)=>{const[i,o]=L.useState(null);return L.useLayoutEffect(()=>{const s=t.current;if(!e||s===null||r===null){o(null);return}const a=s.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=s.getBoundingClientRect(),f=s.offsetHeight>0?d.height/s.offsetHeight:1,u=a?.visualViewport??null,g=u===null?Number.POSITIVE_INFINITY:u.offsetTop+u.height,m=Math.min(r.getBoundingClientRect().bottom,g);o(Math.max(0,Math.floor((m-d.top)/f-y$)))},c=()=>{a!==null&&n===0&&(n=a.requestAnimationFrame(l))};l();const h=new ResizeObserver(c);return h.observe(r),a?.addEventListener("resize",c),a?.visualViewport?.addEventListener("resize",c),a?.visualViewport?.addEventListener("scroll",c),s.ownerDocument.addEventListener("scroll",c,!0),()=>{a!==null&&n!==0&&a.cancelAnimationFrame(n),h.disconnect(),a?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("scroll",c),s.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function un({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:o,pinLabel:s,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:f,onPinToggle:u,popoverClassName:g,scrollBarClearance:m,boundary:y,renderBody:x}){const C=L.useRef(null),w=L.useRef(null),S=L.useRef(null),v=b$(n,S,y),_=L.useCallback(()=>{d(),h()},[h,d]),E=L.useCallback(()=>{if(l)return;const D=C.current?.contains(document.activeElement)===!0;f(),D&&w.current?.focus()},[l,f]);L.useEffect(()=>{if(!n||l)return;const D=C.current;if(D===null)return;const M=U=>{D.contains(U.target)||(f(),U.pointerType==="touch"&&!(U.target instanceof Element&&U.target.closest("[data-aqmd-toolbar]")!==null)&&C$(D.ownerDocument,U))},P=U=>{U.key!=="Escape"||U.defaultPrevented||U.isComposing||(U.preventDefault(),f(),w.current?.focus())};return document.addEventListener("pointerdown",M),D.addEventListener("keydown",P),()=>{document.removeEventListener("pointerdown",M),D.removeEventListener("keydown",P)}},[n,l,f]);const B=l?a:s;return k.jsxs("div",{ref:C,"data-aqmd-toolbar-menu":e,children:[k.jsx("button",{ref:w,type:"button",className:"pointer-events-auto rounded-full border border-gray-200 bg-white p-3 shadow-lg transition-colors hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",onClick:_,"aria-label":r.text,lang:r.lang,"aria-expanded":n,children:k.jsx(t,{className:"h-5 w-5 text-gray-600 dark:text-gray-300"})}),n&&k.jsxs("div",{ref:S,"data-aqmd-toolbar-popover":e,className:`pointer-events-auto absolute end-0 top-full mt-2 box-border overflow-y-auto overscroll-contain rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-800 ${g}`,style:{zIndex:c?2:1,maxInlineSize:m$(m),maxBlockSize:v??void 0},children:[k.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[k.jsx("h3",{id:o,lang:i.lang,className:"px-2 font-bold text-gray-600 text-sm uppercase tracking-wider dark:text-gray-300",children:i.text}),k.jsx("button",{type:"button",className:"rounded p-3.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200",onClick:u,"aria-label":B.text,lang:B.lang,children:l?k.jsx(K3,{className:"h-4 w-4"}):k.jsx(Q3,{className:"h-4 w-4"})})]}),x(E)]})]})}const k$=(e,t,r,i)=>{const[o,s]=L.useState(0),a=L.useRef(null);return L.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,s(0);return}const c=()=>{const g=n.getBoundingClientRect();s(e$({toolbar:r.getBoundingClientRect(),content:l.getBoundingClientRect(),scrollportTop:g.top+n.clientTop,scrollportBottom:g.bottom}))};a.current=c;let h=null;const d=()=>{h===null&&(h=requestAnimationFrame(()=>{h=null,c()}))};c();const f=new ResizeObserver(c);f.observe(n),f.observe(l),f.observe(r);const u=r.querySelector("[data-aqmd-toolbar-inset-probe]");return u!==null&&f.observe(u),window.addEventListener("resize",c),window.addEventListener("scroll",d,{capture:!0,passive:!0}),()=>{a.current=null,f.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",d,{capture:!0}),h!==null&&cancelAnimationFrame(h)}},[e,t,r]),L.useLayoutEffect(()=>{a.current?.()},[i]),o},w$=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,S$=e=>{let t=null,r=e;for(;r!==null;)r.getAttribute("hidden")?.toLowerCase()==="until-found"&&(r.dispatchEvent(new Event("beforematch",{bubbles:!0})),r.removeAttribute("hidden")),r instanceof HTMLDetailsElement&&!r.open&&t!==null&&t!==Array.from(r.children).find(i=>i.localName==="summary")&&(r.open=!0),t=r,r=r.parentElement},v$=L.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:f,spreadsheetLabels:u,imageSource:g,svgImageLabels:m,onMathDiagnostics:y}){return k.jsx("div",{className:"w-full min-w-0",children:k.jsx("div",{className:i,"data-theme":r,children:k.jsx(Dx,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:f,spreadsheetLabels:u,imageSource:g,svgImageLabels:m,onMathDiagnostics:y})})})});function Ux(){const[e,t]=L.useState("toc"),[r,i]=L.useState(!1),[o,s]=L.useState(!1),[a,n]=L.useState(!1),[l,c]=L.useState(!1),[h,d]=L.useState(!1),[f,u]=L.useState(!1),g=L.useCallback(()=>t("toc"),[]),m=L.useCallback(()=>i(M=>!M),[]),y=L.useCallback(()=>i(!1),[]),x=L.useCallback(()=>c(M=>!M),[]),C=L.useCallback(()=>t("style"),[]),w=L.useCallback(()=>s(M=>!M),[]),S=L.useCallback(()=>s(!1),[]),v=L.useCallback(()=>d(M=>!M),[]),_=L.useCallback(()=>t("align"),[]),E=L.useCallback(()=>n(M=>!M),[]),B=L.useCallback(()=>n(!1),[]),D=L.useCallback(()=>u(M=>!M),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:f,activateToc:g,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:w,closeStyle:S,togglePinStyle:v,activateAlign:_,toggleAlign:E,closeAlign:B,togglePinAlign:D}}const T$=({error:e,labels:t})=>{if(L.isValidElement(e))return k.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,o=i.title!==void 0&&i.title!=="";return k.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-6 shadow-sm backdrop-blur-sm dark:border-red-900/50 dark:bg-red-950/30",children:k.jsxs("div",{className:"flex items-start gap-3",children:[k.jsx("div",{className:"rounded-lg bg-red-100 p-2 text-red-600 dark:bg-red-900/50 dark:text-red-400",children:k.jsx(D3,{className:"h-5 w-5"})}),k.jsxs("div",{className:"min-w-0 flex-1",children:[k.jsxs("div",{className:"flex items-center justify-between gap-2",children:[k.jsx("h3",{lang:o?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:o?i.title:t.defaultErrorTitle.text}),i.status&&k.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 font-medium font-mono text-red-700 text-xs dark:bg-red-900/60 dark:text-red-300",children:i.status})]}),k.jsx("p",{className:"mt-2 text-red-700 text-sm leading-relaxed dark:text-red-300/90",children:i.message})]})]})})}const r=typeof e=="string"?e:String(e);return k.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-4 text-center dark:border-red-900/50 dark:bg-red-950/30",children:k.jsxs("p",{className:"font-medium text-red-700 text-sm dark:text-red-300",children:[k.jsx("span",{lang:t.errorPrefix.lang,children:t.errorPrefix.text}),r]})})};function _$({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,style:a,onStyleChange:n,availableStyles:l=Yi.DEFAULT_MARKDOWN_STYLES,align:c=Yi.DEFAULT_CONTENT_ALIGN,onAlignChange:h,showToc:d=!0,showStyle:f=!0,showAlign:u=!0,width:g,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=Ne.NO_EMBEDS,emptyMessage:w,toolbar:S,linkComponent:v,onHeadingSelect:_,headingHref:E,onMathDiagnostics:B,spreadsheetEditor:D,spreadsheetLocale:M,imageSource:P,renderScrollBar:U}){const N=L.useRef(null),[q,A]=L.useState(null),$=L.useCallback(Q=>{N.current=Q,A(Q)},[]),[O,F]=L.useState(0),R=L.useRef(null),[j,T]=L.useState(null),W=L.useRef(null),z=L.useId(),X=Ux(),G=S??X,K=L.useMemo(()=>s$(o),[o]),Z=L.useMemo(()=>a$(o),[o]),at=L.useMemo(()=>n$(o),[o]),pt=L.useMemo(()=>l$(o),[o]),ut=Ix(P),mt=Bx(D);su(C);const Lt=Rr.EMBED_PROVIDER_IDS.filter(Q=>C.providers.includes(Q)).join(" "),Ft=C.linkCardEndpoint,Mt=C.linkCardSize,Ht=L.useMemo(()=>{const Q=Lt.split(" "),it=Object.freeze(Rr.EMBED_PROVIDER_IDS.filter(St=>Q.includes(St)));return Object.freeze(Mt===void 0?{providers:it,linkCardEndpoint:Ft}:{providers:it,linkCardEndpoint:Ft,linkCardSize:Mt})},[Lt,Ft,Mt]),Yt=o?.embeddedVideo,Qt=o?.embeddedPost,we=o?.embeddedFrame,Se=L.useMemo(()=>c$({embeddedVideo:Yt,embeddedPost:Qt,embeddedFrame:we}),[Yt,Qt,we]),_t=L.useRef(B);L.useLayoutEffect(()=>{_t.current=B},[B]);const Ct=L.useCallback(Q=>{_t.current?.(Q)},[]),ve=w===void 0?d$:{text:w,lang:void 0},Yr=k$(N,R,j,c);if(!Yi.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${Yi.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const pe=Number.isFinite(y)&&y>=0?y:16,sr=L.useCallback(Q=>{const it=N.current;if(it){const St=it.querySelector("[data-theme]"),Et=it.getBoundingClientRect(),ie=St?.children;let le=-1,Vr=Number.POSITIVE_INFINITY;if(ie)for(let Hi=0;Hi<ie.length;Hi+=1){const Fa=ie[Hi],jh=Math.abs(Fa.getBoundingClientRect().top-Et.top);jh<Vr&&(Vr=jh,le=Hi)}if(ie&&le>=0){const Fa=ie[le].getBoundingClientRect();W.current={childIndex:le,offset:Fa.top-Et.top}}else W.current=null}n(Q)},[n]);L.useLayoutEffect(()=>{const Q=W.current;if(!Q)return;W.current=null;const it=N.current;if(!it)return;const Et=it.querySelector("[data-theme]")?.children[Q.childIndex];if(!Et)return;const ie=it.getBoundingClientRect(),Vr=Et.getBoundingClientRect().top-ie.top;it.scrollTop+=Vr-Q.offset});const{isTocPinned:xr,closeToc:Ge}=G,Cr=L.useCallback((Q,it)=>{if(xr||Ge(),_?.(Q,it)===!0)return;it.preventDefault();const Et=N.current?.querySelector(`#${CSS.escape(Q.id)}`)??document.getElementById(Q.id);Et&&(S$(Et),Et.tabIndex<0&&!Et.hasAttribute("tabindex")&&Et.setAttribute("tabindex","-1"),Et.scrollIntoView({behavior:w$()?"instant":"smooth",block:"start"}),Et.focus({preventScroll:!0}))},[Ge,xr,_]),Ur=L.useMemo(()=>l.find(it=>it.name===a)?.className??"markdown-body",[l,a]),ar=e?.headings??[],br=!(i||r),Re=br&&e!==null,Te=br&&e===null&&t!==null,kr=Re&&d&&ar.length>0,J=Re&&f,xt=(Re||Te)&&u&&typeof h=="function"&&(g!==void 0||m!==void 0),Dt=L.useMemo(()=>k.jsx(Nx,{headings:ar,className:"text-sm",labelledBy:z,onHeadingSelect:Cr,headingHref:E}),[ar,z,Cr,E]),At=U===void 0?Sl:`${O}px`,Gr=L.useMemo(()=>At===Sl?g$:Yx(At),[At]),Xr=kr||J||xt?k.jsxs("div",{ref:T,"data-aqmd-toolbar":!0,style:Gr,children:[k.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:p$}),xt&&h&&k.jsx(un,{menu:"align",Icon:Xd[c].Icon,buttonLabel:K.selectAlignAria,titleLabel:K.alignTitle,pinLabel:K.pinAlignAria,unpinLabel:K.unpinAlignAria,isOpen:G.isAlignOpen,isPinned:G.isAlignPinned,isFront:G.lastActiveMenu==="align",onActivate:G.activateAlign,onToggle:G.toggleAlign,onClose:G.closeAlign,onPinToggle:G.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:q,renderBody:Q=>k.jsx("div",{className:"space-y-1",children:Yi.CONTENT_ALIGNS.map(it=>{const{labelKey:St,Icon:Et}=Xd[it],ie=K[St],le=c===it;return k.jsxs("button",{type:"button","aria-pressed":le,lang:ie.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${le?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{h(it),Q()},children:[k.jsx(Et,{className:"h-4 w-4"}),ie.text]},it)})})}),J&&k.jsx(un,{menu:"style",Icon:X3,buttonLabel:K.selectStyleAria,titleLabel:K.styleTitle,pinLabel:K.pinStyleAria,unpinLabel:K.unpinStyleAria,isOpen:G.isStyleOpen,isPinned:G.isStylePinned,isFront:G.lastActiveMenu==="style",onActivate:G.activateStyle,onToggle:G.toggleStyle,onClose:G.closeStyle,onPinToggle:G.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:q,renderBody:Q=>k.jsx("div",{className:"space-y-1",children:l.map(it=>{const St=a===it.name;return k.jsx("button",{type:"button","aria-pressed":St,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${St?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{sr(it.name),Q()},children:it.name},it.name)})})}),kr&&k.jsx(un,{menu:"toc",Icon:U3,buttonLabel:K.openTocAria,titleLabel:K.tocTitle,titleId:z,pinLabel:K.pinTocAria,unpinLabel:K.unpinTocAria,isOpen:G.isTocOpen,isPinned:G.isTocPinned,isFront:G.lastActiveMenu==="toc",onActivate:G.activateToc,onToggle:G.toggleToc,onClose:G.closeToc,onPinToggle:G.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:At,boundary:q,renderBody:()=>Dt})]}):null,qo=()=>i?k.jsxs("p",{children:[k.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",k.jsx("span",{lang:K.loading.lang,children:K.loading.text})]}):r?k.jsx(T$,{error:r,labels:K}):e?k.jsx("div",{className:"relative w-full min-w-0",children:k.jsx(v$,{parseResult:e,theme:s,styleClassName:Ur,iFrameAllowedDomains:x,embeds:Ht,embedLabels:Se,linkComponent:v,missingImageLabel:K.missingImage.text,blockFailedLabel:o?.blockFailed,mermaidLabels:Z,spreadsheetEditor:mt,spreadsheetLocale:M,spreadsheetLabels:at,imageSource:ut,svgImageLabels:pt,onMathDiagnostics:Ct})}):t!==null?k.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):k.jsx("p",{lang:ve.lang,children:ve.text}),Wi={containerType:"inline-size",paddingInline:`${pe}px`,paddingBlockEnd:`${pe}px`,paddingBlockStart:`calc(${pe}px + var(${dn}))`,scrollPaddingBlockStart:`var(${dn})`,[dn]:`${Yr}px`};return k.jsxs(eu,{scrollerRef:$,scrollerProps:{"data-testid":"viewer","data-aqmd-scroll-container":!0,className:"grid h-full w-full overflow-x-auto overflow-y-auto *:min-w-0",style:Wi},renderScrollBar:U,onBarInlineSizeChange:F,children:[Xr,k.jsx("div",{ref:R,"data-aqmd-content":!0,style:{width:g??u$,maxWidth:m,marginInline:f$(c)},children:qo()})]})}const Gx=({node:e})=>k.jsx("del",{children:k.jsx(zt,{nodes:e.children})}),Xx=({node:e})=>k.jsx("em",{children:k.jsx(zt,{nodes:e.children})}),Vx=({node:e})=>k.jsx("sup",{children:k.jsxs("a",{id:`fnref-${e.identifier}`,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",href:`#fn-${e.identifier}`,children:["[",e.identifier,"]"]})}),B$=({nodes:e,theme:t="light"})=>e.length===0?null:k.jsx("section",{className:"border-[#171717] border-t pt-4 dark:border-[#464646]",children:k.jsx("ol",{className:"pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]",children:e.map((r,i)=>k.jsx("li",{id:`fn-${r.identifier}`,className:i===0?"":"mt-4",children:k.jsx(zt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),Kx=({node:e})=>k.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),L$=e=>e.replace(/<rt\b[^>]*>[\s\S]*?<\/rt>/gi,"").replace(/<rp\b[^>]*>[\s\S]*?<\/rp>/gi,"").replace(/<[^>]+>/g,"").replace(/ /gi," ").replace(/&/gi,"&").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&#(\d+);/g,(o,s)=>{const a=Number(s);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(o,s)=>{const a=Number.parseInt(s,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),Zx=e=>{const t=r=>{if(!r||typeof r!="object")return"";if("type"in r&&r.type==="html"){const i=r.value;return typeof i=="string"?L$(i):""}if("value"in r){const i=r.value;if(typeof i=="string")return i}return"children"in r&&Array.isArray(r.children)?r.children.map(i=>t(i)).join(""):""};return e.map(r=>t(r)).join("").replace(/\s+/g," ").trim()},E$=e=>{switch(e){case 1:return"border-b-2 border-gray-300 pb-2 text-3xl font-bold dark:border-gray-600 dark:text-gray-100";case 2:return"border-b border-gray-300 pb-2 text-2xl font-semibold dark:border-gray-600 dark:text-gray-200";case 3:return"text-xl font-semibold dark:text-gray-300";default:return"text-lg font-medium dark:text-gray-400"}},Qx=({node:e})=>{const t=new CC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(Zx(e.children));return k.jsx(r,{id:i||o,className:E$(e.depth),children:k.jsx(zt,{nodes:e.children})})},F$=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),A$=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=k.jsx(zt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=ea(e.data.tagName,F$(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(o.action==="unwrap")return i;if(o.action!=="keep"&&o.action!=="placeholder")return null;const s=e.data.tagName.toLowerCase();return k.jsx(s,{...wt.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},M$=/^\s*<(address|article|aside|blockquote|details|dialog|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h[1-6]|header|hgroup|hr|li|main|nav|ol|p|pre|section|table|ul)/i,$$=({node:e,iFrameAllowedDomains:t=[]})=>{const r=wt(e.value,Rx({iFrameAllowedDomains:t,embedLabels:wC}));return Array.isArray(r)&&r.length===0?null:M$.test(e.value)?k.jsx("div",{children:r}):k.jsx("span",{children:r})},Jx=({node:e})=>{if(!e.url||e.url.trim()===""||!$o(e.url))return null;const t=e.title??"",r=e.data?.hProperties?.width,i=e.data?.hProperties?.height;return k.jsxs("span",{style:{width:r,height:i},className:"mt-4 mb-4 inline-block w-fit max-w-full",children:[k.jsx("img",{src:e.url,alt:e.alt??"",className:"mx-auto h-full w-full",width:r,height:i}),t&&k.jsx("em",{className:"block text-center text-gray-400 text-xs",children:t})]})},tC=({node:e})=>k.jsx("code",{className:"rounded-md bg-gray-200 px-1.5 py-1 font-mono text-gray-800 text-sm dark:bg-gray-700 dark:text-gray-200",children:e.value}),O$=({node:e})=>{const t=Fx(e.value,!1),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return t.kind==="rendered"?k.jsx("span",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):k.jsx("span",{className:r,children:t.message})},R$=new RegExp(`<(?:${[...zh].join("|")})(?=[\\s/>])`,"i"),eC=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&R$.test(t.value)||t.children!==void 0&&eC(t.children)),rC=({node:e})=>{const t=$o(e.url)?e.url:void 0,r=t!==void 0&&Ax(t);return k.jsx("a",{className:Mx(void 0,eC(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:k.jsx(zt,{nodes:e.children})})},iC=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?k.jsx("li",{children:k.jsx(zt,{nodes:e.children[0].children})}):k.jsx("li",{children:k.jsx(zt,{nodes:e.children})}),oC=({node:e})=>{const t=e.ordered?"ol":"ul";return k.jsx(t,{children:k.jsx(zt,{nodes:e.children})})},I$=({node:e})=>k.jsx("mark",{children:k.jsx(zt,{nodes:e.children})}),sC=({node:e})=>k.jsx("p",{children:k.jsx(zt,{nodes:e.children})}),aC=({node:e})=>k.jsx("strong",{children:k.jsx(zt,{nodes:e.children})}),P$=({node:e})=>k.jsx("sub",{children:k.jsx(zt,{nodes:e.children})}),D$=({node:e})=>k.jsx("sup",{children:k.jsx(zt,{nodes:e.children})}),Kd=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},nC=({node:e})=>{const[t,...r]=e.children;return k.jsx("div",{className:"overflow-x-auto",children:k.jsxs("table",{className:"w-full border-collapse border-none",children:[k.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:k.jsx("tr",{children:t.children.map((i,o)=>{const{merged:s,colSpan:a,rowSpan:n,textAlign:l}=Kd(i);return s?null:k.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[o]??void 0},className:"border border-gray-300 px-4 py-2 text-left font-semibold dark:border-gray-600 dark:text-gray-200",children:k.jsx(zt,{nodes:i.children})},`mdast-table-node-${e.type}-${o}`)})})}),k.jsx("tbody",{children:r.map((i,o)=>k.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((s,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=Kd(s);return n?null:k.jsx("td",{colSpan:l,rowSpan:c,style:{textAlign:h??e.align?.[a]??void 0},className:"border border-gray-300 px-4 py-2 dark:border-gray-600 dark:text-gray-300",children:k.jsx(zt,{nodes:s.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},lC=({node:e})=>k.jsx(k.Fragment,{children:e.value}),hC=()=>k.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),cC=({node:e})=>{const t=e.data?.title||"";return k.jsxs("details",{className:"markdown-details",children:[k.jsx("summary",{children:t}),k.jsx("div",{className:"markdown-details-content",children:k.jsx(zt,{nodes:e.children})})]})},dC=({node:e})=>{const r=["message",e.data?.messageType||"message"].filter(Boolean).join(" ");return k.jsxs("aside",{className:r,children:[k.jsx("span",{className:"message-symbol",style:{userSelect:"none"},children:"!"}),k.jsx("div",{className:"message-content",children:k.jsx(zt,{nodes:e.children})})]})},zt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,o)=>{switch(i.type){case"blockquote":return k.jsx(uC,{node:i},`mdast-node-${i.type}-${o}`);case"break":return k.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return k.jsx(qh,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return k.jsx(Gx,{node:i},`mdast-node-${i.type}-${o}`);case"details":return k.jsx(cC,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return k.jsx(Xx,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return k.jsx(Vx,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return k.jsx(Kx,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return k.jsx(Qx,{node:i},`mdast-node-${i.type}-${o}`);case"html":return k.jsx($$,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${o}`);case"html-block-container":{const s=i,a=`mdast-node-${s.type}-${s.position?.start?.offset??"na"}-${s.position?.end?.offset??"na"}`;return k.jsx(A$,{node:s,theme:t,iFrameAllowedDomains:r},a)}case"image":return k.jsx(Jx,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return k.jsx(tC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return k.jsx(O$,{node:i},`mdast-node-${i.type}-${o}`);case"link":return k.jsx(rC,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return k.jsx(iC,{node:i},`mdast-node-${i.type}-${o}`);case"list":return k.jsx(oC,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return k.jsx(I$,{node:i},`mdast-node-${i.type}-${o}`);case"math":return k.jsx(Q5,{node:i},`mdast-node-${i.type}-${o}`);case"message":return k.jsx(dC,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return k.jsx(sC,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return k.jsx(aC,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return k.jsx(P$,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return k.jsx(D$,{node:i},`mdast-node-${i.type}-${o}`);case"table":return k.jsx(nC,{node:i},`mdast-node-${i.type}-${o}`);case"text":return k.jsx(lC,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return k.jsx(hC,{},`mdast-node-${i.type}-${o}`);case"yaml":return null;default:{if(process.env.NODE_ENV==="development")return k.jsxs("div",{children:[k.jsxs("p",{style:{color:"red"},children:["Unknown node type: ",i.type]}),k.jsx("pre",{children:JSON.stringify(i,null,2)})]},`mdast-node-${i.type}-${o}`);throw new Error(`Unknown node type: ${i.type}`)}}}),uC=({node:e})=>k.jsx("blockquote",{className:"my-4 border-gray-300 border-l-4 bg-gray-50 p-4 italic dark:border-gray-500 dark:bg-gray-800 dark:text-gray-300",children:k.jsx(zt,{nodes:e.children})}),N$=/\s*\{#(.+?)\}\s*$/,q$=()=>e=>{fe.visit(e,"heading",t=>{if(t.children.length===0)return;const r=t.children[t.children.length-1];if(r?.type!=="text")return;const i=r,o=i.value.match(N$);if(o){const s=o[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=s,a.hProperties=n,i.value=i.value.substring(0,o.index).trimEnd(),i.value===""&&t.children.pop()}})},z$=()=>e=>{fe.visit(e,"footnoteDefinition",t=>{fe.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},j$=()=>e=>{fe.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const s=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(s){const[,a,n]=s,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},W$=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let o=0;for(;o<i.length;){const s=i[o];if(s.type==="html"&&s.value.startsWith("<")&&!s.value.startsWith("</")&&s.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=o;d<i.length;d++){const f=i[d];if(f.type==="html"){n+=f.value;const u=f.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const g of u){const m=g.match(/<\/?([a-zA-Z0-9]+)/);if(!m)continue;const y=m[1];g.startsWith("</")?c.length>0&&c[c.length-1]===y&&c.pop():g.startsWith("<")&&c.push(y)}}else if(f.type==="text")n+=f.value;else{c.length===0&&(h=!0);break}if(l++,c.length===0){h=!0;break}}h&&i.splice(o,l,{type:"html",value:n})}o++}};fe.visit(e,"paragraph",t),fe.visit(e,"tableCell",t),fe.visit(e,"heading",t),fe.visit(e,"emphasis",t),fe.visit(e,"strong",t),fe.visit(e,"delete",t)},Zd=/\s*=\s*(\d+)(w|h|x|y)\s*/g,H$=()=>e=>{fe.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(Zd)];return{updatedText:l.replaceAll(Zd,"").trim(),matches:c}},{updatedText:i,matches:o}=r(t.alt);t.alt=i;const{updatedText:s,matches:a}=r(t.title);t.title=s||null;const n=[...o,...a];if(n.length>0){t.data||(t.data={}),t.data.hProperties||(t.data.hProperties={});for(const l of n){const c=Number.parseInt(l[1],10),h=l[2];h==="w"||h==="x"?t.data.hProperties.width=c:(h==="h"||h==="y")&&(t.data.hProperties.height=c)}}})},Y$=()=>e=>{fe.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},Qd=/^:::(message|details)\s*(.*)/,U$=()=>e=>{function t(r){const i=[];let o=0;for(;o<r.length;){const s=r[o];if(s.type==="paragraph"&&s.children[0]?.type==="text"&&s.children[0].value.trim().startsWith(":::")){const l=s.children[0].value.trim().match(Qd);if(l){const c=o;let h=-1,d=1;const f=s.children.at(-1);if(s.children.length>1&&f?.type==="text"&&f.value.trim()===":::")h=c;else for(let u=c+1;u<r.length;u++){const g=r[u];if(g.type==="paragraph"&&g.children[0]?.type==="text"){const m=g.children[0].value.trim();Qd.test(m)?d++:m===":::"&&d--}if(d===0){h=u;break}}if(h!==-1){const u=l[1],g=l[2];let m;if(h===c){const C=s.children.slice(1,-1);C[0]?.type==="break"&&C.shift(),C.at(-1)?.type==="break"&&C.pop(),m=C.length>0?[{type:"paragraph",children:C}]:[]}else{const C=s.children.slice(1);C[0]?.type==="break"&&C.shift();const w={type:"paragraph",children:C},v=r[h].children.slice(0,-1);v.at(-1)?.type==="break"&&v.pop();const _={type:"paragraph",children:v},E=r.slice(c+1,h);m=[w,...E,_].filter(B=>!(B.type==="paragraph"&&B.children.length===0))}const y=t(m);let x;if(u==="message"?x={type:"message",data:{messageType:g.trim()},children:y}:u==="details"&&(x={type:"details",data:{title:g.trim()},children:y}),x){i.push(x),o=h+1;continue}}}}const a={...s};"children"in a&&Array.isArray(a.children)&&(a.type==="blockquote"||a.type==="footnoteDefinition"||a.type==="message"||a.type==="details"?a.children=t(a.children):a.type==="list"&&(a.children=a.children.map(n=>({...n,children:t(n.children)})))),i.push(a),o++}return i}e.children=t(e.children)},G$=e=>{const t=[];return fe.visit(e,"heading",r=>{const i=Zx(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=uC;exports.CodeNode=qh;exports.Color=Me;exports.Color$1=Di;exports.DEFAULT_MARKDOWN_EMBED_LABELS=kC;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=o$;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=fM;exports.DEFAULT_MERMAID_INTERACTION=Cx;exports.DEFAULT_SVG_IMAGE_LABELS=B3;exports.DeleteNode=Gx;exports.EmphasisNode=Xx;exports.FootnoteBackLinkNode=Kx;exports.FootnoteReferenceNode=Vx;exports.FootnotesSection=B$;exports.HeadingNode=Qx;exports.HostedScrollArea=eu;exports.ImageNode=Jx;exports.InlineCodeNode=tC;exports.JSON_SCHEMA=kp;exports.LinkNode=rC;exports.ListItemNode=iC;exports.ListNode=oC;exports.MarkdownRenderer=Dx;exports.MarkdownViewer=_$;exports.MermaidDiagram=Ph;exports.NodesRenderer=zt;exports.ParagraphNode=sC;exports.Rgb=se;exports.SpreadsheetBlock=Nh;exports.StrongNode=aC;exports.TableNode=nC;exports.TableOfContents=Nx;exports.TextNode=lC;exports.ThematicBreakNode=hC;exports.Utils=gt;exports.ZERO_WIDTH_SPACE=Hp;exports.ZennDetailsNode=cC;exports.ZennMessageNode=dC;exports.__export=uu;exports.__name=p;exports.abs=AS;exports.acos=NS;exports.adjustChannel=Bl;exports.argumentsTag=nh;exports.array=pf;exports.arrayBufferTag=Ap;exports.arrayTag=Fp;exports.asin=qS;exports.assignWithDepth_default=qt;exports.at=rt;exports.atan2=MS;exports.booleanTag=ah;exports.calculateMathMLDimensions=ik;exports.calculateTextDimensions=ma;exports.calculateTextHeight=gh;exports.calculateTextWidth=je;exports.cleanAndMerge=ya;exports.clear=Mu;exports.clear$1=OB;exports.clear$2=nB;exports.clear2=LB;exports.color=Fi;exports.commonDb_exports=Ml;exports.common_default=Pi;exports.computeDimensionOfText=Lm;exports.computeLabelTransform=ii;exports.configureLabelImages=mh;exports.configureSvgSize=Al;exports.constant=_r;exports.constant$1=aa;exports.cos=$S;exports.createText=Oe;exports.curveBasis=$s;exports.darken=Y;exports.dataViewTag=$p;exports.dateTag=Bp;exports.dayjs2=fu;exports.decodeEntities=gr;exports.defaultConfig2=uk;exports.defaultConfig_default=Ll;exports.define=sa;exports.distExports=Sp;exports.edgeLabels=Eo;exports.epsilon=On;exports.extend=ql;exports.extractHeadings=G$;exports.float32ArrayTag=zp;exports.float64ArrayTag=jp;exports.generateId=Kp;exports.getAccDescription=Iu;exports.getAccTitle=Ou;exports.getConfig=Ot;exports.getConfig2=kt;exports.getDefaultExportFromCjs=tu;exports.getDiagramTitle=Du;exports.getEdgeId=MT;exports.getEffectiveHtmlLabels=ee;exports.getIconSVG=qi;exports.getLineFunctionsWithOffset=a0;exports.getRegisteredLayoutAlgorithm=fL;exports.getStylesFromArray=fh;exports.getSubGraphTitleMargins=xa;exports.getTag=ga;exports.getThemeVariables3=pu;exports.getUrl=Fu;exports.getUserDefinedConfig=H1;exports.halfPi=Rn;exports.hasKatex=Li;exports.hue=lw;exports.insertCluster=Nm;exports.insertEdge=c0;exports.insertEdgeLabel=n0;exports.insertNode=Ah;exports.int16ArrayTag=Np;exports.int32ArrayTag=qp;exports.int8ArrayTag=Dp;exports.interpolateNumber=Qe;exports.interpolateRgb=_n;exports.interpolateString=rf;exports.isDark=ke;exports.isLabelStyle=ih;exports.isPrimitive=pa;exports.isTypedArray=mo;exports.isValidShape=s0;exports.lighten=H;exports.line=yf;exports.lineBreakRegex=Ii;exports.load=wp;exports.log=V;exports.mapTag=Lp;exports.markerOffsets=Zt;exports.markers_default=f0;exports.max=OS;exports.min=RS;exports.nogamma=zl;exports.numberTag=sh;exports.objectTag=Mp;exports.parseFontSize=Po;exports.parseGenericTypes=Cn;exports.pi=ha;exports.positionEdgeLabel=l0;exports.positionNode=EB;exports.random=Qp;exports.regexpTag=Tp;exports.registerIconPacks=om;exports.remarkCustomHeadingId=q$;exports.remarkFootnoteBackLink=z$;exports.remarkHtmlAnchorToLink=j$;exports.remarkHtmlInHtml=W$;exports.remarkImageSize=H$;exports.remarkParentNode=Y$;exports.remarkZennMessage=U$;exports.render=uL;exports.renderKatexSanitized=Fl;exports.rgbConvert=Ju;exports.rgba=Je;exports.sanitizeText=Ce;exports.select=yt;exports.selectSvgElement=Nf;exports.setAccDescription=Ru;exports.setAccTitle=$u;exports.setConfig2=dk;exports.setDiagramTitle=Pu;exports.setNodeElem=BB;exports.setTag=Ep;exports.setupGraphViewbox=Au;exports.setupGraphViewbox2=Nu;exports.sin=IS;exports.sqrt=PS;exports.stringTag=oh;exports.styles2String=ot;exports.symbolTag=_p;exports.tau=DS;exports.terminalLabels=Ut;exports.uint16ArrayTag=Ip;exports.uint32ArrayTag=Pp;exports.uint8ArrayTag=Op;exports.uint8ClampedArrayTag=Rp;exports.unknownIcon=rm;exports.updateNodeBounds=st;exports.useMarkdownToolbarState=Ux;exports.utils_default=xe;exports.withPath=gf;exports.wrapLabel=Jp;
|