@inkeep/open-knowledge 0.14.1-beta.1 → 0.14.1-beta.10

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 (151) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +3 -3
  3. package/dist/cli.mjs +53 -53
  4. package/dist/config-schema.json +1 -1
  5. package/dist/config.project-local.schema.json +1 -1
  6. package/dist/config.project.schema.json +1 -1
  7. package/dist/config.user.schema.json +1 -1
  8. package/dist/constants-DjVYhfxT.mjs +2 -0
  9. package/dist/{dist-DDXOiPkg.mjs → dist-Cp_03Nwz.mjs} +8 -8
  10. package/dist/dist-DVfe95Mj.mjs +1 -0
  11. package/dist/{gh-detect-CiwGHfLq.mjs → gh-detect-CFkwvbke.mjs} +2 -2
  12. package/dist/index.mjs +1 -1
  13. package/dist/{init-DzONFFom.mjs → init-BKwzDQVl.mjs} +9 -9
  14. package/dist/init-LtIvqjzS.mjs +1 -0
  15. package/dist/{loader-BMRP9prn.mjs → loader-BsCdRHX0.mjs} +2 -2
  16. package/dist/loader-kaWZncL_.mjs +1 -0
  17. package/dist/{preview-BANXpVov.mjs → preview-BuOcr4k1.mjs} +2 -2
  18. package/dist/preview-CLqqvU70.mjs +1 -0
  19. package/dist/public/assets/{ActivityModeContent-D1LV0i9s.js → ActivityModeContent-Ct2Ie8Uw.js} +1 -1
  20. package/dist/public/assets/ConsentDialogBody-B1OWvzyk.js +2 -0
  21. package/dist/public/assets/DocumentContext-CSuzjbA_.js +34 -0
  22. package/dist/public/assets/{GraphPanel-CsPsbx6t.js → GraphPanel--je5keW-.js} +3 -3
  23. package/dist/public/assets/McpConsentDialogBody-CtLqSrfK.js +1 -0
  24. package/dist/public/assets/{OpenInAgentMenuRequestContext-DGTqGF-d.js → OpenInAgentMenuRequestContext-A7DCrMXJ.js} +3 -3
  25. package/dist/public/assets/SettingsDialogBody-CL1MB92k.js +7 -0
  26. package/dist/public/assets/SourceEditor-BuwbdE2L.js +2 -0
  27. package/dist/public/assets/TerminalPanel-D6LgqCx5.js +145 -0
  28. package/dist/public/assets/{architectureDiagram-Q4EWVU46-CGfN8F1x.js → architectureDiagram-Q4EWVU46-BmpF1HV_.js} +1 -1
  29. package/dist/public/assets/{blockDiagram-DXYQGD6D-CvqzFRrs.js → blockDiagram-DXYQGD6D-Y5N7V1J5.js} +1 -1
  30. package/dist/public/assets/{c4Diagram-AHTNJAMY-CTuRG6XQ.js → c4Diagram-AHTNJAMY-BSmJhnUa.js} +1 -1
  31. package/dist/public/assets/channel-CxWPLabj.js +1 -0
  32. package/dist/public/assets/{checkbox-DcMpayVo.js → checkbox-xiDPPQX2.js} +1 -1
  33. package/dist/public/assets/{chunk-336JU56O-BalL_f4q.js → chunk-336JU56O-CEtCBsiw.js} +2 -2
  34. package/dist/public/assets/{chunk-426QAEUC-CYmyjEj-.js → chunk-426QAEUC-xq7mFc66.js} +1 -1
  35. package/dist/public/assets/{chunk-4TB4RGXK-RPiRkbnR.js → chunk-4TB4RGXK-NJg9d9aO.js} +1 -1
  36. package/dist/public/assets/{chunk-5FUZZQ4R-Bp1iPpGN.js → chunk-5FUZZQ4R-CG5QQXov.js} +1 -1
  37. package/dist/public/assets/{chunk-5PVQY5BW-D2kQfsEU.js → chunk-5PVQY5BW-BFfnnQIi.js} +1 -1
  38. package/dist/public/assets/{chunk-EDXVE4YY-9CmJcS4N.js → chunk-EDXVE4YY-9Eze-YYC.js} +1 -1
  39. package/dist/public/assets/{chunk-ENJZ2VHE-DGOBbqgN.js → chunk-ENJZ2VHE-loXqYw4u.js} +1 -1
  40. package/dist/public/assets/{chunk-ICPOFSXX-Dy9JRPZu.js → chunk-ICPOFSXX-Czafge50.js} +1 -1
  41. package/dist/public/assets/{chunk-OYMX7WX6-tBzsu7Qb.js → chunk-OYMX7WX6-ZDun6vrr.js} +1 -1
  42. package/dist/public/assets/{chunk-U2HBQHQK-DThlp4DR.js → chunk-U2HBQHQK-CSsi_nQO.js} +1 -1
  43. package/dist/public/assets/{chunk-X2U36JSP-b_VUmOsG.js → chunk-X2U36JSP-DZKPmsbB.js} +1 -1
  44. package/dist/public/assets/{chunk-YZCP3GAM-CcH_aTzQ.js → chunk-YZCP3GAM-CGzfn7n5.js} +1 -1
  45. package/dist/public/assets/{chunk-ZZ45TVLE-CwnCYU7J.js → chunk-ZZ45TVLE-BUFYnqAJ.js} +1 -1
  46. package/dist/public/assets/classDiagram-6PBFFD2Q-r3Z_tLK2.js +1 -0
  47. package/dist/public/assets/classDiagram-v2-HSJHXN6E-f9ZLpuaz.js +1 -0
  48. package/dist/public/assets/clone-te25EaCJ.js +1 -0
  49. package/dist/public/assets/{collapsible-CiYR1NR5.js → collapsible-T5wuIIwr.js} +1 -1
  50. package/dist/public/assets/config-validation-events-C0jWGSn7.js +12 -0
  51. package/dist/public/assets/{dagre--CGfxwL9.js → dagre-BE13jSMp.js} +1 -1
  52. package/dist/public/assets/{dagre-KV5264BT-Bgd9TndA.js → dagre-KV5264BT-WCVh4vDo.js} +1 -1
  53. package/dist/public/assets/{diagram-5BDNPKRD-YjznpYlO.js → diagram-5BDNPKRD-BwCuU4A5.js} +1 -1
  54. package/dist/public/assets/{diagram-G4DWMVQ6-Dg1TlI6M.js → diagram-G4DWMVQ6-SnuxFspv.js} +1 -1
  55. package/dist/public/assets/{diagram-MMDJMWI5-BJ7btGpD.js → diagram-MMDJMWI5-diafFr4-.js} +1 -1
  56. package/dist/public/assets/{diagram-TYMM5635-BlLor9aT.js → diagram-TYMM5635-CdBAiH95.js} +1 -1
  57. package/dist/public/assets/{dialog-Y0b8qUlN.js → dialog-DAnNTn2Z.js} +1 -1
  58. package/dist/public/assets/{dist-oO1mEK6k.js → dist--WFXzgaP.js} +1 -1
  59. package/dist/public/assets/{dist-xgQMDGcN.js → dist-0kDsAKH1.js} +1 -1
  60. package/dist/public/assets/{dist-BBjgNwuA.js → dist-3YNajely.js} +1 -1
  61. package/dist/public/assets/{dist-o6vfh304.js → dist-B5LD73X3.js} +1 -1
  62. package/dist/public/assets/{dist--GAH0qWV.js → dist-C7u3xI_X.js} +1 -1
  63. package/dist/public/assets/{dist-B79VGnzv2.js → dist-CLIXxF0N.js} +1 -1
  64. package/dist/public/assets/{dist-DsM4vaX5.js → dist-ChSeukn9.js} +1 -1
  65. package/dist/public/assets/{dist-Bv4ezOaA.js → dist-D2xbbdaz2.js} +1 -1
  66. package/dist/public/assets/{dist-qcpgtxJO.js → dist-DANsqx2U.js} +1 -1
  67. package/dist/public/assets/{dist-ClExeLmG.js → dist-DZpmpDA6.js} +1 -1
  68. package/dist/public/assets/{dist-_mlePoD4.js → dist-De7_06z9.js} +1 -1
  69. package/dist/public/assets/{dist-Bd1HH4xx.js → dist-rGiGXpRA.js} +1 -1
  70. package/dist/public/assets/dist-xnhTeErX.js +510 -0
  71. package/dist/public/assets/{erDiagram-SMLLAGMA-CbusJ6ai.js → erDiagram-SMLLAGMA-DkWe230D.js} +1 -1
  72. package/dist/public/assets/{flowDiagram-DWJPFMVM-n690iqHN.js → flowDiagram-DWJPFMVM-XblEo1i_.js} +1 -1
  73. package/dist/public/assets/{ganttDiagram-T4ZO3ILL-CZUxDSBT.js → ganttDiagram-T4ZO3ILL-BSG2Y6qr.js} +1 -1
  74. package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-C6qYFsUb.js → gitGraphDiagram-UUTBAWPF-D20pkY4t.js} +1 -1
  75. package/dist/public/assets/{graphlib-CxIN2cpg.js → graphlib-DTVXa63Y.js} +1 -1
  76. package/dist/public/assets/index-B8Q-Othm.js +2019 -0
  77. package/dist/public/assets/index-BztJojW-.css +1 -0
  78. package/dist/public/assets/{infoDiagram-42DDH7IO-Csns7giJ.js → infoDiagram-42DDH7IO-BHIgui2V.js} +1 -1
  79. package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-2JnHk_DL.js → ishikawaDiagram-UXIWVN3A-COySm_Yo.js} +1 -1
  80. package/dist/public/assets/{journeyDiagram-VCZTEJTY-W5sor6G2.js → journeyDiagram-VCZTEJTY-DqyhAR_2.js} +1 -1
  81. package/dist/public/assets/{kanban-definition-6JOO6SKY-BcHKSFEp.js → kanban-definition-6JOO6SKY-Boud3nvx.js} +1 -1
  82. package/dist/public/assets/{keyboard-shortcuts-DesPYmCt.js → keyboard-shortcuts-CfHQi9DZ.js} +1 -1
  83. package/dist/public/assets/{line-BPa9YIgj.js → line-D5idNiE3.js} +1 -1
  84. package/dist/public/assets/{mermaid.core-srYvzXpO.js → mermaid.core-CiuNJTJu.js} +3 -3
  85. package/dist/public/assets/{mindmap-definition-QFDTVHPH-TBwtPWpG.js → mindmap-definition-QFDTVHPH-DKb2WzOx.js} +1 -1
  86. package/dist/public/assets/{pieDiagram-DEJITSTG-iP5EAWOK.js → pieDiagram-DEJITSTG-Du2iXB7c.js} +1 -1
  87. package/dist/public/assets/project-paths-BocrcwYE.js +1 -0
  88. package/dist/public/assets/prop-types-BtwbmtAc.js +11 -0
  89. package/dist/public/assets/{propagation-api-qAYD7s-v.js → propagation-api-CuTE-jIt.js} +1 -1
  90. package/dist/public/assets/{quadrantDiagram-34T5L4WZ-CRzlf10O.js → quadrantDiagram-34T5L4WZ-BXGwjhjK.js} +1 -1
  91. package/dist/public/assets/{requirementDiagram-MS252O5E-Bg9QnuLQ.js → requirementDiagram-MS252O5E-be2pdwJN.js} +1 -1
  92. package/dist/public/assets/{sankeyDiagram-XADWPNL6-Cl4zPODp.js → sankeyDiagram-XADWPNL6-B1I7kyez.js} +1 -1
  93. package/dist/public/assets/{sequenceDiagram-FGHM5R23-B9LxUMHK.js → sequenceDiagram-FGHM5R23-PxdXu77F.js} +1 -1
  94. package/dist/public/assets/{stateDiagram-FHFEXIEX-C8mEBLKf.js → stateDiagram-FHFEXIEX-C34JyCcn.js} +1 -1
  95. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-CXoHW-xm.js +1 -0
  96. package/dist/public/assets/{target-navigation-intent-DIvU9BHv.js → target-navigation-intent-COXec7Je.js} +1 -1
  97. package/dist/public/assets/{telemetry-impl-DSmdYH7T.js → telemetry-impl-DOol9SLI.js} +1 -1
  98. package/dist/public/assets/{textarea-CuOwJaz9.js → textarea-BuWgZ9oe.js} +1 -1
  99. package/dist/public/assets/{timeline-definition-GMOUNBTQ-BdBq3Z-G.js → timeline-definition-GMOUNBTQ-C8WcLn1-.js} +1 -1
  100. package/dist/public/assets/{toggle-group-Df7XaPvr.js → toggle-group-DsOyo0jm.js} +1 -1
  101. package/dist/public/assets/{tooltip-Bp4cM4E8.js → tooltip-DhvUSgK7.js} +1 -1
  102. package/dist/public/assets/trash-2-C957VvQL.js +1 -0
  103. package/dist/public/assets/{vennDiagram-DHZGUBPP-CJt2-p2B.js → vennDiagram-DHZGUBPP-CdzC1YU4.js} +1 -1
  104. package/dist/public/assets/{wardleyDiagram-NUSXRM2D-CB_N5pVU.js → wardleyDiagram-NUSXRM2D-TZAW47QU.js} +1 -1
  105. package/dist/public/assets/{xychartDiagram-5P7HB3ND-DtVg628z.js → xychartDiagram-5P7HB3ND-Cu0DCktc.js} +1 -1
  106. package/dist/public/index.html +32 -32
  107. package/dist/{repair-launch-json-ZP0QYT4Z.mjs → repair-launch-json-3X2pcuR-.mjs} +2 -2
  108. package/dist/{repair-mcp-configs-BrxT4PHC.mjs → repair-mcp-configs-ZzQA64SM.mjs} +2 -2
  109. package/dist/repair-skills-Ba-YZuKb.mjs +1 -0
  110. package/dist/{repair-skills-4UqJa14n.mjs → repair-skills-BpMSCAS-.mjs} +2 -2
  111. package/dist/schemas/v0/config.project-local.schema.json +1 -1
  112. package/dist/schemas/v0/config.project.schema.json +1 -1
  113. package/dist/schemas/v0/config.user.schema.json +1 -1
  114. package/dist/{server-lock-BpjJj3OD-Co1tfNQM.mjs → server-lock-BpjJj3OD-BBhS9axG.mjs} +3 -3
  115. package/dist/server-lock-CyhBidkz-DSgrTWgx.mjs +1 -0
  116. package/dist/{src-BJFJd9Ky.mjs → src-CqEnt_lw.mjs} +2 -2
  117. package/dist/{start-QeD6GkFH.mjs → start-ERj5-RnH.mjs} +2 -2
  118. package/dist/start-LJCoYh3g.mjs +1 -0
  119. package/dist/{write-project-skill-BOMiBSxq.mjs → write-project-skill-C9C1BoIh.mjs} +2 -2
  120. package/package.json +1 -1
  121. package/dist/constants-C7m8kE3x.mjs +0 -2
  122. package/dist/dist-De0GFsdh.mjs +0 -1
  123. package/dist/init-DGzF4yPe.mjs +0 -1
  124. package/dist/loader-C2W1FT_X.mjs +0 -1
  125. package/dist/preview-9bljwK_U.mjs +0 -1
  126. package/dist/public/assets/ConsentDialogBody-6ABk-kYO.js +0 -2
  127. package/dist/public/assets/DocumentContext-CAteDFxs.js +0 -34
  128. package/dist/public/assets/McpConsentDialogBody-CVzYkIEw.js +0 -1
  129. package/dist/public/assets/SettingsDialogBody-CJW_Sq1u.js +0 -7
  130. package/dist/public/assets/SourceEditor-Dz9mWVTl.js +0 -2
  131. package/dist/public/assets/TerminalPanel-pXNhcKi1.js +0 -145
  132. package/dist/public/assets/channel-Z7DKCHS6.js +0 -1
  133. package/dist/public/assets/classDiagram-6PBFFD2Q-BlQyIadX.js +0 -1
  134. package/dist/public/assets/classDiagram-v2-HSJHXN6E-DeRDAZjJ.js +0 -1
  135. package/dist/public/assets/clone-B2gSWiE3.js +0 -1
  136. package/dist/public/assets/config-validation-events-C_5rJceh.js +0 -12
  137. package/dist/public/assets/dist-BW0ROjDr.js +0 -506
  138. package/dist/public/assets/index-4X6bXAZx.css +0 -1
  139. package/dist/public/assets/index-DzPdElTu.js +0 -2019
  140. package/dist/public/assets/label-B0eGtw2Z.js +0 -1
  141. package/dist/public/assets/project-paths-Bcp2gekW.js +0 -1
  142. package/dist/public/assets/prop-types-BKGsVwoQ.js +0 -11
  143. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-60n5CD_7.js +0 -1
  144. package/dist/repair-skills-D35qgsTr.mjs +0 -1
  145. package/dist/server-lock-CyhBidkz-Bo2K-DzL.mjs +0 -1
  146. package/dist/start-D8PLZMQh.mjs +0 -1
  147. /package/dist/public/assets/{dist-CUqyztDT.js → dist-FC83wUOI.js} +0 -0
  148. /package/dist/public/assets/{dist-DV57qOHV.js → dist-QyEeuecv.js} +0 -0
  149. /package/dist/public/assets/{katex-DBuiuHex.js → katex-BnO72pd2.js} +0 -0
  150. /package/dist/public/assets/{trace-api-DPMyR1_m.js → trace-api-CbLDdnQA.js} +0 -0
  151. /package/dist/public/assets/{w3c-keyname-nBRha8PK.js → w3c-keyname-CIO0QKme.js} +0 -0
