@aiquants/markdown 9.0.1 → 11.0.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.
Files changed (140) hide show
  1. package/README.md +161 -52
  2. package/dist/{abnfDiagram-VRR7QNED-CqzHEoGP.js → abnfDiagram-VRR7QNED-CxQnFjoJ.js} +3 -3
  3. package/dist/{abnfDiagram-VRR7QNED-CfcidEeF.cjs → abnfDiagram-VRR7QNED-npWEsqYc.cjs} +1 -1
  4. package/dist/{arc-CIHnI5Tn.js → arc-8h1FB6uq.js} +20 -20
  5. package/dist/{arc-BD-XC8JG.cjs → arc-CUfL06Yf.cjs} +1 -1
  6. package/dist/{architectureDiagram-ZJ3FMSHR-CLgC4ySs.cjs → architectureDiagram-ZJ3FMSHR-B20pDRbn.cjs} +1 -1
  7. package/dist/{architectureDiagram-ZJ3FMSHR-CX5DaRgk.js → architectureDiagram-ZJ3FMSHR-B3AN9LVb.js} +2 -2
  8. package/dist/{blockDiagram-677ZJIJ3-B45jR5Ef.cjs → blockDiagram-677ZJIJ3-BpyvdB6a.cjs} +1 -1
  9. package/dist/{blockDiagram-677ZJIJ3-BVvPQ2BZ.js → blockDiagram-677ZJIJ3-Cyl2Lsxi.js} +3 -3
  10. package/dist/{c4Diagram-LMCZKHZV-CmpNmuYQ.js → c4Diagram-LMCZKHZV-B1v06ANz.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-CUgZ93IA.cjs → c4Diagram-LMCZKHZV-C9aMoZww.cjs} +1 -1
  12. package/dist/{channel-CCNoIO-n.cjs → channel-BFKA8ne6.cjs} +1 -1
  13. package/dist/{channel-CJnvKaiK.js → channel-DHWInoX5.js} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-CGvZIrla.cjs → chunk-2Q5K7J3B-CKQJDnvh.cjs} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-DI5NSXs3.js → chunk-2Q5K7J3B-Hkei_N8G.js} +1 -1
  16. package/dist/{chunk-32BRIVSS-DBxZTCPU.js → chunk-32BRIVSS-BVjoQVFd.js} +1 -1
  17. package/dist/{chunk-32BRIVSS-Buxmelj1.cjs → chunk-32BRIVSS-BegSeeKc.cjs} +1 -1
  18. package/dist/{chunk-5VM5RSS4-DJudqxeH.cjs → chunk-5VM5RSS4-BQ9OvvVm.cjs} +1 -1
  19. package/dist/{chunk-5VM5RSS4-B3vhx_6_.js → chunk-5VM5RSS4-Bwvu3ZQn.js} +1 -1
  20. package/dist/{chunk-EX3LRPZG-BYk-yeom.cjs → chunk-EX3LRPZG-Bj_q1v7R.cjs} +1 -1
  21. package/dist/{chunk-EX3LRPZG-3mU4tF-T.js → chunk-EX3LRPZG-Bz5BV4Fn.js} +4 -4
  22. package/dist/{chunk-JWPE2WC7-05_7DU1b.js → chunk-JWPE2WC7-C01naS5D.js} +1 -1
  23. package/dist/{chunk-JWPE2WC7-CF8PY84Z.cjs → chunk-JWPE2WC7-CZGO5NQs.cjs} +1 -1
  24. package/dist/{chunk-MOJQB5TN-MX6h9dRz.js → chunk-MOJQB5TN-C3Hq75Zv.js} +10 -10
  25. package/dist/{chunk-MOJQB5TN-C1PxO_ZB.cjs → chunk-MOJQB5TN-DFFX8TKc.cjs} +1 -1
  26. package/dist/{chunk-PUDLZKDR-nwjWRhQa.cjs → chunk-PUDLZKDR-2MWL0ZoW.cjs} +1 -1
  27. package/dist/{chunk-PUDLZKDR-CEaKE3Nm.js → chunk-PUDLZKDR-Sz0OB5IT.js} +6 -6
  28. package/dist/{chunk-RYQCIY6F-DCzkxbV-.js → chunk-RYQCIY6F-CBI5EYhC.js} +12 -12
  29. package/dist/{chunk-RYQCIY6F-0Xvnmozd.cjs → chunk-RYQCIY6F-CSDblZx6.cjs} +1 -1
  30. package/dist/{chunk-V7JOEXUC-9kUlPSlw.js → chunk-V7JOEXUC-Br5K_lDL.js} +15 -15
  31. package/dist/{chunk-V7JOEXUC-DJ6NOMBh.cjs → chunk-V7JOEXUC-D3Y19ZhK.cjs} +1 -1
  32. package/dist/{chunk-VR4S4FIN-DTcdZAIy.js → chunk-VR4S4FIN-CQXol07w.js} +3 -3
  33. package/dist/{chunk-VR4S4FIN-DjgjZOol.cjs → chunk-VR4S4FIN-DjxDq6sN.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-BSD7H18E.js → chunk-XXDRQBXY--FT3CTeH.js} +1 -1
  35. package/dist/{chunk-XXDRQBXY-BAN-bNyU.cjs → chunk-XXDRQBXY-DwP8HH5V.cjs} +1 -1
  36. package/dist/{classDiagram-v2-EOCWNBFH-CAVtDASr.js → classDiagram-OUVF2IWQ-HKTI1J11.js} +2 -2
  37. package/dist/{classDiagram-OUVF2IWQ-D9dkL55K.cjs → classDiagram-OUVF2IWQ-WUNGB5FC.cjs} +1 -1
  38. package/dist/{classDiagram-OUVF2IWQ-CAVtDASr.js → classDiagram-v2-EOCWNBFH-HKTI1J11.js} +2 -2
  39. package/dist/{classDiagram-v2-EOCWNBFH-D9dkL55K.cjs → classDiagram-v2-EOCWNBFH-WUNGB5FC.cjs} +1 -1
  40. package/dist/code-blocks-Bax5Xik7.cjs +4 -0
  41. package/dist/code-blocks-bgwDIVp1.js +267 -0
  42. package/dist/code-blocks.cjs +1 -1
  43. package/dist/code-blocks.d.ts +15 -1
  44. package/dist/code-blocks.js +19 -34
  45. package/dist/components/SpreadsheetBlock.d.ts +8 -2
  46. package/dist/components/SpreadsheetToolbar.d.ts +20 -2
  47. package/dist/components/blockKeys.d.ts +14 -0
  48. package/dist/components/controlStyles.d.ts +2 -1
  49. package/dist/components/spreadsheetClipboard.d.ts +1 -1
  50. package/dist/components/spreadsheetLabels.d.ts +13 -0
  51. package/dist/components/spreadsheetModel.d.ts +13 -8
  52. package/dist/components/toolbar.d.ts +25 -0
  53. package/dist/components/viewerLabels.d.ts +5 -2
  54. package/dist/converter.wasm +0 -0
  55. package/dist/{cose-bilkent-JH36ORCC-aJGIpkTB.js → cose-bilkent-JH36ORCC-BYqXiffa.js} +5 -5
  56. package/dist/{cose-bilkent-JH36ORCC-KQT29htQ.cjs → cose-bilkent-JH36ORCC-X2Leg8js.cjs} +1 -1
  57. package/dist/{cynefinDiagram-TSTJHNR4-C_rGUs0a.cjs → cynefinDiagram-TSTJHNR4-DYAvR3E8.cjs} +1 -1
  58. package/dist/{cynefinDiagram-TSTJHNR4-C3F_WdyT.js → cynefinDiagram-TSTJHNR4-YATbGDfo.js} +47 -47
  59. package/dist/{dagre-VKFMJZFB-CrmCHDPv.js → dagre-VKFMJZFB-Co2RmhO1.js} +20 -20
  60. package/dist/{dagre-VKFMJZFB-Bn_WdZ6A.cjs → dagre-VKFMJZFB-yjrP1oXL.cjs} +1 -1
  61. package/dist/{diagram-FQU43EPY-B8Bka9S6.cjs → diagram-FQU43EPY-DVts5oXk.cjs} +1 -1
  62. package/dist/{diagram-FQU43EPY-DuJ6IxJz.js → diagram-FQU43EPY-DfigqQP9.js} +2 -2
  63. package/dist/{diagram-G47NLZAW-D--MA_nT.cjs → diagram-G47NLZAW-Cave3JO_.cjs} +1 -1
  64. package/dist/{diagram-G47NLZAW-3UXM5joI.js → diagram-G47NLZAW-k5OpX3J4.js} +38 -38
  65. package/dist/{diagram-NH7WQ7WH-Cqc8orqE.cjs → diagram-NH7WQ7WH-ByEOvB5o.cjs} +1 -1
  66. package/dist/{diagram-NH7WQ7WH-CtH8Gdkl.js → diagram-NH7WQ7WH-DDA_wiMC.js} +20 -20
  67. package/dist/{diagram-OA4YK3LP-DfKPIPFJ.cjs → diagram-OA4YK3LP-C85REJhK.cjs} +1 -1
  68. package/dist/{diagram-OA4YK3LP-CWRyqD4L.js → diagram-OA4YK3LP-DR63MTHd.js} +58 -58
  69. package/dist/{diagram-WEI45ONY-BYMVLI0Q.cjs → diagram-WEI45ONY-9_82j2nL.cjs} +1 -1
  70. package/dist/{diagram-WEI45ONY-C0OrOx2a.js → diagram-WEI45ONY-DKy9LVdb.js} +10 -10
  71. package/dist/{ebnfDiagram-CCIWWBDH-DZKq52yC.cjs → ebnfDiagram-CCIWWBDH-CYd0AUSE.cjs} +1 -1
  72. package/dist/{ebnfDiagram-CCIWWBDH-CQ7558AK.js → ebnfDiagram-CCIWWBDH-Cn6FnIur.js} +5 -5
  73. package/dist/{erDiagram-Q63AITRT-CsCp6RSB.js → erDiagram-Q63AITRT-BF_5IEpU.js} +9 -9
  74. package/dist/{erDiagram-Q63AITRT-CzkYgQ0q.cjs → erDiagram-Q63AITRT-CMIoja24.cjs} +1 -1
  75. package/dist/{extractHeadings-BUjTmniO.js → extractHeadings-DZi9v6vp.js} +8478 -8138
  76. package/dist/extractHeadings-sSLGzcdt.cjs +315 -0
  77. package/dist/fencedBlockLines.d.ts +36 -0
  78. package/dist/flowDiagram-23GEKE2U-BCDxgNfH.js +7 -0
  79. package/dist/flowDiagram-23GEKE2U-DDbv1eCW.cjs +1 -0
  80. package/dist/{ganttDiagram-NO4QXBWP-BVnjew_C.js → ganttDiagram-NO4QXBWP-DEnf80Mq.js} +2 -2
  81. package/dist/{ganttDiagram-NO4QXBWP-7oIdk62h.cjs → ganttDiagram-NO4QXBWP-Drcm5yEd.cjs} +1 -1
  82. package/dist/{gitGraphDiagram-IHSO6WYX-BufmbyyT.cjs → gitGraphDiagram-IHSO6WYX-GII6PPu9.cjs} +1 -1
  83. package/dist/{gitGraphDiagram-IHSO6WYX-fP0zuss4.js → gitGraphDiagram-IHSO6WYX-eyfAn5cz.js} +10 -10
  84. package/dist/index.cjs +1 -1
  85. package/dist/index.client.cjs +1 -1
  86. package/dist/index.client.d.ts +2 -2
  87. package/dist/index.client.js +37 -35
  88. package/dist/index.js +37 -35
  89. package/dist/{infoDiagram-FWYZ7A6U-DerCFmks.cjs → infoDiagram-FWYZ7A6U-C2FBPXIG.cjs} +1 -1
  90. package/dist/{infoDiagram-FWYZ7A6U-DzsSutoh.js → infoDiagram-FWYZ7A6U-DPC7xHqx.js} +1 -1
  91. package/dist/{ishikawaDiagram-FXEZZL3T-BN-byOYP.cjs → ishikawaDiagram-FXEZZL3T-CJVI_dU0.cjs} +1 -1
  92. package/dist/{ishikawaDiagram-FXEZZL3T-BZ_ric9v.js → ishikawaDiagram-FXEZZL3T-DqNbTlei.js} +25 -25
  93. package/dist/{journeyDiagram-5HDEW3XC-C7iTlBhN.cjs → journeyDiagram-5HDEW3XC-DiVOEWa6.cjs} +1 -1
  94. package/dist/{journeyDiagram-5HDEW3XC-CfZ11aJu.js → journeyDiagram-5HDEW3XC-DuKx5oFy.js} +4 -4
  95. package/dist/{kanban-definition-HUTT4EX6-BNNQtqj9.cjs → kanban-definition-HUTT4EX6-BklyDLxL.cjs} +1 -1
  96. package/dist/{kanban-definition-HUTT4EX6-De7q9Kj3.js → kanban-definition-HUTT4EX6-DezliCFs.js} +52 -52
  97. package/dist/{linear-Bh2aX99D.js → linear-CdYfVjua.js} +5 -5
  98. package/dist/{linear-D8TLf9nV.cjs → linear-w1JR48Qh.cjs} +1 -1
  99. package/dist/{mindmap-definition-LN4V7U3C-3bksVDiB.js → mindmap-definition-LN4V7U3C-7q4b7Jdd.js} +16 -16
  100. package/dist/{mindmap-definition-LN4V7U3C-CmbdSctZ.cjs → mindmap-definition-LN4V7U3C-BlvTH7wL.cjs} +1 -1
  101. package/dist/{pegDiagram-2B236MQR-ffi6qFEn.js → pegDiagram-2B236MQR-BPY_9I4m.js} +3 -3
  102. package/dist/{pegDiagram-2B236MQR-BWozQII1.cjs → pegDiagram-2B236MQR-DirAhjr9.cjs} +1 -1
  103. package/dist/{pieDiagram-ENE6RG2P-DfTgyWpG.cjs → pieDiagram-ENE6RG2P-CLMNCcZD.cjs} +1 -1
  104. package/dist/{pieDiagram-ENE6RG2P-De3q_Av5.js → pieDiagram-ENE6RG2P-L4j2AB7Y.js} +51 -51
  105. package/dist/{quadrantDiagram-ABIIQ3AL-CP7NgI8w.js → quadrantDiagram-ABIIQ3AL-B9uzT4Zl.js} +43 -43
  106. package/dist/{quadrantDiagram-ABIIQ3AL-BZF5Z12H.cjs → quadrantDiagram-ABIIQ3AL-lyExQfuw.cjs} +1 -1
  107. package/dist/{railroadDiagram-RFXS5EU6-BuWP-rUP.js → railroadDiagram-RFXS5EU6-BgW-4T7B.js} +7 -7
  108. package/dist/{railroadDiagram-RFXS5EU6-Cui5Nx7p.cjs → railroadDiagram-RFXS5EU6-u2Ztkufm.cjs} +1 -1
  109. package/dist/{requirementDiagram-TGXJPOKE-DOEubcGx.js → requirementDiagram-TGXJPOKE-BnyCTa79.js} +18 -18
  110. package/dist/{requirementDiagram-TGXJPOKE-C-WJSUrB.cjs → requirementDiagram-TGXJPOKE-Cm9r8e07.cjs} +1 -1
  111. package/dist/{sankeyDiagram-HTMAVEWB-BrD3GLG6.js → sankeyDiagram-HTMAVEWB-Cv3KCrBX.js} +1 -1
  112. package/dist/{sankeyDiagram-HTMAVEWB-CyT8wRcS.cjs → sankeyDiagram-HTMAVEWB-KJ5WdXGw.cjs} +1 -1
  113. package/dist/{sequenceDiagram-DBY2YBRQ-CT6w_sxa.js → sequenceDiagram-DBY2YBRQ-CUa9htwo.js} +3 -3
  114. package/dist/{sequenceDiagram-DBY2YBRQ-DmNBUeEN.cjs → sequenceDiagram-DBY2YBRQ-DYXMeMoq.cjs} +1 -1
  115. package/dist/{sizeCapture-X5ZJPWSS-h_Xsq3-D.cjs → sizeCapture-X5ZJPWSS-C4RUlRk2.cjs} +1 -1
  116. package/dist/{sizeCapture-X5ZJPWSS-Dt-2lcQO.js → sizeCapture-X5ZJPWSS-D0cfhTVe.js} +1 -1
  117. package/dist/{stateDiagram-2N3HPSRC-C9dyCEcu.cjs → stateDiagram-2N3HPSRC-C4DOBTHC.cjs} +1 -1
  118. package/dist/{stateDiagram-2N3HPSRC-CjJrf8oq.js → stateDiagram-2N3HPSRC-CUQCdjYa.js} +10 -10
  119. package/dist/{stateDiagram-v2-6OUMAXLB-BhwjG0NA.cjs → stateDiagram-v2-6OUMAXLB-BK27mYqW.cjs} +1 -1
  120. package/dist/{stateDiagram-v2-6OUMAXLB-APLiC-KL.js → stateDiagram-v2-6OUMAXLB-C1Fb_pKt.js} +2 -2
  121. package/dist/styles/markdown.css +1 -1
  122. package/dist/styles/markdown.standalone.css +1 -1
  123. package/dist/{swimlanes-5IMT3BWC-Dlu3b_xG.js → swimlanes-5IMT3BWC-DUPAete1.js} +313 -313
  124. package/dist/{swimlanes-5IMT3BWC-DRPswRoa.cjs → swimlanes-5IMT3BWC-DZLnPVID.cjs} +1 -1
  125. package/dist/{swimlanesDiagram-G3AALYLV-CX2jbFCF.js → swimlanesDiagram-G3AALYLV-BrpRN3Vb.js} +2 -2
  126. package/dist/{swimlanesDiagram-G3AALYLV-VAEv3KP_.cjs → swimlanesDiagram-G3AALYLV-CMa-ZboO.cjs} +1 -1
  127. package/dist/{timeline-definition-FHXFAJF6-Ct68OfPR.js → timeline-definition-FHXFAJF6-DC2SJZSb.js} +108 -108
  128. package/dist/{timeline-definition-FHXFAJF6-C6xF4zqV.cjs → timeline-definition-FHXFAJF6-wvuHQLus.cjs} +1 -1
  129. package/dist/{vennDiagram-L72KCM5P-CUaYoUAd.cjs → vennDiagram-L72KCM5P-DbIG-wm1.cjs} +1 -1
  130. package/dist/{vennDiagram-L72KCM5P-BfTAjs8X.js → vennDiagram-L72KCM5P-HK22xYss.js} +101 -101
  131. package/dist/{wardleyDiagram-EHGQE667-Cp3kY_DT.cjs → wardleyDiagram-EHGQE667-BN2PkxRg.cjs} +1 -1
  132. package/dist/{wardleyDiagram-EHGQE667-2foz0EAt.js → wardleyDiagram-EHGQE667-JHC6pqAp.js} +85 -85
  133. package/dist/{xychartDiagram-FW5EYKEG-CDkSOK02.cjs → xychartDiagram-FW5EYKEG-CMRlyJDS.cjs} +1 -1
  134. package/dist/{xychartDiagram-FW5EYKEG-B3dGYiSE.js → xychartDiagram-FW5EYKEG-DNLQTD-2.js} +40 -40
  135. package/package.json +11 -11
  136. package/dist/cli.d.ts +0 -1
  137. package/dist/cli.js +0 -115
  138. package/dist/extractHeadings-Dkf-aqDu.cjs +0 -314
  139. package/dist/flowDiagram-23GEKE2U-DwEDOisR.cjs +0 -1
  140. package/dist/flowDiagram-23GEKE2U-aboipivB.js +0 -7
