khoj 1.42.7.dev7__py3-none-any.whl → 1.42.7.dev11__py3-none-any.whl

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 (156) hide show
  1. khoj/interface/compiled/404/index.html +2 -2
  2. khoj/interface/compiled/_next/static/chunks/1191.b547ec13349b4aed.js +1 -0
  3. khoj/interface/compiled/_next/static/chunks/1327-1a9107b9a2a04a98.js +20 -0
  4. khoj/interface/compiled/_next/static/chunks/1588.f0558a0bdffc4761.js +117 -0
  5. khoj/interface/compiled/_next/static/chunks/1915-5c6508f6ebb62a30.js +1 -0
  6. khoj/interface/compiled/_next/static/chunks/1918.925cb4a35518d258.js +43 -0
  7. khoj/interface/compiled/_next/static/chunks/{2117-3537ef9986be74d3.js → 2117-080746c8e170c81a.js} +1 -1
  8. khoj/interface/compiled/_next/static/chunks/2242.9a07e19f1a3a8b16.js +1 -0
  9. khoj/interface/compiled/_next/static/chunks/2327-ea623ca2d22f78e9.js +1 -0
  10. khoj/interface/compiled/_next/static/chunks/2612.bcf5a623b3da209e.js +131 -0
  11. khoj/interface/compiled/_next/static/chunks/2849.dc00ae5ba7219cfc.js +1 -0
  12. khoj/interface/compiled/_next/static/chunks/2939-4af3fd24b8ffc9ad.js +1 -0
  13. khoj/interface/compiled/_next/static/chunks/303.fe76de943e930fbd.js +1 -0
  14. khoj/interface/compiled/_next/static/chunks/3265.924139c4146ee344.js +1 -0
  15. khoj/interface/compiled/_next/static/chunks/{4299.2aaa569416cfc208.js → 3489.c523fe96a2eee74f.js} +4 -2
  16. khoj/interface/compiled/_next/static/chunks/3592-b2a2444b0ec7b119.js +1 -0
  17. khoj/interface/compiled/_next/static/chunks/3595-ac8e81e04ecb89cb.js +1 -0
  18. khoj/interface/compiled/_next/static/chunks/4327.8d2a1b8f1ea78208.js +60 -0
  19. khoj/interface/compiled/_next/static/chunks/4447-cd95608f8e93e711.js +1 -0
  20. khoj/interface/compiled/_next/static/chunks/4533.586e74b45a2bde25.js +55 -0
  21. khoj/interface/compiled/_next/static/chunks/4551.82ce1476b5516bc2.js +5 -0
  22. khoj/interface/compiled/_next/static/chunks/{4610.a1e7f40a759ed2aa.js → 4610.196691887afb7fea.js} +1 -1
  23. khoj/interface/compiled/_next/static/chunks/4748.0edd37cba3ea2809.js +59 -0
  24. khoj/interface/compiled/_next/static/chunks/4980.63500d68b3bb1222.js +166 -0
  25. khoj/interface/compiled/_next/static/chunks/5210.cd35a1c1ec594a20.js +93 -0
  26. khoj/interface/compiled/_next/static/chunks/5303-c65c9c6aeb263a0d.js +1 -0
  27. khoj/interface/compiled/_next/static/chunks/5329.f8b3c5b3d16159cd.js +1 -0
  28. khoj/interface/compiled/_next/static/chunks/5427-13d6ffd380fdfab7.js +1 -0
  29. khoj/interface/compiled/_next/static/chunks/5477-18323501c445315e.js +1 -0
  30. khoj/interface/compiled/_next/static/chunks/558-c14e76cff03f6a60.js +1 -0
  31. khoj/interface/compiled/_next/static/chunks/{7211-7fedd2ee3655239c.js → 5639-09e2009a2adedf8b.js} +43 -19
  32. khoj/interface/compiled/_next/static/chunks/5830.8876eccb82da9b7d.js +262 -0
  33. khoj/interface/compiled/_next/static/chunks/6230.88a71d8145347b3f.js +1 -0
  34. khoj/interface/compiled/_next/static/chunks/{6434.7afea9648e238ad5.js → 6434.e6cd986d690f2cef.js} +1 -1
  35. khoj/interface/compiled/_next/static/chunks/7127-880018d56c512906.js +1 -0
  36. khoj/interface/compiled/_next/static/chunks/{3305.1fc7297ba154ee95.js → 7161.77e0530a40ad5ca8.js} +1 -1
  37. khoj/interface/compiled/_next/static/chunks/{5555.f7cf9795d675de51.js → 7303.d0612f812a967a08.js} +2 -2
  38. khoj/interface/compiled/_next/static/chunks/7505.c31027a3695bdebb.js +148 -0
  39. khoj/interface/compiled/_next/static/chunks/{8673.be44c4d9e4f1d084.js → 7760.35649cc21d9585bd.js} +1 -1
  40. khoj/interface/compiled/_next/static/chunks/83.48e2db193a940052.js +1 -0
  41. khoj/interface/compiled/_next/static/chunks/8427.844694e06133fb51.js +1 -0
  42. khoj/interface/compiled/_next/static/chunks/8665.4db7e6b2e8933497.js +174 -0
  43. khoj/interface/compiled/_next/static/chunks/{7890.f681eb1d1f83bea2.js → 8694.2bd9c2f65d8c5847.js} +1 -1
  44. khoj/interface/compiled/_next/static/chunks/872.caf84cc1a39ae59f.js +1 -0
  45. khoj/interface/compiled/_next/static/chunks/{3332.6313db5217bb1b67.js → 8888.ebe0e552b59e7fed.js} +1 -1
  46. khoj/interface/compiled/_next/static/chunks/8890.6e8a59e4de6978bc.js +215 -0
  47. khoj/interface/compiled/_next/static/chunks/8950.5f2272e0ac923f9e.js +1 -0
  48. khoj/interface/compiled/_next/static/chunks/90542734.2c21f16f18b22411.js +1 -0
  49. khoj/interface/compiled/_next/static/chunks/9202.c703864fcedc8d1f.js +63 -0
  50. khoj/interface/compiled/_next/static/chunks/{9433.b1b5f5d050c43e3c.js → 9245.a04e92d034540234.js} +6 -6
  51. khoj/interface/compiled/_next/static/chunks/9320.6aca4885d541aa44.js +24 -0
  52. khoj/interface/compiled/_next/static/chunks/945-74376499b067d28e.js +1 -0
  53. khoj/interface/compiled/_next/static/chunks/9535.f78cd92d03331e55.js +1 -0
  54. khoj/interface/compiled/_next/static/chunks/9537-d9ab442ce15d1e20.js +1 -0
  55. khoj/interface/compiled/_next/static/chunks/9568-0d60ac475f4cc538.js +1 -0
  56. khoj/interface/compiled/_next/static/chunks/9968.b111fc002796da81.js +1 -0
  57. khoj/interface/compiled/_next/static/chunks/app/agents/layout-4e2a134ec26aa606.js +1 -0
  58. khoj/interface/compiled/_next/static/chunks/app/agents/page-5db6ad18da10d353.js +1 -0
  59. khoj/interface/compiled/_next/static/chunks/app/automations/{layout-7f5c33a70e46b3af.js → layout-63603d2cb33279f7.js} +1 -1
  60. khoj/interface/compiled/_next/static/chunks/app/automations/{page-1c2280ae9678b4ce.js → page-6271e2e31c7571d1.js} +1 -1
  61. khoj/interface/compiled/_next/static/chunks/app/chat/layout-ad4d1792ab1a4108.js +1 -0
  62. khoj/interface/compiled/_next/static/chunks/app/chat/page-76fc915800aa90f4.js +1 -0
  63. khoj/interface/compiled/_next/static/chunks/app/page-a19a597629e87fb8.js +1 -0
  64. khoj/interface/compiled/_next/static/chunks/app/search/page-fa366ac14b228688.js +1 -0
  65. khoj/interface/compiled/_next/static/chunks/app/settings/{layout-8a22f370d3eaeed3.js → layout-f88cedfe9ad4df7c.js} +1 -1
  66. khoj/interface/compiled/_next/static/chunks/app/settings/{page-4e8fdd30a3238357.js → page-8f9a85f96088c18b.js} +1 -1
  67. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-abb6c5f4239ad7be.js +1 -0
  68. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-27560c92db5fc2d9.js → page-ed7787cf4938b8e3.js} +1 -1
  69. khoj/interface/compiled/_next/static/chunks/{d3ac728e-07f1976c92cfb109.js → d3ac728e-4c56e7f41db266b7.js} +1 -1
  70. khoj/interface/compiled/_next/static/chunks/f3e3247b-1758d4651e4457c2.js +10 -0
  71. khoj/interface/compiled/_next/static/chunks/{main-63d6432f34cdf74b.js → main-fc8e0fefa2ef3d8c.js} +1 -1
  72. khoj/interface/compiled/_next/static/chunks/webpack-92ce8aaf95718ec4.js +1 -0
  73. khoj/interface/compiled/_next/static/css/{e1bf03aa79521f86.css → 02f60900b0d89ec7.css} +1 -1
  74. khoj/interface/compiled/_next/static/css/37a73b87f02df402.css +1 -0
  75. khoj/interface/compiled/_next/static/css/93eeacc43e261162.css +1 -0
  76. khoj/interface/compiled/_next/static/css/{e4eb883b5265d372.css → db7d90554f3ab82b.css} +1 -1
  77. khoj/interface/compiled/agents/index.html +2 -2
  78. khoj/interface/compiled/agents/index.txt +3 -3
  79. khoj/interface/compiled/automations/index.html +2 -2
  80. khoj/interface/compiled/automations/index.txt +4 -4
  81. khoj/interface/compiled/chat/index.html +2 -2
  82. khoj/interface/compiled/chat/index.txt +3 -3
  83. khoj/interface/compiled/index.html +2 -2
  84. khoj/interface/compiled/index.txt +3 -3
  85. khoj/interface/compiled/search/index.html +2 -2
  86. khoj/interface/compiled/search/index.txt +3 -3
  87. khoj/interface/compiled/settings/index.html +2 -2
  88. khoj/interface/compiled/settings/index.txt +5 -5
  89. khoj/interface/compiled/share/chat/index.html +2 -2
  90. khoj/interface/compiled/share/chat/index.txt +3 -3
  91. khoj/processor/tools/online_search.py +8 -1
  92. {khoj-1.42.7.dev7.dist-info → khoj-1.42.7.dev11.dist-info}/METADATA +1 -1
  93. {khoj-1.42.7.dev7.dist-info → khoj-1.42.7.dev11.dist-info}/RECORD +103 -101
  94. khoj/interface/compiled/_next/static/chunks/1243.ea2826fb35adb15a.js +0 -1
  95. khoj/interface/compiled/_next/static/chunks/133.392ae90c3b2a67f2.js +0 -1
  96. khoj/interface/compiled/_next/static/chunks/1592.b069bdb7aaddd2eb.js +0 -5
  97. khoj/interface/compiled/_next/static/chunks/1915-ab4353eaca76f690.js +0 -1
  98. khoj/interface/compiled/_next/static/chunks/2069.f060659791c0c484.js +0 -1
  99. khoj/interface/compiled/_next/static/chunks/2170.45431769330fa5b7.js +0 -134
  100. khoj/interface/compiled/_next/static/chunks/2327-024b9e0bd6d8c9eb.js +0 -1
  101. khoj/interface/compiled/_next/static/chunks/3237.c4754f02f1a388cb.js +0 -1
  102. khoj/interface/compiled/_next/static/chunks/3451.421db0b49fdbd881.js +0 -252
  103. khoj/interface/compiled/_next/static/chunks/3460.39c2b9b6a3898384.js +0 -159
  104. khoj/interface/compiled/_next/static/chunks/4327.238d15c09a039b8b.js +0 -60
  105. khoj/interface/compiled/_next/static/chunks/4357-d86d3401f6f6f802.js +0 -1
  106. khoj/interface/compiled/_next/static/chunks/4363-4efaf12abe696251.js +0 -20
  107. khoj/interface/compiled/_next/static/chunks/4415.e0c0da5eedae4dd7.js +0 -47
  108. khoj/interface/compiled/_next/static/chunks/4447-5d44807c40355b1a.js +0 -1
  109. khoj/interface/compiled/_next/static/chunks/4650.41f041da0ad365ad.js +0 -215
  110. khoj/interface/compiled/_next/static/chunks/479.a7e0c9cfc376a695.js +0 -1
  111. khoj/interface/compiled/_next/static/chunks/4872.5422e8324272ab40.js +0 -1
  112. khoj/interface/compiled/_next/static/chunks/5061.79a660faed0e16a9.js +0 -1
  113. khoj/interface/compiled/_next/static/chunks/5279.85d537880b8041ae.js +0 -24
  114. khoj/interface/compiled/_next/static/chunks/5402.b9460f1b16b57e92.js +0 -63
  115. khoj/interface/compiled/_next/static/chunks/5427-442f34b514b9fc26.js +0 -1
  116. khoj/interface/compiled/_next/static/chunks/5473-921e17a6177f9729.js +0 -1
  117. khoj/interface/compiled/_next/static/chunks/5477-b91e9926cfc3095c.js +0 -1
  118. khoj/interface/compiled/_next/static/chunks/5621-415bdc6c7b57af11.js +0 -1
  119. khoj/interface/compiled/_next/static/chunks/58.f4bd8a3c9d88f5fe.js +0 -46
  120. khoj/interface/compiled/_next/static/chunks/5854-745bea90ea77a1c7.js +0 -1
  121. khoj/interface/compiled/_next/static/chunks/5978.ddc72cd73130aadc.js +0 -1
  122. khoj/interface/compiled/_next/static/chunks/6663-133d5db72d2d5f24.js +0 -1
  123. khoj/interface/compiled/_next/static/chunks/7127-a75d1b7b16c90ab0.js +0 -1
  124. khoj/interface/compiled/_next/static/chunks/7140.4be689873f6a2d1f.js +0 -116
  125. khoj/interface/compiled/_next/static/chunks/7647-2aa4cf0e69b7a84d.js +0 -1
  126. khoj/interface/compiled/_next/static/chunks/7836.86884157d53d23a1.js +0 -117
  127. khoj/interface/compiled/_next/static/chunks/7953.f6fc335a23efb959.js +0 -1
  128. khoj/interface/compiled/_next/static/chunks/8254.3145a4fbdcfdca46.js +0 -1
  129. khoj/interface/compiled/_next/static/chunks/8400.c95e4e79bcd79a56.js +0 -78
  130. khoj/interface/compiled/_next/static/chunks/8698.a088118fef40d302.js +0 -1
  131. khoj/interface/compiled/_next/static/chunks/9022.33974a513a281fd2.js +0 -151
  132. khoj/interface/compiled/_next/static/chunks/90542734.9e6e44b1b45b30fe.js +0 -1
  133. khoj/interface/compiled/_next/static/chunks/9259-d8bcd9da9e80c81e.js +0 -1
  134. khoj/interface/compiled/_next/static/chunks/9334-b22127fe2d39bc60.js +0 -1
  135. khoj/interface/compiled/_next/static/chunks/9822.34f293973c4e9b04.js +0 -1
  136. khoj/interface/compiled/_next/static/chunks/app/agents/layout-e00fb81dca656a10.js +0 -1
  137. khoj/interface/compiled/_next/static/chunks/app/agents/page-e18e67cff45758c8.js +0 -1
  138. khoj/interface/compiled/_next/static/chunks/app/chat/layout-d5ae861e1ade9d08.js +0 -1
  139. khoj/interface/compiled/_next/static/chunks/app/chat/page-0cb925fc23ccec3b.js +0 -1
  140. khoj/interface/compiled/_next/static/chunks/app/page-a4b97dd0c2a70cfb.js +0 -1
  141. khoj/interface/compiled/_next/static/chunks/app/search/page-44072d929427ee56.js +0 -1
  142. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-b3f7ae1ef8871d30.js +0 -1
  143. khoj/interface/compiled/_next/static/chunks/ebbfb5c1-a73c51b6a41a5ff6.js +0 -10
  144. khoj/interface/compiled/_next/static/chunks/webpack-34ac812e4e4e9a50.js +0 -1
  145. khoj/interface/compiled/_next/static/css/1e9b757ee2a2b34b.css +0 -1
  146. khoj/interface/compiled/_next/static/css/ee66643a6a5bf71c.css +0 -1
  147. /khoj/interface/compiled/_next/static/chunks/{7200-cabc57d26c4b32da.js → 7200-ac3b2e37ff30e126.js} +0 -0
  148. /khoj/interface/compiled/_next/static/chunks/{8667-adbe6017a66cef10.js → 8667-50b03a89e82e0ba7.js} +0 -0
  149. /khoj/interface/compiled/_next/static/chunks/app/_not-found/{page-0ec97c4970898f2d.js → page-84f94d15b2da4eac.js} +0 -0
  150. /khoj/interface/compiled/_next/static/chunks/app/{layout-baa6e7974e560a7a.js → layout-a0c5495d6c582cea.js} +0 -0
  151. /khoj/interface/compiled/_next/static/chunks/{fd9d1056-7454f5bbfcf5bd5b.js → fd9d1056-aa94101ec5388dba.js} +0 -0
  152. /khoj/interface/compiled/_next/static/{ewACU62P02Uk-G-qzM6Ds → oIcJmH5ry9NelqshWDMlq}/_buildManifest.js +0 -0
  153. /khoj/interface/compiled/_next/static/{ewACU62P02Uk-G-qzM6Ds → oIcJmH5ry9NelqshWDMlq}/_ssgManifest.js +0 -0
  154. {khoj-1.42.7.dev7.dist-info → khoj-1.42.7.dev11.dist-info}/WHEEL +0 -0
  155. {khoj-1.42.7.dev7.dist-info → khoj-1.42.7.dev11.dist-info}/entry_points.txt +0 -0
  156. {khoj-1.42.7.dev7.dist-info → khoj-1.42.7.dev11.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,10 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1860],{47833:function(t,e,a){a.d(e,{C1:function(){return o},Fh:function(){return S},Lf:function(){return ed},XO:function(){return x},Yn:function(){return ec},ZH:function(){return P},aH:function(){return ey},dW:function(){return eh},gU:function(){return eg},jr:function(){return c},us:function(){return R}});var l=a(39263),r=a(24568),i=a(9242),n=a(54166),s=a(15440),h=a(90705),o=(0,n.eW)(async(t,e,a)=>{let l,h;let o=e.useHtmlLabels||(0,n.ku)(n.nV()?.htmlLabels);l=a||"node default";let d=t.insert("g").attr("class",l).attr("id",e.domId||e.id),c=d.insert("g").attr("class","label").attr("style",(0,i.R7)(e.labelStyle));h=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let g=await (0,r.rw)(c,(0,n.oO)((0,i.SH)(h),(0,n.nV)()),{useHtmlLabels:o,width:e.width||n.nV().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),y=g.getBBox(),f=(e?.padding??0)/2;if(o){let t=g.children[0],e=(0,s.Ys)(g),a=t.getElementsByTagName("img");if(a){let t=""===h.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=(0,n.nV)().fontSize?(0,n.nV)().fontSize:window.getComputedStyle(document.body).fontSize,[a=n.vZ.fontSize]=(0,i.VG)(t),l=5*a+"px";e.style.minWidth=l,e.style.maxWidth=l}else e.style.width="100%";a(e)}(0,n.eW)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return o?c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):c.attr("transform","translate(0, "+-y.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:d,bbox:y,halfPadding:f,label:c}},"labelHelper"),d=(0,n.eW)(async(t,e,a)=>{let l=a.useHtmlLabels||(0,n.ku)(n.nV()?.flowchart?.htmlLabels),h=t.insert("g").attr("class","label").attr("style",a.labelStyle||""),o=await (0,r.rw)(h,(0,n.oO)((0,i.SH)(e),(0,n.nV)()),{useHtmlLabels:l,width:a.width||n.nV()?.flowchart?.wrappingWidth,style:a.labelStyle,addSvgBackground:!!a.icon||!!a.img}),d=o.getBBox(),c=a.padding/2;if((0,n.ku)(n.nV()?.flowchart?.htmlLabels)){let t=o.children[0],e=(0,s.Ys)(o);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return l?h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):h.attr("transform","translate(0, "+-d.height/2+")"),a.centerLabel&&h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.insert("rect",":first-child"),{shapeSvg:t,bbox:d,halfPadding:c,label:h}},"insertLabel"),c=(0,n.eW)((t,e)=>{let a=e.node().getBBox();t.width=a.width,t.height=a.height},"updateNodeBounds"),g=(0,n.eW)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function y(t){let e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function f(t,e,a,l,r,i){let n=[],s=a-t,h=2*Math.PI/(s/i),o=e+(l-e)/2;for(let e=0;e<=50;e++){let a=t+e/50*s,l=o+r*Math.sin(h*(a-t));n.push({x:a,y:l})}return n}function p(t,e,a,l,r,i){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}(0,n.eW)(y,"createPathFromPoints"),(0,n.eW)(f,"generateFullSineWavePoints"),(0,n.eW)(p,"generateCirclePoints");var u=(0,n.eW)((t,e)=>{var a,l,r=t.x,i=t.y,n=e.x-r,s=e.y-i,h=t.width/2,o=t.height/2;return Math.abs(s)*h>Math.abs(n)*o?(s<0&&(o=-o),a=0===s?0:o*n/s,l=o):(n<0&&(h=-h),a=h,l=0===n?0:h*s/n),{x:r+a,y:i+l}},"intersectRect");function m(t,e){e&&t.attr("style",e)}async function w(t){let e=(0,s.Ys)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=e.append("xhtml:div"),l=t.label;t.label&&(0,n.l0)(t.label)&&(l=await (0,n.uT)(t.label.replace(n.SY.lineBreakRegex,"\n"),(0,n.nV)()));let r=t.isNode?"nodeLabel":"edgeLabel";return a.html('<span class="'+r+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+l+"</span>"),m(a,t.labelStyle),a.style("display","inline-block"),a.style("padding-right","1px"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,n.eW)(m,"applyStyle"),(0,n.eW)(w,"addHtmlLabel");var x=(0,n.eW)(async(t,e,a,l)=>{let r=t||"";if("object"==typeof r&&(r=r[0]),(0,n.ku)((0,n.nV)().flowchart.htmlLabels)){r=r.replace(/\\n|\n/g,"<br />"),n.cM.info("vertexText"+r);let t={isNode:l,label:(0,i.SH)(r).replace(/fa[blrs]?:fa-[\w-]+/g,t=>`<i class='${t.replace(":"," ")}'></i>`),labelStyle:e?e.replace("fill:","color:"):e};return await w(t)}{let t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));for(let e of"string"==typeof r?r.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(r)?r:[]){let l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),a?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=e.trim(),t.appendChild(l)}return t}},"createLabel"),b=(0,n.eW)((t,e,a,l,r)=>["M",t+r,e,"H",t+a-r,"A",r,r,0,0,1,t+a,e+r,"V",e+l-r,"A",r,r,0,0,1,t+a-r,e+l,"H",t+r,"A",r,r,0,0,1,t,e+l-r,"V",e+r,"A",r,r,0,0,1,t+r,e,"Z"].join(" "),"createRoundedRectPathD"),$=(0,n.eW)(t=>{let{handDrawnSeed:e}=(0,n.nV)();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),k=(0,n.eW)(t=>{let e=M([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),M=(0,n.eW)(t=>{let e=new Map;return t.forEach(t=>{let[a,l]=t.split(":");e.set(a.trim(),l?.trim())}),e},"styles2Map"),S=(0,n.eW)(t=>"color"===t||"font-size"===t||"font-family"===t||"font-weight"===t||"font-style"===t||"text-decoration"===t||"text-align"===t||"text-transform"===t||"line-height"===t||"letter-spacing"===t||"word-spacing"===t||"text-shadow"===t||"text-overflow"===t||"white-space"===t||"word-wrap"===t||"word-break"===t||"overflow-wrap"===t||"hyphens"===t,"isLabelStyle"),D=(0,n.eW)(t=>{let{stylesArray:e}=k(t),a=[],l=[],r=[],i=[];return e.forEach(t=>{let e=t[0];S(e)?a.push(t.join(":")+" !important"):(l.push(t.join(":")+" !important"),e.includes("stroke")&&r.push(t.join(":")+" !important"),"fill"===e&&i.push(t.join(":")+" !important"))}),{labelStyles:a.join(";"),nodeStyles:l.join(";"),stylesArray:e,borderStyles:r,backgroundStyles:i}},"styles2String"),W=(0,n.eW)((t,e)=>{let{themeVariables:a,handDrawnSeed:l}=(0,n.nV)(),{nodeBorder:r,mainBkg:i}=a,{stylesMap:s}=k(t);return Object.assign({roughness:.7,fill:s.get("fill")||i,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||r,seed:l,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},e)},"userNodeOverrides"),v=(0,n.eW)(async(t,e)=>{let a;n.cM.info("Creating subgraph rect for ",e.id,e);let i=(0,n.nV)(),{themeVariables:o,handDrawnSeed:d}=i,{clusterBkg:c,clusterBorder:g}=o,{labelStyles:y,nodeStyles:f,borderStyles:p,backgroundStyles:m}=D(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),x=(0,n.ku)(i.flowchart.htmlLabels),$=w.insert("g").attr("class","cluster-label "),k=await (0,r.rw)($,e.label,{style:e.labelStyle,useHtmlLabels:x,isNode:!0}),M=k.getBBox();if((0,n.ku)(i.flowchart.htmlLabels)){let t=k.children[0],e=(0,s.Ys)(k);M=t.getBoundingClientRect(),e.attr("width",M.width),e.attr("height",M.height)}let S=e.width<=M.width+e.padding?M.width+e.padding:e.width;e.width<=M.width+e.padding?e.diff=(S-e.width)/2-e.padding:e.diff=-e.padding;let v=e.height,C=e.x-S/2,B=e.y-v/2;if(n.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=h.Z.svg(w),l=W(e,{roughness:.7,fill:c,stroke:g,fillWeight:3,seed:d}),r=t.path(b(C,B,S,v,0),l);(a=w.insert(()=>(n.cM.debug("Rough node insert CXC",r),r),":first-child")).select("path:nth-child(2)").attr("style",p.join(";")),a.select("path").attr("style",m.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",f).attr("rx",e.rx).attr("ry",e.ry).attr("x",C).attr("y",B).attr("width",S).attr("height",v);let{subGraphTitleTopMargin:N}=(0,l.L)(i);if($.attr("transform",`translate(${e.x-M.width/2}, ${e.y-e.height/2+N})`),y){let t=$.select("span");t&&t.attr("style",y)}let A=a.node().getBBox();return e.offsetX=0,e.width=A.width,e.height=A.height,e.offsetY=M.height-e.padding/2,e.intersect=function(t){return u(e,t)},{cluster:w,labelBBox:M}},"rect"),C=(0,n.eW)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.id),l=a.insert("rect",":first-child"),r=0*e.padding,i=r/2;l.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-i).attr("y",e.y-e.height/2-i).attr("width",e.width+r).attr("height",e.height+r).attr("fill","none");let n=l.node().getBBox();return e.width=n.width,e.height=n.height,e.intersect=function(t){return u(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),B=(0,n.eW)(async(t,e)=>{let a;let l=(0,n.nV)(),{themeVariables:r,handDrawnSeed:i}=l,{altBackground:o,compositeBackground:d,compositeTitleBackground:c,nodeBorder:g}=r,y=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),f=y.insert("g",":first-child"),p=y.insert("g").attr("class","cluster-label"),m=y.append("rect"),w=p.node().appendChild(await x(e.label,e.labelStyle,void 0,!0)),$=w.getBBox();if((0,n.ku)(l.flowchart.htmlLabels)){let t=w.children[0],e=(0,s.Ys)(w);$=t.getBoundingClientRect(),e.attr("width",$.width),e.attr("height",$.height)}let k=0*e.padding,M=(e.width<=$.width+e.padding?$.width+e.padding:e.width)+k;e.width<=$.width+e.padding?e.diff=(M-e.width)/2-e.padding:e.diff=-e.padding;let S=e.height+k,D=e.height+k-$.height-6,W=e.x-M/2,v=e.y-S/2;e.width=M;let C=e.y-e.height/2-k/2+$.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),l=h.Z.svg(y),r=e.rx||e.ry?l.path(b(W,v,M,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:g,seed:i}):l.rectangle(W,v,M,S,{seed:i});a=y.insert(()=>r,":first-child");let n=l.rectangle(W,C,M,D,{fill:t?o:d,fillStyle:t?"hachure":"solid",stroke:g,seed:i});a=y.insert(()=>r,":first-child"),m=y.insert(()=>n)}else(a=f.insert("rect",":first-child")).attr("class","outer").attr("x",W).attr("y",v).attr("width",M).attr("height",S).attr("data-look",e.look),m.attr("class","inner").attr("x",W).attr("y",C).attr("width",M).attr("height",D);p.attr("transform",`translate(${e.x-$.width/2}, ${v+1-((0,n.ku)(l.flowchart.htmlLabels)?0:3)})`);let B=a.node().getBBox();return e.height=B.height,e.offsetX=0,e.offsetY=$.height-e.padding/2,e.labelBBox=$,e.intersect=function(t){return u(e,t)},{cluster:y,labelBBox:$}},"roundedWithTitle"),N=(0,n.eW)(async(t,e)=>{let a;n.cM.info("Creating subgraph rect for ",e.id,e);let i=(0,n.nV)(),{themeVariables:o,handDrawnSeed:d}=i,{clusterBkg:c,clusterBorder:g}=o,{labelStyles:y,nodeStyles:f,borderStyles:p,backgroundStyles:m}=D(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),x=(0,n.ku)(i.flowchart.htmlLabels),$=w.insert("g").attr("class","cluster-label "),k=await (0,r.rw)($,e.label,{style:e.labelStyle,useHtmlLabels:x,isNode:!0,width:e.width}),M=k.getBBox();if((0,n.ku)(i.flowchart.htmlLabels)){let t=k.children[0],e=(0,s.Ys)(k);M=t.getBoundingClientRect(),e.attr("width",M.width),e.attr("height",M.height)}let S=e.width<=M.width+e.padding?M.width+e.padding:e.width;e.width<=M.width+e.padding?e.diff=(S-e.width)/2-e.padding:e.diff=-e.padding;let v=e.height,C=e.x-S/2,B=e.y-v/2;if(n.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=h.Z.svg(w),l=W(e,{roughness:.7,fill:c,stroke:g,fillWeight:4,seed:d}),r=t.path(b(C,B,S,v,e.rx),l);(a=w.insert(()=>(n.cM.debug("Rough node insert CXC",r),r),":first-child")).select("path:nth-child(2)").attr("style",p.join(";")),a.select("path").attr("style",m.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",f).attr("rx",e.rx).attr("ry",e.ry).attr("x",C).attr("y",B).attr("width",S).attr("height",v);let{subGraphTitleTopMargin:N}=(0,l.L)(i);if($.attr("transform",`translate(${e.x-M.width/2}, ${e.y-e.height/2+N})`),y){let t=$.select("span");t&&t.attr("style",y)}let A=a.node().getBBox();return e.offsetX=0,e.width=A.width,e.height=A.height,e.offsetY=M.height-e.padding/2,e.intersect=function(t){return u(e,t)},{cluster:w,labelBBox:M}},"kanbanSection"),A={rect:v,squareRect:v,roundedWithTitle:B,noteGroup:C,divider:(0,n.eW)((t,e)=>{let a;let{themeVariables:l,handDrawnSeed:r}=(0,n.nV)(),{nodeBorder:i}=l,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),o=s.insert("g",":first-child"),d=0*e.padding,c=e.width+d;e.diff=-e.padding;let g=e.height+d,y=e.x-c/2,f=e.y-g/2;if(e.width=c,"handDrawn"===e.look){let t=h.Z.svg(s).rectangle(y,f,c,g,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:i,seed:r});a=s.insert(()=>t,":first-child")}else(a=o.insert("rect",":first-child")).attr("class","divider").attr("x",y).attr("y",f).attr("width",c).attr("height",g).attr("data-look",e.look);let p=a.node().getBBox();return e.height=p.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return u(e,t)},{cluster:s,labelBBox:{}}},"divider"),kanbanSection:N},L=new Map,R=(0,n.eW)(async(t,e)=>{let a=e.shape||"rect",l=await A[a](t,e);return L.set(e.id,l),l},"insertCluster"),P=(0,n.eW)(()=>{L=new Map},"clear");function Z(t,e,a,l){var r=t.x,i=t.y,n=r-l.x,s=i-l.y,h=Math.sqrt(e*e*s*s+a*a*n*n),o=Math.abs(e*a*n/h);l.x<r&&(o=-o);var d=Math.abs(e*a*s/h);return l.y<i&&(d=-d),{x:r+o,y:i+d}}function I(t,e,a){return Z(t,e,e,a)}function T(t,e,a,l){var r,i,n,s,h,o,d,c,g,y,f,p,u;if(r=e.y-t.y,n=t.x-e.x,h=e.x*t.y-t.x*e.y,g=r*a.x+n*a.y+h,y=r*l.x+n*l.y+h,!(0!==g&&0!==y&&E(g,y))&&(i=l.y-a.y,s=a.x-l.x,o=l.x*a.y-a.x*l.y,d=i*t.x+s*t.y+o,c=i*e.x+s*e.y+o,!(0!==d&&0!==c&&E(d,c))&&0!=(f=r*s-i*n)))return p=Math.abs(f/2),{x:(u=n*o-s*h)<0?(u-p)/f:(u+p)/f,y:(u=i*h-r*o)<0?(u-p)/f:(u+p)/f}}function E(t,e){return t*e>0}function H(t,e,a){let l=t.x,r=t.y,i=[],n=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),s=Math.min(s,t.y)}):(n=Math.min(n,e.x),s=Math.min(s,e.y));let h=l-t.width/2-n,o=r-t.height/2-s;for(let l=0;l<e.length;l++){let r=e[l],n=e[l<e.length-1?l+1:0],s=T(t,a,{x:h+r.x,y:o+r.y},{x:h+n.x,y:o+n.y});s&&i.push(s)}return i.length?(i.length>1&&i.sort(function(t,e){let l=t.x-a.x,r=t.y-a.y,i=Math.sqrt(l*l+r*r),n=e.x-a.x,s=e.y-a.y,h=Math.sqrt(n*n+s*s);return i<h?-1:i===h?0:1}),i[0]):t}(0,n.eW)(function(t,e){return t.intersect(e)},"intersectNode"),(0,n.eW)(Z,"intersectEllipse"),(0,n.eW)(I,"intersectCircle"),(0,n.eW)(T,"intersectLine"),(0,n.eW)(E,"sameSign"),(0,n.eW)(H,"intersectPolygon");var j={circle:I,polygon:H,rect:u};function V(t,e){let{labelStyles:a}=D(e);e.labelStyle=a;let l=g(e),r=l;l||(r="anchor");let s=t.insert("g").attr("class",r).attr("id",e.domId||e.id),{cssStyles:o}=e,d=h.Z.svg(s),y=W(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(y.roughness=0);let f=d.circle(0,0,2,y),p=s.insert(()=>f,":first-child");return p.attr("class","anchor").attr("style",(0,i.R7)(o)),c(e,p),e.intersect=function(t){return n.cM.info("Circle intersect",e,1,t),j.circle(e,1,t)},s}function Y(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),h=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(h>1)throw Error("The given radii are too small to create an arc between the points.");let o=Math.sqrt(1-h**2),d=(t+a)/2+o*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-o*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),y=Math.atan2((l-c)/i,(a-d)/r)-g;n&&y<0&&(y+=2*Math.PI),!n&&y>0&&(y-=2*Math.PI);let f=[];for(let t=0;t<20;t++){let e=g+t/19*y,a=d+r*Math.cos(e),l=c+i*Math.sin(e);f.push({x:a,y:l})}return f}async function q(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await o(t,e,g(e)),n=i.width+e.padding+20,s=i.height+e.padding,d=s/2,f=d/(2.5+s/50),{cssStyles:p}=e,u=[{x:n/2,y:-s/2},{x:-n/2,y:-s/2},...Y(-n/2,-s/2,-n/2,s/2,f,d,!1),{x:n/2,y:s/2},...Y(n/2,s/2,n/2,-s/2,f,d,!0)],m=h.Z.svg(r),w=W(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let x=y(u),b=m.path(x,w),$=r.insert(()=>b,":first-child");return $.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),$.attr("transform",`translate(${f/2}, 0)`),c(e,$),e.intersect=function(t){return j.polygon(e,u,t)},r}function O(t,e,a,l){return t.insert("polygon",":first-child").attr("points",l.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+a/2+")")}async function _(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=n.height+e.padding,d=n.width+e.padding+12,f=-s,p=[{x:12,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+12},{x:12,y:f}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=W(e,{}),r=y(p),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-d/2}, ${s/2})`),u&&a.attr("style",u)}else a=O(i,d,s,p);return r&&a.attr("style",r),c(e,a),e.intersect=function(t){return j.polygon(e,p,t)},i}function z(t,e){let{nodeStyles:a}=D(e);e.label="";let l=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),{cssStyles:r}=e,i=Math.max(28,e.width??0),n=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}],s=h.Z.svg(l),o=W(e,{});"handDrawn"!==e.look&&(o.roughness=0,o.fillStyle="solid");let d=y(n),c=s.path(d,o),f=l.insert(()=>c,":first-child");return r&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",r),a&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",a),e.width=28,e.height=28,e.intersect=function(t){return j.polygon(e,n,t)},l}async function F(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:s,bbox:d,halfPadding:y}=await o(t,e,g(e)),f=d.width/2+y,{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(s),l=W(e,{}),r=t.circle(0,0,2*f,l);(a=s.insert(()=>r,":first-child")).attr("class","basic label-container").attr("style",(0,i.R7)(p))}else a=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",r).attr("r",f).attr("cx",0).attr("cy",0);return c(e,a),e.intersect=function(t){return n.cM.info("Circle intersect",e,f,t),j.circle(e,f,t)},s}function X(t){let e=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),l=2*t,r={x:l/2*e,y:l/2*a},i={x:-(l/2)*e,y:l/2*a},n={x:-(l/2)*e,y:-(l/2)*a},s={x:l/2*e,y:-(l/2)*a};return`M ${i.x},${i.y} L ${s.x},${s.y}
