dimcode-web 0.1.0-alpha.12 → 0.1.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/package.json +1 -1
  2. package/release-manifest.json +90 -63
  3. package/web/assets/AccountSettings-4uSrBroj.js +1 -0
  4. package/web/assets/AccountSettings-DuC-j6CL.css +1 -0
  5. package/web/assets/AgentSettings-BDiSW65Y.js +1 -0
  6. package/web/assets/AppearanceSettings-C6T82OEq.js +16 -0
  7. package/web/assets/AppearanceSettings-CX6_CvK6.css +1 -0
  8. package/web/assets/ArchivedSettings-DDK-qro_.js +1 -0
  9. package/web/assets/ArchivedSettings-De1WaCgP.css +1 -0
  10. package/web/assets/{CodeBlockNode-60OgUwQ7.js → CodeBlockNode-DsUHD3_k.js} +2 -2
  11. package/web/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-KPZUoxNU.js +6 -0
  12. package/web/assets/DiagnosticsSettings-BmWPEGHb.css +1 -0
  13. package/web/assets/DiagnosticsSettings-CiDVWqJz.js +1 -0
  14. package/web/assets/GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-DY1_UG_g.js +1 -0
  15. package/web/assets/McpSettings-DCYV728D.css +1 -0
  16. package/web/assets/McpSettings-nYhoS35F.js +1 -0
  17. package/web/assets/ModalitySettings-BkeyOoQt.css +1 -0
  18. package/web/assets/ModalitySettings-mIAic7i5.js +1 -0
  19. package/web/assets/PermissionsSettings-DVv7C2io.css +1 -0
  20. package/web/assets/PermissionsSettings-Dh9gF7YF.js +1 -0
  21. package/web/assets/PluginSettings-BMQazfW6.js +1 -0
  22. package/web/assets/PluginSettings-EhulK7fw.css +1 -0
  23. package/web/assets/{PreCodeBlock-DVwonMrZ.js → PreCodeBlock-DXIuTGLt.js} +1 -1
  24. package/web/assets/ProviderAuthFlow.vue_vue_type_script_setup_true_lang-DHd2sgtZ.js +11 -0
  25. package/web/assets/ProviderSettings-Dc3kVfiC.js +2 -0
  26. package/web/assets/ProviderSettings-O7kVWRtj.css +1 -0
  27. package/web/assets/SettingsPage-YJcDRLr9.js +56 -0
  28. package/web/assets/SkillSettings-C16em-eW.css +1 -0
  29. package/web/assets/SkillSettings-ovHdSPTe.js +3 -0
  30. package/web/assets/Tooltip-BJL7Jk33.js +1 -0
  31. package/web/assets/arc-cA0USBj0.js +1 -0
  32. package/web/assets/{architectureDiagram-3BPJPVTR-Bp-buFYT.js → architectureDiagram-3BPJPVTR-D4GyRGsi.js} +1 -1
  33. package/web/assets/{blockDiagram-GPEHLZMM-CGFXutYB.js → blockDiagram-GPEHLZMM-CaMtk8X8.js} +1 -1
  34. package/web/assets/{c4Diagram-AAUBKEIU-CK81MW6S.js → c4Diagram-AAUBKEIU-By4NO5z_.js} +1 -1
  35. package/web/assets/channel-rxJrCDWw.js +1 -0
  36. package/web/assets/{chunk-2J33WTMH-BoGFm_Ja.js → chunk-2J33WTMH-DVR8RXjF.js} +1 -1
  37. package/web/assets/{chunk-4BX2VUAB-CbZzNwQg.js → chunk-4BX2VUAB-BOCw1xVb.js} +1 -1
  38. package/web/assets/{chunk-55IACEB6-BZora9t3.js → chunk-55IACEB6-nIfgcEjn.js} +1 -1
  39. package/web/assets/{chunk-727SXJPM-BW7PYkUF.js → chunk-727SXJPM-RYvblIbW.js} +1 -1
  40. package/web/assets/{chunk-AQP2D5EJ-jBr0F1L0.js → chunk-AQP2D5EJ-BO5Su4MY.js} +1 -1
  41. package/web/assets/{chunk-FMBD7UC4-Ctw2_biG.js → chunk-FMBD7UC4-Q206iq7t.js} +1 -1
  42. package/web/assets/{chunk-ND2GUHAM-CglIMpot.js → chunk-ND2GUHAM-BEHXSkEZ.js} +1 -1
  43. package/web/assets/{chunk-QZHKN3VN-Dafu5qlJ.js → chunk-QZHKN3VN-B4wImiUI.js} +1 -1
  44. package/web/assets/classDiagram-4FO5ZUOK-BtU1pWhP.js +1 -0
  45. package/web/assets/classDiagram-v2-Q7XG4LA2-BtU1pWhP.js +1 -0
  46. package/web/assets/context-ChGKk1Cc.js +1 -0
  47. package/web/assets/{cose-bilkent-S5V4N54A-CU_bA9uN.js → cose-bilkent-S5V4N54A-BJj5g70v.js} +1 -1
  48. package/web/assets/{cynefin-OW5HDTMX-C4xDBkC-.js → cynefin-OW5HDTMX-C-fnPT_y.js} +1 -1
  49. package/web/assets/{dagre-BM42HDAG-ByBoKdtM.js → dagre-BM42HDAG-CpAodSX7.js} +1 -1
  50. package/web/assets/diagram-2AECGRRQ-C0jz5rBL.js +43 -0
  51. package/web/assets/{diagram-5GNKFQAL-gV_KxSca.js → diagram-5GNKFQAL-CKvRsL1_.js} +2 -2
  52. package/web/assets/{diagram-KO2AKTUF-B7puC9pY.js → diagram-KO2AKTUF-C9_QTnZb.js} +3 -3
  53. package/web/assets/{diagram-LMA3HP47-C3skBDvs.js → diagram-LMA3HP47-B0gvGn3Z.js} +2 -2
  54. package/web/assets/diagram-OG6HWLK6-CoW4sNwB.js +24 -0
  55. package/web/assets/{erDiagram-TEJ5UH35-BiaN4dqV.js → erDiagram-TEJ5UH35-B1YPrM8R.js} +1 -1
  56. package/web/assets/{flowDiagram-I6XJVG4X-BToOh9_1.js → flowDiagram-I6XJVG4X-DbSCyQ1o.js} +1 -1
  57. package/web/assets/{ganttDiagram-6RSMTGT7-BvExJCp1.js → ganttDiagram-6RSMTGT7-DCU_-HcU.js} +1 -1
  58. package/web/assets/{gitGraphDiagram-PVQCEYII-DDSemQ7P.js → gitGraphDiagram-PVQCEYII-BnwXK64G.js} +9 -9
  59. package/web/assets/{index-DviuyFKA.js → index-B9cemsjA.js} +86 -86
  60. package/web/assets/index-BKJW0i9Q.js +225 -0
  61. package/web/assets/index-GnV5W03u.css +1 -0
  62. package/web/assets/{index-BeRBs4X9.js → index-gSmHRsHg.js} +1 -1
  63. package/web/assets/{index10-dOy_vQD6.js → index10-B-_2OEd6.js} +1 -1
  64. package/web/assets/{index5-BOU2nLE8.js → index5-CFV5-M95.js} +1 -1
  65. package/web/assets/{index6-DR5XmdMu.js → index6-C3q8vusa.js} +1 -1
  66. package/web/assets/{index8-BvRgDa_J.js → index8-Cg5dteH_.js} +1 -1
  67. package/web/assets/{index9-DbcgM9Nq.js → index9-DOQm5ENJ.js} +1 -1
  68. package/web/assets/{infoDiagram-5YYISTIA-Cn4tOhRG.js → infoDiagram-5YYISTIA-B_F1M87B.js} +1 -1
  69. package/web/assets/{ishikawaDiagram-YF4QCWOH-rWzBXYON.js → ishikawaDiagram-YF4QCWOH-DXtU3ayb.js} +2 -2
  70. package/web/assets/{journeyDiagram-JHISSGLW-Bxr_4EqR.js → journeyDiagram-JHISSGLW-DiP3bT6x.js} +1 -1
  71. package/web/assets/{kanban-definition-UN3LZRKU-DsCcDt8-.js → kanban-definition-UN3LZRKU-8kyelCSQ.js} +7 -7
  72. package/web/assets/{linear-BS3Zj0XR.js → linear-aMkA3ImE.js} +1 -1
  73. package/web/assets/{markstream-BkeUOv85.js → markstream-ybWMrpCV.js} +2 -2
  74. package/web/assets/{mermaid.core-Dx_GaOpJ.js → mermaid.core-BWfn-FFw.js} +5 -5
  75. package/web/assets/{mindmap-definition-RKZ34NQL-DFpB8AIF.js → mindmap-definition-RKZ34NQL-Dge0FtvP.js} +2 -2
  76. package/web/assets/{pieDiagram-4H26LBE5-BQwF2tkc.js → pieDiagram-4H26LBE5-D7MzngYj.js} +3 -3
  77. package/web/assets/{quadrantDiagram-W4KKPZXB-D52eaKYL.js → quadrantDiagram-W4KKPZXB-cjwaMhCa.js} +1 -1
  78. package/web/assets/{requirementDiagram-4Y6WPE33-D7jJIlEK.js → requirementDiagram-4Y6WPE33-ACmBdhUc.js} +3 -3
  79. package/web/assets/{sankeyDiagram-5OEKKPKP-CIippr_x.js → sankeyDiagram-5OEKKPKP-Rva02Dvb.js} +4 -4
  80. package/web/assets/{sequenceDiagram-3UESZ5HK-CFeGDWiC.js → sequenceDiagram-3UESZ5HK-DzazUDns.js} +1 -1
  81. package/web/assets/settings-general-d_R-CH6R.js +1 -0
  82. package/web/assets/{stateDiagram-AJRCARHV-CQ2cSqF2.js → stateDiagram-AJRCARHV-BODPWGjc.js} +1 -1
  83. package/web/assets/stateDiagram-v2-BHNVJYJU-CJ6CdQEh.js +1 -0
  84. package/web/assets/{timeline-definition-PNZ67QCA-BFuzLqGU.js → timeline-definition-PNZ67QCA-D5UqFLNW.js} +3 -3
  85. package/web/assets/{vendor-vue-9TAdpIVM.js → vendor-vue-Ci9TYO_I.js} +15 -15
  86. package/web/assets/{vennDiagram-CIIHVFJN-FjL7IGQe.js → vennDiagram-CIIHVFJN-CtcagJ7K.js} +5 -5
  87. package/web/assets/{wardleyDiagram-YWT4CUSO-Dfz0iI5u.js → wardleyDiagram-YWT4CUSO-G86oBHE2.js} +4 -4
  88. package/web/assets/{xychartDiagram-2RQKCTM6-BDomIXQK.js → xychartDiagram-2RQKCTM6-BJ1nXYiQ.js} +1 -1
  89. package/web/dimcode-web.json +2 -2
  90. package/web/index.html +3 -3
  91. package/web/assets/Tooltip-D_iQTc-v.js +0 -1
  92. package/web/assets/arc-BDSDdwDv.js +0 -1
  93. package/web/assets/channel-vaJb6Uzh.js +0 -1
  94. package/web/assets/classDiagram-4FO5ZUOK-EjflPmAx.js +0 -1
  95. package/web/assets/classDiagram-v2-Q7XG4LA2-EjflPmAx.js +0 -1
  96. package/web/assets/diagram-2AECGRRQ-D069CPLb.js +0 -43
  97. package/web/assets/diagram-OG6HWLK6-CMHB2OJj.js +0 -24
  98. package/web/assets/index-BtvPmxLc.js +0 -220
  99. package/web/assets/index-QWsLY5HH.css +0 -1
  100. package/web/assets/stateDiagram-v2-BHNVJYJU-CAbFkRgA.js +0 -1