@@ -0,0 +1,315 @@
1
+ "use strict";var Zx=Object.create;var $h=Object.defineProperty;var Qx=Object.getOwnPropertyDescriptor;var Jx=Object.getOwnPropertyNames;var tC=Object.getPrototypeOf,eC=Object.prototype.hasOwnProperty;var rC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jx(t))!eC.call(e,o)&&o!==r&&$h(e,o,{get:()=>t[o],enumerable:!(i=Qx(t,o))||i.enumerable});return e};var Oh=(e,t,r)=>(r=e!=null?Zx(tC(e)):{},rC(t||!e||!e.__esModule?$h(r,"default",{value:e,enumerable:!0}):r,e));const E=require("react"),qe=require("./linkCards-Bjd_vW39.cjs"),Pr=require("./providers-DO2t7ks4.cjs"),zi=require("./viewer-settings.cjs"),Et=require("html-react-parser"),Dt=require("./code-blocks-Bax5Xik7.cjs"),ur=require("./embeds.cjs"),go=require("./source-lines.cjs"),sn=require("./simple-logger-9yf7ypyB.cjs"),iC=require("shiki"),wi=require("dompurify"),se=require("@aiquants/spreadsheet/view"),Gs=require("@aiquants/spreadsheet/tsv"),oC=require("github-slugger"),sC=require("katex"),fe=require("unist-util-visit"),Vs=(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)},fl=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},Ks=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),aC=fl(Ks),jd=e=>Vs(Ks,e),nC=jd(void 0);function Wd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Io={exports:{}},ji={};var Rh;function lC(){if(Rh)return ji;Rh=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 ji.Fragment=t,ji.jsx=r,ji.jsxs=r,ji}var Wi={};var Ih;function hC(){return Ih||(Ih=1,process.env.NODE_ENV!=="production"&&(function(){function e(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===$?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case B:return"Suspense";case L:return"SuspenseList";case F:return"Activity"}if(typeof v=="object")switch(typeof v.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),v.$$typeof){case m:return"Portal";case S:return v.displayName||"Context";case k:return(v._context.displayName||"Context")+".Consumer";case T:var U=v.render;return v=v.displayName,v||(v=U.displayName||U.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case _:return U=v.displayName||null,U!==null?U:e(v.type)||"Memo";case A:U=v._payload,v=v._init;try{return e(v(U))}catch{}}return null}function t(v){return""+v}function r(v){try{t(v);var U=!1}catch{U=!0}if(U){U=console;var D=U.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&v[Symbol.toStringTag]||v.constructor.name||"Object";return D.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(v)}}function i(v){if(v===y)return"<>";if(typeof v=="object"&&v!==null&&v.$$typeof===A)return"<...>";try{var U=e(v);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function o(){var v=H.A;return v===null?null:v.getOwner()}function s(){return Error("react-stack-top-frame")}function a(v){if(Y.call(v,"key")){var U=Object.getOwnPropertyDescriptor(v,"key").get;if(U&&U.isReactWarning)return!1}return v.key!==void 0}function n(v,U){function D(){P||(P=!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)",U))}D.isReactWarning=!0,Object.defineProperty(v,"key",{get:D,configurable:!0})}function l(){var v=e(this.type);return q[v]||(q[v]=!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.")),v=this.props.ref,v!==void 0?v:null}function c(v,U,D,X,G,Z){var K=D.ref;return v={$$typeof:p,type:v,key:U,props:D,_owner:X},(K!==void 0?K:null)!==null?Object.defineProperty(v,"ref",{enumerable:!1,get:l}):Object.defineProperty(v,"ref",{enumerable:!1,value:null}),v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(v,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(v,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(v,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v}function h(v,U,D,X,G,Z){var K=U.children;if(K!==void 0)if(X)if(N(K)){for(X=0;X<K.length;X++)d(K[X]);Object.freeze&&Object.freeze(K)}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(K);if(Y.call(U,"key")){K=e(v);var at=Object.keys(U).filter(function(ct){return ct!=="key"});X=0<at.length?"{key: someKey, "+at.join(": ..., ")+": ...}":"{key: someKey}",z[K+X]||(at=0<at.length?"{"+at.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ let props = %s;
3
+ <%s {...props} />
4
+ React keys must be passed directly to JSX without using spread:
5
+ let props = %s;
6
+ <%s key={someKey} {...props} />`,X,K,at,K),z[K+X]=!0)}if(K=null,D!==void 0&&(r(D),K=""+D),a(U)&&(r(U.key),K=""+U.key),"key"in U){D={};for(var gt in U)gt!=="key"&&(D[gt]=U[gt])}else D=U;return K&&n(D,typeof v=="function"?v.displayName||v.name||"Unknown":v),c(v,K,D,o(),G,Z)}function d(v){f(v)?v._store&&(v._store.validated=1):typeof v=="object"&&v!==null&&v.$$typeof===A&&(v._payload.status==="fulfilled"?f(v._payload.value)&&v._payload.value._store&&(v._payload.value._store.validated=1):v._store&&(v._store.validated=1))}function f(v){return typeof v=="object"&&v!==null&&v.$$typeof===p}var u=E,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"),T=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),H=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,N=Array.isArray,I=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(v){return v()}};var P,q={},R=u.react_stack_bottom_frame.bind(u,s)(),O=I(i(s)),z={};Wi.Fragment=y,Wi.jsx=function(v,U,D){var X=1e4>H.recentlyCreatedOwnerStacks++;return h(v,U,D,!1,X?Error("react-stack-top-frame"):R,X?I(i(v)):O)},Wi.jsxs=function(v,U,D){var X=1e4>H.recentlyCreatedOwnerStacks++;return h(v,U,D,!0,X?Error("react-stack-top-frame"):R,X?I(i(v)):O)}})()),Wi}var Ph;function cC(){return Ph||(Ph=1,process.env.NODE_ENV==="production"?Io.exports=lC():Io.exports=hC()),Io.exports}var w=cC();const Dh=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),dC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),uC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),fC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),pC=Object.freeze({scrollbarWidth:"none"}),gC=.01,Nh=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Ta=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},mC=(e,t,r)=>{const i=getComputedStyle(e),o=Ta(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-Ta(i.borderLeftWidth)-Ta(i.borderRightWidth),l=Math.max(0,Math.ceil(n-gC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},yC=(e,t,r,i,o)=>{const[s,a]=E.useState(Nh),n=E.useRef(o),l=E.useRef(0);return E.useLayoutEffect(()=>{n.current=o}),E.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(Nh),c(0);return}const u=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=mC(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 p=new ResizeObserver(u);return p.observe(h),p.observe(d),p.observe(f),window.addEventListener("resize",u),()=>{p.disconnect(),window.removeEventListener("resize",u)}},[e,t,r,i]),s},xC=(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 Hd({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:a}){const n=E.useRef(null),l=E.useRef(null),c=E.useRef(null),h=i!==void 0,d=yC(h,n,l,c,a),f=E.useCallback(m=>{n.current=m;const y=xC(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?pC:void 0}:e.style,p=w.jsxs("div",{...e,ref:f,style:u,children:[r,h&&w.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:fC})]});return h?w.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?Dh:{...Dh,...s},children:[w.jsx("div",{"data-aqmd-scroll-clip":!0,style:dC,children:p}),w.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:uC,children:d.scroller!==null&&i(d.scroller)})]}):p}const CC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),qh=e=>{const t=bC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yd=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),kC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var wC={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 SC=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:a,...n},l)=>E.createElement("svg",{ref:l,...wC,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Yd("lucide",o),...!s&&!kC(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>E.createElement(c,h)),...Array.isArray(s)?s:[s]]));const Tt=(e,t)=>{const r=E.forwardRef(({className:i,...o},s)=>E.createElement(SC,{ref:s,iconNode:t,className:Yd(`lucide-${CC(qh(e))}`,`lucide-${e}`,i),...o}));return r.displayName=qh(e),r};const TC=[["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"}]],vC=Tt("image-off",TC),_C=1024,gs=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,BC=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&gs(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&gs(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=LC(e,t,r,e.length-i,t.length-i);return[...o,...a,...s]},LC=(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,T)=>gs(e[n[S]],t[l[T]]),f=(S,T)=>e[n[S]].fingerprint===t[l[T]].fingerprint,u=(S,T)=>{let B=S;for(;B<c&&B+T<h&&d(B,B+T);)B+=1;return B},p=[Int32Array.of(u(0,0))],m=[Uint8Array.of(va)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&p[x][y+x]===c);){if(x+=1,x>_C)return[];const S=p[x-1],T=_=>_>=-(x-1)&&_<=x-1?S[_+x-1]:-1,B=new Int32Array(2*x+1).fill(-1),L=new Uint8Array(2*x+1);for(let _=-x;_<=x;_+=1){if(_<-c||_>h)continue;let A=-1,F=va;const $=T(_);$!==-1&&$<c&&$+_<h&&f($,$+_)&&(A=$+1,F=zh);const H=T(_+1);H!==-1&&H+1<=c&&H+1>A&&(A=H+1,F=jh);const Y=T(_-1);Y!==-1&&Y+_<=h&&Y>A&&(A=Y,F=_a),A!==-1&&(B[_+x]=u(A,_),L[_+x]=F)}p.push(B),m.push(L)}const C=[];let k=y;for(let S=x;S>=0;S-=1){const T=p[S][k+S],B=m[S][k+S],L=B===jh?k+1:B===_a?k-1:k,_=B===va?0:p[S-1][L+S-1]+(B===_a?0:1);for(let A=T-1;A>=_;A-=1)C.push([n[A],l[A+k]]);B===zh&&C.push([n[_-1],l[_-1+k]]),k=L}return C.reverse()},va=0,zh=1,jh=2,_a=3,EC=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[n,l]of BC(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(gs),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 FC=[["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"}]],AC=Tt("building-2",FC);const MC=[["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"}]],Wh=Tt("globe",MC),$C=/^[a-z]{2,3}$/u,OC=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return $C.test(t)?t:null},RC=()=>()=>{},IC=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},pl=()=>E.useSyncExternalStore(RC,()=>window.location.origin,()=>null),PC=()=>E.useSyncExternalStore(IC,()=>OC(document.documentElement.lang),()=>null),DC=/^[1-9]\d{0,4}$/u,Hh=e=>e!==void 0&&DC.test(e.trim())?Number(e.trim()):null,NC=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=pl(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const a=Hh(e.attributes.width),n=Hh(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}`})})},Ud=({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 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: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())}}})},qC=Ud({concurrency:2,capacity:256,timeoutMs:15e3}),zC="[data-aqmd-scroll-container]",jC=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=qe.linkCardSkipReasonOf(r.headers.get(qe.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=qe.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},WC=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",Yh=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,Ba=({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})]})]}),HC=({href:e,endpoint:t,size:r,fallback:i})=>{const o=pl(),s=E.useRef(null),a=new URL(e),n=`${t}
7
+ ${a.href}`,[l,c]=E.useState(null);E.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const k=new IntersectionObserver(S=>{C!==null||!S.some(T=>T.isIntersecting)||(k.disconnect(),C=qC.subscribe(n,T=>jC(qe.linkCardRequestOf(t,new URL(e),o),T),T=>{c({key:n,outcome:T});const B=WC(T);B!==null&&sn.linkCardLogger.info(`No link card for ${e} (${B})`)}))},{root:x.closest(zC),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(Ba,{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?AC:Wh;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(Ba,{tile:w.jsx(k,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:a.hostname,secondary:e})})}const{metadata:f}=d,u=new URL(o).hostname,p=Yh(f.image,u),m=Yh(f.icon,u),y=f.siteName===null?a.hostname:`${f.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(Ba,{tile:m===null?w.jsx(Wh,{"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:f.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:f.title??e}),f.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:f.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"})]})},Xd=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(!Pr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Pr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!qe.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&&!qe.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${qe.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},Qi=new WeakMap;let Po=0;const Uh=e=>{if(e.source===null)return;const t=Qi.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(Pr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(Pr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},YC=(e,t)=>{const r={watch:t,last:null};return Qi.has(e)||(Po+=1,Po===1&&window.addEventListener("message",Uh)),Qi.set(e,r),()=>{Qi.get(e)===r&&(Qi.delete(e),Po-=1,Po===0&&window.removeEventListener("message",Uh))}},UC=Ud({concurrency:2,capacity:256,timeoutMs:5e3}),XC=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()},GC=(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`}}},VC=Object.freeze({marginInline:0}),La=Object.freeze({kind:"pending"}),KC=Object.freeze({kind:"narrow"}),ZC=Object.freeze({kind:"fallback"}),QC=(e,t,r,i,o)=>{if(t===null)return La;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return La;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return ZC;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(o===null)return La;if(Math.min(o,n??Number.POSITIVE_INFINITY)<a)return KC}return{kind:"frame",src:s}},JC=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=pl(),a=PC(),[n,l]=E.useState(null),[c,h]=E.useState(null),d=e.kind==="lookup"?e.request.href:null,[f,u]=E.useState(null);E.useEffect(()=>{if(d!==null)return UC.subscribe(d,_=>XC(new URL(d),_),_=>u({key:d,outcome:_}))},[d]);const{provider:p,layout:m}=e,y=QC(e,s,{theme:i,lang:a},f!==null&&f.key===d?f.outcome:null,n),x=E.useCallback(_=>{if(_===null)return;l(_.getBoundingClientRect().width);const A=new ResizeObserver(()=>l(_.getBoundingClientRect().width));return A.observe(_),()=>A.disconnect()},[]),C=y.kind==="frame"?y.src:null,k=c!==null&&c.src===C?c.height:null,S=E.useCallback(_=>{if(!(_===null||_.contentWindow===null||m.kind!=="message"||C===null))return YC(_.contentWindow,{origin:p.frameOrigin,src:C,heightOf:m.heightOf,set:A=>h({src:C,height:A})})},[m,p.frameOrigin,C]);if(y.kind==="fallback")return r;const T=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:[T,r]});const B=p.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:L}=p;return w.jsxs(w.Fragment,{children:[T,w.jsxs("figure",{"data-embed-provider":p.id,"data-embed-state":y.kind,style:VC,children:[w.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:GC(m,k),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?w.jsx("iframe",{ref:S,src:y.src,title:`${p.name}: ${B.text}`,lang:B.lang,loading:"lazy",allow:L.allow??void 0,allowFullScreen:L.allowFullScreen,sandbox:L.sandbox,referrerPolicy:L.referrerPolicy,scrolling:L.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),w.jsx("figcaption",{className:"mt-2",children:t})]})]})},tb=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],eb=(e,t)=>ur.allowedFrameUrlOf(e,t)!==null,rb=(e,t)=>{const r=new Map(Object.entries(e).map(([s,a])=>[s.toLowerCase(),a])),i=ur.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of tb){const a=r.get(s);if(a!==void 0)if(s==="allow"){const n=ur.reduceFrameFeatures(a);n!==null&&(o.allow=n)}else if(s==="referrerpolicy"){const n=a.trim().toLowerCase();ur.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(o.referrerpolicy=n)}else o[s]=a}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},ib=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"]),ob=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),sb=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"]),Xh="language-",ab=/[\t\n\f\r ]+/u,nb=new Set(["h1","h2","h3","h4","h5","h6"]),Gh=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),Vh="user-content-",Kt=["align"],Zr=["width","height"],Kh=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],Ea=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:Kt,cite:[],code:[Dt.CODE_META_ATTRIBUTE],col:["span",...Kt,...Zr],colgroup:["span",...Kt,...Zr],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:Kt,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:Kt,h2:Kt,h3:Kt,h4:Kt,h5:Kt,h6:Kt,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...Kt,...Zr,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:Kt,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...Kt,"border",...Zr],tbody:[...Kt,"valign"],td:Kh,tfoot:[...Kt,"valign"],th:Kh,thead:[...Kt,"valign"],time:["datetime"],tr:[...Kt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...Zr],wbr:[]}),Fa=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...Zr],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),lb=new Set(["svg","g"]),hb=new Set(["href","src","cite","poster",ur.EMBED_LINK_ATTRIBUTE]),cb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,db=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,ub=new Set(["left","right","center","justify","start","end"]),Eo=e=>db.test(e.replace(cb,"")),fb=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();ub.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},pb=e=>{const t=e.split(ab).filter(r=>sb.has(r)||r.startsWith(Xh)&&r.length>Xh.length);return t.length===0?null:t.join(" ")},gb=(e,t)=>nb.has(e)||t.startsWith(Vh)&&t.length>Vh.length||Object.hasOwn(Gh,e)&&Gh[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},Hi=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===go.SOURCE_LINES_ATTRIBUTE){go.parseSourceLines(s)!==null&&(i[o]=s);continue}if((ob.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(hb.has(o)&&!Eo(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!gb(e,s))){if(o==="class"||o==="style"){const a=o==="class"?pb(s):fb(s);a!==null&&(i[o]=a);continue}i[o]=s}}return i},yb=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),gl=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=mb(t);if(o!==null&&lb.has(o)){const n=i!=="svg"&&Object.hasOwn(Fa,i)?Fa[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:Hi(i,s,n)}}if(i==="svg")return{action:"keep",attributes:Hi(i,s,Fa.svg)};if(i==="iframe"){const n=rb(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=Hi(i,s,Ea.p),l=s.get(ur.EMBED_LINK_ATTRIBUTE);return l!==void 0&&Eo(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return yb(s)?{action:"keep",attributes:Hi(i,s,["type","checked","disabled"])}:{action:"remove"};if(ib.has(i))return{action:"remove"};const a=Object.hasOwn(Ea,i)?Ea[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:Hi(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 xb=typeof document<"u"&&!!document.documentMode;let Aa;function Cb(){return Aa||(Aa=document.createElement("div").style)}const Zh=["webkit","moz","ms"],Do={};function ml(e){if(Do[e])return Do[e];const t=Cb();if(e in t)return Do[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=Zh.length;for(;i--;){const o=`${Zh[i]}${r}`;if(o in t)return Do[e]=o}}function No(e,t){return parseFloat(t[ml(e)])||0}function qo(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:No(`${t}Left${i}`,r),right:No(`${t}Right${i}`,r),top:No(`${t}Top${i}`,r),bottom:No(`${t}Bottom${i}`,r)}}function ri(e,t,r){e.style[ml(t)]=r}function bb(e,t){const r=ml("transform");ri(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function kb(e,{x:t,y:r,scale:i,isSVG:o},s){if(ri(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&xb){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Ma(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:qo(e,"margin",r),border:qo(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:qo(t,"padding",i),border:qo(t,"border",i)}}}let mo={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?mo={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(mo={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function $a(e,t,r,i){mo[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function Oa(e,t,r){mo[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function Gd(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function an(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,an(e,i);return}r=Gd(e,t),r>-1&&e.splice(r,1),e.push(t)}function wb(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=Gd(e,t);r>-1&&e.splice(r,1)}function Qh(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 Ra(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 Sb(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 Tb(e){return(e.getAttribute("class")||"").trim()}function vb(e,t){return e.nodeType===1&&` ${Tb(e)} `.indexOf(` ${t} `)>-1}function _b(e,t){for(let r=e;r!=null;r=r.parentNode)if(vb(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const Bb=/^http:[\w\.\/]+svg$/;function Lb(e){return Bb.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function Eb(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const Vd={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:kb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function Kd(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(!Sb(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...Vd,...t};const r=Lb(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,ri(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="",ri(e,"transformOrigin","")}function s(O={}){for(const z in O)O.hasOwnProperty(z)&&(t[z]=O[z]);(O.hasOwnProperty("cursor")||O.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),O.hasOwnProperty("overflow")&&(i.style.overflow=O.overflow),O.hasOwnProperty("touchAction")&&(i.style.touchAction=O.touchAction,e.style.touchAction=O.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(O,z,v){if(v.silent)return;const U=new CustomEvent(O,{detail:z});e.dispatchEvent(U)}function d(O,z,v){const U={x:a,y:n,scale:l,isSVG:r,originalEvent:v};return requestAnimationFrame(()=>{typeof z.animate=="boolean"&&(z.animate?bb(e,z):ri(e,"transition","none")),z.setTransform(e,U,z),h(O,U,z),h("panzoomchange",U,z)}),U}function f(O,z,v,U){const D={...t,...U},X={x:a,y:n,opts:D};if(!U?.force&&(D.disablePan||D.panOnlyWhenZoomed&&l===D.startScale))return X;if(O=parseFloat(O),z=parseFloat(z),D.disableXAxis||(X.x=(D.relative?a:0)+O),D.disableYAxis||(X.y=(D.relative?n:0)+z),D.contain){const G=Ma(e),Z=G.elem.width/l,K=G.elem.height/l,at=Z*v,gt=K*v,ct=(at-Z)/2,mt=(gt-K)/2;if(D.contain==="inside"){const Ft=(-G.elem.margin.left-G.parent.padding.left+ct)/v,At=(G.parent.width-at-G.parent.padding.left-G.elem.margin.left-G.parent.border.left-G.parent.border.right+ct)/v;X.x=Math.max(Math.min(X.x,At),Ft);const Mt=(-G.elem.margin.top-G.parent.padding.top+mt)/v,Ht=(G.parent.height-gt-G.parent.padding.top-G.elem.margin.top-G.parent.border.top-G.parent.border.bottom+mt)/v;X.y=Math.max(Math.min(X.y,Ht),Mt)}else if(D.contain==="outside"){const Ft=(-(at-G.parent.width)-G.parent.padding.left-G.parent.border.left-G.parent.border.right+ct)/v,At=(ct-G.parent.padding.left)/v;X.x=Math.max(Math.min(X.x,At),Ft);const Mt=(-(gt-G.parent.height)-G.parent.padding.top-G.parent.border.top-G.parent.border.bottom+mt)/v,Ht=(mt-G.parent.padding.top)/v;X.y=Math.max(Math.min(X.y,Ht),Mt)}}return D.roundPixels&&(X.x=Math.round(X.x),X.y=Math.round(X.y)),X}function u(O,z){const v={...t,...z},U={scale:l,opts:v};if(!z?.force&&v.disableZoom)return U;let D=t.minScale,X=t.maxScale;if(v.contain){const G=Ma(e),Z=G.elem.width/l,K=G.elem.height/l;if(Z>1&&K>1){const at=G.parent.width-G.parent.border.left-G.parent.border.right,gt=G.parent.height-G.parent.border.top-G.parent.border.bottom,ct=at/Z,mt=gt/K;t.contain==="inside"?X=Math.min(X,ct,mt):t.contain==="outside"&&(D=Math.max(D,ct,mt))}}return U.scale=Math.min(Math.max(O,D),X),U}function p(O,z,v,U){const D=f(O,z,l,v);return a!==D.x||n!==D.y?(a=D.x,n=D.y,d("panzoompan",D.opts,U)):{x:a,y:n,scale:l,isSVG:r,originalEvent:U}}function m(O,z,v){const U=u(O,z),D=U.opts;if(!z?.force&&D.disableZoom)return;O=U.scale;let X=a,G=n;if(D.focal){const K=D.focal;X=(K.x/O-K.x/l+a*O)/O,G=(K.y/O-K.y/l+n*O)/O}const Z=f(X,G,O,{relative:!1,force:!0});return a=Z.x,n=Z.y,l=O,d("panzoomzoom",D,v)}function y(O,z){const v={...t,animate:!0,...z};return m(l*Math.exp((O?1:-1)*v.step),v)}function x(O){return y(!0,O)}function C(O){return y(!1,O)}function k(O,z,v,U){const D=Ma(e),X={width:D.parent.width-D.parent.padding.left-D.parent.padding.right-D.parent.border.left-D.parent.border.right,height:D.parent.height-D.parent.padding.top-D.parent.padding.bottom-D.parent.border.top-D.parent.border.bottom};let G=z.clientX-D.parent.left-D.parent.padding.left-D.parent.border.left-D.elem.margin.left,Z=z.clientY-D.parent.top-D.parent.padding.top-D.parent.border.top-D.elem.margin.top;r||(G-=D.elem.width/l/2,Z-=D.elem.height/l/2);const K={x:G/X.width*(X.width*O),y:Z/X.height*(X.height*O)};return m(O,{...v,animate:!1,focal:K},U)}function S(O,z){O.preventDefault();const v={...t,...z,animate:!1},D=(O.deltaY===0&&O.deltaX?O.deltaX:O.deltaY)<0?1:-1,X=u(l*Math.exp(D*v.step/3),v).scale;return k(X,O,v,O)}function T(O){const z={...t,animate:!0,force:!0,...O};l=u(z.startScale,z).scale;const v=f(z.startX,z.startY,l,z);return a=v.x,n=v.y,d("panzoomreset",z)}let B,L,_,A,F,$;const H=[];function Y(O){if(_b(O.target,t))return;an(H,O),c=!0,t.handleStartEvent(O),B=a,L=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:O},t);const z=Qh(H);_=z.clientX,A=z.clientY,F=l,$=Ra(H)}function N(O){if(!c||B===void 0||L===void 0||_===void 0||A===void 0)return;an(H,O);const z=Qh(H),v=H.length>1;let U=l;if(v){$===0&&($=Ra(H));const D=Ra(H)-$;U=u(D*t.step/80+F).scale,k(U,z,{animate:!1},O)}(!v||t.pinchAndPan)&&p(B+(z.clientX-_)/U,L+(z.clientY-A)/U,{animate:!1},O)}function I(O){H.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:O},t),wb(H,O),c&&(c=!1,B=L=_=A=void 0)}let P=!1;function q(){P||(P=!0,$a("down",t.canvas?i:e,Y),$a("move",document,N,{passive:!0}),$a("up",document,I,{passive:!0}))}function R(){P=!1,Oa("down",t.canvas?i:e,Y),Oa("move",document,N),Oa("up",document,I)}return t.noBind||q(),{bind:q,destroy:R,eventNames:mo,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>Eb(t),handleDown:Y,handleMove:N,handleUp:I,pan:p,reset:T,resetStyle:o,setOptions:s,setStyle:(O,z)=>ri(e,O,z),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:k,zoomWithWheel:S}}Kd.defaultOptions=Vd;const Fb=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ab=Tt("arrow-down",Fb);const Mb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],$b=Tt("arrow-left",Mb);const Ob=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Rb=Tt("arrow-right",Ob);const Ib=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Pb=Tt("arrow-up",Ib);const Db=[["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"}]],Jh=Tt("refresh-cw",Db);const Nb=[["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"}]],qb=Tt("settings-2",Nb);const zb=[["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"}]],Zd=Tt("zoom-in",zb);const jb=[["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"}]],Qd=Tt("zoom-out",jb);var Jd=Object.defineProperty,g=(e,t)=>Jd(e,"name",{value:t,configurable:!0}),tu=(e,t)=>{for(var r in t)Jd(e,r,{get:t[r],enumerable:!0})},ts={exports:{}},Wb=ts.exports,tc;function Hb(){return tc||(tc=1,(function(e,t){(function(r,i){e.exports=i()})(Wb,(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",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 I=["th","st","nd","rd"],P=N%100;return"["+N+(I[(P-20)%10]||I[P]||I[0])+"]"}},k=function(N,I,P){var q=String(N);return!q||q.length>=I?N:""+Array(I+1-q.length).join(P)+N},S={s:k,z:function(N){var I=-N.utcOffset(),P=Math.abs(I),q=Math.floor(P/60),R=P%60;return(I<=0?"+":"-")+k(q,2,"0")+":"+k(R,2,"0")},m:function N(I,P){if(I.date()<P.date())return-N(P,I);var q=12*(P.year()-I.year())+(P.month()-I.month()),R=I.clone().add(q,d),O=P-R<0,z=I.clone().add(q+(O?-1:1),d);return+(-(q+(P-R)/(O?R-z:z-R))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:d,y:u,w:h,d:c,D:p,h:l,m:n,s:a,ms:s,Q:f}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},T="en",B={};B[T]=C;var L="$isDayjsObject",_=function(N){return N instanceof H||!(!N||!N[L])},A=function N(I,P,q){var R;if(!I)return T;if(typeof I=="string"){var O=I.toLowerCase();B[O]&&(R=O),P&&(B[O]=P,R=O);var z=I.split("-");if(!R&&z.length>1)return N(z[0])}else{var v=I.name;B[v]=I,R=v}return!q&&R&&(T=R),R||!q&&T},F=function(N,I){if(_(N))return N.clone();var P=typeof I=="object"?I:{};return P.date=N,P.args=arguments,new H(P)},$=S;$.l=A,$.i=_,$.w=function(N,I){return F(N,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var H=(function(){function N(P){this.$L=A(P.locale,null,!0),this.parse(P),this.$x=this.$x||P.x||{},this[L]=!0}var I=N.prototype;return I.parse=function(P){this.$d=(function(q){var R=q.date,O=q.utc;if(R===null)return new Date(NaN);if($.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var z=R.match(y);if(z){var v=z[2]-1||0,U=(z[7]||"0").substring(0,3);return O?new Date(Date.UTC(z[1],v,z[3]||1,z[4]||0,z[5]||0,z[6]||0,U)):new Date(z[1],v,z[3]||1,z[4]||0,z[5]||0,z[6]||0,U)}}return new Date(R)})(P),this.init()},I.init=function(){var P=this.$d;this.$y=P.getFullYear(),this.$M=P.getMonth(),this.$D=P.getDate(),this.$W=P.getDay(),this.$H=P.getHours(),this.$m=P.getMinutes(),this.$s=P.getSeconds(),this.$ms=P.getMilliseconds()},I.$utils=function(){return $},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(P,q){var R=F(P);return this.startOf(q)<=R&&R<=this.endOf(q)},I.isAfter=function(P,q){return F(P)<this.startOf(q)},I.isBefore=function(P,q){return this.endOf(q)<F(P)},I.$g=function(P,q,R){return $.u(P)?this[q]:this.set(R,P)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(P,q){var R=this,O=!!$.u(q)||q,z=$.p(P),v=function(gt,ct){var mt=$.w(R.$u?Date.UTC(R.$y,ct,gt):new Date(R.$y,ct,gt),R);return O?mt:mt.endOf(c)},U=function(gt,ct){return $.w(R.toDate()[gt].apply(R.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(ct)),R)},D=this.$W,X=this.$M,G=this.$D,Z="set"+(this.$u?"UTC":"");switch(z){case u:return O?v(1,0):v(31,11);case d:return O?v(1,X):v(0,X+1);case h:var K=this.$locale().weekStart||0,at=(D<K?D+7:D)-K;return v(O?G-at:G+(6-at),X);case c:case p:return U(Z+"Hours",0);case l:return U(Z+"Minutes",1);case n:return U(Z+"Seconds",2);case a:return U(Z+"Milliseconds",3);default:return this.clone()}},I.endOf=function(P){return this.startOf(P,!1)},I.$set=function(P,q){var R,O=$.p(P),z="set"+(this.$u?"UTC":""),v=(R={},R[c]=z+"Date",R[p]=z+"Date",R[d]=z+"Month",R[u]=z+"FullYear",R[l]=z+"Hours",R[n]=z+"Minutes",R[a]=z+"Seconds",R[s]=z+"Milliseconds",R)[O],U=O===c?this.$D+(q-this.$W):q;if(O===d||O===u){var D=this.clone().set(p,1);D.$d[v](U),D.init(),this.$d=D.set(p,Math.min(this.$D,D.daysInMonth())).$d}else v&&this.$d[v](U);return this.init(),this},I.set=function(P,q){return this.clone().$set(P,q)},I.get=function(P){return this[$.p(P)]()},I.add=function(P,q){var R,O=this;P=Number(P);var z=$.p(q),v=function(X){var G=F(O);return $.w(G.date(G.date()+Math.round(X*P)),O)};if(z===d)return this.set(d,this.$M+P);if(z===u)return this.set(u,this.$y+P);if(z===c)return v(1);if(z===h)return v(7);var U=(R={},R[n]=i,R[l]=o,R[a]=r,R)[z]||1,D=this.$d.getTime()+P*U;return $.w(D,this)},I.subtract=function(P,q){return this.add(-1*P,q)},I.format=function(P){var q=this,R=this.$locale();if(!this.isValid())return R.invalidDate||m;var O=P||"YYYY-MM-DDTHH:mm:ssZ",z=$.z(this),v=this.$H,U=this.$m,D=this.$M,X=R.weekdays,G=R.months,Z=R.meridiem,K=function(ct,mt,Ft,At){return ct&&(ct[mt]||ct(q,O))||Ft[mt].slice(0,At)},at=function(ct){return $.s(v%12||12,ct,"0")},gt=Z||function(ct,mt,Ft){var At=ct<12?"AM":"PM";return Ft?At.toLowerCase():At};return O.replace(x,(function(ct,mt){return mt||(function(Ft){switch(Ft){case"YY":return String(q.$y).slice(-2);case"YYYY":return $.s(q.$y,4,"0");case"M":return D+1;case"MM":return $.s(D+1,2,"0");case"MMM":return K(R.monthsShort,D,G,3);case"MMMM":return K(G,D);case"D":return q.$D;case"DD":return $.s(q.$D,2,"0");case"d":return String(q.$W);case"dd":return K(R.weekdaysMin,q.$W,X,2);case"ddd":return K(R.weekdaysShort,q.$W,X,3);case"dddd":return X[q.$W];case"H":return String(v);case"HH":return $.s(v,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return gt(v,U,!0);case"A":return gt(v,U,!1);case"m":return String(U);case"mm":return $.s(U,2,"0");case"s":return String(q.$s);case"ss":return $.s(q.$s,2,"0");case"SSS":return $.s(q.$ms,3,"0");case"Z":return z}return null})(ct)||z.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(P,q,R){var O,z=this,v=$.p(q),U=F(P),D=(U.utcOffset()-this.utcOffset())*i,X=this-U,G=function(){return $.m(z,U)};switch(v){case u:O=G()/12;break;case d:O=G();break;case f:O=G()/3;break;case h:O=(X-D)/6048e5;break;case c:O=(X-D)/864e5;break;case l:O=X/o;break;case n:O=X/i;break;case a:O=X/r;break;default:O=X}return R?O:$.a(O)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return B[this.$L]},I.locale=function(P,q){if(!P)return this.$L;var R=this.clone(),O=A(P,q,!0);return O&&(R.$L=O),R},I.clone=function(){return $.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},N})(),Y=H.prototype;return F.prototype=Y,[["$ms",s],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",u],["$D",p]].forEach((function(N){Y[N[1]]=function(I){return this.$g(I,N[0],N[1])}})),F.extend=function(N,I){return N.$i||(N(I,H,F),N.$i=!0),F},F.locale=A,F.isDayjs=_,F.unix=function(N){return F(1e3*N)},F.en=B[T],F.Ls=B,F.p={},F}))})(ts)),ts.exports}var Yb=Hb();const eu=Wd(Yb);var Ze={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")},yl=g(function(e="fatal"){let t=Ze.fatal;typeof e=="string"?e.toLowerCase()in Ze&&(t=Ze[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=Ze.fatal&&(V.fatal=console.error?console.error.bind(console,me("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",me("FATAL"))),t<=Ze.error&&(V.error=console.error?console.error.bind(console,me("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",me("ERROR"))),t<=Ze.warn&&(V.warn=console.warn?console.warn.bind(console,me("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",me("WARN"))),t<=Ze.info&&(V.info=console.info?console.info.bind(console,me("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",me("INFO"))),t<=Ze.debug&&(V.debug=console.debug?console.debug.bind(console,me("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("DEBUG"))),t<=Ze.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${eu().format("ss.SSS")} : ${e} : `,"format");const es={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 es.hue2rgb(s,o,e+1/3)*255;case"g":return es.hue2rgb(s,o,e)*255;case"b":return es.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}}},Ub={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},Xb={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},pt={channel:es,lang:Ub,unit:Xb},hr={};for(let e=0;e<=255;e++)hr[e]=pt.unit.dec2hex(e);const ee={ALL:0,RGB:1,HSL:2};class Gb{constructor(){this.type=ee.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=ee.ALL}is(t){return this.type===t}}class Vb{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Gb}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=ee.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(ee.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(ee.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(ee.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(ee.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(ee.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(ee.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(ee.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(ee.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(ee.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(ee.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(ee.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(ee.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Zs=new Vb({r:0,g:0,b:0,a:0},"transparent"),si={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(si.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 Zs.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?`#${hr[Math.round(t)]}${hr[Math.round(r)]}${hr[Math.round(i)]}${hr[Math.round(o*255)]}`:`#${hr[Math.round(t)]}${hr[Math.round(r)]}${hr[Math.round(i)]}`}},Ar={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(Ar.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(Ar.re);if(!r)return;const[,i,o,s,a,n]=r;return Zs.set({h:Ar._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)}%)`}},no={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=no.colors[e];if(t)return si.parse(t)},stringify:e=>{const t=si.stringify(e);for(const r in no.colors)if(no.colors[r]===t)return r}},Ji={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(Ji.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return Zs.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)})`}},Fe={format:{keyword:no,hex:si,rgb:Ji,rgba:Ji,hsl:Ar,hsla:Ar},parse:e=>{if(typeof e!="string")return e;const t=si.parse(e)||Ji.parse(e)||Ar.parse(e)||no.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(ee.HSL)||e.data.r===void 0?Ar.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Ji.stringify(e):si.stringify(e)},ru=(e,t)=>{const r=Fe.parse(e);for(const i in t)r[i]=pt.channel.clamp[i](t[i]);return Fe.stringify(r)},rr=(e,t,r=0,i=1)=>{if(typeof e!="number")return ru(e,{a:t});const o=Zs.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 Fe.stringify(o)},Kb=e=>{const{r:t,g:r,b:i}=Fe.parse(e),o=.2126*pt.channel.toLinear(t)+.7152*pt.channel.toLinear(r)+.0722*pt.channel.toLinear(i);return pt.lang.round(o)},Zb=e=>Kb(e)>=.5,ke=e=>!Zb(e),xl=(e,t,r)=>{const i=Fe.parse(e),o=i[t],s=pt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Fe.stringify(i)},j=(e,t)=>xl(e,"l",t),W=(e,t)=>xl(e,"l",-t),b=(e,t)=>{const r=Fe.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return ru(e,i)},Qb=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Fe.parse(e),{r:n,g:l,b:c,a:h}=Fe.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,k=s*m+c*y,S=a*d+h*(1-d);return rr(x,C,k,S)},M=(e,t=100)=>{const r=Fe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Qb(r,e,t)};var nn=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=>nn(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]=nn(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),jt=nn,He="#ffffff",Ye="#f2f2f2",ft=g((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),li,Jb=(li=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||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?W(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||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||j(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||W(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||W(this.mainBkg,10)):(this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||j(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]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(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)?j(this.quadrant1Fill):W(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?W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye,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(li,"Theme"),li),t1=g(e=>{const t=new Jb;return t.calculate(e),t},"getThemeVariables"),hi,e1=(hi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(M("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=rr(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=W("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=W(this.sectionBkgColor,10),this.taskBorderColor=rr(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=rr(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||j(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||W(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=j(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=j(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=j(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=M(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]||M(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||j(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)]??j(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)?j(this.quadrant1Fill):W(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?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=j(this.secondaryColor,20),this.git1=j(this.pie2||this.secondaryColor,20),this.git2=j(this.pie3||this.tertiaryColor,20),this.git3=j(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=j(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=j(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=j(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=j(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||j("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||j("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||j("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||j("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||j(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||j(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||j(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||j(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(hi,"Theme"),hi),r1=g(e=>{const t=new e1;return t.calculate(e),t},"getThemeVariables"),ci,i1=(ci=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=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ft(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=rr(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||W(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||W(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=W(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||W(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||M(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||M(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||j(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||j(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)?j(this.quadrant1Fill):W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||W(M(this.git0),25),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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(ci,"Theme"),ci),iu=g(e=>{const t=new i1;return t.calculate(e),t},"getThemeVariables"),di,o1=(di=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=j("#cde498",10),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.primaryColor),this.lineColor=M(this.background),this.textColor=M(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=W(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||W(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||W(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=W(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||W(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||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||j(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)?j(this.quadrant1Fill):W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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),s1=g(e=>{const t=new o1;return t.calculate(e),t},"getThemeVariables"),ui,a1=(ui=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=j(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(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||j(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=j(this.contrast,55),this.border2=this.contrast,this.actorBorder=j(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]||M(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||j(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||W(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=j(this.contrast,30),this.sectionBkgColor2=j(this.contrast,30),this.taskBorderColor=W(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=j(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=W(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)?j(this.quadrant1Fill):W(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=W(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||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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(ui,"Theme"),ui),n1=g(e=>{const t=new a1;return t.calculate(e),t},"getThemeVariables"),fi,l1=(fi=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=ft(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||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?W(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||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||j(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]=W(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=W(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||j(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||W(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)?j(this.quadrant1Fill):W(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?W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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),h1=g(e=>{const t=new l1;return t.calculate(e),t},"getThemeVariables"),pi,c1=(pi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(M("#323D47"),10),this.border1="#ccc",this.border2=rr(255,255,255,.25),this.arrowheadColor=M(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||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?W(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||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||j(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]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(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)?j(this.quadrant1Fill):W(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?W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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),d1=g(e=>{const t=new c1;return t.calculate(e),t},"getThemeVariables"),gi,u1=(gi=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=ft("#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||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?W(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||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||j(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]=W(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=W(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||j(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||W(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)?j(this.quadrant1Fill):W(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?W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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),f1=g(e=>{const t=new u1;return t.calculate(e),t},"getThemeVariables"),mi,p1=(mi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(M("#323D47"),10),this.border1="#ccc",this.border2=rr(255,255,255,.25),this.arrowheadColor=M(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||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?W(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||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||j(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]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(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)?j(this.quadrant1Fill):W(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?W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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),g1=g(e=>{const t=new p1;return t.calculate(e),t},"getThemeVariables"),yi,m1=(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=ft(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||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?W(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||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||j(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]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||j(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||W(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)?j(this.quadrant1Fill):W(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?W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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),y1=g(e=>{const t=new m1;return t.calculate(e),t},"getThemeVariables"),xi,x1=(xi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(M("#323D47"),10),this.border1="#ccc",this.border2=rr(255,255,255,.25),this.arrowheadColor=M(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||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?W(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||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||j(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]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=W(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)?j(this.quadrant1Fill):W(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?W(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=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||He,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye}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),C1=g(e=>{const t=new x1;return t.calculate(e),t},"getThemeVariables"),ir={base:{getThemeVariables:t1},dark:{getThemeVariables:r1},default:{getThemeVariables:iu},forest:{getThemeVariables:s1},neutral:{getThemeVariables:n1},neo:{getThemeVariables:h1},"neo-dark":{getThemeVariables:d1},redux:{getThemeVariables:f1},"redux-dark":{getThemeVariables:g1},"redux-color":{getThemeVariables:y1},"redux-dark-color":{getThemeVariables:C1}},Zt={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},ou={...Zt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:ir.default.getThemeVariables(),sequence:{...Zt.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:{...Zt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Zt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Zt.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:{...Zt.pie,useWidth:984},xyChart:{...Zt.xyChart,useWidth:void 0},requirement:{...Zt.requirement,useWidth:void 0},packet:{...Zt.packet},eventmodeling:{...Zt.eventmodeling},treeView:{...Zt.treeView,useWidth:void 0},radar:{...Zt.radar},railroad:{...Zt.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:{...Zt.ishikawa},sankey:{...Zt.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:{...Zt.venn},cynefin:{...Zt.cynefin}},su=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...su(e[i],"")]:[...r,t+i],[]),"keyify"),b1=new Set(su(ou,"")),Cl=ou,k1={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},w1=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"),ms=g(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>ms(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!b1.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=k1[t];i?w1(e[t],i):(V.debug("sanitizing object",t),ms(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=au(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"),au=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"),Si=Object.freeze(Cl),Ue=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ce=jt({},Si),ys,Dr=[],lo=jt({},Si),Qs=g((e,t)=>{let r=jt({},e),i={};for(const o of t)hu(o),i=jt(i,o);if(r=jt(r,i),i.theme&&i.theme in ir){const o=jt({},ys),s=jt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in ir&&(r.themeVariables=ir[r.theme].getThemeVariables(s))}return lo=r,du(lo),lo},"updateCurrentConfig"),S1=g(e=>(ce=jt({},Si),ce=jt(ce,e),e.theme&&ir[e.theme]&&(ce.themeVariables=ir[e.theme].getThemeVariables(e.themeVariables)),Qs(ce,Dr),ce),"setSiteConfig"),T1=g(e=>{ys=jt({},e)},"saveConfigFromInitialize"),v1=g(e=>(ce=jt(ce,e),Qs(ce,Dr),ce),"updateSiteConfig"),nu=g(()=>jt({},ce),"getSiteConfig"),lu=g(e=>(du(e),jt(lo,e),Ot()),"setConfig"),Ot=g(()=>jt({},lo),"getConfig"),hu=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"&&hu(e[t])}))},"sanitize"),_1=g(e=>{ms(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Dr.push(e),Qs(ce,Dr)},"addDirective"),xs=g((e=ce)=>{Dr=[],Qs(e,Dr)},"reset"),B1={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."},ec={},cu=g(e=>{ec[e]||(V.warn(B1[e]),ec[e]=!0)},"issueWarning"),du=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&cu("LAZY_LOAD_DEPRECATED")},"checkConfig"),L1=g(()=>{let e={};ys&&(e=jt(e,ys));for(const t of Dr)e=jt(e,t);return e},"getUserDefinedConfig"),ie=g(e=>(e.flowchart?.htmlLabels!=null&&cu("FLOWCHART_HTML_LABELS_DEPRECATED"),Ue(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),uu=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,ho=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,E1=/\s*%%.*\n/gm,Ci,fu=(Ci=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},g(Ci,"UnknownDiagramError"),Ci),Nr={},bl=g(function(e,t){e=e.replace(uu,"").replace(ho,"").replace(E1,`
8
+ `);for(const[r,{detector:i}]of Object.entries(Nr))if(i(e,t))return r;throw new fu(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),ln=g((...e)=>{for(const{id:t,detector:r,loader:i}of e)pu(t,r,i)},"registerLazyLoadedDiagrams"),pu=g((e,t,r)=>{Nr[e]&&V.warn(`Detector with key ${e} already exists. Overwriting.`),Nr[e]={detector:t,loader:r},V.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),F1=g(e=>Nr[e].loader,"getDiagramLoader"),Mi=/<br\s*\/?>/gi,A1=g(e=>e?yu(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),M1=(()=>{let e=!1;return()=>{e||(gu(),e=!0)}})();function gu(){const e="data-temp-href-target";wi.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),wi.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"))})}g(gu,"setupDompurifyHooks");var mu=g(e=>(M1(),wi.sanitize(e)),"removeScript"),rc=g((e,t)=>{if(ie(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=mu(e):r!=="loose"&&(e=yu(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=I1(e))}return e},"sanitizeMore"),Ce=g((e,t)=>e&&(t.dompurifyConfig?e=wi.sanitize(rc(e,t),t.dompurifyConfig).toString():e=wi.sanitize(rc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),$1=g((e,t)=>typeof e=="string"?Ce(e,t):e.flat().map(r=>Ce(r,t)),"sanitizeTextOrArray"),O1=g(e=>Mi.test(e),"hasBreaks"),R1=g(e=>e.split(Mi),"splitBreaks"),I1=g(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),yu=g(e=>e.replace(Mi,"#br#"),"breakToPlaceholder"),xu=g(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),P1=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),D1=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),hn=g(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];N1(s,a)&&(o=s+","+a,i++,r.pop())}r.push(q1(o))}return r.join("")},"parseGenericTypes"),cn=g((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),N1=g((e,t)=>{const r=cn(e,"~"),i=cn(t,"~");return r===1&&i===1},"shouldCombineSets"),q1=g(e=>{const t=cn(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"),ic=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),dn=/\$\$(.*?)\$\$/g,Ti=g(e=>(e.match(dn)?.length??0)>0,"hasKatex"),z1=g(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await kl(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"),j1=g(async(e,t)=>{if(!Ti(e))return e;if(!(ic()||t.legacyMathML||t.forceLegacyMathML))return e.replace(dn,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!ic()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Mi).map(o=>Ti(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(dn,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),kl=g(async(e,t)=>Ce(await j1(e,t),t),"renderKatexSanitized"),$i={getRows:A1,sanitizeText:Ce,sanitizeTextOrArray:$1,hasBreaks:O1,splitBreaks:R1,lineBreakRegex:Mi,removeScript:mu,getUrl:xu,evaluate:Ue,getMax:P1,getMin:D1},W1=g(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),H1=g(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"),wl=g(function(e,t,r,i){const o=H1(t,r,i);W1(e,o)},"configureSvgSize"),Cu=g(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}`),wl(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"),rs={};function un(e){return[...e.cssRules].map(t=>t.cssText).join(`
9
+ `)}g(un,"cssStyleSheetToString");var Y1=g((e,t,r,i)=>{let o="";return e in rs&&rs[e]?o=rs[e]({...r,svgId:i}):V.warn(`No theme found for ${e}`),` & {
10
+ font-family: ${r.fontFamily};
11
+ font-size: ${r.fontSize};
12
+ fill: ${r.textColor}
13
+ }
14
+ @keyframes edge-animation-frame {
15
+ from {
16
+ stroke-dashoffset: 0;
17
+ }
18
+ }
19
+ @keyframes dash {
20
+ to {
21
+ stroke-dashoffset: 0;
22
+ }
23
+ }
24
+ & .edge-animation-slow {
25
+ stroke-dasharray: 9,5 !important;
26
+ stroke-dashoffset: 900;
27
+ animation: dash 50s linear infinite;
28
+ stroke-linecap: round;
29
+ }
30
+ & .edge-animation-fast {
31
+ stroke-dasharray: 9,5 !important;
32
+ stroke-dashoffset: 900;
33
+ animation: dash 20s linear infinite;
34
+ stroke-linecap: round;
35
+ }
36
+ /* Classes common for multiple diagrams */
37
+
38
+ & .error-icon {
39
+ fill: ${r.errorBkgColor};
40
+ }
41
+ & .error-text {
42
+ fill: ${r.errorTextColor};
43
+ stroke: ${r.errorTextColor};
44
+ }
45
+
46
+ & .edge-thickness-normal {
47
+ stroke-width: ${r.strokeWidth??1}px;
48
+ }
49
+ & .edge-thickness-thick {
50
+ stroke-width: 3.5px
51
+ }
52
+ & .edge-pattern-solid {
53
+ stroke-dasharray: 0;
54
+ }
55
+ & .edge-thickness-invisible {
56
+ stroke-width: 0;
57
+ fill: none;
58
+ }
59
+ & .edge-pattern-dashed{
60
+ stroke-dasharray: 3;
61
+ }
62
+ .edge-pattern-dotted {
63
+ stroke-dasharray: 2;
64
+ }
65
+
66
+ & .marker {
67
+ fill: ${r.lineColor};
68
+ stroke: ${r.lineColor};
69
+ }
70
+ & .marker.cross {
71
+ stroke: ${r.lineColor};
72
+ }
73
+
74
+ & svg {
75
+ font-family: ${r.fontFamily};
76
+ font-size: ${r.fontSize};
77
+ }
78
+ & p {
79
+ margin: 0
80
+ }
81
+
82
+ ${o}
83
+ .node .neo-node {
84
+ stroke: ${r.nodeBorder};
85
+ }
86
+
87
+ [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
88
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
89
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
90
+ }
91
+ [data-look="neo"].swimlane.cluster rect {
92
+ filter: none;
93
+ }
94
+
95
+
96
+ [data-look="neo"].node path {
97
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
98
+ stroke-width: ${r.strokeWidth??1}px;
99
+ }
100
+
101
+ [data-look="neo"].node .outer-path {
102
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
103
+ }
104
+
105
+ [data-look="neo"].node .neo-line path {
106
+ stroke: ${r.nodeBorder};
107
+ filter: none;
108
+ }
109
+
110
+ [data-look="neo"].node circle{
111
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
112
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
113
+ }
114
+
115
+ [data-look="neo"].node circle .state-start{
116
+ fill: #000000;
117
+ }
118
+
119
+ [data-look="neo"].icon-shape .icon {
120
+ fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
121
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
122
+ }
123
+
124
+ [data-look="neo"].icon-shape .icon-neo path {
125
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
126
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
127
+ }
128
+
129
+ ${t}
130
+ `},"getStyles"),U1=g((e,t)=>{t!==void 0&&(rs[e]=t)},"addStylesForDiagram"),X1=Y1,Sl={};tu(Sl,{clear:()=>bu,getAccDescription:()=>Tu,getAccTitle:()=>wu,getDiagramTitle:()=>_u,setAccDescription:()=>Su,setAccTitle:()=>ku,setDiagramTitle:()=>vu});var Tl="",vl="",_l="",Bl=g(e=>Ce(e,Ot()),"sanitizeText"),bu=g(()=>{Tl="",_l="",vl=""},"clear"),ku=g(e=>{Tl=Bl(e).replace(/^\s+/g,"")},"setAccTitle"),wu=g(()=>Tl,"getAccTitle"),Su=g(e=>{_l=Bl(e).replace(/\n\s+/g,`
131
+ `)},"setAccDescription"),Tu=g(()=>_l,"getAccDescription"),vu=g(e=>{vl=Bl(e)},"setDiagramTitle"),_u=g(()=>vl,"getDiagramTitle"),oc=V,G1=yl,kt=Ot,V1=lu,K1=Si,Ll=g(e=>Ce(e,kt()),"sanitizeText"),Bu=Cu,Z1=g(()=>Sl,"getCommonDb"),Cs={},bs=g((e,t,r)=>{Cs[e]&&oc.warn(`Diagram with id ${e} already registered. Overwriting.`),Cs[e]=t,r&&pu(e,r),U1(e,t.styles),t.injectUtils?.(oc,G1,kt,Ll,Bu,Z1(),()=>{})},"registerDiagram"),fn=g(e=>{if(e in Cs)return Cs[e];throw new Q1(e)},"getDiagram"),bi,Q1=(bi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},g(bi,"DiagramNotFoundError"),bi),J1={value:()=>{}};function Lu(){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 is(r)}function is(e){this._=e}function tk(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}})}is.prototype=Lu.prototype={constructor:is,on:function(e,t){var r=this._,i=tk(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=ek(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]=sc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=sc(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 is(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 ek(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function sc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=J1,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var pn="http://www.w3.org/1999/xhtml";const ac={svg:"http://www.w3.org/2000/svg",xhtml:pn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Js(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),ac.hasOwnProperty(t)?{space:ac[t],local:e}:e}function rk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===pn&&t.documentElement.namespaceURI===pn?t.createElement(e):t.createElementNS(r,e)}}function ik(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Eu(e){var t=Js(e);return(t.local?ik:rk)(t)}function ok(){}function El(e){return e==null?ok:function(){return this.querySelector(e)}}function sk(e){typeof e!="function"&&(e=El(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 ak(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function nk(){return[]}function Fu(e){return e==null?nk:function(){return this.querySelectorAll(e)}}function lk(e){return function(){return ak(e.apply(this,arguments))}}function hk(e){typeof e=="function"?e=lk(e):e=Fu(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 Au(e){return function(){return this.matches(e)}}function Mu(e){return function(t){return t.matches(e)}}var ck=Array.prototype.find;function dk(e){return function(){return ck.call(this.children,e)}}function uk(){return this.firstElementChild}function fk(e){return this.select(e==null?uk:dk(typeof e=="function"?e:Mu(e)))}var pk=Array.prototype.filter;function gk(){return Array.from(this.children)}function mk(e){return function(){return pk.call(this.children,e)}}function yk(e){return this.selectAll(e==null?gk:mk(typeof e=="function"?e:Mu(e)))}function xk(e){typeof e!="function"&&(e=Au(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 $u(e){return new Array(e.length)}function Ck(){return new pe(this._enter||this._groups.map($u),this._parents)}function ks(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ks.prototype={constructor:ks,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 bk(e){return function(){return e}}function kk(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 ks(e,s[a]);for(;a<l;++a)(n=t[a])&&(o[a]=n)}function wk(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 ks(e,s[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(f[n])===l&&(o[n]=l)}function Sk(e){return e.__data__}function Tk(e,t){if(!arguments.length)return Array.from(this,Sk);var r=t?wk:kk,i=this._parents,o=this._groups;typeof e!="function"&&(e=bk(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=vk(e.call(h,h&&h.__data__,c,i)),p=u.length,m=n[c]=new Array(p),y=a[c]=new Array(p),x=l[c]=new Array(f);r(h,d,m,y,x,u,t);for(var C=0,k=0,S,T;C<p;++C)if(S=m[C]){for(C>=k&&(k=C+1);!(T=y[k])&&++k<p;);S._next=T||null}}return a=new pe(a,i),a._enter=n,a._exit=l,a}function vk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _k(){return new pe(this._exit||this._groups.map($u),this._parents)}function Bk(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 Lk(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,p=0;p<d;++p)(u=c[p]||h[p])&&(f[p]=u);for(;l<o;++l)n[l]=r[l];return new pe(n,this._parents)}function Ek(){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 Fk(e){e||(e=Ak);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 pe(o,this._parents).order()}function Ak(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Mk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $k(){return Array.from(this)}function Ok(){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 Rk(){let e=0;for(const t of this)++e;return e}function Ik(){return!this.node()}function Pk(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 Dk(e){return function(){this.removeAttribute(e)}}function Nk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qk(e,t){return function(){this.setAttribute(e,t)}}function zk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function jk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Wk(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 Hk(e,t){var r=Js(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?Nk:Dk:typeof t=="function"?r.local?Wk:jk:r.local?zk:qk)(r,t))}function Ou(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Yk(e){return function(){this.style.removeProperty(e)}}function Uk(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Xk(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Gk(e,t,r){return arguments.length>1?this.each((t==null?Yk:typeof t=="function"?Xk:Uk)(e,t,r??"")):vi(this.node(),e)}function vi(e,t){return e.style.getPropertyValue(t)||Ou(e).getComputedStyle(e,null).getPropertyValue(t)}function Vk(e){return function(){delete this[e]}}function Kk(e,t){return function(){this[e]=t}}function Zk(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Qk(e,t){return arguments.length>1?this.each((t==null?Vk:typeof t=="function"?Zk:Kk)(e,t)):this.node()[e]}function Ru(e){return e.trim().split(/^|\s+/)}function Fl(e){return e.classList||new Iu(e)}function Iu(e){this._node=e,this._names=Ru(e.getAttribute("class")||"")}Iu.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 Pu(e,t){for(var r=Fl(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function Du(e,t){for(var r=Fl(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function Jk(e){return function(){Pu(this,e)}}function t2(e){return function(){Du(this,e)}}function e2(e,t){return function(){(t.apply(this,arguments)?Pu:Du)(this,e)}}function r2(e,t){var r=Ru(e+"");if(arguments.length<2){for(var i=Fl(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?e2:t?Jk:t2)(r,t))}function i2(){this.textContent=""}function o2(e){return function(){this.textContent=e}}function s2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function a2(e){return arguments.length?this.each(e==null?i2:(typeof e=="function"?s2:o2)(e)):this.node().textContent}function n2(){this.innerHTML=""}function l2(e){return function(){this.innerHTML=e}}function h2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function c2(e){return arguments.length?this.each(e==null?n2:(typeof e=="function"?h2:l2)(e)):this.node().innerHTML}function d2(){this.nextSibling&&this.parentNode.appendChild(this)}function u2(){return this.each(d2)}function f2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function p2(){return this.each(f2)}function g2(e){var t=typeof e=="function"?e:Eu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function m2(){return null}function y2(e,t){var r=typeof e=="function"?e:Eu(e),i=t==null?m2:typeof t=="function"?t:El(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function x2(){var e=this.parentNode;e&&e.removeChild(this)}function C2(){return this.each(x2)}function b2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function k2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function w2(e){return this.select(e?k2:b2)}function S2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function T2(e){return function(t){e.call(this,t,this.__data__)}}function v2(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 _2(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 B2(e,t,r){return function(){var i=this.__on,o,s=T2(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 L2(e,t,r){var i=v2(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?B2:_2,o=0;o<s;++o)this.each(n(i[o],t,r));return this}function Nu(e,t,r){var i=Ou(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 E2(e,t){return function(){return Nu(this,e,t)}}function F2(e,t){return function(){return Nu(this,e,t.apply(this,arguments))}}function A2(e,t){return this.each((typeof t=="function"?F2:E2)(e,t))}function*M2(){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 pe(e,t){this._groups=e,this._parents=t}function Fo(){return new pe([[document.documentElement]],qu)}function $2(){return this}pe.prototype=Fo.prototype={constructor:pe,select:sk,selectAll:hk,selectChild:fk,selectChildren:yk,filter:xk,data:Tk,enter:Ck,exit:_k,join:Bk,merge:Lk,selection:$2,order:Ek,sort:Fk,call:Mk,nodes:$k,node:Ok,size:Rk,empty:Ik,each:Pk,attr:Hk,style:Gk,property:Qk,classed:r2,text:a2,html:c2,raise:u2,lower:p2,append:g2,insert:y2,remove:C2,clone:w2,datum:S2,on:L2,dispatch:A2,[Symbol.iterator]:M2};function yt(e){return typeof e=="string"?new pe([[document.querySelector(e)]],[document.documentElement]):new pe([[e]],qu)}function ta(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Al(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Oi(){}var yo=.7,ws=1/yo,ai="\\s*([+-]?\\d+)\\s*",xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",O2=/^#([0-9a-f]{3,8})$/,R2=new RegExp(`^rgb\\(${ai},${ai},${ai}\\)$`),I2=new RegExp(`^rgb\\(${ze},${ze},${ze}\\)$`),P2=new RegExp(`^rgba\\(${ai},${ai},${ai},${xo}\\)$`),D2=new RegExp(`^rgba\\(${ze},${ze},${ze},${xo}\\)$`),N2=new RegExp(`^hsl\\(${xo},${ze},${ze}\\)$`),q2=new RegExp(`^hsla\\(${xo},${ze},${ze},${xo}\\)$`),nc={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};ta(Oi,_i,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lc,formatHex:lc,formatHex8:z2,formatHsl:j2,formatRgb:hc,toString:hc});function lc(){return this.rgb().formatHex()}function z2(){return this.rgb().formatHex8()}function j2(){return ju(this).formatHsl()}function hc(){return this.rgb().formatRgb()}function _i(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=O2.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?cc(t):r===3?new ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?zo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?zo(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=R2.exec(e))?new ae(t[1],t[2],t[3],1):(t=I2.exec(e))?new ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=P2.exec(e))?zo(t[1],t[2],t[3],t[4]):(t=D2.exec(e))?zo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=N2.exec(e))?fc(t[1],t[2]/100,t[3]/100,1):(t=q2.exec(e))?fc(t[1],t[2]/100,t[3]/100,t[4]):nc.hasOwnProperty(e)?cc(nc[e]):e==="transparent"?new ae(NaN,NaN,NaN,0):null}function cc(e){return new ae(e>>16&255,e>>8&255,e&255,1)}function zo(e,t,r,i){return i<=0&&(e=t=r=NaN),new ae(e,t,r,i)}function zu(e){return e instanceof Oi||(e=_i(e)),e?(e=e.rgb(),new ae(e.r,e.g,e.b,e.opacity)):new ae}function gn(e,t,r,i){return arguments.length===1?zu(e):new ae(e,t,r,i??1)}function ae(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}ta(ae,gn,Al(Oi,{brighter(e){return e=e==null?ws:Math.pow(ws,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?yo:Math.pow(yo,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ae(Rr(this.r),Rr(this.g),Rr(this.b),Ss(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:dc,formatHex:dc,formatHex8:W2,formatRgb:uc,toString:uc}));function dc(){return`#${Mr(this.r)}${Mr(this.g)}${Mr(this.b)}`}function W2(){return`#${Mr(this.r)}${Mr(this.g)}${Mr(this.b)}${Mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function uc(){const e=Ss(this.opacity);return`${e===1?"rgb(":"rgba("}${Rr(this.r)}, ${Rr(this.g)}, ${Rr(this.b)}${e===1?")":`, ${e})`}`}function Ss(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mr(e){return e=Rr(e),(e<16?"0":"")+e.toString(16)}function fc(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Be(e,t,r,i)}function ju(e){if(e instanceof Be)return new Be(e.h,e.s,e.l,e.opacity);if(e instanceof Oi||(e=_i(e)),!e)return new Be;if(e instanceof Be)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 Be(a,n,l,e.opacity)}function H2(e,t,r,i){return arguments.length===1?ju(e):new Be(e,t,r,i??1)}function Be(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}ta(Be,H2,Al(Oi,{brighter(e){return e=e==null?ws:Math.pow(ws,e),new Be(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?yo:Math.pow(yo,e),new Be(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 ae(Ia(e>=240?e-240:e+120,o,i),Ia(e,o,i),Ia(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Be(pc(this.h),jo(this.s),jo(this.l),Ss(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=Ss(this.opacity);return`${e===1?"hsl(":"hsla("}${pc(this.h)}, ${jo(this.s)*100}%, ${jo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function pc(e){return e=(e||0)%360,e<0?e+360:e}function jo(e){return Math.max(0,Math.min(1,e||0))}function Ia(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 ea=e=>()=>e;function Wu(e,t){return function(r){return e+r*t}}function Y2(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 U2(e,t){var r=t-e;return r?Wu(e,r>180||r<-180?r-360*Math.round(r/360):r):ea(isNaN(e)?t:e)}function X2(e){return(e=+e)==1?Ml:function(t,r){return r-t?Y2(t,r,e):ea(isNaN(t)?r:t)}}function Ml(e,t){var r=t-e;return r?Wu(e,r):ea(isNaN(e)?t:e)}const mn=(function e(t){var r=X2(t);function i(o,s){var a=r((o=gn(o)).r,(s=gn(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=Ml(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 er(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var yn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pa=new RegExp(yn.source,"g");function G2(e){return function(){return e}}function V2(e){return function(t){return e(t)+""}}function Hu(e,t){var r=yn.lastIndex=Pa.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=yn.exec(e))&&(o=Pa.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:er(i,o)})),r=Pa.lastIndex;return r<t.length&&(s=t.slice(r),n[a]?n[a]+=s:n[++a]=s),n.length<2?l[0]?V2(l[0].x):G2(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 gc=180/Math.PI,xn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yu(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)*gc,skewX:Math.atan(l)*gc,scaleX:a,scaleY:n}}var Wo;function K2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?xn:Yu(t.a,t.b,t.c,t.d,t.e,t.f)}function Z2(e){return e==null||(Wo||(Wo=document.createElementNS("http://www.w3.org/2000/svg","g")),Wo.setAttribute("transform",e),!(e=Wo.transform.baseVal.consolidate()))?xn:(e=e.matrix,Yu(e.a,e.b,e.c,e.d,e.e,e.f))}function Uu(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function s(c,h,d,f,u,p){if(c!==d||h!==f){var m=u.push("translate(",null,t,null,r);p.push({i:m-4,x:er(c,d)},{i:m-2,x:er(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:er(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:er(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,f,u,p){if(c!==d||h!==f){var m=u.push(o(u)+"scale(",null,",",null,")");p.push({i:m-4,x:er(c,d)},{i:m-2,x:er(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 p=-1,m=f.length,y;++p<m;)d[(y=f[p]).i]=y.x(u);return d.join("")}}}var Q2=Uu(K2,"px, ","px)","deg)"),J2=Uu(Z2,", ",")",")"),Bi=0,to=0,Yi=0,Xu=1e3,Ts,eo,vs=0,qr=0,ra=0,Co=typeof performance=="object"&&performance.now?performance:Date,Gu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $l(){return qr||(Gu(tw),qr=Co.now()+ra)}function tw(){qr=0}function _s(){this._call=this._time=this._next=null}_s.prototype=Vu.prototype={constructor:_s,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?$l():+r)+(t==null?0:+t),!this._next&&eo!==this&&(eo?eo._next=this:Ts=this,eo=this),this._call=e,this._time=r,Cn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cn())}};function Vu(e,t,r){var i=new _s;return i.restart(e,t,r),i}function ew(){$l(),++Bi;for(var e=Ts,t;e;)(t=qr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Bi}function mc(){qr=(vs=Co.now())+ra,Bi=to=0;try{ew()}finally{Bi=0,iw(),qr=0}}function rw(){var e=Co.now(),t=e-vs;t>Xu&&(ra-=t,vs=e)}function iw(){for(var e,t=Ts,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:Ts=r);eo=e,Cn(i)}function Cn(e){if(!Bi){to&&(to=clearTimeout(to));var t=e-qr;t>24?(e<1/0&&(to=setTimeout(mc,e-Co.now()-ra)),Yi&&(Yi=clearInterval(Yi))):(Yi||(vs=Co.now(),Yi=setInterval(rw,Xu)),Bi=1,Gu(mc))}}function yc(e,t,r){var i=new _s;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var ow=Lu("start","end","cancel","interrupt"),sw=[],Ku=0,xc=1,bn=2,os=3,Cc=4,kn=5,ss=6;function ia(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;aw(e,r,{name:t,index:i,group:o,on:ow,tween:sw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Ku})}function Ol(e,t){var r=Ae(e,t);if(r.state>Ku)throw new Error("too late; already scheduled");return r}function Xe(e,t){var r=Ae(e,t);if(r.state>os)throw new Error("too late; already running");return r}function Ae(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function aw(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=Vu(s,0,r.time);function s(c){r.state=xc,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!==xc)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===os)return yc(a);u.state===Cc?(u.state=ss,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+h<t&&(u.state=ss,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete i[h])}if(yc(function(){r.state===os&&(r.state=Cc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=bn,r.on.call("start",e,e.__data__,r.index,r.group),r.state===bn){for(r.state=os,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=kn,1),d=-1,f=o.length;++d<f;)o[d].call(e,h);r.state===kn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=ss,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function nw(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>bn&&i.state<kn,i.state=ss,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function lw(e){return this.each(function(){nw(this,e)})}function hw(e,t){var r,i;return function(){var o=Xe(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 cw(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=Xe(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 dw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=Ae(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?hw:cw)(r,e,t))}function Rl(e,t,r){var i=e._id;return e.each(function(){var o=Xe(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return Ae(o,i).value[t]}}function Zu(e,t){var r;return(typeof t=="number"?er:t instanceof _i?mn:(r=_i(t))?(t=r,mn):Hu)(e,t)}function uw(e){return function(){this.removeAttribute(e)}}function fw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pw(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 gw(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 yw(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 xw(e,t){var r=Js(e),i=r==="transform"?J2:Zu;return this.attrTween(e,typeof t=="function"?(r.local?yw:mw)(r,i,Rl(this,"attr."+e,t)):t==null?(r.local?fw:uw)(r):(r.local?gw:pw)(r,i,t))}function Cw(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function bw(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function kw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&bw(e,s)),r}return o._value=t,o}function ww(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Cw(e,s)),r}return o._value=t,o}function Sw(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=Js(e);return this.tween(r,(i.local?kw:ww)(i,t))}function Tw(e,t){return function(){Ol(this,e).delay=+t.apply(this,arguments)}}function vw(e,t){return t=+t,function(){Ol(this,e).delay=t}}function _w(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Tw:vw)(t,e)):Ae(this.node(),t).delay}function Bw(e,t){return function(){Xe(this,e).duration=+t.apply(this,arguments)}}function Lw(e,t){return t=+t,function(){Xe(this,e).duration=t}}function Ew(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Bw:Lw)(t,e)):Ae(this.node(),t).duration}function Fw(e,t){if(typeof t!="function")throw new Error;return function(){Xe(this,e).ease=t}}function Aw(e){var t=this._id;return arguments.length?this.each(Fw(t,e)):Ae(this.node(),t).ease}function Mw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Xe(this,e).ease=r}}function $w(e){if(typeof e!="function")throw new Error;return this.each(Mw(this._id,e))}function Ow(e){typeof e!="function"&&(e=Au(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 sr(i,this._parents,this._name,this._id)}function Rw(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 sr(a,this._parents,this._name,this._id)}function Iw(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 Pw(e,t,r){var i,o,s=Iw(t)?Ol:Xe;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function Dw(e,t){var r=this._id;return arguments.length<2?Ae(this.node(),r).on.on(e):this.each(Pw(r,e,t))}function Nw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function qw(){return this.on("end.remove",Nw(this._id))}function zw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=El(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,ia(c[f],t,r,f,c,Ae(h,r)));return new sr(s,this._parents,t,r)}function jw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Fu(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,p=Ae(h,r),m=0,y=f.length;m<y;++m)(u=f[m])&&ia(u,t,r,m,f,p);s.push(f),a.push(h)}return new sr(s,a,t,r)}var Ww=Fo.prototype.constructor;function Hw(){return new Ww(this._groups,this._parents)}function Yw(e,t){var r,i,o;return function(){var s=vi(this,e),a=(this.style.removeProperty(e),vi(this,e));return s===a?null:s===r&&a===i?o:o=t(r=s,i=a)}}function Qu(e){return function(){this.style.removeProperty(e)}}function Uw(e,t,r){var i,o=r+"",s;return function(){var a=vi(this,e);return a===o?null:a===i?s:s=t(i=a,r)}}function Xw(e,t,r){var i,o,s;return function(){var a=vi(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),vi(this,e))),a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n))}}function Gw(e,t){var r,i,o,s="style."+t,a="end."+s,n;return function(){var l=Xe(this,e),c=l.on,h=l.value[s]==null?n||(n=Qu(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function Vw(e,t,r){var i=(e+="")=="transform"?Q2:Zu;return t==null?this.styleTween(e,Yw(e,i)).on("end.style."+e,Qu(e)):typeof t=="function"?this.styleTween(e,Xw(e,i,Rl(this,"style."+e,t))).each(Gw(this._id,e)):this.styleTween(e,Uw(e,i,t),r).on("end.style."+e,null)}function Kw(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function Zw(e,t,r){var i,o;function s(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&Kw(e,a,r)),i}return s._value=t,s}function Qw(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,Zw(e,t,r??""))}function Jw(e){return function(){this.textContent=e}}function tS(e){return function(){var t=e(this);this.textContent=t??""}}function eS(e){return this.tween("text",typeof e=="function"?tS(Rl(this,"text",e)):Jw(e==null?"":e+""))}function rS(e){return function(t){this.textContent=e.call(this,t)}}function iS(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&rS(o)),t}return i._value=e,i}function oS(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,iS(e))}function sS(){for(var e=this._name,t=this._id,r=Ju(),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=Ae(l,t);ia(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new sr(i,this._parents,e,r)}function aS(){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=Xe(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 nS=0;function sr(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function Ju(){return++nS}var Qe=Fo.prototype;sr.prototype={constructor:sr,select:zw,selectAll:jw,selectChild:Qe.selectChild,selectChildren:Qe.selectChildren,filter:Ow,merge:Rw,selection:Hw,transition:sS,call:Qe.call,nodes:Qe.nodes,node:Qe.node,size:Qe.size,empty:Qe.empty,each:Qe.each,on:Dw,attr:xw,attrTween:Sw,style:Vw,styleTween:Qw,text:eS,textTween:oS,remove:qw,tween:dw,delay:_w,duration:Ew,ease:Aw,easeVarying:$w,end:aS,[Symbol.iterator]:Qe[Symbol.iterator]};function lS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hS={time:null,delay:0,duration:250,ease:lS};function cS(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 dS(e){var t,r;e instanceof sr?(t=e._id,e=e._name):(t=Ju(),(r=hS).time=$l(),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])&&ia(l,e,t,c,a,r||cS(l,t));return new sr(i,this._parents,e,t)}Fo.prototype.interrupt=lw;Fo.prototype.transition=dS;const wn=Math.PI,Sn=2*wn,Br=1e-6,uS=Sn-Br;function tf(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function fS(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return tf;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 pS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?tf:fS(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>Br)if(!(Math.abs(d*l-c*h)>Br)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,p=o-n,m=l*l+c*c,y=u*u+p*p,x=Math.sqrt(m),C=Math.sqrt(f),k=s*Math.tan((wn-Math.acos((m+f-y)/(2*x*C)))/2),S=k/C,T=k/x;Math.abs(S-1)>Br&&this._append`L${t+S*h},${r+S*d}`,this._append`A${s},${s},0,0,${+(d*u>h*p)},${this._x1=t+T*l},${this._y1=r+T*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)>Br||Math.abs(this._y1-h)>Br)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%Sn+Sn),f>uS?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>Br&&this._append`A${i},${i},0,${+(f>=wn)},${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 Lr(e){return function(){return e}}const gS=Math.abs,mS=Math.atan2,yS=Math.cos,xS=Math.max,CS=Math.min,bS=Math.sin,kS=Math.sqrt,Tn=1e-12,oa=Math.PI,vn=oa/2,wS=2*oa;function SS(e){return e>1?0:e<-1?oa:Math.acos(e)}function TS(e){return e>=1?vn:e<=-1?-vn:Math.asin(e)}function ef(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 pS(t)}function rf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function of(e){this._context=e}of.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 co(e){return new of(e)}function vS(e){return e[0]}function _S(e){return e[1]}function sf(e,t){var r=Lr(!0),i=null,o=co,s=null,a=ef(n);e=typeof e=="function"?e:e===void 0?vS:Lr(e),t=typeof t=="function"?t:t===void 0?_S:Lr(t);function n(l){var c,h=(l=rf(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:Lr(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:Lr(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Lr(!!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 af{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 nf(e){return new af(e,!0)}function lf(e){return new af(e,!1)}function pr(){}function Bs(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 sa(e){this._context=e}sa.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:Bs(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:Bs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ls(e){return new sa(e)}function hf(e){this._context=e}hf.prototype={areaStart:pr,areaEnd:pr,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:Bs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BS(e){return new hf(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:Bs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function LS(e){return new cf(e)}function df(e,t){this._basis=new sa(e),this._beta=t}df.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 ES=(function e(t){function r(i){return t===1?new sa(i):new df(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function Es(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 Il(e,t){this._context=e,this._k=(1-t)/6}Il.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:Es(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:Es(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 uf=(function e(t){function r(i){return new Il(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Pl(e,t){this._context=e,this._k=(1-t)/6}Pl.prototype={areaStart:pr,areaEnd:pr,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:Es(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 FS=(function e(t){function r(i){return new Pl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Dl(e,t){this._context=e,this._k=(1-t)/6}Dl.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:Es(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 AS=(function e(t){function r(i){return new Dl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Nl(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Tn){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>Tn){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 ff(e,t){this._context=e,this._alpha=t}ff.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:Nl(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 pf=(function e(t){function r(i){return t?new ff(i,t):new Il(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function gf(e,t){this._context=e,this._alpha=t}gf.prototype={areaStart:pr,areaEnd:pr,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:Nl(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 MS=(function e(t){function r(i){return t?new gf(i,t):new Pl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function mf(e,t){this._context=e,this._alpha=t}mf.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:Nl(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 $S=(function e(t){function r(i){return t?new mf(i,t):new Dl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function yf(e){this._context=e}yf.prototype={areaStart:pr,areaEnd:pr,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 OS(e){return new yf(e)}function bc(e){return e<0?-1:1}function kc(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(bc(s)+bc(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function wc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Da(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 Fs(e){this._context=e}Fs.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:Da(this,this._t0,wc(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,Da(this,wc(this,r=kc(this,e,t)),r);break;default:Da(this,this._t0,r=kc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function xf(e){this._context=new Cf(e)}(xf.prototype=Object.create(Fs.prototype)).point=function(e,t){Fs.prototype.point.call(this,t,e)};function Cf(e){this._context=e}Cf.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 bf(e){return new Fs(e)}function kf(e){return new xf(e)}function wf(e){this._context=e}wf.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=Sc(e),o=Sc(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 Sc(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 Sf(e){return new wf(e)}function aa(e,t){this._context=e,this._t=t}aa.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 Tf(e){return new aa(e,.5)}function vf(e){return new aa(e,0)}function _f(e){return new aa(e,1)}function ro(e,t,r){this.k=e,this.x=t,this.y=r}ro.prototype={constructor:ro,scale:function(e){return e===1?this:new ro(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ro(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+")"}};ro.prototype;var Bf=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 ql(e){return typeof e>"u"||e===null}g(ql,"isNothing");function Lf(e){return typeof e=="object"&&e!==null}g(Lf,"isObject");function Ef(e){return Array.isArray(e)?e:ql(e)?[]:[e]}g(Ef,"toArray");function Ff(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(Ff,"extend");function Af(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}g(Af,"repeat");function Mf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}g(Mf,"isNegativeZero");var RS=ql,IS=Lf,PS=Ef,DS=Af,NS=Mf,qS=Ff,Ut={isNothing:RS,isObject:IS,toArray:PS,repeat:DS,isNegativeZero:NS,extend:qS};function zl(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
+
133
+ `+e.mark.snippet),i+" "+r):i}g(zl,"formatError");function Li(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=zl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}g(Li,"YAMLException$1");Li.prototype=Object.create(Error.prototype);Li.prototype.constructor=Li;Li.prototype.toString=g(function(t){return this.name+": "+zl(this,t)},"toString");var de=Li;function as(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}}g(as,"getLine");function ns(e,t){return Ut.repeat(" ",t-e.length)+e}g(ns,"padStart");function $f(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=as(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),d),n=Ut.repeat(" ",t.indent)+ns((e.line-l+1).toString(),h)+" | "+c.str+`
134
+ `+n;for(c=as(e.buffer,i[a],o[a],e.position,d),n+=Ut.repeat(" ",t.indent)+ns((e.line+1).toString(),h)+" | "+c.str+`
135
+ `,n+=Ut.repeat("-",t.indent+h+3+c.pos)+`^
136
+ `,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=as(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),d),n+=Ut.repeat(" ",t.indent)+ns((e.line+l+1).toString(),h)+" | "+c.str+`
137
+ `;return n.replace(/\n$/,"")}g($f,"makeSnippet");var zS=$f,jS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],WS=["scalar","sequence","mapping"];function Of(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}g(Of,"compileStyleAliases");function Rf(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(jS.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=Of(t.styleAliases||null),WS.indexOf(this.kind)===-1)throw new de('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}g(Rf,"Type$1");var re=Rf;function _n(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}g(_n,"compileList");function If(){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(g(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}g(If,"compileMap");function As(e){return this.extend(e)}g(As,"Schema$1");As.prototype.extend=g(function(t){var r=[],i=[];if(t instanceof re)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 re))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 re))throw new de("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(As.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(i),o.compiledImplicit=_n(o,"implicit"),o.compiledExplicit=_n(o,"explicit"),o.compiledTypeMap=If(o.compiledImplicit,o.compiledExplicit),o},"extend");var HS=As,YS=new re("tag:yaml.org,2002:str",{kind:"scalar",construct:g(function(e){return e!==null?e:""},"construct")}),US=new re("tag:yaml.org,2002:seq",{kind:"sequence",construct:g(function(e){return e!==null?e:[]},"construct")}),XS=new re("tag:yaml.org,2002:map",{kind:"mapping",construct:g(function(e){return e!==null?e:{}},"construct")}),GS=new HS({explicit:[YS,US,XS]});function Pf(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}g(Pf,"resolveYamlNull");function Df(){return null}g(Df,"constructYamlNull");function Nf(e){return e===null}g(Nf,"isNull");var VS=new re("tag:yaml.org,2002:null",{kind:"scalar",resolve:Pf,construct:Df,predicate:Nf,represent:{canonical:g(function(){return"~"},"canonical"),lowercase:g(function(){return"null"},"lowercase"),uppercase:g(function(){return"NULL"},"uppercase"),camelcase:g(function(){return"Null"},"camelcase"),empty:g(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")}g(qf,"resolveYamlBoolean");function zf(e){return e==="true"||e==="True"||e==="TRUE"}g(zf,"constructYamlBoolean");function jf(e){return Object.prototype.toString.call(e)==="[object Boolean]"}g(jf,"isBoolean");var KS=new re("tag:yaml.org,2002:bool",{kind:"scalar",resolve:qf,construct:zf,predicate:jf,represent:{lowercase:g(function(e){return e?"true":"false"},"lowercase"),uppercase:g(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:g(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Wf(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}g(Wf,"isHexCode");function Hf(e){return 48<=e&&e<=55}g(Hf,"isOctCode");function Yf(e){return 48<=e&&e<=57}g(Yf,"isDecCode");function Uf(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(!Wf(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Hf(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Yf(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}g(Uf,"resolveYamlInteger");function Xf(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)}g(Xf,"constructYamlInteger");function Gf(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ut.isNegativeZero(e)}g(Gf,"isInteger");var ZS=new re("tag:yaml.org,2002:int",{kind:"scalar",resolve:Uf,construct:Xf,predicate:Gf,represent:{binary:g(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:g(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:g(function(e){return e.toString(10)},"decimal"),hexadecimal:g(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"]}}),QS=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Vf(e){return!(e===null||!QS.test(e)||e[e.length-1]==="_")}g(Vf,"resolveYamlFloat");function Kf(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)}g(Kf,"constructYamlFloat");var JS=/^[-+]?[0-9]+e/;function Zf(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(Ut.isNegativeZero(e))return"-0.0";return r=e.toString(10),JS.test(r)?r.replace("e",".e"):r}g(Zf,"representYamlFloat");function Qf(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ut.isNegativeZero(e))}g(Qf,"isFloat");var tT=new re("tag:yaml.org,2002:float",{kind:"scalar",resolve:Vf,construct:Kf,predicate:Qf,represent:Zf,defaultStyle:"lowercase"}),Jf=GS.extend({implicit:[VS,KS,ZS,tT]}),eT=Jf,tp=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ep=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 rp(e){return e===null?!1:tp.exec(e)!==null||ep.exec(e)!==null}g(rp,"resolveYamlTimestamp");function ip(e){var t,r,i,o,s,a,n,l=0,c=null,h,d,f;if(t=tp.exec(e),t===null&&(t=ep.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}g(ip,"constructYamlTimestamp");function op(e){return e.toISOString()}g(op,"representYamlTimestamp");var rT=new re("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:rp,construct:ip,instanceOf:Date,represent:op});function sp(e){return e==="<<"||e===null}g(sp,"resolveYamlMerge");var iT=new re("tag:yaml.org,2002:merge",{kind:"scalar",resolve:sp}),jl=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
138
+ \r`;function ap(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=jl;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}g(ap,"resolveYamlBinary");function np(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=jl,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)}g(np,"constructYamlBinary");function lp(e){var t="",r=0,i,o,s=e.length,a=jl;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}g(lp,"representYamlBinary");function hp(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}g(hp,"isBinary");var oT=new re("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ap,construct:np,predicate:hp,represent:lp}),sT=Object.prototype.hasOwnProperty,aT=Object.prototype.toString;function cp(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,aT.call(o)!=="[object Object]")return!1;for(s in o)if(sT.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}g(cp,"resolveYamlOmap");function dp(e){return e!==null?e:[]}g(dp,"constructYamlOmap");var nT=new re("tag:yaml.org,2002:omap",{kind:"sequence",resolve:cp,construct:dp}),lT=Object.prototype.toString;function up(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],lT.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}g(up,"resolveYamlPairs");function fp(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}g(fp,"constructYamlPairs");var hT=new re("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:up,construct:fp}),cT=Object.prototype.hasOwnProperty;function pp(e){if(e===null)return!0;var t,r=e;for(t in r)if(cT.call(r,t)&&r[t]!==null)return!1;return!0}g(pp,"resolveYamlSet");function gp(e){return e!==null?e:{}}g(gp,"constructYamlSet");var dT=new re("tag:yaml.org,2002:set",{kind:"mapping",resolve:pp,construct:gp}),mp=eT.extend({implicit:[rT,iT],explicit:[oT,nT,hT,dT]}),gr=Object.prototype.hasOwnProperty,Ms=1,yp=2,xp=3,$s=4,Na=1,uT=2,Tc=3,fT=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,pT=/[\x85\u2028\u2029]/,gT=/[,\[\]\{\}]/,Cp=/^(?:!|!!|![a-z\-]+!)$/i,bp=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Bn(e){return Object.prototype.toString.call(e)}g(Bn,"_class");function Le(e){return e===10||e===13}g(Le,"is_EOL");function fr(e){return e===9||e===32}g(fr,"is_WHITE_SPACE");function ne(e){return e===9||e===32||e===10||e===13}g(ne,"is_WS_OR_EOL");function $r(e){return e===44||e===91||e===93||e===123||e===125}g($r,"is_FLOW_INDICATOR");function kp(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}g(kp,"fromHexCode");function wp(e){return e===120?2:e===117?4:e===85?8:0}g(wp,"escapedHexLen");function Sp(e){return 48<=e&&e<=57?e-48:-1}g(Sp,"fromDecimalCode");function Ln(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":""}g(Ln,"simpleEscapeSequence");function Tp(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}g(Tp,"charFromCodepoint");function Wl(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}g(Wl,"setProperty");var vp=new Array(256),_p=new Array(256);for(Tr=0;Tr<256;Tr++)vp[Tr]=Ln(Tr)?1:0,_p[Tr]=Ln(Tr);var Tr;function Bp(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||mp,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=[]}g(Bp,"State$1");function Hl(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=zS(r),new de(t,r)}g(Hl,"generateError");function st(e,t){throw Hl(e,t)}g(st,"throwError");function bo(e,t){e.onWarning&&e.onWarning.call(null,Hl(e,t))}g(bo,"throwWarning");var vc={YAML:g(function(t,r,i){var o,s,a;t.version!==null&&st(t,"duplication of %YAML directive"),i.length!==1&&st(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&st(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&&st(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&bo(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:g(function(t,r,i){var o,s;i.length!==2&&st(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],Cp.test(o)||st(t,"ill-formed tag handle (first argument) of the TAG directive"),gr.call(t.tagMap,o)&&st(t,'there is a previously declared suffix for "'+o+'" tag handle'),bp.test(s)||st(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{st(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function or(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||st(e,"expected valid JSON character");else fT.test(n)&&st(e,"the stream contains non-printable characters");e.result+=n}}g(or,"captureSegment");function En(e,t,r,i){var o,s,a,n;for(Ut.isObject(r)||st(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],gr.call(t,s)||(Wl(t,s,r[s]),i[s]=!0)}g(En,"mergeMappings");function Or(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])&&st(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Bn(o[c])==="[object Object]"&&(o[c]="[object Object]");if(typeof o=="object"&&Bn(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)En(e,t,s[c],r);else En(e,t,s,r);else!e.json&&!gr.call(r,o)&&gr.call(t,o)&&(e.line=a||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,st(e,"duplicated mapping key")),Wl(t,o,s),delete r[o];return t}g(Or,"storeMappingPair");function na(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++):st(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}g(na,"readLineBreak");function Nt(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;fr(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(Le(o))for(na(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&&bo(e,"deficient indentation"),i}g(Nt,"skipSeparationSpace");function Ao(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||ne(r)))}g(Ao,"testDocumentSeparator");function la(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ut.repeat(`
140
+ `,t-1))}g(la,"writeFoldedLines");function Lp(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),ne(u)||$r(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),ne(o)||r&&$r(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),ne(o)||r&&$r(o))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),ne(i))break}else{if(e.position===e.lineStart&&Ao(e)||r&&$r(u))break;if(Le(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,Nt(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&&(or(e,s,a,!1),la(e,e.line-l),s=a=e.position,n=!1),fr(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return or(e,s,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}g(Lp,"readPlainScalar");function Ep(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(or(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 Le(r)?(or(e,i,o,!0),la(e,Nt(e,!1,t)),i=o=e.position):e.position===e.lineStart&&Ao(e)?st(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);st(e,"unexpected end of the stream within a single quoted scalar")}g(Ep,"readSingleQuotedScalar");function Fp(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 or(e,r,e.position,!0),e.position++,!0;if(n===92){if(or(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),Le(n))Nt(e,!1,t);else if(n<256&&vp[n])e.result+=_p[n],e.position++;else if((a=wp(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=kp(n))>=0?s=(s<<4)+a:st(e,"expected hexadecimal character");e.result+=Tp(s),e.position++}else st(e,"unknown escape sequence");r=i=e.position}else Le(n)?(or(e,r,i,!0),la(e,Nt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Ao(e)?st(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}st(e,"unexpected end of the stream within a double quoted scalar")}g(Fp,"readDoubleQuotedScalar");function Ap(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,d,f,u,p=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(Nt(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&&st(e,"expected the node content, but found ','"):st(e,"missed comma between flow collection entries"),y=m=x=null,d=f=!1,C===63&&(c=e.input.charCodeAt(e.position+1),ne(c)&&(d=f=!0,e.position++,Nt(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,zr(e,t,Ms,!1,!0),y=e.tag,m=e.result,Nt(e,!0,t),C=e.input.charCodeAt(e.position),(f||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),Nt(e,!0,t),zr(e,t,Ms,!1,!0),x=e.result),u?Or(e,n,p,y,m,x,i,o,s):d?n.push(Or(e,null,p,y,m,x,i,o,s)):n.push(m),Nt(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}st(e,"unexpected end of the stream within a flow collection")}g(Ap,"readFlowCollection");function Mp(e,t){var r,i,o=Na,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)Na===o?o=d===43?Tc:uT:st(e,"repeat of a chomping mode identifier");else if((h=Sp(d))>=0)h===0?st(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?st(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(fr(d)){do d=e.input.charCodeAt(++e.position);while(fr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Le(d)&&d!==0)}for(;d!==0;){for(na(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),Le(d)){l++;continue}if(e.lineIndent<n){o===Tc?e.result+=Ut.repeat(`
141
+ `,s?1+l:l):o===Na&&s&&(e.result+=`
142
+ `);break}for(i?fr(d)?(c=!0,e.result+=Ut.repeat(`
143
+ `,s?1+l:l)):c?(c=!1,e.result+=Ut.repeat(`
144
+ `,l+1)):l===0?s&&(e.result+=" "):e.result+=Ut.repeat(`
145
+ `,l):e.result+=Ut.repeat(`
146
+ `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Le(d)&&d!==0;)d=e.input.charCodeAt(++e.position);or(e,r,e.position,!1)}return!0}g(Mp,"readBlockScalar");function Fn(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,st(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!ne(a))));){if(n=!0,e.position++,Nt(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,zr(e,t,xp,!1,!0),s.push(e.result),Nt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)st(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}g(Fn,"readBlockSequence");function $p(e,t,r){var i,o,s,a,n,l,c=e.tag,h=e.anchor,d={},f=Object.create(null),u=null,p=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,st(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&ne(i))C===63?(y&&(Or(e,d,f,u,p,null,a,n,l),u=p=m=null),x=!0,y=!0,o=!0):y?(y=!1,o=!0):st(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,!zr(e,r,yp,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);fr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),ne(C)||st(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Or(e,d,f,u,p,null,a,n,l),u=p=m=null),x=!0,y=!1,o=!1,u=e.tag,p=e.result;else if(x)st(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)st(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),zr(e,t,$s,!0,o)&&(y?p=e.result:m=e.result),y||(Or(e,d,f,u,p,m,a,n,l),u=p=m=null),Nt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)st(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Or(e,d,f,u,p,null,a,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}g($p,"readBlockMapping");function Op(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&&st(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)):st(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!ne(a);)a===33&&(i?st(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Cp.test(o)||st(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),gT.test(s)&&st(e,"tag suffix cannot contain flow indicator characters")}s&&!bp.test(s)&&st(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{st(e,"tag name is malformed: "+s)}return r?e.tag=s:gr.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:st(e,'undeclared tag handle "'+o+'"'),!0}g(Op,"readTagProperty");function Rp(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&st(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ne(r)&&!$r(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&st(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}g(Rp,"readAnchorProperty");function Ip(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&&!ne(i)&&!$r(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&st(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),gr.call(e.anchorMap,r)||st(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Nt(e,!0,-1),!0}g(Ip,"readAlias");function zr(e,t,r,i,o){var s,a,n,l=1,c=!1,h=!1,d,f,u,p,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=$s===r||xp===r,i&&Nt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Op(e)||Rp(e);)Nt(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||$s===r)&&(Ms===r||yp===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?n&&(Fn(e,y)||$p(e,y,m))||Ap(e,m)?h=!0:(a&&Mp(e,m)||Ep(e,m)||Fp(e,m)?h=!0:Ip(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&st(e,"alias node should not have any properties")):Lp(e,m,Ms===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=n&&Fn(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"&&st(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(p=e.implicitTypes[d],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(gr.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=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){p=u[d];break}p||st(e,"unknown tag !<"+e.tag+">"),e.result!==null&&p.kind!==e.kind&&st(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):st(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}g(zr,"composeNode");function Pp(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&&(Nt(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&&!ne(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&st(e,"directive name must not be less than one character in length");a!==0;){for(;fr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Le(a));break}if(Le(a))break;for(r=e.position;a!==0&&!ne(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&na(e),gr.call(vc,i)?vc[i](e,i,o):bo(e,'unknown document directive "'+i+'"')}if(Nt(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,Nt(e,!0,-1)):s&&st(e,"directives end mark is expected"),zr(e,e.lineIndent-1,$s,!1,!0),Nt(e,!0,-1),e.checkLineBreaks&&pT.test(e.input.slice(t,e.position))&&bo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ao(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Nt(e,!0,-1));return}if(e.position<e.length-1)st(e,"end of the stream or a document separator is expected");else return}g(Pp,"readDocument");function Yl(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 Bp(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,st(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;)Pp(r);return r.documents}g(Yl,"loadDocuments");function mT(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=Yl(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}g(mT,"loadAll$1");function Dp(e,t){var r=Yl(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")}}g(Dp,"load$1");var yT=Dp,xT={load:yT},Np=Object.prototype.toString,qp=Object.prototype.hasOwnProperty,Ul=65279,CT=9,ko=10,bT=13,kT=32,wT=33,ST=34,An=35,TT=37,vT=38,_T=39,BT=42,zp=44,LT=45,Os=58,ET=61,FT=62,AT=63,MT=64,jp=91,Wp=93,$T=96,Hp=123,OT=124,Yp=125,oe={};oe[0]="\\0";oe[7]="\\a";oe[8]="\\b";oe[9]="\\t";oe[10]="\\n";oe[11]="\\v";oe[12]="\\f";oe[13]="\\r";oe[27]="\\e";oe[34]='\\"';oe[92]="\\\\";oe[133]="\\N";oe[160]="\\_";oe[8232]="\\L";oe[8233]="\\P";var RT=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],IT=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Up(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&&qp.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[a]=n;return r}g(Up,"compileStyleMap");function Xp(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+Ut.repeat("0",i-t.length)+t}g(Xp,"encodeHex");var PT=1,wo=2;function Gp(e){this.schema=e.schema||mp,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ut.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Up(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==='"'?wo:PT,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}g(Gp,"State");function Mn(e,t){for(var r=Ut.repeat(" ",t),i=0,o=-1,s="",a,n=e.length;i<n;)o=e.indexOf(`
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}g(Mn,"indentString");function Rs(e,t){return`
150
+ `+Ut.repeat(" ",e.indent*t)}g(Rs,"generateNextLine");function Vp(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}g(Vp,"testImplicitResolving");function So(e){return e===kT||e===CT}g(So,"isWhitespace");function Ei(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ul||65536<=e&&e<=1114111}g(Ei,"isPrintable");function $n(e){return Ei(e)&&e!==Ul&&e!==bT&&e!==ko}g($n,"isNsCharOrWhitespace");function On(e,t,r){var i=$n(e),o=i&&!So(e);return(r?i:i&&e!==zp&&e!==jp&&e!==Wp&&e!==Hp&&e!==Yp)&&e!==An&&!(t===Os&&!o)||$n(t)&&!So(t)&&e===An||t===Os&&o}g(On,"isPlainSafe");function Kp(e){return Ei(e)&&e!==Ul&&!So(e)&&e!==LT&&e!==AT&&e!==Os&&e!==zp&&e!==jp&&e!==Wp&&e!==Hp&&e!==Yp&&e!==An&&e!==vT&&e!==BT&&e!==wT&&e!==OT&&e!==ET&&e!==FT&&e!==_T&&e!==ST&&e!==TT&&e!==MT&&e!==$T}g(Kp,"isPlainSafeFirst");function Zp(e){return!So(e)&&e!==Os}g(Zp,"isPlainSafeLast");function ii(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}g(ii,"codePointAt");function Xl(e){var t=/^\n* /;return t.test(e)}g(Xl,"needIndentIndicator");var Qp=1,Rn=2,Jp=3,tg=4,Qr=5;function eg(e,t,r,i,o,s,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,p=-1,m=Kp(ii(e,0))&&Zp(ii(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ii(e,l),!Ei(c))return Qr;m=m&&On(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ii(e,l),c===ko)d=!0,u&&(f=f||l-p-1>i&&e[p+1]!==" ",p=l);else if(!Ei(c))return Qr;m=m&&On(c,h,n),h=c}f=f||u&&l-p-1>i&&e[p+1]!==" "}return!d&&!f?m&&!a&&!o(e)?Qp:s===wo?Qr:Rn:r>9&&Xl(e)?Qr:a?s===wo?Qr:Rn:f?tg:Jp}g(eg,"chooseScalarStyle");function rg(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===wo?'""':"''";if(!e.noCompatMode&&(RT.indexOf(t)!==-1||IT.test(t)))return e.quotingType===wo?'"'+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 Vp(e,c)}switch(g(l,"testAmbiguity"),eg(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case Qp:return t;case Rn:return"'"+t.replace(/'/g,"''")+"'";case Jp:return"|"+In(t,e.indent)+Pn(Mn(t,s));case tg:return">"+In(t,e.indent)+Pn(Mn(ig(t,a),s));case Qr:return'"'+og(t)+'"';default:throw new de("impossible error: invalid scalar style")}})()}g(rg,"writeScalar");function In(e,t){var r=Xl(e)?String(t):"",i=e[e.length-1]===`
151
+ `,o=i&&(e[e.length-2]===`
152
+ `||e===`
153
+ `),s=o?"+":i?"":"-";return r+s+`
154
+ `}g(In,"blockHeader");function Pn(e){return e[e.length-1]===`
155
+ `?e.slice(0,-1):e}g(Pn,"dropEndingNewline");function ig(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
156
+ `);return c=c!==-1?c:e.length,r.lastIndex=c,Dn(e.slice(0,c),t)})(),o=e[0]===`
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
+ `:"")+Dn(l,t),o=s}return i}g(ig,"foldString");function Dn(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
+ `+e.slice(o,s),o=s+1),a=n;return l+=`
160
+ `,e.length-o>t&&a>o?l+=e.slice(o,a)+`
161
+ `+e.slice(a+1):l+=e.slice(o),l.slice(1)}g(Dn,"foldLine");function og(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=ii(e,o),i=oe[r],!i&&Ei(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||Xp(r);return t}g(og,"escapeString");function sg(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)),(je(e,t,n,!1,!1)||typeof n>"u"&&je(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}g(sg,"writeFlowSequence");function Nn(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)),(je(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&je(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Rs(e,t)),e.dump&&ko===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}g(Nn,"writeBlockSequence");function ag(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)),je(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),je(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}g(ag,"writeFlowMapping");function ng(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+=Rs(e,t)),c=a[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),je(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&ko===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=Rs(e,t)),je(e,t+1,h,!0,d)&&(e.dump&&ko===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}g(ng,"writeBlockMapping");function qn(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,Np.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(qp.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}g(qn,"detectType");function je(e,t,r,i,o,s,a){e.tag=null,e.dump=r,qn(e,r,!1)||qn(e,r,!0);var n=Np.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?(ng(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(ag(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?Nn(e,t-1,e.dump,o):Nn(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(sg(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&rg(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}g(je,"writeNode");function lg(e,t){var r=[],i=[],o,s;for(Is(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}g(lg,"getDuplicateReferences");function Is(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)Is(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)Is(e[i[o]],t,r)}g(Is,"inspectNode");function DT(e,t){t=t||{};var r=new Gp(t);r.noRefs||lg(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),je(r,0,i,!0,!0)?r.dump+`
162
+ `:""}g(DT,"dump$1");function NT(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(NT,"renamed");var hg=Jf,cg=xT.load;var qT=g(e=>{const{handDrawnSeed:t}=kt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ri=g(e=>{const t=zT([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),zT=g(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),Gl=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"),it=g(e=>{const{stylesArray:t}=Ri(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];Gl(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}=Ri(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:jT(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),jT=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"),Ho={},Yt={},_c;function WT(){return _c||(_c=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.BLANK_URL=Yt.relativeFirstCharacters=Yt.whitespaceEscapeCharsRegex=Yt.urlSchemeRegex=Yt.ctrlCharactersRegex=Yt.htmlCtrlEntityRegex=Yt.htmlEntitiesRegex=Yt.invalidProtocolRegex=void 0,Yt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Yt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Yt.htmlCtrlEntityRegex=/&(newline|tab);/gi,Yt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Yt.urlSchemeRegex=/^.+(:|&colon;)/gim,Yt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Yt.relativeFirstCharacters=[".","/"],Yt.BLANK_URL="about:blank"),Yt}var Bc;function HT(){if(Bc)return Ho;Bc=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.sanitizeUrl=s;var e=WT();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 p=new URL(u);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return u}return Ho}var dg=HT();function qa(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 YT(){}function ug(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ha(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const fg="[object RegExp]",Vl="[object String]",Kl="[object Number]",Zl="[object Boolean]",Ql="[object Arguments]",pg="[object Symbol]",gg="[object Date]",mg="[object Map]",yg="[object Set]",xg="[object Array]",Cg="[object ArrayBuffer]",bg="[object Object]",kg="[object DataView]",wg="[object Uint8Array]",Sg="[object Uint8ClampedArray]",Tg="[object Uint16Array]",vg="[object Uint32Array]",_g="[object Int8Array]",Bg="[object Int16Array]",Lg="[object Int32Array]",Eg="[object Float32Array]",Fg="[object Float64Array]",Lc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function Jl(e){return typeof Lc.Buffer<"u"&&Lc.Buffer.isBuffer(e)}function UT(e){return Number.isSafeInteger(e)&&e>=0}function Ag(e){return e!=null&&typeof e!="function"&&UT(e.length)}function XT(e){return e==="__proto__"}function ca(e){return e==null||typeof e!="object"&&typeof e!="function"}function th(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function GT(e,t){return oi(e,void 0,e,new Map,t)}function oi(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(ca(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]=oi(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,oi(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(oi(n,void 0,r,i,o));return a}if(Jl(e))return e.subarray();if(th(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=oi(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),Te(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),Te(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),Te(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,Te(a,e,r,i,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),Te(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),Te(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),Te(a,e,r,i,o),a}if(typeof e=="object"&&VT(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),Te(a,e,r,i,o),a}return e}function Te(e,t,r=e,i,o){const s=[...Object.keys(t),...ug(t)];for(let a=0;a<s.length;a++){const n=s[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=oi(t[n],n,r,i,o))}}function VT(e){switch(ha(e)){case Ql:case xg:case Cg:case kg:case Zl:case gg:case Eg:case Fg:case _g:case Bg:case Lg:case mg:case Kl:case bg:case fg:case yg:case Vl:case pg:case wg:case Sg:case Tg:case vg:return!0;default:return!1}}function KT(e,t){return GT(e,(r,i,o,s)=>{if(typeof e=="object"){if(ha(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),Te(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case Kl:case Vl:case Zl:{const a=new e.constructor(e?.valueOf());return Te(a,e),a}case Ql:{const a={};return Te(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Ec(e){return KT(e)}function zn(e){return e!==null&&typeof e=="object"&&ha(e)==="[object Arguments]"}function jn(e){return typeof e=="object"&&e!==null}function ZT(e){return jn(e)&&Ag(e)}function Mo(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(Mo.Cache||Map),r}Mo.Cache=Map;function uo(e){return th(e)}function QT(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function JT(e){if(ca(e))return e;if(Array.isArray(e)||th(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 tv(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=ls(o,a,i,new Map)}return o}function ls(e,t,r,i){if(ca(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return JT(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),...ug(t)];for(let s=0;s<o.length;s++){const a=o[s];if(XT(a))continue;let n=t[a],l=e[a];if(zn(n)&&(n={...n}),zn(l)&&(l={...l}),Jl(n)&&(n=Ec(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(ZT(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)||jn(l)&&jn(n)&&(qa(l)||qa(n)||uo(l)||uo(n))?e[a]=ls(l,n,r,i):l==null&&qa(n)?e[a]=ls({},n,r,i):l==null&&uo(n)?e[a]=Ec(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function ev(e,...t){return tv(e,...t,YT)}function Fc(e){if(e==null)return!0;if(Ag(e))return typeof e.splice!="function"&&typeof e!="string"&&!Jl(e)&&!uo(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 QT(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var Mg="​",rv={curveBasis:Ls,curveBasisClosed:BS,curveBasisOpen:LS,curveBumpX:nf,curveBumpY:lf,curveBundle:ES,curveCardinalClosed:FS,curveCardinalOpen:AS,curveCardinal:uf,curveCatmullRomClosed:MS,curveCatmullRomOpen:$S,curveCatmullRom:pf,curveLinear:co,curveLinearClosed:OS,curveMonotoneX:bf,curveMonotoneY:kf,curveNatural:Sf,curveStep:Tf,curveStepAfter:_f,curveStepBefore:vf},iv=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ov=g(function(e,t){const r=$g(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);ms(a),i=jt(i,[...a])}else i=r.args;if(!i)return;let o=bl(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),$g=g(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${iv.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=ho.exec(e))!==null;)if(i.index===ho.lastIndex&&ho.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"),sv=g(function(e){return e.replace(ho,"")},"removeDirectives"),av=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function eh(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return rv[r]??t}g(eh,"interpolateToCurve");function Og(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?dg.sanitizeUrl(r):r}g(Og,"formatUrl");var nv=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 rh(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}g(rh,"distance");function Rg(e){let t,r=0;e.forEach(o=>{r+=rh(o,t),t=o});const i=r/2;return ih(e,i)}g(Rg,"traverseEdge");function Ig(e){return e.length===1?e[0]:Rg(e)}g(Ig,"calcLabelPosition");var Ac=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),ih=g((e,t)=>{let r,i=t;for(const o of e){if(r){const s=rh(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:Ac((1-a)*r.x+a*o.x,5),y:Ac((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),lv=g((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=ih(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 Pg(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=ih(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(Pg,"calcTerminalLabelPosition");function oh(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(oh,"getStylesFromArray");var Mc=0,Dg=g(()=>(Mc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Mc),"generateId");function Ng(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(Ng,"makeRandomHex");var qg=g(e=>Ng(e.length),"random"),hv=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"),cv=g(function(e,t){const r=t.text.replace($i.lineBreakRegex," "),[,i]=$o(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"),zg=Mo((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),$i.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=We(`${a} `,r),c=We(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=dv(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}`),dv=Mo((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(We(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 sh(e,t){return da(e,t).height}g(sh,"calculateTextHeight");function We(e,t){return da(e,t).width}g(We,"calculateTextWidth");var da=Mo((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=$o(r),a=["sans-serif",i],n=e.split($i.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 p={width:0,height:0,lineHeight:0};for(const m of n){const y=hv();y.text=m||Mg;const x=cv(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");p.width=Math.round(Math.max(p.width,C.width)),u=Math.round(C.height),p.height+=u,p.lineHeight=Math.round(Math.max(p.lineHeight,u))}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}`),ki,uv=(ki=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},g(ki,"InitIDGenerator"),ki),Yo,fv=g(function(e){return Yo=Yo||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Yo.innerHTML=e,unescape(Yo.textContent)},"entityDecode");function ah(e){return"str"in e}g(ah,"isDetailedError");var pv=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"),$o=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 ua(e,t){return ev({},e,t)}g(ua,"cleanAndMerge");var xe={assignWithDepth:jt,wrapLabel:zg,calculateTextHeight:sh,calculateTextWidth:We,calculateTextDimensions:da,cleanAndMerge:ua,detectInit:ov,detectDirective:$g,isSubstringInArray:av,interpolateToCurve:eh,calcLabelPosition:Ig,calcCardinalityPosition:lv,calcTerminalLabelPosition:Pg,formatUrl:Og,getStylesFromArray:oh,generateId:Dg,random:qg,runFunc:nv,entityDecode:fv,insertTitle:pv,isLabelCoordinateInPath:jg,parseFontSize:$o,InitIDGenerator:uv},gv=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"),mr=g(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),mv=g((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}g(Gt,"handleUndefinedAttr");function jg(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(jg,"isLabelCoordinateInPath");var fa=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 nh(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=Cl.fontSize]=$o(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(nh,"configureLabelImages");const yv=Object.freeze({left:0,top:0,width:16,height:16}),Ps=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Wg=Object.freeze({...yv,...Ps}),xv=Object.freeze({...Wg,body:"",hidden:!1}),Cv=Object.freeze({width:null,height:null}),bv=Object.freeze({...Cv,...Ps}),kv=(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 za(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 za(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return za(n,r)?n:null}return null},za=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function wv(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 $c(e,t){const r=wv(e,t);for(const i in xv)i in Ps?i in e&&!(i in r)&&(r[i]=Ps[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function Sv(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 Oc(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=$c(i[n]||o[n],s)}return a(t),r.forEach(a),$c(e,s)}function Tv(e,t){if(e.icons[t])return Oc(e,t,[]);const r=Sv(e,[t])[t];return r?Oc(e,t,r):null}const vv=/(-?[0-9.]*[0-9]+[0-9.]*)/g,_v=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Rc(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(vv);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=_v.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 Bv(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 Lv(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Ev(e,t,r){const i=Bv(e);return Lv(i.defs,t+i.content+r)}const Fv=e=>e==="unset"||e==="undefined"||e==="none";function Av(e,t){const r={...Wg,...e},i={...bv,...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=Ev(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=Rc(d,l/c)):(h=a==="auto"?l:a,d=n===null?Rc(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{Fv(y)||(f[m]=y.toString())};u("width",h),u("height",d);const p=[o.left,o.top,l,c];return f.viewBox=p.join(" "),{attributes:f,viewBox:p,body:s}}const Mv=/\sid="(\S+)"/g,Ic=new Map;function $v(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Ic.get(e)||0;return Ic.set(e,t+1),t?`${e}${t}`:e}function Ov(e){const t=[];let r;for(;r=Mv.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=$v(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 Rv(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 Hg={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},Wn=new Map,Yg=new Map,Ug=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)Yg.set(t.name,t.loader);else if("icons"in t)Wn.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"),Xg=g(async(e,t)=>{const r=kv(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=Wn.get(i);if(!o){const a=Yg.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},Wn.set(i,o)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=Tv(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),Iv=g(async e=>{try{return await Xg(e),!0}catch{return!1}},"isIconAvailable"),Ii=g(async(e,t,r)=>{let i;try{i=await Xg(e,t?.fallbackPrefix)}catch(a){V.error(a),i=Hg}const o=Av(i,t),s=Rv(Ov(o.body),{...o.attributes,...r});return Ce(s,Ot())},"getIconSVG");function lh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Hr=lh();function Gg(e){Hr=e}var fo={exec:()=>null};function St(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(le.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var Pv=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),le={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")},Dv=/^(?:[ \t]*(?:\n|$))+/,Nv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,qv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Oo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hh=/(?:[*+-]|\d{1,9}[.)])/,Vg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Kg=St(Vg).replace(/bull/g,hh).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(),jv=St(Vg).replace(/bull/g,hh).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]+)*)/,Wv=/^[^\n]+/,dh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Hv=St(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",dh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yv=St(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hh).getRegex(),pa="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",uh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Uv=St("^ {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",uh).replace("tag",pa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Zg=St(ch).replace("hr",Oo).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",pa).getRegex(),Xv=St(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Zg).getRegex(),fh={blockquote:Xv,code:Nv,def:Hv,fences:qv,heading:zv,hr:Oo,html:Uv,lheading:Kg,list:Yv,newline:Dv,paragraph:Zg,table:fo,text:Wv},Pc=St("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Oo).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",pa).getRegex(),Gv={...fh,lheading:jv,table:Pc,paragraph:St(ch).replace("hr",Oo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pc).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",pa).getRegex()},Vv={...fh,html:St(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",uh).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:fo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:St(ch).replace("hr",Oo).replace("heading",` *#{1,6} *[^
164
+ ]`).replace("lheading",Kg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Kv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qg=/^( {2,}|\\)\n(?!\s*$)/,Qv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ga=/[\p{P}\p{S}]/u,ph=/[\s\p{P}\p{S}]/u,Jg=/[^\s\p{P}\p{S}]/u,Jv=St(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ph).getRegex(),tm=/(?!~)[\p{P}\p{S}]/u,t_=/(?!~)[\s\p{P}\p{S}]/u,e_=/(?:[^\s\p{P}\p{S}]|~)/u,r_=St(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),em=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,i_=St(em,"u").replace(/punct/g,ga).getRegex(),o_=St(em,"u").replace(/punct/g,tm).getRegex(),rm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",s_=St(rm,"gu").replace(/notPunctSpace/g,Jg).replace(/punctSpace/g,ph).replace(/punct/g,ga).getRegex(),a_=St(rm,"gu").replace(/notPunctSpace/g,e_).replace(/punctSpace/g,t_).replace(/punct/g,tm).getRegex(),n_=St("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jg).replace(/punctSpace/g,ph).replace(/punct/g,ga).getRegex(),l_=St(/\\(punct)/,"gu").replace(/punct/g,ga).getRegex(),h_=St(/^<(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(),c_=St(uh).replace("(?:-->|$)","-->").getRegex(),d_=St("^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",c_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ds=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,u_=St(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ds).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),im=St(/^!?\[(label)\]\[(ref)\]/).replace("label",Ds).replace("ref",dh).getRegex(),om=St(/^!?\[(ref)\](?:\[\])?/).replace("ref",dh).getRegex(),f_=St("reflink|nolink(?!\\()","g").replace("reflink",im).replace("nolink",om).getRegex(),Dc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gh={_backpedal:fo,anyPunctuation:l_,autolink:h_,blockSkip:r_,br:Qg,code:Zv,del:fo,emStrongLDelim:i_,emStrongRDelimAst:s_,emStrongRDelimUnd:n_,escape:Kv,link:u_,nolink:om,punctuation:Jv,reflink:im,reflinkSearch:f_,tag:d_,text:Qv,url:fo},p_={...gh,link:St(/^!?\[(label)\]\((.*?)\)/).replace("label",Ds).getRegex(),reflink:St(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ds).getRegex()},Hn={...gh,emStrongRDelimAst:a_,emStrongLDelim:o_,url:St(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Dc).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:St(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Dc).getRegex()},g_={...Hn,br:St(Qg).replace("{2,}","*").getRegex(),text:St(Hn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Uo={normal:fh,gfm:Gv,pedantic:Vv},Ui={normal:gh,gfm:Hn,breaks:g_,pedantic:p_},m_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Nc=e=>m_[e];function Pe(e,t){if(t){if(le.escapeTest.test(e))return e.replace(le.escapeReplace,Nc)}else if(le.escapeTestNoEncode.test(e))return e.replace(le.escapeReplaceNoEncode,Nc);return e}function qc(e){try{e=encodeURI(e).replace(le.percentDecode,"%")}catch{return null}return e}function zc(e,t){let r=e.replace(le.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(le.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(le.slashPipe,"|");return i}function Xi(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 y_(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 jc(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 x_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
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 Ns=class{options;rules;lexer;constructor(t){this.options=t||Hr}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:Xi(i,`
167
+ `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=x_(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=Xi(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:Xi(r[0],`
168
+ `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Xi(r[0],`
169
+ `).split(`
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
+ `),d=h.replace(this.rules.other.blockquoteSetextReplace,`
172
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
173
+ ${h}`:h,s=s?`${s}
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 p=u,m=p.raw+`
175
+ `+i.join(`
176
+ `),y=this.blockquote(m);a[a.length-1]=y,o=o.substring(0,o.length-p.raw.length)+y.raw,s=s.substring(0,s.length-p.text.length)+y.text;break}else if(u?.type==="list"){let p=u,m=p.raw+`
177
+ `+i.join(`
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-p.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],p=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):p?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),p&&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),k=this.rules.other.hrRegex(m),S=this.rules.other.fencesBeginRegex(m),T=this.rules.other.headingBeginRegex(m),B=this.rules.other.htmlBeginRegex(m);for(;t;){let L=t.split(`
183
+ `,1)[0],_;if(u=L,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),_=u):_=u.replace(this.rules.other.tabCharGlobal," "),S.test(u)||T.test(u)||B.test(u)||C.test(u)||k.test(u))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!u.trim())d+=`
184
+ `+_.slice(m);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(f)||T.test(f)||k.test(f))break;d+=`
185
+ `+u}!p&&!u.trim()&&(p=!0),h+=L+`
186
+ `,t=t.substring(L.length+1),f=_.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=zc(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(zc(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=Xi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=y_(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)),jc(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 jc(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 p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}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}}}},ve=class Yn{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Hr,this.options.tokenizer=this.options.tokenizer||new Ns,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:le,block:Uo.normal,inline:Ui.normal};this.options.pedantic?(r.block=Uo.pedantic,r.inline=Ui.pedantic):this.options.gfm&&(r.block=Uo.gfm,this.options.breaks?r.inline=Ui.breaks:r.inline=Ui.gfm),this.tokenizer.rules=r}static get rules(){return{block:Uo,inline:Ui}}static lex(t,r){return new Yn(r).lex(t)}static lexInline(t,r){return new Yn(r).inlineTokens(t)}lex(t){t=t.replace(le.carriageReturn,`
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(le.tabCharGlobal," ").replace(le.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
+ `: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
+ `)?"":`
192
+ `)+o.raw,a.text+=`
193
+ `+o.text,this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
194
+ `)?"":`
195
+ `)+o.raw,a.text+=`
196
+ `+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let s=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
197
+ `)?"":`
198
+ `)+o.raw,a.text+=`
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
+ `)?"":`
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),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}},qs=class{options;parser;constructor(t){this.options=t||Hr}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(le.notSpaceStart)?.[0],s=t.replace(le.endingNewline,"")+`
203
+ `;return o?'<pre><code class="language-'+Pe(o)+'">'+(i?s:Pe(s,!0))+`</code></pre>
204
+ `:"<pre><code>"+(i?s:Pe(s,!0))+`</code></pre>
205
+ `}blockquote({tokens:t}){return`<blockquote>
206
+ ${this.parser.parse(t)}</blockquote>
207
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
208
+ `}hr(t){return`<hr>
209
+ `}list(t){let r=t.ordered,i=t.start,o="";for(let n=0;n<t.items.length;n++){let l=t.items[n];o+=this.listitem(l)}let s=r?"ol":"ul",a=r&&i!==1?' start="'+i+'"':"";return"<"+s+a+`>
210
+ `+o+"</"+s+`>
211
+ `}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+Pe(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
212
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
213
+ `}table(t){let r="",i="";for(let s=0;s<t.header.length;s++)i+=this.tablecell(t.header[s]);r+=this.tablerow({text:i});let o="";for(let s=0;s<t.rows.length;s++){let a=t.rows[s];i="";for(let n=0;n<a.length;n++)i+=this.tablecell(a[n]);o+=this.tablerow({text:i})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
214
+ <thead>
215
+ `+r+`</thead>
216
+ `+o+`</table>
217
+ `}tablerow({text:t}){return`<tr>
218
+ ${t}</tr>
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>${Pe(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=qc(t);if(s===null)return o;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+Pe(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=qc(t);if(s===null)return Pe(i);t=s;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${Pe(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Pe(t.text)}},mh=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""}},_e=class Un{options;renderer;textRenderer;constructor(t){this.options=t||Hr,this.options.renderer=this.options.renderer||new qs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new mh}static parse(t,r){return new Un(r).parse(t)}static parseInline(t,r){return new Un(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}},io=class{options;block;constructor(t){this.options=t||Hr}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?ve.lex:ve.lexInline}provideParser(){return this.block?_e.parse:_e.parseInline}},C_=class{defaults=lh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=_e;Renderer=qs;TextRenderer=mh;Lexer=ve;Tokenizer=Ns;Hooks=io;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 qs(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 Ns(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 io;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];io.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&io.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 ve.lex(t,r??this.defaults)}parser(t,r){return _e.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?ve.lex:ve.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?_e.parse:_e.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?ve.lex:ve.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?_e.parse:_e.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>"+Pe(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},jr=new C_;function _t(e,t){return jr.parse(e,t)}_t.options=_t.setOptions=function(e){return jr.setOptions(e),_t.defaults=jr.defaults,Gg(_t.defaults),_t};_t.getDefaults=lh;_t.defaults=Hr;_t.use=function(...e){return jr.use(...e),_t.defaults=jr.defaults,Gg(_t.defaults),_t};_t.walkTokens=function(e,t){return jr.walkTokens(e,t)};_t.parseInline=jr.parseInline;_t.Parser=_e;_t.parser=_e.parse;_t.Renderer=qs;_t.TextRenderer=mh;_t.Lexer=ve;_t.lexer=ve.lex;_t.Tokenizer=Ns;_t.Hooks=io;_t.parse=_t;_t.options;_t.setOptions;_t.use;_t.walkTokens;_t.parseInline;_e.parse;ve.lex;function sm(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
+ [ ]{`+Math.min.apply(Math,o)+"}","g");i=i.map(function(n){return n.replace(s,`
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
+ `)&&(d=String(n).split(`
226
+ `).map(function(f,u){return u===0?f:""+h+f}).join(`
227
+ `)),a+=d+i[l+1]}),a}function am(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
228
+ `).replace(/\n{2,}/g,`
229
+ `);return sm(i)}g(am,"preprocessMarkdown");function nm(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}g(nm,"nonMarkdownToLines");function lm(e,t={}){const r=am(e,t),i=_t.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(/&#39;/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 g(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}g(lm,"markdownToLines");function hm(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}g(hm,"nonMarkdownToHTML");function cm(e,{markdownAutoWrap:t}={}){const r=_t.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):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 g(i,"output"),r.map(i).join("")}g(cm,"markdownToHTML");function dm(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}g(dm,"splitTextToChars");function um(e,t){const r=dm(t.content);return yh(e,[],r,t.type)}g(um,"splitWordToFitWidth");function yh(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}])?yh(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}g(yh,"splitWordToFitWidthRecursion");function fm(e,t){if(e.some(({content:r})=>r.includes(`
231
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return zs(e,t)}g(fm,"splitLineToFitWidth");function zs(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 zs(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=um(t,s);r.push([n]),l.content&&e.unshift(l)}return zs(e,t,r)}g(zs,"splitLineToFitWidthRecursion");function Xn(e,t){t&&e.attr("style",t)}g(Xn,"applyStyle");var Wc=16384;async function pm(e,t,r,i,o=!1,s=Ot()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,Wc)}px`),a.attr("height",`${Math.min(10*r,Wc)}px`);const n=a.append("xhtml:div"),l=Ti(t.label)?await kl(t.label.replace($i.lineBreakRegex,`
232
+ `),s):Ce(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),Xn(h,t.labelStyle),h.attr("class",`${c} ${i}`),Xn(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(pm,"addHtmlSpan");function ma(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(ma,"createTspan");function gm(e,t,r){const i=e.append("text"),o=ma(i,1,t);ya(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}g(gm,"computeWidthOfText");function mm(e,t,r){const i=e.append("text"),o=ma(i,1,t);ya(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}g(mm,"computeDimensionOfText");function ym(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(u=>gm(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:fm(h,d);for(const u of f){const p=ma(l,c,1.1,o);ya(p,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()}g(ym,"createFormattedText");function Gn(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(Gn,"decodeHTMLEntities");function ya(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(Gn(r.content)):o.text(" "+Gn(r.content))})}g(ya,"updateTextContentAndStyles");async function xm(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await Iv(n)?await Ii(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(xm,"replaceIconSubstring");var Me=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):hm(t),f=await xm(mr(d),h),u=t.replace(/\\\\/g,"\\"),p={isNode:n,label:Ti(t)?u:f,labelStyle:r.replace("fill:","color:")};return await pm(e,p,l,o,c,h)}else{const d=mr(t.replace(/<br\s*\/?>/g,"<br/>")),f=a?lm(d.replace("<br>","<br/>"),h):nm(d),u=ym(l,e,f,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(u).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(u).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(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 ja(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 b_(e,t){return e[0]===t[0]&&e[1]===t[1]}function k_(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)ja(c,n,o);const l=(function(c,h,d){const f=[];for(const C of c){const k=[...C];b_(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const u=[];h=Math.max(h,.1);const p=[];for(const C of f)for(let k=0;k<C.length-1;k++){const S=C[k],T=C[k+1];if(S[1]!==T[1]){const B=Math.min(S[1],T[1]);p.push({ymin:B,ymax:Math.max(S[1],T[1]),x:B===S[1]?S[0]:T[0],islope:(T[0]-S[0])/(T[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 u;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,T=m[k].edge;u.push([[Math.round(S.x),y],[Math.round(T.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)ja(c,n,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),ja(f,h,d)})(l,n,-o)}return l}function Ro(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),k_(e,o,i,s||1)}class xh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Ro(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 xa(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 w_ extends xh{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Ro(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)xa([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 S_ extends xh{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 T_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ro(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=xa(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 p=0;p<h;p++){const m=u+d+p*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 v_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ro(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=xa(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 p=u*(i+o),m=p+i,y=[h[0]+p*Math.cos(f)+c*Math.cos(f),h[1]+p*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 __{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=Ro(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=xa(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,p=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]+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 B_{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const L_=0,Wa=1,Hc=2,Xo={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 Ha(e,t){return e.type===t}function Ch(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:L_,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:Wa,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:Hc,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!Ha(s,Hc);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return Ch("M0,0"+e);o++,a=Xo[s.text],i=s.text}else Ha(s,Wa)?a=Xo[i]:(o++,a=Xo[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(!Ha(c,Wa))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Xo[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 Cm(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 bm(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,p=0;r==="Q"||r==="T"?(u=i+(i-n),p=o+(o-l)):(u=i,p=o);const m=i+2*(u-i)/3,y=o+2*(p-o)/3,x=d+2*(u-d)/3,C=f+2*(p-f)/3;t.push({key:"C",data:[m,y,x,C,d,f]}),n=u,l=p,i=d,o=f;break}case"Q":{const[d,f,u,p]=h,m=i+2*(d-i)/3,y=o+2*(f-o)/3,x=u+2*(d-u)/3,C=p+2*(f-p)/3;t.push({key:"C",data:[m,y,x,C,u,p]}),n=d,l=f,i=u,o=p;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],p=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)&&(km(i,o,y,x,d,f,u,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 Gi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function km(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,p=0,m=0,y=0;if(c)[u,p,m,y]=c;else{[e,t]=Gi(e,t,-h),[r,i]=Gi(r,i,-h);const Y=(e-r)/2,N=(t-i)/2;let I=Y*Y/(o*o)+N*N/(s*s);I>1&&(I=Math.sqrt(I),o*=I,s*=I);const P=o*o,q=s*s,R=P*q-P*N*N-q*Y*Y,O=P*N*N+q*Y*Y,z=(n===l?-1:1)*Math.sqrt(Math.abs(R/O));m=z*o*N/s+(e+r)/2,y=z*-s*Y/o+(t+i)/2,u=Math.asin(parseFloat(((t-y)/s).toFixed(9))),p=Math.asin(parseFloat(((i-y)/s).toFixed(9))),e<m&&(u=Math.PI-u),r<m&&(p=Math.PI-p),u<0&&(u=2*Math.PI+u),p<0&&(p=2*Math.PI+p),l&&u>p&&(u-=2*Math.PI),!l&&p>u&&(p-=2*Math.PI)}let x=p-u;if(Math.abs(x)>120*Math.PI/180){const Y=p,N=r,I=i;p=l&&p>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=km(r=m+o*Math.cos(p),i=y+s*Math.sin(p),N,I,o,s,a,0,l,[p,Y,m,y])}x=p-u;const C=Math.cos(u),k=Math.sin(u),S=Math.cos(p),T=Math.sin(p),B=Math.tan(x/4),L=4/3*o*B,_=4/3*s*B,A=[e,t],F=[e+L*k,t-_*C],$=[r+L*T,i-_*S],H=[r,i];if(F[0]=2*A[0]-F[0],F[1]=2*A[1]-F[1],c)return[F,$,H].concat(f);{f=[F,$,H].concat(f);const Y=[];for(let N=0;N<f.length;N+=3){const I=Gi(f[N][0],f[N][1],h),P=Gi(f[N+1][0],f[N+1][1],h),q=Gi(f[N+2][0],f[N+2][1],h);Y.push([I[0],I[1],P[0],P[1],q[0],q[1]])}return Y}}const E_={randOffset:function(e,t){return ut(e,t)},randOffsetWithRange:function(e,t,r){return js(e,t,r)},ellipse:function(e,t,r,i,o){const s=Sm(r,i,o);return Vn(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return yr(e,t,r,i,o,!0)}};function wm(e,t,r,i,o){return{type:"path",ops:yr(e,t,r,i,o)}}function hs(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...yr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...yr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?wm(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function F_(e,t,r,i,o){return(function(s,a){return hs(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function Yc(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Go(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:Go(r[0],1.5*(1+.22*t.roughness),Gc(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=Go(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Go(a,1.5*(1+.22*t.roughness),Gc(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 Sm(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+=ut(a*l,r),n+=ut(n*l,r),{increment:s,rx:a,ry:n}}function Vn(e,t,r,i){const[o,s]=Vc(i.increment,e,t,i.rx,i.ry,1,i.increment*js(.1,js(.4,1,r),r),r);let a=Ws(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=Vc(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Ws(n,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function Uc(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+=ut(.01*d,l),f+=ut(.01*f,l);let u=o,p=s;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(p-u)/2),x=Kc(y,c,h,d,f,u,p,1,l);if(!l.disableMultiStroke){const C=Kc(y,c,h,d,f,u,p,1.5,l);x.push(...C)}return a&&(n?x.push(...yr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...yr(c,h,c+d*Math.cos(p),h+f*Math.sin(p),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 Xc(e,t){const r=bm(Cm(Ch(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(...yr(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(...A_(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...yr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function Ya(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]+ut(o,t),i[0][1]+ut(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+ut(o,t),i[a][1]+ut(o,t)]})}}return{type:"fillPath",ops:r}}function Gr(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!he[o])switch(o){case"zigzag":he[o]||(he[o]=new w_(i));break;case"cross-hatch":he[o]||(he[o]=new S_(i));break;case"dots":he[o]||(he[o]=new T_(i));break;case"dashed":he[o]||(he[o]=new v_(i));break;case"zigzag-line":he[o]||(he[o]=new __(i));break;default:o="hachure",he[o]||(he[o]=new xh(i))}return he[o]})(t,E_).fillPolygons(e,t)}function Gc(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Tm(e){return e.randomizer||(e.randomizer=new B_(e.seed||0)),e.randomizer.next()}function js(e,t,r,i=1){return r.roughness*i*(Tm(r)*(t-e)+e)}function ut(e,t,r=1){return js(-e,e,t,r)}function yr(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=Kn(e,t,r,i,o,!0,!1);if(a)return n;const l=Kn(e,t,r,i,o,!0,!0);return n.concat(l)}function Kn(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*Tm(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,p=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=ut(u,o,c),p=ut(p,o,c);const m=[],y=()=>ut(d,o,c),x=()=>ut(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:ut(h,o,c)),t+(C?0:ut(h,o,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),p+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),p+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(),p+t+(i-t)*f+x(),u+e+2*(r-e)*f+x(),p+t+2*(i-t)*f+x(),r+(C?0:x()),i+(C?0:x())]}),m}function Go(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ut(t,r),e[0][1]+ut(t,r)]),i.push([e[0][0]+ut(t,r),e[0][1]+ut(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+ut(t,r),e[o][1]+ut(t,r)]),o===e.length-1&&i.push([e[o][0]+ut(t,r),e[o][1]+ut(t,r)]);return Ws(i,null,r)}function Ws(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(...Kn(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function Vc(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=ut(.5,n)-Math.PI/2;c.push([ut(s,n)+t+.9*i*Math.cos(h-e),ut(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=[ut(s,n)+t+i*Math.cos(f),ut(s,n)+r+o*Math.sin(f)];l.push(u),c.push(u)}c.push([ut(s,n)+t+i*Math.cos(h+2*Math.PI+.5*a),ut(s,n)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([ut(s,n)+t+.98*i*Math.cos(h+a),ut(s,n)+r+.98*o*Math.sin(h+a)]),c.push([ut(s,n)+t+.9*i*Math.cos(h+.5*a),ut(s,n)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function Kc(e,t,r,i,o,s,a,n,l){const c=s+ut(.1,l),h=[];h.push([ut(n,l)+t+.9*i*Math.cos(c-e),ut(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([ut(n,l)+t+i*Math.cos(d),ut(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)]),Ws(h,null,l)}function A_(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:ut(c[0],n)),a[1]+(f?0:ut(c[0],n))]}),h=f?[o,s]:[o+ut(c[u],n),s+ut(c[u],n)],l.push({op:"bcurveTo",data:[e+ut(c[u],n),t+ut(c[u],n),r+ut(c[u],n),i+ut(c[u],n),h[0],h[1]]});return l}function Vi(e){return[...e]}function Zc(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(Vi(e[0]),Vi(e[1]),Vi(e[2]),Vi(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(Vi(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 cs(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function M_(e,t,r){const i=cs(t,r);if(i===0)return cs(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)),cs(e,Er(t,r,o))}function Er(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Zn(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 p=3*h[1]-2*c[1]-f[1];p*=p;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),p<y&&(p=y),u+p})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(cs(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=Er(l,c,.5),u=Er(c,h,.5),p=Er(h,d,.5),m=Er(f,u,.5),y=Er(u,p,.5),x=Er(m,y,.5);Zn([l,f,m,x],0,r,o),Zn([x,y,p,d],0,r,o)}var s,a;return o}function $_(e,t){return Hs(e,0,e.length,t)}function Hs(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=M_(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Hs(e,t,c+1,i,s),Hs(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function Ua(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)Zn(e,3*s,t,i);return r&&r>0?Hs(i,0,i.length,r):i}const ue="none";class Ys{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",[wm(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=F_(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(Ya([c],a)):n.push(Gr([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=Sm(i,o,a),c=Vn(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Vn(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Gr([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",[hs(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=Uc(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=Uc(t,r,i,o,s,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,p,m,y,x,C){const k=f,S=u;let T=Math.abs(p/2),B=Math.abs(m/2);T+=ut(.01*T,C),B+=ut(.01*B,C);let L=y,_=x;for(;L<0;)L+=2*Math.PI,_+=2*Math.PI;_-L>2*Math.PI&&(L=0,_=2*Math.PI);const A=(_-L)/C.curveStepCount,F=[];for(let $=L;$<=_;$+=A)F.push([k+T*Math.cos($),S+B*Math.sin($)]);return F.push([k+T*Math.cos(_),S+B*Math.sin(_)]),F.push([k,S]),Gr([F],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=Yc(t,i);if(i.fill&&i.fill!==ue)if(i.fillStyle==="solid"){const a=Yc(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(...Ua(Zc([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Ua(Zc(c),10,(1+i.roughness)/2))}a.length&&o.push(Gr([a],i))}return i.stroke!==ue&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=hs(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Ya([t],i)):o.push(Gr([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=bm(Cm(Ch(h))),p=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...Ua(x,d)),x=[]},k=()=>{C(),m.length&&(p.push(m),m=[])};for(const{key:T,data:B}of u)switch(T){case"M":k(),y=[B[0],B[1]],m.push(y);break;case"L":C(),m.push([B[0],B[1]]);break;case"C":if(!x.length){const L=m.length?m[m.length-1]:y;x.push([L[0],L[1]])}x.push([B[0],B[1]]),x.push([B[2],B[3]]),x.push([B[4],B[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(k(),!f)return p;const S=[];for(const T of p){const B=$_(T,f);B.length&&S.push(B)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=Xc(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=Xc(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(Ya(l,i));else o.push(Gr(l,i));return a&&(n?l.forEach((h=>{o.push(hs(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 O_{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Ys(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 Vo="http://www.w3.org/2000/svg";class R_{constructor(t,r){this.svg=t,this.gen=new Ys(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(Vo,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(Vo,"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(Vo,"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(Vo,"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 O_(e,t),svg:(e,t)=>new R_(e,t),generator:e=>new Ys(e),newSeed:()=>Ys.newSeed()},dt=g(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ue(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 Me(a,Ce(mr(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],p=yt(h);await nh(u,n),d=u.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:f,label:a}},"labelHelper"),Xa=g(async(e,t,r)=>{const i=r.useHtmlLabels??ie(kt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Me(o,Ce(mr(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(ie(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"),ot=g((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),ht=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 xr(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 p=u/50,m=e+p*l,y=f+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}g(xr,"generateFullSineWavePoints");function To(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),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(To,"generateCirclePoints");function Qn(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(Qn,"mergePaths");var I_=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"),Yr=I_,P_=g(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=kt(),n=ie(a);return await Me(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),cr=P_,Cr=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"),D_=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}=it(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=Ue(r.flowchart.htmlLabels),p=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Me(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let x=y.getBBox();if(u){const Y=y.children[0],N=yt(y);x=Y.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,T=t.y-S/2,B=t.y+S/2,L=t.x-k/2,_=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:T+S/3,A=p?4:0,F=x.height+2*A;let $,H;if(p){const Y=Math.max(F,x.height+2*A),N=L+Y,I=Math.max(0,k-Y);if(t.look==="handDrawn"){const R=rt.svg(f),O=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),z=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),v=R.rectangle(L,T,Y,S,O);$=f.insert(()=>v,":first-child");const U=R.rectangle(N,T,I,S,z);H=f.insert(()=>U,":first-child"),$.select("path:nth-child(2)").attr("style",h.join(";")),$.select("path").attr("style",d.join(";").replace("fill","stroke"))}else $=f.insert("rect",":first-child"),H=f.insert("rect",":first-child"),$.attr("class","swimlane-title").attr("style",c).attr("x",L).attr("y",T).attr("width",Y).attr("height",S).attr("fill",s).attr("stroke",n),H.attr("class","swimlane-body").attr("style",c).attr("x",N).attr("y",T).attr("width",I).attr("height",S).attr("fill","none").attr("stroke",n);const P=L+Y/2,q=t.y;m.attr("transform",`translate(${P}, ${q}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const Y=Math.max(0,_-T),N=Math.min(F,Y),I=T+N,P=Math.max(0,B-I),q=t.x-k/2;if(t.look==="handDrawn"){const z=rt.svg(f),v=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),U=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),D=z.rectangle(q,T,k,N,v);$=f.insert(()=>D,":first-child");const X=z.rectangle(q,I,k,P,U);H=f.insert(()=>X,":first-child"),$.select("path:nth-child(2)").attr("style",h.join(";")),$.select("path").attr("style",d.join(";").replace("fill","stroke"))}else $=f.insert("rect",":first-child"),H=f.insert("rect",":first-child"),$.attr("class","swimlane-title").attr("style",c).attr("x",q).attr("y",T).attr("width",k).attr("height",N).attr("fill",s).attr("stroke",n),H.attr("class","swimlane-body").attr("style",c).attr("x",q).attr("y",I).attr("width",k).attr("height",P).attr("fill","none").attr("stroke",n);const R=t.x-x.width/2,O=T+(N-x.height)/2;m.attr("transform",`translate(${R}, ${O})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const Y=m.select("span");Y&&Y.attr("style",l)}return t.offsetX=0,t.width=k,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(Y){return Yr(t,Y)},{cluster:f,labelBBox:x}},"swimlane"),vm=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}=it(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ie(r),u=d.insert("g").attr("class","cluster-label ");let p;t.labelType==="markdown"?p=await Me(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):p=await cr(u,t.label,t.labelStyle||"",!1,!0);let m=p.getBBox();if(ie(r)){const L=p.children[0],_=yt(p);m=L.getBoundingClientRect(),_.attr("width",m.width),_.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 L=rt.svg(d),_=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),A=L.path(Cr(C,k,y,x,0),_);S=d.insert(()=>(V.debug("Rough node insert CXC",A),A),":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:T}=fa(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+T})`),n){const L=u.select("span");L&&L.attr("style",n)}const B=S.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=m.height-t.padding/2,t.intersect=function(L){return Yr(t,L)},{cluster:d,labelBBox:m}},"rect"),N_=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 Yr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),q_=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 f=c.append("rect");const u=await cr(d,t.label,t.labelStyle,void 0,!0);let p=u.getBBox();if(ie(r)){const A=u.children[0],F=yt(u);p=A.getBoundingClientRect(),F.attr("width",p.width),F.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,T=t.y-C/2;t.width=x;const B=t.y-t.height/2-y+p.height+2;let L;if(t.look==="handDrawn"){const A=t.cssClasses.includes("statediagram-cluster-alt"),F=rt.svg(c),$=t.rx||t.ry?F.path(Cr(S,T,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):F.rectangle(S,T,x,C,{seed:o});L=c.insert(()=>$,":first-child");const H=F.rectangle(S,B,x,k,{fill:A?s:a,fillStyle:A?"hachure":"solid",stroke:l,seed:o});L=c.insert(()=>$,":first-child"),f=c.insert(()=>H)}else L=h.insert("rect",":first-child"),L.attr("class","outer").attr("x",S).attr("y",T).attr("width",x).attr("height",C).attr("data-look",t.look),f.attr("class","inner").attr("x",S).attr("y",B).attr("width",x).attr("height",k);d.attr("transform",`translate(${t.x-p.width/2}, ${T+1-(ie(r)?0:3)})`);const _=L.node().getBBox();return t.height=_.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(A){return Yr(t,A)},{cluster:c,labelBBox:p}},"roundedWithTitle"),z_=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}=it(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ie(r),u=d.insert("g").attr("class","cluster-label "),p=await Me(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=p.getBBox();if(ie(r)){const L=p.children[0],_=yt(p);m=L.getBoundingClientRect(),_.attr("width",m.width),_.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 L=rt.svg(d),_=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),A=L.path(Cr(C,k,y,x,t.rx),_);S=d.insert(()=>(V.debug("Rough node insert CXC",A),A),":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:T}=fa(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+T})`),n){const L=u.select("span");L&&L.attr("style",n)}const B=S.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=m.height-t.padding/2,t.intersect=function(L){return Yr(t,L)},{cluster:d,labelBBox:m}},"kanbanSection"),j_=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,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 p=u.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Yr(t,m)},{cluster:a,labelBBox:{}}},"divider"),W_=vm,H_={rect:vm,squareRect:W_,roundedWithTitle:q_,noteGroup:N_,divider:j_,kanbanSection:z_,swimlane:D_},_m=new Map,Bm=g(async(e,t)=>{const r=t.shape||"rect",i=await H_[r](e,t);return _m.set(t.id,i),i},"insertCluster"),Y_=g(()=>{_m=new Map},"clear");function Lm(e,t){return e.intersect(t)}g(Lm,"intersectNode");var U_=Lm;function Em(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(Em,"intersectEllipse");var Fm=Em;function Am(e,t,r){return Fm(e,t,t,r)}g(Am,"intersectCircle");var X_=Am;function Mm(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&&Jn(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,p=h*t.x+d*t.y+f;if(Math.abs(u)<c&&Math.abs(p)<c&&Jn(u,p))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 k=x<0?(x-y)/m:(x+y)/m;return{x:C,y:k}}}g(Mm,"intersectLine");function Jn(e,t){return e*t>0}g(Jn,"sameSign");var G_=Mm;function $m(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=G_(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,p=Math.sqrt(f*f+u*u),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($m,"intersectPolygon");var V_=$m,tt={node:U_,circle:X_,ellipse:Fm,polygon:V_,rect:Yr};function Om(e,t){const{labelStyles:r}=it(t);t.labelStyle=r;const i=ht(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)),ot(t,d),t.intersect=function(f){return V.info("Circle intersect",t,a,f),tt.circle(t,a,f)},s}g(Om,"anchor");function tl(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,p=f/s,m=Math.sqrt(u**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 T=Math.atan2((i-C)/s,(r-x)/o)-k;a&&T<0&&(T+=2*Math.PI),!a&&T>0&&(T-=2*Math.PI);const B=[];for(let L=0;L<20;L++){const _=L/19,A=k+_*T,F=x+o*Math.cos(A),$=C+s*Math.sin(A);B.push({x:F,y:$})}return B}g(tl,"generateArcPoints");function Rm(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}g(Rm,"calculateArcSagitta");async function Im(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=g(A=>A+a,"calcTotalHeight"),l=g(A=>{const F=A/2;return[F/(2.5+A/50),F]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await dt(e,t,ht(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),p=Rm(d,f,u),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},...tl(-y/2,-x/2,-y/2,x/2,f,u,!1),{x:y/2,y:x/2},...tl(y/2,x/2,y/2,-x/2,f,u,!0)],S=rt.svg(c),T=et(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const B=bt(k),L=S.path(B,T),_=c.insert(()=>L,":first-child");return _.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${f/2}, 0)`),ot(t,_),t.intersect=function(A){return tt.polygon(t,k,A)},c}g(Im,"bowTieRect");function nr(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(nr,"insertPolygonShape");var Ko=12;async function Pm(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+Ko),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,p=0,m=[{x:d+Ko,y:u},{x:f,y:u},{x:f,y:p},{x:d,y:p},{x:d,y:u+Ko},{x:d+Ko,y:u}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),k=et(t,{}),S=bt(m),T=C.path(S,k);y=n.insert(()=>T,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=nr(n,c,h,m);return i&&y.attr("style",i),ot(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},n}g(Pm,"card");function Dm(e,t){const{nodeStyles:r}=it(t);t.label="";const i=e.insert("g").attr("class",ht(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}g(Dm,"choice");async function bh(e,t,r){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await dt(e,t,ht(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),p=et(t,{}),m=u.circle(0,0,h*2,p);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 ot(t,d),t.calcIntersect=function(u,p){const m=u.width/2;return tt.circle(u,m,p)},t.intersect=function(u){return V.info("Circle intersect",t,h,u),tt.circle(t,h,u)},s}g(bh,"circle");function Nm(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(Nm,"createLine");function qm(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",ht(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=Nm(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),ot(t,f),t.intersect=function(u){return V.info("crossedCircle intersect",t,{radius:s,point:u}),tt.circle(t,s,u)},o}g(qm,"crossedCircle");function Je(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),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(Je,"generateCirclePoints");async function zm(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ht(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=[...Je(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Je(c/2+d*2,-d,d,20,-180,-270),...Je(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Je(c/2,h/2,d,20,0,90)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Je(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Je(c/2+c*.1,-d,d,20,-180,-270),...Je(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Je(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",""),k=m.path(C,y),S=bt(p),T=m.path(S,{...y}),B=o.insert("g",":first-child");return B.insert(()=>T,":first-child").attr("stroke-opacity",0),B.insert(()=>k,":first-child"),B.attr("class","text"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.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))})`),ot(t,B),t.intersect=function(L){return tt.polygon(t,p,L)},o}g(zm,"curlyBraceLeft");function tr(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),p=t+r*Math.sin(f);a.push({x:u,y:p})}return a}g(tr,"generateCirclePoints");async function jm(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ht(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=[...tr(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...tr(c/2+d*2,-d,d,20,-180,-270),...tr(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...tr(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...tr(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...tr(c/2+d*2,-d,d,20,-180,-270),...tr(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...tr(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",""),k=m.path(C,y),S=bt(p),T=m.path(S,{...y}),B=o.insert("g",":first-child");return B.insert(()=>T,":first-child").attr("stroke-opacity",0),B.insert(()=>k,":first-child"),B.attr("class","text"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.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))})`),ot(t,B),t.intersect=function(L){return tt.polygon(t,p,L)},o}g(jm,"curlyBraceRight");function Qt(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),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(Qt,"generateCirclePoints");async function Wm(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ht(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=[...Qt(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Qt(c/2+d*2,-d,d,20,-180,-270),...Qt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Qt(c/2,h/2,d,20,0,90)],p=[...Qt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Qt(-c/2-d/2,-d,d,20,0,90),...Qt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Qt(-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},...Qt(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Qt(c/2+d*2,-d,d,20,-180,-270),...Qt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Qt(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},...Qt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Qt(-c/2-d/2,-d,d,20,0,90),...Qt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Qt(-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(u).replace("Z",""),S=y.path(k,x),B=bt(p).replace("Z",""),L=y.path(B,x),_=bt(m),A=y.path(_,{...x}),F=o.insert("g",":first-child");return F.insert(()=>A,":first-child").attr("stroke-opacity",0),F.insert(()=>S,":first-child"),F.insert(()=>L,":first-child"),F.attr("class","text"),f&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),F.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))})`),ot(t,F),t.intersect=function($){return tt.polygon(t,m,$)},o}g(Wm,"curlyBraces");async function Hm(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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:p}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=f,k=x-u,S=C/4,T=[{x:k,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:k,y:C},...To(-k,-C/2,u,50,270,90)],B=bt(T),L=m.path(B,y),_=c.insert(()=>L,":first-child");return _.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(${-d/2}, ${-f/2})`),ot(t,_),t.intersect=function(A){return tt.polygon(t,T,A)},c}g(Hm,"curvedTrapezoid");var K_=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"),Z_=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"),Q_=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Qc=8,Jc=8;async function Ym(e,t){const{labelStyles:r,nodeStyles:i}=it(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<Jc&&(t.width=Jc);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<Qc&&(t.height=Qc)}const{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ht(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 p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=rt.svg(n),x=Z_(0,0,h,u,d,f),C=Q_(0,f,h,u,d,f),k=et(t,{}),S=y.path(x,k),T=y.path(C,et(t,{fill:"none"}));p=n.insert(()=>T,":first-child"),p=n.insert(()=>S,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=K_(0,0,h,u,d,f);p=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Gt(m)).attr("style",i)}return p.attr("label-offset-y",f),p.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),ot(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-f)){let k=f*f*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}g(Ym,"cylinder");async function Pi(e,t,r){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await dt(e,t,ht(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:p}=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(Cr(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(p))}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 ot(t,d),t.calcIntersect=function(m,y){return tt.rect(m,y)},t.intersect=function(m){return tt.rect(t,m)},s}g(Pi,"drawRect");async function Um(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 Pi(e,t,l);if(t.look==="handDrawn"){const u=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(()=>u.line(x.x,x.y,x.x+x.width,x.y,p),".basic.label-container g.label"),c.insert(()=>u.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,f=(Number(h.attr("height"))||n)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}g(Um,"datastore");async function Xm(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(t)),c=n.width+o,h=n.height+s,d=h*.2,f=-c/2,u=-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: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),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(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+d+(t.padding??0)/2-(n.y-(n.top??0))})`),ot(t,k),t.intersect=function(S){return tt.rect(t,S)},a}g(Xm,"dividedRectangle");async function Gm(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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),p=et(t,{roughness:.2,strokeWidth:2.5}),m=et(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,p),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"),p=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),p.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return ot(t,d),t.intersect=function(u){return V.info("DoubleCircle intersect",t,c,u),tt.circle(t,c,u)},n}g(Gm,"doublecircle");function Vm(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",ht(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),ot(t,f),t.intersect=function(u){return V.info("filledCircle intersect",t,{radius:a,point:u}),tt.circle(t,a,u)},s}g(Vm,"filledCircle");var td=10,ed=10;async function Km(e,t){const{labelStyles:r,nodeStyles:i}=it(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<td&&(t.height=td),t.width=(t?.width??0)-s-s/2,t.width<ed&&(t.width=ed));const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ht(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,p=rt.svg(a),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(f),x=p.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,ot(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,f,k),tt.polygon(t,f,k)},a}g(Km,"flippedTriangle");function Zm(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=it(t);t.label="";const a=e.insert("g").attr("class",ht(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 p=f.rectangle(h,d,l,c,u),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),ot(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(Zm,"forkJoin");async function Qm(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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,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-f,y:-d/2},...To(-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=p.path(x,m),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),ot(t,k),t.intersect=function(S){return V.info("Pill intersect",t,{radius:f,point:S}),tt.polygon(t,y,S)},l}g(Qm,"halfRoundedRectangle");var J_=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 Jm(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(t)),f=(t?.height?t?.height:d.height)+l,u=f/o,p=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:p-u,y:0},{x:p,y:-f/2},{x:p-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),k=et(t,{}),S=J_(0,0,p,f,u),T=C.path(S,k);y=h.insert(()=>T,":first-child").attr("transform",`translate(${-p/2}, ${f/2})`),x&&y.attr("style",x)}else y=nr(h,p,f,m);return i&&y.attr("style",i),t.width=p,t.height=f,ot(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}g(Jm,"hexagon");async function ty(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await dt(e,t,ht(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})`),ot(t,u),t.intersect=function(p){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,p)},o}g(ty,"hourglass");async function ey(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(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 dt(e,t,"icon-shape default"),f=t.pos==="t",u=n,p=n,{nodeBorder:m}=r,{stylesMap:y}=Ri(t),x=-p/2,C=-u/2,k=t.label?8:0,S=rt.svg(c),T=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const B=S.rectangle(x,C,p,u,T),L=Math.max(p,h.width),_=u+h.height+k,A=S.rectangle(-L/2,-_/2,L,_,{...T,fill:"transparent",stroke:"none"}),F=c.insert(()=>B,":first-child"),$=c.insert(()=>A);if(t.icon){const H=c.append("g");H.html(`<g>${await Ii(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const Y=H.node().getBBox(),N=Y.width,I=Y.height,P=Y.x,q=Y.y;H.attr("transform",`translate(${-N/2-P},${f?h.height/2+k/2-I/2-q:-h.height/2-k/2-I/2-q})`),H.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-_/2:_/2-h.height})`),F.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),ot(t,$),t.intersect=function(H){if(V.info("iconSquare intersect",t,H),!t.label)return tt.rect(t,H);const Y=t.x??0,N=t.y??0,I=t.height??0;let P=[];return f?P=[{x:Y-h.width/2,y:N-I/2},{x:Y+h.width/2,y:N-I/2},{x:Y+h.width/2,y:N-I/2+h.height+k},{x:Y+p/2,y:N-I/2+h.height+k},{x:Y+p/2,y:N+I/2},{x:Y-p/2,y:N+I/2},{x:Y-p/2,y:N-I/2+h.height+k},{x:Y-h.width/2,y:N-I/2+h.height+k}]:P=[{x:Y-p/2,y:N-I/2},{x:Y+p/2,y:N-I/2},{x:Y+p/2,y:N-I/2+u},{x:Y+h.width/2,y:N-I/2+u},{x:Y+h.width/2/2,y:N+I/2},{x:Y-h.width/2,y:N+I/2},{x:Y-h.width/2,y:N-I/2+u},{x:Y-p/2,y:N-I/2+u}],tt.polygon(t,P,H)},c}g(ey,"icon");async function ry(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(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 dt(e,t,"icon-shape default"),f=20,u=t.label?8:0,p=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Ri(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 T=c.append("g");t.icon&&T.html(`<g>${await Ii(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const B=T.node().getBBox(),L=B.width,_=B.height,A=B.x,F=B.y,$=Math.max(L,_)*Math.SQRT2+f*2,H=C.circle(0,0,$,k),Y=Math.max($,h.width),N=$+h.height+u,I=C.rectangle(-Y/2,-N/2,Y,N,{...k,fill:"transparent",stroke:"none"}),P=c.insert(()=>H,":first-child"),q=c.insert(()=>I);return T.attr("transform",`translate(${-L/2-A},${p?h.height/2+u/2-_/2-F:-h.height/2-u/2-_/2-F})`),T.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})`),P.attr("transform",`translate(0,${p?h.height/2+u/2:-h.height/2-u/2})`),ot(t,q),t.intersect=function(R){return V.info("iconSquare intersect",t,R),tt.rect(t,R)},c}g(ry,"iconCircle");async function iy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(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 dt(e,t,"icon-shape default"),u=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ri(t),k=-m/2,S=-p/2,T=t.label?8:0,B=rt.svg(c),L=et(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const _=C.get("fill");L.stroke=_??x;const A=B.path(Cr(k,S,m,p,5),L),F=Math.max(m,h.width),$=p+h.height+T,H=B.rectangle(-F/2,-$/2,F,$,{...L,fill:"transparent",stroke:"none"}),Y=c.insert(()=>A,":first-child").attr("class","icon-shape2"),N=c.insert(()=>H);if(t.icon){const I=c.append("g");I.html(`<g>${await Ii(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const P=I.node().getBBox(),q=P.width,R=P.height,O=P.x,z=P.y;I.attr("transform",`translate(${-q/2-O},${u?h.height/2+T/2-R/2-z:-h.height/2-T/2-R/2-z})`),I.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-$/2:$/2-h.height})`),Y.attr("transform",`translate(0,${u?h.height/2+T/2:-h.height/2-T/2})`),ot(t,N),t.intersect=function(I){if(V.info("iconSquare intersect",t,I),!t.label)return tt.rect(t,I);const P=t.x??0,q=t.y??0,R=t.height??0;let O=[];return u?O=[{x:P-h.width/2,y:q-R/2},{x:P+h.width/2,y:q-R/2},{x:P+h.width/2,y:q-R/2+h.height+T},{x:P+m/2,y:q-R/2+h.height+T},{x:P+m/2,y:q+R/2},{x:P-m/2,y:q+R/2},{x:P-m/2,y:q-R/2+h.height+T},{x:P-h.width/2,y:q-R/2+h.height+T}]:O=[{x:P-m/2,y:q-R/2},{x:P+m/2,y:q-R/2},{x:P+m/2,y:q-R/2+p},{x:P+h.width/2,y:q-R/2+p},{x:P+h.width/2/2,y:q+R/2},{x:P-h.width/2,y:q+R/2},{x:P-h.width/2,y:q-R/2+p},{x:P-m/2,y:q-R/2+p}],tt.polygon(t,O,I)},c}g(iy,"iconRounded");async function oy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(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 dt(e,t,"icon-shape default"),u=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ri(t),k=-m/2,S=-p/2,T=t.label?8:0,B=rt.svg(c),L=et(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const _=C.get("fill");L.stroke=_??x;const A=B.path(Cr(k,S,m,p,.1),L),F=Math.max(m,h.width),$=p+h.height+T,H=B.rectangle(-F/2,-$/2,F,$,{...L,fill:"transparent",stroke:"none"}),Y=c.insert(()=>A,":first-child"),N=c.insert(()=>H);if(t.icon){const I=c.append("g");I.html(`<g>${await Ii(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const P=I.node().getBBox(),q=P.width,R=P.height,O=P.x,z=P.y;I.attr("transform",`translate(${-q/2-O},${u?h.height/2+T/2-R/2-z:-h.height/2-T/2-R/2-z})`),I.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-$/2:$/2-h.height})`),Y.attr("transform",`translate(0,${u?h.height/2+T/2:-h.height/2-T/2})`),ot(t,N),t.intersect=function(I){if(V.info("iconSquare intersect",t,I),!t.label)return tt.rect(t,I);const P=t.x??0,q=t.y??0,R=t.height??0;let O=[];return u?O=[{x:P-h.width/2,y:q-R/2},{x:P+h.width/2,y:q-R/2},{x:P+h.width/2,y:q-R/2+h.height+T},{x:P+m/2,y:q-R/2+h.height+T},{x:P+m/2,y:q+R/2},{x:P-m/2,y:q+R/2},{x:P-m/2,y:q-R/2+h.height+T},{x:P-h.width/2,y:q-R/2+h.height+T}]:O=[{x:P-m/2,y:q-R/2},{x:P+m/2,y:q-R/2},{x:P+m/2,y:q-R/2+p},{x:P+h.width/2,y:q-R/2+p},{x:P+h.width/2/2,y:q+R/2},{x:P-h.width/2,y:q+R/2},{x:P-h.width/2,y:q-R/2+p},{x:P-m/2,y:q-R/2+p}],tt.polygon(t,O,I)},c}g(oy,"iconSquare");async function sy(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}=it(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 dt(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),T=Math.max(c,f.width),B=h+f.height+x,L=C.rectangle(-T/2,-B/2,T,B,{...k,fill:"none",stroke:"none"}),_=d.insert(()=>S,":first-child"),A=d.insert(()=>L);if(t.img){const F=d.append("image");F.attr("href",t.img),F.attr("width",c),F.attr("height",h),F.attr("preserveAspectRatio","none"),F.attr("transform",`translate(${-c/2},${p?B/2-h:-B/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${p?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),_.attr("transform",`translate(0,${p?f.height/2+x/2:-f.height/2-x/2})`),ot(t,A),t.intersect=function(F){if(V.info("iconSquare intersect",t,F),!t.label)return tt.rect(t,F);const $=t.x??0,H=t.y??0,Y=t.height??0;let N=[];return p?N=[{x:$-f.width/2,y:H-Y/2},{x:$+f.width/2,y:H-Y/2},{x:$+f.width/2,y:H-Y/2+f.height+x},{x:$+c/2,y:H-Y/2+f.height+x},{x:$+c/2,y:H+Y/2},{x:$-c/2,y:H+Y/2},{x:$-c/2,y:H-Y/2+f.height+x},{x:$-f.width/2,y:H-Y/2+f.height+x}]:N=[{x:$-c/2,y:H-Y/2},{x:$+c/2,y:H-Y/2},{x:$+c/2,y:H-Y/2+h},{x:$+f.width/2,y:H-Y/2+h},{x:$+f.width/2/2,y:H+Y/2},{x:$-f.width/2,y:H+Y/2},{x:$-f.width/2,y:H-Y/2+h},{x:$-c/2,y:H-Y/2+h}],tt.polygon(t,N,F)},d}g(sy,"imageSquare");async function ay(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await dt(e,t,ht(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 p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=nr(n,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(ay,"inv_trapezoid");async function ny(e,t){const{shapeSvg:r,bbox:i,label:o}=await dt(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))})`),ot(t,s),t.intersect=function(l){return tt.rect(t,l)},r}g(ny,"labelRect");async function ly(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await dt(e,t,ht(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 p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=nr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(ly,"lean_left");async function hy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await dt(e,t,ht(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 p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=nr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(hy,"lean_right");function cy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",ht(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),p=o.insert(()=>u,":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})`),ot(t,p),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},o}g(cy,"lightningBolt");var tB=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"),eB=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"),rB=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),rd=10,id=10;async function dy(e,t){const{labelStyles:r,nodeStyles:i}=it(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<id&&(t.width=id);const k=x/2/(2.5+x/50);t.height=(t.height??0)-a-k*3,t.height<rd&&(t.height=rd)}const{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ht(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,p=u*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=rt.svg(n),C=eB(0,0,h,u,d,f,p),k=rB(0,f,h,u,d,f),S=et(t,{}),T=x.path(C,S),B=x.path(k,S);n.insert(()=>B,":first-child").attr("class","line"),m=n.insert(()=>T,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=tB(0,0,h,u,d,f,p);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)})`),ot(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),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-f)){let S=f*f*(1-k*k/(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}g(dy,"linedCylinder");async function uy(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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: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:-u/2},{x:-h/2-h/2*.1,y:u/2},...xr(-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),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,${-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))})`),ot(t,k),t.intersect=function(S){return tt.polygon(t,x,S)},n}g(uy,"linedWaveEdgedRect");async function fy(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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,p=f-2*n,m=-u/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+u-n,y:y+p+n},{x:m+u-n,y:y+p},{x:m+u,y:y+p},{x:m+u,y:y+p-n},{x:m+u+n,y:y+p-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}],T=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+p},{x:m+u,y:y+p},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const B=bt(S);let L=C.path(B,k);const _=bt(T);let A=C.path(_,k);t.look!=="handDrawn"&&(L=Qn(L),A=Qn(A));const F=l.insert("g",":first-child");return F.insert(()=>L),F.insert(()=>A),F.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&F.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))})`),ot(t,F),t.intersect=function($){return tt.polygon(t,S,$)},l}g(fy,"multiRect");async function py(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ht(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,p=f+(h?u/2:-u/2),m=-d/2,y=-p/2,x=10,{cssStyles:C}=t,k=xr(m-x,y+p+x,m+d-x,y+p+x,u,.8),S=k?.[k.length-1],T=[{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}],B=[{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}],L=rt.svg(o),_=et(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const A=bt(T),F=L.path(A,_),$=bt(B),H=L.path($,_),Y=o.insert(()=>F,":first-child");return Y.insert(()=>H),Y.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&Y.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&Y.selectAll("path").attr("style",i),Y.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))})`),ot(t,Y),t.intersect=function(N){return tt.polygon(t,T,N)},o}g(py,"multiWaveEdgedRectangle");async function gy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i,t.useHtmlLabels||ie(Ot())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ht(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,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,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))})`),ot(t,x),t.intersect=function(C){return tt.rect(t,C)},a}g(gy,"note");var iB=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 my(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await dt(e,t,ht(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),p=et(t,{}),m=iB(0,0,l),y=u.path(m,p);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=nr(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),ot(t,d),t.calcIntersect=function(u,p){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,p);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}g(my,"question");async function yy(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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,p=u/2,m=[{x:f+p,y:u},{x:f,y:0},{x:f+p,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 k=bt(m),S=x.path(k,C),T=n.insert(()=>S,":first-child");return T.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.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))})`),ot(t,T),t.intersect=function(B){return tt.polygon(t,m,B)},n}g(yy,"rect_left_inv_arrow");async function xy(e,t){const{labelStyles:r,nodeStyles:i}=it(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 cr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ie(kt())){const _=h.children[0],A=yt(h);d=_.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}V.info("Text 2",l);const f=l||[],u=h.getBBox(),p=await cr(n,Array.isArray(f)?f.join("<br/>"):f,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>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),k=d.height+(t.padding||0),S=-d.width/2-x,T=-d.height/2-x;let B,L;if(t.look==="handDrawn"){const _=rt.svg(s),A=et(t,{}),F=_.path(Cr(S,T,C,k,t.rx||0),A),$=_.line(-d.width/2-x,-d.height/2-x+u.height+x,d.width/2+x,-d.height/2-x+u.height+x,A);L=s.insert(()=>(V.debug("Rough node insert CXC",F),$),":first-child"),B=s.insert(()=>(V.debug("Rough node insert CXC",F),F),":first-child")}else B=a.insert("rect",":first-child"),L=a.insert("line"),B.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)),L.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 ot(t,B),t.intersect=function(_){return tt.rect(t,_)},s}g(xy,"rectWithTitle");async function Cy(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 Pi(e,t,o)}g(Cy,"roundedRect");var vr=8;async function by(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?vr:vr*2),h=(t?.height??n.height)+s*2,d=c-vr,f=h,u=vr-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:u,y:p},{x:u+d,y:p},{x:u+d,y:p+f},{x:u-vr,y:p+f},{x:u-vr,y:p},{x:u,y:p},{x:u,y:p+f}],k=y.polygon(C.map(T=>[T.x,T.y]),x),S=a.insert(()=>k,":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(${vr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,S),t.intersect=function(T){return tt.rect(t,T)},a}g(by,"shadedProcess");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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,p=-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 k=[{x:p,y:m},{x:p,y:m+u},{x:p+f,y:m+u},{x:p+f,y:m-u/2}],S=bt(k),T=x.path(S,C),B=n.insert(()=>T,":first-child");return B.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.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))})`),ot(t,B),t.intersect=function(L){return tt.polygon(t,k,L)},n}g(ky,"slopedRect");async function wy(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 Pi(e,t,s)}g(wy,"squareRect");async function Sy(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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),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},...To(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...To(h/2-d,0,d,50,270,450)],y=bt(m),x=u.path(y,p),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),ot(t,C),t.intersect=function(k){return tt.polygon(t,m,k)},n}g(Sy,"stadium");async function Ty(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Pi(e,t,r)}g(Ty,"state");function vy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(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}),p=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:p,stroke:p,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??"",k=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${k})`)}return ot(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}g(vy,"stateEnd");function _y(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,qT(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 ot(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}g(_y,"stateStart");var Vr=8;async function By(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(t)),c=(t?.width??l.width)+2*Vr+s,h=(t?.height??l.height)+a,d=c-2*Vr,f=h,u=-c/2,p=-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,p,d+16,f,x),k=y.line(u+Vr,p,u+Vr,p+f,x),S=y.line(u+Vr+d,p,u+Vr+d,p+f,x);n.insert(()=>k,":first-child"),n.insert(()=>S,":first-child");const T=n.insert(()=>C,":first-child"),{cssStyles:B}=t;T.attr("class","basic label-container").attr("style",Gt(B)),ot(t,T)}else{const y=nr(n,d,f,m);i&&y.attr("style",i),ot(t,y)}return t.intersect=function(y){return tt.polygon(t,m,y)},n}g(By,"subroutine");var Ga=.2;async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=it(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-Ga*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await dt(e,t,ht(t)),c=(t?.height?t?.height:l.height)+a*2,h=Ga*c,d=Ga*c,u=(t?.width?t?.width:l.width)+s*2+h-h,p=c,m=-u/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(n),k=et(t,{}),S=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+p},{x:m-h/2,y:y+p}],T=[{x:m+u-h/2,y:y+p},{x:m+u+h/2,y:y+p},{x:m+u+h/2,y:y+p-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const B=bt(S),L=C.path(B,k),_=bt(T),A=C.path(_,{...k,fillStyle:"solid"}),F=n.insert(()=>A,":first-child");return F.insert(()=>L,":first-child"),F.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),ot(t,F),t.intersect=function($){return tt.polygon(t,S,$)},n}g(Ly,"taggedRect");async function Ey(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ht(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,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:f/2},...xr(-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,k=[{x:x+n-h,y:(C+l)*1.3},{x:x+n,y:C+l-d},{x:x+n,y:(C+l)*.9},...xr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],S=bt(y),T=p.path(S,m),B=bt(k),L=p.path(B,{...m,fillStyle:"solid"}),_=o.insert(()=>L,":first-child");return _.insert(()=>T,":first-child"),_.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.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))})`),ot(t,_),t.intersect=function(A){return tt.polygon(t,y,A)},o}g(Ey,"taggedWaveEdgedRectangle");async function Fy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await dt(e,t,ht(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),ot(t,h),t.intersect=function(d){return tt.rect(t,d)},o}g(Fy,"text");var oB=g((e,t,r,i,o,s)=>`M${e},${t}
234
+ a${o},${s} 0,0,1 0,${-i}
235
+ l${r},0
236
+ a${o},${s} 0,0,1 0,${i}
237
+ M${r},${-i}
238
+ a${o},${s} 0,0,0 0,${i}
239
+ l${-r},0`,"createCylinderPathD"),sB=g((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"),aB=g((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),od=5,sd=10;async function Ay(e,t){const{labelStyles:r,nodeStyles:i}=it(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<od&&(t.height=od);const x=m/2/(2.5+m/50);t.width=(t.width??0)-s-x*3,t.width<sd&&(t.width=sd)}const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ht(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 p;if(t.look==="handDrawn"){const m=rt.svg(a),y=sB(0,0,f,c,d,h),x=aB(0,0,f,c,d,h),C=m.path(y,et(t,{})),k=m.path(x,et(t,{fill:"none"}));p=a.insert(()=>k,":first-child"),p=a.insert(()=>C,":first-child"),p.attr("class","basic label-container"),u&&p.attr("style",u)}else{const m=oB(0,0,f,c,d,h);p=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Gt(u)).attr("style",i),p.attr("class","basic label-container outer-path"),u&&p.selectAll("path").attr("style",u),i&&p.selectAll("path").attr("style",i)}return p.attr("label-offset-x",d),p.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))})`),ot(t,p),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}g(Ay,"tiltedCylinder");async function My(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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 p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=nr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(My,"trapezoid");async function $y(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(t)),d=(t?.width?t?.width:h.width)+s*2,f=(t?.height?t?.height:h.height)+a*2,{cssStyles:u}=t,p=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=p.path(x,m),k=c.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),ot(t,k),t.intersect=function(S){return tt.polygon(t,y,S)},c}g($y,"trapezoidalPentagon");var ad=10,nd=10;async function Oy(e,t){const{labelStyles:r,nodeStyles:i}=it(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<nd&&(t.width=nd),t.height=t?.height??0,t.height<ad&&(t.height=ad));const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ht(t)),c=Ue(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:p}=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),k=a.insert(()=>C,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return p&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=h,t.height=d,ot(t,k),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}g(Oy,"triangle");async function Ry(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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,p=f+(n?u:-u),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,k=rt.svg(l),S=et(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const T=[{x:-d/2-C,y:p/2},...xr(-d/2-C,p/2,d/2+C,p/2,u,.8),{x:d/2+C,y:-p/2},{x:-d/2-C,y:-p/2}],B=bt(T),L=k.path(B,S),_=l.insert(()=>L,":first-child");return _.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.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))})`),ot(t,_),t.intersect=function(A){return tt.polygon(t,T,A)},l}g(Ry,"waveEdgedRectangle");async function Iy(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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,p=rt.svg(n),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...xr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...xr(c/2,-f/2,-c/2,-f/2,d,-1)],x=bt(y),C=p.path(x,m),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),ot(t,k),t.intersect=function(S){return tt.polygon(t,y,S)},n}g(Iy,"waveRectangle");var Rt=10;async function Py(e,t){const{labelStyles:r,nodeStyles:i}=it(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 dt(e,t,ht(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,p=-f/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{}),C=[{x:u-Rt,y:p-Rt},{x:u-Rt,y:p+f},{x:u+d,y:p+f},{x:u+d,y:p-Rt}],k=`M${u-Rt},${p-Rt} L${u+d},${p-Rt} L${u+d},${p+f} L${u-Rt},${p+f} L${u-Rt},${p-Rt}
240
+ M${u-Rt},${p} L${u+d},${p}
241
+ M${u},${p-Rt} L${u},${p+f}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(k,x),T=a.insert(()=>S,":first-child");return T.attr("transform",`translate(${Rt/2}, ${Rt/2})`),T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&T.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))})`),ot(t,T),t.intersect=function(B){return tt.polygon(t,C,B)},a}g(Py,"windowPane");var ld=new Set(["redux-color","redux-dark-color"]),nB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function kh(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:Z}=Ot(),{background:K}=Z,at={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${K}`]};await kh(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:p}=it(t);if(r.attributes.length===0&&t.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};We(t.label,c)+Z.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const K=await Pi(e,t,Z);if(i!=null&&ld.has(i)){const at=r.colorIndex??0;K.attr("data-color-id",`color-${at%l.length}`)}if(!Ue(c.htmlLabels)){const at=K.select("text"),gt=at.node()?.getBBox();at.attr("transform",`translate(${-gt.width/2}, 0)`)}return K}c.htmlLabels||(h*=1.25,d*=1.25);let m=ht(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await Jr(y,t.label??"",c,0,0,["name"],u);x.height+=d;let C=0;const k=[],S=[];let T=0,B=0,L=0,_=0,A=!0,F=!0;for(const Z of r.attributes){const K=await Jr(y,Z.type,c,0,C,["attribute-type"],u);T=Math.max(T,K.width+h);const at=await Jr(y,Z.name,c,0,C,["attribute-name"],u);B=Math.max(B,at.width+h);const gt=await Jr(y,Z.keys.join(),c,0,C,["attribute-keys"],u);L=Math.max(L,gt.width+h);const ct=await Jr(y,Z.comment,c,0,C,["attribute-comment"],u);_=Math.max(_,ct.width+h);const mt=Math.max(K.height,at.height,gt.height,ct.height)+d;S.push({yOffset:C,rowHeight:mt}),C+=mt}let $=4;L<=h&&(A=!1,L=0,$--),_<=h&&(F=!1,_=0,$--);const H=y.node().getBBox();if(x.width+h*2-(T+B+L+_)>0){const Z=x.width+h*2-(T+B+L+_);T+=Z/$,B+=Z/$,L>0&&(L+=Z/$),_>0&&(_+=Z/$)}const Y=T+B+L+_,N=rt.svg(y),I=et(t,{});t.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let P=0;S.length>0&&(P=S.reduce((Z,K)=>Z+(K?.rowHeight??0),0));const q=Math.max(H.width+h*2,t?.width||0,Y),R=Math.max((P??0)+x.height,t?.height||0),O=-q/2,z=-R/2;if(y.selectAll("g:not(:first-child)").each((Z,K,at)=>{const gt=yt(at[K]),ct=gt.attr("transform");let mt=0,Ft=0;if(ct){const Mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ct);Mt&&(mt=parseFloat(Mt[1]),Ft=parseFloat(Mt[2]),gt.attr("class").includes("attribute-name")?mt+=T:gt.attr("class").includes("attribute-keys")?mt+=T+B:gt.attr("class").includes("attribute-comment")&&(mt+=T+B+L))}gt.attr("transform",`translate(${O+h/2+mt}, ${Ft+z+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(z+d/2)+")"),i!=null&&ld.has(i)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const v=N.rectangle(O,z,q,R,I),U=y.insert(()=>v,":first-child").attr("class","outer-path").attr("style",f.join(""));k.push(0);for(const[Z,K]of S.entries()){const gt=(Z+1)%2===0&&K.yOffset!==0,ct=N.rectangle(O,x.height+z+K?.yOffset,q,K?.rowHeight,{...I,fill:gt?s:a,stroke:n});y.insert(()=>ct,"g.label").attr("style",f.join("")).attr("class",`row-rect-${gt?"even":"odd"}`)}const D=1e-4;let X=ti(O,x.height+z,q+O,x.height+z,D),G=N.polygon(X.map(Z=>[Z.x,Z.y]),I);if(y.insert(()=>G).attr("class","divider"),X=ti(T+O,x.height+z,T+O,R+z,D),G=N.polygon(X.map(Z=>[Z.x,Z.y]),I),y.insert(()=>G).attr("class","divider"),A){const Z=T+B+O;X=ti(Z,x.height+z,Z,R+z,D),G=N.polygon(X.map(K=>[K.x,K.y]),I),y.insert(()=>G).attr("class","divider")}if(F){const Z=T+B+L+O;X=ti(Z,x.height+z,Z,R+z,D),G=N.polygon(X.map(K=>[K.x,K.y]),I),y.insert(()=>G).attr("class","divider")}for(const Z of k){const K=x.height+z+Z;X=ti(O,K,q+O,K,D),G=N.polygon(X.map(at=>[at.x,at.y]),I),y.insert(()=>G).attr("class","divider")}if(ot(t,U),p&&t.look!=="handDrawn")if(i!=null&&nB.has(i))y.selectAll("path").attr("style",p);else{const K=p.split(";")?.filter(at=>at.includes("stroke"))?.map(at=>`${at}`).join("; ");y.selectAll("path").attr("style",K??""),y.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(Z){return tt.rect(t,Z)},y}g(kh,"erBox");async function Jr(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!==hn(t)&&(t=hn(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=n.node().appendChild(await Me(n,t,{width:We(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();if(Ue(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(Jr,"addText");function ti(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(ti,"lineToPolygon");async function Dy(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",ht(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 oo(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await oo(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();f=p.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const k=await oo(c,C,m,[C.parseClassifier()]);m+=k+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 k=await oo(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+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}}g(Dy,"textHelper");async function oo(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:Ue(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Ti(n)&&(a=!0);const l=await Me(o,Ll(mr(n)),{width:We(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 p=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",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(),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("&gt"))&&(d.textContent=n[0]+n.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").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(oo,"addText");async function Ny(e,t){const r=kt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ue(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Dy(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=it(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.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,T=-C/2;let B=p?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(B=s*2);const L=m.rectangle(S-s,T-s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+B,y),_=c.insert(()=>L,":first-child");_.attr("class","basic label-container outer-path");const A=_.node().getBBox(),F=c.select(".annotation-group").node().getBBox().height-(p?s/2:0)||0,$=c.select(".label-group").node().getBBox().height-(p?s/2:0)||0,H=c.select(".members-group").node().getBBox().height-(p?s/2:0)||0,Y=(F+$+T+s-(T-s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((N,I,P)=>{const q=yt(P[I]),R=q.attr("transform");let O=0;if(R){const D=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);D&&(O=parseFloat(D[2]))}let z=O+T+s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(q.attr("class").includes("methods-group")){const U=Math.max(H,a/2);k?z=Math.max(Y,F+$+U+T+a*2+s)+a*2:z=F+$+U+T+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?z=O-a:z=O),n||(z-=4);let v=S;(q.attr("class").includes("label-group")||q.attr("class").includes("annotation-group"))&&(v=-q.node()?.getBBox().width/2||0,c.selectAll("text").each(function(U,D,X){window.getComputedStyle(X[D]).textAnchor==="middle"&&(v=0)})),q.attr("transform",`translate(${v}, ${z})`)}),l.members.length>0||l.methods.length>0||p){const N=F+$+T+s,I=m.line(A.x,N,A.x+A.width,N+.001,y);c.insert(()=>I).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(p||l.members.length>0||l.methods.length>0){const N=F+$+H+T+a*2+s,I=m.line(A.x,k?Math.max(Y,N):N,A.x+A.width,(k?Math.max(Y,N):N)+.001,y);c.insert(()=>I).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),_.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 N=RegExp(/color\s*:\s*([^;]*)/),I=N.exec(u);if(I){const P=I[0].replace("color","fill");c.selectAll("tspan").attr("style",P)}else if(d){const P=N.exec(d);if(P){const q=P[0].replace("color","fill");c.selectAll("tspan").attr("style",q)}}}return ot(t,_),t.intersect=function(N){return tt.rect(t,N)},c}g(Ny,"classBox");async function qy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=ht(t),{themeVariables:h}=kt(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let p;l?p=await De(u,`&lt;&lt;${o.type}&gt;&gt;`,0,t.labelStyle):p=await De(u,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let m=p;const y=await De(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const A=await De(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=A;const F=await De(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=F;const $=await De(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=$,await De(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const A=await De(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=A,await De(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,k=-x/2,S=-C/2,T=rt.svg(u),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const L=T.rectangle(k,S,x,C,B),_=u.insert(()=>L,":first-child");if(_.attr("class","basic label-container outer-path").attr("style",i),d?.length){const A=t.colorIndex??0;u.attr("data-color-id",`color-${A%d.length}`)}if(u.selectAll(".label").each((A,F,$)=>{const H=yt($[F]),Y=H.attr("transform");let N=0,I=0;if(Y){const O=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Y);O&&(N=parseFloat(O[1]),I=parseFloat(O[2]))}const P=I-C/2;let q=k+a/2;(F===0||F===1)&&(q=N),H.attr("transform",`translate(${q}, ${P+a})`)}),m>p+y+n){const A=S+p+y+n;let F;if(t.look==="neo"){const Y=[[k,A],[k+x,A],[k+x,A+.001],[k,A+.001]];F=T.polygon(Y,B)}else F=T.line(k,A,k+x,A,B);u.insert(()=>F).attr("class","divider")}return ot(t,_),t.intersect=function(A){return tt.rect(t,A)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}g(qy,"requirementBox");async function De(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 Me(o,Ll(mr(t)),{width:We(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(De,"addText");var lB=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 zy(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ht(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 p,m;f?{label:p,bbox:m}=await Xa(f,"ticket"in t&&t.ticket||"",u):{label:p,bbox:m}=await Xa(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:x}=await Xa(n,"assigned"in t&&t.assigned||"",u);t.width=a;const C=10,k=t?.width||0,S=Math.max(m.height,x.height)/2,T=Math.max(l.height+C*2,t?.height||0)+S,B=-k/2,L=-T/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 _;const{rx:A,ry:F}=t,{cssStyles:$}=t;if(t.look==="handDrawn"){const H=rt.svg(n),Y=et(t,{}),N=A||F?H.path(Cr(B,L,k,T,A||0),Y):H.rectangle(B,L,k,T,Y);_=n.insert(()=>N,":first-child"),_.attr("class","basic label-container").attr("style",$||null)}else{_=n.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",o).attr("rx",A??5).attr("ry",F??5).attr("x",B).attr("y",L).attr("width",k).attr("height",T);const H="priority"in t&&t.priority;if(H){const Y=n.append("line"),N=B+2,I=L+Math.floor((A??0)/2),P=L+T-Math.floor((A??0)/2);Y.attr("x1",N).attr("y1",I).attr("x2",N).attr("y2",P).attr("stroke-width","4").attr("stroke",lB(H))}}return ot(t,_),t.height=T,t.intersect=function(H){return tt.rect(t,H)},n}g(zy,"kanbanItem");async function jy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await dt(e,t,ht(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,p=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 ${p*.25},${-1*m*.1}
243
+ a${h},${h} 1 0,0 ${p*.25},0
244
+ a${h},${h} 1 0,0 ${p*.25},0
245
+ a${h},${h} 1 0,0 ${p*.25},${m*.1}
246
+
247
+ a${h},${h} 1 0,0 ${p*.15},${m*.33}
248
+ a${h*.8},${h*.8} 1 0,0 0,${m*.34}
249
+ a${h},${h} 1 0,0 ${-1*p*.15},${m*.33}
250
+
251
+ a${h},${h} 1 0,0 ${-1*p*.25},${m*.15}
252
+ a${h},${h} 1 0,0 ${-1*p*.25},0
253
+ a${h},${h} 1 0,0 ${-1*p*.25},0
254
+ a${h},${h} 1 0,0 ${-1*p*.25},${-1*m*.15}
255
+
256
+ a${h},${h} 1 0,0 ${-1*p*.1},${-1*m*.33}
257
+ a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
258
+ a${h},${h} 1 0,0 ${p*.1},${-1*m*.33}
259
+ H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),k=et(t,{}),S=C.path(x,k);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(${-p/2}, ${-m/2})`),ot(t,y),t.calcIntersect=function(C,k){return tt.rect(C,k)},t.intersect=function(C){return V.info("Bang intersect",t,C),tt.rect(t,C)},o}g(jy,"bang");async function Wy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await dt(e,t,ht(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:p}=t;let m;const y=`M0 0
260
+ a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
261
+ a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}
262
+ a${d},${d} 1 0,1 ${l*.35},${l*.2}
263
+
264
+ a${h},${h} 1 0,1 ${l*.15},${c*.35}
265
+ a${u},${u} 1 0,1 ${-1*l*.15},${c*.65}
266
+
267
+ a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
268
+ a${f},${f} 1 0,1 ${-1*l*.5},0
269
+ a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
270
+
271
+ a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
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,{}),k=x.path(y,C);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Gt(p))}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})`),ot(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}g(Wy,"cloud");async function Hy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await dt(e,t,ht(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?`
274
+ M${-l/2} ${c/2-h}
275
+ v${-c+2*h}
276
+ q0,-${h} ${h},-${h}
277
+ h${l-2*h}
278
+ q${h},0 ${h},${h}
279
+ v${c-h}
280
+ H${-l/2}
281
+ Z
282
+ `:`
283
+ M${-l/2} ${c/2-h}
284
+ v${-c+2*h}
285
+ q0,-${h} ${h},-${h}
286
+ h${l-2*h}
287
+ q${h},0 ${h},${h}
288
+ v${c-2*h}
289
+ q0,${h} ${-h},${h}
290
+ h${-(l-2*h)}
291
+ q${-h},0 ${-h},${-h}
292
+ Z
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()),ot(t,f),t.calcIntersect=function(u,p){return tt.rect(u,p)},t.intersect=function(u){return tt.rect(t,u)},o}g(Hy,"defaultMindmapNode");async function Yy(e,t){const r={padding:t.padding??0};return bh(e,t,r)}g(Yy,"mindmapCircle");var hB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:wy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Cy},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Sy},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:By},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Ym},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Um},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:bh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:jy},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Wy},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:my},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Jm},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:hy},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:ly},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:My},{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:ay},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Gm},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Fy},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Pm},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:by},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:_y},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:vy},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Zm},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:ty},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:zm},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:jm},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Wm},{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:Ry},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Qm},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Ay},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:dy},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Hm},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Xm},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Oy},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Py},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Vm},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:$y},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Km},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:ky},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:py},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:fy},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Im},{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:Ey},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Ly},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Iy},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:yy},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:uy}],cB=g(()=>{const t=[...Object.entries({state:Ty,choice:Dm,note:gy,rectWithTitle:xy,labelRect:ny,iconSquare:oy,iconCircle:ry,icon:ey,iconRounded:iy,imageSquare:sy,anchor:Om,kanbanItem:zy,mindmapCircle:Yy,defaultMindmapNode:Hy,classBox:Ny,erBox:kh,requirementBox:qy}),...hB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Uy=cB();function Xy(e){return e in Uy}g(Xy,"isValidShape");var Ca=new Map;async function wh(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?Uy[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),Ca.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(wh,"insertNode");var dB=g((e,t)=>{Ca.set(t.id,e)},"setNodeElem"),uB=g(()=>{Ca.clear()},"clear"),fB=g(e=>{const t=Ca.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"),ei=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"),Jt={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},hd={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function so(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(so,"calculateDeltaAndAngle");var $t=g(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),Gy=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(Jt,e.arrowTypeStart)){const{angle:u,deltaX:p}=so(i[0],i[1]);o=Jt[e.arrowTypeStart]*Math.cos(u)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Jt,e.arrowTypeEnd)){const{angle:u,deltaX:p}=so(i[i.length-1],i[i.length-2]);o=Jt[e.arrowTypeEnd]*Math.cos(u)*(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=Jt[e.arrowTypeStart],d=Jt[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: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(Jt,e.arrowTypeStart)){const{angle:u,deltaY:p}=so(i[0],i[1]);o=Jt[e.arrowTypeStart]*Math.abs(Math.sin(u))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Jt,e.arrowTypeEnd)){const{angle:u,deltaY:p}=so(i[i.length-1],i[i.length-2]);o=Jt[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(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=Jt[e.arrowTypeStart],d=Jt[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"),pB=g((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"),gB={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=g((e,t,r,i,o,s,a=!1,n)=>{const l=gB[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 p=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${p}`;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(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}#${u})`)},"addEdgeMarker"),yB=g(e=>typeof e=="string"?e:kt()?.flowchart?.curve,"resolveEdgeCurveType"),vo=new Map,Xt=new Map,xB=g(()=>{vo.clear(),Xt.clear()},"clear"),Ki=g(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),Vy=g(async(e,t)=>{const r=kt();let i=ie(r);const{labelStyles:o}=it(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 Me(e,t.label,{style:Ki(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],p=yt(c);h=u.getBoundingClientRect(),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const u=yt(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",ei(d,i)),vo.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"),p=u.insert("g").attr("class","inner"),m=await cr(p,t.startLabelLeft,Ki(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)}p.attr("transform",ei(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).startLeft=u,ao(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await cr(p,t.startLabelRight,Ki(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)}p.attr("transform",ei(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).startRight=u,ao(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await cr(u,t.endLabelLeft,Ki(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)}p.attr("transform",ei(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).endLeft=u,ao(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await cr(u,t.endLabelRight,Ki(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)}p.attr("transform",ei(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).endRight=u,ao(f,t.endLabelRight)}return c},"insertEdgeLabel");function ao(e,t){ie(kt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(ao,"setTerminalWidth");var Ky=g((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,vo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=kt(),{subGraphTitleTotalMargin:o}=fa(i);if(e.label){const s=vo.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=Xt.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=Xt.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=Xt.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=Xt.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"),CB=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"),bB=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"),kB=g((e,t,r)=>{V.debug(`intersection calc abc89:
294
+ outsidePoint: ${JSON.stringify(t)}
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 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"),dd=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),!bB(t,s)&&!o){const a=kB(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 Zy(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(Zy,"extractCornerPoints");var ud=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"),wB=g(function(e){const{cornerPointPositions:t}=Zy(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=ud(o,a,5),l=ud(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"),SB=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"),Qy=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 f=o;var u=s;const p=[];for(const R in t.cssCompiledStyles)Gl(R)||p.push(t.cssCompiledStyles[R]);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 R=h.slice(1,-1),O=R[0],z=R[R.length-1],v=.5,U=Math.abs(h[h.length-1].x-z.x)<v&&Math.abs(h[h.length-1].y-z.y)<v,D=f.intersect(O),X=U?z:u.intersect(z),G=Math.abs(X.x-z.x)<v&&Math.abs(X.y-z.y)<v,K=Math.abs(D.x-O.x)<v&&Math.abs(D.y-O.y)<v?[]:[D],at=G?[]:[X];h=[...K,...R,...at]}h=CB(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=dd(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=dd(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(R=>!Number.isNaN(R.y));const x=yB(t.curve);x!=="rounded"&&(y=wB(y));let C=co;switch(x){case"linear":C=co;break;case"basis":C=Ls;break;case"cardinal":C=uf;break;case"bumpX":C=nf;break;case"bumpY":C=lf;break;case"catmullRom":C=pf;break;case"monotoneX":C=bf;break;case"monotoneY":C=kf;break;case"natural":C=Sf;break;case"step":C=Tf;break;case"stepAfter":C=_f;break;case"stepBefore":C=vf;break;case"rounded":C=co;break;default:C=Ls}const{x:k,y:S}=Gy(t),T=sf().x(k).y(S).curve(C);let B;switch(t.thickness){case"normal":B="edge-thickness-normal";break;case"thick":B="edge-thickness-thick";break;case"invisible":B="edge-thickness-invisible";break;default:B="edge-thickness-normal"}switch(t.pattern){case"solid":B+=" edge-pattern-solid";break;case"dotted":B+=" edge-pattern-dotted";break;case"dashed":B+=" edge-pattern-dashed";break;default:B+=" edge-pattern-solid"}let L,_=x==="rounded"?Jy(t0(y,t),5):T(y);const A=Array.isArray(t.style)?t.style:[t.style];let F=A.find(R=>R?.startsWith("stroke:")),$="";t.animate&&($="edge-animation-fast"),t.animation&&($="edge-animation-"+t.animation);let H=!1;if(t.look==="handDrawn"){const R=rt.svg(e);Object.assign([],y);const O=R.path(_,{roughness:.3,seed:l});B+=" transition",L=yt(O).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+B+(t.classes?" "+t.classes:"")+($?" "+$:"")).attr("style",A?A.reduce((v,U)=>v+";"+U,""):"");let z=L.attr("d");L.attr("d",z),e.node().appendChild(L.node())}else{const R=p.join(";"),O=A?A.reduce((G,Z)=>G+Z+";",""):"",z=(R?R+";"+O+";":O)+";"+(A?A.reduce((G,Z)=>G+";"+Z,""):"");L=e.append("path").attr("d",_).attr("id",`${a}-${t.id}`).attr("class"," "+B+(t.classes?" "+t.classes:"")+($?" "+$:"")).attr("style",z),F=z.match(/stroke:([^;]+)/)?.[1],H=t.animate===!0||!!t.animation||R.includes("animation");const v=L.node(),U=typeof v.getTotalLength=="function"?v.getTotalLength():0,D=hd[t.arrowTypeStart]||0,X=hd[t.arrowTypeEnd]||0;if(t.look==="neo"&&!H){const Z=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?SB(U,D,X):`0 ${D} ${U-D-X} ${X}`}; stroke-dashoffset: 0;`;L.attr("style",Z+L.attr("style"))}}L.attr("data-edge",!0),L.attr("data-et","edge"),L.attr("data-id",t.id),L.attr("data-points",m),L.attr("data-look",Gt(t.look)),t.showPoints&&y.forEach(R=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",R.x).attr("cy",R.y)});let Y="";(kt().flowchart.arrowMarkerAbsolute||kt().state.arrowMarkerAbsolute)&&(Y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,Y=Y.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const N=!H&&t?.look==="neo";pB(L,t,Y,a,i,N,F);const I=Math.floor(h.length/2),P=h[I];xe.isLabelCoordinateInPath(P,L.attr("d"))||(d=!0);let q={};return d&&(q.updatedPath=h),q.originalPath=t.points,q},"insertEdge");function Jy(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),p=Math.hypot(d,f);if(u<o||p<o){r+=`L${a.x},${a.y}`;continue}const m=c/u,y=h/u,x=d/p,C=f/p,k=m*x+y*C,S=Math.max(-1,Math.min(1,k)),T=Math.acos(S);if(T<o||Math.abs(Math.PI-T)<o){r+=`L${a.x},${a.y}`;continue}const B=Math.min(t/Math.sin(T/2),u/2,p/2),L=a.x-m*B,_=a.y-y*B,A=a.x+x*B,F=a.y+C*B;r+=`L${L},${_}`,r+=`Q${a.x},${a.y} ${A},${F}`}}return r}g(Jy,"generateRoundedPath");function el(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(el,"calculateDeltaAndAngle");function t0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Jt[t.arrowTypeStart]){const o=Jt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=el(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&&Jt[t.arrowTypeEnd]){const o=Jt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=el(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(t0,"applyMarkerOffsetsToPoints");var TB=g((e,t,r,i)=>{t.forEach(o=>{XB[o](e,r,i)})},"insertMarkers"),vB=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"),_B=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"),BB=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"),LB=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"),EB=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"),FB=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"),AB=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"),MB=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"),$B=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"),OB=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"),RB=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"),IB=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"),PB=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"),DB=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"),NB=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"),qB=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"),zB=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"),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+"-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"),WB=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
297
+ L20,10
298
+ M20,10
299
+ L0,20`)},"requirement_arrow"),HB=g((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
+ L20,10
301
+ M20,10
302
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),YB=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"),UB=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"),XB={extension:vB,composition:_B,aggregation:BB,dependency:LB,lollipop:EB,point:FB,circle:AB,cross:MB,barb:$B,barbNeo:OB,only_one:RB,zero_or_one:IB,one_or_more:PB,zero_or_more:DB,only_one_neo:NB,zero_or_one_neo:qB,one_or_more_neo:zB,zero_or_more_neo:jB,requirement_arrow:WB,requirement_contains:YB,requirement_arrow_neo:HB,requirement_contains_neo:UB},e0=TB,GB={common:$i,getConfig:Ot,insertCluster:Bm,insertEdge:Qy,insertEdgeLabel:Vy,insertMarkers:e0,insertNode:wh,interpolateToCurve:eh,labelHelper:dt,log:V,positionEdgeLabel:Ky},_o={},r0=g(e=>{for(const t of e)_o[t.name]=t},"registerLayoutLoaders"),VB=g(()=>{r0([{name:"dagre",loader:g(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-yjrP1oXL.cjs")),"loader")},{name:"swimlane",loader:g(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-DZLnPVID.cjs")),"loader")},{name:"cose-bilkent",loader:g(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-X2Leg8js.cjs")),"loader")}])},"registerDefaultLayoutLoaders");VB();var KB=g(async(e,t,r)=>{if(!(e.layoutAlgorithm in _o))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=_o[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,GB,{algorithm:i.algorithm},r)},"render"),ZB=g((e="",{fallback:t="dagre"}={})=>{if(e in _o)return e;if(t in _o)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"),Sh="comm",i0="rule",o0="decl",QB="@media",JB="@import",tL="@supports",eL="@namespace",rl="@keyframes",s0="@layer",rL="@scope",iL=Math.abs,po=String.fromCharCode;function a0(e){return e.trim()}function il(e,t,r){return e.replace(t,r)}function ni(e,t){return e.charCodeAt(t)|0}function Fi(e,t,r){return e.slice(t,r)}function Ne(e){return e.length}function n0(e){return e.length}function Zo(e,t){return t.push(e),e}var ba=1,Ai=1,l0=0,be=0,zt=0,Di="";function Th(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:ba,column:Ai,length:a,return:"",siblings:n}}function oL(){return zt}function sL(){return zt=be>0?ni(Di,--be):0,Ai--,zt===10&&(Ai=1,ba--),zt}function Ee(){return zt=be<l0?ni(Di,be++):0,Ai++,zt===10&&(Ai=1,ba++),zt}function dr(){return ni(Di,be)}function ds(){return be}function ka(e,t){return Fi(Di,e,t)}function Bo(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 aL(e){return ba=Ai=1,l0=Ne(Di=e),be=0,[]}function nL(e){return Di="",e}function Va(e){return a0(ka(be-1,ol(e===91?e+2:e===40?e+1:e)))}function lL(e){for(;(zt=dr())&&zt<33;)Ee();return Bo(e)>2||Bo(zt)>3?"":" "}function hL(e,t){for(;--t&&Ee()&&!(zt<48||zt>102||zt>57&&zt<65||zt>70&&zt<97););return ka(e,ds()+(t<6&&dr()==32&&Ee()==32))}function ol(e){for(;Ee();)switch(zt){case e:return be;case 34:case 39:e!==34&&e!==39&&ol(zt);break;case 40:e===41&&ol(e);break;case 92:Ee();break}return be}function cL(e,t){for(;Ee()&&e+zt!==57;)if(e+zt===84&&dr()===47)break;return"/*"+ka(t,be-1)+"*"+po(e===47?e:Ee())}function dL(e){for(;!Bo(dr());)Ee();return ka(e,be)}function uL(e){return nL(us("",null,null,null,[""],e=aL(e),0,[0],e))}function us(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,p=0,m=1,y=1,x=1,C=0,k=0,S="",T=o,B=s,L=i,_=S;y;)switch(p=k,k=Ee()){case 40:p!=108&&ni(_,d-1)==58?(C++,_+="("):_+=Va(k);break;case 41:C--,_+=")";break;case 34:case 39:case 91:_+=Va(k);break;case 9:case 10:case 13:case 32:if(C>0){_+=po(k);break}_+=lL(p);break;case 92:_+=hL(ds()-1,7);continue;case 47:switch(dr()){case 42:case 47:Zo(fL(cL(Ee(),ds()),t,r,l),l),(Bo(p||1)==5||Bo(dr()||1)==5)&&Ne(_)&&Fi(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:n[c++]=Ne(_)*x;case 125*m:case 59:case 0:if(C>0&&k){_+=po(k);break}switch(k){case 0:case 125:y=0;case 59+h:x==-1&&(_=il(_,/\f/g,"")),u>0&&(Ne(_)-d||m===0)&&Zo(u>32?pd(_+";",i,r,d-1,l):pd(il(_," ","")+";",i,r,d-2,l),l);break;case 59:_+=";";default:if(Zo(L=fd(_,t,r,c,h,o,n,S,T=[],B=[],d,s),s),k===123)if(h===0)us(_,t,L,L,T,s,d,n,B);else{switch(f){case 99:if(ni(_,3)===110)break;case 108:if(ni(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?us(e,L,L,i&&Zo(fd(e,L,L,0,0,o,n,S,o,T=[],d,B),B),o,B,d,n,i?T:B):us(_,L,L,L,[""],B,0,n,B)}}c=h=u=0,m=x=1,S=_="",d=a;break;case 58:d=1+Ne(_),u=p;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&sL()==125)continue}switch(_+=po(k),k*m){case 38:x=h>0?1:(_+="\f",-1);break;case 44:if(C>0)break;n[c++]=(Ne(_)-1)*x,x=1;break;case 64:dr()===45&&(_+=Va(Ee())),f=dr(),h=d=Ne(S=_+=dL(ds())),k++;break;case 45:p===45&&Ne(_)==2&&(m=0)}}return s}function fd(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],p=n0(u),m=0,y=0,x=0;m<i;++m)for(var C=0,k=Fi(e,f+1,f=iL(y=a[m])),S=e;C<p;++C)(S=a0(y>0?u[C]+" "+k:il(k,/&\f/g,u[C])))&&(l[x++]=S);return Th(e,t,r,o===0?i0:n,l,c,h,d)}function fL(e,t,r,i){return Th(e,t,r,Sh,po(oL()),Fi(e,2,-2),0,i)}function pd(e,t,r,i,o){return Th(e,t,r,o0,Fi(e,0,i),Fi(e,i+1,-1),i,o)}function sl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function pL(e,t,r,i){switch(e.type){case s0:if(e.children.length)break;case JB:case eL:case o0:return e.return=e.return||e.value;case Sh:return"";case rl:return e.return=e.value+"{"+sl(e.children,i)+"}";case i0:if(!Ne(e.value=e.props.join(",")))return""}return Ne(r=sl(e.children,i))?e.return=e.value+"{"+r+"}":""}function gL(e){var t=n0(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 h0="c4",mL=g(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),yL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-C9aMoZww.cjs"));return{id:h0,diagram:e}},"loader"),xL={id:h0,detector:mL,loader:yL},CL=xL,c0="flowchart",bL=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),kL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-DDbv1eCW.cjs"));return{id:c0,diagram:e}},"loader"),wL={id:c0,detector:bL,loader:kL},SL=wL,d0="flowchart-v2",TL=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"),vL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-DDbv1eCW.cjs"));return{id:d0,diagram:e}},"loader"),_L={id:d0,detector:TL,loader:vL},BL=_L,u0="swimlane",LL=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),EL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-CMa-ZboO.cjs"));return{id:u0,diagram:e}},"loader"),FL={id:u0,detector:LL,loader:EL},AL=FL,f0="er",ML=g(e=>/^\s*erDiagram/.test(e),"detector"),$L=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-CMIoja24.cjs"));return{id:f0,diagram:e}},"loader"),OL={id:f0,detector:ML,loader:$L},RL=OL,p0="gitGraph",IL=g(e=>/^\s*gitGraph/.test(e),"detector"),PL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-GII6PPu9.cjs"));return{id:p0,diagram:e}},"loader"),DL={id:p0,detector:IL,loader:PL},NL=DL,g0="gantt",qL=g(e=>/^\s*gantt/.test(e),"detector"),zL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-Drcm5yEd.cjs"));return{id:g0,diagram:e}},"loader"),jL={id:g0,detector:qL,loader:zL},WL=jL,m0="info",HL=g(e=>/^\s*info/.test(e),"detector"),YL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-C2FBPXIG.cjs"));return{id:m0,diagram:e}},"loader"),UL={id:m0,detector:HL,loader:YL},y0="pie",XL=g(e=>/^\s*pie/.test(e),"detector"),GL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-CLMNCcZD.cjs"));return{id:y0,diagram:e}},"loader"),VL={id:y0,detector:XL,loader:GL},x0="quadrantChart",KL=g(e=>/^\s*quadrantChart/.test(e),"detector"),ZL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-lyExQfuw.cjs"));return{id:x0,diagram:e}},"loader"),QL={id:x0,detector:KL,loader:ZL},JL=QL,C0="xychart",tE=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),eE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-CMRlyJDS.cjs"));return{id:C0,diagram:e}},"loader"),rE={id:C0,detector:tE,loader:eE},iE=rE,b0="requirement",oE=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),sE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-Cm9r8e07.cjs"));return{id:b0,diagram:e}},"loader"),aE={id:b0,detector:oE,loader:sE},nE=aE,k0="sequence",lE=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),hE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-DYXMeMoq.cjs"));return{id:k0,diagram:e}},"loader"),cE={id:k0,detector:lE,loader:hE},dE=cE,w0="class",uE=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),fE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-WUNGB5FC.cjs"));return{id:w0,diagram:e}},"loader"),pE={id:w0,detector:uE,loader:fE},gE=pE,S0="classDiagram",mE=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),yE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-WUNGB5FC.cjs"));return{id:S0,diagram:e}},"loader"),xE={id:S0,detector:mE,loader:yE},CE=xE,T0="state",bE=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),kE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-C4DOBTHC.cjs"));return{id:T0,diagram:e}},"loader"),wE={id:T0,detector:bE,loader:kE},SE=wE,v0="stateDiagram",TE=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),vE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-BK27mYqW.cjs"));return{id:v0,diagram:e}},"loader"),_E={id:v0,detector:TE,loader:vE},BE=_E,_0="journey",LE=g(e=>/^\s*journey/.test(e),"detector"),EE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-DiVOEWa6.cjs"));return{id:_0,diagram:e}},"loader"),FE={id:_0,detector:LE,loader:EE},AE=FE,ME=g((e,t,r)=>{V.debug(`rendering svg for syntax error
303
+ `);const i=Bf(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),wl(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"),B0={draw:ME},$E=B0,OE={db:{},renderer:B0,parser:{parse:g(()=>{},"parse")}},RE=OE,L0="flowchart-elk",IE=g((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),PE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-DDbv1eCW.cjs"));return{id:L0,diagram:e}},"loader"),DE={id:L0,detector:IE,loader:PE},NE=DE,E0="timeline",qE=g(e=>/^\s*timeline/.test(e),"detector"),zE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6-wvuHQLus.cjs"));return{id:E0,diagram:e}},"loader"),jE={id:E0,detector:qE,loader:zE},WE=jE,F0="mindmap",HE=g(e=>/^\s*mindmap/.test(e),"detector"),YE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-BlvTH7wL.cjs"));return{id:F0,diagram:e}},"loader"),UE={id:F0,detector:HE,loader:YE},XE=UE,A0="kanban",GE=g(e=>/^\s*kanban/.test(e),"detector"),VE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-BklyDLxL.cjs"));return{id:A0,diagram:e}},"loader"),KE={id:A0,detector:GE,loader:VE},ZE=KE,M0="sankey",QE=g(e=>/^\s*sankey(-beta)?/.test(e),"detector"),JE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-KJ5WdXGw.cjs"));return{id:M0,diagram:e}},"loader"),tF={id:M0,detector:QE,loader:JE},eF=tF,$0="packet",rF=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),iF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-ByEOvB5o.cjs"));return{id:$0,diagram:e}},"loader"),oF={id:$0,detector:rF,loader:iF},O0="radar",sF=g(e=>/^\s*radar-beta/.test(e),"detector"),aF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-9_82j2nL.cjs"));return{id:O0,diagram:e}},"loader"),nF={id:O0,detector:sF,loader:aF},R0="block",lF=g(e=>/^\s*block(-beta)?/.test(e),"detector"),hF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-BpyvdB6a.cjs"));return{id:R0,diagram:e}},"loader"),cF={id:R0,detector:lF,loader:hF},dF=cF,I0="treeView",uF=g(e=>/^\s*treeView-beta/.test(e),"detector"),fF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-C85REJhK.cjs"));return{id:I0,diagram:e}},"loader"),pF={id:I0,detector:uF,loader:fF},gF=pF,P0="architecture",mF=g(e=>/^\s*architecture/.test(e),"detector"),yF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-B20pDRbn.cjs"));return{id:P0,diagram:e}},"loader"),xF={id:P0,detector:mF,loader:yF},CF=xF,D0="eventmodeling",bF=g(e=>/^\s*eventmodeling/.test(e),"detector"),kF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-DVts5oXk.cjs"));return{id:D0,diagram:e}},"loader"),wF={id:D0,detector:bF,loader:kF},SF=wF,N0="ishikawa",TF=g(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),vF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-CJVI_dU0.cjs"));return{id:N0,diagram:e}},"loader"),_F={id:N0,detector:TF,loader:vF},q0="venn",BF=g(e=>/^\s*venn-beta/.test(e),"detector"),LF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-DbIG-wm1.cjs"));return{id:q0,diagram:e}},"loader"),EF={id:q0,detector:BF,loader:LF},FF=EF,z0="treemap",AF=g(e=>/^\s*treemap/.test(e),"detector"),MF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-Cave3JO_.cjs"));return{id:z0,diagram:e}},"loader"),$F={id:z0,detector:AF,loader:MF},j0="wardley",OF=g(e=>/^\s*wardley-beta/i.test(e),"detector"),RF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-BN2PkxRg.cjs"));return{id:j0,diagram:e}},"loader"),IF={id:j0,detector:OF,loader:RF},PF=IF,W0="cynefin",DF=g(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),NF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-DYAvR3E8.cjs"));return{id:W0,diagram:e}},"loader"),qF={id:W0,detector:DF,loader:NF},H0="railroad",zF=g(e=>/^\s*railroad-beta/i.test(e),"detector"),jF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-u2Ztkufm.cjs"));return{id:H0,diagram:e}},"loader"),WF={id:H0,detector:zF,loader:jF},Y0="railroadEbnf",HF=g(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),YF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-CYd0AUSE.cjs"));return{id:Y0,diagram:e}},"loader"),UF={id:Y0,detector:HF,loader:YF},U0="railroadAbnf",XF=g(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),GF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-npWEsqYc.cjs"));return{id:U0,diagram:e}},"loader"),VF={id:U0,detector:XF,loader:GF},X0="railroadPeg",KF=g(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),ZF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-DirAhjr9.cjs"));return{id:X0,diagram:e}},"loader"),QF={id:X0,detector:KF,loader:ZF},gd=!1,wa=g(()=>{gd||(gd=!0,bs("error",RE,e=>e.toLowerCase().trim()==="error"),bs("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{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:g(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),ln(NE,XE,CF),ln(CL,ZE,CE,gE,RL,WL,UL,VL,nE,dE,AL,BL,SL,WE,NL,BE,SE,AE,JL,eF,oF,iE,dF,SF,gF,nF,_F,$F,WF,UF,VF,QF,FF,PF,qF))},"addDiagrams"),JF=g(async()=>{V.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Nr).map(async([r,{detector:i,loader:o}])=>{if(o)try{fn(r)}catch{try{const{diagram:s,id:a}=await o();bs(a,s,i)}catch(s){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Nr[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"),tA="graphics-document document";function G0(e,t){e.attr("role",tA),t!==""&&e.attr("aria-roledescription",t)}g(G0,"setA11yDiagramInfo");function V0(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)}}}g(V0,"addSVGa11yTitleDescription");var Ir,al=(Ir=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=bl(t,i);t=gv(t)+`
304
+ `;try{fn(o)}catch{const c=F1(o);if(!c)throw new fu(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();bs(h,d)}const{db:s,parser:a,renderer:n,init:l}=fn(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new Ir(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}},g(Ir,"Diagram"),Ir),md=[],eA=g(()=>{md.forEach(e=>{e()}),md=[]},"attachFunctions"),rA=g(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function K0(e){const t=e.match(uu);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
305
+ `).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
306
+ `):t[2];let o=cg(i,{schema:hg})??{};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}}g(K0,"extractFrontMatter");var iA=g(e=>e.replace(/\r\n?/g,`
307
+ `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),oA=g(e=>{const{text:t,metadata:r}=K0(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"),sA=g(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:sv(e),directive:t}},"processDirectives");function vh(e){const t=iA(e),r=oA(t),i=sA(r.text),o=ua(r.config,i.directive);return e=rA(i.text),{code:e,title:r.title,config:o}}g(vh,"preprocessDiagram");function Z0(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}g(Z0,"toBase64");var aA=5e4,nA="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",lA="sandbox",hA="loose",cA="http://www.w3.org/2000/svg",dA="http://www.w3.org/1999/xlink",uA="http://www.w3.org/1999/xhtml",fA="100%",pA="100%",gA="border:0;margin:0;",mA="margin:0",yA="allow-top-navigation-by-user-activation allow-popups",xA='The "iframe" tag is not supported by your browser.',CA=["foreignobject"],bA=["dominant-baseline"];function _h(e){const t=vh(e);return xs(),_1(t.config??{}),t}g(_h,"processAndSetConfigs");async function Q0(e,t){wa();try{const{code:r,config:i}=_h(e);return{diagramType:(await tx(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}g(Q0,"parse");var yd=g((e,t,r=[])=>{const i=au(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),kA=g((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=ie(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Fc(l.styles)||n.forEach(c=>{r.insertRule(yd(l.id,c,l.styles),r.cssRules.length)}),Fc(l.textStyles)||r.insertRule(yd(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=un(o)+`
308
+ `}else i+=`${e.themeCSS}
309
+ `;return i+un(r)},"createCssStyles"),wA=g((e,t)=>sl(uL(`${e}{${t}}`),gL([g(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===rl)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[QB,tL,s0,rL,"@container","@starting-style"],rl].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Sh))},"addNamespace"),pL])),"compileCSS"),SA=g((e,t,r,i)=>{const o=kA(e,r),s=X1(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return wA(i,s)},"createUserStyles"),TA=g((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=mr(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),vA=g((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":pA,i=Z0(`<body style="${mA}">${e}</body>`);return`<iframe style="width:${fA};height:${r};${gA}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${yA}">
310
+ ${xA}
311
+ </iframe>`},"putIntoIFrame"),xd=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",cA);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function nl(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(nl,"sandboxedIframe");var _A=g((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),BA=g(async function(e,t,r){wa();const i=_h(t);t=i.code;const o=Ot();V.debug(o),t.length>(o?.maxTextSize??aA)&&(t=nA);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=g(()=>{const Y=yt(f?n:c).node();Y&&"remove"in Y&&Y.remove()},"removeTempElements");let d=yt(document.body);const f=o.securityLevel===lA,u=o.securityLevel===hA,p=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const H=nl(yt(r),a);d=yt(H.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);xd(d,e,l,`font-family: ${p}`,dA)}else{if(_A(document,e,l,a),f){const H=nl(yt(document.body),a);d=yt(H.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");xd(d,e,l)}let m,y;try{m=await al.fromText(t,{title:i.title})}catch(H){if(o.suppressErrorRendering)throw h(),H;m=await al.fromText("error"),y=H}const x=d.select(c).node(),C=m.type,k=x.firstChild,S=k.firstChild,T=m.renderer.getClasses?.(t,m),B=SA(o,C,T,s),L=document.createElement("style");L.innerHTML=B,k.insertBefore(L,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(H){throw o.suppressErrorRendering?h():$E.draw(t,e,"11.16.0"),H}const _=d.select(`${c} svg`),A=m.db.getAccTitle?.(),F=m.db.getAccDescription?.();ex(C,_,A,F),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",uA);let $=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),$=TA($,f,Ue(o.arrowMarkerAbsolute)),f){const H=d.select(c+" svg").node();$=vA($,H)}else u||($=wi.sanitize($,{ADD_TAGS:CA,ADD_ATTR:bA,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(eA(),y)throw y;return h(),{diagramType:C,svg:$,bindFunctions:m.db.bindFunctions}},"render");function J0(e={}){const t=jt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),T1(t),t?.theme&&t.theme in ir?t.themeVariables=ir[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=ir.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?S1(t):nu();yl(r.logLevel),wa()}g(J0,"initialize");var tx=g((e,t={})=>{const{code:r}=vh(e);return al.fromText(r,t)},"getDiagramFromText");function ex(e,t,r,i){G0(t,e),V0(t,r,i,t.attr("id"))}g(ex,"addA11yInfo");var Wr=Object.freeze({render:BA,parse:Q0,getDiagramFromText:tx,initialize:J0,getConfig:Ot,setConfig:lu,getSiteConfig:nu,updateSiteConfig:v1,reset:g(()=>{xs()},"reset"),globalReset:g(()=>{xs(Si)},"globalReset"),defaultConfig:Si});yl(Ot().logLevel);xs(Ot());var LA=g((e,t,r)=>{V.warn(e),ah(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"),rx=g(async function(e={querySelector:".mermaid"}){try{await EA(e)}catch(t){if(ah(t)&&V.error(t.str),ar.parseError&&ar.parseError(t),!e.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),t}},"run"),EA=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Wr.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),Wr.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=sm(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 ax(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){LA(d,n,ar.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),ix=g(function(e){Wr.initialize(e)},"initialize"),FA=g(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&ix(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await rx(i)},"init"),AA=g(async(e,{lazyLoad:t=!0}={})=>{wa(),ln(...e),t===!1&&await JF()},"registerExternalDiagrams"),ox=g(function(){if(ar.startOnLoad){const{startOnLoad:e}=Wr.getConfig();e&&ar.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",ox,!1);var MA=g(function(e){ar.parseError=e},"setParseErrorHandler"),Us=[],Ka=!1,sx=g(async()=>{if(!Ka){for(Ka=!0;Us.length>0;){const e=Us.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}Ka=!1}},"executeQueue"),$A=g(async(e,t)=>new Promise((r,i)=>{const o=g(()=>new Promise((s,a)=>{Wr.parse(e,t).then(n=>{s(n),r(n)},n=>{V.error("Error parsing",n),ar.parseError?.(n),a(n),i(n)})}),"performCall");Us.push(o),sx().catch(i)}),"parse"),ax=g((e,t,r)=>new Promise((i,o)=>{const s=g(()=>new Promise((a,n)=>{Wr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),ar.parseError?.(l),n(l),o(l)})}),"performCall");Us.push(s),sx().catch(o)}),"render"),OA=g(()=>Object.keys(Nr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ar={startOnLoad:!0,mermaidAPI:Wr,parse:$A,render:ax,init:FA,run:rx,registerExternalDiagrams:AA,registerLayoutLoaders:r0,initialize:ix,parseError:void 0,contentLoaded:ox,setParseErrorHandler:MA,detectType:bl,registerIconPacks:Ug,getRegisteredDiagramsMetadata:OA},ll=ar;const Lo="flex size-11 items-center justify-center rounded border p-1 shadow",RA="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",IA="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Cd="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",nx="both-shift",bd=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})}),PA=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),DA=Object.freeze(["none","zoom","pan","both"]),NA=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),fs=.3,qA=3,zA=2,Fr=.5,jA=1;function kd(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const WA=0;function Za(e,t,r){return e.panTrigger===null||t.button!==WA?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function HA(e,t){return e.zoom&&t.shiftKey}function YA(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 UA(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 XA(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:zA/e}}function Qa(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function Zi(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 GA(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 VA(e,t,r){return e*t.inline-r.inline>Fr||e*t.block-r.block>Fr}function KA(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<jA?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function wd(e){return e*(1-Math.exp(-fs))}function Sd(e,t,r){const i=e<-Fr||e>Fr;return t-e>r+Fr?i?0-e:0:e<-Fr?0-e:t>r+Fr?r-t:0}const Sa=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"}}),ZA=fl(Sa),QA=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),JA=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),lx="(pointer: coarse)",tM=e=>{const t=window.matchMedia(lx);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},eM=()=>window.matchMedia(lx).matches,rM=()=>!1,iM=()=>E.useSyncExternalStore(tM,eM,rM),hx=(e,t)=>{const[r,i]=E.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 p;switch(l.key){case f:p=(h+1)%e.length;break;case u: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}},cx=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[a,n]=E.useState(null),[l,c]=E.useState(!1),h=a!==null,d=E.useId(),f=E.useId(),u=E.useRef(null),p=E.useRef(null),m=E.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{n(null),c(!1),S&&p.current?.focus()};E.useLayoutEffect(()=>{const S=m.current;if(a===null||S===null)return;const T=S.ownerDocument.defaultView,B=S.ownerDocument.documentElement.clientWidth,L=S.getBoundingClientRect();(T?.getComputedStyle(S).direction==="rtl"?L.left<0:L.right>B)&&c(!0);const A=y(),F=A.findIndex(H=>H.getAttribute("aria-checked")==="true"),$=a==="last"?A.length-1:Math.max(F,0);A[$]?.focus()},[a]),E.useEffect(()=>{const S=u.current?.ownerDocument;if(!h||S===void 0)return;const T=B=>{B.target instanceof Node&&u.current?.contains(B.target)===!0||(n(null),c(!1))};return S.addEventListener("pointerdown",T,!0),S.addEventListener("focusin",T,!0),()=>{S.removeEventListener("pointerdown",T,!0),S.removeEventListener("focusin",T,!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 T=y(),B=T.indexOf(S.target);let L;switch(S.key){case"ArrowDown":L=(B+1)%T.length;break;case"ArrowUp":L=(B-1+T.length)%T.length;break;case"Home":L=0;break;case"End":L=T.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),T[L]?.focus()};return w.jsxs("div",{ref:u,className:"relative",children:[w.jsx("button",{ref:p,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):n("chosen"),onKeyDown:C,className:Lo,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?f:void 0,children:i}),h&&w.jsx("div",{ref:m,id:f,role:"menu","aria-labelledby":d,...t,"data-aqmd-toolbar-menu":l?"end":"start",onKeyDown:k,className:IA,children:s.map(S=>{const T=()=>{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:T,className:Cd,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:T,className:Cd,children:[w.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),w.jsx("span",{children:S.label.text})]},S.key)})})]})},Td=new Set(["gantt"]),oM=200,sM=300,aM=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),nM="data-aqmd-mermaid-host",lM=e=>{const t=document.createElement("div");return t.setAttribute(nM,""),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 vd=Promise.resolve();const hM=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},_d=e=>{e.resetStyle(),e.destroy()},Ja=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",cM=Object.freeze({visibility:"hidden"});let dx=!1,hl=null;if(ll?.initialize)try{ll.initialize({startOnLoad:!1}),dx=!0}catch(e){hl=e instanceof Error?e:new Error(String(e))}else hl=new Error("Mermaid library or mermaid.initialize is not available.");const ux=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=E.useMemo(()=>Vs(Sa,i),[i]),a=E.useId(),n=E.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),l=E.useRef(0),c=E.useRef(null),h=E.useRef(null),d=E.useRef(null),f=E.useRef(null),[u,p]=E.useState(!0),[m,y]=E.useState(null),[x,C]=E.useState(null),[k,S]=E.useState(0),T=E.useRef(!1),B=iM(),[L,_]=E.useState(t??nx),A=E.useRef(bd[L]),F=E.useRef(!1),[$,H]=E.useState(!1);E.useEffect(()=>{t&&_(t)},[t]),E.useEffect(()=>{A.current=bd[L],f.current?.refresh()},[L]),E.useEffect(()=>{if(p(!0),y(null),C(null),!dx){y(hl?.message||"Mermaid failed to initialize globally."),p(!1);return}const v=e.trim();if(v===""){p(!1);return}const U=c.current;if(!U)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let D=!1,X=0,G=null,Z=U.offsetWidth,K=null,at,gt;const ct=()=>{Ht.disconnect(),clearTimeout(at)},mt=Vt=>{K=null,ct(),y(Vt),C(null),p(!1)},Ft=Vt=>{l.current+=1;const te=l.current;X=te,G=Vt;const $e=()=>!D&&te===X,ge=async()=>{const Bt=lM(Vt);try{return await ll.render(`${n.current}-${te}`,v,Bt)}finally{Bt.remove()}};vd=vd.then(()=>$e()?ge().then(Bt=>{if($e()){if(typeof Bt.svg!="string"||Bt.svg.length===0){mt("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}K=Bt.diagramType,C({svg:Bt.svg,bindFunctions:typeof Bt.bindFunctions=="function"?Bt.bindFunctions:null}),p(!1),Td.has(Bt.diagramType)?Z!==Vt&&At():Ht.disconnect()}}).catch(Bt=>{if($e()){if(console.error(`[MermaidDiagram ${n.current}] Error rendering Mermaid diagram:`,Bt),hM(Bt)&&!T.current){T.current=!0,gt=setTimeout(()=>S(xt=>xt+1),sM);return}mt(Bt instanceof Error?Bt.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},At=()=>{clearTimeout(at),at=setTimeout(()=>{Z>0&&Z!==G&&Ft(Z)},oM)},Mt=()=>{const Vt=U.offsetWidth;if(Vt!==Z){if(Z=Vt,G===null){Vt>0&&Ft(Vt);return}K!==null&&Td.has(K)&&At()}},Ht=new ResizeObserver(Mt);return Ht.observe(U),Z>0&&Ft(Z),()=>{D=!0,ct(),clearTimeout(gt)}},[e,k]),E.useEffect(()=>{const v=h.current;if(!v)return;const U=()=>{f.current=null,d.current&&(_d(d.current),d.current=null),F.current=!1,H(!1)};if(!x){v.innerHTML="",U();return}v.innerHTML=x.svg;const D=v.querySelector("svg");let X=!1,G;const Z=[];if(D){let K;try{K=YA(D.getAttribute("viewBox"))}catch(ct){console.error(`[MermaidDiagram ${n.current}] Cannot size the drawing:`,ct),y(ct instanceof Error?ct.message:String(ct)),C(null);return}const at=K,gt=()=>{if(X)return;const ct=D.getBBox();if(!ct||ct.width===0||ct.height===0){G=setTimeout(gt,100);return}d.current&&_d(d.current);const mt=Kd(D,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:fs,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:kd(A.current,!1)});d.current=mt;let Ft={minScale:1,maxScale:1};const At=()=>{const J=mt.getPan();return{scale:mt.getScale(),x:J.x,y:J.y}},Mt=()=>{const J=v.getBoundingClientRect(),nt=D.getBoundingClientRect(),{scale:Ct,x:qt,y:It}=At();return{frameRect:J,frame:{inline:J.width,block:J.height},drawing:{origin:{x:nt.left-J.left-Ct*qt,y:nt.top-J.top-Ct*It},inline:nt.width/Ct,block:nt.height/Ct}}},Ht=()=>{if(X)return;const{frame:J,drawing:nt}=Mt(),Ct=VA(mt.getScale(),nt,J);F.current=Ct,H(Ct),wr(Ct),mt.setOptions({touchAction:kd(A.current,Ct)}),v.style.cursor=Ja(A.current,xt?.kind==="pan"&&xt.mouse)},Vt=()=>{const J=v.getBoundingClientRect().width;J<=0||(Ft=XA(UA(J,at)),mt.setOptions({minScale:Ft.minScale,maxScale:Ft.maxScale}))},te=J=>{const nt=At(),{frame:Ct,drawing:qt}=Mt(),It=GA({...J,scale:Qa(J.scale,Ft)},qt,Ct);return It.scale===nt.scale&&It.x===nt.x&&It.y===nt.y?!1:(mt.zoom(It.scale,{animate:!1,force:!0,silent:!0}),mt.pan(It.x,It.y,{animate:!1,force:!0}),Ht(),!0)},$e=(J,nt)=>{const{drawing:Ct}=Mt();return te(Zi(At(),Qa(J,Ft),nt,nt,Ct))},ge=J=>{const nt=v.getBoundingClientRect();return{x:J.x-nt.left,y:J.y-nt.top}};f.current={zoomBy:J=>{const{frame:nt}=Mt();$e(mt.getScale()*Math.exp(J*fs),{x:nt.inline/2,y:nt.block/2})},panBy:(J,nt)=>{const{drawing:Ct}=Mt(),qt=At();return te(Zi(qt,qt.scale,{x:0,y:0},{x:J,y:nt},Ct))},reset:()=>{te({scale:1,x:0,y:0})},panSteps:()=>{const{frame:J}=Mt();return{x:wd(J.inline),y:wd(J.block)}},refresh:Ht};const Bt=new Map;let xt=null;const Oe=J=>({x:J.clientX,y:J.clientY}),br=()=>{const J=[...Bt.values()];return J.length===2?[J[0],J[1]]:null},we=J=>{if(Bt.has(J.pointerId)&&Bt.set(J.pointerId,Oe(J)),xt?.kind==="pinch"){const nt=br();if(nt===null)return;const Ct=KA(xt.last,nt);if(xt={kind:"pinch",last:nt},Ct===null)return;const{drawing:qt}=Mt(),It=At();te(Zi(It,Qa(It.scale*Ct.ratio,Ft),ge(Ct.from),ge(Ct.to),qt));return}if(xt?.kind==="pan"&&xt.pointerId===J.pointerId){const nt=Oe(J),{drawing:Ct}=Mt(),qt=At();te(Zi(qt,qt.scale,ge(xt.last),ge(nt),Ct)),xt={...xt,last:nt}}},Ge=()=>{window.removeEventListener("pointermove",we),window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re)},Ur=()=>{Ge(),window.addEventListener("pointermove",we),window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re)},Re=J=>{if(Bt.delete(J.pointerId),xt?.kind==="pinch"){const[nt]=[...Bt.entries()];xt=nt!==void 0&&Za(A.current,{button:0,shiftKey:!1,pointerType:J.pointerType},F.current)?{kind:"pan",pointerId:nt[0],last:nt[1],mouse:!1}:null}else xt?.kind==="pan"&&xt.pointerId===J.pointerId&&(xt=null);xt===null&&Bt.size===0&&Ge(),v.style.cursor=Ja(A.current,xt?.kind==="pan"&&xt.mouse)},kr=J=>{const nt=A.current;if(J.pointerType==="touch"||J.pointerType==="pen"){Bt.set(J.pointerId,Oe(J)),Ur();const Ct=br();Ct!==null&&nt.zoom?xt={kind:"pinch",last:Ct}:Bt.size>1?xt?.kind==="pan"&&!xt.mouse&&(xt=null):Za(nt,J,F.current)&&(xt={kind:"pan",pointerId:J.pointerId,last:Oe(J),mouse:!1});return}Za(nt,J,F.current)&&(xt={kind:"pan",pointerId:J.pointerId,last:Oe(J),mouse:!0},v.style.cursor=Ja(nt,!0),Ur(),J.preventDefault())},lr=J=>{xt!==null&&!(xt.kind==="pan"&&xt.mouse)&&J.cancelable&&J.preventDefault()};let Xr=!1;const wr=J=>{J!==Xr&&(Xr=J,J?v.addEventListener("touchmove",lr,{passive:!1}):v.removeEventListener("touchmove",lr))},Ve=J=>{const nt=J.target;if(!(nt instanceof Element)||nt===D||!D.contains(nt))return;const Ct=v.getBoundingClientRect(),qt=nt.getBoundingClientRect(),It={x:Sd(qt.left-Ct.left,qt.right-Ct.left,Ct.width),y:Sd(qt.top-Ct.top,qt.bottom-Ct.top,Ct.height)};if(It.x===0&&It.y===0)return;const{drawing:Ni}=Mt(),Lt=At();te(Zi(Lt,Lt.scale,{x:0,y:0},It,Ni))},Ie=J=>{if(!HA(A.current,J))return;const nt=J.deltaY===0?J.deltaX:J.deltaY;nt!==0&&(J.preventDefault(),$e(mt.getScale()*Math.exp(Math.sign(-nt)*fs/qA),ge(Oe(J))))},Sr=new ResizeObserver(()=>{Vt(),te(At()),Ht()});v.addEventListener("pointerdown",kr),v.addEventListener("focusin",Ve),v.addEventListener("wheel",Ie,{passive:!1}),D.addEventListener("panzoomchange",Ht),Sr.observe(v),Z.push(()=>{v.removeEventListener("pointerdown",kr),v.removeEventListener("focusin",Ve),wr(!1),v.removeEventListener("wheel",Ie),D.removeEventListener("panzoomchange",Ht),Sr.disconnect(),Ge()}),Vt(),Ht()};gt()}return x.bindFunctions&&x.bindFunctions(v),()=>{X=!0,clearTimeout(G);for(const K of Z)K();U()}},[x]);const Y=E.useCallback(v=>{const U=f.current;if(U===null||v.target!==v.currentTarget||v.altKey||v.ctrlKey||v.metaKey)return;const D=U.panSteps();let X;switch(v.key){case"ArrowLeft":X=U.panBy(D.x,0);break;case"ArrowRight":X=U.panBy(-D.x,0);break;case"ArrowUp":X=U.panBy(0,D.y);break;case"ArrowDown":X=U.panBy(0,-D.y);break;case"+":case"=":U.zoomBy(1),X=!0;break;case"-":U.zoomBy(-1),X=!0;break;case"0":U.reset(),X=!0;break;default:X=!1}X&&v.preventDefault()},[]),N=E.useMemo(()=>[...r?[]:["mode"],"zoom-in","zoom-out","reset",...$?["pan-left","pan-up","pan-down","pan-right"]:[]],[r,$]),{onKeyDown:I,onFocus:P,tabIndexOf:q}=hx(N,"data-aqmd-mermaid-control"),R=(v,U,D,X,G=!1)=>w.jsx("button",{type:"button","data-aqmd-mermaid-control":v,tabIndex:q(v),onClick:D,style:G?cM:void 0,className:Lo,"aria-label":s[U].text,lang:s[U].lang,children:X},v),O=v=>{const U=f.current;if(U===null)return;const D=U.panSteps();U.panBy(v.x*D.x,v.y*D.y)};let z;if(u)z=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)z=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:()=>{T.current=!1,y(null),S(v=>v+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(Jh,{className:"h-4 w-4"}),s.retry.text]})]});else{const v=s[B?"interactionModeTouch":"interactionMode"],U=B?DA.map(D=>({value:D,label:s[JA[D]],checked:NA[L]===D})):PA.map(D=>({value:D,label:s[QA[D]],checked:L===D}));z=w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":a,onKeyDown:I,onFocus:P,className:"mb-1 flex flex-wrap items-start gap-1",children:[!r&&w.jsx(cx,{buttonHook:{"data-aqmd-mermaid-control":"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:v,icon:w.jsx(qb,{size:18}),tabIndex:q("mode"),items:U.map(({value:D,label:X,checked:G})=>({key:D,label:X,checked:G,onSelect:()=>_(D)}))}),R("zoom-in","zoomIn",()=>f.current?.zoomBy(1),w.jsx(Zd,{size:20})),R("zoom-out","zoomOut",()=>f.current?.zoomBy(-1),w.jsx(Qd,{size:20})),R("reset","resetView",()=>f.current?.reset(),w.jsx(Jh,{size:18})),R("pan-left","panLeft",()=>O({x:1,y:0}),w.jsx($b,{size:18}),!$),R("pan-up","panUp",()=>O({x:0,y:1}),w.jsx(Pb,{size:18}),!$),R("pan-down","panDown",()=>O({x:0,y:-1}),w.jsx(Ab,{size:18}),!$),R("pan-right","panRight",()=>O({x:-1,y:0}),w.jsx(Rb,{size:18}),!$)]}),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":$?"true":"false",role:"group",tabIndex:0,"aria-labelledby":a,onKeyDown:Y,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:aM}),z]})};ux.displayName="MermaidDiagramInternal";const Bh=E.memo(ux),dM="unicodeTextInMathMode",uM="noCharacterMetrics",fM=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,pM="consoleCommand",gM=e=>{const t=(r,i)=>o=>(i(o),e(pM,`${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())}},fx=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=_r.get(r);if(i!==void 0)return _r.delete(r),_r.set(r,i),i;const o=yM(e,t);return _r.set(r,o),_r.size>mM&&_r.delete(_r.keys().next().value),o},mM=610,_r=new Map,yM=(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(uM,a);return}o.apply(console,s)};try{const s=sC.renderToString(e,{displayMode:t,throwOnError:!1,macros:gM(i),strict:(a,n)=>(a!==dM&&i(a,n),"ignore")});return Object.freeze({html:s,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=o}};const xM=[["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"}]],CM=Tt("align-horizontal-space-around",xM);const bM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kM=Tt("chevron-down",bM);const wM=[["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"}]],SM=Tt("copy",wM);const TM=[["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"}]],vM=Tt("download",TM);const _M=[["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"}]],BM=Tt("fold-horizontal",_M);const LM=[["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"}]],EM=Tt("fold-vertical",LM);const FM=[["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"}]],AM=Tt("highlighter",FM);const MM=[["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"}]],$M=Tt("maximize-2",MM);const OM=[["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"}]],RM=Tt("minimize-2",OM);const IM=[["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"}]],PM=Tt("ruler",IM);const DM=[["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"}]],NM=Tt("unfold-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:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],zM=Tt("unfold-vertical",qM),px=24,jM=1,WM=1,HM=Object.freeze({}),tn=e=>{const{rows:t,cols:r}=Gs.measureTsv(e);return t*r},YM=26,UM=(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]},XM=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),GM=(e,t)=>(se.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX+e*px)*t+se.SPREADSHEET_SCROLLBAR_SIZE_PX,cl=e=>Math.round(e*100),VM=(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},Lh=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))},Qo=e=>Lh(Gs.parseTsv(e)),KM=["format","hyperlink","note","comments","validation"],ZM=(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(KM.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"}},QM=e=>{const t=Lh(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 Gs.serializeTsv(t).replaceAll(`\r
313
+ `,`
314
+ `)},JM=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},t5=(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}},e5=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,r5=e=>e5.test(e)?e:void 0,i5=(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}`},o5=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)})}},Jo="data-aqmd-spreadsheet-control",a5=Object.freeze(["zoom-in","zoom-out","reset-zoom","highlight","track-size","copy","save","save-menu","fullscreen"]),n5=({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:p,gridReady:m,activeCell:y,onTrackSize:x})=>{const{onKeyDown:C,onFocus:k,tabIndexOf:S}=hx(a5,Jo),[T,B]=E.useState(!1),L=E.useId(),_=E.useRef(null),A=T&&m,F=(Y,N,I,P,q,R,O=Lo)=>w.jsx("button",{type:"button",[Jo]:Y,tabIndex:S(Y),onClick:q?I:void 0,"aria-disabled":q?void 0:"true","aria-pressed":R,className:O,"aria-label":N.text,lang:N.lang,children:P}),$=cl(a),H={text:Dt.fillLabel(e.resetZoom.text,{percent:$}),lang:e.resetZoom.lang};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",role:"toolbar","aria-labelledby":t,onKeyDown:C,onFocus:k,className:"mb-1 flex flex-wrap items-center gap-1",children:[F("zoom-in",e.zoomIn,()=>n(1),w.jsx(Zd,{size:20}),m&&o),F("zoom-out",e.zoomOut,()=>n(-1),w.jsx(Qd,{size:20}),m&&s),F("reset-zoom",H,l,w.jsxs("span",{"data-aqmd-spreadsheet-zoom":"",children:[w.jsxs("span",{"data-aqmd-spreadsheet-zoom-widest":"","aria-hidden":"true",children:[cl(se.SPREADSHEET_ZOOM_MAX)," %"]}),w.jsxs("span",{children:[$," %"]})]}),m&&a!==1,void 0,RA),F("highlight",e.highlight,h,w.jsx(AM,{size:18}),m,c),w.jsx("button",{type:"button",ref:_,[Jo]:"track-size",tabIndex:S("track-size"),onClick:m?()=>B(Y=>!Y):void 0,"aria-disabled":m?void 0:"true","aria-expanded":A,"aria-controls":A?L:void 0,className:Lo,"aria-label":e.trackSize.text,lang:e.trackSize.lang,children:w.jsx(PM,{size:18})}),F("copy",e.copyAll,d,w.jsx(SM,{size:18}),m),F("save",e.saveTsv,()=>f(!1),w.jsx(vM,{size:18}),!0),w.jsx(cx,{buttonHook:{[Jo]:"save-menu"},menuHook:{"data-aqmd-spreadsheet-menu":""},label:e.saveMenu,icon:w.jsx(kM,{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"}}]}),F("fullscreen",u?e.exitFullscreen:e.fullscreen,p,u?w.jsx(RM,{size:18}):w.jsx($M,{size:18}),!0),w.jsx("span",{"data-aqmd-spreadsheet-size":"",lang:e.size.lang,className:"ms-1 text-sm",children:Dt.fillLabel(e.size.text,{rows:r,cols:i})})]}),A&&w.jsx(h5,{id:L,labels:e,activeCell:y,onTrackSize:x,onClose:()=>{B(!1),_.current?.focus()}})]})},l5=Object.freeze({decreaseColumnWidth:w.jsx(BM,{size:18}),increaseColumnWidth:w.jsx(NM,{size:18}),autoFitColumnWidth:w.jsx(CM,{size:18}),decreaseRowHeight:w.jsx(EM,{size:18}),increaseRowHeight:w.jsx(zM,{size:18})}),h5=({id:e,labels:t,activeCell:r,onTrackSize:i,onClose:o})=>{const s=E.useSyncExternalStore(r.subscribe,r.get,r.get),a={column:se.columnIndexToName(s.col),row:s.row+1},n=l=>{l.key!=="Escape"||l.defaultPrevented||(l.preventDefault(),l.stopPropagation(),o())};return w.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:o5.map(l=>w.jsx("button",{type:"button","data-aqmd-spreadsheet-track-size-control":l,onClick:()=>i(l),className:Lo,"aria-label":Dt.fillLabel(t[l].text,a),lang:t[l].lang,children:l5[l]},l))})},c5=(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)}},d5=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"})})])},u5="\uFEFF",f5="text/tab-separated-values;charset=utf-8",p5=(e,t)=>`${t?u5:""}${Gs.serializeTsv(e)}`,g5=(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:f5})),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)}},gx=e=>{const t=E.useRef(e);E.useLayoutEffect(()=>{t.current=e});const r=e!==void 0,[i]=E.useState(()=>new Set);return E.useEffect(()=>e?.subscribe(()=>{for(const o of[...i])o()}),[e,i]),E.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 ps=null,en=null;const dl=new Set,m5=e=>(dl.add(e),()=>{dl.delete(e)}),Bd=()=>ps!==null?Promise.resolve(ps):(en??=import("@aiquants/spreadsheet").then(e=>{ps=e;for(const t of dl)t();return e},e=>{throw en=null,e}),en);class Kr extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const Ld=e=>{console.error("[@aiquants/markdown] could not load @aiquants/spreadsheet",e)},Ed=Object.freeze({row:!0,column:!0,intersection:!1}),y5=Object.freeze({row:!1,column:!1,intersection:!1}),Fd=Object.freeze([Object.freeze([""])]),x5=Object.freeze({link:!1}),C5=229,b5=({matrix:e,headerRows:t,footerRows:r,visibleRows:i})=>{const o=Math.min(e[0].length,YM),s=UM(e,i,r),a=Array.from({length:o},(l,c)=>se.columnIndexToName(c)),n=l=>w.jsx("td",{"aria-hidden":"true","data-aqmd-spreadsheet-static-number":"",children:l+1});return w.jsxs("table",{"data-aqmd-spreadsheet-static":"",children:[w.jsxs("thead",{children:[w.jsxs("tr",{"aria-hidden":"true","data-aqmd-spreadsheet-static-letters":"",children:[w.jsx("td",{}),a.map(l=>w.jsx("td",{children:l},l))]}),s.filter(({index:l})=>l<t).map(({index:l,cells:c})=>w.jsxs("tr",{children:[n(l),c.slice(0,o).map((h,d)=>w.jsx("th",{scope:"col",children:h},d))]},l))]}),w.jsx("tbody",{children:s.filter(({index:l})=>l>=t).map(({index:l,cells:c})=>w.jsxs("tr",{children:[n(l),c.slice(0,o).map((h,d)=>w.jsx("td",{children:h},d))]},l))})]})},k5=e=>{try{return{options:Dt.parseSpreadsheetOptions(e),unreadWord:null}}catch(t){if(t instanceof Dt.SpreadsheetOptionsError)return{options:null,unreadWord:t.word};throw t}},mx=({tsv:e,meta:t,sourceLines:r,editor:i,locale:o="en",labels:s,layout:a="inline"})=>{if(!Object.hasOwn(Dt.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=E.useMemo(()=>Vs(Dt.SPREADSHEET_BLOCK_LABEL_CATALOGS[o],s),[o,s]),{options:l,unreadWord:c}=E.useMemo(()=>k5(t),[t]),h=E.useMemo(()=>tn(e),[e]),d=h>se.SPREADSHEET_MAX_OPERATION_CELLS,f=E.useMemo(()=>go.parseSourceLines(r)?.first??null,[r]),[u,p]=E.useState(null),m=`${r??""}
315
+ ${e}`,y=u===m,x=i!==void 0&&f!==null&&!y?i:void 0,C=x!==void 0,k=C&&l!==null&&l.footerRows===0?jM:0,S=C?WM:0,[T,B]=E.useState(()=>d?Fd:Qo(e)),[L,_]=E.useState(0),A=E.useRef(e),F=E.useRef([]),$=E.useMemo(()=>VM(T,k,S),[T,k,S]),H=E.useRef($);H.current=$;const Y=E.useSyncExternalStore(m5,()=>ps,()=>null),[N,I]=E.useState(!1),P=N&&Y===null,[q,R]=E.useState(1),[O,z]=E.useState(Ed),[v,U]=E.useState(!1),[D,X]=E.useState(null),G=E.useRef(null),Z=E.useId(),K=E.useCallback((Q,lt={})=>{X(wt=>({text:Dt.fillLabel(n[Q].text,lt),lang:n[Q].lang,serial:(wt?.serial??0)+1}))},[n]);E.useEffect(()=>{if(Y!==null||l===null||d)return;let Q=!0;return Bd().catch(lt=>{Q&&(Ld(lt),I(!0))}),()=>{Q=!1}},[Y,l,d]),E.useEffect(()=>{const Q=JM(F.current,e);if(Q.echo){F.current=Q.pending;return}const lt=x===void 0||f===null?null:x.read(f),wt=lt!==null&&tn(lt)<=se.SPREADSHEET_MAX_OPERATION_CELLS?lt:null;if(wt!==null&&wt===F.current.at(-1))return;F.current=[];const Pt=wt===null?e:wt;Pt!==A.current&&(A.current=Pt,B(wt===null&&d?Fd:Qo(Pt)),_(Ke=>Ke+1))},[e,d,x,f]);const at=E.useCallback(()=>{if(x===void 0||f===null)return;const Q=x.read(f);Q===null||Q===A.current||tn(Q)>se.SPREADSHEET_MAX_OPERATION_CELLS||(F.current=[],A.current=Q,B(Qo(Q)),_(lt=>lt+1))},[x,f]);E.useEffect(()=>x?.subscribe(()=>{F.current.length>0&&at()}),[x,at]);const gt=E.useCallback(Q=>{Q(),at()},[at]),ct=E.useMemo(()=>x===void 0?void 0:()=>gt(()=>x.undo()),[x,gt]),mt=E.useMemo(()=>x===void 0?void 0:()=>gt(()=>x.redo()),[x,gt]),Ft=E.useRef(()=>{});Ft.current=Q=>{if(x===void 0||f===null)throw new Kr("readOnly");const lt=ZM(H.current,Q);if(lt.kind==="format-only")throw new Kr("formatRefused");if(lt.kind==="unchanged")return;const wt=Lh(lt.matrix),Pt=QM(wt),Ke=x.write({fenceLine:f,expected:A.current,text:Pt});switch(Ke){case"written":{const Se=x.read(f);if(Se===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");A.current=Se,F.current=[...F.current,Se],B(Se===Pt?wt:Qo(Se)),_(qi=>qi+1),X(null);return}case"changed":throw at(),new Kr("editConflict");case"closesFence":throw new Kr("fenceRefused");case"unwritable":throw p(m),new Kr("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(Ke)} (written, changed, closesFence or unwritable)`)}};const[At]=E.useState(()=>({get rowCount(){return H.current.length},get colCount(){return H.current[0].length},getCellText:(Q,lt)=>H.current[Q][lt],applyEdits:(Q,lt)=>Ft.current(Q),getCellFormat:()=>HM,getCellHyperlink:(Q,lt)=>r5(H.current[Q][lt]),findDataEdge:(Q,lt)=>t5((wt,Pt)=>H.current[wt][Pt],H.current.length,H.current[0].length,Q,lt)})),Mt=E.useCallback(Q=>{if(!(Q instanceof Kr))throw Q;K(Q.reason)},[K]),Ht=E.useCallback(Q=>K(y?"unwritable":"readOnly"),[K,y]),Vt=E.useCallback(Q=>{G.current?.ownerDocument.defaultView?.open(Q,"_blank","noopener,noreferrer")},[]),te=E.useCallback(({row:Q,displayText:lt,columnName:wt,readOnly:Pt})=>Dt.fillLabel((Pt===!0?n.readOnlyCellAnnouncement:n.cellAnnouncement).text,{cell:`${wt}${Q+1}`,value:lt===""?n.emptyCell.text:lt}),[n]),$e=E.useCallback(({range:Q})=>Dt.fillLabel(n.selectionAnnouncement.text,{range:i5(Q,se.columnIndexToName)}),[n]),ge=E.useCallback(({axis:Q,index:lt,size:wt})=>Q==="column"?Dt.fillLabel(n.columnResized.text,{column:se.columnIndexToName(lt),size:wt}):Dt.fillLabel(n.rowResized.text,{row:lt+1,size:wt}),[n]),Bt=E.useRef(null),[xt]=E.useState(s5),Oe=E.useCallback(Q=>xt.set(Q.active),[xt]),br=E.useCallback(Q=>{Bt.current?.executeCommand(Q)},[]),we=cl(q),Ge=E.useRef(we);E.useEffect(()=>{Ge.current!==we&&(Ge.current=we,K("zoomed",{percent:we}))},[K,we]);const Ur=E.useCallback(Q=>R(lt=>se.clampSpreadsheetZoom(se.stepSpreadsheetZoom(lt,Q))),[]),Re=E.useCallback(()=>R(1),[]),kr=O.row||O.column,lr=E.useCallback(()=>z(Q=>Q.row||Q.column?y5:Ed),[]),Xr=E.useCallback(()=>{if(Y===null)return;const Q=G.current?.ownerDocument.defaultView;(async()=>{if(Q==null)throw new Error("no window");const wt=c5(T,Y,Q.crypto.randomUUID());await d5(wt,Q.navigator.clipboard,Pt=>new Q.ClipboardItem(Pt))})().then(()=>K("copied"),wt=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",wt),K("copyFailed")})},[K,T,Y]),wr=E.useCallback(Q=>{const lt=G.current?.ownerDocument;lt!==void 0&&g5(p5(T,Q),n.fileName.text,lt)},[T,n]),Ve=E.useRef(!1);E.useEffect(()=>{Ve.current&&(Ve.current=!1,G.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[v]);const Ie=E.useCallback(Q=>{const lt=G.current;lt!==null&&(lt.close(),Q?lt.showModal():lt.show(),Ve.current=!0,U(Q))},[]),Sr=E.useCallback(()=>Ie(!v),[v,Ie]),J=E.useCallback(Q=>{!v||Q.key!=="Escape"||Q.defaultPrevented||Q.nativeEvent.isComposing||Q.keyCode===C5||(Q.preventDefault(),Q.stopPropagation(),Ie(!1))},[v,Ie]),nt=E.useCallback(Q=>{Q.preventDefault(),Ie(!1)},[Ie]),Ct=T.length,qt=T[0].length,It=l===null?0:XM(l,$.length),Ni=E.useMemo(()=>({"--aqmd-spreadsheet-box-height":`${GM(It,q)}px`}),[It,q]),Lt=v?n.fullscreenDialog:n.table,vt=Y?.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":v?"":void 0,children:[w.jsx("span",{id:Z,hidden:!0,lang:Lt.lang,children:Lt.text}),w.jsxs("dialog",{ref:G,open:!0,"data-aqmd-spreadsheet-dialog":"",role:v?void 0:"group","aria-labelledby":Z,onKeyDown:J,onCancel:nt,children:[l===null?w.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:n.optionsError.lang,children:Dt.fillLabel(n.optionsError.text,{word:c,frozenMax:Dt.SPREADSHEET_OPTION_RULES.header.max,heightMax:Dt.SPREADSHEET_OPTION_RULES.height.max})}):d?w.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:n.tooLarge.lang,children:Dt.fillLabel(n.tooLarge.text,{cells:new Intl.NumberFormat(o).format(h),max:new Intl.NumberFormat(o).format(se.SPREADSHEET_MAX_OPERATION_CELLS)})}):w.jsxs(w.Fragment,{children:[w.jsx(n5,{labels:n,labelledBy:Z,rows:Ct,cols:qt,canZoomIn:q<se.SPREADSHEET_ZOOM_MAX,canZoomOut:q>se.SPREADSHEET_ZOOM_MIN,zoom:q,onZoom:Ur,onResetZoom:Re,highlighted:kr,onToggleHighlight:lr,onCopy:Xr,onSave:wr,fullscreen:v,onToggleFullscreen:Sr,gridReady:vt!==void 0,activeCell:xt,onTrackSize:br}),w.jsx("div",{"data-aqmd-spreadsheet-box":"",style:a==="inline"?Ni:void 0,children:vt===void 0?w.jsx(b5,{matrix:T,headerRows:l.headerRows,footerRows:l.footerRows,visibleRows:It}):w.jsx(vt,{ref:Bt,adapter:At,dataVersion:L,defaultRowHeight:px,frozenRows:l.headerRows,headerRows:l.headerRows,frozenTrailingRows:l.footerRows,frozenColumns:l.frozenColumns,enableFillHandle:C,readOnly:!C,labelledBy:Z,enableResizeUI:!0,zoom:q,onZoomChange:R,highlight:O,onHighlightChange:z,popovers:x5,onHyperlinkOpen:Vt,onEditRejected:Mt,onReadOnlyRejected:Ht,onUndoRequest:ct,onRedoRequest:mt,formatCellAnnouncement:te,formatSelectionAnnouncement:$e,formatResizeAnnouncement:ge,onSelectionChange:Oe,locale:o})})]}),P&&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:()=>{I(!1),Bd().catch(Q=>{Ld(Q),I(!0)})},children:n.retry.text})]}),w.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:D!==null&&w.jsx("span",{lang:D.lang,children:D.text},D.serial)})]})]})};mx.displayName="SpreadsheetBlock";const Eh=E.memo(mx),w5=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),S5=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 T5(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 v5=({code:e})=>{const[t,r]=E.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"})},_5=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const o=E.use(e),s={replace:a=>{if(a instanceof Et.Element&&a.name==="pre"){const n=T5(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(v5,{code:r}),w.jsx("pre",{...n,children:Et.domToReact(a.children,s)})]})}},htmlparser2:{lowerCaseTags:!0}};return w.jsx(w.Fragment,{children:Et(o,s)})},B5=/^(diff)?:?(\w+):?([\w.-]*)?/,L5=()=>({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)}}}}),E5=e=>{const t=B5.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},Fh=({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}=E5(o);return n===Dt.SPREADSHEETS_LANGUAGE?w.jsx(Eh,{tsv:s,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?w.jsx(Bh,{chartContent:s,sourceLines:i}):w.jsx(F5,{code:s,lang:n,isDiff:a,filename:l,sourceLines:i})},F5=({code:e,lang:t,isDiff:r,filename:i,sourceLines:o})=>{const s=E.useMemo(async()=>{const a=[];return r&&a.push(L5()),await iC.codeToHtml(e,{lang:t,themes:w5,defaultColor:!1,colorReplacements:S5,transformers:a})},[e,t,r]);return w.jsx(E.Suspense,{fallback:w.jsx("div",{className:"dark:text-white","data-source-lines":o,children:"🌀 Loading code..."}),children:w.jsx(_5,{htmlPromise:s,filename:i,code:e,sourceLines:o})})},yx=({code:e})=>{const[t,r]=E.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"})},xx=(e,t)=>{const r=E.useMemo(()=>{try{return{kind:"rendered",html:fx(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return E.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},A5=({node:e})=>{const t=xx(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(yx,{code:e.value}),t.kind==="rendered"?w.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("article",{className:r,children:t.message})]})},M5=/^[a-z][a-z0-9+.-]*:/i,$5=/^[/\\]{2}/,O5=/[\t\n\r]/g,Ad=32,R5=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=Ad;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=Ad;)r-=1;return e.slice(t,r)},Cx=e=>{const t=R5(e).replace(O5,"");return M5.test(t)||$5.test(t)},I5="text-link underline visited:text-link-visited",P5="inline-block w-fit",Ah=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"]);[...Ah].join(",");const bx=(e,t)=>[e,t?P5:void 0,I5].filter(r=>r!==void 0&&r.trim()!=="").join(" "),D5=new Set(["id","title","lang","dir","role"]),N5=["aria-","data-footnote-"],q5=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(D5.has(o)||N5.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},ye=new sn.Logger(sn.LogLevel.INFO,"[DifyIFramePlugin]"),z5="100%",j5="600px",W5="0",H5=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,Y5=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=E.useState(!0),[o,s]=E.useState(!1),a=E.useRef(null),n=E.useRef(null),l=E.useRef(null),{src:c}=e,h=E.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!eb(x.origin,t)||H5(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=E.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))}},[]),f=E.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(T=>T||!0),s(T=>T&&!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]);E.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),E.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]),E.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:u=z5,height:p=j5,frameborder:m=W5,...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: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 認証を開始"})})]}),w.jsx("div",{className:`${r||o?"hidden":"block"}`,children:w.jsx("iframe",{ref:a,...Et.attributesToProps({...y,width:u,height:p,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},Md=Object.freeze({dify:Y5}),U5=e=>Object.hasOwn(Md,e)?Md[e]:null,X5=w.jsx(E.Fragment,{}),G5=(e,t,r,i,o)=>{const s=t===null?null:U5(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return w.jsx(NC,{embed:e,label:i,insideAnchor:o,children:s!==null?w.jsx(s,{embed:e,iFrameAllowedDomains:r}):w.jsx("iframe",{...Et.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},V5=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof Et.Element&&t.name.toLowerCase()==="a")return!0;return!1},kx=e=>e.some(t=>t instanceof Et.Element&&(Ah.has(t.name)||kx(t.children))),K5=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":a,...n}=e.attribs,l=bx(i,kx(e.children)),c=n.href??"",h=o,d=h==="external"||Cx(c),f=Et.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:q5(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),w.jsx("a",{...Et.attributesToProps(n,"a"),className:l,...u,children:f})},wx=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:a=>{if(!(a instanceof Et.Element))return;const n=a.parent instanceof Et.Element?a.parent.name:null,l=gl(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return X5;case"unwrap":return w.jsx(E.Fragment,{children:Et.domToReact(a.children,s)});case"embed":return G5(l.embed,l.pluginType,e,t.embeddedFrame,V5(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 K5(a,s,r)}};return s},Z5=({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(vC,{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})]})]}),Q5=(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(Z5,{alt:o,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,w.jsx("img",{alt:"",...Et.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},Xs=e=>e.map(t=>t instanceof Et.Text?t.data:t instanceof Et.Element?Xs(t.children):"").join(""),J5=(e,t)=>e.map(r=>{if(r instanceof Et.Text)return{kind:"text",text:r.data};if(!(r instanceof Et.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=gl(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),t3=(e,t,r,i)=>{const o=e.children,s=ur.placeholderLinkOf(t,J5(o,i.iFrameAllowedDomains));if(s===null)return;const a=Et.domToReact(o,r),n=w.jsx("p",{...Et.attributesToProps(e.attribs,"p"),children:a}),l=o.find(f=>f instanceof Et.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&ur.isBareLink(Xs(l.children),s)?w.jsx(HC,{href:t,endpoint:c,size:qe.linkCardSizeOf(i.embeds),fallback:n}):n,d=Pr.resolveEmbed(s,i.embeds.providers);return d===null?h:w.jsx(JC,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},e3={lowerCaseAttributeNames:!1},$d=2166136261,Od=16777619,Rd=/^[\t\n\f\r ]*$/u,r3=`language-${Dt.SPREADSHEETS_LANGUAGE}`,Sx=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(r3),i3=e=>{let t=$d,r=$d;const i=(s,a)=>{for(let n=0;n<s.length;n+=1){const l=s.charCodeAt(n);r=Math.imul(r^l,Od),a&&(t=Math.imul(t^l,Od))}},o=(s,a)=>{if(s instanceof Et.Text)i("",a),i(s.data,a);else if(s instanceof Et.Element){i("",a),i(s.name,a);for(const[l,c]of Object.entries(s.attribs))l!==go.SOURCE_LINES_ATTRIBUTE&&(i("",a),i(l,a),i("",a),i(c,a));i("",a);const n=a&&!Sx(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)}},o3=(e,t,r)=>{if(e==="")return{nodes:[],keys:[]};const i=Et.htmlToDOM(e,e3),o=i.filter(n=>!(n instanceof Et.Text&&Rd.test(n.data))),s=EC(o.map(i3),r);let a=0;return{nodes:i.map(n=>{if(n instanceof Et.Text&&Rd.test(n.data))return n.data;const{key:l}=s[a];return a+=1,w.jsx(E.Fragment,{children:Et.domToReact([n],t)},l)}),keys:s}},Tx=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=qe.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",onMathDiagnostics:f})=>{Xd(i);const u=jd(o),p=gx(n),m={rendered:0},y=[],x=E.useRef(null),C=E.useEffectEvent(L=>{f?.(L)}),k=wx({iFrameAllowedDomains:r,embedLabels:u,linkComponent:h,renderPlaceholder:(L,_,A)=>t3(L,_,A,{embeds:i,theme:t,embedLabels:u,iFrameAllowedDomains:r}),renderKept:L=>{if(L.name==="pre"&&L.children.length===1){const _=L.children[0];if(_ instanceof Et.Element&&_.name==="code"){const A=_.attribs.class??"",F=Xs(_.children),$=L.attribs[go.SOURCE_LINES_ATTRIBUTE];return Sx(_)?w.jsx(Eh,{tsv:F,meta:_.attribs[Dt.CODE_META_ATTRIBUTE],sourceLines:$,editor:p,locale:l,labels:c}):A.includes("language-mermaid")?w.jsx(Bh,{chartContent:F,interaction:s,labels:a,sourceLines:$}):w.jsx(Fh,{lang:A.replace("language-",""),code:F,theme:t,sourceLines:$})}}if(L.name==="img")return Q5(L,d,m);if(L.name==="span"&&L.attribs.class?.includes("math")){const _=L.attribs.class.includes("display");let A=Xs(L.children).trim();_?A=A.replace(/^\\\[/,"").replace(/\\\]$/,""):A=A.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:F,diagnostics:$}=fx(A,_);return y.push(...$),_?w.jsxs("span",{className:"group relative block",children:[w.jsx(yx,{code:A}),w.jsx("span",{dangerouslySetInnerHTML:{__html:F}})]}):w.jsx("span",{dangerouslySetInnerHTML:{__html:F}})}catch(F){console.error("Failed to render math:",F);return}}}}),S=E.useRef([]),{nodes:T,keys:B}=o3(e,k,S.current);return E.useEffect(()=>{S.current=B},[B]),E.useEffect(()=>{x.current!==e&&(x.current=e,y.length>0&&C(y))},[e,y]),w.jsx("div",{className:"markdown-body","data-theme":t,children:T})};const s3=[["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",s3);const n3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],l3=Tt("text-align-center",n3);const h3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],c3=Tt("text-align-start",h3);const d3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],u3=Tt("text-align-end",d3);const f3=[["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"}]],p3=Tt("list",f3);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"}]],m3=Tt("palette",g3);const y3=[["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"}]],x3=Tt("pin",y3);const C3=[["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"}]],b3=Tt("pin-off",C3),k3=e=>`#${e.id}`,w3=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},Id="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",vx=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=k3,label:o,labelledBy:s})=>{if(e.length===0)return null;const a=w3(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:`${Id} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):w.jsx("a",{href:Eo(c)?c:void 0,className:`${Id} 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)})})})},rn="--aqmd-toolbar-block-overlap",S3=({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},_x=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,Bx=Object.keys(Sa),T3=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,v3=Object.keys(Dt.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),Lx=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"},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(Bx.map(e=>[_x(e),Sa[e]])),...Ks}),_3=fl(Lx),B3=e=>Vs(Lx,e),L3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of Bx){const i=e[_x(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},E3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of v3){const i=e[T3(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},F3=Object.keys(Ks),A3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of F3){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},Pd=Object.freeze({left:{labelKey:"alignLeft",Icon:c3},center:{labelKey:"alignCenter",Icon:l3},right:{labelKey:"alignRight",Icon:u3}}),M3=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),$3="100%",O3=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",ul="24px",Ex=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"}),R3=Ex(ul),I3=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"}),P3=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,D3=8,Dd=800,N3=16,q3=(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>Dd||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>N3)&&(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,Dd)},z3=(e,t,r)=>{const[i,o]=E.useState(null);return E.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,p=u===null?Number.POSITIVE_INFINITY:u.offsetTop+u.height,m=Math.min(r.getBoundingClientRect().bottom,p);o(Math.max(0,Math.floor((m-d.top)/f-D3)))},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 on({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:p,scrollBarClearance:m,boundary:y,renderBody:x}){const C=E.useRef(null),k=E.useRef(null),S=E.useRef(null),T=z3(n,S,y),B=E.useCallback(()=>{d(),h()},[h,d]),L=E.useCallback(()=>{if(l)return;const A=C.current?.contains(document.activeElement)===!0;f(),A&&k.current?.focus()},[l,f]);E.useEffect(()=>{if(!n||l)return;const A=C.current;if(A===null)return;const F=H=>{A.contains(H.target)||(f(),H.pointerType==="touch"&&!(H.target instanceof Element&&H.target.closest("[data-aqmd-toolbar]")!==null)&&q3(A.ownerDocument,H))},$=H=>{H.key!=="Escape"||H.defaultPrevented||H.isComposing||(H.preventDefault(),f(),k.current?.focus())};return document.addEventListener("pointerdown",F),A.addEventListener("keydown",$),()=>{document.removeEventListener("pointerdown",F),A.removeEventListener("keydown",$)}},[n,l,f]);const _=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:B,"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:P3(m),maxBlockSize:T??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:u,"aria-label":_.text,lang:_.lang,children:l?w.jsx(x3,{className:"h-4 w-4"}):w.jsx(b3,{className:"h-4 w-4"})})]}),x(L)]})]})}const j3=(e,t,r,i)=>{const[o,s]=E.useState(0),a=E.useRef(null);return E.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(S3({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 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]),E.useLayoutEffect(()=>{a.current?.()},[i]),o},W3=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,H3=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},Y3=E.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,mermaidLabels:c,spreadsheetEditor:h,spreadsheetLocale:d,spreadsheetLabels:f,onMathDiagnostics:u}){return w.jsx("div",{className:"w-full min-w-0",children:w.jsx("div",{className:i,"data-theme":r,children:w.jsx(Tx,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,mermaidLabels:c,spreadsheetEditor:h,spreadsheetLocale:d,spreadsheetLabels:f,onMathDiagnostics:u})})})});function Fx(){const[e,t]=E.useState("toc"),[r,i]=E.useState(!1),[o,s]=E.useState(!1),[a,n]=E.useState(!1),[l,c]=E.useState(!1),[h,d]=E.useState(!1),[f,u]=E.useState(!1),p=E.useCallback(()=>t("toc"),[]),m=E.useCallback(()=>i(F=>!F),[]),y=E.useCallback(()=>i(!1),[]),x=E.useCallback(()=>c(F=>!F),[]),C=E.useCallback(()=>t("style"),[]),k=E.useCallback(()=>s(F=>!F),[]),S=E.useCallback(()=>s(!1),[]),T=E.useCallback(()=>d(F=>!F),[]),B=E.useCallback(()=>t("align"),[]),L=E.useCallback(()=>n(F=>!F),[]),_=E.useCallback(()=>n(!1),[]),A=E.useCallback(()=>u(F=>!F),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:f,activateToc:p,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:k,closeStyle:S,togglePinStyle:T,activateAlign:B,toggleAlign:L,closeAlign:_,togglePinAlign:A}}const U3=({error:e,labels:t})=>{if(E.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 X3({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,style:a,onStyleChange:n,availableStyles:l=zi.DEFAULT_MARKDOWN_STYLES,align:c=zi.DEFAULT_CONTENT_ALIGN,onAlignChange:h,showToc:d=!0,showStyle:f=!0,showAlign:u=!0,width:p,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=qe.NO_EMBEDS,emptyMessage:k,toolbar:S,linkComponent:T,onHeadingSelect:B,headingHref:L,onMathDiagnostics:_,spreadsheetEditor:A,spreadsheetLocale:F,renderScrollBar:$}){const H=E.useRef(null),[Y,N]=E.useState(null),I=E.useCallback(Lt=>{H.current=Lt,N(Lt)},[]),[P,q]=E.useState(0),R=E.useRef(null),[O,z]=E.useState(null),v=E.useRef(null),U=E.useId(),D=Fx(),X=S??D,G=E.useMemo(()=>B3(o),[o]),Z=E.useMemo(()=>L3(o),[o]),K=E.useMemo(()=>E3(o),[o]),at=gx(A);Xd(C);const gt=Pr.EMBED_PROVIDER_IDS.filter(Lt=>C.providers.includes(Lt)).join(" "),ct=C.linkCardEndpoint,mt=C.linkCardSize,Ft=E.useMemo(()=>{const Lt=gt.split(" "),vt=Object.freeze(Pr.EMBED_PROVIDER_IDS.filter(Q=>Lt.includes(Q)));return Object.freeze(mt===void 0?{providers:vt,linkCardEndpoint:ct}:{providers:vt,linkCardEndpoint:ct,linkCardSize:mt})},[gt,ct,mt]),At=o?.embeddedVideo,Mt=o?.embeddedPost,Ht=o?.embeddedFrame,Vt=E.useMemo(()=>A3({embeddedVideo:At,embeddedPost:Mt,embeddedFrame:Ht}),[At,Mt,Ht]),te=E.useRef(_);E.useLayoutEffect(()=>{te.current=_},[_]);const $e=E.useCallback(Lt=>{te.current?.(Lt)},[]),ge=k===void 0?M3:{text:k,lang:void 0},Bt=j3(H,R,O,c);if(!zi.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${zi.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const xt=Number.isFinite(y)&&y>=0?y:16,Oe=E.useCallback(Lt=>{const vt=H.current;if(vt){const Q=vt.querySelector("[data-theme]"),lt=vt.getBoundingClientRect(),wt=Q?.children;let Pt=-1,Ke=Number.POSITIVE_INFINITY;if(wt)for(let Se=0;Se<wt.length;Se+=1){const qi=wt[Se],Mh=Math.abs(qi.getBoundingClientRect().top-lt.top);Mh<Ke&&(Ke=Mh,Pt=Se)}if(wt&&Pt>=0){const qi=wt[Pt].getBoundingClientRect();v.current={childIndex:Pt,offset:qi.top-lt.top}}else v.current=null}n(Lt)},[n]);E.useLayoutEffect(()=>{const Lt=v.current;if(!Lt)return;v.current=null;const vt=H.current;if(!vt)return;const lt=vt.querySelector("[data-theme]")?.children[Lt.childIndex];if(!lt)return;const wt=vt.getBoundingClientRect(),Ke=lt.getBoundingClientRect().top-wt.top;vt.scrollTop+=Ke-Lt.offset});const{isTocPinned:br,closeToc:we}=X,Ge=E.useCallback((Lt,vt)=>{if(br||we(),B?.(Lt,vt)===!0)return;vt.preventDefault();const lt=H.current?.querySelector(`#${CSS.escape(Lt.id)}`)??document.getElementById(Lt.id);lt&&(H3(lt),lt.tabIndex<0&&!lt.hasAttribute("tabindex")&&lt.setAttribute("tabindex","-1"),lt.scrollIntoView({behavior:W3()?"instant":"smooth",block:"start"}),lt.focus({preventScroll:!0}))},[we,br,B]),Ur=E.useMemo(()=>l.find(vt=>vt.name===a)?.className??"markdown-body",[l,a]),Re=e?.headings??[],kr=!(i||r),lr=kr&&e!==null,Xr=kr&&e===null&&t!==null,wr=lr&&d&&Re.length>0,Ve=lr&&f,Sr=(lr||Xr)&&u&&typeof h=="function"&&(p!==void 0||m!==void 0),J=E.useMemo(()=>w.jsx(vx,{headings:Re,className:"text-sm",labelledBy:U,onHeadingSelect:Ge,headingHref:L}),[Re,U,Ge,L]),nt=$===void 0?ul:`${P}px`,Ct=E.useMemo(()=>nt===ul?R3:Ex(nt),[nt]),qt=wr||Ve||Sr?w.jsxs("div",{ref:z,"data-aqmd-toolbar":!0,style:Ct,children:[w.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:I3}),Sr&&h&&w.jsx(on,{menu:"align",Icon:Pd[c].Icon,buttonLabel:G.selectAlignAria,titleLabel:G.alignTitle,pinLabel:G.pinAlignAria,unpinLabel:G.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:nt,boundary:Y,renderBody:Lt=>w.jsx("div",{className:"space-y-1",children:zi.CONTENT_ALIGNS.map(vt=>{const{labelKey:Q,Icon:lt}=Pd[vt],wt=G[Q],Pt=c===vt;return w.jsxs("button",{type:"button","aria-pressed":Pt,lang:wt.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${Pt?"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(vt),Lt()},children:[w.jsx(lt,{className:"h-4 w-4"}),wt.text]},vt)})})}),Ve&&w.jsx(on,{menu:"style",Icon:m3,buttonLabel:G.selectStyleAria,titleLabel:G.styleTitle,pinLabel:G.pinStyleAria,unpinLabel:G.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:nt,boundary:Y,renderBody:Lt=>w.jsx("div",{className:"space-y-1",children:l.map(vt=>{const Q=a===vt.name;return w.jsx("button",{type:"button","aria-pressed":Q,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${Q?"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:()=>{Oe(vt.name),Lt()},children:vt.name},vt.name)})})}),wr&&w.jsx(on,{menu:"toc",Icon:p3,buttonLabel:G.openTocAria,titleLabel:G.tocTitle,titleId:U,pinLabel:G.pinTocAria,unpinLabel:G.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:nt,boundary:Y,renderBody:()=>J})]}):null,It=()=>i?w.jsxs("p",{children:[w.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",w.jsx("span",{lang:G.loading.lang,children:G.loading.text})]}):r?w.jsx(U3,{error:r,labels:G}):e?w.jsx("div",{className:"relative w-full min-w-0",children:w.jsx(Y3,{parseResult:e,theme:s,styleClassName:Ur,iFrameAllowedDomains:x,embeds:Ft,embedLabels:Vt,linkComponent:T,missingImageLabel:G.missingImage.text,mermaidLabels:Z,spreadsheetEditor:at,spreadsheetLocale:F,spreadsheetLabels:K,onMathDiagnostics:$e})}):t!==null?w.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):w.jsx("p",{lang:ge.lang,children:ge.text}),Ni={containerType:"inline-size",paddingInline:`${xt}px`,paddingBlockEnd:`${xt}px`,paddingBlockStart:`calc(${xt}px + var(${rn}))`,scrollPaddingBlockStart:`var(${rn})`,[rn]:`${Bt}px`};return w.jsxs(Hd,{scrollerRef:I,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:Ni},renderScrollBar:$,onBarInlineSizeChange:q,children:[qt,w.jsx("div",{ref:R,"data-aqmd-content":!0,style:{width:p??$3,maxWidth:m,marginInline:O3(c)},children:It()})]})}const Ax=({node:e})=>w.jsx("del",{children:w.jsx(Wt,{nodes:e.children})}),Mx=({node:e})=>w.jsx("em",{children:w.jsx(Wt,{nodes:e.children})}),$x=({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,"]"]})}),G3=({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(Wt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),Ox=({node:e})=>w.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),V3=e=>e.replace(/<rt\b[^>]*>[\s\S]*?<\/rt>/gi,"").replace(/<rp\b[^>]*>[\s\S]*?<\/rp>/gi,"").replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&amp;/gi,"&").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/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(),Rx=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"?V3(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()},K3=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"}},Ix=({node:e})=>{const t=new oC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(Rx(e.children));return w.jsx(r,{id:i||o,className:K3(e.depth),children:w.jsx(Wt,{nodes:e.children})})},Z3=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),Q3=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=w.jsx(Wt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=gl(e.data.tagName,Z3(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,{...Et.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},J3=/^\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,t$=({node:e,iFrameAllowedDomains:t=[]})=>{const r=Et(e.value,wx({iFrameAllowedDomains:t,embedLabels:nC}));return Array.isArray(r)&&r.length===0?null:J3.test(e.value)?w.jsx("div",{children:r}):w.jsx("span",{children:r})},Px=({node:e})=>{if(!e.url||e.url.trim()===""||!Eo(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})]})},Dx=({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}),e$=({node:e})=>{const t=xx(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})},r$=new RegExp(`<(?:${[...Ah].join("|")})(?=[\\s/>])`,"i"),Nx=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&&Nx(t.children)),qx=({node:e})=>{const t=Eo(e.url)?e.url:void 0,r=t!==void 0&&Cx(t);return w.jsx("a",{className:bx(void 0,Nx(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:w.jsx(Wt,{nodes:e.children})})},zx=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?w.jsx("li",{children:w.jsx(Wt,{nodes:e.children[0].children})}):w.jsx("li",{children:w.jsx(Wt,{nodes:e.children})}),jx=({node:e})=>{const t=e.ordered?"ol":"ul";return w.jsx(t,{children:w.jsx(Wt,{nodes:e.children})})},i$=({node:e})=>w.jsx("mark",{children:w.jsx(Wt,{nodes:e.children})}),Wx=({node:e})=>w.jsx("p",{children:w.jsx(Wt,{nodes:e.children})}),Hx=({node:e})=>w.jsx("strong",{children:w.jsx(Wt,{nodes:e.children})}),o$=({node:e})=>w.jsx("sub",{children:w.jsx(Wt,{nodes:e.children})}),s$=({node:e})=>w.jsx("sup",{children:w.jsx(Wt,{nodes:e.children})}),Nd=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},Yx=({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}=Nd(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(Wt,{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}=Nd(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(Wt,{nodes:s.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},Ux=({node:e})=>w.jsx(w.Fragment,{children:e.value}),Xx=()=>w.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),Gx=({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(Wt,{nodes:e.children})})]})},Vx=({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(Wt,{nodes:e.children})})]})},Wt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,o)=>{switch(i.type){case"blockquote":return w.jsx(Kx,{node:i},`mdast-node-${i.type}-${o}`);case"break":return w.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return w.jsx(Fh,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return w.jsx(Ax,{node:i},`mdast-node-${i.type}-${o}`);case"details":return w.jsx(Gx,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return w.jsx(Mx,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return w.jsx($x,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return w.jsx(Ox,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return w.jsx(Ix,{node:i},`mdast-node-${i.type}-${o}`);case"html":return w.jsx(t$,{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(Q3,{node:s,theme:t,iFrameAllowedDomains:r},a)}case"image":return w.jsx(Px,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return w.jsx(Dx,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return w.jsx(e$,{node:i},`mdast-node-${i.type}-${o}`);case"link":return w.jsx(qx,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return w.jsx(zx,{node:i},`mdast-node-${i.type}-${o}`);case"list":return w.jsx(jx,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return w.jsx(i$,{node:i},`mdast-node-${i.type}-${o}`);case"math":return w.jsx(A5,{node:i},`mdast-node-${i.type}-${o}`);case"message":return w.jsx(Vx,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return w.jsx(Wx,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return w.jsx(Hx,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return w.jsx(o$,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return w.jsx(s$,{node:i},`mdast-node-${i.type}-${o}`);case"table":return w.jsx(Yx,{node:i},`mdast-node-${i.type}-${o}`);case"text":return w.jsx(Ux,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return w.jsx(Xx,{},`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}`)}}}),Kx=({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(Wt,{nodes:e.children})}),a$=/\s*\{#(.+?)\}\s*$/,n$=()=>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(a$);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()}})},l$=()=>e=>{fe.visit(e,"footnoteDefinition",t=>{fe.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},h$=()=>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)}})},c$=()=>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 p of u){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(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)},qd=/\s*=\s*(\d+)(w|h|x|y)\s*/g,d$=()=>e=>{fe.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(qd)];return{updatedText:l.replaceAll(qd,"").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)}}})},u$=()=>e=>{fe.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},zd=/^:::(message|details)\s*(.*)/,f$=()=>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(zd);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 p=r[u];if(p.type==="paragraph"&&p.children[0]?.type==="text"){const m=p.children[0].value.trim();zd.test(m)?d++:m===":::"&&d--}if(d===0){h=u;break}}if(h!==-1){const u=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},T=r[h].children.slice(0,-1);T.at(-1)?.type==="break"&&T.pop();const B={type:"paragraph",children:T},L=r.slice(c+1,h);m=[k,...L,B].filter(_=>!(_.type==="paragraph"&&_.children.length===0))}const y=t(m);let x;if(u==="message"?x={type:"message",data:{messageType:p.trim()},children:y}:u==="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)},p$=e=>{const t=[];return fe.visit(e,"heading",r=>{const i=Rx(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=Kx;exports.CodeNode=Fh;exports.Color=Fe;exports.Color$1=Oi;exports.DEFAULT_MARKDOWN_EMBED_LABELS=aC;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=_3;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=ZA;exports.DEFAULT_MERMAID_INTERACTION=nx;exports.DeleteNode=Ax;exports.EmphasisNode=Mx;exports.FootnoteBackLinkNode=Ox;exports.FootnoteReferenceNode=$x;exports.FootnotesSection=G3;exports.HeadingNode=Ix;exports.HostedScrollArea=Hd;exports.ImageNode=Px;exports.InlineCodeNode=Dx;exports.JSON_SCHEMA=hg;exports.LinkNode=qx;exports.ListItemNode=zx;exports.ListNode=jx;exports.MarkdownRenderer=Tx;exports.MarkdownViewer=X3;exports.MermaidDiagram=Bh;exports.NodesRenderer=Wt;exports.ParagraphNode=Wx;exports.Rgb=ae;exports.SpreadsheetBlock=Eh;exports.StrongNode=Hx;exports.TableNode=Yx;exports.TableOfContents=vx;exports.TextNode=Ux;exports.ThematicBreakNode=Xx;exports.Utils=pt;exports.ZERO_WIDTH_SPACE=Mg;exports.ZennDetailsNode=Gx;exports.ZennMessageNode=Vx;exports.__export=tu;exports.__name=g;exports.abs=gS;exports.acos=SS;exports.adjustChannel=xl;exports.argumentsTag=Ql;exports.array=rf;exports.arrayBufferTag=Cg;exports.arrayTag=xg;exports.asin=TS;exports.assignWithDepth_default=jt;exports.at=rt;exports.atan2=mS;exports.booleanTag=Zl;exports.calculateMathMLDimensions=z1;exports.calculateTextDimensions=da;exports.calculateTextHeight=sh;exports.calculateTextWidth=We;exports.cleanAndMerge=ua;exports.clear=bu;exports.clear$1=xB;exports.clear$2=Y_;exports.clear2=uB;exports.color=_i;exports.commonDb_exports=Sl;exports.common_default=$i;exports.computeDimensionOfText=mm;exports.computeLabelTransform=ei;exports.configureLabelImages=nh;exports.configureSvgSize=wl;exports.constant=Lr;exports.constant$1=ea;exports.cos=yS;exports.createText=Me;exports.curveBasis=Ls;exports.darken=W;exports.dataViewTag=kg;exports.dateTag=gg;exports.dayjs2=eu;exports.decodeEntities=mr;exports.defaultConfig2=K1;exports.defaultConfig_default=Cl;exports.define=ta;exports.distExports=dg;exports.edgeLabels=vo;exports.epsilon=Tn;exports.extend=Al;exports.extractHeadings=p$;exports.float32ArrayTag=Eg;exports.float64ArrayTag=Fg;exports.generateId=Dg;exports.getAccDescription=Tu;exports.getAccTitle=wu;exports.getConfig=Ot;exports.getConfig2=kt;exports.getDefaultExportFromCjs=Wd;exports.getDiagramTitle=_u;exports.getEdgeId=mv;exports.getEffectiveHtmlLabels=ie;exports.getIconSVG=Ii;exports.getLineFunctionsWithOffset=Gy;exports.getRegisteredLayoutAlgorithm=ZB;exports.getStylesFromArray=oh;exports.getSubGraphTitleMargins=fa;exports.getTag=ha;exports.getThemeVariables3=iu;exports.getUrl=xu;exports.getUserDefinedConfig=L1;exports.halfPi=vn;exports.hasKatex=Ti;exports.hue=U2;exports.insertCluster=Bm;exports.insertEdge=Qy;exports.insertEdgeLabel=Vy;exports.insertNode=wh;exports.int16ArrayTag=Bg;exports.int32ArrayTag=Lg;exports.int8ArrayTag=_g;exports.interpolateNumber=er;exports.interpolateRgb=mn;exports.interpolateString=Hu;exports.isDark=ke;exports.isLabelStyle=Gl;exports.isPrimitive=ca;exports.isTypedArray=uo;exports.isValidShape=Xy;exports.lighten=j;exports.line=sf;exports.lineBreakRegex=Mi;exports.load=cg;exports.log=V;exports.mapTag=mg;exports.markerOffsets=Jt;exports.markers_default=e0;exports.max=xS;exports.min=CS;exports.nogamma=Ml;exports.numberTag=Kl;exports.objectTag=bg;exports.parseFontSize=$o;exports.parseGenericTypes=hn;exports.pi=oa;exports.positionEdgeLabel=Ky;exports.positionNode=fB;exports.random=qg;exports.regexpTag=fg;exports.registerIconPacks=Ug;exports.remarkCustomHeadingId=n$;exports.remarkFootnoteBackLink=l$;exports.remarkHtmlAnchorToLink=h$;exports.remarkHtmlInHtml=c$;exports.remarkImageSize=d$;exports.remarkParentNode=u$;exports.remarkZennMessage=f$;exports.render=KB;exports.renderKatexSanitized=kl;exports.rgbConvert=zu;exports.rgba=rr;exports.sanitizeText=Ce;exports.select=yt;exports.selectSvgElement=Bf;exports.setAccDescription=Su;exports.setAccTitle=ku;exports.setConfig2=V1;exports.setDiagramTitle=vu;exports.setNodeElem=dB;exports.setTag=yg;exports.setupGraphViewbox=Cu;exports.setupGraphViewbox2=Bu;exports.sin=bS;exports.sqrt=kS;exports.stringTag=Vl;exports.styles2String=it;exports.symbolTag=pg;exports.tau=wS;exports.terminalLabels=Xt;exports.uint16ArrayTag=Tg;exports.uint32ArrayTag=vg;exports.uint8ArrayTag=wg;exports.uint8ClampedArrayTag=Sg;exports.unknownIcon=Hg;exports.updateNodeBounds=ot;exports.useMarkdownToolbarState=Fx;exports.utils_default=xe;exports.withPath=ef;exports.wrapLabel=zg;