2
+ M ${r.x},${r.y} L ${n.x},${n.y}`}function J(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a,e.label="";let r=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),i=Math.max(30,e?.width??0),{cssStyles:s}=e,o=h.Z.svg(r),d=W(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");let y=o.circle(0,0,2*i,d),f=X(i),p=o.path(f,d),u=r.insert(()=>y,":first-child");return u.insert(()=>p),s&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",s),l&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",l),c(e,u),e.intersect=function(t){return n.cM.info("crossedCircle intersect",e,{radius:i,point:t}),j.circle(e,i,t)},r}function U(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function G(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=i.width+(e.padding??0),d=i.height+(e.padding??0),f=Math.max(5,.1*d),{cssStyles:p}=e,u=[...U(s/2,-d/2,f,30,-90,0),{x:-s/2-f,y:f},...U(s/2+2*f,-f,f,20,-180,-270),...U(s/2+2*f,f,f,20,-90,-180),{x:-s/2-f,y:-d/2},...U(s/2,d/2,f,20,0,90)],m=[{x:s/2,y:-d/2-f},{x:-s/2,y:-d/2-f},...U(s/2,-d/2,f,20,-90,0),{x:-s/2-f,y:-f},...U(s/2+.1*s,-f,f,20,-180,-270),...U(s/2+.1*s,f,f,20,-90,-180),{x:-s/2-f,y:d/2},...U(s/2,d/2,f,20,0,90),{x:-s/2,y:d/2+f},{x:s/2,y:d/2+f}],w=h.Z.svg(r),x=W(e,{fill:"none"});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let b=y(u).replace("Z",""),$=w.path(b,x),k=y(m),M=w.path(k,{...x}),S=r.insert("g",":first-child");return S.insert(()=>M,":first-child").attr("stroke-opacity",0),S.insert(()=>$,":first-child"),S.attr("class","text"),p&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),S.attr("transform",`translate(${f}, 0)`),n.attr("transform",`translate(${-s/2+f-(i.x-(i.left??0))},${-d/2+(e.padding??0)/2-(i.y-(i.top??0))})`),c(e,S),e.intersect=function(t){return j.polygon(e,m,t)},r}function K(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:i,y:o})}return n}async function Q(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=i.width+(e.padding??0),d=i.height+(e.padding??0),f=Math.max(5,.1*d),{cssStyles:p}=e,u=[...K(s/2,-d/2,f,20,-90,0),{x:s/2+f,y:-f},...K(s/2+2*f,-f,f,20,-180,-270),...K(s/2+2*f,f,f,20,-90,-180),{x:s/2+f,y:d/2},...K(s/2,d/2,f,20,0,90)],m=[{x:-s/2,y:-d/2-f},{x:s/2,y:-d/2-f},...K(s/2,-d/2,f,20,-90,0),{x:s/2+f,y:-f},...K(s/2+2*f,-f,f,20,-180,-270),...K(s/2+2*f,f,f,20,-90,-180),{x:s/2+f,y:d/2},...K(s/2,d/2,f,20,0,90),{x:s/2,y:d/2+f},{x:-s/2,y:d/2+f}],w=h.Z.svg(r),x=W(e,{fill:"none"});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let b=y(u).replace("Z",""),$=w.path(b,x),k=y(m),M=w.path(k,{...x}),S=r.insert("g",":first-child");return S.insert(()=>M,":first-child").attr("stroke-opacity",0),S.insert(()=>$,":first-child"),S.attr("class","text"),p&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),S.attr("transform",`translate(${-f}, 0)`),n.attr("transform",`translate(${-s/2+(e.padding??0)/2-(i.x-(i.left??0))},${-d/2+(e.padding??0)/2-(i.y-(i.top??0))})`),c(e,S),e.intersect=function(t){return j.polygon(e,m,t)},r}function tt(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function te(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=i.width+(e.padding??0),d=i.height+(e.padding??0),f=Math.max(5,.1*d),{cssStyles:p}=e,u=[...tt(s/2,-d/2,f,30,-90,0),{x:-s/2-f,y:f},...tt(s/2+2*f,-f,f,20,-180,-270),...tt(s/2+2*f,f,f,20,-90,-180),{x:-s/2-f,y:-d/2},...tt(s/2,d/2,f,20,0,90)],m=[...tt(-s/2+f+f/2,-d/2,f,20,-90,-180),{x:s/2-f/2,y:f},...tt(-s/2-f/2,-f,f,20,0,90),...tt(-s/2-f/2,f,f,20,-90,0),{x:s/2-f/2,y:-f},...tt(-s/2+f+f/2,d/2,f,30,-180,-270)],w=[{x:s/2,y:-d/2-f},{x:-s/2,y:-d/2-f},...tt(s/2,-d/2,f,20,-90,0),{x:-s/2-f,y:-f},...tt(s/2+2*f,-f,f,20,-180,-270),...tt(s/2+2*f,f,f,20,-90,-180),{x:-s/2-f,y:d/2},...tt(s/2,d/2,f,20,0,90),{x:-s/2,y:d/2+f},{x:s/2-f-f/2,y:d/2+f},...tt(-s/2+f+f/2,-d/2,f,20,-90,-180),{x:s/2-f/2,y:f},...tt(-s/2-f/2,-f,f,20,0,90),...tt(-s/2-f/2,f,f,20,-90,0),{x:s/2-f/2,y:-f},...tt(-s/2+f+f/2,d/2,f,30,-180,-270)],x=h.Z.svg(r),b=W(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=y(u).replace("Z",""),k=x.path($,b),M=y(m).replace("Z",""),S=x.path(M,b),v=y(w),C=x.path(v,{...b}),B=r.insert("g",":first-child");return B.insert(()=>C,":first-child").attr("stroke-opacity",0),B.insert(()=>k,":first-child"),B.insert(()=>S,":first-child"),B.attr("class","text"),p&&"handDrawn"!==e.look&&B.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&B.selectAll("path").attr("style",l),B.attr("transform",`translate(${f-f/4}, 0)`),n.attr("transform",`translate(${-s/2+(e.padding??0)/2-(i.x-(i.left??0))},${-d/2+(e.padding??0)/2-(i.y-(i.top??0))})`),c(e,B),e.intersect=function(t){return j.polygon(e,w,t)},r}async function ta(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await o(t,e,g(e)),n=Math.max(80,(i.width+(e.padding??0)*2)*1.25,e?.width??0),s=Math.max(20,i.height+(e.padding??0)*2,e?.height??0),d=s/2,{cssStyles:f}=e,u=h.Z.svg(r),m=W(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let w=n-d,x=s/4,b=[{x:w,y:0},{x:x,y:0},{x:0,y:s/2},{x:x,y:s},{x:w,y:s},...p(-w,-s/2,d,50,270,90)],$=y(b),k=u.path($,m),M=r.insert(()=>k,":first-child");return M.attr("class","basic label-container"),f&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",f),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),M.attr("transform",`translate(${-n/2}, ${-s/2})`),c(e,M),e.intersect=function(t){return j.polygon(e,b,t)},r}(0,n.eW)(V,"anchor"),(0,n.eW)(Y,"generateArcPoints"),(0,n.eW)(q,"bowTieRect"),(0,n.eW)(O,"insertPolygonShape"),(0,n.eW)(_,"card"),(0,n.eW)(z,"choice"),(0,n.eW)(F,"circle"),(0,n.eW)(X,"createLine"),(0,n.eW)(J,"crossedCircle"),(0,n.eW)(U,"generateCirclePoints"),(0,n.eW)(G,"curlyBraceLeft"),(0,n.eW)(K,"generateCirclePoints"),(0,n.eW)(Q,"curlyBraceRight"),(0,n.eW)(tt,"generateCirclePoints"),(0,n.eW)(te,"curlyBraces"),(0,n.eW)(ta,"curvedTrapezoid");var tl=(0,n.eW)((t,e,a,l,r,i)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createCylinderPathD"),tr=(0,n.eW)((t,e,a,l,r,i)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createOuterCylinderPathD"),ti=(0,n.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function tn(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:n,bbox:s,label:d}=await o(t,e,g(e)),y=Math.max(s.width+e.padding,e.width??0),f=y/2,p=f/(2.5+y/50),u=Math.max(s.height+p+e.padding,e.height??0),{cssStyles:m}=e;if("handDrawn"===e.look){let t=h.Z.svg(n),l=tr(0,0,y,u,f,p),r=ti(0,p,y,u,f,p),i=t.path(l,W(e,{})),s=t.path(r,W(e,{fill:"none"}));a=n.insert(()=>s,":first-child"),(a=n.insert(()=>i,":first-child")).attr("class","basic label-container"),m&&a.attr("style",m)}else{let t=tl(0,0,y,u,f,p);a=n.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,i.R7)(m)).attr("style",r)}return a.attr("label-offset-y",p),a.attr("transform",`translate(${-y/2}, ${-(u/2+p)})`),c(e,a),d.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+(e.padding??0)/1.5-(s.y-(s.top??0))})`),e.intersect=function(t){let a=j.rect(e,t),l=a.x-(e.x??0);if(0!=f&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-p)){let r=p*p*(1-l*l/(f*f));r>0&&(r=Math.sqrt(r)),r=p-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},n}async function ts(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=i.width+e.padding,d=i.height+e.padding,y=.2*d,f=-s/2,p=-d/2-y/2,{cssStyles:u}=e,m=h.Z.svg(r),w=W(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let x=m.polygon([{x:f,y:p+y},{x:-f,y:p+y},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+y}].map(t=>[t.x,t.y]),w),b=r.insert(()=>x,":first-child");return b.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",l),n.attr("transform",`translate(${f+(e.padding??0)/2-(i.x-(i.left??0))}, ${p+y+(e.padding??0)/2-(i.y-(i.top??0))})`),c(e,b),e.intersect=function(t){return j.rect(e,t)},r}async function th(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:s,bbox:d,halfPadding:y}=await o(t,e,g(e)),f=d.width/2+y+5,p=d.width/2+y,{cssStyles:u}=e;if("handDrawn"===e.look){let t=h.Z.svg(s),l=W(e,{roughness:.2,strokeWidth:2.5}),r=W(e,{roughness:.2,strokeWidth:1.5}),n=t.circle(0,0,2*f,l),o=t.circle(0,0,2*p,r);(a=s.insert("g",":first-child")).attr("class",(0,i.R7)(e.cssClasses)).attr("style",(0,i.R7)(u)),a.node()?.appendChild(n),a.node()?.appendChild(o)}else{let t=(a=s.insert("g",":first-child")).insert("circle",":first-child"),e=a.insert("circle");a.attr("class","basic label-container").attr("style",r),t.attr("class","outer-circle").attr("style",r).attr("r",f).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",r).attr("r",p).attr("cx",0).attr("cy",0)}return c(e,a),e.intersect=function(t){return n.cM.info("DoubleCircle intersect",e,f,t),j.circle(e,f,t)},s}function to(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:r}=D(e);e.label="",e.labelStyle=l;let i=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=h.Z.svg(i),{nodeBorder:d}=a,y=W(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(y.roughness=0);let f=o.circle(0,0,14,y),p=i.insert(()=>f,":first-child");return p.selectAll("path").attr("style",`fill: ${d} !important;`),s&&s.length>0&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",s),r&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",r),c(e,p),e.intersect=function(t){return n.cM.info("filledCircle intersect",e,{radius:7,point:t}),j.circle(e,7,t)},i}async function td(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:s}=await o(t,e,g(e)),d=i.width+(e.padding??0),f=d+i.height,p=d+i.height,u=[{x:0,y:-f},{x:p,y:-f},{x:p/2,y:0}],{cssStyles:m}=e,w=h.Z.svg(r),x=W(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let b=y(u),$=w.path(b,x),k=r.insert(()=>$,":first-child").attr("transform",`translate(${-f/2}, ${f/2})`);return m&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",m),l&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",l),e.width=d,e.height=f,c(e,k),s.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-f/2+(e.padding??0)/2+(i.y-(i.top??0))})`),e.intersect=function(t){return n.cM.info("Triangle intersect",e,u,t),j.polygon(e,u,t)},r}function tc(t,e,{dir:a,config:{state:l,themeVariables:r}}){let{nodeStyles:i}=D(e);e.label="";let n=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=Math.max(70,e?.width??0),d=Math.max(10,e?.height??0);"LR"===a&&(o=Math.max(10,e?.width??0),d=Math.max(70,e?.height??0));let y=-1*o/2,f=-1*d/2,p=h.Z.svg(n),u=W(e,{stroke:r.lineColor,fill:r.lineColor});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=p.rectangle(y,f,o,d,u),w=n.insert(()=>m,":first-child");s&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",s),i&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",i),c(e,w);let x=l?.padding??0;return e.width&&e.height&&(e.width+=x/2||0,e.height+=x/2||0),e.intersect=function(t){return j.rect(e,t)},n}async function tg(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await o(t,e,g(e)),s=Math.max(80,i.width+(e.padding??0)*2,e?.width??0),d=Math.max(50,i.height+(e.padding??0)*2,e?.height??0),f=d/2,{cssStyles:u}=e,m=h.Z.svg(r),w=W(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let x=[{x:-s/2,y:-d/2},{x:s/2-f,y:-d/2},...p(-s/2+f,0,f,50,90,270),{x:s/2-f,y:d/2},{x:-s/2,y:d/2}],b=y(x),$=m.path(b,w),k=r.insert(()=>$,":first-child");return k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",l),c(e,k),e.intersect=function(t){return n.cM.info("Pill intersect",e,{radius:f,point:t}),j.polygon(e,x,t)},r}(0,n.eW)(tn,"cylinder"),(0,n.eW)(ts,"dividedRectangle"),(0,n.eW)(th,"doublecircle"),(0,n.eW)(to,"filledCircle"),(0,n.eW)(td,"flippedTriangle"),(0,n.eW)(tc,"forkJoin"),(0,n.eW)(tg,"halfRoundedRectangle");var ty=(0,n.eW)((t,e,a,l,r)=>`M${t+r},${e} L${t+a-r},${e} L${t+a},${e-l/2} L${t+a-r},${e-l} L${t+r},${e-l} L${t},${e-l/2} Z`,"createHexagonPathD");async function tf(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=n.height+e.padding,d=s/4,y=n.width+2*d+e.padding,f=[{x:d,y:0},{x:y-d,y:0},{x:y,y:-s/2},{x:y-d,y:-s},{x:d,y:-s},{x:0,y:-s/2}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=W(e,{}),r=ty(0,0,y,s,d),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-y/2}, ${s/2})`),p&&a.attr("style",p)}else a=O(i,y,s,f);return r&&a.attr("style",r),e.width=y,e.height=s,c(e,a),e.intersect=function(t){return j.polygon(e,f,t)},i}async function tp(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.label="",e.labelStyle=a;let{shapeSvg:r}=await o(t,e,g(e)),i=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:d}=e,f=h.Z.svg(r),p=W(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let u=[{x:0,y:0},{x:i,y:0},{x:0,y:s},{x:i,y:s}],m=y(u),w=f.path(m,p),x=r.insert(()=>w,":first-child");return x.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",d),l&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",l),x.attr("transform",`translate(${-i/2}, ${-s/2})`),c(e,x),e.intersect=function(t){return n.cM.info("Pill intersect",e,{points:u}),j.polygon(e,u,t)},r}async function tu(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:i}=D(e);e.labelStyle=i;let s=Math.max(e.assetHeight??48,e.assetWidth??48),d=l?.wrappingWidth;e.width=Math.max(s,d??0);let{shapeSvg:g,bbox:y,label:f}=await o(t,e,"icon-shape default"),p="t"===e.pos,{nodeBorder:u}=a,{stylesMap:m}=k(e),w=-s/2,x=-s/2,b=e.label?8:0,$=h.Z.svg(g),M=W(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=$.rectangle(w,x,s,s,M),v=Math.max(s,y.width),C=s+y.height+b,B=$.rectangle(-v/2,-C/2,v,C,{...M,fill:"transparent",stroke:"none"}),N=g.insert(()=>S,":first-child"),A=g.insert(()=>B);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,r.s4)(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,i=a.height,n=a.x,h=a.y;t.attr("transform",`translate(${-l/2-n},${p?y.height/2+b/2-i/2-h:-y.height/2-b/2-i/2-h})`),t.attr("style",`color: ${m.get("stroke")??u};`)}return f.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${p?-C/2:C/2-y.height})`),N.attr("transform",`translate(0,${p?y.height/2+b/2:-y.height/2-b/2})`),c(e,A),e.intersect=function(t){if(n.cM.info("iconSquare intersect",e,t),!e.label)return j.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=p?[{x:a-y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2+y.height+b},{x:a+s/2,y:l-r/2+y.height+b},{x:a+s/2,y:l+r/2},{x:a-s/2,y:l+r/2},{x:a-s/2,y:l-r/2+y.height+b},{x:a-y.width/2,y:l-r/2+y.height+b}]:[{x:a-s/2,y:l-r/2},{x:a+s/2,y:l-r/2},{x:a+s/2,y:l-r/2+s},{x:a+y.width/2,y:l-r/2+s},{x:a+y.width/2/2,y:l+r/2},{x:a-y.width/2,y:l+r/2},{x:a-y.width/2,y:l-r/2+s},{x:a-s/2,y:l-r/2+s}],j.polygon(e,i,t)},g}async function tm(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:i}=D(e);e.labelStyle=i;let s=Math.max(e.assetHeight??48,e.assetWidth??48),d=l?.wrappingWidth;e.width=Math.max(s,d??0);let{shapeSvg:g,bbox:y,label:f}=await o(t,e,"icon-shape default"),p=e.label?8:0,u="t"===e.pos,{nodeBorder:m,mainBkg:w}=a,{stylesMap:x}=k(e),b=h.Z.svg(g),$=W(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let M=x.get("fill");$.stroke=M??w;let S=g.append("g");e.icon&&S.html(`<g>${await (0,r.s4)(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let v=S.node().getBBox(),C=v.width,B=v.height,N=v.x,A=v.y,L=Math.max(C,B)*Math.SQRT2+40,R=b.circle(0,0,L,$),P=Math.max(L,y.width),Z=L+y.height+p,I=b.rectangle(-P/2,-Z/2,P,Z,{...$,fill:"transparent",stroke:"none"}),T=g.insert(()=>R,":first-child"),E=g.insert(()=>I);return S.attr("transform",`translate(${-C/2-N},${u?y.height/2+p/2-B/2-A:-y.height/2-p/2-B/2-A})`),S.attr("style",`color: ${x.get("stroke")??m};`),f.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${u?-Z/2:Z/2-y.height})`),T.attr("transform",`translate(0,${u?y.height/2+p/2:-y.height/2-p/2})`),c(e,E),e.intersect=function(t){return n.cM.info("iconSquare intersect",e,t),j.rect(e,t)},g}async function tw(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:i}=D(e);e.labelStyle=i;let s=Math.max(e.assetHeight??48,e.assetWidth??48),d=l?.wrappingWidth;e.width=Math.max(s,d??0);let{shapeSvg:g,bbox:y,halfPadding:f,label:p}=await o(t,e,"icon-shape default"),u="t"===e.pos,m=s+2*f,w=s+2*f,{nodeBorder:x,mainBkg:$}=a,{stylesMap:M}=k(e),S=e.label?8:0,v=h.Z.svg(g),C=W(e,{});"handDrawn"!==e.look&&(C.roughness=0,C.fillStyle="solid");let B=M.get("fill");C.stroke=B??$;let N=v.path(b(-w/2,-m/2,w,m,5),C),A=Math.max(w,y.width),L=m+y.height+S,R=v.rectangle(-A/2,-L/2,A,L,{...C,fill:"transparent",stroke:"none"}),P=g.insert(()=>N,":first-child").attr("class","icon-shape2"),Z=g.insert(()=>R);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,r.s4)(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,i=a.height,n=a.x,h=a.y;t.attr("transform",`translate(${-l/2-n},${u?y.height/2+S/2-i/2-h:-y.height/2-S/2-i/2-h})`),t.attr("style",`color: ${M.get("stroke")??x};`)}return p.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${u?-L/2:L/2-y.height})`),P.attr("transform",`translate(0,${u?y.height/2+S/2:-y.height/2-S/2})`),c(e,Z),e.intersect=function(t){if(n.cM.info("iconSquare intersect",e,t),!e.label)return j.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=u?[{x:a-y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2+y.height+S},{x:a+w/2,y:l-r/2+y.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+y.height+S},{x:a-y.width/2,y:l-r/2+y.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+m},{x:a+y.width/2,y:l-r/2+m},{x:a+y.width/2/2,y:l+r/2},{x:a-y.width/2,y:l+r/2},{x:a-y.width/2,y:l-r/2+m},{x:a-w/2,y:l-r/2+m}],j.polygon(e,i,t)},g}async function tx(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:i}=D(e);e.labelStyle=i;let s=Math.max(e.assetHeight??48,e.assetWidth??48),d=l?.wrappingWidth;e.width=Math.max(s,d??0);let{shapeSvg:g,bbox:y,halfPadding:f,label:p}=await o(t,e,"icon-shape default"),u="t"===e.pos,m=s+2*f,w=s+2*f,{nodeBorder:x,mainBkg:$}=a,{stylesMap:M}=k(e),S=e.label?8:0,v=h.Z.svg(g),C=W(e,{});"handDrawn"!==e.look&&(C.roughness=0,C.fillStyle="solid");let B=M.get("fill");C.stroke=B??$;let N=v.path(b(-w/2,-m/2,w,m,.1),C),A=Math.max(w,y.width),L=m+y.height+S,R=v.rectangle(-A/2,-L/2,A,L,{...C,fill:"transparent",stroke:"none"}),P=g.insert(()=>N,":first-child"),Z=g.insert(()=>R);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,r.s4)(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,i=a.height,n=a.x,h=a.y;t.attr("transform",`translate(${-l/2-n},${u?y.height/2+S/2-i/2-h:-y.height/2-S/2-i/2-h})`),t.attr("style",`color: ${M.get("stroke")??x};`)}return p.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${u?-L/2:L/2-y.height})`),P.attr("transform",`translate(0,${u?y.height/2+S/2:-y.height/2-S/2})`),c(e,Z),e.intersect=function(t){if(n.cM.info("iconSquare intersect",e,t),!e.label)return j.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=u?[{x:a-y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2+y.height+S},{x:a+w/2,y:l-r/2+y.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+y.height+S},{x:a-y.width/2,y:l-r/2+y.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+m},{x:a+y.width/2,y:l-r/2+m},{x:a+y.width/2/2,y:l+r/2},{x:a-y.width/2,y:l+r/2},{x:a-y.width/2,y:l-r/2+m},{x:a-w/2,y:l-r/2+m}],j.polygon(e,i,t)},g}async function tb(t,e,{config:{flowchart:a}}){let l=new Image;l.src=e?.img??"",await l.decode();let r=Number(l.naturalWidth.toString().replace("px","")),i=Number(l.naturalHeight.toString().replace("px",""));e.imageAspectRatio=r/i;let{labelStyles:s}=D(e);e.labelStyle=s;let d=a?.wrappingWidth;e.defaultWidth=a?.wrappingWidth;let g=Math.max(e.label?d??0:0,e?.assetWidth??r),y="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:g,f="on"===e.constraint?y/e.imageAspectRatio:e?.assetHeight??i;e.width=Math.max(y,d??0);let{shapeSvg:p,bbox:u,label:m}=await o(t,e,"image-shape default"),w="t"===e.pos,x=-y/2,b=e.label?8:0,$=h.Z.svg(p),k=W(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=$.rectangle(x,-f/2,y,f,k),S=Math.max(y,u.width),v=f+u.height+b,C=$.rectangle(-S/2,-v/2,S,v,{...k,fill:"none",stroke:"none"}),B=p.insert(()=>M,":first-child"),N=p.insert(()=>C);if(e.img){let t=p.append("image");t.attr("href",e.img),t.attr("width",y),t.attr("height",f),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-y/2},${w?v/2-f:-v/2})`)}return m.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${w?-f/2-u.height/2-b/2:f/2-u.height/2+b/2})`),B.attr("transform",`translate(0,${w?u.height/2+b/2:-u.height/2-b/2})`),c(e,N),e.intersect=function(t){if(n.cM.info("iconSquare intersect",e,t),!e.label)return j.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=w?[{x:a-u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2+u.height+b},{x:a+y/2,y:l-r/2+u.height+b},{x:a+y/2,y:l+r/2},{x:a-y/2,y:l+r/2},{x:a-y/2,y:l-r/2+u.height+b},{x:a-u.width/2,y:l-r/2+u.height+b}]:[{x:a-y/2,y:l-r/2},{x:a+y/2,y:l-r/2},{x:a+y/2,y:l-r/2+f},{x:a+u.width/2,y:l-r/2+f},{x:a+u.width/2/2,y:l+r/2},{x:a-u.width/2,y:l+r/2},{x:a-u.width/2,y:l-r/2+f},{x:a-y/2,y:l-r/2+f}],j.polygon(e,i,t)},p}async function t$(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),d=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=[{x:0,y:0},{x:s,y:0},{x:s+3*d/6,y:-d},{x:-3*d/6,y:-d}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=W(e,{}),r=y(f),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-s/2}, ${d/2})`),p&&a.attr("style",p)}else a=O(i,s,d,f);return r&&a.attr("style",r),e.width=s,e.height=d,c(e,a),e.intersect=function(t){return j.polygon(e,f,t)},i}async function tk(t,e,a){let l;let{labelStyles:r,nodeStyles:n}=D(e);e.labelStyle=r;let{shapeSvg:s,bbox:d}=await o(t,e,g(e)),y=Math.max(d.width+2*a.labelPaddingX,e?.width||0),f=Math.max(d.height+2*a.labelPaddingY,e?.height||0),p=-y/2,u=-f/2,{rx:m,ry:w}=e,{cssStyles:x}=e;if(a?.rx&&a.ry&&(m=a.rx,w=a.ry),"handDrawn"===e.look){let t=h.Z.svg(s),a=W(e,{}),r=m||w?t.path(b(p,u,y,f,m||0),a):t.rectangle(p,u,y,f,a);(l=s.insert(()=>r,":first-child")).attr("class","basic label-container").attr("style",(0,i.R7)(x))}else(l=s.insert("rect",":first-child")).attr("class","basic label-container").attr("style",n).attr("rx",(0,i.R7)(m)).attr("ry",(0,i.R7)(w)).attr("x",p).attr("y",u).attr("width",y).attr("height",f);return c(e,l),e.intersect=function(t){return j.rect(e,t)},s}async function tM(t,e){let{shapeSvg:a,bbox:l,label:r}=await o(t,e,"label"),i=a.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),a.attr("class","label edgeLabel"),r.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),c(e,i),e.intersect=function(t){return j.rect(e,t)},a}async function tS(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=Math.max(n.width+(e.padding??0),e?.width??0),d=Math.max(n.height+(e.padding??0),e?.height??0),f=[{x:0,y:0},{x:s+3*d/6,y:0},{x:s,y:-d},{x:-(3*d)/6,y:-d}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=W(e,{}),r=y(f),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-s/2}, ${d/2})`),p&&a.attr("style",p)}else a=O(i,s,d,f);return r&&a.attr("style",r),e.width=s,e.height=d,c(e,a),e.intersect=function(t){return j.polygon(e,f,t)},i}async function tD(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=Math.max(n.width+(e.padding??0),e?.width??0),d=Math.max(n.height+(e.padding??0),e?.height??0),f=[{x:-3*d/6,y:0},{x:s,y:0},{x:s+3*d/6,y:-d},{x:0,y:-d}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=W(e,{}),r=y(f),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-s/2}, ${d/2})`),p&&a.attr("style",p)}else a=O(i,s,d,f);return r&&a.attr("style",r),e.width=s,e.height=d,c(e,a),e.intersect=function(t){return j.polygon(e,f,t)},i}function tW(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.label="",e.labelStyle=a;let r=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,s=Math.max(35,e?.width??0),o=Math.max(35,e?.height??0),d=[{x:s,y:0},{x:0,y:o+3.5},{x:s-14,y:o+3.5},{x:0,y:2*o},{x:s,y:o-3.5},{x:14,y:o-3.5}],f=h.Z.svg(r),p=W(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let u=y(d),m=f.path(u,p),w=r.insert(()=>m,":first-child");return i&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",i),l&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",l),w.attr("transform",`translate(-${s/2},${-o})`),c(e,w),e.intersect=function(t){return n.cM.info("lightningBolt intersect",e,t),j.polygon(e,d,t)},r}(0,n.eW)(tf,"hexagon"),(0,n.eW)(tp,"hourglass"),(0,n.eW)(tu,"icon"),(0,n.eW)(tm,"iconCircle"),(0,n.eW)(tw,"iconRounded"),(0,n.eW)(tx,"iconSquare"),(0,n.eW)(tb,"imageSquare"),(0,n.eW)(t$,"inv_trapezoid"),(0,n.eW)(tk,"drawRect"),(0,n.eW)(tM,"labelRect"),(0,n.eW)(tS,"lean_left"),(0,n.eW)(tD,"lean_right"),(0,n.eW)(tW,"lightningBolt");var tv=(0,n.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createCylinderPathD"),tC=(0,n.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createOuterCylinderPathD"),tB=(0,n.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function tN(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:n,bbox:s,label:d}=await o(t,e,g(e)),y=Math.max(s.width+(e.padding??0),e.width??0),f=y/2,p=f/(2.5+y/50),u=Math.max(s.height+p+(e.padding??0),e.height??0),m=.1*u,{cssStyles:w}=e;if("handDrawn"===e.look){let t=h.Z.svg(n),l=tC(0,0,y,u,f,p,m),r=tB(0,p,y,u,f,p),i=W(e,{}),s=t.path(l,i),o=t.path(r,i);n.insert(()=>o,":first-child").attr("class","line"),(a=n.insert(()=>s,":first-child")).attr("class","basic label-container"),w&&a.attr("style",w)}else{let t=tv(0,0,y,u,f,p,m);a=n.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,i.R7)(w)).attr("style",r)}return a.attr("label-offset-y",p),a.attr("transform",`translate(${-y/2}, ${-(u/2+p)})`),c(e,a),d.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+p-(s.y-(s.top??0))})`),e.intersect=function(t){let a=j.rect(e,t),l=a.x-(e.x??0);if(0!=f&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-p)){let r=p*p*(1-l*l/(f*f));r>0&&(r=Math.sqrt(r)),r=p-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},n}async function tA(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),d=Math.max(i.height+(e.padding??0)*2,e?.height??0),y=d/4,p=d+y,{cssStyles:u}=e,m=h.Z.svg(r),w=W(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let x=[{x:-s/2-s/2*.1,y:-p/2},{x:-s/2-s/2*.1,y:p/2},...f(-s/2-s/2*.1,p/2,s/2+s/2*.1,p/2,y,.8),{x:s/2+s/2*.1,y:-p/2},{x:-s/2-s/2*.1,y:-p/2},{x:-s/2,y:-p/2},{x:-s/2,y:p/2*1.1},{x:-s/2,y:-p/2}],b=m.polygon(x.map(t=>[t.x,t.y]),w),$=r.insert(()=>b,":first-child");return $.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),$.attr("transform",`translate(0,${-y/2})`),n.attr("transform",`translate(${-s/2+(e.padding??0)+s/2*.1/2-(i.x-(i.left??0))},${-d/2+(e.padding??0)-y/2-(i.y-(i.top??0))})`),c(e,$),e.intersect=function(t){return j.polygon(e,x,t)},r}async function tL(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),d=Math.max(i.height+(e.padding??0)*2,e?.height??0),f=-s/2,p=-d/2,{cssStyles:u}=e,m=h.Z.svg(r),w=W(e,{}),x=[{x:f-5,y:p+5},{x:f-5,y:p+d+5},{x:f+s-5,y:p+d+5},{x:f+s-5,y:p+d},{x:f+s,y:p+d},{x:f+s,y:p+d-5},{x:f+s+5,y:p+d-5},{x:f+s+5,y:p-5},{x:f+5,y:p-5},{x:f+5,y:p},{x:f,y:p},{x:f,y:p+5}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=y(x),$=m.path(b,w),k=y([{x:f,y:p+5},{x:f+s-5,y:p+5},{x:f+s-5,y:p+d},{x:f+s,y:p+d},{x:f+s,y:p},{x:f,y:p}]),M=m.path(k,{...w,fill:"none"}),S=r.insert(()=>M,":first-child");return S.insert(()=>$,":first-child"),S.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),n.attr("transform",`translate(${-(i.width/2)-5-(i.x-(i.left??0))}, ${-(i.height/2)+5-(i.y-(i.top??0))})`),c(e,S),e.intersect=function(t){return j.polygon(e,x,t)},r}async function tR(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),d=Math.max(i.height+(e.padding??0)*2,e?.height??0),p=d/4,u=d+p,m=-s/2,w=-u/2,{cssStyles:x}=e,b=f(m-5,w+u+5,m+s-5,w+u+5,p,.8),$=b?.[b.length-1],k=[{x:m-5,y:w+5},{x:m-5,y:w+u+5},...b,{x:m+s-5,y:$.y-5},{x:m+s,y:$.y-5},{x:m+s,y:$.y-10},{x:m+s+5,y:$.y-10},{x:m+s+5,y:w-5},{x:m+5,y:w-5},{x:m+5,y:w},{x:m,y:w},{x:m,y:w+5}],M=[{x:m,y:w+5},{x:m+s-5,y:w+5},{x:m+s-5,y:$.y-5},{x:m+s,y:$.y-5},{x:m+s,y:w},{x:m,y:w}],S=h.Z.svg(r),v=W(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");let C=y(k),B=S.path(C,v),N=y(M),A=S.path(N,v),L=r.insert(()=>B,":first-child");return L.insert(()=>A),L.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&L.selectAll("path").attr("style",x),l&&"handDrawn"!==e.look&&L.selectAll("path").attr("style",l),L.attr("transform",`translate(0,${-p/2})`),n.attr("transform",`translate(${-(i.width/2)-5-(i.x-(i.left??0))}, ${-(i.height/2)+5-p/2-(i.y-(i.top??0))})`),c(e,L),e.intersect=function(t){return j.polygon(e,k,t)},r}async function tP(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l,e.useHtmlLabels||n.iE().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);let{shapeSvg:i,bbox:s}=await o(t,e,g(e)),d=Math.max(s.width+(e.padding??0)*2,e?.width??0),y=Math.max(s.height+(e.padding??0)*2,e?.height??0),{cssStyles:f}=e,p=h.Z.svg(i),u=W(e,{fill:a.noteBkgColor,stroke:a.noteBorderColor});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=p.rectangle(-d/2,-y/2,d,y,u),w=i.insert(()=>m,":first-child");return w.attr("class","basic label-container"),f&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",f),r&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",r),c(e,w),e.intersect=function(t){return j.rect(e,t)},i}(0,n.eW)(tN,"linedCylinder"),(0,n.eW)(tA,"linedWaveEdgedRect"),(0,n.eW)(tL,"multiRect"),(0,n.eW)(tR,"multiWaveEdgedRectangle"),(0,n.eW)(tP,"note");var tZ=(0,n.eW)((t,e,a)=>`M${t+a/2},${e} L${t+a},${e-a/2} L${t+a/2},${e-a} L${t},${e-a/2} Z`,"createDecisionBoxPathD");async function tI(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:i,bbox:s}=await o(t,e,g(e)),d=s.width+e.padding+(s.height+e.padding),y=[{x:d/2,y:0},{x:d,y:-d/2},{x:d/2,y:-d},{x:0,y:-d/2}],{cssStyles:f}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=W(e,{}),r=tZ(0,0,d),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`),f&&a.attr("style",f)}else a=O(i,d,d,y);return r&&a.attr("style",r),c(e,a),e.intersect=function(t){return n.cM.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",j.polygon(e,y,t)),j.polygon(e,y,t)},i}async function tT(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=Math.max(i.width+(e.padding??0),e?.width??0),d=Math.max(i.height+(e.padding??0),e?.height??0),f=-s/2,p=-d/2,u=p/2,m=[{x:f+u,y:p},{x:f,y:0},{x:f+u,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:w}=e,x=h.Z.svg(r),b=W(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=y(m),k=x.path($,b),M=r.insert(()=>k,":first-child");return M.attr("class","basic label-container"),w&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",w),l&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",l),M.attr("transform",`translate(${-u/2},0)`),n.attr("transform",`translate(${-u/2-i.width/2-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),c(e,M),e.intersect=function(t){return j.polygon(e,m,t)},r}async function tE(t,e){let a,l,r;let{labelStyles:i,nodeStyles:o}=D(e);e.labelStyle=i,a=e.cssClasses?"node "+e.cssClasses:"node default";let d=t.insert("g").attr("class",a).attr("id",e.domId||e.id),g=d.insert("g"),y=d.insert("g").attr("class","label").attr("style",o),f=e.description,p=e.label,u=y.node().appendChild(await x(p,e.labelStyle,!0,!0)),m={width:0,height:0};if((0,n.ku)(n.nV()?.flowchart?.htmlLabels)){let t=u.children[0],e=(0,s.Ys)(u);m=t.getBoundingClientRect(),e.attr("width",m.width),e.attr("height",m.height)}n.cM.info("Text 2",f);let w=f||[],$=u.getBBox(),k=y.node().appendChild(await x(w.join?w.join("<br/>"):w,e.labelStyle,!0,!0)),M=k.children[0],S=(0,s.Ys)(k);m=M.getBoundingClientRect(),S.attr("width",m.width),S.attr("height",m.height);let v=(e.padding||0)/2;(0,s.Ys)(k).attr("transform","translate( "+(m.width>$.width?0:($.width-m.width)/2)+", "+($.height+v+5)+")"),(0,s.Ys)(u).attr("transform","translate( "+(m.width<$.width?0:-($.width-m.width)/2)+", 0)"),m=y.node().getBBox(),y.attr("transform","translate("+-m.width/2+", "+(-m.height/2-v+3)+")");let C=m.width+(e.padding||0),B=m.height+(e.padding||0),N=-m.width/2-v,A=-m.height/2-v;if("handDrawn"===e.look){let t=h.Z.svg(d),a=W(e,{}),i=t.path(b(N,A,C,B,e.rx||0),a),s=t.line(-m.width/2-v,-m.height/2-v+$.height+v,m.width/2+v,-m.height/2-v+$.height+v,a);r=d.insert(()=>(n.cM.debug("Rough node insert CXC",i),s),":first-child"),l=d.insert(()=>(n.cM.debug("Rough node insert CXC",i),i),":first-child")}else l=g.insert("rect",":first-child"),r=g.insert("line"),l.attr("class","outer title-state").attr("style",o).attr("x",-m.width/2-v).attr("y",-m.height/2-v).attr("width",m.width+(e.padding||0)).attr("height",m.height+(e.padding||0)),r.attr("class","divider").attr("x1",-m.width/2-v).attr("x2",m.width/2+v).attr("y1",-m.height/2-v+$.height+v).attr("y2",-m.height/2-v+$.height+v);return c(e,l),e.intersect=function(t){return j.rect(e,t)},d}async function tH(t,e){let a={rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return tk(t,e,a)}async function tj(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:n,label:s}=await o(t,e,g(e)),d=e?.padding??0,y=Math.max(n.width+(e.padding??0)*2,e?.width??0),f=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-n.width/2-d,u=-n.height/2-d,{cssStyles:m}=e,w=h.Z.svg(r),x=W(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let b=w.polygon([{x:p,y:u},{x:p+y+8,y:u},{x:p+y+8,y:u+f},{x:p-8,y:u+f},{x:p-8,y:u},{x:p,y:u},{x:p,y:u+f}].map(t=>[t.x,t.y]),x),$=r.insert(()=>b,":first-child");return $.attr("class","basic label-container").attr("style",(0,i.R7)(m)),l&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),m&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),s.attr("transform",`translate(${-y/2+4+(e.padding??0)-(n.x-(n.left??0))},${-f/2+(e.padding??0)-(n.y-(n.top??0))})`),c(e,$),e.intersect=function(t){return j.rect(e,t)},r}async function tV(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),d=Math.max(i.height+(e.padding??0)*2,e?.height??0),f=-s/2,p=-d/2,{cssStyles:u}=e,m=h.Z.svg(r),w=W(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let x=[{x:f,y:p},{x:f,y:p+d},{x:f+s,y:p+d},{x:f+s,y:p-d/2}],b=y(x),$=m.path(b,w),k=r.insert(()=>$,":first-child");return k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",l),k.attr("transform",`translate(0, ${d/4})`),n.attr("transform",`translate(${-s/2+(e.padding??0)-(i.x-(i.left??0))}, ${-d/4+(e.padding??0)-(i.y-(i.top??0))})`),c(e,k),e.intersect=function(t){return j.polygon(e,x,t)},r}async function tY(t,e){let a={rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return tk(t,e,a)}async function tq(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await o(t,e,g(e)),d=s.height+e.padding,y=s.width+d/4+e.padding,{cssStyles:f}=e;if("handDrawn"===e.look){let t=h.Z.svg(n),l=W(e,{}),r=b(-y/2,-d/2,y,d,d/2),s=t.path(r,l);(a=n.insert(()=>s,":first-child")).attr("class","basic label-container").attr("style",(0,i.R7)(f))}else(a=n.insert("rect",":first-child")).attr("class","basic label-container").attr("style",r).attr("rx",d/2).attr("ry",d/2).attr("x",-y/2).attr("y",-d/2).attr("width",y).attr("height",d);return c(e,a),e.intersect=function(t){return j.rect(e,t)},n}async function tO(t,e){return tk(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function t_(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{cssStyles:i}=e,{lineColor:n,stateBorder:s,nodeBorder:o}=a,d=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),g=h.Z.svg(d),y=W(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");let f=g.circle(0,0,14,{...y,stroke:n,strokeWidth:2}),p=s??o,u=g.circle(0,0,5,{...y,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),m=d.insert(()=>f,":first-child");return m.insert(()=>u),i&&m.selectAll("path").attr("style",i),r&&m.selectAll("path").attr("style",r),c(e,m),e.intersect=function(t){return j.circle(e,7,t)},d}function tz(t,e,{config:{themeVariables:a}}){let l;let{lineColor:r}=a,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);if("handDrawn"===e.look){let t=h.Z.svg(i).circle(0,0,14,$(r));(l=i.insert(()=>t)).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else(l=i.insert("circle",":first-child")).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return c(e,l),e.intersect=function(t){return j.circle(e,7,t)},i}async function tF(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:n}=await o(t,e,g(e)),s=(e?.padding||0)/2,d=n.width+e.padding,y=n.height+e.padding,f=-n.width/2-s,p=-n.height/2-s,u=[{x:0,y:0},{x:d,y:0},{x:d,y:-y},{x:0,y:-y},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-y},{x:-8,y:-y},{x:-8,y:0}];if("handDrawn"===e.look){let t=h.Z.svg(r),a=W(e,{}),l=t.rectangle(f-8,p,d+16,y,a),n=t.line(f,p,f,p+y,a),s=t.line(f+d,p,f+d,p+y,a);r.insert(()=>n,":first-child"),r.insert(()=>s,":first-child");let o=r.insert(()=>l,":first-child"),{cssStyles:g}=e;o.attr("class","basic label-container").attr("style",(0,i.R7)(g)),c(e,o)}else{let t=O(r,d,y,u);l&&t.attr("style",l),c(e,t)}return e.intersect=function(t){return j.polygon(e,u,t)},r}async function tX(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await o(t,e,g(e)),n=Math.max(i.width+(e.padding??0)*2,e?.width??0),s=Math.max(i.height+(e.padding??0)*2,e?.height??0),d=-n/2,f=-s/2,p=.2*s,{cssStyles:u}=e,m=h.Z.svg(r),w=W(e,{}),x=[{x:d-p/2,y:f},{x:d+n+p/2,y:f},{x:d+n+p/2,y:f+s},{x:d-p/2,y:f+s}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=y(x),$=m.path(b,w),k=y([{x:d+n-p/2,y:f+s},{x:d+n+p/2,y:f+s},{x:d+n+p/2,y:f+s-.2*s}]),M=m.path(k,{...w,fillStyle:"solid"}),S=r.insert(()=>M,":first-child");return S.insert(()=>$,":first-child"),S.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),c(e,S),e.intersect=function(t){return j.polygon(e,x,t)},r}async function tJ(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),d=Math.max(i.height+(e.padding??0)*2,e?.height??0),p=d/4,u=.2*s,m=.2*d,w=d+p,{cssStyles:x}=e,b=h.Z.svg(r),$=W(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=[{x:-s/2-s/2*.1,y:w/2},...f(-s/2-s/2*.1,w/2,s/2+s/2*.1,w/2,p,.8),{x:s/2+s/2*.1,y:-w/2},{x:-s/2-s/2*.1,y:-w/2}],M=-s/2+s/2*.1,S=-w/2-.4*m,v=[{x:M+s-u,y:(S+d)*1.4},{x:M+s,y:S+d-m},{x:M+s,y:(S+d)*.9},...f(M+s,(S+d)*1.3,M+s-u,(S+d)*1.5,-(.03*d),.5)],C=y(k),B=b.path(C,$),N=y(v),A=b.path(N,{...$,fillStyle:"solid"}),L=r.insert(()=>A,":first-child");return L.insert(()=>B,":first-child"),L.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&L.selectAll("path").attr("style",x),l&&"handDrawn"!==e.look&&L.selectAll("path").attr("style",l),L.attr("transform",`translate(0,${-p/2})`),n.attr("transform",`translate(${-s/2+(e.padding??0)-(i.x-(i.left??0))},${-d/2+(e.padding??0)-p/2-(i.y-(i.top??0))})`),c(e,L),e.intersect=function(t){return j.polygon(e,k,t)},r}async function tU(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await o(t,e,g(e)),n=Math.max(i.width+e.padding,e?.width||0),s=Math.max(i.height+e.padding,e?.height||0),h=r.insert("rect",":first-child");return h.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",-n/2).attr("y",-s/2).attr("width",n).attr("height",s),c(e,h),e.intersect=function(t){return j.rect(e,t)},r}(0,n.eW)(tI,"question"),(0,n.eW)(tT,"rect_left_inv_arrow"),(0,n.eW)(tE,"rectWithTitle"),(0,n.eW)(tH,"roundedRect"),(0,n.eW)(tj,"shadedProcess"),(0,n.eW)(tV,"slopedRect"),(0,n.eW)(tY,"squareRect"),(0,n.eW)(tq,"stadium"),(0,n.eW)(tO,"state"),(0,n.eW)(t_,"stateEnd"),(0,n.eW)(tz,"stateStart"),(0,n.eW)(tF,"subroutine"),(0,n.eW)(tX,"taggedRect"),(0,n.eW)(tJ,"taggedWaveEdgedRectangle"),(0,n.eW)(tU,"text");var tG=(0,n.eW)((t,e,a,l,r,i)=>`M${t},${e}
3
+ a${r},${i} 0,0,1 0,${-l}
4
+ l${a},0
5
+ a${r},${i} 0,0,1 0,${l}
6
+ M${a},${-l}
7
+ a${r},${i} 0,0,0 0,${l}
8
+ l${-a},0`,"createCylinderPathD"),tK=(0,n.eW)((t,e,a,l,r,i)=>`M${t},${e} M${t+a},${e} a${r},${i} 0,0,0 0,${-l} l${-a},0 a${r},${i} 0,0,0 0,${l} l${a},0`,"createOuterCylinderPathD"),tQ=(0,n.eW)((t,e,a,l,r,i)=>`M${t+a/2},${-l/2} a${r},${i} 0,0,0 0,${l}`,"createInnerCylinderPathD");async function t0(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:n,bbox:s,label:d,halfPadding:y}=await o(t,e,g(e)),f="neo"===e.look?2*y:y,p=s.height+f,u=p/2,m=u/(2.5+p/50),w=s.width+m+f,{cssStyles:x}=e;if("handDrawn"===e.look){let t=h.Z.svg(n),l=tK(0,0,w,p,m,u),r=tQ(0,0,w,p,m,u),i=t.path(l,W(e,{})),s=t.path(r,W(e,{fill:"none"}));a=n.insert(()=>s,":first-child"),(a=n.insert(()=>i,":first-child")).attr("class","basic label-container"),x&&a.attr("style",x)}else{let t=tG(0,0,w,p,m,u);(a=n.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,i.R7)(x)).attr("style",r)).attr("class","basic label-container"),x&&a.selectAll("path").attr("style",x),r&&a.selectAll("path").attr("style",r)}return a.attr("label-offset-x",m),a.attr("transform",`translate(${-w/2}, ${p/2} )`),d.attr("transform",`translate(${-(s.width/2)-m-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),c(e,a),e.intersect=function(t){let a=j.rect(e,t),l=a.y-(e.y??0);if(0!=u&&(Math.abs(l)<(e.height??0)/2||Math.abs(l)==(e.height??0)/2&&Math.abs(a.x-(e.x??0))>(e.width??0)/2-m)){let r=m*m*(1-l*l/(u*u));0!=r&&(r=Math.sqrt(Math.abs(r))),r=m-r,t.x-(e.x??0)>0&&(r=-r),a.x+=r}return a},n}async function t2(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=n.width+e.padding,d=n.height+e.padding,f=[{x:-3*d/6,y:0},{x:s+3*d/6,y:0},{x:s,y:-d},{x:0,y:-d}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=h.Z.svg(i),l=W(e,{}),r=y(f),n=t.path(r,l);a=i.insert(()=>n,":first-child").attr("transform",`translate(${-s/2}, ${d/2})`),p&&a.attr("style",p)}else a=O(i,s,d,f);return r&&a.attr("style",r),e.width=s,e.height=d,c(e,a),e.intersect=function(t){return j.polygon(e,f,t)},i}async function t1(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await o(t,e,g(e)),n=Math.max(60,i.width+(e.padding??0)*2,e?.width??0),s=Math.max(20,i.height+(e.padding??0)*2,e?.height??0),{cssStyles:d}=e,f=h.Z.svg(r),p=W(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let u=[{x:-n/2*.8,y:-s/2},{x:n/2*.8,y:-s/2},{x:n/2,y:-s/2*.6},{x:n/2,y:s/2},{x:-n/2,y:s/2},{x:-n/2,y:-s/2*.6}],m=y(u),w=f.path(m,p),x=r.insert(()=>w,":first-child");return x.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",d),l&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",l),c(e,x),e.intersect=function(t){return j.polygon(e,u,t)},r}async function t5(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:s}=await o(t,e,g(e)),d=(0,n.ku)(n.nV().flowchart?.htmlLabels),f=i.width+(e.padding??0),p=f+i.height,u=f+i.height,m=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-p}],{cssStyles:w}=e,x=h.Z.svg(r),b=W(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=y(m),k=x.path($,b),M=r.insert(()=>k,":first-child").attr("transform",`translate(${-p/2}, ${p/2})`);return w&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",w),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),e.width=f,e.height=p,c(e,M),s.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${p/2-(i.height+(e.padding??0)/(d?2:1)-(i.y-(i.top??0)))})`),e.intersect=function(t){return n.cM.info("Triangle intersect",e,m,t),j.polygon(e,m,t)},r}async function t8(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),d=Math.max(i.height+(e.padding??0)*2,e?.height??0),p=d/8,u=d+p,{cssStyles:m}=e,w=70-s,x=w>0?w/2:0,b=h.Z.svg(r),$=W(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=[{x:-s/2-x,y:u/2},...f(-s/2-x,u/2,s/2+x,u/2,p,.8),{x:s/2+x,y:-u/2},{x:-s/2-x,y:-u/2}],M=y(k),S=b.path(M,$),v=r.insert(()=>S,":first-child");return v.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",l),v.attr("transform",`translate(0,${-p/2})`),n.attr("transform",`translate(${-s/2+(e.padding??0)-(i.x-(i.left??0))},${-d/2+(e.padding??0)-p-(i.y-(i.top??0))})`),c(e,v),e.intersect=function(t){return j.polygon(e,k,t)},r}async function t4(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i}=await o(t,e,g(e)),n=Math.max(i.width+(e.padding??0)*2,e?.width??0),s=Math.max(i.height+(e.padding??0)*2,e?.height??0),d=n/s,p=n,u=s;p>u*d?u=p/d:p=u*d,p=Math.max(p,100);let m=Math.min(.2*(u=Math.max(u,50)),u/4),w=u+2*m,{cssStyles:x}=e,b=h.Z.svg(r),$=W(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=[{x:-p/2,y:w/2},...f(-p/2,w/2,p/2,w/2,m,1),{x:p/2,y:-w/2},...f(p/2,-w/2,-p/2,-w/2,m,-1)],M=y(k),S=b.path(M,$),v=r.insert(()=>S,":first-child");return v.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",x),l&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",l),c(e,v),e.intersect=function(t){return j.polygon(e,k,t)},r}async function t7(t,e){let{labelStyles:a,nodeStyles:l}=D(e);e.labelStyle=a;let{shapeSvg:r,bbox:i,label:n}=await o(t,e,g(e)),s=Math.max(i.width+(e.padding??0)*2,e?.width??0),d=Math.max(i.height+(e.padding??0)*2,e?.height??0),y=-s/2,f=-d/2,{cssStyles:p}=e,u=h.Z.svg(r),m=W(e,{}),w=[{x:y-5,y:f-5},{x:y-5,y:f+d},{x:y+s,y:f+d},{x:y+s,y:f-5}],x=`M${y-5},${f-5} L${y+s},${f-5} L${y+s},${f+d} L${y-5},${f+d} L${y-5},${f-5}
9
+ M${y-5},${f} L${y+s},${f}
10
+ M${y},${f-5} L${y},${f+d}`;"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let b=u.path(x,m),$=r.insert(()=>b,":first-child");return $.attr("transform","translate(2.5, 2.5)"),$.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),n.attr("transform",`translate(${-(i.width/2)+2.5-(i.x-(i.left??0))}, ${-(i.height/2)+2.5-(i.y-(i.top??0))})`),c(e,$),e.intersect=function(t){return j.polygon(e,w,t)},r}async function t3(t,e){if(e.alias&&(e.label=e.alias),"handDrawn"===e.look){let{themeVariables:a}=(0,n.iE)(),{background:l}=a,r={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${l}`]};await t3(t,r)}let a=(0,n.iE)();e.useHtmlLabels=a.htmlLabels;let l=a.er?.diagramPadding??10,r=a.er?.entityPadding??6,{cssStyles:o}=e,{labelStyles:d,nodeStyles:y}=D(e);if(0===e.attributes.length&&e.label){let r={rx:0,ry:0,labelPaddingX:l,labelPaddingY:1.5*l,classes:""};(0,i.Cq)(e.label,a)+2*r.labelPaddingX<a.er.minEntityWidth&&(e.width=a.er.minEntityWidth);let s=await tk(t,e,r);if(!(0,n.ku)(a.htmlLabels)){let t=s.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return s}a.htmlLabels||(l*=1.25,r*=1.25);let f=g(e);f||(f="node default");let p=t.insert("g").attr("class",f).attr("id",e.domId||e.id),u=await t9(p,e.label??"",a,0,0,["name"],d);u.height+=r;let m=0,w=[],x=[],b=0,$=0,k=0,M=0,S=!0,v=!0;for(let t of e.attributes){let e=await t9(p,t.type,a,0,m,["attribute-type"],d);b=Math.max(b,e.width+l);let i=await t9(p,t.name,a,0,m,["attribute-name"],d);$=Math.max($,i.width+l);let n=await t9(p,t.keys.join(),a,0,m,["attribute-keys"],d);k=Math.max(k,n.width+l);let s=await t9(p,t.comment,a,0,m,["attribute-comment"],d);M=Math.max(M,s.width+l);let h=Math.max(e.height,i.height,n.height,s.height)+r;x.push({yOffset:m,rowHeight:h}),m+=h}let C=4;k<=l&&(S=!1,k=0,C--),M<=l&&(v=!1,M=0,C--);let B=p.node().getBBox();if(u.width+2*l-(b+$+k+M)>0){let t=u.width+2*l-(b+$+k+M);b+=t/C,$+=t/C,k>0&&(k+=t/C),M>0&&(M+=t/C)}let N=b+$+k+M,A=h.Z.svg(p),L=W(e,{});"handDrawn"!==e.look&&(L.roughness=0,L.fillStyle="solid");let R=0;x.length>0&&(R=x.reduce((t,e)=>t+(e?.rowHeight??0),0));let P=Math.max(B.width+2*l,e?.width||0,N),Z=Math.max((R??0)+u.height,e?.height||0),I=-P/2,T=-Z/2;p.selectAll("g:not(:first-child)").each((t,e,a)=>{let i=(0,s.Ys)(a[e]),n=i.attr("transform"),h=0,o=0;if(n){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(n);t&&(h=parseFloat(t[1]),o=parseFloat(t[2]),i.attr("class").includes("attribute-name")?h+=b:i.attr("class").includes("attribute-keys")?h+=b+$:i.attr("class").includes("attribute-comment")&&(h+=b+$+k))}i.attr("transform",`translate(${I+l/2+h}, ${o+T+u.height+r/2})`)}),p.select(".name").attr("transform","translate("+-u.width/2+", "+(T+r/2)+")");let E=A.rectangle(I,T,P,Z,L),H=p.insert(()=>E,":first-child").attr("style",o.join("")),{themeVariables:V}=(0,n.iE)(),{rowEven:Y,rowOdd:q,nodeBorder:O}=V;for(let[t,e]of(w.push(0),x.entries())){let a=(t+1)%2==0&&0!==e.yOffset,l=A.rectangle(I,u.height+T+e?.yOffset,P,e?.rowHeight,{...L,fill:a?Y:q,stroke:O});p.insert(()=>l,"g.label").attr("style",o.join("")).attr("class",`row-rect-${a?"even":"odd"}`)}let _=A.line(I,u.height+T,P+I,u.height+T,L);for(let t of(p.insert(()=>_).attr("class","divider"),_=A.line(b+I,u.height+T,b+I,Z+T,L),p.insert(()=>_).attr("class","divider"),S&&(_=A.line(b+$+I,u.height+T,b+$+I,Z+T,L),p.insert(()=>_).attr("class","divider")),v&&(_=A.line(b+$+k+I,u.height+T,b+$+k+I,Z+T,L),p.insert(()=>_).attr("class","divider")),w))_=A.line(I,u.height+T+t,P+I,u.height+T+t,L),p.insert(()=>_).attr("class","divider");if(c(e,H),y&&"handDrawn"!==e.look){let t=y.split(";"),e=t?.filter(t=>t.includes("stroke"))?.map(t=>`${t}`).join("; ");p.selectAll("path").attr("style",e??""),p.selectAll(".row-rect-even path").attr("style",y)}return e.intersect=function(t){return j.rect(e,t)},p}async function t9(t,e,a,l=0,h=0,o=[],d=""){let c=t.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${l}, ${h})`).attr("style",d);e!==(0,n.UO)(e)&&(e=(e=(0,n.UO)(e)).replaceAll("<","&lt;").replaceAll(">","&gt;"));let g=c.node().appendChild(await (0,r.rw)(c,e,{width:(0,i.Cq)(e,a)+100,style:d,useHtmlLabels:a.htmlLabels},a));if(e.includes("&lt;")||e.includes("&gt;")){let t=g.children[0];for(t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");t.childNodes[0];)(t=t.childNodes[0]).textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let y=g.getBBox();if((0,n.ku)(a.htmlLabels)){let t=g.children[0];t.style.textAlign="start";let e=(0,s.Ys)(g);y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return y}async function t6(t,e,a,l,r=a.class.padding??12){let i=l?0:3,n=t.insert("g").attr("class",g(e)).attr("id",e.domId||e.id),s=null,h=null,o=null,d=null,c=0,y=0,f=0;if(s=n.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let t=e.annotations[0];await et(s,{text:`\xab${t}\xbb`},0),c=s.node().getBBox().height}h=n.insert("g").attr("class","label-group text"),await et(h,e,0,["font-weight: bolder"]);let p=h.node().getBBox();y=p.height,o=n.insert("g").attr("class","members-group text");let u=0;for(let t of e.members){let e=await et(o,t,u,[t.parseClassifier()]);u+=e+i}(f=o.node().getBBox().height)<=0&&(f=r/2),d=n.insert("g").attr("class","methods-group text");let m=0;for(let t of e.methods){let e=await et(d,t,m,[t.parseClassifier()]);m+=e+i}let w=n.node().getBBox();if(null!==s){let t=s.node().getBBox();s.attr("transform",`translate(${-t.width/2})`)}return h.attr("transform",`translate(${-p.width/2}, ${c})`),w=n.node().getBBox(),o.attr("transform",`translate(0, ${c+y+2*r})`),w=n.node().getBBox(),d.attr("transform",`translate(0, ${c+y+(f?f+4*r:2*r)})`),w=n.node().getBBox(),{shapeSvg:n,bbox:w}}async function et(t,e,a,l=[]){let h;let o=t.insert("g").attr("class","label").attr("style",l.join("; ")),d=(0,n.iE)(),c="useHtmlLabels"in e?e.useHtmlLabels:(0,n.ku)(d.htmlLabels)??!0,g="";g="text"in e?e.text:e.label,!c&&g.startsWith("\\")&&(g=g.substring(1)),(0,n.l0)(g)&&(c=!0);let y=await (0,r.rw)(o,(0,n.uX)((0,i.SH)(g)),{width:(0,i.Cq)(g,d)+50,classes:"markdown-node-label",useHtmlLabels:c},d),f=1;if(c){let t=y.children[0],e=(0,s.Ys)(y);f=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(f+=t.innerHTML.split("<mrow>").length-1);let a=t.getElementsByTagName("img");if(a){let t=""===g.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=5*parseInt(d.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,10)+"px";e.style.minWidth=t,e.style.maxWidth=t}else e.style.width="100%";a(e)}(0,n.eW)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}else{l.includes("font-weight: bolder")&&(0,s.Ys)(y).selectAll("tspan").attr("font-weight",""),f=y.children.length;let t=y.children[0];(""===y.textContent||y.textContent.includes("&gt"))&&(t.textContent=g[0]+g.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim()," "===g[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))),"undefined"===t.textContent&&(t.textContent=""),h=y.getBBox()}return o.attr("transform","translate(0,"+(-h.height/(2*f)+a)+")"),h.height}async function ee(t,e){let a=(0,n.nV)(),l=a.class.padding??12,r=e.useHtmlLabels??(0,n.ku)(a.htmlLabels)??!0;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:i,bbox:o}=await t6(t,e,a,r,l),{labelStyles:d,nodeStyles:g}=D(e);e.labelStyle=d,e.cssStyles=e.styles||"";let y=e.styles?.join(";")||g||"";e.cssStyles||(e.cssStyles=y.replaceAll("!important","").split(";"));let f=0===e.members.length&&0===e.methods.length&&!a.class?.hideEmptyMembersBox,p=h.Z.svg(i),u=W(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=o.width,w=o.height;0===e.members.length&&0===e.methods.length?w+=l:e.members.length>0&&0===e.methods.length&&(w+=2*l);let x=-m/2,b=-w/2,$=p.rectangle(x-l,b-l-(f?l:0===e.members.length&&0===e.methods.length?-l/2:0),m+2*l,w+2*l+(f?2*l:0===e.members.length&&0===e.methods.length?-l:0),u),k=i.insert(()=>$,":first-child");k.attr("class","basic label-container");let M=k.node().getBBox();i.selectAll(".text").each((t,a,n)=>{let h=(0,s.Ys)(n[a]),o=h.attr("transform"),d=0;if(o){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);t&&(d=parseFloat(t[2]))}let c=d+b+l-(f?l:0===e.members.length&&0===e.methods.length?-l/2:0);r||(c-=4);let g=x;(h.attr("class").includes("label-group")||h.attr("class").includes("annotation-group"))&&(g=-h.node()?.getBBox().width/2||0,i.selectAll("text").each(function(t,e,a){"middle"===window.getComputedStyle(a[e]).textAnchor&&(g=0)})),h.attr("transform",`translate(${g}, ${c})`)});let S=i.select(".annotation-group").node().getBBox().height-(f?l/2:0)||0,v=i.select(".label-group").node().getBBox().height-(f?l/2:0)||0,C=i.select(".members-group").node().getBBox().height-(f?l/2:0)||0;if(e.members.length>0||e.methods.length>0||f){let t=p.line(M.x,S+v+b+l,M.x+M.width,S+v+b+l,u);i.insert(()=>t).attr("class","divider").attr("style",y)}if(f||e.members.length>0||e.methods.length>0){let t=p.line(M.x,S+v+C+b+2*l+l,M.x+M.width,S+v+C+b+l+2*l,u);i.insert(()=>t).attr("class","divider").attr("style",y)}if("handDrawn"!==e.look&&i.selectAll("path").attr("style",y),k.select(":nth-child(2)").attr("style",y),i.selectAll(".divider").select("path").attr("style",y),e.labelStyle?i.selectAll("span").attr("style",e.labelStyle):i.selectAll("span").attr("style",y),!r){let t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(y);if(e){let t=e[0].replace("color","fill");i.selectAll("tspan").attr("style",t)}else if(d){let e=t.exec(d);if(e){let t=e[0].replace("color","fill");i.selectAll("tspan").attr("style",t)}}}return c(e,k),e.intersect=function(t){return j.rect(e,t)},i}async function ea(t,e){let a;let{labelStyles:l,nodeStyles:r}=D(e);e.labelStyle=l;let i="verifyMethod"in e,n=g(e),o=t.insert("g").attr("class",n).attr("id",e.domId??e.id),d=a=i?await el(o,`&lt;&lt;${e.type}&gt;&gt;`,0,e.labelStyle):await el(o,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle),y=await el(o,e.name,d,e.labelStyle+"; font-weight: bold;");if(d+=y+20,i){let t=await el(o,`${e.requirementId?`id: ${e.requirementId}`:""}`,d,e.labelStyle);d+=t;let a=await el(o,`${e.text?`Text: ${e.text}`:""}`,d,e.labelStyle);d+=a;let l=await el(o,`${e.risk?`Risk: ${e.risk}`:""}`,d,e.labelStyle);d+=l,await el(o,`${e.verifyMethod?`Verification: ${e.verifyMethod}`:""}`,d,e.labelStyle)}else{let t=await el(o,`${e.type?`Type: ${e.type}`:""}`,d,e.labelStyle);d+=t,await el(o,`${e.docRef?`Doc Ref: ${e.docRef}`:""}`,d,e.labelStyle)}let f=(o.node()?.getBBox().width??200)+20,p=(o.node()?.getBBox().height??200)+20,u=-f/2,m=-p/2,w=h.Z.svg(o),x=W(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let b=w.rectangle(u,m,f,p,x),$=o.insert(()=>b,":first-child");if($.attr("class","basic label-container").attr("style",r),o.selectAll(".label").each((t,e,a)=>{let l=(0,s.Ys)(a[e]),r=l.attr("transform"),i=0,n=0;if(r){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(r);t&&(i=parseFloat(t[1]),n=parseFloat(t[2]))}let h=n-p/2,o=u+10;(0===e||1===e)&&(o=i),l.attr("transform",`translate(${o}, ${h+20})`)}),d>a+y+20){let t=w.line(u,m+a+y+20,u+f,m+a+y+20,x);o.insert(()=>t).attr("style",r)}return c(e,$),e.intersect=function(t){return j.rect(e,t)},o}async function el(t,e,a,l=""){let h;if(""===e)return 0;let o=t.insert("g").attr("class","label").attr("style",l),d=(0,n.nV)(),c=d.htmlLabels??!0,g=await (0,r.rw)(o,(0,n.uX)((0,i.SH)(e)),{width:(0,i.Cq)(e,d)+50,classes:"markdown-node-label",useHtmlLabels:c,style:l},d);if(c){let t=g.children[0],e=(0,s.Ys)(g);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}else{for(let t of g.children[0].children)t.textContent=t.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),l&&t.setAttribute("style",l);h=g.getBBox(),h.height+=6}return o.attr("transform",`translate(${-h.width/2},${-h.height/2+a})`),h.height}(0,n.eW)(t0,"tiltedCylinder"),(0,n.eW)(t2,"trapezoid"),(0,n.eW)(t1,"trapezoidalPentagon"),(0,n.eW)(t5,"triangle"),(0,n.eW)(t8,"waveEdgedRectangle"),(0,n.eW)(t4,"waveRectangle"),(0,n.eW)(t7,"windowPane"),(0,n.eW)(t3,"erBox"),(0,n.eW)(t9,"addText"),(0,n.eW)(t6,"textHelper"),(0,n.eW)(et,"addText"),(0,n.eW)(ee,"classBox"),(0,n.eW)(ea,"requirementBox"),(0,n.eW)(el,"addText");var er=(0,n.eW)(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function ei(t,e,{config:a}){let l,r,i,n;let{labelStyles:s,nodeStyles:y}=D(e);e.labelStyle=s||"";let f=e.width;e.width=(e.width??200)-10;let{shapeSvg:p,bbox:u,label:m}=await o(t,e,g(e)),w=e.padding||10,x="";"ticket"in e&&e.ticket&&a?.kanban?.ticketBaseUrl&&(x=a?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),l=p.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",x).attr("target","_blank"));let $={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};l?{label:r,bbox:i}=await d(l,"ticket"in e&&e.ticket||"",$):{label:r,bbox:i}=await d(p,"ticket"in e&&e.ticket||"",$);let{label:k,bbox:M}=await d(p,"assigned"in e&&e.assigned||"",$);e.width=f;let S=e?.width||0,v=Math.max(i.height,M.height)/2,C=Math.max(u.height+20,e?.height||0)+v,B=-S/2,N=-C/2;m.attr("transform","translate("+(w-S/2)+", "+(-v-u.height/2)+")"),r.attr("transform","translate("+(w-S/2)+", "+(-v+u.height/2)+")"),k.attr("transform","translate("+(w+S/2-M.width-20)+", "+(-v+u.height/2)+")");let{rx:A,ry:L}=e,{cssStyles:R}=e;if("handDrawn"===e.look){let t=h.Z.svg(p),a=W(e,{}),l=A||L?t.path(b(B,N,S,C,A||0),a):t.rectangle(B,N,S,C,a);(n=p.insert(()=>l,":first-child")).attr("class","basic label-container").attr("style",R||null)}else{(n=p.insert("rect",":first-child")).attr("class","basic label-container __APA__").attr("style",y).attr("rx",A??5).attr("ry",L??5).attr("x",B).attr("y",N).attr("width",S).attr("height",C);let t="priority"in e&&e.priority;if(t){let e=p.append("line"),a=B+2,l=N+Math.floor((A??0)/2),r=N+C-Math.floor((A??0)/2);e.attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",r).attr("stroke-width","4").attr("stroke",er(t))}}return c(e,n),e.height=C,e.intersect=function(t){return j.rect(e,t)},p}(0,n.eW)(ei,"kanbanItem");var en=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:tY},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:tH},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:tq},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:tF},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:tn},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:F},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:tI},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:tf},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:tD},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:tS},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:t2},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:t$},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:th},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:tU},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:_},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:tj},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:tz},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:t_},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:tc},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:tp},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:G},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Q},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:te},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:tW},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:t8},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:tg},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:t0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:tN},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:ta},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ts},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:t5},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:t7},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:to},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:t1},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:td},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:tV},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:tR},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:tL},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:q},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:J},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:tJ},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:tX},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:t4},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:tT},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:tA}],es=(0,n.eW)(()=>Object.fromEntries([...Object.entries({state:tO,choice:z,note:tP,rectWithTitle:tE,labelRect:tM,iconSquare:tx,iconCircle:tm,icon:tu,iconRounded:tw,imageSquare:tb,anchor:V,kanbanItem:ei,classBox:ee,erBox:t3,requirementBox:ea}),...en.flatMap(t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map(e=>[e,t.handler]))]),"generateShapeMap")();function eh(t){return t in es}(0,n.eW)(eh,"isValidShape");var eo=new Map;async function ed(t,e,a){let l,r;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let i=e.shape?es[e.shape]:void 0;if(!i)throw Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let n;"sandbox"===a.config.securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),l=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n??null),r=await i(l,e,a)}else l=r=await i(t,e,a);return e.tooltip&&r.attr("title",e.tooltip),eo.set(e.id,l),e.haveCallback&&l.attr("class",l.attr("class")+" clickable"),l}(0,n.eW)(ed,"insertNode");var ec=(0,n.eW)((t,e)=>{eo.set(e.id,t)},"setNodeElem"),eg=(0,n.eW)(()=>{eo.clear()},"clear"),ey=(0,n.eW)(t=>{let e=eo.get(t.id);n.cM.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let a=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+a-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),a},"positionNode")}}]);