@@ -1 +1 @@
1
- import{d as at,y as ut,x as it,r as c,w as K,k as fe,m as st,o as dt,a as v,p as m,b as i,z as f,i as pe,t as R,s as j,n as ge,g as ct,v as vt,u as b}from"./vendor-vue-9TAdpIVM.js";import{a as mt,l as ft,o as pt,f as gt,s as ht,d as yt,Y as Se,Z as wt,r as kt,P as bt,m as xt}from"./index-DviuyFKA.js";import"./index-BtvPmxLc.js";var Bt=Object.defineProperty,Ne=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,Le=(g,o,s)=>o in g?Bt(g,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):g[o]=s,he=(g,o)=>{for(var s in o||(o={}))Dt.call(o,s)&&Le(g,s,o[s]);if(Ne)for(var s of Ne(o))Ct.call(o,s)&&Le(g,s,o[s]);return g},ye=(g,o,s)=>new Promise((w,r)=>{var H=h=>{try{p(s.next(h))}catch(a){r(a)}},x=h=>{try{p(s.throw(h))}catch(a){r(a)}},p=h=>h.done?w(h.value):Promise.resolve(h.value).then(H,x);p((s=s.apply(g,o)).next())});let Re=0;const Mt=["data-markstream-mode","data-markstream-pending"],Et={key:0,class:"d2-block-header flex justify-between items-center border-b"},Tt={class:"d2-header-actions flex items-center"},At={key:0,class:"d2-mode-toggle flex items-center gap-0.5"},jt=["aria-label"],Ht={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Ot={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},It=["aria-label"],Pt=["aria-pressed"],Ft={key:0,class:"d2-source"},St={class:"d2-code"},Nt={key:0,class:"d2-error mt-2 text-xs"},Lt={key:1},Rt={key:0,class:"d2-source"},_t={class:"d2-code"},$t={key:0,class:"d2-error mt-2 text-xs"},Vt=["innerHTML"],Yt={key:0,class:"d2-error px-4 pb-3 text-xs"},we=mt(at({__name:"D2BlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{default:void 0},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:{},darkThemeId:{},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(g){const o=g,s=ut(),w=it(ft,null),{t:r}=pt(),H=c(!1),x=c(!1),p=c(!1),h=c(!1),a=c(null),Q=c(!1),O=c(""),ae=c(""),ue=c(0),_=c(""),I=c(""),W=c(null),ke=c(null),ie=c(null),_e=gt(),ee=ht(),be=yt(),z=c(null),xe=typeof window<"u",Be=c(!1),P=c(typeof window>"u"||!be.value),M=b(()=>{var t;return(t=o.node.code)!=null?t:""}),$e=b(()=>xt(o,s)),te=b(()=>{var t,e;return[o.isDark?"dark":"light",(t=o.themeId)!=null?t:"auto",(e=o.darkThemeId)!=null?e:"auto",M.value].join(":")}),oe=b(()=>!!O.value&&ae.value===te.value),De=b(()=>{if(!Be.value||!M.value||p.value)return!1;const t=te.value;return!!Q.value||_.value!==t&&(!a.value||I.value!==t)}),se=b(()=>oe.value||!!O.value&&De.value),ne=b(()=>p.value||!h.value||!se.value),Ve=b(()=>{var t;return p.value||se.value?0:M.value?a.value&&I.value===te.value?0:(t=kt(o.estimatedPreviewHeightPx))!=null?t:0:0}),Ye=b(()=>{var t;if(!ne.value)return;const e=Math.max((t=ke.value)!=null?t:0,Ve.value);return e>0?{minHeight:`${e}px`}:void 0}),ze=b(()=>{if(o.maxHeight==="none")return{maxHeight:"none","--ms-d2-render-max-height":"none"};if(o.maxHeight!=null){const t=typeof o.maxHeight=="number"?`${o.maxHeight}px`:String(o.maxHeight);return{maxHeight:t,"--ms-d2-render-max-height":t}}});let B=null,de=!1,$=!1,Ce=0,V=null,F=!1,U=null,E="";typeof window<"u"&&K([()=>ie.value,be],([t,e])=>{var n,d,S;if((n=z.value)==null||n.destroy(),z.value=null,!e||P.value)return void(P.value=!0);if(!t)return void(P.value=!1);const le=(S=(d=ee==null?void 0:ee.value.heavyBlockMargin)!=null?d:ee==null?void 0:ee.value.rootMargin)!=null?S:"160px",D=_e(t,{rootMargin:le,allowIdle:!1});z.value=D,P.value=D.isVisible.value,D.whenVisible.then(()=>{P.value=!0})},{immediate:!0});const Ue={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function Me(t){return!t||t.disabled}function T(t,e,n="top"){if(Me(t.currentTarget))return;const d=t,S=(d==null?void 0:d.clientX)!=null&&(d==null?void 0:d.clientY)!=null?{x:d.clientX,y:d.clientY}:void 0;Se(t.currentTarget,e,n,!1,S,o.isDark)}function k(){wt()}function Ee(t){if(Me(t.currentTarget))return;const e=H.value?r("common.copied")||"Copied":r("common.copy")||"Copy",n=t,d=(n==null?void 0:n.clientX)!=null&&(n==null?void 0:n.clientY)!=null?{x:n.clientX,y:n.clientY}:void 0;Se(t.currentTarget,e,"top",!1,d,o.isDark)}function Xe(){return ye(this,null,function*(){try{const t=M.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(t)),H.value=!0,setTimeout(()=>{H.value=!1},1e3)}catch(t){console.error("Copy failed:",t)}})}function qe(){x.value=!x.value}function Te(t){p.value=t==="source"}const Ze=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],Ge=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function Je(t){if(!t)return"";const e=t.trim();return Ge.test(e)?e:""}function Ae(){O.value="",ae.value=""}function X(t){return $||t!==ue.value}function Ke(){return ye(this,null,function*(){var t,e,n,d,S,le;if(!xe||$||!P.value||o.loading&&!o.progressiveRender)return;const D=te.value;if(D===_.value&&!a.value&&oe.value)return h.value=!0,void(o.loading&&(p.value=!1));const je=M.value;if(!je)return Ae(),a.value=null,_.value="",void(I.value="");const Z=++ue.value;Q.value=!0,a.value=null,I.value="",(function(){const u=$e.value;w&&u&&E!==u&&(E&&w.markSettled(E),E=u,w.markPending(u))})();try{const u=yield(function(){return ye(this,null,function*(){if(B)return B;const l=yield bt();if($||!l)return null;if(typeof l=="function"){const G=new l;return G&&typeof G.compile=="function"?B=G:typeof l.compile=="function"&&(B=l),B}return l!=null&&l.D2&&typeof l.D2=="function"?(B=new l.D2,B):(typeof l.compile=="function"&&(B=l),B)})})();if(X(Z))return;if(!u)return h.value=!1,p.value=!0,Ae(),a.value="D2 is not available.",void(I.value=D);if(typeof u.compile!="function"||typeof u.render!="function")throw new TypeError("D2 instance is missing compile/render methods.");h.value=!0;const y=yield u.compile(je);if(X(Z))return;const re=(t=y==null?void 0:y.diagram)!=null?t:y,C=(n=(e=y==null?void 0:y.renderOptions)!=null?e:y==null?void 0:y.options)!=null?n:{},We=(d=o.themeId)!=null?d:C.themeID,He=(S=o.darkThemeId)!=null?S:C.darkThemeID,N=he({},C);if(N.themeID=o.isDark&&He!=null?He:We,N.darkThemeID=null,N.darkThemeOverrides=null,o.isDark){const l=C.themeOverrides&&typeof C.themeOverrides=="object"?C.themeOverrides:null;N.themeOverrides=he(he({},Ue),l||{})}N.salt=(le=N.salt)!=null?le:(function(l="markstream-vue-d2"){return Re+=1,`${l}-${Re}`})();const et=yield u.render(re,N);if(X(Z))return;const Oe=(function(l){return l?typeof l=="string"?l:typeof l.svg=="string"?l.svg:typeof l.data=="string"?l.data:"":""})(et);if(!Oe)throw new Error("D2 render returned empty output.");(function(l,G){const Ie=(function(Pe){if(typeof window>"u"||typeof DOMParser>"u"||!Pe)return"";const tt=Pe.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),ve=new DOMParser().parseFromString(tt,"image/svg+xml").documentElement;if(!ve||ve.nodeName.toLowerCase()!=="svg")return"";const me=ve;return(function(Fe){const ot=new Set(["script"]),nt=[Fe,...Array.from(Fe.querySelectorAll("*"))];for(const L of nt){if(ot.has(L.tagName.toLowerCase())){L.remove();continue}const lt=Array.from(L.attributes);for(const Y of lt){const A=Y.name;if(/^on/i.test(A))L.removeAttribute(A);else{if(A==="style"&&Y.value){const J=Y.value;if(Ze.some(rt=>rt.test(J))){L.removeAttribute(A);continue}}if((A==="href"||A==="xlink:href")&&Y.value){const J=Je(Y.value);if(!J){L.removeAttribute(A);continue}J!==Y.value&&L.setAttribute(A,J)}}}}})(me),me.classList.add("markstream-d2-root-svg"),me.outerHTML})(l);O.value=Ie||"",ae.value=Ie?G:""})(Oe,D),_.value=D,I.value="",o.loading&&(p.value=!1),a.value=null}catch(u){if(X(Z))return;const y=u!=null&&u.message?String(u.message):"D2 render failed.";o.loading||(a.value=y,I.value=D),_.value="",y.includes("@terrastruct/d2")&&(h.value=!1,p.value=!0)}finally{X(Z)||(Q.value=!1,F?(F=!1,q()):(function(){const u=E;w&&u&&(E="",fe(()=>{var y,re;if(!$){const C=(re=(y=ie.value)==null?void 0:y.offsetHeight)!=null?re:0;C>0&&w.reportHeight(u,C)}w.markSettled(u)}))})())}})}function q(t=!1){if(de||!xe||$)return;if(Q.value)return void(F=!0);const e=Math.max(120,Number(o.progressiveIntervalMs)||0),n=Date.now()-Ce;if(!t&&n<e)return F=!0,void(V==null&&(V=window.setTimeout(()=>{V=null,F&&(F=!1,q(!0))},Math.max(0,e-n))));de=!0;const d=()=>{de=!1,Ce=Date.now(),Ke()};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(d):setTimeout(d,0)}function Qe(){if(oe.value)try{const t=new Blob([O.value],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t);if(typeof document<"u"){const n=document.createElement("a");n.href=e,n.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(n),n.click(),document.body.removeChild(n)}URL.revokeObjectURL(e)}catch(t){console.error("Failed to export SVG:",t)}}function ce(){var t;const e=W.value;if(!e)return;const n=((t=e.firstElementChild)!=null?t:e).getBoundingClientRect().height;n>0&&(ke.value=n)}return K(()=>[o.node.code,o.loading,o.isDark,o.themeId,o.darkThemeId],()=>{q()},{immediate:!0}),K(()=>o.loading,(t,e)=>{e&&!t&&q(!0)}),K(()=>P.value,t=>{t&&q(!0)}),K(()=>[ne.value,O.value,M.value],()=>{fe(()=>{ce()})}),st(()=>{Be.value=!0,fe(()=>{ce()}),typeof ResizeObserver<"u"&&(U=new ResizeObserver(()=>{ce()}),W.value&&U.observe(W.value))}),dt(()=>{var t;$=!0,ue.value+=1,F=!1,(function(){const e=E;w&&e&&(E="",w.markSettled(e))})(),_.value="",(t=z.value)==null||t.destroy(),z.value=null,V!=null&&(clearTimeout(V),V=null),U==null||U.disconnect(),U=null}),(t,e)=>(v(),m("div",{ref_key:"viewportTarget",ref:ie,class:pe(["d2-block-container rounded-lg border overflow-hidden",{dark:o.isDark}]),"data-markstream-d2":"1","data-markstream-mode":ne.value?"fallback":"preview","data-markstream-pending":De.value?"true":void 0},[o.showHeader?(v(),m("div",Et,[e[16]||(e[16]=i("div",{class:"flex items-center gap-x-2"},[i("span",{class:"d2-label font-medium font-mono"},"D2")],-1)),i("div",Tt,[o.showModeToggle?(v(),m("div",At,[i("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",p.value?"":"is-active"]),onClick:e[0]||(e[0]=n=>Te("preview")),onMouseenter:e[1]||(e[1]=n=>T(n,f(r)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=n=>T(n,f(r)("common.preview")||"Preview")),onMouseleave:k,onBlur:k},R(f(r)("common.preview")||"Preview"),35),i("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",p.value?"is-active":""]),onClick:e[3]||(e[3]=n=>Te("source")),onMouseenter:e[4]||(e[4]=n=>T(n,f(r)("common.source")||"Source")),onFocus:e[5]||(e[5]=n=>T(n,f(r)("common.source")||"Source")),onMouseleave:k,onBlur:k},R(f(r)("common.source")||"Source"),35)])):j("",!0),o.showCopyButton?(v(),m("button",{key:1,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":H.value?f(r)("common.copied")||"Copied":f(r)("common.copy")||"Copy",onClick:Xe,onMouseenter:e[6]||(e[6]=n=>Ee(n)),onFocus:e[7]||(e[7]=n=>Ee(n)),onMouseleave:k,onBlur:k},[H.value?(v(),m("svg",Ot,[...e[13]||(e[13]=[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),m("svg",Ht,[...e[12]||(e[12]=[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),i("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,jt)):j("",!0),o.showExportButton&&oe.value?(v(),m("button",{key:2,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":f(r)("common.export")||"Export",onClick:Qe,onMouseenter:e[8]||(e[8]=n=>T(n,f(r)("common.export")||"Export")),onFocus:e[9]||(e[9]=n=>T(n,f(r)("common.export")||"Export")),onMouseleave:k,onBlur:k},[...e[14]||(e[14]=[i("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"})],-1)])],40,It)):j("",!0),o.showCollapseButton?(v(),m("button",{key:3,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-pressed":x.value,onClick:qe,onMouseenter:e[10]||(e[10]=n=>T(n,x.value?f(r)("common.expand")||"Expand":f(r)("common.collapse")||"Collapse")),onFocus:e[11]||(e[11]=n=>T(n,x.value?f(r)("common.expand")||"Expand":f(r)("common.collapse")||"Collapse")),onMouseleave:k,onBlur:k},[(v(),m("svg",{style:ge({rotate:x.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Pt)):j("",!0)])])):j("",!0),ct(i("div",{ref_key:"bodyRef",ref:W,class:"d2-block-body",style:ge(Ye.value)},[o.loading&&!se.value?(v(),m("div",Ft,[i("pre",St,[i("code",null,R(M.value),1)]),a.value?(v(),m("p",Nt,R(a.value),1)):j("",!0)])):(v(),m("div",Lt,[ne.value?(v(),m("div",Rt,[i("pre",_t,[i("code",null,R(M.value),1)]),a.value?(v(),m("p",$t,R(a.value),1)):j("",!0)])):(v(),m("div",{key:1,class:"d2-render",style:ge(ze.value)},[i("div",{class:"d2-svg",innerHTML:O.value},null,8,Vt),a.value?(v(),m("p",Yt,R(a.value),1)):j("",!0)],4))]))],4),[[vt,!x.value]])],10,Mt))}}),[["__scopeId","data-v-196847dc"]]);we.install=g=>{g.component(we.__name,we)};export{we as default};
1
+ import{d as at,z as ut,i as it,r as c,w as K,l as fe,p as st,o as dt,a as v,q as m,b as i,A as f,j as pe,t as R,x as j,n as ge,g as ct,v as vt,y as b}from"./vendor-vue-Ci9TYO_I.js";import{a as mt,l as ft,o as pt,f as gt,s as ht,d as yt,Y as Se,Z as wt,r as kt,P as bt,m as xt}from"./index-B9cemsjA.js";import"./index-BKJW0i9Q.js";var Bt=Object.defineProperty,Ne=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,Le=(g,o,s)=>o in g?Bt(g,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):g[o]=s,he=(g,o)=>{for(var s in o||(o={}))Dt.call(o,s)&&Le(g,s,o[s]);if(Ne)for(var s of Ne(o))Ct.call(o,s)&&Le(g,s,o[s]);return g},ye=(g,o,s)=>new Promise((w,r)=>{var H=h=>{try{p(s.next(h))}catch(a){r(a)}},x=h=>{try{p(s.throw(h))}catch(a){r(a)}},p=h=>h.done?w(h.value):Promise.resolve(h.value).then(H,x);p((s=s.apply(g,o)).next())});let Re=0;const Mt=["data-markstream-mode","data-markstream-pending"],Et={key:0,class:"d2-block-header flex justify-between items-center border-b"},Tt={class:"d2-header-actions flex items-center"},At={key:0,class:"d2-mode-toggle flex items-center gap-0.5"},jt=["aria-label"],Ht={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Ot={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},It=["aria-label"],Pt=["aria-pressed"],Ft={key:0,class:"d2-source"},St={class:"d2-code"},Nt={key:0,class:"d2-error mt-2 text-xs"},Lt={key:1},Rt={key:0,class:"d2-source"},_t={class:"d2-code"},$t={key:0,class:"d2-error mt-2 text-xs"},Vt=["innerHTML"],Yt={key:0,class:"d2-error px-4 pb-3 text-xs"},we=mt(at({__name:"D2BlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{default:void 0},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:{},darkThemeId:{},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(g){const o=g,s=ut(),w=it(ft,null),{t:r}=pt(),H=c(!1),x=c(!1),p=c(!1),h=c(!1),a=c(null),Q=c(!1),O=c(""),ae=c(""),ue=c(0),_=c(""),I=c(""),W=c(null),ke=c(null),ie=c(null),_e=gt(),ee=ht(),be=yt(),z=c(null),xe=typeof window<"u",Be=c(!1),P=c(typeof window>"u"||!be.value),M=b(()=>{var t;return(t=o.node.code)!=null?t:""}),$e=b(()=>xt(o,s)),te=b(()=>{var t,e;return[o.isDark?"dark":"light",(t=o.themeId)!=null?t:"auto",(e=o.darkThemeId)!=null?e:"auto",M.value].join(":")}),oe=b(()=>!!O.value&&ae.value===te.value),De=b(()=>{if(!Be.value||!M.value||p.value)return!1;const t=te.value;return!!Q.value||_.value!==t&&(!a.value||I.value!==t)}),se=b(()=>oe.value||!!O.value&&De.value),ne=b(()=>p.value||!h.value||!se.value),Ve=b(()=>{var t;return p.value||se.value?0:M.value?a.value&&I.value===te.value?0:(t=kt(o.estimatedPreviewHeightPx))!=null?t:0:0}),Ye=b(()=>{var t;if(!ne.value)return;const e=Math.max((t=ke.value)!=null?t:0,Ve.value);return e>0?{minHeight:`${e}px`}:void 0}),ze=b(()=>{if(o.maxHeight==="none")return{maxHeight:"none","--ms-d2-render-max-height":"none"};if(o.maxHeight!=null){const t=typeof o.maxHeight=="number"?`${o.maxHeight}px`:String(o.maxHeight);return{maxHeight:t,"--ms-d2-render-max-height":t}}});let B=null,de=!1,$=!1,Ce=0,V=null,F=!1,U=null,E="";typeof window<"u"&&K([()=>ie.value,be],([t,e])=>{var n,d,S;if((n=z.value)==null||n.destroy(),z.value=null,!e||P.value)return void(P.value=!0);if(!t)return void(P.value=!1);const le=(S=(d=ee==null?void 0:ee.value.heavyBlockMargin)!=null?d:ee==null?void 0:ee.value.rootMargin)!=null?S:"160px",D=_e(t,{rootMargin:le,allowIdle:!1});z.value=D,P.value=D.isVisible.value,D.whenVisible.then(()=>{P.value=!0})},{immediate:!0});const Ue={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function Me(t){return!t||t.disabled}function T(t,e,n="top"){if(Me(t.currentTarget))return;const d=t,S=(d==null?void 0:d.clientX)!=null&&(d==null?void 0:d.clientY)!=null?{x:d.clientX,y:d.clientY}:void 0;Se(t.currentTarget,e,n,!1,S,o.isDark)}function k(){wt()}function Ee(t){if(Me(t.currentTarget))return;const e=H.value?r("common.copied")||"Copied":r("common.copy")||"Copy",n=t,d=(n==null?void 0:n.clientX)!=null&&(n==null?void 0:n.clientY)!=null?{x:n.clientX,y:n.clientY}:void 0;Se(t.currentTarget,e,"top",!1,d,o.isDark)}function qe(){return ye(this,null,function*(){try{const t=M.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(t)),H.value=!0,setTimeout(()=>{H.value=!1},1e3)}catch(t){console.error("Copy failed:",t)}})}function Xe(){x.value=!x.value}function Te(t){p.value=t==="source"}const Ze=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],Ge=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function Je(t){if(!t)return"";const e=t.trim();return Ge.test(e)?e:""}function Ae(){O.value="",ae.value=""}function q(t){return $||t!==ue.value}function Ke(){return ye(this,null,function*(){var t,e,n,d,S,le;if(!xe||$||!P.value||o.loading&&!o.progressiveRender)return;const D=te.value;if(D===_.value&&!a.value&&oe.value)return h.value=!0,void(o.loading&&(p.value=!1));const je=M.value;if(!je)return Ae(),a.value=null,_.value="",void(I.value="");const Z=++ue.value;Q.value=!0,a.value=null,I.value="",(function(){const u=$e.value;w&&u&&E!==u&&(E&&w.markSettled(E),E=u,w.markPending(u))})();try{const u=yield(function(){return ye(this,null,function*(){if(B)return B;const l=yield bt();if($||!l)return null;if(typeof l=="function"){const G=new l;return G&&typeof G.compile=="function"?B=G:typeof l.compile=="function"&&(B=l),B}return l!=null&&l.D2&&typeof l.D2=="function"?(B=new l.D2,B):(typeof l.compile=="function"&&(B=l),B)})})();if(q(Z))return;if(!u)return h.value=!1,p.value=!0,Ae(),a.value="D2 is not available.",void(I.value=D);if(typeof u.compile!="function"||typeof u.render!="function")throw new TypeError("D2 instance is missing compile/render methods.");h.value=!0;const y=yield u.compile(je);if(q(Z))return;const re=(t=y==null?void 0:y.diagram)!=null?t:y,C=(n=(e=y==null?void 0:y.renderOptions)!=null?e:y==null?void 0:y.options)!=null?n:{},We=(d=o.themeId)!=null?d:C.themeID,He=(S=o.darkThemeId)!=null?S:C.darkThemeID,N=he({},C);if(N.themeID=o.isDark&&He!=null?He:We,N.darkThemeID=null,N.darkThemeOverrides=null,o.isDark){const l=C.themeOverrides&&typeof C.themeOverrides=="object"?C.themeOverrides:null;N.themeOverrides=he(he({},Ue),l||{})}N.salt=(le=N.salt)!=null?le:(function(l="markstream-vue-d2"){return Re+=1,`${l}-${Re}`})();const et=yield u.render(re,N);if(q(Z))return;const Oe=(function(l){return l?typeof l=="string"?l:typeof l.svg=="string"?l.svg:typeof l.data=="string"?l.data:"":""})(et);if(!Oe)throw new Error("D2 render returned empty output.");(function(l,G){const Ie=(function(Pe){if(typeof window>"u"||typeof DOMParser>"u"||!Pe)return"";const tt=Pe.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),ve=new DOMParser().parseFromString(tt,"image/svg+xml").documentElement;if(!ve||ve.nodeName.toLowerCase()!=="svg")return"";const me=ve;return(function(Fe){const ot=new Set(["script"]),nt=[Fe,...Array.from(Fe.querySelectorAll("*"))];for(const L of nt){if(ot.has(L.tagName.toLowerCase())){L.remove();continue}const lt=Array.from(L.attributes);for(const Y of lt){const A=Y.name;if(/^on/i.test(A))L.removeAttribute(A);else{if(A==="style"&&Y.value){const J=Y.value;if(Ze.some(rt=>rt.test(J))){L.removeAttribute(A);continue}}if((A==="href"||A==="xlink:href")&&Y.value){const J=Je(Y.value);if(!J){L.removeAttribute(A);continue}J!==Y.value&&L.setAttribute(A,J)}}}}})(me),me.classList.add("markstream-d2-root-svg"),me.outerHTML})(l);O.value=Ie||"",ae.value=Ie?G:""})(Oe,D),_.value=D,I.value="",o.loading&&(p.value=!1),a.value=null}catch(u){if(q(Z))return;const y=u!=null&&u.message?String(u.message):"D2 render failed.";o.loading||(a.value=y,I.value=D),_.value="",y.includes("@terrastruct/d2")&&(h.value=!1,p.value=!0)}finally{q(Z)||(Q.value=!1,F?(F=!1,X()):(function(){const u=E;w&&u&&(E="",fe(()=>{var y,re;if(!$){const C=(re=(y=ie.value)==null?void 0:y.offsetHeight)!=null?re:0;C>0&&w.reportHeight(u,C)}w.markSettled(u)}))})())}})}function X(t=!1){if(de||!xe||$)return;if(Q.value)return void(F=!0);const e=Math.max(120,Number(o.progressiveIntervalMs)||0),n=Date.now()-Ce;if(!t&&n<e)return F=!0,void(V==null&&(V=window.setTimeout(()=>{V=null,F&&(F=!1,X(!0))},Math.max(0,e-n))));de=!0;const d=()=>{de=!1,Ce=Date.now(),Ke()};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(d):setTimeout(d,0)}function Qe(){if(oe.value)try{const t=new Blob([O.value],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t);if(typeof document<"u"){const n=document.createElement("a");n.href=e,n.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(n),n.click(),document.body.removeChild(n)}URL.revokeObjectURL(e)}catch(t){console.error("Failed to export SVG:",t)}}function ce(){var t;const e=W.value;if(!e)return;const n=((t=e.firstElementChild)!=null?t:e).getBoundingClientRect().height;n>0&&(ke.value=n)}return K(()=>[o.node.code,o.loading,o.isDark,o.themeId,o.darkThemeId],()=>{X()},{immediate:!0}),K(()=>o.loading,(t,e)=>{e&&!t&&X(!0)}),K(()=>P.value,t=>{t&&X(!0)}),K(()=>[ne.value,O.value,M.value],()=>{fe(()=>{ce()})}),st(()=>{Be.value=!0,fe(()=>{ce()}),typeof ResizeObserver<"u"&&(U=new ResizeObserver(()=>{ce()}),W.value&&U.observe(W.value))}),dt(()=>{var t;$=!0,ue.value+=1,F=!1,(function(){const e=E;w&&e&&(E="",w.markSettled(e))})(),_.value="",(t=z.value)==null||t.destroy(),z.value=null,V!=null&&(clearTimeout(V),V=null),U==null||U.disconnect(),U=null}),(t,e)=>(v(),m("div",{ref_key:"viewportTarget",ref:ie,class:pe(["d2-block-container rounded-lg border overflow-hidden",{dark:o.isDark}]),"data-markstream-d2":"1","data-markstream-mode":ne.value?"fallback":"preview","data-markstream-pending":De.value?"true":void 0},[o.showHeader?(v(),m("div",Et,[e[16]||(e[16]=i("div",{class:"flex items-center gap-x-2"},[i("span",{class:"d2-label font-medium font-mono"},"D2")],-1)),i("div",Tt,[o.showModeToggle?(v(),m("div",At,[i("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",p.value?"":"is-active"]),onClick:e[0]||(e[0]=n=>Te("preview")),onMouseenter:e[1]||(e[1]=n=>T(n,f(r)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=n=>T(n,f(r)("common.preview")||"Preview")),onMouseleave:k,onBlur:k},R(f(r)("common.preview")||"Preview"),35),i("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",p.value?"is-active":""]),onClick:e[3]||(e[3]=n=>Te("source")),onMouseenter:e[4]||(e[4]=n=>T(n,f(r)("common.source")||"Source")),onFocus:e[5]||(e[5]=n=>T(n,f(r)("common.source")||"Source")),onMouseleave:k,onBlur:k},R(f(r)("common.source")||"Source"),35)])):j("",!0),o.showCopyButton?(v(),m("button",{key:1,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":H.value?f(r)("common.copied")||"Copied":f(r)("common.copy")||"Copy",onClick:qe,onMouseenter:e[6]||(e[6]=n=>Ee(n)),onFocus:e[7]||(e[7]=n=>Ee(n)),onMouseleave:k,onBlur:k},[H.value?(v(),m("svg",Ot,[...e[13]||(e[13]=[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),m("svg",Ht,[...e[12]||(e[12]=[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),i("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,jt)):j("",!0),o.showExportButton&&oe.value?(v(),m("button",{key:2,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":f(r)("common.export")||"Export",onClick:Qe,onMouseenter:e[8]||(e[8]=n=>T(n,f(r)("common.export")||"Export")),onFocus:e[9]||(e[9]=n=>T(n,f(r)("common.export")||"Export")),onMouseleave:k,onBlur:k},[...e[14]||(e[14]=[i("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"})],-1)])],40,It)):j("",!0),o.showCollapseButton?(v(),m("button",{key:3,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-pressed":x.value,onClick:Xe,onMouseenter:e[10]||(e[10]=n=>T(n,x.value?f(r)("common.expand")||"Expand":f(r)("common.collapse")||"Collapse")),onFocus:e[11]||(e[11]=n=>T(n,x.value?f(r)("common.expand")||"Expand":f(r)("common.collapse")||"Collapse")),onMouseleave:k,onBlur:k},[(v(),m("svg",{style:ge({rotate:x.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Pt)):j("",!0)])])):j("",!0),ct(i("div",{ref_key:"bodyRef",ref:W,class:"d2-block-body",style:ge(Ye.value)},[o.loading&&!se.value?(v(),m("div",Ft,[i("pre",St,[i("code",null,R(M.value),1)]),a.value?(v(),m("p",Nt,R(a.value),1)):j("",!0)])):(v(),m("div",Lt,[ne.value?(v(),m("div",Rt,[i("pre",_t,[i("code",null,R(M.value),1)]),a.value?(v(),m("p",$t,R(a.value),1)):j("",!0)])):(v(),m("div",{key:1,class:"d2-render",style:ge(ze.value)},[i("div",{class:"d2-svg",innerHTML:O.value},null,8,Vt),a.value?(v(),m("p",Yt,R(a.value),1)):j("",!0)],4))]))],4),[[vt,!x.value]])],10,Mt))}}),[["__scopeId","data-v-196847dc"]]);we.install=g=>{g.component(we.__name,we)};export{we as default};
@@ -1,2 +1,2 @@
1
- import{_ as a,l as s,I as n,e as i}from"./mermaid.core-Dx_GaOpJ.js";import{p}from"./cynefin-OW5HDTMX-C4xDBkC-.js";import"./index-BtvPmxLc.js";import"./vendor-vue-9TAdpIVM.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram
1
+ import{_ as a,l as s,L as n,e as i}from"./mermaid.core-BWfn-FFw.js";import{p}from"./cynefin-OW5HDTMX-C-fnPT_y.js";import"./index-BKJW0i9Q.js";import"./vendor-vue-Ci9TYO_I.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=n(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},w={parser:g,db:m,renderer:l};export{w as diagram};
@@ -1,9 +1,9 @@
1
- import{_ as o,c as ot,a4 as ut,I as dt,al as yt,z as ft,k as pt,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-Dx_GaOpJ.js";import"./index-BtvPmxLc.js";import"./vendor-vue-9TAdpIVM.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(F,"popStack");function j(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(j,"lex");for(var A,W,B,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,a4 as ut,L as dt,al as yt,A as ft,k as pt,q as it,a as gt,b as kt,g as mt,s as wt,t as _t,e as bt}from"./mermaid.core-BWfn-FFw.js";import"./index-BKJW0i9Q.js";import"./vendor-vue-Ci9TYO_I.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
5
5
  `+s+"^"},"showPosition"),test_match:o(function(t,s){var i,u,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),u=t[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var n in p)this[n]=p[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,s,i,u;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),n=0;n<p.length;n++)if(i=this._input.match(this.rules[p[n]]),i&&(!s||i[0].length>s[0].length)){if(s=i,u=n,this.options.backtrack_lexer){if(t=this.test_match(i,p[n]),t!==!1)return t;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(t=this.test_match(s,p[u]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var s=this.next();return s||this.lex()},"lex"),begin:o(function(s){this.conditionStack.push(s)},"begin"),popState:o(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:o(function(s){this.begin(s)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(s,i,u,p){switch(u){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return M})();N.lexer=O;function $(){this.yy={}}return o($,"Parser"),$.prototype=N,N.Parser=$,new $})();tt.parser=tt;var xt=tt,Z,vt=(Z=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,ft()}getRoot(){return this.root}addNode(h,r){const a=pt.sanitizeText(r,ot());if(!this.root){this.root={text:a,children:[]},this.stack=[{level:0,node:this.root}],it(a);return}this.baseLevel??(this.baseLevel=h);let l=h-this.baseLevel+1;for(l<=0&&(l=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=l;)this.stack.pop();const y=this.stack[this.stack.length-1].node,f={text:a,children:[]};y.children.push(f),this.stack.push({level:l,node:f})}getAccTitle(){return gt()}setAccTitle(h){kt(h)}getAccDescription(){return mt()}setAccDescription(h){wt(h)}getDiagramTitle(){return _t()}setDiagramTitle(h){it(h)}},o(Z,"IshikawaDB"),Z),St=14,G=250,$t=30,Et=60,At=5,ht=82*Math.PI/180,st=Math.cos(ht),nt=Math.sin(ht),at=o((e,h,r)=>{const a=e.node().getBBox(),l=a.width+h*2,y=a.height+h*2;bt(e,y,l,r),e.attr("viewBox",`${a.x-h} ${a.y-h} ${l} ${y}`)},"applyPaddedViewBox"),It=o((e,h,r,a)=>{var C,z;const y=a.db.getRoot();if(!y)return;const f=ot(),{look:d,handDrawnSeed:m,themeVariables:c}=f,k=ut(f.fontSize)[0]??St,g=d==="handDrawn",_=y.children??[],x=((C=f.ishikawa)==null?void 0:C.diagramPadding)??20,N=((z=f.ishikawa)==null?void 0:z.useMaxWidth)??!1,O=dt(h),$=O.append("g").attr("class","ishikawa"),M=g?yt.svg(O.node()):void 0,t=M?{roughSvg:M,seed:m??0,lineColor:(c==null?void 0:c.lineColor)??"#333",fillColor:(c==null?void 0:c.mainBkg)??"#fff"}:void 0,s=`ishikawa-arrow-${h}`;g||$.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,u=G;const p=g?void 0:U($,i,u,i,u,"ishikawa-spine");if(Lt($,i,u,y.text,k,t),!_.length){g&&U($,i,u,i,u,"ishikawa-spine",t),at(O,x,N);return}i-=20;const n=_.filter((T,D)=>D%2===0),v=_.filter((T,D)=>D%2===1),w=rt(n),I=rt(v),S=w.total+I.total;let L=G,E=G;if(S>0){const T=G*2,D=G*.3;L=Math.max(D,T*(w.total/S)),E=Math.max(D,T*(I.total/S))}const R=k*2;L=Math.max(L,w.max*R),E=Math.max(E,I.max*R),u=Math.max(L,G),p&&p.attr("y1",u).attr("y2",u),$.select(".ishikawa-head-group").attr("transform",`translate(0,${u})`);const b=Math.ceil(_.length/2);for(let T=0;T<b;T++){const D=$.append("g").attr("class","ishikawa-pair");for(const[F,j,A]of[[_[T*2],-1,L],[_[T*2+1],1,E]])F&&Pt(D,F,i,u,j,A,k,t);i=D.selectAll("text").nodes().reduce((F,j)=>Math.min(F,j.getBBox().x),1/0)}if(g)U($,i,u,0,u,"ishikawa-spine",t);else{p.attr("x1",i);const T=`url(#${s})`;$.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",T)}at(O,x,N)},"draw"),rt=o(e=>{const h=o(r=>r.children.reduce((a,l)=>a+1+h(l),0),"countDescendants");return e.reduce((r,a)=>{const l=h(a);return r.total+=l,r.max=Math.max(r.max,l),r},{total:0,max:0})},"sideStats"),Lt=o((e,h,r,a,l,y)=>{const f=Math.max(6,Math.floor(110/(l*.6))),d=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${h},${r})`),m=q(d,ct(a,f),0,0,"ishikawa-head-label","start",l),c=m.node().getBBox(),k=Math.max(60,c.width+6),g=Math.max(40,c.height*2+40),_=`M 0 ${-g/2} L 0 ${g/2} Q ${k*2.4} 0 0 ${-g/2} Z`;if(y){const x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});d.insert(()=>x,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);m.attr("transform",`translate(${(k-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),Tt=o((e,h)=>{const r=[],a=[],l=o((y,f,d)=>{const m=h===-1?[...y].reverse():y;for(const c of m){const k=r.length,g=c.children??[];r.push({depth:d,text:ct(c.text,15),parentIndex:f,childCount:g.length}),d%2===0?(a.push(k),g.length&&l(g,k,d+1)):(g.length&&l(g,k,d+1),a.push(k))}},"walk");return l(e,-1,2),{entries:r,yOrder:a}},"flattenTree"),Mt=o((e,h,r,a,l,y,f)=>{const d=e.append("g").attr("class","ishikawa-label-group"),c=q(d,h,r,a+11*l,"ishikawa-label cause","middle",y).node().getBBox();if(f){const k=f.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:f.seed,fill:f.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:f.lineColor,strokeWidth:2});d.insert(()=>k,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",c.x-20).attr("y",c.y-2).attr("width",c.width+40).attr("height",c.height+4)},"drawCauseLabel"),J=o((e,h,r,a,l,y)=>{const f=Math.sqrt(a*a+l*l);if(f===0)return;const d=a/f,m=l/f,c=6,k=-m*c,g=d*c,_=h,x=r,N=`M ${_} ${x} L ${_-d*c*2+k} ${x-m*c*2+g} L ${_-d*c*2-k} ${x-m*c*2-g} Z`,O=y.roughSvg.path(N,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});e.append(()=>O)},"drawArrowMarker"),Pt=o((e,h,r,a,l,y,f,d)=>{const m=h.children??[],c=y*(m.length?1:.2),k=-st*c,g=nt*c*l,_=r+k,x=a+g;if(U(e,r,a,_,x,"ishikawa-branch",d),d&&J(e,r,a,r-_,a-x,d),Mt(e,h.text,_,x,l,f,d),!m.length)return;const{entries:N,yOrder:O}=Tt(m,l),$=N.length,M=new Array($);for(const[p,n]of O.entries())M[n]=a+g*((p+1)/($+1));const t=new Map;t.set(-1,{x0:r,y0:a,x1:_,y1:x,childCount:m.length,childrenDrawn:0});const s=-st,i=nt*l,u=l<0?"ishikawa-label up":"ishikawa-label down";for(const[p,n]of N.entries()){const v=M[p],w=t.get(n.parentIndex),I=e.append("g").attr("class","ishikawa-sub-group");let S=0,L=0,E=0;if(n.depth%2===0){const R=w.y1-w.y0;S=lt(w.x0,w.x1,R?(v-w.y0)/R:.5),L=v,E=S-(n.childCount>0?Et+n.childCount*At:$t),U(I,S,v,E,v,"ishikawa-sub-branch",d),d&&J(I,S,v,1,0,d),q(I,n.text,E,v,"ishikawa-label align","end",f)}else{const R=w.childrenDrawn++;S=lt(w.x0,w.x1,(w.childCount-R)/(w.childCount+1)),L=w.y0,E=S+s*((v-L)/i),U(I,S,L,E,v,"ishikawa-sub-branch",d),d&&J(I,S,L,S-E,L-v,d),q(I,n.text,E,v,u,"end",f)}n.childCount>0&&t.set(p,{x0:S,y0:L,x1:E,y1:v,childCount:n.childCount,childrenDrawn:0})}},"drawBranch"),Bt=o(e=>e.split(/<br\s*\/?>|\n/),"splitLines"),ct=o((e,h)=>{if(e.length<=h)return e;const r=[];for(const a of e.split(/\s+/)){const l=r.length-1;l>=0&&r[l].length+1+a.length<=h?r[l]+=" "+a:r.push(a)}return r.join(`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var s=this.next();return s||this.lex()},"lex"),begin:o(function(s){this.conditionStack.push(s)},"begin"),popState:o(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:o(function(s){this.begin(s)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(s,i,u,p){switch(u){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return M})();N.lexer=O;function $(){this.yy={}}return o($,"Parser"),$.prototype=N,N.Parser=$,new $})();tt.parser=tt;var xt=tt,Z,vt=(Z=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,ft()}getRoot(){return this.root}addNode(h,r){const a=pt.sanitizeText(r,ot());if(!this.root){this.root={text:a,children:[]},this.stack=[{level:0,node:this.root}],it(a);return}this.baseLevel??(this.baseLevel=h);let l=h-this.baseLevel+1;for(l<=0&&(l=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=l;)this.stack.pop();const y=this.stack[this.stack.length-1].node,f={text:a,children:[]};y.children.push(f),this.stack.push({level:l,node:f})}getAccTitle(){return gt()}setAccTitle(h){kt(h)}getAccDescription(){return mt()}setAccDescription(h){wt(h)}getDiagramTitle(){return _t()}setDiagramTitle(h){it(h)}},o(Z,"IshikawaDB"),Z),St=14,G=250,$t=30,Et=60,At=5,ht=82*Math.PI/180,st=Math.cos(ht),nt=Math.sin(ht),at=o((e,h,r)=>{const a=e.node().getBBox(),l=a.width+h*2,y=a.height+h*2;bt(e,y,l,r),e.attr("viewBox",`${a.x-h} ${a.y-h} ${l} ${y}`)},"applyPaddedViewBox"),It=o((e,h,r,a)=>{var C,F;const y=a.db.getRoot();if(!y)return;const f=ot(),{look:d,handDrawnSeed:m,themeVariables:c}=f,k=ut(f.fontSize)[0]??St,g=d==="handDrawn",_=y.children??[],x=((C=f.ishikawa)==null?void 0:C.diagramPadding)??20,N=((F=f.ishikawa)==null?void 0:F.useMaxWidth)??!1,O=dt(h),$=O.append("g").attr("class","ishikawa"),M=g?yt.svg(O.node()):void 0,t=M?{roughSvg:M,seed:m??0,lineColor:(c==null?void 0:c.lineColor)??"#333",fillColor:(c==null?void 0:c.mainBkg)??"#fff"}:void 0,s=`ishikawa-arrow-${h}`;g||$.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,u=G;const p=g?void 0:U($,i,u,i,u,"ishikawa-spine");if(Lt($,i,u,y.text,k,t),!_.length){g&&U($,i,u,i,u,"ishikawa-spine",t),at(O,x,N);return}i-=20;const n=_.filter((T,D)=>D%2===0),v=_.filter((T,D)=>D%2===1),w=rt(n),I=rt(v),S=w.total+I.total;let L=G,E=G;if(S>0){const T=G*2,D=G*.3;L=Math.max(D,T*(w.total/S)),E=Math.max(D,T*(I.total/S))}const R=k*2;L=Math.max(L,w.max*R),E=Math.max(E,I.max*R),u=Math.max(L,G),p&&p.attr("y1",u).attr("y2",u),$.select(".ishikawa-head-group").attr("transform",`translate(0,${u})`);const b=Math.ceil(_.length/2);for(let T=0;T<b;T++){const D=$.append("g").attr("class","ishikawa-pair");for(const[j,z,A]of[[_[T*2],-1,L],[_[T*2+1],1,E]])j&&Pt(D,j,i,u,z,A,k,t);i=D.selectAll("text").nodes().reduce((j,z)=>Math.min(j,z.getBBox().x),1/0)}if(g)U($,i,u,0,u,"ishikawa-spine",t);else{p.attr("x1",i);const T=`url(#${s})`;$.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",T)}at(O,x,N)},"draw"),rt=o(e=>{const h=o(r=>r.children.reduce((a,l)=>a+1+h(l),0),"countDescendants");return e.reduce((r,a)=>{const l=h(a);return r.total+=l,r.max=Math.max(r.max,l),r},{total:0,max:0})},"sideStats"),Lt=o((e,h,r,a,l,y)=>{const f=Math.max(6,Math.floor(110/(l*.6))),d=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${h},${r})`),m=q(d,ct(a,f),0,0,"ishikawa-head-label","start",l),c=m.node().getBBox(),k=Math.max(60,c.width+6),g=Math.max(40,c.height*2+40),_=`M 0 ${-g/2} L 0 ${g/2} Q ${k*2.4} 0 0 ${-g/2} Z`;if(y){const x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});d.insert(()=>x,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);m.attr("transform",`translate(${(k-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),Tt=o((e,h)=>{const r=[],a=[],l=o((y,f,d)=>{const m=h===-1?[...y].reverse():y;for(const c of m){const k=r.length,g=c.children??[];r.push({depth:d,text:ct(c.text,15),parentIndex:f,childCount:g.length}),d%2===0?(a.push(k),g.length&&l(g,k,d+1)):(g.length&&l(g,k,d+1),a.push(k))}},"walk");return l(e,-1,2),{entries:r,yOrder:a}},"flattenTree"),Mt=o((e,h,r,a,l,y,f)=>{const d=e.append("g").attr("class","ishikawa-label-group"),c=q(d,h,r,a+11*l,"ishikawa-label cause","middle",y).node().getBBox();if(f){const k=f.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:f.seed,fill:f.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:f.lineColor,strokeWidth:2});d.insert(()=>k,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",c.x-20).attr("y",c.y-2).attr("width",c.width+40).attr("height",c.height+4)},"drawCauseLabel"),J=o((e,h,r,a,l,y)=>{const f=Math.sqrt(a*a+l*l);if(f===0)return;const d=a/f,m=l/f,c=6,k=-m*c,g=d*c,_=h,x=r,N=`M ${_} ${x} L ${_-d*c*2+k} ${x-m*c*2+g} L ${_-d*c*2-k} ${x-m*c*2-g} Z`,O=y.roughSvg.path(N,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});e.append(()=>O)},"drawArrowMarker"),Pt=o((e,h,r,a,l,y,f,d)=>{const m=h.children??[],c=y*(m.length?1:.2),k=-st*c,g=nt*c*l,_=r+k,x=a+g;if(U(e,r,a,_,x,"ishikawa-branch",d),d&&J(e,r,a,r-_,a-x,d),Mt(e,h.text,_,x,l,f,d),!m.length)return;const{entries:N,yOrder:O}=Tt(m,l),$=N.length,M=new Array($);for(const[p,n]of O.entries())M[n]=a+g*((p+1)/($+1));const t=new Map;t.set(-1,{x0:r,y0:a,x1:_,y1:x,childCount:m.length,childrenDrawn:0});const s=-st,i=nt*l,u=l<0?"ishikawa-label up":"ishikawa-label down";for(const[p,n]of N.entries()){const v=M[p],w=t.get(n.parentIndex),I=e.append("g").attr("class","ishikawa-sub-group");let S=0,L=0,E=0;if(n.depth%2===0){const R=w.y1-w.y0;S=lt(w.x0,w.x1,R?(v-w.y0)/R:.5),L=v,E=S-(n.childCount>0?Et+n.childCount*At:$t),U(I,S,v,E,v,"ishikawa-sub-branch",d),d&&J(I,S,v,1,0,d),q(I,n.text,E,v,"ishikawa-label align","end",f)}else{const R=w.childrenDrawn++;S=lt(w.x0,w.x1,(w.childCount-R)/(w.childCount+1)),L=w.y0,E=S+s*((v-L)/i),U(I,S,L,E,v,"ishikawa-sub-branch",d),d&&J(I,S,L,S-E,L-v,d),q(I,n.text,E,v,u,"end",f)}n.childCount>0&&t.set(p,{x0:S,y0:L,x1:E,y1:v,childCount:n.childCount,childrenDrawn:0})}},"drawBranch"),Bt=o(e=>e.split(/<br\s*\/?>|\n/),"splitLines"),ct=o((e,h)=>{if(e.length<=h)return e;const r=[];for(const a of e.split(/\s+/)){const l=r.length-1;l>=0&&r[l].length+1+a.length<=h?r[l]+=" "+a:r.push(a)}return r.join(`
7
7
  `)},"wrapText"),q=o((e,h,r,a,l,y,f)=>{const d=Bt(h),m=f*1.05,c=e.append("text").attr("class",l).attr("text-anchor",y).attr("x",r).attr("y",a-(d.length-1)*m/2);for(const[k,g]of d.entries())c.append("tspan").attr("x",r).attr("dy",k===0?0:m).text(g);return c},"drawMultilineText"),lt=o((e,h,r)=>e+(h-e)*r,"lerp"),U=o((e,h,r,a,l,y,f)=>{if(f){const d=f.roughSvg.line(h,r,a,l,{roughness:1.5,seed:f.seed,stroke:f.lineColor,strokeWidth:2});e.append(()=>d).attr("class",y);return}return e.append("line").attr("class",y).attr("x1",h).attr("y1",r).attr("x2",a).attr("y2",l)},"drawLine"),Nt={draw:It},Dt=o(e=>`
8
8
  .ishikawa .ishikawa-spine,
9
9
  .ishikawa .ishikawa-branch,
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./chunk-FMBD7UC4-Ctw2_biG.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-CglIMpot.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as X,e as $t,z as Mt}from"./mermaid.core-Dx_GaOpJ.js";import{d as it}from"./arc-BDSDdwDv.js";import"./index-BtvPmxLc.js";import"./vendor-vue-9TAdpIVM.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-FMBD7UC4-Q206iq7t.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-BEHXSkEZ.js";import{g as _t,s as vt,a as bt,b as wt,t as Tt,q as St,_ as s,c as R,d as X,e as $t,A as Mt}from"./mermaid.core-BWfn-FFw.js";import{d as it}from"./arc-cA0USBj0.js";import"./index-BKJW0i9Q.js";import"./vendor-vue-Ci9TYO_I.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,14 +1,14 @@
1
- import{_ as c,l as te,c as W,I as fe,ah as ye,ai as be,aj as me,af as _e,G as Y,i as F,t as ke,ac as Ee,ad as le,ae as ce,J as Se}from"./mermaid.core-Dx_GaOpJ.js";import{g as Ne}from"./chunk-FMBD7UC4-Ctw2_biG.js";import"./index-BtvPmxLc.js";import"./vendor-vue-9TAdpIVM.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],j=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:j}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:j}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
1
+ import{_ as c,l as te,c as W,L as fe,ah as ye,ai as be,aj as me,af as _e,I as Y,i as G,v as ke,ac as Ee,ad as le,ae as ce,J as Se}from"./mermaid.core-BWfn-FFw.js";import{g as Ne}from"./chunk-FMBD7UC4-Q206iq7t.js";import"./index-BKJW0i9Q.js";import"./vendor-vue-Ci9TYO_I.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],j=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:j}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:j}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
2
2
  `+m.showPosition()+`
3
- Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
3
+ Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
5
  `+n+"^"},"showPosition"),test_match:c(function(s,n){var a,o,u;if(this.options.backtrack_lexer&&(u={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(u.yylloc.range=this.yylloc.range.slice(0))),o=s[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],a=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var e in u)this[e]=u[e];return!1}return!1},"test_match"),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,n,a,o;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),e=0;e<u.length;e++)if(a=this._input.match(this.rules[u[e]]),a&&(!n||a[0].length>n[0].length)){if(n=a,o=e,this.options.backtrack_lexer){if(s=this.test_match(a,u[e]),s!==!1)return s;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(s=this.test_match(n,u[o]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:c(function(){var n=this.next();return n||this.lex()},"lex"),begin:c(function(n){this.conditionStack.push(n)},"begin"),popState:c(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:c(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:c(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:c(function(n){this.begin(n)},"pushState"),stateStackSize:c(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:c(function(n,a,o,u){switch(o){case 0:return this.pushState("shapeData"),a.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const e=/\n\s*/g;return a.yytext=a.yytext.replace(e,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",a.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",a.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",a.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",a.yytext),21;case 42:return n.getLogger().trace("Long description:",a.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return _})();V.lexer=y;function O(){this.yy={}}return c(O,"Parser"),O.prototype=V,V.Parser=O,new O})();$.parser=$;var xe=$,D=[],ne=[],ee=0,se={},ve=c(()=>{D=[],ne=[],ee=0,se={}},"clear"),De=c(t=>{if(D.length===0)return null;const g=D[0].level;let d=null;for(let r=D.length-1;r>=0;r--)if(D[r].level===g&&!d&&(d=D[r]),D[r].level<g)throw new Error('Items without section detected, found section ("'+D[r].label+'")');return t===(d==null?void 0:d.level)?null:d},"getSection"),he=c(function(){return ne},"getSections"),Le=c(function(){const t=[],g=[],d=he(),r=W();for(const p of d){const k={id:p.id,label:F(p.label??"",r),labelType:"markdown",isGroup:!0,ticket:p.ticket,shape:"kanbanSection",level:p.level,look:r.look};g.push(k);const f=D.filter(h=>h.parentId===p.id);for(const h of f){const L={id:h.id,parentId:p.id,label:F(h.label??"",r),labelType:"markdown",isGroup:!1,ticket:h==null?void 0:h.ticket,priority:h==null?void 0:h.priority,assigned:h==null?void 0:h.assigned,icon:h==null?void 0:h.icon,shape:"kanbanItem",level:h.level,rx:5,ry:5,cssStyles:["text-align: left"]};g.push(L)}}return{nodes:g,edges:t,other:{},config:W()}},"getData"),Oe=c((t,g,d,r,p)=>{var C,w;const k=W();let f=((C=k.mindmap)==null?void 0:C.padding)??Y.mindmap.padding;switch(r){case b.ROUNDED_RECT:case b.RECT:case b.HEXAGON:f*=2}const h={id:F(g,k)||"kbn"+ee++,level:t,label:F(d,k),width:((w=k.mindmap)==null?void 0:w.maxNodeWidth)??Y.mindmap.maxNodeWidth,padding:f,isGroup:!1};if(p!==void 0){let N;p.includes(`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:c(function(){var n=this.next();return n||this.lex()},"lex"),begin:c(function(n){this.conditionStack.push(n)},"begin"),popState:c(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:c(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:c(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:c(function(n){this.begin(n)},"pushState"),stateStackSize:c(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:c(function(n,a,o,u){switch(o){case 0:return this.pushState("shapeData"),a.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const e=/\n\s*/g;return a.yytext=a.yytext.replace(e,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",a.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",a.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",a.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",a.yytext),21;case 42:return n.getLogger().trace("Long description:",a.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return _})();V.lexer=y;function O(){this.yy={}}return c(O,"Parser"),O.prototype=V,V.Parser=O,new O})();$.parser=$;var xe=$,D=[],ne=[],ee=0,se={},ve=c(()=>{D=[],ne=[],ee=0,se={}},"clear"),De=c(t=>{if(D.length===0)return null;const g=D[0].level;let d=null;for(let r=D.length-1;r>=0;r--)if(D[r].level===g&&!d&&(d=D[r]),D[r].level<g)throw new Error('Items without section detected, found section ("'+D[r].label+'")');return t===(d==null?void 0:d.level)?null:d},"getSection"),he=c(function(){return ne},"getSections"),Le=c(function(){const t=[],g=[],d=he(),r=W();for(const p of d){const k={id:p.id,label:G(p.label??"",r),labelType:"markdown",isGroup:!0,ticket:p.ticket,shape:"kanbanSection",level:p.level,look:r.look};g.push(k);const f=D.filter(h=>h.parentId===p.id);for(const h of f){const L={id:h.id,parentId:p.id,label:G(h.label??"",r),labelType:"markdown",isGroup:!1,ticket:h==null?void 0:h.ticket,priority:h==null?void 0:h.priority,assigned:h==null?void 0:h.assigned,icon:h==null?void 0:h.icon,shape:"kanbanItem",level:h.level,rx:5,ry:5,cssStyles:["text-align: left"]};g.push(L)}}return{nodes:g,edges:t,other:{},config:W()}},"getData"),Oe=c((t,g,d,r,p)=>{var C,w;const k=W();let f=((C=k.mindmap)==null?void 0:C.padding)??Y.mindmap.padding;switch(r){case b.ROUNDED_RECT:case b.RECT:case b.HEXAGON:f*=2}const h={id:G(g,k)||"kbn"+ee++,level:t,label:G(d,k),width:((w=k.mindmap)==null?void 0:w.maxNodeWidth)??Y.mindmap.maxNodeWidth,padding:f,isGroup:!1};if(p!==void 0){let N;p.includes(`
7
7
  `)?N=p+`
8
8
  `:N=`{
9
9
  `+p+`
10
- }`;const i=ke(N,{schema:Se});if(i.shape&&(i.shape!==i.shape.toLowerCase()||i.shape.includes("_")))throw new Error(`No such shape: ${i.shape}. Shape names should be lowercase.`);i!=null&&i.shape&&i.shape==="kanbanItem"&&(h.shape=i==null?void 0:i.shape),i!=null&&i.label&&(h.label=i==null?void 0:i.label),i!=null&&i.icon&&(h.icon=i==null?void 0:i.icon.toString()),i!=null&&i.assigned&&(h.assigned=i==null?void 0:i.assigned.toString()),i!=null&&i.ticket&&(h.ticket=i==null?void 0:i.ticket.toString()),i!=null&&i.priority&&(h.priority=i==null?void 0:i.priority)}const L=De(t);L?h.parentId=L.id||"kbn"+ee++:ne.push(h),D.push(h)},"addNode"),b={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=c((t,g)=>{switch(te.debug("In get type",t,g),t){case"[":return b.RECT;case"(":return g===")"?b.ROUNDED_RECT:b.CLOUD;case"((":return b.CIRCLE;case")":return b.CLOUD;case"))":return b.BANG;case"{{":return b.HEXAGON;default:return b.DEFAULT}},"getType"),Ce=c((t,g)=>{se[t]=g},"setElementForId"),we=c(t=>{if(!t)return;const g=W(),d=D[D.length-1];t.icon&&(d.icon=F(t.icon,g)),t.class&&(d.cssClasses=F(t.class,g))},"decorateNode"),Ae=c(t=>{switch(t){case b.DEFAULT:return"no-border";case b.RECT:return"rect";case b.ROUNDED_RECT:return"rounded-rect";case b.CIRCLE:return"circle";case b.CLOUD:return"cloud";case b.BANG:return"bang";case b.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=c(()=>te,"getLogger"),Re=c(t=>se[t],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:b,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=c(async(t,g,d,r)=>{var M,U,A,H,V;te.debug(`Rendering kanban diagram
11
- `+t);const k=r.db.getData(),f=W();f.htmlLabels=!1;const h=fe(g);for(const y of k.nodes)y.domId=`${g}-${y.id}`;const L=h.append("g");L.attr("class","sections");const C=h.append("g");C.attr("class","items");const w=k.nodes.filter(y=>y.isGroup);let N=0;const i=10,j=[];let x=25;for(const y of w){const O=((M=f==null?void 0:f.kanban)==null?void 0:M.sectionWidth)||200;N=N+1,y.x=O*N+(N-1)*i/2,y.width=O,y.y=0,y.height=O*3,y.rx=5,y.ry=5,y.cssClasses=y.cssClasses+" section-"+N;const _=await ye(L,y);x=Math.max(x,(U=_==null?void 0:_.labelBBox)==null?void 0:U.height),j.push(_)}let P=0;for(const y of w){const O=j[P];P=P+1;const _=((A=f==null?void 0:f.kanban)==null?void 0:A.sectionWidth)||200,s=-_*3/2+x;let n=s;const a=k.nodes.filter(e=>e.parentId===y.id);for(const e of a){if(e.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");e.x=y.x,e.width=_-1.5*i;const l=(await be(C,e,{config:f})).node().getBBox();e.y=n+l.height/2,await me(e),n=e.y+l.height/2+i/2}const o=O.cluster.select("rect"),u=Math.max(n-s+3*i,50)+(x-25);o.attr("height",u)}_e(void 0,h,((H=f.mindmap)==null?void 0:H.padding)??Y.kanban.padding,((V=f.mindmap)==null?void 0:V.useMaxWidth)??Y.kanban.useMaxWidth)},"draw"),Ge={draw:Be},Fe=c(t=>{let g="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++)t["lineColor"+r]=t["lineColor"+r]||t["cScaleInv"+r],Ee(t["lineColor"+r])?t["lineColor"+r]=le(t["lineColor"+r],20):t["lineColor"+r]=ce(t["lineColor"+r],20);const d=c((r,p)=>t.darkMode?ce(r,p):le(r,p),"adjuster");for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const p=""+(17-3*r);g+=`
10
+ }`;const i=ke(N,{schema:Se});if(i.shape&&(i.shape!==i.shape.toLowerCase()||i.shape.includes("_")))throw new Error(`No such shape: ${i.shape}. Shape names should be lowercase.`);i!=null&&i.shape&&i.shape==="kanbanItem"&&(h.shape=i==null?void 0:i.shape),i!=null&&i.label&&(h.label=i==null?void 0:i.label),i!=null&&i.icon&&(h.icon=i==null?void 0:i.icon.toString()),i!=null&&i.assigned&&(h.assigned=i==null?void 0:i.assigned.toString()),i!=null&&i.ticket&&(h.ticket=i==null?void 0:i.ticket.toString()),i!=null&&i.priority&&(h.priority=i==null?void 0:i.priority)}const L=De(t);L?h.parentId=L.id||"kbn"+ee++:ne.push(h),D.push(h)},"addNode"),b={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=c((t,g)=>{switch(te.debug("In get type",t,g),t){case"[":return b.RECT;case"(":return g===")"?b.ROUNDED_RECT:b.CLOUD;case"((":return b.CIRCLE;case")":return b.CLOUD;case"))":return b.BANG;case"{{":return b.HEXAGON;default:return b.DEFAULT}},"getType"),Ce=c((t,g)=>{se[t]=g},"setElementForId"),we=c(t=>{if(!t)return;const g=W(),d=D[D.length-1];t.icon&&(d.icon=G(t.icon,g)),t.class&&(d.cssClasses=G(t.class,g))},"decorateNode"),Ae=c(t=>{switch(t){case b.DEFAULT:return"no-border";case b.RECT:return"rect";case b.ROUNDED_RECT:return"rounded-rect";case b.CIRCLE:return"circle";case b.CLOUD:return"cloud";case b.BANG:return"bang";case b.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=c(()=>te,"getLogger"),Re=c(t=>se[t],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:b,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=c(async(t,g,d,r)=>{var M,U,A,H,V;te.debug(`Rendering kanban diagram
11
+ `+t);const k=r.db.getData(),f=W();f.htmlLabels=!1;const h=fe(g);for(const y of k.nodes)y.domId=`${g}-${y.id}`;const L=h.append("g");L.attr("class","sections");const C=h.append("g");C.attr("class","items");const w=k.nodes.filter(y=>y.isGroup);let N=0;const i=10,j=[];let x=25;for(const y of w){const O=((M=f==null?void 0:f.kanban)==null?void 0:M.sectionWidth)||200;N=N+1,y.x=O*N+(N-1)*i/2,y.width=O,y.y=0,y.height=O*3,y.rx=5,y.ry=5,y.cssClasses=y.cssClasses+" section-"+N;const _=await ye(L,y);x=Math.max(x,(U=_==null?void 0:_.labelBBox)==null?void 0:U.height),j.push(_)}let P=0;for(const y of w){const O=j[P];P=P+1;const _=((A=f==null?void 0:f.kanban)==null?void 0:A.sectionWidth)||200,s=-_*3/2+x;let n=s;const a=k.nodes.filter(e=>e.parentId===y.id);for(const e of a){if(e.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");e.x=y.x,e.width=_-1.5*i;const l=(await be(C,e,{config:f})).node().getBBox();e.y=n+l.height/2,await me(e),n=e.y+l.height/2+i/2}const o=O.cluster.select("rect"),u=Math.max(n-s+3*i,50)+(x-25);o.attr("height",u)}_e(void 0,h,((H=f.mindmap)==null?void 0:H.padding)??Y.kanban.padding,((V=f.mindmap)==null?void 0:V.useMaxWidth)??Y.kanban.useMaxWidth)},"draw"),Fe={draw:Be},Ge=c(t=>{let g="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++)t["lineColor"+r]=t["lineColor"+r]||t["cScaleInv"+r],Ee(t["lineColor"+r])?t["lineColor"+r]=le(t["lineColor"+r],20):t["lineColor"+r]=ce(t["lineColor"+r],20);const d=c((r,p)=>t.darkMode?ce(r,p):le(r,p),"adjuster");for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const p=""+(17-3*r);g+=`
12
12
  .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} polygon, .section-${r-1} path {
13
13
  fill: ${d(t["cScale"+r],10)};
14
14
  stroke: ${d(t["cScale"+r],10)};
@@ -58,7 +58,7 @@ Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on
58
58
  .edge {
59
59
  stroke-width: 3;
60
60
  }
61
- ${Fe(t)}
61
+ ${Ge(t)}
62
62
  .section-root rect, .section-root path, .section-root circle, .section-root polygon {
63
63
  fill: ${t.git0};
64
64
  }
@@ -86,4 +86,4 @@ Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on
86
86
  text-align: center;
87
87
  }
88
88
  ${Ne()}
89
- `,"getStyles"),Me=je,Xe={db:Ve,renderer:Ge,parser:xe,styles:Me};export{Xe as diagram};
89
+ `,"getStyles"),Me=je,Xe={db:Ve,renderer:Fe,parser:xe,styles:Me};export{Xe as diagram};
@@ -1 +1 @@
1
- import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-Dx_GaOpJ.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
1
+ import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-BWfn-FFw.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BeRBs4X9.js","assets/index-BtvPmxLc.js","assets/vendor-vue-9TAdpIVM.js","assets/index-QWsLY5HH.css"])))=>i.map(i=>d[i]);
2
- var Y=Object.defineProperty;var Z=(e,i,t)=>i in e?Y(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var f=(e,i,t)=>Z(e,typeof i!="symbol"?i+"":i,t);import{_ as ee}from"./index-BtvPmxLc.js";import"./vendor-vue-9TAdpIVM.js";var ie=class{constructor(){f(this,"chunks",[]);f(this,"cached","");f(this,"dirty",!1);f(this,"length",0)}append(e){e&&(this.chunks.push(e),this.length+=e.length,this.dirty=!0,this.chunks.length>256&&this.compact())}clear(e=""){this.chunks=e?[e]:[],this.cached=e,this.dirty=!1,this.length=e.length}toString(){return this.dirty&&(this.cached=this.chunks.join(""),this.dirty=!1),this.cached}compact(){this.chunks=[this.chunks.join("")]}};function H(e,i){e.replaceChildren();const t=document.createElement("div");t.className="stream-diffs-shell",t.style.overflow="auto",t.style.maxHeight=typeof i=="number"?`${i}px`:i??"none";const n=document.createElement("div");return n.className="stream-diffs-surface",t.appendChild(n),e.appendChild(t),{shell:t,surface:n}}function L(e,i,t){return{name:e,contents:i,lang:t}}var te=class{constructor(e){f(this,"input");f(this,"container");f(this,"surface");f(this,"instance");f(this,"diff");f(this,"selectedLines",null);f(this,"disposed",!1);f(this,"renderListeners",new Set);f(this,"visualRevision",0);f(this,"visualReadyPromise",Promise.resolve(!1));f(this,"resolveVisualReady");f(this,"module");this.input=e}async mount(e){this.disposed=!1,this.container=e,this.surface=H(e).surface,await this.render()}async update(e){this.input=e,this.surface&&await this.render(!0)}updateFile(e,i){return this.update({kind:"file",file:e,annotations:i,options:this.input.kind==="file"?this.input.options:void 0,workerManager:this.input.kind==="file"?this.input.workerManager:void 0})}updateDiff(e,i,t){return this.update({kind:"diff",oldFile:e,newFile:i,annotations:t,options:k(this.input)?this.input.options:void 0,workerManager:k(this.input)?this.input.workerManager:void 0})}updateParsedDiff(e,i){return this.update({kind:"diff",fileDiff:e,annotations:i,options:k(this.input)?this.input.options:void 0,workerManager:k(this.input)?this.input.workerManager:void 0})}updatePatch(e,i=0,t,n=0){return this.update({kind:"patch",patch:e,patchIndex:n,fileIndex:i,annotations:t,options:this.input.kind==="patch"?this.input.options:void 0,workerManager:this.input.kind==="patch"?this.input.workerManager:void 0})}updateMergeConflict(e,i){return this.update({kind:"merge-conflict",file:e,annotations:i,options:this.input.kind==="merge-conflict"?this.input.options:void 0,workerManager:this.input.kind==="merge-conflict"?this.input.workerManager:void 0})}setSelectedLines(e){var i;this.selectedLines=e,(i=this.instance)==null||i.setSelectedLines(e)}setAnnotations(e){this.instance&&(this.input.kind==="file"?(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)):(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)),this.emitRender())}setThemeType(e){var i;this.input.options?this.input.options={...this.input.options,themeType:e}:this.input.options={themeType:e},(i=this.instance)==null||i.setThemeType(e)}async setTheme(e){this.input.options?this.input.options={...this.input.options,theme:e}:this.input.options={theme:e},this.surface&&await this.render(!1)}async setOptions(e){this.input.options=e,this.surface&&await this.render(!1)}acceptReject(e,i){if(!k(this.input)||!this.diff)throw new Error("acceptReject() requires a diff view");const{diffAcceptRejectHunk:t}=this.module;return this.diff=t(this.diff,e,i),this.instance.render({fileDiff:this.diff,containerWrapper:this.surface,lineAnnotations:this.input.annotations}),this.diff}resolveConflict(e,i){if(this.input.kind!=="merge-conflict")throw new Error("resolveConflict() requires a merge-conflict view");const t=this.instance.resolveConflict(e,i);return t&&(this.input.file=t.file,this.diff=t.fileDiff),t==null?void 0:t.file}getResolvedFile(){if(!k(this.input)||!this.diff||this.diff.isPartial)return;const e="newFile"in this.input?this.input.newFile:void 0;return{name:(e==null?void 0:e.name)??this.diff.name,contents:this.diff.additionLines.join(""),lang:(e==null?void 0:e.lang)??this.diff.lang}}getDiff(){return this.diff}getInput(){return this.input}getNativeInstance(){return this.instance}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}async whenVisualReady(){let e=this.visualReadyPromise;for(;;){const i=await e;if(e===this.visualReadyPromise)return i;e=this.visualReadyPromise}}dispose(){var e,i;this.disposed=!0,this.invalidateVisualReady(),(e=this.instance)==null||e.cleanUp(),this.instance=void 0,this.surface=void 0,(i=this.container)==null||i.replaceChildren(),this.container=void 0,this.renderListeners.clear()}async render(e=!0){var a,r;const i=this.surface;if(!i||this.disposed)return;const t=this.beginVisualRender(),n=this.module??(this.module=await ee(()=>import("./index-BeRBs4X9.js"),__vite__mapDeps([0,1,2,3])));if(this.disposed||i!==this.surface)return;if((a=this.instance)==null||a.cleanUp(),i.replaceChildren(),this.input.kind==="file"){const d=new n.File(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);d.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=d,d.setSelectedLines(this.selectedLines),this.diff=void 0;return}if(k(this.input)){if(e||!this.diff)if(this.input.kind==="patch"){const g=n.parsePatchFiles(this.input.patch)[this.input.patchIndex??0];if(!g)throw new Error(`Patch does not contain patch index ${this.input.patchIndex??0}`);const h=g.files[this.input.fileIndex??0];if(!h)throw new Error(`Patch does not contain file index ${this.input.fileIndex??0}`);this.diff=h}else"fileDiff"in this.input?this.diff=this.input.fileDiff:this.diff=n.parseDiffFromFile(this.input.oldFile,this.input.newFile,(r=this.input.options)==null?void 0:r.parseDiffOptions);const d=new n.FileDiff(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);d.render({fileDiff:this.diff,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=d,d.setSelectedLines(this.selectedLines);return}const o=new n.UnresolvedFile(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines),this.diff=o.fileDiff}emitRender(){for(const e of this.renderListeners)e()}beginVisualRender(){var i;(i=this.resolveVisualReady)==null||i.call(this,!1);const e=++this.visualRevision;return this.visualReadyPromise=new Promise(t=>{this.resolveVisualReady=t}),e}markVisualReady(e){var i;this.disposed||e!==this.visualRevision||((i=this.resolveVisualReady)==null||i.call(this,!0),this.resolveVisualReady=void 0,this.emitRender())}invalidateVisualReady(){var e;this.visualRevision++,(e=this.resolveVisualReady)==null||e.call(this,!1),this.resolveVisualReady=void 0}};function M(e){return new te(e)}function ne(e){return!e||e.useTokenTransformer===!0||!e.onTokenClick&&!e.onTokenEnter&&!e.onTokenLeave?e:{...e,useTokenTransformer:!0}}function b(e,i){const t=ne(e),n=t==null?void 0:t.onPostRender;return{...t,onPostRender(...o){n==null||n(...o),i()}}}function k(e){return e.kind==="diff"||e.kind==="patch"}var se=class{constructor(e={}){f(this,"options");f(this,"state","idle");f(this,"stats",{characters:0,lines:0,writes:0,resets:0,renderMode:"plain-text",overflowed:!1});f(this,"text",new ie);f(this,"pending",[]);f(this,"scheduled");f(this,"generation",0);f(this,"container");f(this,"shell");f(this,"surface");f(this,"finalizedSurface");f(this,"plainText");f(this,"finalizePromise");f(this,"renderListeners",new Set);f(this,"finalizedRenderSubscription");this.options=e}async mount(e){var n,o,a,r;if(this.state==="disposed")throw new Error("Cannot mount a disposed code stream. Create a new controller instead.");++this.generation,this.cancelScheduledFlush(),(n=this.finalizedSurface)==null||n.dispose(),(o=this.finalizedRenderSubscription)==null||o.dispose(),(a=this.container)==null||a.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.setState("mounting"),this.container=e;const{shell:i,surface:t}=H(e,this.options.maxHeight);this.shell=i,this.surface=t,this.mountPlainText(t),(r=this.stats).startedAt??(r.startedAt=performance.now()),this.setState("streaming")}append(e){if(e){if(this.state==="finalized"||this.state==="finalizing"||this.state==="disposed")throw new Error(`Cannot append while stream is ${this.state}`);this.text.append(e),this.stats.characters=this.text.length,this.stats.lines+=re(e)+(this.stats.lines===0?1:0),this.pending.push(e),this.scheduleFlush()}}updateSnapshot(e){const i=this.text.toString();if(e.startsWith(i)){this.append(e.slice(i.length));return}const t=this.options.nonAppendBehavior??"reset";if(t!=="ignore"){if(t==="throw")throw new Error("Snapshot violates the append-only stream contract");return this.reset(e)}}async consume(e){try{if(Symbol.asyncIterator in e)for await(const i of e)this.append(i);else{const i=e.getReader();try{for(;;){const{done:t,value:n}=await i.read();if(t)break;this.append(n)}}finally{i.releaseLock()}}}catch(i){throw this.fail(i),i}}async flush(){var t;if(this.cancelScheduledFlush(),!this.pending.length)return;const e=this.shouldFollowViewport(),i=this.pending.join("");this.pending.length=0,(t=this.plainText)==null||t.append(i),this.stats.writes++,this.followViewport(e),this.emitRender()}finalize(e={view:"stream"}){if(this.state==="finalized")return Promise.resolve();if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed code stream");const i=this.generation;if(this.setState("finalizing"),await this.flush(),i!==this.generation)return;if(this.stats.finalizedAt=performance.now(),!e.view||e.view==="stream"){this.setState("finalized");return}const t=this.surface;if(!t)throw new Error("Mount the stream before finalizing to a file or diff view");const n=this.options.fileName??`code.${this.options.language??"txt"}`,o=L(n,this.getText(),this.options.language);let a;if(e.view==="file"){const{annotations:c,workerManager:y,view:S,...z}=e;a=M({kind:"file",file:o,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...z},workerManager:y??this.options.workerManager})}else{const{annotations:c,original:y,workerManager:S,view:z,...D}=e;a=M({kind:"diff",oldFile:L(n,y,this.options.language),newFile:o,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...D},workerManager:S??this.options.workerManager})}const r=document.createElement("div");if(r.className="stream-diffs-finalized",await a.mount(r),i!==this.generation){a.dispose();return}const d=this.shell,g=(d==null?void 0:d.scrollTop)??0,h=d?d.scrollHeight-d.scrollTop-d.clientHeight:0;t.replaceWith(r),this.surface=r,this.plainText=void 0,this.finalizedSurface=a,this.finalizedRenderSubscription=a.onDidRender(()=>this.emitRender()),d&&(this.options.autoScroll==="always"||this.options.autoScroll!=="never"&&h<=(this.options.autoScrollThresholdPx??32)?d.scrollTop=d.scrollHeight:d.scrollTop=g),this.setState("finalized"),this.emitRender()}async reset(e=""){var t,n;const i=this.container;++this.generation,this.cancelScheduledFlush(),(t=this.finalizedSurface)==null||t.dispose(),(n=this.finalizedRenderSubscription)==null||n.dispose(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.finalizePromise=void 0,this.text.clear(),this.stats.resets++,this.stats.characters=0,this.stats.lines=0,this.stats.renderMode="plain-text",this.stats.overflowed=!1,this.setState("idle"),e&&this.append(e),i&&await this.mount(i)}setThemeType(e){var i;this.options.themeType=e,(i=this.finalizedSurface)==null||i.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e===this.options.language||(this.options.language=e,!this.finalizedSurface))return;const i=this.finalizedSurface.getInput();i.kind==="file"?await this.finalizedSurface.updateFile({...i.file,lang:e},i.annotations):i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations)}getText(){return this.text.toString()}getState(){return this.state}getStats(){return{...this.stats}}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){var e,i,t;++this.generation,this.cancelScheduledFlush(),(e=this.finalizedSurface)==null||e.dispose(),(i=this.finalizedRenderSubscription)==null||i.dispose(),(t=this.container)==null||t.replaceChildren(),this.plainText=void 0,this.container=void 0,this.surface=void 0,this.shell=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}scheduleFlush(){if(this.scheduled!=null||!this.plainText)return;const e=this.options.flushStrategy??"raf";e==="raf"&&typeof requestAnimationFrame=="function"?this.scheduled=requestAnimationFrame(()=>void this.flush()):this.scheduled=globalThis.setTimeout(()=>void this.flush(),e==="raf"?0:e.intervalMs)}cancelScheduledFlush(){this.scheduled!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.scheduled),clearTimeout(this.scheduled),this.scheduled=void 0)}shouldFollowViewport(){const e=this.shell;return!e||this.options.autoScroll==="never"?!1:this.options.autoScroll==="always"?!0:e.scrollHeight-e.scrollTop-e.clientHeight<=(this.options.autoScrollThresholdPx??32)}followViewport(e=this.shouldFollowViewport()){this.shell&&e&&(this.shell.scrollTop=this.shell.scrollHeight)}mountPlainText(e){const i=document.createElement("pre");i.className="stream-diffs-plain-text",i.dataset.streamDiffsState="streaming",i.style.margin="0",i.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",i.style.overflowWrap=this.options.wrap?"anywhere":"normal",i.textContent=this.getText(),e.replaceChildren(i),this.plainText=i}setState(e){var i,t;this.state=e,(t=(i=this.options).onStateChange)==null||t.call(i,e)}emitRender(){for(const e of this.renderListeners)e()}fail(e){var i,t;this.state!=="disposed"&&(this.setState("error"),(t=(i=this.options).onError)==null||t.call(i,e))}};function re(e){let i=0;for(let t=0;t<e.length;t++)e.charCodeAt(t)===10&&i++;return i}var ae=class{constructor(e={}){f(this,"options");f(this,"state","idle");f(this,"generation",0);f(this,"original","");f(this,"modified","");f(this,"container");f(this,"shell");f(this,"surface");f(this,"finalizedSurface");f(this,"finalizePromise");f(this,"renderListeners",new Set);f(this,"finalizedRenderSubscription");this.options=e}async mount(e,i=this.original,t=this.modified){var a,r,d;if(this.state==="disposed")throw new Error("Cannot mount a disposed diff stream. Create a new controller instead.");++this.generation,this.original=i,this.modified=t,(a=this.finalizedSurface)==null||a.dispose(),(r=this.finalizedRenderSubscription)==null||r.dispose(),(d=this.container)==null||d.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.setState("mounting"),this.container=e;const{shell:n,surface:o}=H(e,this.options.maxHeight);this.shell=n,this.surface=o,this.renderPre(),this.setState("streaming")}update(e,i){if(this.state==="disposed")throw new Error("Cannot update a disposed diff stream");return this.original=e,this.modified=i,this.finalizedSurface?this.finalizedSurface.updateDiff(this.asFile(e),this.asFile(i)):(this.renderPre(),this.emitRender(),Promise.resolve())}finalize(e){if(this.state==="finalized")return Promise.resolve(this.finalizedSurface);if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed diff stream");const i=this.surface;if(!i)throw new Error("Mount the diff stream before finalizing it");const t=this.generation;this.setState("finalizing");const n=M({kind:"diff",oldFile:this.asFile(this.original),newFile:this.asFile(this.modified),annotations:e,options:{...this.options,diffStyle:this.options.diffStyle??"unified"},workerManager:this.options.workerManager}),o=document.createElement("div");if(o.className="stream-diffs-finalized",await n.mount(o),t!==this.generation){n.dispose();return}const a=this.shell,r=(a==null?void 0:a.scrollTop)??0;return i.replaceWith(o),this.surface=o,this.finalizedSurface=n,this.finalizedRenderSubscription=n.onDidRender(()=>this.emitRender()),a&&(a.scrollTop=r),this.setState("finalized"),this.emitRender(),n}setThemeType(e){var i;this.options.themeType=e,(i=this.finalizedSurface)==null||i.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e!==this.options.language){if(this.options.language=e,this.finalizedSurface){const i=this.finalizedSurface.getInput();i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations);return}this.renderPre()}}getOriginal(){return this.original}getModified(){return this.modified}getState(){return this.state}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){var e,i,t;++this.generation,(e=this.finalizedSurface)==null||e.dispose(),(i=this.finalizedRenderSubscription)==null||i.dispose(),(t=this.container)==null||t.replaceChildren(),this.container=void 0,this.shell=void 0,this.surface=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}renderPre(){const e=this.surface;if(!e||this.finalizedSurface)return;const i=document.createElement("div");i.className=`stream-diffs-diff-pre stream-diffs-diff-pre--${this.options.diffStyle??"unified"}`,i.dataset.streamDiffsState="streaming",i.style.minWidth="max-content",(this.options.diffStyle??"unified")==="split"?(i.style.display="grid",i.style.gridTemplateColumns="minmax(0, 1fr) minmax(0, 1fr)",i.append(this.createPre(this.original,"deletions"),this.createPre(this.modified,"additions"))):i.append(this.createPre(oe(this.original,this.modified),"unified")),e.replaceChildren(i)}createPre(e,i){const t=document.createElement("pre");return t.className=`stream-diffs-diff-pre__pane stream-diffs-diff-pre__pane--${i}`,t.dataset.side=i,t.style.margin="0",t.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",t.style.overflowWrap=this.options.wrap?"anywhere":"normal",t.textContent=e,t}asFile(e){return L(this.options.fileName??`code.${this.options.language??"txt"}`,e,this.options.language)}setState(e){var i,t;this.state=e,(t=(i=this.options).onStateChange)==null||t.call(i,e)}emitRender(){for(const e of this.renderListeners)e()}};function oe(e,i){const t=e.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-gSmHRsHg.js","assets/index-BKJW0i9Q.js","assets/vendor-vue-Ci9TYO_I.js","assets/index-GnV5W03u.css"])))=>i.map(i=>d[i]);
2
+ var Y=Object.defineProperty;var Z=(e,i,t)=>i in e?Y(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var f=(e,i,t)=>Z(e,typeof i!="symbol"?i+"":i,t);import{_ as ee}from"./index-BKJW0i9Q.js";import"./vendor-vue-Ci9TYO_I.js";var ie=class{constructor(){f(this,"chunks",[]);f(this,"cached","");f(this,"dirty",!1);f(this,"length",0)}append(e){e&&(this.chunks.push(e),this.length+=e.length,this.dirty=!0,this.chunks.length>256&&this.compact())}clear(e=""){this.chunks=e?[e]:[],this.cached=e,this.dirty=!1,this.length=e.length}toString(){return this.dirty&&(this.cached=this.chunks.join(""),this.dirty=!1),this.cached}compact(){this.chunks=[this.chunks.join("")]}};function H(e,i){e.replaceChildren();const t=document.createElement("div");t.className="stream-diffs-shell",t.style.overflow="auto",t.style.maxHeight=typeof i=="number"?`${i}px`:i??"none";const n=document.createElement("div");return n.className="stream-diffs-surface",t.appendChild(n),e.appendChild(t),{shell:t,surface:n}}function L(e,i,t){return{name:e,contents:i,lang:t}}var te=class{constructor(e){f(this,"input");f(this,"container");f(this,"surface");f(this,"instance");f(this,"diff");f(this,"selectedLines",null);f(this,"disposed",!1);f(this,"renderListeners",new Set);f(this,"visualRevision",0);f(this,"visualReadyPromise",Promise.resolve(!1));f(this,"resolveVisualReady");f(this,"module");this.input=e}async mount(e){this.disposed=!1,this.container=e,this.surface=H(e).surface,await this.render()}async update(e){this.input=e,this.surface&&await this.render(!0)}updateFile(e,i){return this.update({kind:"file",file:e,annotations:i,options:this.input.kind==="file"?this.input.options:void 0,workerManager:this.input.kind==="file"?this.input.workerManager:void 0})}updateDiff(e,i,t){return this.update({kind:"diff",oldFile:e,newFile:i,annotations:t,options:k(this.input)?this.input.options:void 0,workerManager:k(this.input)?this.input.workerManager:void 0})}updateParsedDiff(e,i){return this.update({kind:"diff",fileDiff:e,annotations:i,options:k(this.input)?this.input.options:void 0,workerManager:k(this.input)?this.input.workerManager:void 0})}updatePatch(e,i=0,t,n=0){return this.update({kind:"patch",patch:e,patchIndex:n,fileIndex:i,annotations:t,options:this.input.kind==="patch"?this.input.options:void 0,workerManager:this.input.kind==="patch"?this.input.workerManager:void 0})}updateMergeConflict(e,i){return this.update({kind:"merge-conflict",file:e,annotations:i,options:this.input.kind==="merge-conflict"?this.input.options:void 0,workerManager:this.input.kind==="merge-conflict"?this.input.workerManager:void 0})}setSelectedLines(e){var i;this.selectedLines=e,(i=this.instance)==null||i.setSelectedLines(e)}setAnnotations(e){this.instance&&(this.input.kind==="file"?(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)):(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)),this.emitRender())}setThemeType(e){var i;this.input.options?this.input.options={...this.input.options,themeType:e}:this.input.options={themeType:e},(i=this.instance)==null||i.setThemeType(e)}async setTheme(e){this.input.options?this.input.options={...this.input.options,theme:e}:this.input.options={theme:e},this.surface&&await this.render(!1)}async setOptions(e){this.input.options=e,this.surface&&await this.render(!1)}acceptReject(e,i){if(!k(this.input)||!this.diff)throw new Error("acceptReject() requires a diff view");const{diffAcceptRejectHunk:t}=this.module;return this.diff=t(this.diff,e,i),this.instance.render({fileDiff:this.diff,containerWrapper:this.surface,lineAnnotations:this.input.annotations}),this.diff}resolveConflict(e,i){if(this.input.kind!=="merge-conflict")throw new Error("resolveConflict() requires a merge-conflict view");const t=this.instance.resolveConflict(e,i);return t&&(this.input.file=t.file,this.diff=t.fileDiff),t==null?void 0:t.file}getResolvedFile(){if(!k(this.input)||!this.diff||this.diff.isPartial)return;const e="newFile"in this.input?this.input.newFile:void 0;return{name:(e==null?void 0:e.name)??this.diff.name,contents:this.diff.additionLines.join(""),lang:(e==null?void 0:e.lang)??this.diff.lang}}getDiff(){return this.diff}getInput(){return this.input}getNativeInstance(){return this.instance}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}async whenVisualReady(){let e=this.visualReadyPromise;for(;;){const i=await e;if(e===this.visualReadyPromise)return i;e=this.visualReadyPromise}}dispose(){var e,i;this.disposed=!0,this.invalidateVisualReady(),(e=this.instance)==null||e.cleanUp(),this.instance=void 0,this.surface=void 0,(i=this.container)==null||i.replaceChildren(),this.container=void 0,this.renderListeners.clear()}async render(e=!0){var a,r;const i=this.surface;if(!i||this.disposed)return;const t=this.beginVisualRender(),n=this.module??(this.module=await ee(()=>import("./index-gSmHRsHg.js"),__vite__mapDeps([0,1,2,3])));if(this.disposed||i!==this.surface)return;if((a=this.instance)==null||a.cleanUp(),i.replaceChildren(),this.input.kind==="file"){const d=new n.File(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);d.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=d,d.setSelectedLines(this.selectedLines),this.diff=void 0;return}if(k(this.input)){if(e||!this.diff)if(this.input.kind==="patch"){const g=n.parsePatchFiles(this.input.patch)[this.input.patchIndex??0];if(!g)throw new Error(`Patch does not contain patch index ${this.input.patchIndex??0}`);const h=g.files[this.input.fileIndex??0];if(!h)throw new Error(`Patch does not contain file index ${this.input.fileIndex??0}`);this.diff=h}else"fileDiff"in this.input?this.diff=this.input.fileDiff:this.diff=n.parseDiffFromFile(this.input.oldFile,this.input.newFile,(r=this.input.options)==null?void 0:r.parseDiffOptions);const d=new n.FileDiff(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);d.render({fileDiff:this.diff,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=d,d.setSelectedLines(this.selectedLines);return}const o=new n.UnresolvedFile(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines),this.diff=o.fileDiff}emitRender(){for(const e of this.renderListeners)e()}beginVisualRender(){var i;(i=this.resolveVisualReady)==null||i.call(this,!1);const e=++this.visualRevision;return this.visualReadyPromise=new Promise(t=>{this.resolveVisualReady=t}),e}markVisualReady(e){var i;this.disposed||e!==this.visualRevision||((i=this.resolveVisualReady)==null||i.call(this,!0),this.resolveVisualReady=void 0,this.emitRender())}invalidateVisualReady(){var e;this.visualRevision++,(e=this.resolveVisualReady)==null||e.call(this,!1),this.resolveVisualReady=void 0}};function M(e){return new te(e)}function ne(e){return!e||e.useTokenTransformer===!0||!e.onTokenClick&&!e.onTokenEnter&&!e.onTokenLeave?e:{...e,useTokenTransformer:!0}}function b(e,i){const t=ne(e),n=t==null?void 0:t.onPostRender;return{...t,onPostRender(...o){n==null||n(...o),i()}}}function k(e){return e.kind==="diff"||e.kind==="patch"}var se=class{constructor(e={}){f(this,"options");f(this,"state","idle");f(this,"stats",{characters:0,lines:0,writes:0,resets:0,renderMode:"plain-text",overflowed:!1});f(this,"text",new ie);f(this,"pending",[]);f(this,"scheduled");f(this,"generation",0);f(this,"container");f(this,"shell");f(this,"surface");f(this,"finalizedSurface");f(this,"plainText");f(this,"finalizePromise");f(this,"renderListeners",new Set);f(this,"finalizedRenderSubscription");this.options=e}async mount(e){var n,o,a,r;if(this.state==="disposed")throw new Error("Cannot mount a disposed code stream. Create a new controller instead.");++this.generation,this.cancelScheduledFlush(),(n=this.finalizedSurface)==null||n.dispose(),(o=this.finalizedRenderSubscription)==null||o.dispose(),(a=this.container)==null||a.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.setState("mounting"),this.container=e;const{shell:i,surface:t}=H(e,this.options.maxHeight);this.shell=i,this.surface=t,this.mountPlainText(t),(r=this.stats).startedAt??(r.startedAt=performance.now()),this.setState("streaming")}append(e){if(e){if(this.state==="finalized"||this.state==="finalizing"||this.state==="disposed")throw new Error(`Cannot append while stream is ${this.state}`);this.text.append(e),this.stats.characters=this.text.length,this.stats.lines+=re(e)+(this.stats.lines===0?1:0),this.pending.push(e),this.scheduleFlush()}}updateSnapshot(e){const i=this.text.toString();if(e.startsWith(i)){this.append(e.slice(i.length));return}const t=this.options.nonAppendBehavior??"reset";if(t!=="ignore"){if(t==="throw")throw new Error("Snapshot violates the append-only stream contract");return this.reset(e)}}async consume(e){try{if(Symbol.asyncIterator in e)for await(const i of e)this.append(i);else{const i=e.getReader();try{for(;;){const{done:t,value:n}=await i.read();if(t)break;this.append(n)}}finally{i.releaseLock()}}}catch(i){throw this.fail(i),i}}async flush(){var t;if(this.cancelScheduledFlush(),!this.pending.length)return;const e=this.shouldFollowViewport(),i=this.pending.join("");this.pending.length=0,(t=this.plainText)==null||t.append(i),this.stats.writes++,this.followViewport(e),this.emitRender()}finalize(e={view:"stream"}){if(this.state==="finalized")return Promise.resolve();if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed code stream");const i=this.generation;if(this.setState("finalizing"),await this.flush(),i!==this.generation)return;if(this.stats.finalizedAt=performance.now(),!e.view||e.view==="stream"){this.setState("finalized");return}const t=this.surface;if(!t)throw new Error("Mount the stream before finalizing to a file or diff view");const n=this.options.fileName??`code.${this.options.language??"txt"}`,o=L(n,this.getText(),this.options.language);let a;if(e.view==="file"){const{annotations:c,workerManager:y,view:S,...z}=e;a=M({kind:"file",file:o,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...z},workerManager:y??this.options.workerManager})}else{const{annotations:c,original:y,workerManager:S,view:z,...D}=e;a=M({kind:"diff",oldFile:L(n,y,this.options.language),newFile:o,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...D},workerManager:S??this.options.workerManager})}const r=document.createElement("div");if(r.className="stream-diffs-finalized",await a.mount(r),i!==this.generation){a.dispose();return}const d=this.shell,g=(d==null?void 0:d.scrollTop)??0,h=d?d.scrollHeight-d.scrollTop-d.clientHeight:0;t.replaceWith(r),this.surface=r,this.plainText=void 0,this.finalizedSurface=a,this.finalizedRenderSubscription=a.onDidRender(()=>this.emitRender()),d&&(this.options.autoScroll==="always"||this.options.autoScroll!=="never"&&h<=(this.options.autoScrollThresholdPx??32)?d.scrollTop=d.scrollHeight:d.scrollTop=g),this.setState("finalized"),this.emitRender()}async reset(e=""){var t,n;const i=this.container;++this.generation,this.cancelScheduledFlush(),(t=this.finalizedSurface)==null||t.dispose(),(n=this.finalizedRenderSubscription)==null||n.dispose(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.finalizePromise=void 0,this.text.clear(),this.stats.resets++,this.stats.characters=0,this.stats.lines=0,this.stats.renderMode="plain-text",this.stats.overflowed=!1,this.setState("idle"),e&&this.append(e),i&&await this.mount(i)}setThemeType(e){var i;this.options.themeType=e,(i=this.finalizedSurface)==null||i.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e===this.options.language||(this.options.language=e,!this.finalizedSurface))return;const i=this.finalizedSurface.getInput();i.kind==="file"?await this.finalizedSurface.updateFile({...i.file,lang:e},i.annotations):i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations)}getText(){return this.text.toString()}getState(){return this.state}getStats(){return{...this.stats}}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){var e,i,t;++this.generation,this.cancelScheduledFlush(),(e=this.finalizedSurface)==null||e.dispose(),(i=this.finalizedRenderSubscription)==null||i.dispose(),(t=this.container)==null||t.replaceChildren(),this.plainText=void 0,this.container=void 0,this.surface=void 0,this.shell=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}scheduleFlush(){if(this.scheduled!=null||!this.plainText)return;const e=this.options.flushStrategy??"raf";e==="raf"&&typeof requestAnimationFrame=="function"?this.scheduled=requestAnimationFrame(()=>void this.flush()):this.scheduled=globalThis.setTimeout(()=>void this.flush(),e==="raf"?0:e.intervalMs)}cancelScheduledFlush(){this.scheduled!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.scheduled),clearTimeout(this.scheduled),this.scheduled=void 0)}shouldFollowViewport(){const e=this.shell;return!e||this.options.autoScroll==="never"?!1:this.options.autoScroll==="always"?!0:e.scrollHeight-e.scrollTop-e.clientHeight<=(this.options.autoScrollThresholdPx??32)}followViewport(e=this.shouldFollowViewport()){this.shell&&e&&(this.shell.scrollTop=this.shell.scrollHeight)}mountPlainText(e){const i=document.createElement("pre");i.className="stream-diffs-plain-text",i.dataset.streamDiffsState="streaming",i.style.margin="0",i.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",i.style.overflowWrap=this.options.wrap?"anywhere":"normal",i.textContent=this.getText(),e.replaceChildren(i),this.plainText=i}setState(e){var i,t;this.state=e,(t=(i=this.options).onStateChange)==null||t.call(i,e)}emitRender(){for(const e of this.renderListeners)e()}fail(e){var i,t;this.state!=="disposed"&&(this.setState("error"),(t=(i=this.options).onError)==null||t.call(i,e))}};function re(e){let i=0;for(let t=0;t<e.length;t++)e.charCodeAt(t)===10&&i++;return i}var ae=class{constructor(e={}){f(this,"options");f(this,"state","idle");f(this,"generation",0);f(this,"original","");f(this,"modified","");f(this,"container");f(this,"shell");f(this,"surface");f(this,"finalizedSurface");f(this,"finalizePromise");f(this,"renderListeners",new Set);f(this,"finalizedRenderSubscription");this.options=e}async mount(e,i=this.original,t=this.modified){var a,r,d;if(this.state==="disposed")throw new Error("Cannot mount a disposed diff stream. Create a new controller instead.");++this.generation,this.original=i,this.modified=t,(a=this.finalizedSurface)==null||a.dispose(),(r=this.finalizedRenderSubscription)==null||r.dispose(),(d=this.container)==null||d.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.setState("mounting"),this.container=e;const{shell:n,surface:o}=H(e,this.options.maxHeight);this.shell=n,this.surface=o,this.renderPre(),this.setState("streaming")}update(e,i){if(this.state==="disposed")throw new Error("Cannot update a disposed diff stream");return this.original=e,this.modified=i,this.finalizedSurface?this.finalizedSurface.updateDiff(this.asFile(e),this.asFile(i)):(this.renderPre(),this.emitRender(),Promise.resolve())}finalize(e){if(this.state==="finalized")return Promise.resolve(this.finalizedSurface);if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed diff stream");const i=this.surface;if(!i)throw new Error("Mount the diff stream before finalizing it");const t=this.generation;this.setState("finalizing");const n=M({kind:"diff",oldFile:this.asFile(this.original),newFile:this.asFile(this.modified),annotations:e,options:{...this.options,diffStyle:this.options.diffStyle??"unified"},workerManager:this.options.workerManager}),o=document.createElement("div");if(o.className="stream-diffs-finalized",await n.mount(o),t!==this.generation){n.dispose();return}const a=this.shell,r=(a==null?void 0:a.scrollTop)??0;return i.replaceWith(o),this.surface=o,this.finalizedSurface=n,this.finalizedRenderSubscription=n.onDidRender(()=>this.emitRender()),a&&(a.scrollTop=r),this.setState("finalized"),this.emitRender(),n}setThemeType(e){var i;this.options.themeType=e,(i=this.finalizedSurface)==null||i.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e!==this.options.language){if(this.options.language=e,this.finalizedSurface){const i=this.finalizedSurface.getInput();i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations);return}this.renderPre()}}getOriginal(){return this.original}getModified(){return this.modified}getState(){return this.state}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){var e,i,t;++this.generation,(e=this.finalizedSurface)==null||e.dispose(),(i=this.finalizedRenderSubscription)==null||i.dispose(),(t=this.container)==null||t.replaceChildren(),this.container=void 0,this.shell=void 0,this.surface=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}renderPre(){const e=this.surface;if(!e||this.finalizedSurface)return;const i=document.createElement("div");i.className=`stream-diffs-diff-pre stream-diffs-diff-pre--${this.options.diffStyle??"unified"}`,i.dataset.streamDiffsState="streaming",i.style.minWidth="max-content",(this.options.diffStyle??"unified")==="split"?(i.style.display="grid",i.style.gridTemplateColumns="minmax(0, 1fr) minmax(0, 1fr)",i.append(this.createPre(this.original,"deletions"),this.createPre(this.modified,"additions"))):i.append(this.createPre(oe(this.original,this.modified),"unified")),e.replaceChildren(i)}createPre(e,i){const t=document.createElement("pre");return t.className=`stream-diffs-diff-pre__pane stream-diffs-diff-pre__pane--${i}`,t.dataset.side=i,t.style.margin="0",t.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",t.style.overflowWrap=this.options.wrap?"anywhere":"normal",t.textContent=e,t}asFile(e){return L(this.options.fileName??`code.${this.options.language??"txt"}`,e,this.options.language)}setState(e){var i,t;this.state=e,(t=(i=this.options).onStateChange)==null||t.call(i,e)}emitRender(){for(const e of this.renderListeners)e()}};function oe(e,i){const t=e.split(`
3
3
  `),n=i.split(`
4
4
  `);let o=0;for(;o<t.length&&o<n.length&&t[o]===n[o];)o++;let a=0;for(;a<t.length-o&&a<n.length-o&&t[t.length-a-1]===n[n.length-a-1];)a++;return[...t.slice(0,o).map(r=>` ${r}`),...t.slice(o,t.length-a).map(r=>`- ${r}`),...n.slice(o,n.length-a).map(r=>`+ ${r}`),...t.slice(t.length-a).map(r=>` ${r}`)].join(`
5
5
  `)}function we(e={}){let i,t,n,o,a,r="text",d="",g="",h,c=0,y="system",S=K(e),z=G(e);const D={disableLineNumbers:e.lineNumbers===!1,overflow:e.wordWrap==="on"?"wrap":"scroll",enableLineSelection:e.enableLineSelection},P=()=>({...D,theme:S,themeType:y});async function I(s,l,p){var m;F();const v=c;if($(s,e),h=s,r=x(p),W(l))return _(s,l,r);if(e.stream===!1)return O(s,l,r);const u=new se({...P(),...R(e),fileName:`code.${r}`,language:r,maxHeight:e.MAX_HEIGHT,autoScroll:e.autoScrollOnUpdate===!1?"never":"near-bottom",autoScrollThresholdPx:e.autoScrollThresholdPx,workerManager:e.workerManager});if(i=u,u.append(l),await u.mount(s),v!==c||i!==u||h!==s)throw u.dispose(),new Error("Editor creation was cancelled");return(m=e.onController)==null||m.call(e,u),o=C(()=>u.getText(),s,()=>u.getFinalizedSurface(),w=>u.onDidRender(w)),o}async function V(s,l,p,v){var q,B;F();const u=c;$(s,e),h=s,r=x(v),d=l,g=p;let m,w;if(e.stream===!1){if(m=M({kind:"diff",oldFile:T(l),newFile:T(p),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...P(),diffStyle:e.diffStyle??(e.renderSideBySide===!1?"unified":"split"),...R(e)}}),n=m,await m.mount(s),u!==c||n!==m||h!==s)throw m.dispose(),new Error("Editor creation was cancelled");(q=e.onController)==null||q.call(e,m)}else{if(w=new ae({...P(),...R(e),fileName:`code.${r}`,language:r,diffStyle:e.diffStyle??(e.renderSideBySide===!1?"unified":"split"),maxHeight:e.MAX_HEIGHT,wrap:e.wordWrap==="on",workerManager:e.workerManager}),t=w,await w.mount(s,l,p),u!==c||t!==w||h!==s)throw w.dispose(),new Error("Editor creation was cancelled");(B=e.onController)==null||B.call(e,w)}return a=ue(()=>d,()=>g,s,()=>m??(w==null?void 0:w.getFinalizedSurface())),a}async function J(s,l=r){const p=x(l);if(W(s)){(n==null?void 0:n.getInput().kind)==="merge-conflict"?(r=p,await n.updateMergeConflict(T(s),e.lineAnnotations)):h&&await _(h,s,p);return}if(e.stream===!1){(n==null?void 0:n.getInput().kind)==="file"?(r=p,await n.updateFile(T(s),e.lineAnnotations)):h&&await O(h,s,p);return}if(!i){h&&await I(h,s,p);return}if(i.getState()==="finalized"){s!==i.getText()&&await i.reset(s);return}if(p!==r){r=p,await i.setLanguage(p),s!==i.getText()&&await i.reset(s);return}const v=i.getText();s.startsWith(v)?i.append(s.slice(v.length)):await i.reset(s)}async function E(s,l,p=r){if(d=s,g=l,r=x(p),t){await t.update(s,l);return}if(!n){h&&await V(h,s,l,p);return}await n.updateDiff(T(s),T(l))}function F(){c++,i==null||i.dispose(),t==null||t.dispose(),t||n==null||n.dispose(),i=void 0,t=void 0,n=void 0,o=void 0,a=void 0,h=void 0}async function O(s,l,p){var m;F();const v=c;h=s,r=p;const u=M({kind:"file",file:T(l),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...P(),...R(e)}});if(n=u,await u.mount(s),v!==c||n!==u||h!==s)throw u.dispose(),new Error("Editor creation was cancelled");return(m=e.onController)==null||m.call(e,u),o=C(()=>X(u)??l,s,()=>u,w=>u.onDidRender(w)),o}async function _(s,l,p){var m;F();const v=c;h=s,r=p;const u=M({kind:"merge-conflict",file:T(l),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...P(),...R(e)}});if(n=u,await u.mount(s),v!==c||n!==u||h!==s)throw u.dispose(),new Error("Editor creation was cancelled");return(m=e.onController)==null||m.call(e,u),o=C(()=>X(u)??l,s,()=>u,w=>u.onDidRender(w)),o}function W(s){return e.mergeConflict===!1?!1:/^<<<<<<< .+$/m.test(s)&&/^=======$/m.test(s)&&/^>>>>>>> .+$/m.test(s)}async function Q(s){if(s){if(typeof s=="string"){const l=e.themes;if((l==null?void 0:l[0])===s){await j(),y="dark",i==null||i.setThemeType("dark"),t==null||t.setThemeType("dark"),n==null||n.setThemeType("dark");return}if((l==null?void 0:l[1])===s){await j(),y="light",i==null||i.setThemeType("light"),t==null||t.setThemeType("light"),n==null||n.setThemeType("light");return}}z=void 0,S=s,await U(s)}}async function j(){const s=G(e);!s||s===z||(z=s,S=K(e),await U(S))}async function U(s){await(i==null?void 0:i.setTheme(s)),await(t==null?void 0:t.setTheme(s)),await(n==null?void 0:n.setTheme(s))}function T(s){return L(`code.${r||"txt"}`,s,r)}return{runtimeKind:"stream-diffs",createEditor:I,createDiffEditor:V,updateCode:J,appendCode(s){i==null||i.append(s)},async finalizeCode(){if(!i||i.getState()==="finalized")return i==null?void 0:i.getFinalizedSurface();const s=R(e);return delete s.lineAnnotations,await i.finalize({view:"file",...s,theme:S,themeType:y,annotations:e.lineAnnotations,workerManager:e.workerManager}),i.getFinalizedSurface()},async finalizeDiff(){return t&&(n=await t.finalize(e.lineAnnotations)),n},updateDiff:E,updateOriginal(s,l=r){return E(s,g,l)},updateModified(s,l=r){return E(d,s,l)},appendOriginal(s,l=r){return E(d+s,g,l)},appendModified(s,l=r){return E(d,g+s,l)},cleanupEditor:F,safeClean:F,setTheme:Q,async setLanguage(s){if(r=x(s),await(i==null?void 0:i.setLanguage(r)),await(t==null?void 0:t.setLanguage(r)),n&&!t){const l=n.getInput();l.kind==="file"||l.kind==="merge-conflict"?await n.update({...l,file:{...l.file,lang:r}}):l.kind==="diff"&&"oldFile"in l&&await n.update({...l,oldFile:{...l.oldFile,lang:r},newFile:{...l.newFile,lang:r}})}},getCurrentTheme:()=>S,getEditor:()=>ce,getEditorView:()=>o??null,getDiffEditorView:()=>a??null,getDiffModels:()=>({original:A(()=>d),modified:A(()=>{var s;return((s=n==null?void 0:n.getResolvedFile())==null?void 0:s.contents)??(t==null?void 0:t.getModified())??g})}),getCode:()=>{var l;const s=n==null?void 0:n.getInput();return(s==null?void 0:s.kind)==="diff"||(s==null?void 0:s.kind)==="patch"?{original:d,modified:((l=n==null?void 0:n.getResolvedFile())==null?void 0:l.contents)??g}:(s==null?void 0:s.kind)==="file"||(s==null?void 0:s.kind)==="merge-conflict"?s.file.contents:t?{original:t.getOriginal(),modified:t.getModified()}:(i==null?void 0:i.getText())??null},refreshDiffPresentation:()=>n==null?void 0:n.update(n.getInput()),whenVisualReady:async()=>{const s=h,l=c,p=n??(i==null?void 0:i.getFinalizedSurface())??(t==null?void 0:t.getFinalizedSurface());return!p||!await p.whenVisualReady()?!1:le(s,()=>l===c&&s===h&&p===(n??(i==null?void 0:i.getFinalizedSurface())??(t==null?void 0:t.getFinalizedSurface())),()=>de(n??(i==null?void 0:i.getFinalizedSurface())??(t==null?void 0:t.getFinalizedSurface())))}}}async function le(e,i,t){var r,d;if(!e||typeof window>"u")return!1;let n="",o,a=0;for(let g=0;g<120;g+=1){if(!i())return!1;const h=e.querySelector(".stream-diffs-shell"),c=(d=(r=h==null?void 0:h.querySelector("diffs-container"))==null?void 0:r.shadowRoot)==null?void 0:d.querySelector("pre"),y=h==null?void 0:h.getBoundingClientRect(),S=(c==null?void 0:c.textContent)??"";if(y&&y.width>0&&y.height>0&&c&&t()){const z=`${Math.round(y.width)}:${Math.round(y.height)}:${c.scrollWidth}:${c.scrollHeight}:${S.length}`;if(a=c===o&&z===n?a+1:1,o=c,n=z,a>=2)return!0}else n="",o=void 0,a=0;await he()}return!1}function de(e){var d,g;if(!e)return!0;const i=e.getNativeInstance(),t=(i==null?void 0:i.fileRenderer)??(i==null?void 0:i.hunksRenderer);if(!t)return!0;const n=t.renderCache;if(!(n!=null&&n.result))return!1;if(n.highlighted===!0)return!0;const o=e.getInput();if(x(o.kind==="file"||o.kind==="merge-conflict"?o.file.lang:"oldFile"in o?o.oldFile.lang??o.newFile.lang:(d=e.getDiff())==null?void 0:d.lang)==="text")return!0;const a=Number(((g=t.getTokenizeMaxLength)==null?void 0:g.call(t))??1e5);if(o.kind==="file"||o.kind==="merge-conflict")return fe(o.file.contents)>a;const r=e.getDiff();return!!r&&Math.max(r.additionLines.length,r.deletionLines.length)>a}function x(e){return!e||/^(?:text|txt|plain|plaintext)$/i.test(e)?"text":e}function fe(e){if(!e)return 0;let i=1;for(let t=0;t<e.length;t+=1)e.charCodeAt(t)===10&&(i+=1);return i}function he(){return new Promise(e=>{let i=!1;const t=()=>{i||(i=!0,window.clearTimeout(o),window.cancelAnimationFrame(n),e())},n=window.requestAnimationFrame(t),o=window.setTimeout(t,50)})}function K(e){var i;return(i=e.themes)!=null&&i.length&&typeof e.themes[0]=="string"&&typeof e.themes[1]=="string"?{dark:e.themes[0],light:e.themes[1]}:e.theme??void 0}function G(e){var i,t;if(!(typeof((i=e.themes)==null?void 0:i[0])!="string"||typeof((t=e.themes)==null?void 0:t[1])!="string"))return`${e.themes[0]}