@@ -1 +1 @@
1
- import{T as e,_ as t,b as n,c as r,d as i,f as a,g as o,h as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h,v as ee}from"./reduce-Cr8PO88G.js";import{C as te,f as ne,h as g,i as re,n as ie,t as ae,u as oe}from"./_baseFor-BB4KANPr.js";import{n as se,r as ce,t as le}from"./isObjectLike-BWNDxuxw.js";import{i as ue,n as de}from"./isEmpty-Bq6bzoiF.js";import{t as fe}from"./isSymbol-W-l9JIco.js";import{a as _,i as pe,n as v,o as me,r as he,t as y}from"./flatten-BHQFj2az.js";import{C as ge,N as _e,S as ve,T as b,_ as x,b as ye,v as S,x as C,y as be}from"./chunk-5PVQY5BW-D2kQfsEU.js";import{i as xe,n as w,r as T,t as E}from"./graphlib-CxIN2cpg.js";import{n as Se,t as Ce}from"./now-F1RJRIcM.js";var we=1/0,Te=17976931348623157e292;function D(e){return e?(e=Se(e),e===we||e===-we?(e<0?-1:1)*Te:e===e?e:0):e===0?e:0}function Ee(e){var t=D(e),n=t%1;return t===t?n?t-n:t:0}function De(e){return ye(ve(e,void 0,y),e+``)}var Oe=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function ke(e){return Oe.test(e)}var Ae=1,je=4;function Me(e){return xe(e,Ae|je)}var Ne=Object.prototype,Pe=Ne.hasOwnProperty,Fe=be(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&S(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=ge(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||te(u,Ne[l])&&!Pe.call(e,l))&&(e[l]=a[l])}return e});function O(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ie(e){return function(t,r,a){var o=Object(t);if(!re(t)){var s=i(r,3);t=n(t),r=function(e){return s(o[e],e,o)}}var c=e(t,r,a);return c>-1?o[s?t[c]:c]:void 0}}var Le=Math.max;function Re(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:Ee(n);return a<0&&(a=Le(r+a,0)),u(e,i(t,3),a)}var k=Ie(Re);function ze(e,t){return e==null?e:ae(e,f(t),ge)}function Be(e,t){return e&&h(e,f(t))}function Ve(e,t){return e>t}var He=Object.prototype.hasOwnProperty;function Ue(e,t){return e!=null&&He.call(e,t)}function We(e,t){return e!=null&&c(e,t,Ue)}var Ge=`[object String]`;function Ke(e){return typeof e==`string`||!g(e)&&le(e)&&ce(e)==Ge}function A(e,t){var n={};return t=i(t,3),h(e,function(e,r,i){_e(n,r,t(e,r,i))}),n}function j(e){return e&&e.length?pe(e,ie,Ve):void 0}function M(e,t){return e&&e.length?pe(e,i(t,2),he):void 0}function qe(e,n,r,i){if(!se(e))return e;n=t(n,e);for(var a=-1,s=n.length,c=s-1,l=e;l!=null&&++a<s;){var u=o(n[a]),d=r;if(u===`__proto__`||u===`constructor`||u===`prototype`)return e;if(a!=c){var f=l[u];d=i?i(f,u,l):void 0,d===void 0&&(d=se(f)?f:ne(n[a+1])?[]:{})}b(l,u,d),l=l[u]}return e}function Je(e,n,r){for(var i=-1,a=n.length,o={};++i<a;){var c=n[i],l=s(e,c);r(l,c)&&qe(o,t(c,e),l)}return o}function Ye(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Xe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=fe(e),o=t!==void 0,s=t===null,c=t===t,l=fe(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function Ze(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Xe(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Qe(t,n,r){n=n.length?e(n,function(e){return g(e)?function(t){return s(t,e.length===1?e[0]:e)}:e}):[ie];var a=-1;return n=e(n,oe(i)),Ye(me(t,function(t,r,i){return{criteria:e(n,function(e){return e(t)}),index:++a,value:t}}),function(e,t){return Ze(e,t,r)})}var $e=a(`length`),et=`\\ud800-\\udfff`,tt=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,nt=`\\ufe0e\\ufe0f`,rt=`[`+et+`]`,N=`[`+tt+`]`,P=`\\ud83c[\\udffb-\\udfff]`,it=`(?:`+N+`|`+P+`)`,at=`[^`+et+`]`,ot=`(?:\\ud83c[\\udde6-\\uddff]){2}`,st=`[\\ud800-\\udbff][\\udc00-\\udfff]`,ct=`\\u200d`,lt=it+`?`,ut=`[`+nt+`]?`,dt=`(?:`+ct+`(?:`+[at,ot,st].join(`|`)+`)`+ut+lt+`)*`,ft=ut+lt+dt,pt=`(?:`+[at+N+`?`,N,ot,st,rt].join(`|`)+`)`,mt=RegExp(P+`(?=`+P+`)|`+pt+ft,`g`);function ht(e){for(var t=mt.lastIndex=0;mt.test(e);)++t;return t}function gt(e){return ke(e)?ht(e):$e(e)}function _t(e,t){return Je(e,t,function(t,n){return d(e,n)})}var F=De(function(e,t){return e==null?{}:_t(e,t)}),vt=Math.ceil,yt=Math.max;function bt(e,t,n,r){for(var i=-1,a=yt(vt((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function xt(e){return function(t,n,r){return r&&typeof r!=`number`&&S(t,n,r)&&(n=r=void 0),t=D(t),n===void 0?(n=t,t=0):n=D(n),r=r===void 0?t<n?1:-1:D(r),bt(t,n,r,e)}}var I=xt(),St=`[object Map]`,Ct=`[object Set]`;function wt(e){if(e==null)return 0;if(re(e))return Ke(e)?gt(e):e.length;var t=de(e);return t==St||t==Ct?e.size:ue(e).length}var L=be(function(e,t){if(e==null)return[];var n=t.length;return n>1&&S(e,t[0],t[1])?t=[]:n>2&&S(t[0],t[1],t[2])&&(t=[t[0]]),Qe(e,p(t,1),[])}),Tt=0;function R(e){var t=++Tt;return ee(e)+t}function Et(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function Dt(e,t){return Et(e||[],t||[],b)}var Ot=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return kt(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&kt(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,At)),n=n._prev;return`[`+e.join(`, `)+`]`}};function kt(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function At(e,t){if(e!==`_next`&&e!==`_prev`)return t}var jt=C(1);function Mt(e,t){if(e.nodeCount()<=1)return[];var n=Pt(e,t||jt);return y(_(Nt(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function Nt(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)z(e,t,n,o);for(;o=i.dequeue();)z(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(z(e,t,n,o,!0));break}}}return r}function z(e,t,n,r,i){var a=i?[]:void 0;return l(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,B(t,n,s)}),l(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,B(t,n,o)}),e.removeNode(r.v),a}function Pt(e,t){var n=new E,r=0,i=0;l(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),l(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=I(i+r+3).map(function(){return new Ot}),o=r+1;return l(n.nodes(),function(e){B(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function B(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Ft(e){l(e.graph().acyclicer===`greedy`?Mt(e,t(e)):It(e),function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,R(`rev`))});function t(e){return function(t){return e.edge(t).weight}}}function It(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,l(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return l(e.nodes(),i),t}function Lt(e){l(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function V(e,t,n,r){var i;do i=R(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function Rt(e){var t=new E().setGraph(e.graph());return l(e.nodes(),function(n){t.setNode(n,e.node(n))}),l(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function zt(e){var t=new E({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),l(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function Bt(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function H(e){var t=_(I(Wt(e)+1),function(){return[]});return l(e.nodes(),function(n){var r=e.node(n),i=r.rank;w(i)||(t[i][r.order]=n)}),t}function Vt(e){var t=v(_(e.nodes(),function(t){return e.node(t).rank}));l(e.nodes(),function(n){var r=e.node(n);We(r,`rank`)&&(r.rank-=t)})}function Ht(e){var t=v(_(e.nodes(),function(t){return e.node(t).rank})),n=[];l(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;l(n,function(t,n){w(t)&&n%i!==0?--r:r&&l(t,function(t){e.node(t).rank+=r})})}function Ut(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),V(e,`border`,i,t)}function Wt(e){return j(_(e.nodes(),function(t){var n=e.node(t).rank;if(!w(n))return n}))}function Gt(e,t){var n={lhs:[],rhs:[]};return l(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Kt(e,t){var n=Ce();try{return t()}finally{console.log(e+` time: `+(Ce()-n)+`ms`)}}function qt(e,t){return t()}function Jt(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&l(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Yt(e,`borderLeft`,`_bl`,n,i,a),Yt(e,`borderRight`,`_br`,n,i,a)}}l(e.children(),t)}function Yt(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=V(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Xt(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Qt(e)}function Zt(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&en(e),(t===`lr`||t===`rl`)&&(tn(e),Qt(e))}function Qt(e){l(e.nodes(),function(t){$t(e.node(t))}),l(e.edges(),function(t){$t(e.edge(t))})}function $t(e){var t=e.width;e.width=e.height,e.height=t}function en(e){l(e.nodes(),function(t){U(e.node(t))}),l(e.edges(),function(t){var n=e.edge(t);l(n.points,U),Object.prototype.hasOwnProperty.call(n,`y`)&&U(n)})}function U(e){e.y=-e.y}function tn(e){l(e.nodes(),function(t){W(e.node(t))}),l(e.edges(),function(t){var n=e.edge(t);l(n.points,W),Object.prototype.hasOwnProperty.call(n,`x`)&&W(n)})}function W(e){var t=e.x;e.x=e.y,e.y=t}function nn(e){e.graph().dummyChains=[],l(e.edges(),function(t){rn(e,t)})}function rn(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=V(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function an(e){l(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function G(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=v(_(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}l(e.sources(),n)}function K(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function on(e){var t=new E({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;sn(t,e)<r;)i=cn(t,e),a=t.hasNode(i.v)?K(e,i):-K(e,i),ln(t,e,a);return t}function sn(e,t){function n(r){l(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!K(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return l(e.nodes(),n),e.nodeCount()}function cn(e,t){return M(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return K(t,n)})}function ln(e,t,n){l(e.nodes(),function(e){t.node(e).rank+=n})}C(1),C(1),un.CycleException=q;function un(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new q;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,l(e.predecessors(a),i),delete n[a],r.push(a))}if(l(e.sinks(),i),wt(t)!==e.nodeCount())throw new q;return r}function q(){}q.prototype=Error();function dn(e,t,n){g(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return l(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);fn(e,t,n===`post`,a,r,i)}),i}function fn(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),l(i(t),function(t){fn(e,t,n,r,i,a)}),n&&a.push(t))}function pn(e,t){return dn(e,t,`post`)}function mn(e,t){return dn(e,t,`pre`)}J.initLowLimValues=X,J.initCutValues=Y,J.calcCutValue=gn,J.leaveEdge=vn,J.enterEdge=yn,J.exchangeEdges=Z;function J(e){e=Rt(e),G(e);var t=on(e);X(t),Y(t,e);for(var n,r;n=vn(t);)r=yn(t,e,n),Z(t,e,n,r)}function Y(e,t){var n=pn(e,e.nodes());n=n.slice(0,n.length-1),l(n,function(n){hn(e,t,n)})}function hn(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=gn(e,t,n)}function gn(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,l(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,xn(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function X(e,t){arguments.length<2&&(t=e.nodes()[0]),_n(e,{},1,t)}function _n(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,l(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=_n(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function vn(e){return k(e.edges(),function(t){return e.edge(t).cutvalue<0})}function yn(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var o=e.node(i),s=e.node(a),c=o,l=!1;return o.lim>s.lim&&(c=s,l=!0),M(r(t.edges(),function(t){return l===Sn(e,e.node(t.v),c)&&l!==Sn(e,e.node(t.w),c)}),function(e){return K(t,e)})}function Z(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),X(e),Y(e,t),bn(e,t)}function bn(e,t){var n=mn(e,k(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),l(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function xn(e,t,n){return e.hasEdge(t,n)}function Sn(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Cn(e){switch(e.graph().ranker){case`network-simplex`:En(e);break;case`tight-tree`:Tn(e);break;case`longest-path`:wn(e);break;default:En(e)}}var wn=G;function Tn(e){G(e),on(e)}function En(e){J(e)}function Dn(e){var t=V(e,`root`,{},`_root`),n=kn(e),r=j(T(n))-1,i=2*r+1;e.graph().nestingRoot=t,l(e.edges(),function(t){e.edge(t).minlen*=i});var a=An(e)+1;l(e.children(),function(o){On(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function On(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=Ut(e,`_bt`),u=Ut(e,`_bb`),d=e.node(o);e.setParent(c,o),d.borderTop=c,e.setParent(u,o),d.borderBottom=u,l(s,function(s){On(e,t,n,r,i,a,s);var l=e.node(s),d=l.borderTop?l.borderTop:s,f=l.borderBottom?l.borderBottom:s,p=l.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,u,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function kn(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&l(a,function(e){n(e,i+1)}),t[r]=i}return l(e.children(),function(e){n(e,1)}),t}function An(e){return m(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function jn(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,l(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function Mn(e,t,n){var r={},i;l(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Nn(e,t,n){var r=Pn(e),i=new E({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return l(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),l(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=w(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Pn(e){for(var t;e.hasNode(t=R(`_root`)););return t}function Fn(e,t){for(var n=0,r=1;r<t.length;++r)n+=In(e,t[r-1],t[r]);return n}function In(e,t,n){for(var r=Dt(n,_(n,function(e,t){return t})),i=y(_(t,function(t){return L(_(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=_(Array(o),function(){return 0}),c=0;return l(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ln(e){var t={},n=r(e.nodes(),function(t){return!e.children(t).length}),i=_(I(j(_(n,function(t){return e.node(t).rank}))+1),function(){return[]});function a(n){We(t,n)||(t[n]=!0,i[e.node(n).rank].push(n),l(e.successors(n),a))}return l(L(n,function(t){return e.node(t).rank}),a),i}function Rn(e,t){return _(t,function(t){var n=e.inEdges(t);if(n.length){var r=m(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:t}})}function zn(e,t){var n={};return l(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};w(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),l(t.edges(),function(e){var t=n[e.v],r=n[e.w];!w(t)&&!w(r)&&(r.indegree++,t.out.push(n[e.w]))}),Bn(r(n,function(e){return!e.indegree}))}function Bn(e){var t=[];function n(e){return function(t){t.merged||(w(t.barycenter)||w(e.barycenter)||t.barycenter>=e.barycenter)&&Vn(e,t)}}function i(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var a=e.pop();t.push(a),l(a.in.reverse(),n(a)),l(a.out,i(a))}return _(r(t,function(e){return!e.merged}),function(e){return F(e,[`vs`,`i`,`barycenter`,`weight`])})}function Vn(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Hn(e,t){var n=Gt(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=L(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Wn(!!t)),c=Un(a,i,c),l(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=Un(a,i,c)});var u={vs:y(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function Un(e,t,n){for(var r;t.length&&(r=O(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Wn(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function Gn(e,t,n,i){var a=e.children(t),o=e.node(t),s=o?o.borderLeft:void 0,c=o?o.borderRight:void 0,u={};s&&(a=r(a,function(e){return e!==s&&e!==c}));var d=Rn(e,a);l(d,function(t){if(e.children(t.v).length){var r=Gn(e,t.v,n,i);u[t.v]=r,Object.prototype.hasOwnProperty.call(r,`barycenter`)&&qn(t,r)}});var f=zn(d,n);Kn(f,u);var p=Hn(f,i);if(s&&(p.vs=y([s,p.vs,c]),e.predecessors(s).length)){var m=e.node(e.predecessors(s)[0]),h=e.node(e.predecessors(c)[0]);Object.prototype.hasOwnProperty.call(p,`barycenter`)||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+m.order+h.order)/(p.weight+2),p.weight+=2}return p}function Kn(e,t){l(e,function(e){e.vs=y(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function qn(e,t){w(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Jn(e){var t=Wt(e),n=Yn(e,I(1,t+1),`inEdges`),r=Yn(e,I(t-1,-1,-1),`outEdges`),i=Ln(e);Zn(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Xn(s%2?n:r,s%4>=2),i=H(e);var l=Fn(e,i);l<a&&(c=0,o=Me(i),a=l)}Zn(e,o)}function Yn(e,t,n){return _(t,function(t){return Nn(e,t,n)})}function Xn(e,t){var n=new E;l(e,function(e){var r=e.graph().root,i=Gn(e,r,n,t);l(i.vs,function(t,n){e.node(t).order=n}),Mn(e,n,i.vs)})}function Zn(e,t){l(t,function(t){l(t,function(t,n){e.node(t).order=n})})}function Qn(e){var t=er(e);l(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=$n(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function $n(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function er(e){var t={},n=0;function r(i){var a=n;l(e.children(i),r),t[i]={low:a,lim:n++}}return l(e.children(),r),t}function tr(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=O(r);return l(r,function(t,c){var u=rr(e,t),d=u?e.node(u).order:o;(u||t===s)&&(l(r.slice(a,c+1),function(t){l(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||d<o)&&!(a.dummy&&e.node(t).dummy)&&ir(n,r,t)})}),a=c+1,i=d)}),r}return m(t,r),n}function nr(e,t){var n={};function r(t,r,i,a,o){var s;l(I(r,i),function(r){s=t[r],e.node(s).dummy&&l(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&ir(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return l(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return m(t,i),n}function rr(e,t){if(e.node(t).dummy)return k(e.predecessors(t),function(t){return e.node(t).dummy})}function ir(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function ar(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function or(e,t,n,r){var i={},a={},o={};return l(t,function(e){l(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),l(t,function(e){var t=-1;l(e,function(e){var s=r(e);if(s.length){s=L(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!ar(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function sr(e,t,n,r,i){var a={},o=cr(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function u(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function d(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(u,o.predecessors.bind(o)),c(d,o.successors.bind(o)),l(r,function(e){a[e]=a[n[e]]}),a}function cr(e,t,n,r){var i=new E,a=e.graph(),o=pr(a.nodesep,a.edgesep,r);return l(t,function(t){var r;l(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function lr(e,t){return M(T(t),function(t){var n=-1/0,r=1/0;return ze(t,function(t,i){var a=mr(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function ur(e,t){var n=T(t),r=v(n),i=j(n);l([`u`,`d`],function(n){l([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=T(s);c=a===`l`?r-v(l):i-j(l),c&&(e[o]=A(s,function(e){return e+c}))}})})}function dr(e,t){return A(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=L(_(e,r));return(i[1]+i[2])/2})}function fr(e){var t=H(e),n=x(tr(e,t),nr(e,t)),r={},i;return l([`u`,`d`],function(a){i=a===`u`?t:T(t).reverse(),l([`l`,`r`],function(t){t===`r`&&(i=_(i,function(e){return T(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=or(e,i,n,o),c=sr(e,i,s.root,s.align,t===`r`);t===`r`&&(c=A(c,function(e){return-e})),r[a+t]=c})}),ur(r,lr(e,r)),dr(r,e.graph().align)}function pr(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}function mr(e,t){return e.node(t).width}function hr(e){e=zt(e),gr(e),Be(fr(e),function(t,n){e.node(n).x=t})}function gr(e){var t=H(e),n=e.graph().ranksep,r=0;l(t,function(t){var i=j(_(t,function(t){return e.node(t).height}));l(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function _r(e,t){var n=t&&t.debugTiming?Kt:qt;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>Or(e));n(` runLayout`,()=>vr(t,n)),n(` updateInputGraph`,()=>yr(e,t))})}function vr(e,t){t(` makeSpaceForEdgeLabels`,()=>kr(e)),t(` removeSelfEdges`,()=>Rr(e)),t(` acyclic`,()=>Ft(e)),t(` nestingGraph.run`,()=>Dn(e)),t(` rank`,()=>Cn(zt(e))),t(` injectEdgeLabelProxies`,()=>Ar(e)),t(` removeEmptyRanks`,()=>Ht(e)),t(` nestingGraph.cleanup`,()=>jn(e)),t(` normalizeRanks`,()=>Vt(e)),t(` assignRankMinMax`,()=>jr(e)),t(` removeEdgeLabelProxies`,()=>Mr(e)),t(` normalize.run`,()=>nn(e)),t(` parentDummyChains`,()=>Qn(e)),t(` addBorderSegments`,()=>Jt(e)),t(` order`,()=>Jn(e)),t(` insertSelfEdges`,()=>zr(e)),t(` adjustCoordinateSystem`,()=>Xt(e)),t(` position`,()=>hr(e)),t(` positionSelfEdges`,()=>Br(e)),t(` removeBorderNodes`,()=>Lr(e)),t(` normalize.undo`,()=>an(e)),t(` fixupEdgeLabelCoords`,()=>Fr(e)),t(` undoCoordinateSystem`,()=>Zt(e)),t(` translateGraph`,()=>Nr(e)),t(` assignNodeIntersects`,()=>Pr(e)),t(` reversePoints`,()=>Ir(e)),t(` acyclic.undo`,()=>Lt(e))}function yr(e,t){l(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),l(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var br=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],xr={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Sr=[`acyclicer`,`ranker`,`rankdir`,`align`],Cr=[`width`,`height`],wr={width:0,height:0},Tr=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Er={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Dr=[`labelpos`];function Or(e){var t=new E({multigraph:!0,compound:!0}),n=$(e.graph());return t.setGraph(x({},xr,Q(n,br),F(n,Sr))),l(e.nodes(),function(n){var r=$(e.node(n));t.setNode(n,Fe(Q(r,Cr),wr)),t.setParent(n,e.parent(n))}),l(e.edges(),function(n){var r=$(e.edge(n));t.setEdge(n,x({},Er,Q(r,Tr),F(r,Dr)))}),t}function kr(e){var t=e.graph();t.ranksep/=2,l(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Ar(e){l(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);V(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function jr(e){var t=0;l(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=j(t,r.maxRank))}),e.graph().maxRank=t}function Mr(e){l(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function Nr(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}l(e.nodes(),function(t){c(e.node(t))}),l(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,l(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),l(e.edges(),function(n){var i=e.edge(n);l(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Pr(e){l(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Bt(r,a)),n.points.push(Bt(i,o))})}function Fr(e){l(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function Ir(e){l(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function Lr(e){l(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(O(n.borderLeft)),o=e.node(O(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),l(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function Rr(e){l(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function zr(e){l(H(e),function(t){var n=0;l(t,function(t,r){var i=e.node(t);i.order=r+n,l(i.selfEdges,function(t){V(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Br(e){l(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Q(e,t){return A(F(e,t),Number)}function $(e){var t={};return l(e,function(e,n){t[n.toLowerCase()]=e}),t}export{_r as t};
1
+ import{T as e,_ as t,b as n,c as r,d as i,f as a,g as o,h as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h,v as ee}from"./reduce-Cr8PO88G.js";import{C as te,f as ne,h as g,i as re,n as ie,t as ae,u as oe}from"./_baseFor-BB4KANPr.js";import{n as se,r as ce,t as le}from"./isObjectLike-BWNDxuxw.js";import{i as ue,n as de}from"./isEmpty-Bq6bzoiF.js";import{t as fe}from"./isSymbol-W-l9JIco.js";import{a as _,i as pe,n as v,o as me,r as he,t as y}from"./flatten-BHQFj2az.js";import{C as ge,N as _e,S as ve,T as b,_ as x,b as ye,v as S,x as C,y as be}from"./chunk-5PVQY5BW-BFfnnQIi.js";import{i as xe,n as w,r as T,t as E}from"./graphlib-DTVXa63Y.js";import{n as Se,t as Ce}from"./now-F1RJRIcM.js";var we=1/0,Te=17976931348623157e292;function D(e){return e?(e=Se(e),e===we||e===-we?(e<0?-1:1)*Te:e===e?e:0):e===0?e:0}function Ee(e){var t=D(e),n=t%1;return t===t?n?t-n:t:0}function De(e){return ye(ve(e,void 0,y),e+``)}var Oe=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function ke(e){return Oe.test(e)}var Ae=1,je=4;function Me(e){return xe(e,Ae|je)}var Ne=Object.prototype,Pe=Ne.hasOwnProperty,Fe=be(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&S(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=ge(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||te(u,Ne[l])&&!Pe.call(e,l))&&(e[l]=a[l])}return e});function O(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ie(e){return function(t,r,a){var o=Object(t);if(!re(t)){var s=i(r,3);t=n(t),r=function(e){return s(o[e],e,o)}}var c=e(t,r,a);return c>-1?o[s?t[c]:c]:void 0}}var Le=Math.max;function Re(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:Ee(n);return a<0&&(a=Le(r+a,0)),u(e,i(t,3),a)}var k=Ie(Re);function ze(e,t){return e==null?e:ae(e,f(t),ge)}function Be(e,t){return e&&h(e,f(t))}function Ve(e,t){return e>t}var He=Object.prototype.hasOwnProperty;function Ue(e,t){return e!=null&&He.call(e,t)}function We(e,t){return e!=null&&c(e,t,Ue)}var Ge=`[object String]`;function Ke(e){return typeof e==`string`||!g(e)&&le(e)&&ce(e)==Ge}function A(e,t){var n={};return t=i(t,3),h(e,function(e,r,i){_e(n,r,t(e,r,i))}),n}function j(e){return e&&e.length?pe(e,ie,Ve):void 0}function M(e,t){return e&&e.length?pe(e,i(t,2),he):void 0}function qe(e,n,r,i){if(!se(e))return e;n=t(n,e);for(var a=-1,s=n.length,c=s-1,l=e;l!=null&&++a<s;){var u=o(n[a]),d=r;if(u===`__proto__`||u===`constructor`||u===`prototype`)return e;if(a!=c){var f=l[u];d=i?i(f,u,l):void 0,d===void 0&&(d=se(f)?f:ne(n[a+1])?[]:{})}b(l,u,d),l=l[u]}return e}function Je(e,n,r){for(var i=-1,a=n.length,o={};++i<a;){var c=n[i],l=s(e,c);r(l,c)&&qe(o,t(c,e),l)}return o}function Ye(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Xe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=fe(e),o=t!==void 0,s=t===null,c=t===t,l=fe(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function Ze(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Xe(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Qe(t,n,r){n=n.length?e(n,function(e){return g(e)?function(t){return s(t,e.length===1?e[0]:e)}:e}):[ie];var a=-1;return n=e(n,oe(i)),Ye(me(t,function(t,r,i){return{criteria:e(n,function(e){return e(t)}),index:++a,value:t}}),function(e,t){return Ze(e,t,r)})}var $e=a(`length`),et=`\\ud800-\\udfff`,tt=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,nt=`\\ufe0e\\ufe0f`,rt=`[`+et+`]`,N=`[`+tt+`]`,P=`\\ud83c[\\udffb-\\udfff]`,it=`(?:`+N+`|`+P+`)`,at=`[^`+et+`]`,ot=`(?:\\ud83c[\\udde6-\\uddff]){2}`,st=`[\\ud800-\\udbff][\\udc00-\\udfff]`,ct=`\\u200d`,lt=it+`?`,ut=`[`+nt+`]?`,dt=`(?:`+ct+`(?:`+[at,ot,st].join(`|`)+`)`+ut+lt+`)*`,ft=ut+lt+dt,pt=`(?:`+[at+N+`?`,N,ot,st,rt].join(`|`)+`)`,mt=RegExp(P+`(?=`+P+`)|`+pt+ft,`g`);function ht(e){for(var t=mt.lastIndex=0;mt.test(e);)++t;return t}function gt(e){return ke(e)?ht(e):$e(e)}function _t(e,t){return Je(e,t,function(t,n){return d(e,n)})}var F=De(function(e,t){return e==null?{}:_t(e,t)}),vt=Math.ceil,yt=Math.max;function bt(e,t,n,r){for(var i=-1,a=yt(vt((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function xt(e){return function(t,n,r){return r&&typeof r!=`number`&&S(t,n,r)&&(n=r=void 0),t=D(t),n===void 0?(n=t,t=0):n=D(n),r=r===void 0?t<n?1:-1:D(r),bt(t,n,r,e)}}var I=xt(),St=`[object Map]`,Ct=`[object Set]`;function wt(e){if(e==null)return 0;if(re(e))return Ke(e)?gt(e):e.length;var t=de(e);return t==St||t==Ct?e.size:ue(e).length}var L=be(function(e,t){if(e==null)return[];var n=t.length;return n>1&&S(e,t[0],t[1])?t=[]:n>2&&S(t[0],t[1],t[2])&&(t=[t[0]]),Qe(e,p(t,1),[])}),Tt=0;function R(e){var t=++Tt;return ee(e)+t}function Et(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function Dt(e,t){return Et(e||[],t||[],b)}var Ot=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return kt(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&kt(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,At)),n=n._prev;return`[`+e.join(`, `)+`]`}};function kt(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function At(e,t){if(e!==`_next`&&e!==`_prev`)return t}var jt=C(1);function Mt(e,t){if(e.nodeCount()<=1)return[];var n=Pt(e,t||jt);return y(_(Nt(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function Nt(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)z(e,t,n,o);for(;o=i.dequeue();)z(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(z(e,t,n,o,!0));break}}}return r}function z(e,t,n,r,i){var a=i?[]:void 0;return l(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,B(t,n,s)}),l(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,B(t,n,o)}),e.removeNode(r.v),a}function Pt(e,t){var n=new E,r=0,i=0;l(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),l(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=I(i+r+3).map(function(){return new Ot}),o=r+1;return l(n.nodes(),function(e){B(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function B(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Ft(e){l(e.graph().acyclicer===`greedy`?Mt(e,t(e)):It(e),function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,R(`rev`))});function t(e){return function(t){return e.edge(t).weight}}}function It(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,l(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return l(e.nodes(),i),t}function Lt(e){l(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function V(e,t,n,r){var i;do i=R(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function Rt(e){var t=new E().setGraph(e.graph());return l(e.nodes(),function(n){t.setNode(n,e.node(n))}),l(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function zt(e){var t=new E({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),l(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function Bt(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function H(e){var t=_(I(Wt(e)+1),function(){return[]});return l(e.nodes(),function(n){var r=e.node(n),i=r.rank;w(i)||(t[i][r.order]=n)}),t}function Vt(e){var t=v(_(e.nodes(),function(t){return e.node(t).rank}));l(e.nodes(),function(n){var r=e.node(n);We(r,`rank`)&&(r.rank-=t)})}function Ht(e){var t=v(_(e.nodes(),function(t){return e.node(t).rank})),n=[];l(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;l(n,function(t,n){w(t)&&n%i!==0?--r:r&&l(t,function(t){e.node(t).rank+=r})})}function Ut(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),V(e,`border`,i,t)}function Wt(e){return j(_(e.nodes(),function(t){var n=e.node(t).rank;if(!w(n))return n}))}function Gt(e,t){var n={lhs:[],rhs:[]};return l(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Kt(e,t){var n=Ce();try{return t()}finally{console.log(e+` time: `+(Ce()-n)+`ms`)}}function qt(e,t){return t()}function Jt(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&l(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Yt(e,`borderLeft`,`_bl`,n,i,a),Yt(e,`borderRight`,`_br`,n,i,a)}}l(e.children(),t)}function Yt(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=V(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Xt(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Qt(e)}function Zt(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&en(e),(t===`lr`||t===`rl`)&&(tn(e),Qt(e))}function Qt(e){l(e.nodes(),function(t){$t(e.node(t))}),l(e.edges(),function(t){$t(e.edge(t))})}function $t(e){var t=e.width;e.width=e.height,e.height=t}function en(e){l(e.nodes(),function(t){U(e.node(t))}),l(e.edges(),function(t){var n=e.edge(t);l(n.points,U),Object.prototype.hasOwnProperty.call(n,`y`)&&U(n)})}function U(e){e.y=-e.y}function tn(e){l(e.nodes(),function(t){W(e.node(t))}),l(e.edges(),function(t){var n=e.edge(t);l(n.points,W),Object.prototype.hasOwnProperty.call(n,`x`)&&W(n)})}function W(e){var t=e.x;e.x=e.y,e.y=t}function nn(e){e.graph().dummyChains=[],l(e.edges(),function(t){rn(e,t)})}function rn(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=V(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function an(e){l(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function G(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=v(_(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}l(e.sources(),n)}function K(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function on(e){var t=new E({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;sn(t,e)<r;)i=cn(t,e),a=t.hasNode(i.v)?K(e,i):-K(e,i),ln(t,e,a);return t}function sn(e,t){function n(r){l(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!K(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return l(e.nodes(),n),e.nodeCount()}function cn(e,t){return M(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return K(t,n)})}function ln(e,t,n){l(e.nodes(),function(e){t.node(e).rank+=n})}C(1),C(1),un.CycleException=q;function un(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new q;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,l(e.predecessors(a),i),delete n[a],r.push(a))}if(l(e.sinks(),i),wt(t)!==e.nodeCount())throw new q;return r}function q(){}q.prototype=Error();function dn(e,t,n){g(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return l(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);fn(e,t,n===`post`,a,r,i)}),i}function fn(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),l(i(t),function(t){fn(e,t,n,r,i,a)}),n&&a.push(t))}function pn(e,t){return dn(e,t,`post`)}function mn(e,t){return dn(e,t,`pre`)}J.initLowLimValues=X,J.initCutValues=Y,J.calcCutValue=gn,J.leaveEdge=vn,J.enterEdge=yn,J.exchangeEdges=Z;function J(e){e=Rt(e),G(e);var t=on(e);X(t),Y(t,e);for(var n,r;n=vn(t);)r=yn(t,e,n),Z(t,e,n,r)}function Y(e,t){var n=pn(e,e.nodes());n=n.slice(0,n.length-1),l(n,function(n){hn(e,t,n)})}function hn(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=gn(e,t,n)}function gn(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,l(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,xn(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function X(e,t){arguments.length<2&&(t=e.nodes()[0]),_n(e,{},1,t)}function _n(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,l(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=_n(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function vn(e){return k(e.edges(),function(t){return e.edge(t).cutvalue<0})}function yn(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var o=e.node(i),s=e.node(a),c=o,l=!1;return o.lim>s.lim&&(c=s,l=!0),M(r(t.edges(),function(t){return l===Sn(e,e.node(t.v),c)&&l!==Sn(e,e.node(t.w),c)}),function(e){return K(t,e)})}function Z(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),X(e),Y(e,t),bn(e,t)}function bn(e,t){var n=mn(e,k(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),l(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function xn(e,t,n){return e.hasEdge(t,n)}function Sn(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Cn(e){switch(e.graph().ranker){case`network-simplex`:En(e);break;case`tight-tree`:Tn(e);break;case`longest-path`:wn(e);break;default:En(e)}}var wn=G;function Tn(e){G(e),on(e)}function En(e){J(e)}function Dn(e){var t=V(e,`root`,{},`_root`),n=kn(e),r=j(T(n))-1,i=2*r+1;e.graph().nestingRoot=t,l(e.edges(),function(t){e.edge(t).minlen*=i});var a=An(e)+1;l(e.children(),function(o){On(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function On(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=Ut(e,`_bt`),u=Ut(e,`_bb`),d=e.node(o);e.setParent(c,o),d.borderTop=c,e.setParent(u,o),d.borderBottom=u,l(s,function(s){On(e,t,n,r,i,a,s);var l=e.node(s),d=l.borderTop?l.borderTop:s,f=l.borderBottom?l.borderBottom:s,p=l.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,u,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function kn(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&l(a,function(e){n(e,i+1)}),t[r]=i}return l(e.children(),function(e){n(e,1)}),t}function An(e){return m(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function jn(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,l(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function Mn(e,t,n){var r={},i;l(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Nn(e,t,n){var r=Pn(e),i=new E({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return l(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),l(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=w(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Pn(e){for(var t;e.hasNode(t=R(`_root`)););return t}function Fn(e,t){for(var n=0,r=1;r<t.length;++r)n+=In(e,t[r-1],t[r]);return n}function In(e,t,n){for(var r=Dt(n,_(n,function(e,t){return t})),i=y(_(t,function(t){return L(_(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=_(Array(o),function(){return 0}),c=0;return l(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ln(e){var t={},n=r(e.nodes(),function(t){return!e.children(t).length}),i=_(I(j(_(n,function(t){return e.node(t).rank}))+1),function(){return[]});function a(n){We(t,n)||(t[n]=!0,i[e.node(n).rank].push(n),l(e.successors(n),a))}return l(L(n,function(t){return e.node(t).rank}),a),i}function Rn(e,t){return _(t,function(t){var n=e.inEdges(t);if(n.length){var r=m(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:t}})}function zn(e,t){var n={};return l(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};w(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),l(t.edges(),function(e){var t=n[e.v],r=n[e.w];!w(t)&&!w(r)&&(r.indegree++,t.out.push(n[e.w]))}),Bn(r(n,function(e){return!e.indegree}))}function Bn(e){var t=[];function n(e){return function(t){t.merged||(w(t.barycenter)||w(e.barycenter)||t.barycenter>=e.barycenter)&&Vn(e,t)}}function i(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var a=e.pop();t.push(a),l(a.in.reverse(),n(a)),l(a.out,i(a))}return _(r(t,function(e){return!e.merged}),function(e){return F(e,[`vs`,`i`,`barycenter`,`weight`])})}function Vn(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Hn(e,t){var n=Gt(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=L(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Wn(!!t)),c=Un(a,i,c),l(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=Un(a,i,c)});var u={vs:y(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function Un(e,t,n){for(var r;t.length&&(r=O(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Wn(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function Gn(e,t,n,i){var a=e.children(t),o=e.node(t),s=o?o.borderLeft:void 0,c=o?o.borderRight:void 0,u={};s&&(a=r(a,function(e){return e!==s&&e!==c}));var d=Rn(e,a);l(d,function(t){if(e.children(t.v).length){var r=Gn(e,t.v,n,i);u[t.v]=r,Object.prototype.hasOwnProperty.call(r,`barycenter`)&&qn(t,r)}});var f=zn(d,n);Kn(f,u);var p=Hn(f,i);if(s&&(p.vs=y([s,p.vs,c]),e.predecessors(s).length)){var m=e.node(e.predecessors(s)[0]),h=e.node(e.predecessors(c)[0]);Object.prototype.hasOwnProperty.call(p,`barycenter`)||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+m.order+h.order)/(p.weight+2),p.weight+=2}return p}function Kn(e,t){l(e,function(e){e.vs=y(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function qn(e,t){w(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Jn(e){var t=Wt(e),n=Yn(e,I(1,t+1),`inEdges`),r=Yn(e,I(t-1,-1,-1),`outEdges`),i=Ln(e);Zn(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Xn(s%2?n:r,s%4>=2),i=H(e);var l=Fn(e,i);l<a&&(c=0,o=Me(i),a=l)}Zn(e,o)}function Yn(e,t,n){return _(t,function(t){return Nn(e,t,n)})}function Xn(e,t){var n=new E;l(e,function(e){var r=e.graph().root,i=Gn(e,r,n,t);l(i.vs,function(t,n){e.node(t).order=n}),Mn(e,n,i.vs)})}function Zn(e,t){l(t,function(t){l(t,function(t,n){e.node(t).order=n})})}function Qn(e){var t=er(e);l(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=$n(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function $n(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function er(e){var t={},n=0;function r(i){var a=n;l(e.children(i),r),t[i]={low:a,lim:n++}}return l(e.children(),r),t}function tr(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=O(r);return l(r,function(t,c){var u=rr(e,t),d=u?e.node(u).order:o;(u||t===s)&&(l(r.slice(a,c+1),function(t){l(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||d<o)&&!(a.dummy&&e.node(t).dummy)&&ir(n,r,t)})}),a=c+1,i=d)}),r}return m(t,r),n}function nr(e,t){var n={};function r(t,r,i,a,o){var s;l(I(r,i),function(r){s=t[r],e.node(s).dummy&&l(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&ir(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return l(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return m(t,i),n}function rr(e,t){if(e.node(t).dummy)return k(e.predecessors(t),function(t){return e.node(t).dummy})}function ir(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function ar(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function or(e,t,n,r){var i={},a={},o={};return l(t,function(e){l(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),l(t,function(e){var t=-1;l(e,function(e){var s=r(e);if(s.length){s=L(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!ar(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function sr(e,t,n,r,i){var a={},o=cr(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function u(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function d(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(u,o.predecessors.bind(o)),c(d,o.successors.bind(o)),l(r,function(e){a[e]=a[n[e]]}),a}function cr(e,t,n,r){var i=new E,a=e.graph(),o=pr(a.nodesep,a.edgesep,r);return l(t,function(t){var r;l(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function lr(e,t){return M(T(t),function(t){var n=-1/0,r=1/0;return ze(t,function(t,i){var a=mr(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function ur(e,t){var n=T(t),r=v(n),i=j(n);l([`u`,`d`],function(n){l([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=T(s);c=a===`l`?r-v(l):i-j(l),c&&(e[o]=A(s,function(e){return e+c}))}})})}function dr(e,t){return A(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=L(_(e,r));return(i[1]+i[2])/2})}function fr(e){var t=H(e),n=x(tr(e,t),nr(e,t)),r={},i;return l([`u`,`d`],function(a){i=a===`u`?t:T(t).reverse(),l([`l`,`r`],function(t){t===`r`&&(i=_(i,function(e){return T(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=or(e,i,n,o),c=sr(e,i,s.root,s.align,t===`r`);t===`r`&&(c=A(c,function(e){return-e})),r[a+t]=c})}),ur(r,lr(e,r)),dr(r,e.graph().align)}function pr(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}function mr(e,t){return e.node(t).width}function hr(e){e=zt(e),gr(e),Be(fr(e),function(t,n){e.node(n).x=t})}function gr(e){var t=H(e),n=e.graph().ranksep,r=0;l(t,function(t){var i=j(_(t,function(t){return e.node(t).height}));l(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function _r(e,t){var n=t&&t.debugTiming?Kt:qt;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>Or(e));n(` runLayout`,()=>vr(t,n)),n(` updateInputGraph`,()=>yr(e,t))})}function vr(e,t){t(` makeSpaceForEdgeLabels`,()=>kr(e)),t(` removeSelfEdges`,()=>Rr(e)),t(` acyclic`,()=>Ft(e)),t(` nestingGraph.run`,()=>Dn(e)),t(` rank`,()=>Cn(zt(e))),t(` injectEdgeLabelProxies`,()=>Ar(e)),t(` removeEmptyRanks`,()=>Ht(e)),t(` nestingGraph.cleanup`,()=>jn(e)),t(` normalizeRanks`,()=>Vt(e)),t(` assignRankMinMax`,()=>jr(e)),t(` removeEdgeLabelProxies`,()=>Mr(e)),t(` normalize.run`,()=>nn(e)),t(` parentDummyChains`,()=>Qn(e)),t(` addBorderSegments`,()=>Jt(e)),t(` order`,()=>Jn(e)),t(` insertSelfEdges`,()=>zr(e)),t(` adjustCoordinateSystem`,()=>Xt(e)),t(` position`,()=>hr(e)),t(` positionSelfEdges`,()=>Br(e)),t(` removeBorderNodes`,()=>Lr(e)),t(` normalize.undo`,()=>an(e)),t(` fixupEdgeLabelCoords`,()=>Fr(e)),t(` undoCoordinateSystem`,()=>Zt(e)),t(` translateGraph`,()=>Nr(e)),t(` assignNodeIntersects`,()=>Pr(e)),t(` reversePoints`,()=>Ir(e)),t(` acyclic.undo`,()=>Lt(e))}function yr(e,t){l(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),l(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var br=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],xr={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Sr=[`acyclicer`,`ranker`,`rankdir`,`align`],Cr=[`width`,`height`],wr={width:0,height:0},Tr=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Er={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Dr=[`labelpos`];function Or(e){var t=new E({multigraph:!0,compound:!0}),n=$(e.graph());return t.setGraph(x({},xr,Q(n,br),F(n,Sr))),l(e.nodes(),function(n){var r=$(e.node(n));t.setNode(n,Fe(Q(r,Cr),wr)),t.setParent(n,e.parent(n))}),l(e.edges(),function(n){var r=$(e.edge(n));t.setEdge(n,x({},Er,Q(r,Tr),F(r,Dr)))}),t}function kr(e){var t=e.graph();t.ranksep/=2,l(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Ar(e){l(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);V(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function jr(e){var t=0;l(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=j(t,r.maxRank))}),e.graph().maxRank=t}function Mr(e){l(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function Nr(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}l(e.nodes(),function(t){c(e.node(t))}),l(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,l(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),l(e.edges(),function(n){var i=e.edge(n);l(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Pr(e){l(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Bt(r,a)),n.points.push(Bt(i,o))})}function Fr(e){l(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function Ir(e){l(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function Lr(e){l(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(O(n.borderLeft)),o=e.node(O(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),l(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function Rr(e){l(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function zr(e){l(H(e),function(t){var n=0;l(t,function(t,r){var i=e.node(t);i.order=r+n,l(i.selfEdges,function(t){V(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Br(e){l(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Q(e,t){return A(F(e,t),Number)}function $(e){var t={};return l(e,function(e,n){t[n.toLowerCase()]=e}),t}export{_r as t};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./flatten-BHQFj2az.js";import{n as t,r as n}from"./src-DxsrUvGr.js";import{b as r}from"./chunk-ICPOFSXX-Dy9JRPZu.js";import"./chunk-5PVQY5BW-D2kQfsEU.js";import"./chunk-U2HBQHQK-DThlp4DR.js";import"./chunk-BSJP7CBP-gINBJmdn.js";import{n as i}from"./chunk-ZZ45TVLE-CwnCYU7J.js";import{n as a,t as o}from"./graphlib-CxIN2cpg.js";import{t as s}from"./clone-B2gSWiE3.js";import{t as c}from"./dagre--CGfxwL9.js";import"./chunk-X2U36JSP-b_VUmOsG.js";import{a as l,c as u,i as d,l as f,n as p,t as m,u as h}from"./chunk-5FUZZQ4R-Bp1iPpGN.js";import{a as g,i as _,n as v,r as y,t as b}from"./chunk-ENJZ2VHE-DGOBbqgN.js";function x(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:S(e),edges:C(e)};return a(e.graph())||(t.value=s(e.graph())),t}function S(t){return e(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return a(n)||(i.value=n),a(r)||(i.parent=r),i})}function C(t){return e(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return a(e.name)||(r.name=e.name),a(n)||(r.value=n),r})}var w=new Map,T=new Map,E=new Map,D=t(()=>{T.clear(),E.clear(),w.clear()},`clear`),O=t((e,t)=>{let r=T.get(t)||[];return n.trace(`In isDescendant`,t,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),k=t((e,t)=>{let r=T.get(t)||[];return n.info(`Descendants of `,t,` is `,r),n.info(`Edge is `,e),e.v===t||e.w===t?!1:r?r.includes(e.v)||O(e.v,t)||O(e.w,t)||r.includes(e.w):(n.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),A=t((e,t,r,i)=>{n.warn(`Copying children of `,e,`root`,i,`data`,t.node(e),i);let a=t.children(e)||[];e!==i&&a.push(e),n.warn(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(t.children(a).length>0)A(a,t,r,i);else{let o=t.node(a);n.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==t.parent(a)&&(n.warn(`Setting parent`,a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(n.debug(`Setting parent`,a,e),r.setParent(a,e)):(n.info(`In copy `,e,`root`,i,`data`,t.node(e),i),n.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=t.edges(a);n.debug(`Copying Edges`,s),s.forEach(a=>{n.info(`Edge`,a);let o=t.edge(a.v,a.w,a.name);n.info(`Edge data`,o,i);try{k(a,i)?(n.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),n.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):n.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){n.error(e)}})}n.debug(`Removing node`,a),t.removeNode(a)})},`copy`),j=t((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)E.set(i,e),r=[...r,...j(i,t)];return r},`extractDescendants`),M=t((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),N=t((e,t,r)=>{let i=t.children(e);if(n.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let n=N(e,t,r),i=M(t,r,n);if(n)if(i.length>0)a=n;else return n}return a},`findNonClusterChild`),P=t(e=>!w.has(e)||!w.get(e).externalConnections?e:w.has(e)?w.get(e).id:e,`getAnchorId`),F=t((e,t)=>{if(!e||t>10){n.debug(`Opting out, no graph `);return}else n.debug(`Opting in, graph `);e.nodes().forEach(function(t){e.children(t).length>0&&(n.warn(`Cluster identified`,t,` Replacement id in edges: `,N(t,e,t)),T.set(t,j(t,e)),w.set(t,{id:N(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let r=e.children(t),i=e.edges();r.length>0?(n.debug(`Cluster identified`,t,T),i.forEach(e=>{O(e.v,t)^O(e.w,t)&&(n.warn(`Edge: `,e,` leaves cluster `,t),n.warn(`Descendants of XXX `,t,`: `,T.get(t)),w.get(t).externalConnections=!0)})):n.debug(`Not a cluster `,t,T)});for(let t of w.keys()){let n=w.get(t).id,r=e.parent(n);r!==t&&w.has(r)&&!w.get(r).externalConnections&&(w.get(t).id=r)}e.edges().forEach(function(t){let r=e.edge(t);n.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),n.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let i=t.v,a=t.w;if(n.warn(`Fix XXX`,w,`ids:`,t.v,t.w,`Translating: `,w.get(t.v),` --- `,w.get(t.w)),w.get(t.v)||w.get(t.w)){if(n.warn(`Fixing and trying - removing XXX`,t.v,t.w,t.name),i=P(t.v),a=P(t.w),e.removeEdge(t.v,t.w,t.name),i!==t.v){let n=e.parent(i);w.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){let n=e.parent(a);w.get(n).externalConnections=!0,r.toCluster=t.w}n.warn(`Fix Replacing with XXX`,i,a,t.name),e.setEdge(i,a,r,t.name)}}),n.warn(`Adjusted Graph`,x(e)),I(e,0),n.trace(w)},`adjustClustersAndEdges`),I=t((e,t)=>{if(n.warn(`extractor - `,t,x(e),e.children(`D`)),t>10){n.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i){n.debug(`Done, no node has children`,e.nodes());return}n.debug(`Nodes = `,r,t);for(let i of r)if(n.debug(`Extracting node`,i,w,w.has(i)&&!w.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,t),!w.has(i))n.debug(`Not a cluster`,i,t);else if(!w.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){n.warn(`Cluster without external connections, without a parent and with children`,i,t);let r=e.graph().rankdir===`TB`?`LR`:`TB`;w.get(i)?.clusterData?.dir&&(r=w.get(i).clusterData.dir,n.warn(`Fixing dir`,w.get(i).clusterData.dir,r));let a=new o({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});n.warn(`Old graph before copy`,x(e)),A(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:w.get(i).clusterData,label:w.get(i).label,graph:a}),n.warn(`New graph after copy node: (`,i,`)`,x(a)),n.debug(`Old graph after copy`,x(e))}else n.warn(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!w.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),t),n.debug(w);r=e.nodes(),n.warn(`New list of nodes`,r);for(let i of r){let r=e.node(i);n.warn(` Now next level`,i,r),r?.clusterNode&&I(r.graph,t+1)}},`extractor`),L=t((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=t(e=>L(e,e.children()),`sortNodesByHierarchy`),z=t(async(e,r,a,o,s,p)=>{n.warn(`Graph in recursive render:XAX`,x(r),s);let m=r.graph().rankdir;n.trace(`Dir in recursive render - dir:`,m);let _=e.insert(`g`).attr(`class`,`root`);r.nodes()?n.info(`Recursive render XXX`,r.nodes()):n.info(`No nodes found for`,r),r.edges().length>0&&n.info(`Recursive edges`,r.edge(r.edges()[0]));let b=_.insert(`g`).attr(`class`,`clusters`),S=_.insert(`g`).attr(`class`,`edgePaths`),C=_.insert(`g`).attr(`class`,`edgeLabels`),T=_.insert(`g`).attr(`class`,`nodes`);await Promise.all(r.nodes().map(async function(e){let t=r.node(e);if(s!==void 0){let t=JSON.parse(JSON.stringify(s.clusterData));n.trace(`Setting data for parent cluster XXX
1
+ import{a as e}from"./flatten-BHQFj2az.js";import{n as t,r as n}from"./src-DxsrUvGr.js";import{b as r}from"./chunk-ICPOFSXX-Czafge50.js";import"./chunk-5PVQY5BW-BFfnnQIi.js";import"./chunk-U2HBQHQK-CSsi_nQO.js";import"./chunk-BSJP7CBP-gINBJmdn.js";import{n as i}from"./chunk-ZZ45TVLE-BUFYnqAJ.js";import{n as a,t as o}from"./graphlib-DTVXa63Y.js";import{t as s}from"./clone-te25EaCJ.js";import{t as c}from"./dagre-BE13jSMp.js";import"./chunk-X2U36JSP-DZKPmsbB.js";import{a as l,c as u,i as d,l as f,n as p,t as m,u as h}from"./chunk-5FUZZQ4R-CG5QQXov.js";import{a as g,i as _,n as v,r as y,t as b}from"./chunk-ENJZ2VHE-loXqYw4u.js";function x(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:S(e),edges:C(e)};return a(e.graph())||(t.value=s(e.graph())),t}function S(t){return e(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return a(n)||(i.value=n),a(r)||(i.parent=r),i})}function C(t){return e(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return a(e.name)||(r.name=e.name),a(n)||(r.value=n),r})}var w=new Map,T=new Map,E=new Map,D=t(()=>{T.clear(),E.clear(),w.clear()},`clear`),O=t((e,t)=>{let r=T.get(t)||[];return n.trace(`In isDescendant`,t,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),k=t((e,t)=>{let r=T.get(t)||[];return n.info(`Descendants of `,t,` is `,r),n.info(`Edge is `,e),e.v===t||e.w===t?!1:r?r.includes(e.v)||O(e.v,t)||O(e.w,t)||r.includes(e.w):(n.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),A=t((e,t,r,i)=>{n.warn(`Copying children of `,e,`root`,i,`data`,t.node(e),i);let a=t.children(e)||[];e!==i&&a.push(e),n.warn(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(t.children(a).length>0)A(a,t,r,i);else{let o=t.node(a);n.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==t.parent(a)&&(n.warn(`Setting parent`,a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(n.debug(`Setting parent`,a,e),r.setParent(a,e)):(n.info(`In copy `,e,`root`,i,`data`,t.node(e),i),n.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=t.edges(a);n.debug(`Copying Edges`,s),s.forEach(a=>{n.info(`Edge`,a);let o=t.edge(a.v,a.w,a.name);n.info(`Edge data`,o,i);try{k(a,i)?(n.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),n.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):n.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){n.error(e)}})}n.debug(`Removing node`,a),t.removeNode(a)})},`copy`),j=t((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)E.set(i,e),r=[...r,...j(i,t)];return r},`extractDescendants`),M=t((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),N=t((e,t,r)=>{let i=t.children(e);if(n.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let n=N(e,t,r),i=M(t,r,n);if(n)if(i.length>0)a=n;else return n}return a},`findNonClusterChild`),P=t(e=>!w.has(e)||!w.get(e).externalConnections?e:w.has(e)?w.get(e).id:e,`getAnchorId`),F=t((e,t)=>{if(!e||t>10){n.debug(`Opting out, no graph `);return}else n.debug(`Opting in, graph `);e.nodes().forEach(function(t){e.children(t).length>0&&(n.warn(`Cluster identified`,t,` Replacement id in edges: `,N(t,e,t)),T.set(t,j(t,e)),w.set(t,{id:N(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let r=e.children(t),i=e.edges();r.length>0?(n.debug(`Cluster identified`,t,T),i.forEach(e=>{O(e.v,t)^O(e.w,t)&&(n.warn(`Edge: `,e,` leaves cluster `,t),n.warn(`Descendants of XXX `,t,`: `,T.get(t)),w.get(t).externalConnections=!0)})):n.debug(`Not a cluster `,t,T)});for(let t of w.keys()){let n=w.get(t).id,r=e.parent(n);r!==t&&w.has(r)&&!w.get(r).externalConnections&&(w.get(t).id=r)}e.edges().forEach(function(t){let r=e.edge(t);n.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),n.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let i=t.v,a=t.w;if(n.warn(`Fix XXX`,w,`ids:`,t.v,t.w,`Translating: `,w.get(t.v),` --- `,w.get(t.w)),w.get(t.v)||w.get(t.w)){if(n.warn(`Fixing and trying - removing XXX`,t.v,t.w,t.name),i=P(t.v),a=P(t.w),e.removeEdge(t.v,t.w,t.name),i!==t.v){let n=e.parent(i);w.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){let n=e.parent(a);w.get(n).externalConnections=!0,r.toCluster=t.w}n.warn(`Fix Replacing with XXX`,i,a,t.name),e.setEdge(i,a,r,t.name)}}),n.warn(`Adjusted Graph`,x(e)),I(e,0),n.trace(w)},`adjustClustersAndEdges`),I=t((e,t)=>{if(n.warn(`extractor - `,t,x(e),e.children(`D`)),t>10){n.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i){n.debug(`Done, no node has children`,e.nodes());return}n.debug(`Nodes = `,r,t);for(let i of r)if(n.debug(`Extracting node`,i,w,w.has(i)&&!w.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,t),!w.has(i))n.debug(`Not a cluster`,i,t);else if(!w.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){n.warn(`Cluster without external connections, without a parent and with children`,i,t);let r=e.graph().rankdir===`TB`?`LR`:`TB`;w.get(i)?.clusterData?.dir&&(r=w.get(i).clusterData.dir,n.warn(`Fixing dir`,w.get(i).clusterData.dir,r));let a=new o({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});n.warn(`Old graph before copy`,x(e)),A(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:w.get(i).clusterData,label:w.get(i).label,graph:a}),n.warn(`New graph after copy node: (`,i,`)`,x(a)),n.debug(`Old graph after copy`,x(e))}else n.warn(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!w.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),t),n.debug(w);r=e.nodes(),n.warn(`New list of nodes`,r);for(let i of r){let r=e.node(i);n.warn(` Now next level`,i,r),r?.clusterNode&&I(r.graph,t+1)}},`extractor`),L=t((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=t(e=>L(e,e.children()),`sortNodesByHierarchy`),z=t(async(e,r,a,o,s,p)=>{n.warn(`Graph in recursive render:XAX`,x(r),s);let m=r.graph().rankdir;n.trace(`Dir in recursive render - dir:`,m);let _=e.insert(`g`).attr(`class`,`root`);r.nodes()?n.info(`Recursive render XXX`,r.nodes()):n.info(`No nodes found for`,r),r.edges().length>0&&n.info(`Recursive edges`,r.edge(r.edges()[0]));let b=_.insert(`g`).attr(`class`,`clusters`),S=_.insert(`g`).attr(`class`,`edgePaths`),C=_.insert(`g`).attr(`class`,`edgeLabels`),T=_.insert(`g`).attr(`class`,`nodes`);await Promise.all(r.nodes().map(async function(e){let t=r.node(e);if(s!==void 0){let t=JSON.parse(JSON.stringify(s.clusterData));n.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,e,`
3
3
  data=`,t.height,`
4
4
  Parent cluster`,s.height),r.setNode(s.id,t),r.parent(e)||(n.trace(`Setting parent`,e,s.id),r.setParent(e,s.id,t))}if(n.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(r.node(e))),t?.clusterNode){n.info(`Cluster identified XBX`,e,t.width,r.node(e));let{ranksep:i,nodesep:s}=r.graph();t.graph.setGraph({...t.graph.graph(),ranksep:i+25,nodesep:s});let c=await z(T,t.graph,a,o,r.node(e),p),l=c.elem;h(t,l),t.diff=c.diff||0,n.info(`New compound node after recursive render XAX`,e,`width`,t.width,`height`,t.height),f(l,t)}else r.children(e).length>0?(n.trace(`Cluster - the non recursive path XBX`,e,t.id,t,t.width,`Graph:`,r),n.trace(N(t.id,r)),w.set(t.id,{id:N(t.id,r),node:t})):(n.trace(`Node - the non recursive path XAX`,e,T,r.node(e),m),await l(T,r.node(e),{config:p,dir:m}))})),await t(async()=>{let e=r.edges().map(async function(e){let t=r.edge(e.v,e.w,e.name);n.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),n.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(r.edge(e))),n.info(`Fix`,w,`ids:`,e.v,e.w,`Translating: `,w.get(e.v),w.get(e.w)),await y(C,t)});await Promise.all(e)},`processEdges`)(),n.info(`Graph before layout:`,JSON.stringify(x(r))),n.info(`############################################# XXX`),n.info(`### Layout ### XXX`),n.info(`############################################# XXX`),c(r),n.info(`Graph after layout:`,JSON.stringify(x(r)));let E=0,{subGraphTitleTotalMargin:D}=i(p);return await Promise.all(R(r).map(async function(e){let t=r.node(e);if(n.info(`Position XBX => `+e+`: (`+t.x,`,`+t.y,`) width: `,t.width,` height: `,t.height),t?.clusterNode)t.y+=D,n.info(`A tainted cluster node XBX1`,e,t.id,t.width,t.height,t.x,t.y,r.parent(e)),w.get(t.id).node=t,u(t);else if(r.children(e).length>0){n.info(`A pure cluster node XBX1`,e,t.id,t.x,t.y,t.width,t.height,r.parent(e)),t.height+=D,r.node(t.parentId);let i=t?.padding/2||0,a=t?.labelBBox?.height||0,o=a-i||0;n.debug(`OffsetY`,o,`labelHeight`,a,`halfPadding`,i),await d(b,t),w.get(t.id).node=t}else{let e=r.node(t.parentId);t.y+=D/2,n.info(`A regular node XBX1 - using the padding`,t.id,`parent`,t.parentId,t.width,t.height,t.x,t.y,`offsetY`,t.offsetY,`parent`,e,e?.offsetY,t),u(t)}})),r.edges().forEach(function(e){let t=r.edge(e);n.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(t),t),t.points.forEach(e=>e.y+=D/2),g(t,v(S,t,w,a,r.node(e.v),r.node(e.w),o))}),r.nodes().forEach(function(e){let t=r.node(e);n.info(e,t.type,t.diff),t.isGroup&&(E=t.diff)}),n.warn(`Returning from recursive render XAX`,_,E),{elem:_,diff:E}},`recursiveRender`),B=t(async(e,t)=>{let i=new o({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select(`g`);_(a,e.markers,e.type,e.diagramId),p(),b(),m(),D(),e.nodes.forEach(e=>{i.setNode(e.id,{...e}),e.parentId&&i.setParent(e.id,e.parentId)}),n.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,n=t+`---`+t+`---1`,r=t+`---`+t+`---2`,a=i.node(t);i.setNode(n,{domId:n,id:n,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),i.setParent(n,a.parentId),i.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),i.setParent(r,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e);o.label=``,o.arrowTypeEnd=`none`,o.id=t+`-cyclic-special-1`,s.arrowTypeStart=`none`,s.arrowTypeEnd=`none`,s.id=t+`-cyclic-special-mid`,c.label=``,a.isGroup&&(o.fromCluster=t,c.toCluster=t),c.id=t+`-cyclic-special-2`,c.arrowTypeStart=`none`,i.setEdge(t,n,o,t+`-cyclic-special-0`),i.setEdge(n,r,s,t+`-cyclic-special-1`),i.setEdge(r,t,c,t+`-cyc<lic-special-2`)}else i.setEdge(e.start,e.end,{...e},e.id)}),n.warn(`Graph at first:`,JSON.stringify(x(i))),F(i),n.warn(`Graph after XAX:`,JSON.stringify(x(i)));let s=r();await z(a,i,e.type,e.diagramId,void 0,s)},`render`);export{B as render};
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./src-DxsrUvGr.js";import{B as n,C as r,V as i,W as a,_ as o,a as s,c,d as l,v as u,y as d}from"./chunk-ICPOFSXX-Dy9JRPZu.js";import{r as f}from"./chunk-5PVQY5BW-D2kQfsEU.js";import{t as p}from"./chunk-426QAEUC-CYmyjEj-.js";import{t as m}from"./chunk-4BX2VUAB-DeXGuanp.js";import{t as h}from"./mermaid-parser.core-CIRt0Dgq.js";import{t as g}from"./chunk-QZHKN3VN-DGZr8ZKt.js";var _=new g(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,children:[]}]})),v=e(()=>{_.reset(),s()},`clear`),y=e(()=>_.records.stack[0],`getRoot`),b=e(()=>_.records.cnt,`getCount`),x=l.treeView,S={clear:v,addNode:e((e,t)=>{for(;e<=_.records.stack[_.records.stack.length-1].level;)_.records.stack.pop();let n={id:_.records.cnt++,level:e,name:t,children:[]};_.records.stack[_.records.stack.length-1].children.push(n),_.records.stack.push(n)},`addNode`),getRoot:y,getCount:b,getConfig:e(()=>f(x,d().treeView),`getConfig`),getAccTitle:u,getAccDescription:o,getDiagramTitle:r,setAccDescription:n,setAccTitle:i,setDiagramTitle:a},C=e(e=>{m(e,S),e.nodes.map(e=>S.addNode(e.indent?parseInt(e.indent):0,e.name))},`populate`),w={parse:e(async e=>{let n=await h(`treeView`,e);t.debug(n),C(n)},`parse`)},T=e((e,t,n,r,i)=>{let a=r.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-label`),{height:o,width:s}=a.node().getBBox(),c=o+i.paddingY*2,l=s+i.paddingX*2;a.attr(`x`,e+i.paddingX),a.attr(`y`,t+c/2),n.BBox={x:e,y:t,width:l,height:c}},`positionLabel`),E=e((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),D=e((t,n,r)=>{let i=0,a=0,o=e((e,t,n,r)=>{let o=r*(n.rowIndent+n.paddingX);T(o,i,t,e,n);let{height:s,width:c}=t.BBox;E(e,o-n.rowIndent,i+s/2,o,i+s/2,n.lineThickness),a=Math.max(a,o+c),i+=s},`drawNode`),s=e((e,n=0)=>{o(t,e,r,n),e.children.forEach(e=>{s(e,n+1)});let{x:i,y:a,height:c}=e.BBox;if(e.children.length){let{y:n,height:o}=e.children[e.children.length-1].BBox;E(t,i+r.paddingX,a+c,i+r.paddingX,n+o/2+r.lineThickness/2,r.lineThickness)}},`processNode`);return s(n),{totalHeight:i,totalWidth:a}},`drawTree`),O={draw:e((e,n,r,i)=>{t.debug(`Rendering treeView diagram
1
+ import{n as e,r as t}from"./src-DxsrUvGr.js";import{B as n,C as r,V as i,W as a,_ as o,a as s,c,d as l,v as u,y as d}from"./chunk-ICPOFSXX-Czafge50.js";import{r as f}from"./chunk-5PVQY5BW-BFfnnQIi.js";import{t as p}from"./chunk-426QAEUC-xq7mFc66.js";import{t as m}from"./chunk-4BX2VUAB-DeXGuanp.js";import{t as h}from"./mermaid-parser.core-CIRt0Dgq.js";import{t as g}from"./chunk-QZHKN3VN-DGZr8ZKt.js";var _=new g(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,children:[]}]})),v=e(()=>{_.reset(),s()},`clear`),y=e(()=>_.records.stack[0],`getRoot`),b=e(()=>_.records.cnt,`getCount`),x=l.treeView,S={clear:v,addNode:e((e,t)=>{for(;e<=_.records.stack[_.records.stack.length-1].level;)_.records.stack.pop();let n={id:_.records.cnt++,level:e,name:t,children:[]};_.records.stack[_.records.stack.length-1].children.push(n),_.records.stack.push(n)},`addNode`),getRoot:y,getCount:b,getConfig:e(()=>f(x,d().treeView),`getConfig`),getAccTitle:u,getAccDescription:o,getDiagramTitle:r,setAccDescription:n,setAccTitle:i,setDiagramTitle:a},C=e(e=>{m(e,S),e.nodes.map(e=>S.addNode(e.indent?parseInt(e.indent):0,e.name))},`populate`),w={parse:e(async e=>{let n=await h(`treeView`,e);t.debug(n),C(n)},`parse`)},T=e((e,t,n,r,i)=>{let a=r.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-label`),{height:o,width:s}=a.node().getBBox(),c=o+i.paddingY*2,l=s+i.paddingX*2;a.attr(`x`,e+i.paddingX),a.attr(`y`,t+c/2),n.BBox={x:e,y:t,width:l,height:c}},`positionLabel`),E=e((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),D=e((t,n,r)=>{let i=0,a=0,o=e((e,t,n,r)=>{let o=r*(n.rowIndent+n.paddingX);T(o,i,t,e,n);let{height:s,width:c}=t.BBox;E(e,o-n.rowIndent,i+s/2,o,i+s/2,n.lineThickness),a=Math.max(a,o+c),i+=s},`drawNode`),s=e((e,n=0)=>{o(t,e,r,n),e.children.forEach(e=>{s(e,n+1)});let{x:i,y:a,height:c}=e.BBox;if(e.children.length){let{y:n,height:o}=e.children[e.children.length-1].BBox;E(t,i+r.paddingX,a+c,i+r.paddingX,n+o/2+r.lineThickness/2,r.lineThickness)}},`processNode`);return s(n),{totalHeight:i,totalWidth:a}},`drawTree`),O={draw:e((e,n,r,i)=>{t.debug(`Rendering treeView diagram
2
2
  `+e);let a=i.db,o=a.getRoot(),s=a.getConfig(),l=p(n),u=l.append(`g`);u.attr(`class`,`tree-view`);let{totalHeight:d,totalWidth:f}=D(u,o,s);l.attr(`viewBox`,`-${s.lineThickness/2} 0 ${f} ${d}`),c(l,d,f,s.useMaxWidth)},`draw`)},k={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`},A={db:S,renderer:O,parser:w,styles:e(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r}=f(k,e);return`
3
3
  .treeView-node-label {
4
4
  font-size: ${t};
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./src-DxsrUvGr.js";import{B as n,C as r,E as i,V as a,W as o,_ as s,a as c,c as l,d as u,v as d,y as f}from"./chunk-ICPOFSXX-Dy9JRPZu.js";import{t as p}from"./ordinal-C2dFitP3.js";import{C as m}from"./src-DXWvEiD2.js";import{t as h}from"./defaultLocale-C061bpWn.js";import{r as g}from"./chunk-5PVQY5BW-D2kQfsEU.js";import{t as _}from"./chunk-426QAEUC-CYmyjEj-.js";import{t as v}from"./chunk-4BX2VUAB-DeXGuanp.js";import{t as y}from"./mermaid-parser.core-CIRt0Dgq.js";import{t as b}from"./chunk-EDXVE4YY-9CmJcS4N.js";import{i as x,n as S}from"./chunk-X2U36JSP-b_VUmOsG.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function R(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=V)):t===void 0&&(t=B);for(var n=new W(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function te(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var ne=(1+Math.sqrt(5))/2;function re(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?ee(c,n,r,i,h?r+=m*g/h:a):te(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var ie=(function e(t){function n(e,n,r,i,a){re(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=G(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:q(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:q(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:q(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:q(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:q(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=a,this.getAccTitle=d,this.setDiagramTitle=o,this.getDiagramTitle=r,this.getAccDescription=s,this.setAccDescription=n}static{e(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=u,t=f();return g({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{S(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){c(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{v(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await y(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((n,r,i,a)=>{let o=a.db,s=o.getConfig(),c=s.padding??ce,u=o.getDiagramTitle(),d=o.getRoot(),{themeVariables:g}=f();if(!d)return;let v=u?30:0,y=_(r),S=s.nodeWidth?s.nodeWidth*Q:960,C=s.nodeHeight?s.nodeHeight*Q:500,w=S,T=C+v;y.attr(`viewBox`,`0 0 ${w} ${T}`),l(y,T,w,s.useMaxWidth);let E;try{let t=s.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=p().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=p().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=p().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);u&&y.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(u);let A=y.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=R(d).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([S,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(c).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${r}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=x({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=m(this),n=e.data.name;t.text(n);let r=e.x1-e.x0,i;i=s.showValues!==!1&&e.value?r-10-30-10-6:r-6-6;let a=Math.max(15,i),o=t.node();if(o.getComputedTextLength()>a){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),o.getComputedTextLength()>a&&t.text(``);break}if(t.text(e+`...`),o.getComputedTextLength()<=a)break}}}),s.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);I.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>x({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),I.append(`clipPath`).attr(`id`,(e,t)=>`clip-${r}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),I.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:`+k(e.data.name)+`;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.data.name).each(function(e){let t=m(this),n=e.x1-e.x0,r=e.y1-e.y0,i=t.node(),a=n-8,o=r-8;if(a<10||o<10){t.style(`display`,`none`);return}let s=parseInt(t.style(`font-size`),10),c=.6;for(;i.getComputedTextLength()>a&&s>8;)s--,t.style(`font-size`,`${s}px`);let l=Math.max(6,Math.min(28,Math.round(s*c))),u=s+2+l;for(;u>o&&s>8&&(s--,l=Math.max(6,Math.min(28,Math.round(s*c))),!(l<6&&s===8));)t.style(`font-size`,`${s}px`),u=s+2+l;t.style(`font-size`,`${s}px`),(i.getComputedTextLength()>a||s<8||o<s)&&t.style(`display`,`none`)}),s.showValues!==!1&&I.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:`+k(e.data.name)+`;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=m(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let r=m(n).select(`.treemapLabel`);if(r.empty()||r.style(`display`)===`none`){t.style(`display`,`none`);return}let i=parseFloat(r.style(`font-size`)),a=Math.max(6,Math.min(28,Math.round(i*.6)));t.style(`font-size`,`${a}px`);let o=(e.y1-e.y0)/2+i/2+2;t.attr(`y`,o);let s=e.x1-e.x0,c=e.y1-e.y0-4,l=s-8;t.node().getComputedTextLength()>l||o+a>c||a<6?t.style(`display`,`none`):t.style(`display`,null)}),b(y,s.diagramPadding??8,`flowchart`,s?.useMaxWidth||!1)},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:Z,get db(){return new Y},renderer:le,styles:e(({treemap:e}={})=>{let t=g(i(),f().themeVariables),n=g(ue,e),r=n.titleColor??t.titleColor,a=n.labelColor??t.textColor,o=n.valueColor??t.textColor;return`
1
+ import{n as e,r as t}from"./src-DxsrUvGr.js";import{B as n,C as r,E as i,V as a,W as o,_ as s,a as c,c as l,d as u,v as d,y as f}from"./chunk-ICPOFSXX-Czafge50.js";import{t as p}from"./ordinal-C2dFitP3.js";import{C as m}from"./src-DXWvEiD2.js";import{t as h}from"./defaultLocale-C061bpWn.js";import{r as g}from"./chunk-5PVQY5BW-BFfnnQIi.js";import{t as _}from"./chunk-426QAEUC-xq7mFc66.js";import{t as v}from"./chunk-4BX2VUAB-DeXGuanp.js";import{t as y}from"./mermaid-parser.core-CIRt0Dgq.js";import{t as b}from"./chunk-EDXVE4YY-9Eze-YYC.js";import{i as x,n as S}from"./chunk-X2U36JSP-DZKPmsbB.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function R(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=V)):t===void 0&&(t=B);for(var n=new W(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function te(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var ne=(1+Math.sqrt(5))/2;function re(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?ee(c,n,r,i,h?r+=m*g/h:a):te(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var ie=(function e(t){function n(e,n,r,i,a){re(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=G(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:q(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:q(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:q(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:q(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:q(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=a,this.getAccTitle=d,this.setDiagramTitle=o,this.getDiagramTitle=r,this.getAccDescription=s,this.setAccDescription=n}static{e(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=u,t=f();return g({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{S(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){c(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{v(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await y(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((n,r,i,a)=>{let o=a.db,s=o.getConfig(),c=s.padding??ce,u=o.getDiagramTitle(),d=o.getRoot(),{themeVariables:g}=f();if(!d)return;let v=u?30:0,y=_(r),S=s.nodeWidth?s.nodeWidth*Q:960,C=s.nodeHeight?s.nodeHeight*Q:500,w=S,T=C+v;y.attr(`viewBox`,`0 0 ${w} ${T}`),l(y,T,w,s.useMaxWidth);let E;try{let t=s.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=p().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=p().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=p().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);u&&y.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(u);let A=y.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=R(d).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([S,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(c).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${r}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=x({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=m(this),n=e.data.name;t.text(n);let r=e.x1-e.x0,i;i=s.showValues!==!1&&e.value?r-10-30-10-6:r-6-6;let a=Math.max(15,i),o=t.node();if(o.getComputedTextLength()>a){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),o.getComputedTextLength()>a&&t.text(``);break}if(t.text(e+`...`),o.getComputedTextLength()<=a)break}}}),s.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);I.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>x({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),I.append(`clipPath`).attr(`id`,(e,t)=>`clip-${r}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),I.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:`+k(e.data.name)+`;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.data.name).each(function(e){let t=m(this),n=e.x1-e.x0,r=e.y1-e.y0,i=t.node(),a=n-8,o=r-8;if(a<10||o<10){t.style(`display`,`none`);return}let s=parseInt(t.style(`font-size`),10),c=.6;for(;i.getComputedTextLength()>a&&s>8;)s--,t.style(`font-size`,`${s}px`);let l=Math.max(6,Math.min(28,Math.round(s*c))),u=s+2+l;for(;u>o&&s>8&&(s--,l=Math.max(6,Math.min(28,Math.round(s*c))),!(l<6&&s===8));)t.style(`font-size`,`${s}px`),u=s+2+l;t.style(`font-size`,`${s}px`),(i.getComputedTextLength()>a||s<8||o<s)&&t.style(`display`,`none`)}),s.showValues!==!1&&I.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:`+k(e.data.name)+`;`+x({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=m(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let r=m(n).select(`.treemapLabel`);if(r.empty()||r.style(`display`)===`none`){t.style(`display`,`none`);return}let i=parseFloat(r.style(`font-size`)),a=Math.max(6,Math.min(28,Math.round(i*.6)));t.style(`font-size`,`${a}px`);let o=(e.y1-e.y0)/2+i/2+2;t.attr(`y`,o);let s=e.x1-e.x0,c=e.y1-e.y0-4,l=s-8;t.node().getComputedTextLength()>l||o+a>c||a<6?t.style(`display`,`none`):t.style(`display`,null)}),b(y,s.diagramPadding??8,`flowchart`,s?.useMaxWidth||!1)},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:Z,get db(){return new Y},renderer:le,styles:e(({treemap:e}={})=>{let t=g(i(),f().themeVariables),n=g(ue,e),r=n.titleColor??t.titleColor,a=n.labelColor??t.textColor,o=n.valueColor??t.textColor;return`
2
2
  .treemapNode.section {
3
3
  stroke: ${n.sectionStrokeColor};
4
4
  stroke-width: ${n.sectionStrokeWidth};
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./src-DxsrUvGr.js";import{B as n,C as r,E as i,V as a,W as o,_ as s,a as c,c as l,d as u,v as d,y as f}from"./chunk-ICPOFSXX-Dy9JRPZu.js";import{r as p}from"./chunk-5PVQY5BW-D2kQfsEU.js";import{t as m}from"./chunk-426QAEUC-CYmyjEj-.js";import{t as h}from"./chunk-4BX2VUAB-DeXGuanp.js";import{t as g}from"./mermaid-parser.core-CIRt0Dgq.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=u.radar,x=e(()=>p({...b,...f().radar}),`getConfig`),S=e(()=>y.axes,`getAxes`),C=e(()=>y.curves,`getCurves`),w=e(()=>y.options,`getOptions`),T=e(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=e(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=e(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:e(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:e(()=>{c(),y=structuredClone(v)},`clear`),setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},k=e(e=>{h(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:e(async e=>{let n=await g(`radar`,e);t.debug(n),k(n)},`parse`)},j=e((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=M(m(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;N(u,a,p,s.ticks,s.graticule),P(u,a,p,c),F(u,a,o,f,d,s.graticule,c),R(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),M=e((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return l(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),N=e((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=e((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2;e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*Math.cos(s)).attr(`y2`,n*r.axisScaleFactor*Math.sin(s)).attr(`class`,`radarAxisLine`),e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*Math.cos(s)).attr(`y`,n*r.axisLabelFactor*Math.sin(s)).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}e(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}e(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}e(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}e(R,`drawLegend`);var z={draw:j},B=e((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
1
+ import{n as e,r as t}from"./src-DxsrUvGr.js";import{B as n,C as r,E as i,V as a,W as o,_ as s,a as c,c as l,d as u,v as d,y as f}from"./chunk-ICPOFSXX-Czafge50.js";import{r as p}from"./chunk-5PVQY5BW-BFfnnQIi.js";import{t as m}from"./chunk-426QAEUC-xq7mFc66.js";import{t as h}from"./chunk-4BX2VUAB-DeXGuanp.js";import{t as g}from"./mermaid-parser.core-CIRt0Dgq.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=u.radar,x=e(()=>p({...b,...f().radar}),`getConfig`),S=e(()=>y.axes,`getAxes`),C=e(()=>y.curves,`getCurves`),w=e(()=>y.options,`getOptions`),T=e(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=e(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=e(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:e(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:e(()=>{c(),y=structuredClone(v)},`clear`),setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},k=e(e=>{h(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:e(async e=>{let n=await g(`radar`,e);t.debug(n),k(n)},`parse`)},j=e((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=M(m(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;N(u,a,p,s.ticks,s.graticule),P(u,a,p,c),F(u,a,o,f,d,s.graticule,c),R(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),M=e((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return l(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),N=e((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=e((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2;e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*Math.cos(s)).attr(`y2`,n*r.axisScaleFactor*Math.sin(s)).attr(`class`,`radarAxisLine`),e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*Math.cos(s)).attr(`y`,n*r.axisLabelFactor*Math.sin(s)).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}e(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}e(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}e(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}e(R,`drawLegend`);var z={draw:j},B=e((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
2
2
  .radarCurve-${r} {
3
3
  color: ${i};
4
4
  fill: ${i};
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./src-DxsrUvGr.js";import{B as n,C as r,V as i,W as a,_ as o,a as s,c,d as l,v as u,y as d}from"./chunk-ICPOFSXX-Dy9JRPZu.js";import{r as f}from"./chunk-5PVQY5BW-D2kQfsEU.js";import{t as p}from"./chunk-426QAEUC-CYmyjEj-.js";import{t as m}from"./chunk-4BX2VUAB-DeXGuanp.js";import{t as h}from"./mermaid-parser.core-CIRt0Dgq.js";var g=l.packet,_=class{constructor(){this.packet=[],this.setAccTitle=i,this.getAccTitle=u,this.setDiagramTitle=a,this.getDiagramTitle=r,this.getAccDescription=o,this.setAccDescription=n}static{e(this,`PacketDB`)}getConfig(){let e=f({...g,...d().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){s(),this.packet=[]}},v=1e4,y=e((e,n)=>{m(e,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:s,end:c,bits:l,label:u}of e.blocks){if(s!==void 0&&c!==void 0&&c<s)throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);if(s??=r+1,s!==r+1)throw Error(`Packet block ${s} - ${c??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(c??=s+(l??1)-1,l??=c-s+1,r=c,t.debug(`Packet block ${s} - ${r} with label ${u}`);i.length<=o+1&&n.getPacket().length<v;){let[e,t]=b({start:s,end:c,bits:l,label:u},a,o);if(i.push(e),e.end+1===a*o&&(n.pushWord(i),i=[],a++),!t)break;({start:s,end:c,bits:l,label:u}=t)}}n.pushWord(i)},`populate`),b=e((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:e(async e=>{let n=await h(`packet`,e),r=x.parser?.yy;if(!(r instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);t.debug(n),y(n,r)},`parse`)},S=e((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:l,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),m=o+s,h=m*(d.length+1)-(f?0:o),g=l*u+2,_=p(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),c(_,h,g,a.useMaxWidth);for(let[e,t]of d.entries())C(_,t,e,a);_.append(`text`).text(f).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=e((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:e(({packet:e}={})=>{let t=f(T,e);return`
1
+ import{n as e,r as t}from"./src-DxsrUvGr.js";import{B as n,C as r,V as i,W as a,_ as o,a as s,c,d as l,v as u,y as d}from"./chunk-ICPOFSXX-Czafge50.js";import{r as f}from"./chunk-5PVQY5BW-BFfnnQIi.js";import{t as p}from"./chunk-426QAEUC-xq7mFc66.js";import{t as m}from"./chunk-4BX2VUAB-DeXGuanp.js";import{t as h}from"./mermaid-parser.core-CIRt0Dgq.js";var g=l.packet,_=class{constructor(){this.packet=[],this.setAccTitle=i,this.getAccTitle=u,this.setDiagramTitle=a,this.getDiagramTitle=r,this.getAccDescription=o,this.setAccDescription=n}static{e(this,`PacketDB`)}getConfig(){let e=f({...g,...d().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){s(),this.packet=[]}},v=1e4,y=e((e,n)=>{m(e,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:s,end:c,bits:l,label:u}of e.blocks){if(s!==void 0&&c!==void 0&&c<s)throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);if(s??=r+1,s!==r+1)throw Error(`Packet block ${s} - ${c??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(c??=s+(l??1)-1,l??=c-s+1,r=c,t.debug(`Packet block ${s} - ${r} with label ${u}`);i.length<=o+1&&n.getPacket().length<v;){let[e,t]=b({start:s,end:c,bits:l,label:u},a,o);if(i.push(e),e.end+1===a*o&&(n.pushWord(i),i=[],a++),!t)break;({start:s,end:c,bits:l,label:u}=t)}}n.pushWord(i)},`populate`),b=e((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:e(async e=>{let n=await h(`packet`,e),r=x.parser?.yy;if(!(r instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);t.debug(n),y(n,r)},`parse`)},S=e((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:l,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),m=o+s,h=m*(d.length+1)-(f?0:o),g=l*u+2,_=p(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),c(_,h,g,a.useMaxWidth);for(let[e,t]of d.entries())C(_,t,e,a);_.append(`text`).text(f).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=e((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:e(({packet:e}={})=>{let t=f(T,e);return`
2
2
  .packetByte {
3
3
  font-size: ${t.byteFontSize};
4
4
  }
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,o as n,r,t as i}from"./compiler-runtime-Cs91PcD2.js";import{i as a,l as o,s,t as c,u as l}from"./button-CNAPefQE.js";import{r as u}from"./dist-DV57qOHV.js";import{a as d,d as f,f as p,i as m,l as h,n as g,o as _,r as ee,s as te,u as ne}from"./dist-CUqyztDT.js";var re=l(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),v=e(t(),1),y=n(),b=`focusScope.autoFocusOnMount`,x=`focusScope.autoFocusOnUnmount`,ie={bubbles:!1,cancelable:!0},ae=`FocusScope`,S=v.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=v.useState(null),u=m(i),d=m(a),f=v.useRef(null),h=s(t,e=>l(e)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:C(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||C(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&C(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){fe.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(b,ie);c.addEventListener(b,u),c.dispatchEvent(t),t.defaultPrevented||(oe(he(ce(c)),{select:!0}),document.activeElement===e&&C(c))}return()=>{c.removeEventListener(b,u),setTimeout(()=>{let t=new CustomEvent(x,ie);c.addEventListener(x,d),c.dispatchEvent(t),t.defaultPrevented||C(e??document.body,{select:!0}),c.removeEventListener(x,d),fe.remove(g)},0)}}},[c,u,d,g]);let _=v.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=se(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&C(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&C(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,y.jsx)(p.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});S.displayName=ae;function oe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(C(r,{select:t}),document.activeElement!==n)return}function se(e){let t=ce(e);return[le(t,e),le(t.reverse(),e)]}function ce(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function le(e,t){for(let n of e)if(!ue(n,{upTo:t}))return n}function ue(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function de(e){return e instanceof HTMLInputElement&&`select`in e}function C(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&de(e)&&t&&e.select()}}var fe=pe();function pe(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=me(e,t),e.unshift(t)},remove(t){e=me(e,t),e[0]?.resume()}}}function me(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function he(e){return e.filter(e=>e.tagName!==`A`)}var w=0;function ge(){v.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??_e()),document.body.insertAdjacentElement(`beforeend`,e[1]??_e()),w++,()=>{w===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),w--}},[])}function _e(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var T=function(){return T=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},T.apply(this,arguments)};function ve(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ye(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var E=`right-scroll-bar-position`,D=`width-before-scroll-bar`,be=`with-scroll-bars-hidden`,xe=`--removed-body-scroll-bar-size`;function O(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Se(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ce=typeof window<`u`?v.useLayoutEffect:v.useEffect,we=new WeakMap;function Te(e,t){var n=Se(t||null,function(t){return e.forEach(function(e){return O(e,t)})});return Ce(function(){var t=we.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||O(e,null)}),i.forEach(function(e){r.has(e)||O(e,a)})}we.set(n,e)},[e]),n}function Ee(e){return e}function De(e,t){t===void 0&&(t=Ee);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Oe(e){e===void 0&&(e={});var t=De(null);return t.options=T({async:!0,ssr:!1},e),t}var ke=function(e){var t=e.sideCar,n=ve(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,T({},n))};ke.isSideCarExport=!0;function Ae(e,t){return e.useMedium(t),ke}var je=Oe(),k=function(){},A=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:k,onWheelCapture:k,onTouchMoveCapture:k}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,ee=_===void 0?`div`:_,te=e.gapMode,ne=ve(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),re=f,y=Te([n,t]),b=T(T({},ne),i);return v.createElement(v.Fragment,null,u&&v.createElement(re,{sideCar:je,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:te}),o?v.cloneElement(v.Children.only(s),T(T({},b),{ref:y})):v.createElement(ee,T({},b,{className:c,ref:y}),s))});A.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},A.classNames={fullWidth:D,zeroRight:E};var Me,Ne=function(){if(Me)return Me;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Pe(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ne();return t&&e.setAttribute(`nonce`,t),e}function Fe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ie(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Le=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Pe())&&(Fe(t,n),Ie(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Re=function(){var e=Le();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ze=function(){var e=Re();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Be={left:0,top:0,right:0,gap:0},j=function(e){return parseInt(e||``,10)||0},Ve=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[j(n),j(r),j(i)]},He=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Be;var t=Ve(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ue=ze(),M=`data-scroll-locked`,We=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,o as n,r,t as i}from"./compiler-runtime-Cs91PcD2.js";import{i as a,l as o,s,t as c,u as l}from"./button-CNAPefQE.js";import{r as u}from"./dist-QyEeuecv.js";import{a as d,d as f,f as p,i as m,l as h,n as g,o as _,r as ee,s as te,u as ne}from"./dist-FC83wUOI.js";var re=l(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),v=e(t(),1),y=n(),b=`focusScope.autoFocusOnMount`,x=`focusScope.autoFocusOnUnmount`,ie={bubbles:!1,cancelable:!0},ae=`FocusScope`,S=v.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=v.useState(null),u=m(i),d=m(a),f=v.useRef(null),h=s(t,e=>l(e)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:C(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||C(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&C(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){fe.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(b,ie);c.addEventListener(b,u),c.dispatchEvent(t),t.defaultPrevented||(oe(he(ce(c)),{select:!0}),document.activeElement===e&&C(c))}return()=>{c.removeEventListener(b,u),setTimeout(()=>{let t=new CustomEvent(x,ie);c.addEventListener(x,d),c.dispatchEvent(t),t.defaultPrevented||C(e??document.body,{select:!0}),c.removeEventListener(x,d),fe.remove(g)},0)}}},[c,u,d,g]);let _=v.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=se(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&C(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&C(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,y.jsx)(p.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});S.displayName=ae;function oe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(C(r,{select:t}),document.activeElement!==n)return}function se(e){let t=ce(e);return[le(t,e),le(t.reverse(),e)]}function ce(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function le(e,t){for(let n of e)if(!ue(n,{upTo:t}))return n}function ue(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function de(e){return e instanceof HTMLInputElement&&`select`in e}function C(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&de(e)&&t&&e.select()}}var fe=pe();function pe(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=me(e,t),e.unshift(t)},remove(t){e=me(e,t),e[0]?.resume()}}}function me(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function he(e){return e.filter(e=>e.tagName!==`A`)}var w=0;function ge(){v.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??_e()),document.body.insertAdjacentElement(`beforeend`,e[1]??_e()),w++,()=>{w===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),w--}},[])}function _e(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var T=function(){return T=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},T.apply(this,arguments)};function ve(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ye(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var E=`right-scroll-bar-position`,D=`width-before-scroll-bar`,be=`with-scroll-bars-hidden`,xe=`--removed-body-scroll-bar-size`;function O(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Se(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ce=typeof window<`u`?v.useLayoutEffect:v.useEffect,we=new WeakMap;function Te(e,t){var n=Se(t||null,function(t){return e.forEach(function(e){return O(e,t)})});return Ce(function(){var t=we.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||O(e,null)}),i.forEach(function(e){r.has(e)||O(e,a)})}we.set(n,e)},[e]),n}function Ee(e){return e}function De(e,t){t===void 0&&(t=Ee);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Oe(e){e===void 0&&(e={});var t=De(null);return t.options=T({async:!0,ssr:!1},e),t}var ke=function(e){var t=e.sideCar,n=ve(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,T({},n))};ke.isSideCarExport=!0;function Ae(e,t){return e.useMedium(t),ke}var je=Oe(),k=function(){},A=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:k,onWheelCapture:k,onTouchMoveCapture:k}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,ee=_===void 0?`div`:_,te=e.gapMode,ne=ve(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),re=f,y=Te([n,t]),b=T(T({},ne),i);return v.createElement(v.Fragment,null,u&&v.createElement(re,{sideCar:je,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:te}),o?v.cloneElement(v.Children.only(s),T(T({},b),{ref:y})):v.createElement(ee,T({},b,{className:c,ref:y}),s))});A.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},A.classNames={fullWidth:D,zeroRight:E};var Me,Ne=function(){if(Me)return Me;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Pe(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ne();return t&&e.setAttribute(`nonce`,t),e}function Fe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ie(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Le=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Pe())&&(Fe(t,n),Ie(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Re=function(){var e=Le();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ze=function(){var e=Re();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Be={left:0,top:0,right:0,gap:0},j=function(e){return parseInt(e||``,10)||0},Ve=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[j(n),j(r),j(i)]},He=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Be;var t=Ve(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ue=ze(),M=`data-scroll-locked`,We=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${be} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./w3c-keyname-nBRha8PK.js";var i=[],a=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?a:i).push(n+=e[t])})();function o(e){if(e<768)return!1;for(let t=0,n=i.length;;){let r=t+n>>1;if(e<i[r])n=r;else if(e>=a[r])t=r+1;else return!0;if(t==n)return!1}}function s(e){return e>=127462&&e<=127487}var c=8205;function l(e,t,n=!0,r=!0){return(n?u:d)(e,t,r)}function u(e,t,n){if(t==e.length)return t;t&&p(e.charCodeAt(t))&&m(e.charCodeAt(t-1))&&t--;let r=f(e,t);for(t+=h(r);t<e.length;){let i=f(e,t);if(r==c||i==c||n&&o(i))t+=h(i),r=i;else if(s(i)){let n=0,r=t-2;for(;r>=0&&s(f(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function d(e,t,n){for(;t>0;){let r=u(e,t-2,n);if(r<t)return r;t--}return 0}function f(e,t){let n=e.charCodeAt(t);if(!m(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return p(r)?(n-55296<<10)+(r-56320)+65536:n}function p(e){return e>=56320&&e<57344}function m(e){return e>=55296&&e<56320}function h(e){return e<65536?1:2}var g=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=re(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),v.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=re(this,e,t);let n=[];return this.decompose(e,t,n,0),v.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new S(this),i=new S(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new S(this,e)}iterRange(e,t=this.length){return new ee(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new te(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new _(t):v.from(_.split(t,[]))}},_=class e extends g{constructor(e,t=y(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new ne(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(x(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=b(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=re(this,t,n);let i=b(this.text,b(r.text,x(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):v.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
1
+ import{r as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./w3c-keyname-CIO0QKme.js";var i=[],a=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?a:i).push(n+=e[t])})();function o(e){if(e<768)return!1;for(let t=0,n=i.length;;){let r=t+n>>1;if(e<i[r])n=r;else if(e>=a[r])t=r+1;else return!0;if(t==n)return!1}}function s(e){return e>=127462&&e<=127487}var c=8205;function l(e,t,n=!0,r=!0){return(n?u:d)(e,t,r)}function u(e,t,n){if(t==e.length)return t;t&&p(e.charCodeAt(t))&&m(e.charCodeAt(t-1))&&t--;let r=f(e,t);for(t+=h(r);t<e.length;){let i=f(e,t);if(r==c||i==c||n&&o(i))t+=h(i),r=i;else if(s(i)){let n=0,r=t-2;for(;r>=0&&s(f(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function d(e,t,n){for(;t>0;){let r=u(e,t-2,n);if(r<t)return r;t--}return 0}function f(e,t){let n=e.charCodeAt(t);if(!m(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return p(r)?(n-55296<<10)+(r-56320)+65536:n}function p(e){return e>=56320&&e<57344}function m(e){return e>=55296&&e<56320}function h(e){return e<65536?1:2}var g=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=re(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),v.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=re(this,e,t);let n=[];return this.decompose(e,t,n,0),v.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new S(this),i=new S(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new S(this,e)}iterRange(e,t=this.length){return new ee(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new te(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new _(t):v.from(_.split(t,[]))}},_=class e extends g{constructor(e,t=y(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new ne(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(x(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=b(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=re(this,t,n);let i=b(this.text,b(r.text,x(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):v.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
2
2
  `){[e,t]=re(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},v=class e extends g{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=re(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
3
3
  `){[e,t]=re(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new _(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof _&&c&&(n=u[u.length-1])instanceof _&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new _(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};g.empty=new _([``],0);function y(e){let t=-1;for(let n of e)t+=n.length+1;return t}function b(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function x(e,t,n){return b(e,[``],t,n)}var S=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof _?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof _?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
4
4
  `,this;e--}else if(r instanceof _){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof _?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},ee=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new S(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},te=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(g.prototype[Symbol.iterator]=function(){return this.iter()},S.prototype[Symbol.iterator]=ee.prototype[Symbol.iterator]=te.prototype[Symbol.iterator]=function(){return this});var ne=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function re(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function C(e,t,n=!0,r=!0){return l(e,t,n,r)}function ie(e){return e>=56320&&e<57344}function ae(e){return e>=55296&&e<56320}function oe(e,t){let n=e.charCodeAt(t);if(!ae(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return ie(r)?(n-55296<<10)+(r-56320)+65536:n}function se(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function ce(e){return e<65536?1:2}var le=/\r\n?|\n/,w=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(w||={}),ue=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){pe(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:he(this,e)}mapDesc(e,t=!1){return e.empty?this:me(this,e,t)}mapPos(e,t=-1,n=w.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=w.Simple&&c>=e&&(n==w.TrackDel&&r<e&&c>e||n==w.TrackBefore&&r<e||n==w.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},de=class e extends ue{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return pe(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return me(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(g.empty);r.push(a?t.slice(i,i+a):g.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:he(this,e,!0)}map(e,t=!1){return e.empty?this:me(this,e,t,!0)}iterChanges(e,t=!1){pe(this,e,t)}get desc(){return ue.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new ge(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);T(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;T(n,e,t),t>0&&fe(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);T(n,e,-1),T(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:ue.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&T(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?g.of(l.split(r||le)):l:g.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&T(i,e-o,-1),T(i,s-e,d),fe(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(g.empty);r[e]=g.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function T(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function fe(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(g.empty);e.push(n)}}function pe(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=g.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function me(e,t,n,r=!1){let i=[],a=r?[]:null,o=new ge(e),s=new ge(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);T(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(T(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(T(i,0,o.ins),a&&fe(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;T(i,t,e<o.i?o.ins:0),a&&e<o.i&&fe(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?de.createSet(i,a):ue.create(i);else throw Error(`Mismatched change set lengths`)}function he(e,t,n=!1){let r=[],i=n?[]:null,a=new ge(e),o=new ge(t);for(let e=!1;;)if(a.done&&o.done)return i?de.createSet(r,i):ue.create(r);else if(a.ins==0)T(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)T(r,0,o.ins,e),i&&fe(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;T(r,t,n,e),i&&n&&fe(i,r,o.text)}else o.ins==-1?(T(r,a.off?0:a.len,t,e),i&&fe(i,r,a.textBit(t))):(T(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&fe(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var ge=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?g.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?g.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},_e=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return E.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return E.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return E.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},E=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>_e.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return _e.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r,i){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!i&&e!=t&&(i=t<e?1:-1),t<e?_e.create(t,e,48|a):_e.create(e,t,(i?i<0?8:16:0)|a)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function ve(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var ye=0,D=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ye++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:be),!!t.static,t.enables)}of(e){return new xe([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new xe(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new xe(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function be(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var xe=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ye++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||Ce(e,c)){let r=t(e);if(a?!Se(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=Ie(o,c);if(this.dependencies.every(t=>t instanceof D?o.facet(t)===e.facet(t):t instanceof Ee?o.field(t,!1)==e.field(t,!1):!0)||(a?Se(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function Se(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Ce(e,t){let n=!1;for(let r of t)Fe(e,r)&1&&(n=!0);return n}function we(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=Ie(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)Fe(e,t);return e.values[o]=s(e),1},update(e,n){if(!Ce(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=Ce(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&be(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var Te=D.define({static:!0}),Ee=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(ye++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(Te).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(Te),i=n.facet(Te),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,Te.of({field:this,create:e})]}get extension(){return this}},De={lowest:4,low:3,default:2,high:1,highest:0};function Oe(e){return t=>new Ae(t,e)}var ke={highest:Oe(De.highest),high:Oe(De.high),default:Oe(De.default),low:Oe(De.low),lowest:Oe(De.lowest)},Ae=class{constructor(e,t){this.inner=e,this.prec=t}},je=class e{of(e){return new Me(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},Me=class{constructor(e,t){this.compartment=e,this.inner=t}},Ne=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of Pe(t,n,o))e instanceof Ee?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,be(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>we(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}};function Pe(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof Me&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof Me){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof Ae)a(e.inner,e.prec);else if(e instanceof Ee)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof xe)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,De.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,De.default),r.reduce((e,t)=>e.concat(t))}function Fe(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Ie(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var Le=D.define(),Re=D.define({combine:e=>e.some(e=>e),static:!0}),ze=D.define({combine:e=>e.length?e[0]:void 0,static:!0}),Be=D.define(),Ve=D.define(),He=D.define(),Ue=D.define({combine:e=>e.length?e[0]:!1}),We=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Ge}},Ge=class{of(e){return new We(this,e)}},Ke=class{constructor(e){this.map=e}of(e){return new O(this,e)}},O=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new Ke(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};O.reconfigure=O.define(),O.appendConfig=O.define();var k=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&ve(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};k.time=We.define(),k.userEvent=We.define(),k.addToHistory=We.define(),k.remote=We.define();function qe(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Je(e,t,n){let r,i,a;return n?(r=t.changes,i=de.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:O.mapEffects(e.effects,r).concat(O.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Ye(e,t,n){let r=t.selection,i=et(t.annotations);return t.userEvent&&(i=i.concat(k.userEvent.of(t.userEvent))),{changes:t.changes instanceof de?t.changes:de.of(t.changes||[],n,e.facet(ze)),selection:r&&(r instanceof E?r:E.single(r.anchor,r.head)),effects:et(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Xe(e,t,n){let r=Ye(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Je(r,Ye(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=k.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Qe(n?Ze(i):i)}function Ze(e){let t=e.startState,n=!0;for(let r of t.facet(Be)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:qe(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=de.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=k.create(t,r,e.selection&&e.selection.map(i),O.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(Ve);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof k?i:Array.isArray(i)&&i.length==1&&i[0]instanceof k?i[0]:Xe(t,et(i),!1)}return e}function Qe(e){let t=e.startState,n=t.facet(He),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Je(r,Ye(t,a,e.changes.newLength),!0))}return r==e?e:k.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var $e=[];function et(e){return e==null?$e:Array.isArray(e)?e:[e]}var tt=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(tt||={}),nt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,rt;try{rt=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function it(e){if(rt)return rt.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>`€`&&(n.toUpperCase()!=n.toLowerCase()||nt.test(n)))return!0}return!1}function at(e){return t=>{if(!/\S/.test(t))return tt.Space;if(it(t))return tt.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return tt.Word;return tt.Other}}var A=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Fe(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return Fe(this,n),Ie(this,n)}update(...e){return Xe(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(je.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(O.reconfigure)?(n=null,r=e.value):e.is(O.appendConfig)&&(n=null,r=et(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=Ne.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(Re)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:E.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=et(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=O.mapEffects(a,c).concat(O.mapEffects(et(o.effects),l))}return{changes:r,selection:E.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof de?t:de.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return g.of(t.split(this.facet(e.lineSeparator)||le))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Fe(this,t),Ie(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Ee&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:E.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=Ne.resolve(t.extensions||[],new Map),r=t.doc instanceof g?t.doc:g.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||le)),i=t.selection?t.selection instanceof E?t.selection:E.single(t.selection.anchor,t.selection.head):E.single(0);return ve(i,r.length),n.staticFacet(Re)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
@@ -1,4 +1,4 @@
1
- import{r as e}from"./chunk-CFjPhJqf.js";import{A as t,At as n,Dt as r,Et as i,F as a,G as o,H as s,K as c,L as l,O as u,P as d,R as f,T as p,U as m,V as h,Vt as g,X as ee,a as _,b as te,i as ne,o as v,p as re,q as ie,s as ae,ut as oe,x as se}from"./dist-oO1mEK6k.js";import{n as ce,r as le}from"./dist-ClExeLmG.js";import{t as ue}from"./dist-BBjgNwuA.js";var de=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[h.contextHash,r]]}addChild(e,t){e.prop(h.contextHash)!=this.hash&&(e=new c(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new c(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new c(m.none,e,t,n,this.hashProp)})}},y;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(y||={});var fe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},pe=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return x(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function me(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==y.OrderedList?T:w)(n,t,!1);return r>0&&(e.type!=y.BulletList||C(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var he={[y.Blockquote](e,t,n){return n.next==62?(n.markers.push(R(y.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(b(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[y.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[y.OrderedList]:me,[y.BulletList]:me,[y.Document](){return!0}};function b(e){return e==32||e==9||e==10||e==13}function x(e,t=0){for(;t<e.length&&b(e.charCodeAt(t));)t++;return t}function S(e,t,n){for(;t>n&&b(e.charCodeAt(t-1));)t--;return t}function ge(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function _e(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function C(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!b(n))return-1}return n&&e.next==45&&be(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Te.SetextHeading)>-1||r<3?-1:1}function ve(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function w(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||b(e.text.charCodeAt(e.pos+1)))&&(!n||ve(t,y.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function T(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!b(e.text.charCodeAt(r+1))||n&&!ve(t,y.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ye(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function be(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&b(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var E=/^[ \t]*$/,xe=/-->/,Se=/\?>/,D=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,xe],[/^\s*<\?/,Se],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,E],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,E]];function O(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=D.length-+!!n;e<t;e++)if(D[e][0].test(r))return e;return-1}function k(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function A(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==y.CodeText?e[r].to=n:e.push(R(y.CodeText,t,n))}var j={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(A(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){A(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==y.CodeText?A(o,e.from,e.to):o.push(e);s=[]}A(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&A(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=y.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(y.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ge(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=S(t.text,t.text.length,o),c=[R(y.CodeMark,r,r+a)];o<s&&c.push(R(y.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&A(c,e.lineStart-1,e.lineStart),c.push(R(y.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(A(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(A(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(y.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=_e(t);return n<0?!1:(e.startContext(y.Blockquote,t.pos),e.addNode(y.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(C(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(y.HorizontalRule,n),!0},BulletList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=y.BulletList&&e.startContext(y.BulletList,t.basePos,t.next);let r=k(t,t.pos+1);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=y.OrderedList&&e.startContext(y.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=k(t,t.pos+n);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ye(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=S(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!b(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(y.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(y.HeaderMark,o-r,a-r);let c=s.finish(y.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=O(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=D[n][1],a=[],o=i!=E;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==xe?y.CommentBlock:i==Se?y.ProcessingInstructionBlock:y.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Ce=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
1
+ import{r as e}from"./chunk-CFjPhJqf.js";import{A as t,At as n,Dt as r,Et as i,F as a,G as o,H as s,K as c,L as l,O as u,P as d,R as f,T as p,U as m,V as h,Vt as g,X as ee,a as _,b as te,i as ne,o as v,p as re,q as ie,s as ae,ut as oe,x as se}from"./dist--WFXzgaP.js";import{n as ce,r as le}from"./dist-DZpmpDA6.js";import{t as ue}from"./dist-3YNajely.js";var de=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[h.contextHash,r]]}addChild(e,t){e.prop(h.contextHash)!=this.hash&&(e=new c(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new c(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new c(m.none,e,t,n,this.hashProp)})}},y;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(y||={});var fe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},pe=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return x(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function me(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==y.OrderedList?T:w)(n,t,!1);return r>0&&(e.type!=y.BulletList||C(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var he={[y.Blockquote](e,t,n){return n.next==62?(n.markers.push(R(y.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(b(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[y.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[y.OrderedList]:me,[y.BulletList]:me,[y.Document](){return!0}};function b(e){return e==32||e==9||e==10||e==13}function x(e,t=0){for(;t<e.length&&b(e.charCodeAt(t));)t++;return t}function S(e,t,n){for(;t>n&&b(e.charCodeAt(t-1));)t--;return t}function ge(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function _e(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function C(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!b(n))return-1}return n&&e.next==45&&be(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Te.SetextHeading)>-1||r<3?-1:1}function ve(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function w(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||b(e.text.charCodeAt(e.pos+1)))&&(!n||ve(t,y.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function T(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!b(e.text.charCodeAt(r+1))||n&&!ve(t,y.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ye(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function be(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&b(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var E=/^[ \t]*$/,xe=/-->/,Se=/\?>/,D=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,xe],[/^\s*<\?/,Se],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,E],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,E]];function O(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=D.length-+!!n;e<t;e++)if(D[e][0].test(r))return e;return-1}function k(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function A(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==y.CodeText?e[r].to=n:e.push(R(y.CodeText,t,n))}var j={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(A(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){A(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==y.CodeText?A(o,e.from,e.to):o.push(e);s=[]}A(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&A(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=y.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(y.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ge(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=S(t.text,t.text.length,o),c=[R(y.CodeMark,r,r+a)];o<s&&c.push(R(y.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&A(c,e.lineStart-1,e.lineStart),c.push(R(y.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(A(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(A(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(y.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=_e(t);return n<0?!1:(e.startContext(y.Blockquote,t.pos),e.addNode(y.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(C(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(y.HorizontalRule,n),!0},BulletList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=y.BulletList&&e.startContext(y.BulletList,t.basePos,t.next);let r=k(t,t.pos+1);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=y.OrderedList&&e.startContext(y.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=k(t,t.pos+n);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ye(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=S(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!b(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(y.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(y.HeaderMark,o-r,a-r);let c=s.finish(y.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=O(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=D[n][1],a=[],o=i!=E;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==xe?y.CommentBlock:i==Se?y.ProcessingInstructionBlock:y.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Ce=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
2
2
  `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&x(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,R(y.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(Be(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(R(y.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Re(e,x(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=x(e,this.pos),n=0;if(t>this.pos){let r=ze(e,t,this.start);if(r){let t=M(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=M(e,this.pos),n>0&&n<e.length?n:-1}else return M(e,this.pos)}};function M(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!b(n))return-1}return t}var we=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:be(t),i=t.next;if(r<0)return!1;let a=R(y.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,R(i==61?y.SetextHeading1:y.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},Te={LinkReference(e,t){return t.content.charCodeAt(0)==91?new Ce(t):null},SetextHeading(){return new we}},Ee=[(e,t)=>ye(t)>=0,(e,t)=>ge(t)>=0,(e,t)=>_e(t)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>T(t,e,!0)>=0,(e,t)=>C(t,e,!0)>=0,(e,t)=>O(t,e,!0)>=0],De={text:``,end:0},Oe=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new pe,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=de.create(y.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new He(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new fe(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
3
3
  `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=Ue(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=De;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+y[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
4
4
  `?``:t;else{let e=t.indexOf(`