@dooc-dev/dooc 0.0.5 → 0.0.7

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 (174) hide show
  1. package/dist/cli.js +162 -67
  2. package/dist/code-worker.global.js +152 -0
  3. package/dist/code.global.js +101 -101
  4. package/dist/compiler/bundle-urls.js +2 -0
  5. package/dist/compiler/check.js +2 -0
  6. package/dist/compiler/compile.js +13 -3
  7. package/dist/compiler/dxf.d.ts +1 -0
  8. package/dist/compiler/dxf.js +81 -0
  9. package/dist/compiler/export.js +22 -15
  10. package/dist/compiler/figures.js +39 -10
  11. package/dist/compiler/files.js +2 -0
  12. package/dist/compiler/ignored-files.d.ts +2 -0
  13. package/dist/compiler/ignored-files.js +30 -0
  14. package/dist/compiler/ops.js +1 -1
  15. package/dist/compiler/subformat-schema.d.ts +14 -0
  16. package/dist/compiler/subformat-schema.js +92 -0
  17. package/dist/compiler/subformats.d.ts +5 -7
  18. package/dist/compiler/subformats.js +115 -75
  19. package/dist/core/code-file.js +7 -5
  20. package/dist/core/code-grammars.d.ts +5 -0
  21. package/dist/core/code-grammars.js +34 -0
  22. package/dist/core/content-metadata.d.ts +2 -1
  23. package/dist/core/content-metadata.js +7 -2
  24. package/dist/core/content-types.d.ts +1 -1
  25. package/dist/core/escape-html.d.ts +1 -0
  26. package/dist/core/escape-html.js +1 -0
  27. package/dist/core/figure-frame.js +1 -1
  28. package/dist/core/file-embed.js +7 -3
  29. package/dist/core/html.d.ts +4 -1
  30. package/dist/core/html.js +8 -7
  31. package/dist/core/language.js +5 -2
  32. package/dist/core/markdown.js +3 -1
  33. package/dist/core/previewers.d.ts +8 -0
  34. package/dist/core/previewers.js +2 -0
  35. package/dist/core/schema-fields.d.ts +13 -0
  36. package/dist/core/schema-fields.js +175 -0
  37. package/dist/core/schema-graph-mount.js +26 -3
  38. package/dist/core/schema-refs.d.ts +8 -0
  39. package/dist/core/schema-refs.js +82 -0
  40. package/dist/core/toc-ui.js +1 -1
  41. package/dist/edit.global.js +266 -285
  42. package/dist/flow.global.js +1031 -1057
  43. package/dist/graph/abnfDiagram-S7VZAUFO-GAGCW2J5.js +1 -0
  44. package/dist/graph/architecture-WOLXFQ4H-AWAC3VBS.js +1 -0
  45. package/dist/graph/architectureDiagram-YGSQEFNW-WQ7QKSUJ.js +36 -0
  46. package/dist/graph/blockDiagram-APKKGZFW-H7ZNJMOM.js +140 -0
  47. package/dist/graph/bpmnIcons-APHXDYXF-EAVPNTFE.js +1 -0
  48. package/dist/graph/c4Diagram-KJ2TOQU5-3IYS34YL.js +38 -0
  49. package/dist/graph/chunk-3CJU2RDX.js +1 -0
  50. package/dist/graph/chunk-3LU66YMI.js +1 -0
  51. package/dist/graph/chunk-3Y2PDVDE.js +1 -0
  52. package/dist/graph/chunk-4KILFWYV.js +339 -0
  53. package/dist/graph/chunk-4QDE4SUK.js +1 -0
  54. package/dist/graph/chunk-5N2X2DXU.js +1 -0
  55. package/dist/graph/chunk-5OO6DATX.js +1 -0
  56. package/dist/graph/chunk-67BPVAXC.js +1 -0
  57. package/dist/graph/chunk-6CDZONCA.js +1 -0
  58. package/dist/graph/chunk-7ASYMKN2.js +1 -0
  59. package/dist/graph/chunk-7JQUFVT4.js +10 -0
  60. package/dist/graph/chunk-7LSMJ4VU.js +72 -0
  61. package/dist/graph/chunk-7UKJADAE.js +213 -0
  62. package/dist/graph/chunk-AARGNXTW.js +32 -0
  63. package/dist/graph/chunk-ARAJTKOH.js +2 -0
  64. package/dist/graph/chunk-BOXAA5AP.js +62 -0
  65. package/dist/graph/chunk-BTMPKSGF.js +1 -0
  66. package/dist/graph/chunk-BVXT562I.js +1 -0
  67. package/dist/graph/chunk-DIDARDST.js +1 -0
  68. package/dist/graph/chunk-EWYECPNJ.js +1 -0
  69. package/dist/graph/chunk-FD7ZFC7R.js +3 -0
  70. package/dist/graph/chunk-GF4TOPUK.js +1 -0
  71. package/dist/graph/chunk-GWYODWCE.js +1 -0
  72. package/dist/graph/chunk-HKRJKXEE.js +1 -0
  73. package/dist/graph/chunk-I5LEUF24.js +1 -0
  74. package/dist/graph/chunk-ICJPOOXG.js +1 -0
  75. package/dist/graph/chunk-IVZHB6RS.js +135 -0
  76. package/dist/graph/chunk-JSHWCPFJ.js +1 -0
  77. package/dist/graph/chunk-JZGXHT3J.js +1 -0
  78. package/dist/graph/chunk-K4I76XBX.js +14 -0
  79. package/dist/graph/chunk-LSRL537V.js +88 -0
  80. package/dist/graph/chunk-LT6LXKCR.js +136 -0
  81. package/dist/graph/chunk-MPR575IN.js +1 -0
  82. package/dist/graph/chunk-N44XPVUD.js +15 -0
  83. package/dist/graph/chunk-NDAMZVXQ.js +1 -0
  84. package/dist/graph/chunk-O656ZI37.js +1 -0
  85. package/dist/graph/chunk-PDH25ALM.js +2 -0
  86. package/dist/graph/chunk-QLS7NIYR.js +2 -0
  87. package/dist/graph/chunk-QQIGL7OP.js +1 -0
  88. package/dist/graph/chunk-QYAXYFNI.js +1 -0
  89. package/dist/graph/chunk-QYTM6GY3.js +1 -0
  90. package/dist/graph/chunk-RJFVWYCA.js +1 -0
  91. package/dist/graph/chunk-SCEY3ZPT.js +1 -0
  92. package/dist/graph/chunk-SQE76S5B.js +1 -0
  93. package/dist/graph/chunk-WQHTQAFY.js +1 -0
  94. package/dist/graph/chunk-XQS73SBQ.js +1 -0
  95. package/dist/graph/chunk-Z4FIZ7CR.js +1 -0
  96. package/dist/graph/chunk-ZSZXN4BT.js +2 -0
  97. package/dist/graph/classDiagram-v2-L25IHNXF-HNTCDTNK.js +217 -0
  98. package/dist/graph/cose-bilkent-JH36ORCC-2GVA7XKO.js +1 -0
  99. package/dist/graph/cynefin-EF2NZ3EQ-TCI65RAQ.js +1 -0
  100. package/dist/graph/cynefinDiagram-L36ESFBY-OKQ5BLVF.js +62 -0
  101. package/dist/graph/dagre-SPEB5RXH-KZEBD52K.js +4 -0
  102. package/dist/graph/diagram-3B7GL73J-ESCBJM3O.js +200 -0
  103. package/dist/graph/diagram-DNEMPZML-ZIBUSQZI.js +24 -0
  104. package/dist/graph/diagram-L3MUGCDN-IGK62IPN.js +41 -0
  105. package/dist/graph/diagram-LA4NIPWU-2KZCOFJ5.js +24 -0
  106. package/dist/graph/diagram-MHCOC4E2-EYAAB236.js +3 -0
  107. package/dist/graph/diagram-XPFHEONP-OZ5ARGMG.js +30 -0
  108. package/dist/graph/ebnfDiagram-UZSYDL2S-M3XJHARD.js +1 -0
  109. package/dist/graph/erDiagram-EYBAPDEH-Y7KUBH7A.js +99 -0
  110. package/dist/graph/eventmodeling-K75KTNOO-ROLYRDEP.js +1 -0
  111. package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
  112. package/dist/graph/ganttDiagram-23REXITY-JSBTFSSJ.js +292 -0
  113. package/dist/graph/gitGraph-VSP46ZUC-ZCBCDVNF.js +1 -0
  114. package/dist/graph/gitGraphDiagram-STJD7YCW-3ZA5FT3G.js +106 -0
  115. package/dist/graph/info-OHQRW6UA-JKJGOQNY.js +1 -0
  116. package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
  117. package/dist/graph/ishikawaDiagram-M35NCXHK-YLEU44DY.js +70 -0
  118. package/dist/graph/journeyDiagram-OPLOXDXO-ZHJV66ZT.js +139 -0
  119. package/dist/graph/kanban-definition-BZKZHSQY-SDU25WUM.js +89 -0
  120. package/dist/graph/katex-WSLZOTY7.js +257 -0
  121. package/dist/graph/mindmap-definition-I2QAS2VK-XQNBCYHN.js +98 -0
  122. package/dist/graph/packet-JDAUHWVQ-Y3H77ERD.js +1 -0
  123. package/dist/graph/pegDiagram-FD4XPPHP-YO4VWH6V.js +1 -0
  124. package/dist/graph/pie-XZMESJXO-PRER4XL5.js +1 -0
  125. package/dist/graph/pieDiagram-J4AKIIQI-TJ5WOOSV.js +39 -0
  126. package/dist/graph/quadrantDiagram-XTYBLID2-G6MSSZLW.js +7 -0
  127. package/dist/graph/radar-ABXABTNO-M6MV34GM.js +1 -0
  128. package/dist/graph/railroad-I3PHUGI6-YIWPGN6Q.js +1 -0
  129. package/dist/graph/railroad-abnf-LNEFI6M7-7JHLZ2R7.js +1 -0
  130. package/dist/graph/railroad-ebnf-DWYD2UWJ-V55BXEWY.js +1 -0
  131. package/dist/graph/railroad-peg-JR7BVNR7-XCGKDRMK.js +1 -0
  132. package/dist/graph/railroadDiagram-MRQ6NCDL-RACSFXC4.js +1 -0
  133. package/dist/graph/requirementDiagram-Y7LWUY3S-4LQIQWHQ.js +84 -0
  134. package/dist/graph/sankeyDiagram-WGJFYUXA-K3RXG5FB.js +40 -0
  135. package/dist/graph/schema-graph-global.js +639 -0
  136. package/dist/graph/sequenceDiagram-5NDRBG5M-Y6RBHRS3.js +169 -0
  137. package/dist/graph/sizeCapture-INFHLROL-TJW3VUGH.js +1 -0
  138. package/dist/graph/stateDiagram-v2-FJ4FJNEA-4M5WZORG.js +291 -0
  139. package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
  140. package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
  141. package/dist/graph/timeline-definition-SEUHKTQE-IHISQ4Q7.js +120 -0
  142. package/dist/graph/treeView-D4JQ5SDB-EVGY4VYS.js +1 -0
  143. package/dist/graph/treemap-SAJKECNS-LN3SMFRX.js +1 -0
  144. package/dist/graph/usecaseDiagram-AFA6YXN4-B645A3J6.js +370 -0
  145. package/dist/graph/vennDiagram-NNMJR3RB-K3HWMON6.js +34 -0
  146. package/dist/graph/wardley-7MLQ67FV-RRWOELC6.js +1 -0
  147. package/dist/graph/wardleyDiagram-S7YFUSEH-DMMWKJEK.js +78 -0
  148. package/dist/graph/xychartDiagram-GGNKY7IX-K6MUQVXR.js +7 -0
  149. package/dist/mcp.js +5 -4
  150. package/dist/plugins.global.js +71 -104
  151. package/dist/subformats.global.js +6 -112
  152. package/dist/ui.global.js +75 -108
  153. package/dist/viewer/build.d.ts +2 -0
  154. package/dist/viewer/build.js +22 -8
  155. package/dist/viewer/code-file.js +7 -2
  156. package/dist/viewer/figure-preview.d.ts +4 -0
  157. package/dist/viewer/figure-preview.js +54 -0
  158. package/dist/viewer/hmr.js +4 -3
  159. package/dist/viewer/lazy-preview.d.ts +2 -0
  160. package/dist/viewer/lazy-preview.js +43 -0
  161. package/dist/viewer/locales/eng.json +26 -3
  162. package/dist/viewer/locales/jpn.json +26 -3
  163. package/dist/viewer/locales/zho.json +26 -3
  164. package/dist/viewer/plugin-blocks.js +1 -1
  165. package/dist/viewer/plugins.js +1 -1
  166. package/dist/viewer/resource-library.d.ts +1 -1
  167. package/dist/viewer/resource-library.js +5 -4
  168. package/dist/viewer/serve.d.ts +2 -1
  169. package/dist/viewer/serve.js +148 -41
  170. package/dist/viewer/textfile.d.ts +2 -0
  171. package/dist/viewer/textfile.js +20 -5
  172. package/package.json +14 -4
  173. package/dist/viewer/lazy-graph.d.ts +0 -2
  174. package/dist/viewer/lazy-graph.js +0 -30
@@ -0,0 +1 @@
1
+ function Y(a,t,s){if(a&&a.length){let[e,n]=t,o=Math.PI/180*s,r=Math.cos(o),h=Math.sin(o);for(let i of a){let[l,c]=i;i[0]=(l-e)*r-(c-n)*h+e,i[1]=(l-e)*h+(c-n)*r+n}}}function zt(a,t){return a[0]===t[0]&&a[1]===t[1]}function Wt(a,t,s,e=1){let n=s,o=Math.max(t,.1),r=a[0]&&a[0][0]&&typeof a[0][0]=="number"?[a]:a,h=[0,0];if(n)for(let l of r)Y(l,h,n);let i=(function(l,c,d){let p=[];for(let M of l){let m=[...M];zt(m[0],m[m.length-1])||m.push([m[0][0],m[0][1]]),m.length>2&&p.push(m)}let u=[];c=Math.max(c,.1);let f=[];for(let M of p)for(let m=0;m<M.length-1;m++){let P=M[m],x=M[m+1];if(P[1]!==x[1]){let w=Math.min(P[1],x[1]);f.push({ymin:w,ymax:Math.max(P[1],x[1]),x:w===P[1]?P[0]:x[0],islope:(x[0]-P[0])/(x[1]-P[1])})}}if(f.sort(((M,m)=>M.ymin<m.ymin?-1:M.ymin>m.ymin?1:M.x<m.x?-1:M.x>m.x?1:M.ymax===m.ymax?0:(M.ymax-m.ymax)/Math.abs(M.ymax-m.ymax))),!f.length)return u;let g=[],k=f[0].ymin,b=0;for(;g.length||f.length;){if(f.length){let M=-1;for(let m=0;m<f.length&&!(f[m].ymin>k);m++)M=m;f.splice(0,M+1).forEach((m=>{g.push({s:k,edge:m})}))}if(g=g.filter((M=>!(M.edge.ymax<=k))),g.sort(((M,m)=>M.edge.x===m.edge.x?0:(M.edge.x-m.edge.x)/Math.abs(M.edge.x-m.edge.x))),(d!==1||b%c==0)&&g.length>1)for(let M=0;M<g.length;M+=2){let m=M+1;if(m>=g.length)break;let P=g[M].edge,x=g[m].edge;u.push([[Math.round(P.x),k],[Math.round(x.x),k]])}k+=d,g.forEach((M=>{M.edge.x=M.edge.x+d*M.edge.islope})),b++}return u})(r,o,e);if(n){for(let l of r)Y(l,h,-n);(function(l,c,d){let p=[];l.forEach((u=>p.push(...u))),Y(p,c,d)})(i,h,-n)}return i}function F(a,t){var s;let e=t.hachureAngle+90,n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.round(Math.max(n,.1));let o=1;return t.roughness>=1&&(((s=t.randomizer)===null||s===void 0?void 0:s.next())||Math.random())>.7&&(o=n),Wt(a,n,e,o||1)}var q=class{constructor(t){this.helper=t}fillPolygons(t,s){return this._fillPolygons(t,s)}_fillPolygons(t,s){let e=F(t,s);return{type:"fillSketch",ops:this.renderLines(e,s)}}renderLines(t,s){let e=[];for(let n of t)e.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],s));return e}};function X(a){let t=a[0],s=a[1];return Math.sqrt(Math.pow(t[0]-s[0],2)+Math.pow(t[1]-s[1],2))}var at=class extends q{fillPolygons(t,s){let e=s.hachureGap;e<0&&(e=4*s.strokeWidth),e=Math.max(e,.1);let n=F(t,Object.assign({},s,{hachureGap:e})),o=Math.PI/180*s.hachureAngle,r=[],h=.5*e*Math.cos(o),i=.5*e*Math.sin(o);for(let[l,c]of n)X([l,c])&&r.push([[l[0]-h,l[1]+i],[...c]],[[l[0]+h,l[1]-i],[...c]]);return{type:"fillSketch",ops:this.renderLines(r,s)}}},ot=class extends q{fillPolygons(t,s){let e=this._fillPolygons(t,s),n=Object.assign({},s,{hachureAngle:s.hachureAngle+90}),o=this._fillPolygons(t,n);return e.ops=e.ops.concat(o.ops),e}},ht=class{constructor(t){this.helper=t}fillPolygons(t,s){let e=F(t,s=Object.assign({},s,{hachureAngle:0}));return this.dotsOnLines(e,s)}dotsOnLines(t,s){let e=[],n=s.hachureGap;n<0&&(n=4*s.strokeWidth),n=Math.max(n,.1);let o=s.fillWeight;o<0&&(o=s.strokeWidth/2);let r=n/4;for(let h of t){let i=X(h),l=i/n,c=Math.ceil(l)-1,d=i-c*n,p=(h[0][0]+h[1][0])/2-n/4,u=Math.min(h[0][1],h[1][1]);for(let f=0;f<c;f++){let g=u+d+f*n,k=p-r+2*Math.random()*r,b=g-r+2*Math.random()*r,M=this.helper.ellipse(k,b,o,o,s);e.push(...M.ops)}}return{type:"fillSketch",ops:e}}},rt=class{constructor(t){this.helper=t}fillPolygons(t,s){let e=F(t,s);return{type:"fillSketch",ops:this.dashedLine(e,s)}}dashedLine(t,s){let e=s.dashOffset<0?s.hachureGap<0?4*s.strokeWidth:s.hachureGap:s.dashOffset,n=s.dashGap<0?s.hachureGap<0?4*s.strokeWidth:s.hachureGap:s.dashGap,o=[];return t.forEach((r=>{let h=X(r),i=Math.floor(h/(e+n)),l=(h+n-i*(e+n))/2,c=r[0],d=r[1];c[0]>d[0]&&(c=r[1],d=r[0]);let p=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let u=0;u<i;u++){let f=u*(e+n),g=f+e,k=[c[0]+f*Math.cos(p)+l*Math.cos(p),c[1]+f*Math.sin(p)+l*Math.sin(p)],b=[c[0]+g*Math.cos(p)+l*Math.cos(p),c[1]+g*Math.sin(p)+l*Math.sin(p)];o.push(...this.helper.doubleLineOps(k[0],k[1],b[0],b[1],s))}})),o}},it=class{constructor(t){this.helper=t}fillPolygons(t,s){let e=s.hachureGap<0?4*s.strokeWidth:s.hachureGap,n=s.zigzagOffset<0?e:s.zigzagOffset,o=F(t,s=Object.assign({},s,{hachureGap:e+n}));return{type:"fillSketch",ops:this.zigzagLines(o,n,s)}}zigzagLines(t,s,e){let n=[];return t.forEach((o=>{let r=X(o),h=Math.round(r/(2*s)),i=o[0],l=o[1];i[0]>l[0]&&(i=o[1],l=o[0]);let c=Math.atan((l[1]-i[1])/(l[0]-i[0]));for(let d=0;d<h;d++){let p=2*d*s,u=2*(d+1)*s,f=Math.sqrt(2*Math.pow(s,2)),g=[i[0]+p*Math.cos(c),i[1]+p*Math.sin(c)],k=[i[0]+u*Math.cos(c),i[1]+u*Math.sin(c)],b=[g[0]+f*Math.cos(c+Math.PI/4),g[1]+f*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(g[0],g[1],b[0],b[1],e),...this.helper.doubleLineOps(b[0],b[1],k[0],k[1],e))}})),n}},S={},ct=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},Et=0,tt=1,bt=2,Z={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function et(a,t){return a.type===t}function gt(a){let t=[],s=(function(r){let h=new Array;for(;r!=="";)if(r.match(/^([ \t\r\n,]+)/))r=r.substr(RegExp.$1.length);else if(r.match(/^([aAcChHlLmMqQsStTvVzZ])/))h[h.length]={type:Et,text:RegExp.$1},r=r.substr(RegExp.$1.length);else{if(!r.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];h[h.length]={type:tt,text:`${parseFloat(RegExp.$1)}`},r=r.substr(RegExp.$1.length)}return h[h.length]={type:bt,text:""},h})(a),e="BOD",n=0,o=s[n];for(;!et(o,bt);){let r=0,h=[];if(e==="BOD"){if(o.text!=="M"&&o.text!=="m")return gt("M0,0"+a);n++,r=Z[o.text],e=o.text}else et(o,tt)?r=Z[e]:(n++,r=Z[o.text],e=o.text);if(!(n+r<s.length))throw new Error("Path data ended short");for(let i=n;i<n+r;i++){let l=s[i];if(!et(l,tt))throw new Error("Param not a number: "+e+","+l.text);h[h.length]=+l.text}if(typeof Z[e]!="number")throw new Error("Bad segment: "+e);{let i={key:e,data:h};t.push(i),n+=r,o=s[n],e==="M"&&(e="L"),e==="m"&&(e="l")}}return t}function Ot(a){let t=0,s=0,e=0,n=0,o=[];for(let{key:r,data:h}of a)switch(r){case"M":o.push({key:"M",data:[...h]}),[t,s]=h,[e,n]=h;break;case"m":t+=h[0],s+=h[1],o.push({key:"M",data:[t,s]}),e=t,n=s;break;case"L":o.push({key:"L",data:[...h]}),[t,s]=h;break;case"l":t+=h[0],s+=h[1],o.push({key:"L",data:[t,s]});break;case"C":o.push({key:"C",data:[...h]}),t=h[4],s=h[5];break;case"c":{let i=h.map(((l,c)=>c%2?l+s:l+t));o.push({key:"C",data:i}),t=i[4],s=i[5];break}case"Q":o.push({key:"Q",data:[...h]}),t=h[2],s=h[3];break;case"q":{let i=h.map(((l,c)=>c%2?l+s:l+t));o.push({key:"Q",data:i}),t=i[2],s=i[3];break}case"A":o.push({key:"A",data:[...h]}),t=h[5],s=h[6];break;case"a":t+=h[5],s+=h[6],o.push({key:"A",data:[h[0],h[1],h[2],h[3],h[4],t,s]});break;case"H":o.push({key:"H",data:[...h]}),t=h[0];break;case"h":t+=h[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...h]}),s=h[0];break;case"v":s+=h[0],o.push({key:"V",data:[s]});break;case"S":o.push({key:"S",data:[...h]}),t=h[2],s=h[3];break;case"s":{let i=h.map(((l,c)=>c%2?l+s:l+t));o.push({key:"S",data:i}),t=i[2],s=i[3];break}case"T":o.push({key:"T",data:[...h]}),t=h[0],s=h[1];break;case"t":t+=h[0],s+=h[1],o.push({key:"T",data:[t,s]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=e,s=n}return o}function Lt(a){let t=[],s="",e=0,n=0,o=0,r=0,h=0,i=0;for(let{key:l,data:c}of a){switch(l){case"M":t.push({key:"M",data:[...c]}),[e,n]=c,[o,r]=c;break;case"C":t.push({key:"C",data:[...c]}),e=c[4],n=c[5],h=c[2],i=c[3];break;case"L":t.push({key:"L",data:[...c]}),[e,n]=c;break;case"H":e=c[0],t.push({key:"L",data:[e,n]});break;case"V":n=c[0],t.push({key:"L",data:[e,n]});break;case"S":{let d=0,p=0;s==="C"||s==="S"?(d=e+(e-h),p=n+(n-i)):(d=e,p=n),t.push({key:"C",data:[d,p,...c]}),h=c[0],i=c[1],e=c[2],n=c[3];break}case"T":{let[d,p]=c,u=0,f=0;s==="Q"||s==="T"?(u=e+(e-h),f=n+(n-i)):(u=e,f=n);let g=e+2*(u-e)/3,k=n+2*(f-n)/3,b=d+2*(u-d)/3,M=p+2*(f-p)/3;t.push({key:"C",data:[g,k,b,M,d,p]}),h=u,i=f,e=d,n=p;break}case"Q":{let[d,p,u,f]=c,g=e+2*(d-e)/3,k=n+2*(p-n)/3,b=u+2*(d-u)/3,M=f+2*(p-f)/3;t.push({key:"C",data:[g,k,b,M,u,f]}),h=d,i=p,e=u,n=f;break}case"A":{let d=Math.abs(c[0]),p=Math.abs(c[1]),u=c[2],f=c[3],g=c[4],k=c[5],b=c[6];d===0||p===0?(t.push({key:"C",data:[e,n,k,b,k,b]}),e=k,n=b):(e!==k||n!==b)&&(Tt(e,n,k,b,d,p,u,f,g).forEach((function(M){t.push({key:"C",data:M})})),e=k,n=b);break}case"Z":t.push({key:"Z",data:[]}),e=o,n=r}s=l}return t}function R(a,t,s){return[a*Math.cos(s)-t*Math.sin(s),a*Math.sin(s)+t*Math.cos(s)]}function Tt(a,t,s,e,n,o,r,h,i,l){let c=(d=r,Math.PI*d/180);var d;let p=[],u=0,f=0,g=0,k=0;if(l)[u,f,g,k]=l;else{[a,t]=R(a,t,-c),[s,e]=R(s,e,-c);let T=(a-s)/2,v=(t-e)/2,_=T*T/(n*n)+v*v/(o*o);_>1&&(_=Math.sqrt(_),n*=_,o*=_);let W=n*n,E=o*o,It=W*E-W*v*v-E*T*T,Ct=W*v*v+E*T*T,kt=(h===i?-1:1)*Math.sqrt(Math.abs(It/Ct));g=kt*n*v/o+(a+s)/2,k=kt*-o*T/n+(t+e)/2,u=Math.asin(parseFloat(((t-k)/o).toFixed(9))),f=Math.asin(parseFloat(((e-k)/o).toFixed(9))),a<g&&(u=Math.PI-u),s<g&&(f=Math.PI-f),u<0&&(u=2*Math.PI+u),f<0&&(f=2*Math.PI+f),i&&u>f&&(u-=2*Math.PI),!i&&f>u&&(f-=2*Math.PI)}let b=f-u;if(Math.abs(b)>120*Math.PI/180){let T=f,v=s,_=e;f=i&&f>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,p=Tt(s=g+n*Math.cos(f),e=k+o*Math.sin(f),v,_,n,o,r,0,i,[f,T,g,k])}b=f-u;let M=Math.cos(u),m=Math.sin(u),P=Math.cos(f),x=Math.sin(f),w=Math.tan(b/4),L=4/3*n*w,A=4/3*o*w,V=[a,t],D=[a+L*m,t-A*M],C=[s+L*x,e-A*P],Mt=[s,e];if(D[0]=2*V[0]-D[0],D[1]=2*V[1]-D[1],l)return[D,C,Mt].concat(p);{p=[D,C,Mt].concat(p);let T=[];for(let v=0;v<p.length;v+=3){let _=R(p[v][0],p[v][1],c),W=R(p[v+1][0],p[v+1][1],c),E=R(p[v+2][0],p[v+2][1],c);T.push([_[0],_[1],W[0],W[1],E[0],E[1]])}return T}}var Gt={randOffset:function(a,t){return y(a,t)},randOffsetWithRange:function(a,t,s){return J(a,t,s)},ellipse:function(a,t,s,e,n){let o=At(s,e,n);return lt(a,t,n,o).opset},doubleLineOps:function(a,t,s,e,n){return I(a,t,s,e,n,!0)}};function Dt(a,t,s,e,n){return{type:"path",ops:I(a,t,s,e,n)}}function N(a,t,s){let e=(a||[]).length;if(e>2){let n=[];for(let o=0;o<e-1;o++)n.push(...I(a[o][0],a[o][1],a[o+1][0],a[o+1][1],s));return t&&n.push(...I(a[e-1][0],a[e-1][1],a[0][0],a[0][1],s)),{type:"path",ops:n}}return e===2?Dt(a[0][0],a[0][1],a[1][0],a[1][1],s):{type:"path",ops:[]}}function $t(a,t,s,e,n){return(function(o,r){return N(o,!0,r)})([[a,t],[a+s,t],[a+s,t+e],[a,t+e]],n)}function yt(a,t){if(a.length){let s=typeof a[0][0]=="number"?[a]:a,e=Q(s[0],1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:Q(s[0],1.5*(1+.22*t.roughness),xt(t));for(let o=1;o<s.length;o++){let r=s[o];if(r.length){let h=Q(r,1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:Q(r,1.5*(1+.22*t.roughness),xt(t));for(let l of h)l.op!=="move"&&e.push(l);for(let l of i)l.op!=="move"&&n.push(l)}}return{type:"path",ops:e.concat(n)}}return{type:"path",ops:[]}}function At(a,t,s){let e=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(a/2,2)+Math.pow(t/2,2))/2)),n=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*e)),o=2*Math.PI/n,r=Math.abs(a/2),h=Math.abs(t/2),i=1-s.curveFitting;return r+=y(r*i,s),h+=y(h*i,s),{increment:o,rx:r,ry:h}}function lt(a,t,s,e){let[n,o]=Pt(e.increment,a,t,e.rx,e.ry,1,e.increment*J(.1,J(.4,1,s),s),s),r=K(n,null,s);if(!s.disableMultiStroke&&s.roughness!==0){let[h]=Pt(e.increment,a,t,e.rx,e.ry,1.5,0,s),i=K(h,null,s);r=r.concat(i)}return{estimatedPoints:o,opset:{type:"path",ops:r}}}function mt(a,t,s,e,n,o,r,h,i){let l=a,c=t,d=Math.abs(s/2),p=Math.abs(e/2);d+=y(.01*d,i),p+=y(.01*p,i);let u=n,f=o;for(;u<0;)u+=2*Math.PI,f+=2*Math.PI;f-u>2*Math.PI&&(u=0,f=2*Math.PI);let g=2*Math.PI/i.curveStepCount,k=Math.min(g/2,(f-u)/2),b=vt(k,l,c,d,p,u,f,1,i);if(!i.disableMultiStroke){let M=vt(k,l,c,d,p,u,f,1.5,i);b.push(...M)}return r&&(h?b.push(...I(l,c,l+d*Math.cos(u),c+p*Math.sin(u),i),...I(l,c,l+d*Math.cos(f),c+p*Math.sin(f),i)):b.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+d*Math.cos(u),c+p*Math.sin(u)]})),{type:"path",ops:b}}function wt(a,t){let s=Lt(Ot(gt(a))),e=[],n=[0,0],o=[0,0];for(let{key:r,data:h}of s)switch(r){case"M":o=[h[0],h[1]],n=[h[0],h[1]];break;case"L":e.push(...I(o[0],o[1],h[0],h[1],t)),o=[h[0],h[1]];break;case"C":{let[i,l,c,d,p,u]=h;e.push(...Rt(i,l,c,d,p,u,o,t)),o=[p,u];break}case"Z":e.push(...I(o[0],o[1],n[0],n[1],t)),o=[n[0],n[1]]}return{type:"path",ops:e}}function st(a,t){let s=[];for(let e of a)if(e.length){let n=t.maxRandomnessOffset||0,o=e.length;if(o>2){s.push({op:"move",data:[e[0][0]+y(n,t),e[0][1]+y(n,t)]});for(let r=1;r<o;r++)s.push({op:"lineTo",data:[e[r][0]+y(n,t),e[r][1]+y(n,t)]})}}return{type:"fillPath",ops:s}}function G(a,t){return(function(s,e){let n=s.fillStyle||"hachure";if(!S[n])switch(n){case"zigzag":S[n]||(S[n]=new at(e));break;case"cross-hatch":S[n]||(S[n]=new ot(e));break;case"dots":S[n]||(S[n]=new ht(e));break;case"dashed":S[n]||(S[n]=new rt(e));break;case"zigzag-line":S[n]||(S[n]=new it(e));break;default:n="hachure",S[n]||(S[n]=new q(e))}return S[n]})(t,Gt).fillPolygons(a,t)}function xt(a){let t=Object.assign({},a);return t.randomizer=void 0,a.seed&&(t.seed=a.seed+1),t}function _t(a){return a.randomizer||(a.randomizer=new ct(a.seed||0)),a.randomizer.next()}function J(a,t,s,e=1){return s.roughness*e*(_t(s)*(t-a)+a)}function y(a,t,s=1){return J(-a,a,t,s)}function I(a,t,s,e,n,o=!1){let r=o?n.disableMultiStrokeFill:n.disableMultiStroke,h=ut(a,t,s,e,n,!0,!1);if(r)return h;let i=ut(a,t,s,e,n,!0,!0);return h.concat(i)}function ut(a,t,s,e,n,o,r){let h=Math.pow(a-s,2)+Math.pow(t-e,2),i=Math.sqrt(h),l=1;l=i<200?1:i>500?.4:-.0016668*i+1.233334;let c=n.maxRandomnessOffset||0;c*c*100>h&&(c=i/10);let d=c/2,p=.2+.2*_t(n),u=n.bowing*n.maxRandomnessOffset*(e-t)/200,f=n.bowing*n.maxRandomnessOffset*(a-s)/200;u=y(u,n,l),f=y(f,n,l);let g=[],k=()=>y(d,n,l),b=()=>y(c,n,l),M=n.preserveVertices;return o&&(r?g.push({op:"move",data:[a+(M?0:k()),t+(M?0:k())]}):g.push({op:"move",data:[a+(M?0:y(c,n,l)),t+(M?0:y(c,n,l))]})),r?g.push({op:"bcurveTo",data:[u+a+(s-a)*p+k(),f+t+(e-t)*p+k(),u+a+2*(s-a)*p+k(),f+t+2*(e-t)*p+k(),s+(M?0:k()),e+(M?0:k())]}):g.push({op:"bcurveTo",data:[u+a+(s-a)*p+b(),f+t+(e-t)*p+b(),u+a+2*(s-a)*p+b(),f+t+2*(e-t)*p+b(),s+(M?0:b()),e+(M?0:b())]}),g}function Q(a,t,s){if(!a.length)return[];let e=[];e.push([a[0][0]+y(t,s),a[0][1]+y(t,s)]),e.push([a[0][0]+y(t,s),a[0][1]+y(t,s)]);for(let n=1;n<a.length;n++)e.push([a[n][0]+y(t,s),a[n][1]+y(t,s)]),n===a.length-1&&e.push([a[n][0]+y(t,s),a[n][1]+y(t,s)]);return K(e,null,s)}function K(a,t,s){let e=a.length,n=[];if(e>3){let o=[],r=1-s.curveTightness;n.push({op:"move",data:[a[1][0],a[1][1]]});for(let h=1;h+2<e;h++){let i=a[h];o[0]=[i[0],i[1]],o[1]=[i[0]+(r*a[h+1][0]-r*a[h-1][0])/6,i[1]+(r*a[h+1][1]-r*a[h-1][1])/6],o[2]=[a[h+1][0]+(r*a[h][0]-r*a[h+2][0])/6,a[h+1][1]+(r*a[h][1]-r*a[h+2][1])/6],o[3]=[a[h+1][0],a[h+1][1]],n.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}if(t&&t.length===2){let h=s.maxRandomnessOffset;n.push({op:"lineTo",data:[t[0]+y(h,s),t[1]+y(h,s)]})}}else e===3?(n.push({op:"move",data:[a[1][0],a[1][1]]}),n.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[2][0],a[2][1]]})):e===2&&n.push(...ut(a[0][0],a[0][1],a[1][0],a[1][1],s,!0,!0));return n}function Pt(a,t,s,e,n,o,r,h){let i=[],l=[];if(h.roughness===0){a/=4,l.push([t+e*Math.cos(-a),s+n*Math.sin(-a)]);for(let c=0;c<=2*Math.PI;c+=a){let d=[t+e*Math.cos(c),s+n*Math.sin(c)];i.push(d),l.push(d)}l.push([t+e*Math.cos(0),s+n*Math.sin(0)]),l.push([t+e*Math.cos(a),s+n*Math.sin(a)])}else{let c=y(.5,h)-Math.PI/2;l.push([y(o,h)+t+.9*e*Math.cos(c-a),y(o,h)+s+.9*n*Math.sin(c-a)]);let d=2*Math.PI+c-.01;for(let p=c;p<d;p+=a){let u=[y(o,h)+t+e*Math.cos(p),y(o,h)+s+n*Math.sin(p)];i.push(u),l.push(u)}l.push([y(o,h)+t+e*Math.cos(c+2*Math.PI+.5*r),y(o,h)+s+n*Math.sin(c+2*Math.PI+.5*r)]),l.push([y(o,h)+t+.98*e*Math.cos(c+r),y(o,h)+s+.98*n*Math.sin(c+r)]),l.push([y(o,h)+t+.9*e*Math.cos(c+.5*r),y(o,h)+s+.9*n*Math.sin(c+.5*r)])}return[l,i]}function vt(a,t,s,e,n,o,r,h,i){let l=o+y(.1,i),c=[];c.push([y(h,i)+t+.9*e*Math.cos(l-a),y(h,i)+s+.9*n*Math.sin(l-a)]);for(let d=l;d<=r;d+=a)c.push([y(h,i)+t+e*Math.cos(d),y(h,i)+s+n*Math.sin(d)]);return c.push([t+e*Math.cos(r),s+n*Math.sin(r)]),c.push([t+e*Math.cos(r),s+n*Math.sin(r)]),K(c,null,i)}function Rt(a,t,s,e,n,o,r,h){let i=[],l=[h.maxRandomnessOffset||1,(h.maxRandomnessOffset||1)+.3],c=[0,0],d=h.disableMultiStroke?1:2,p=h.preserveVertices;for(let u=0;u<d;u++)u===0?i.push({op:"move",data:[r[0],r[1]]}):i.push({op:"move",data:[r[0]+(p?0:y(l[0],h)),r[1]+(p?0:y(l[0],h))]}),c=p?[n,o]:[n+y(l[u],h),o+y(l[u],h)],i.push({op:"bcurveTo",data:[a+y(l[u],h),t+y(l[u],h),s+y(l[u],h),e+y(l[u],h),c[0],c[1]]});return i}function j(a){return[...a]}function St(a,t=0){let s=a.length;if(s<3)throw new Error("A curve must have at least three points.");let e=[];if(s===3)e.push(j(a[0]),j(a[1]),j(a[2]),j(a[2]));else{let n=[];n.push(a[0],a[0]);for(let h=1;h<a.length;h++)n.push(a[h]),h===a.length-1&&n.push(a[h]);let o=[],r=1-t;e.push(j(n[0]));for(let h=1;h+2<n.length;h++){let i=n[h];o[0]=[i[0],i[1]],o[1]=[i[0]+(r*n[h+1][0]-r*n[h-1][0])/6,i[1]+(r*n[h+1][1]-r*n[h-1][1])/6],o[2]=[n[h+1][0]+(r*n[h][0]-r*n[h+2][0])/6,n[h+1][1]+(r*n[h][1]-r*n[h+2][1])/6],o[3]=[n[h+1][0],n[h+1][1]],e.push(o[1],o[2],o[3])}}return e}function B(a,t){return Math.pow(a[0]-t[0],2)+Math.pow(a[1]-t[1],2)}function jt(a,t,s){let e=B(t,s);if(e===0)return B(a,t);let n=((a[0]-t[0])*(s[0]-t[0])+(a[1]-t[1])*(s[1]-t[1]))/e;return n=Math.max(0,Math.min(1,n)),B(a,z(t,s,n))}function z(a,t,s){return[a[0]+(t[0]-a[0])*s,a[1]+(t[1]-a[1])*s]}function pt(a,t,s,e){let n=e||[];if((function(h,i){let l=h[i+0],c=h[i+1],d=h[i+2],p=h[i+3],u=3*c[0]-2*l[0]-p[0];u*=u;let f=3*c[1]-2*l[1]-p[1];f*=f;let g=3*d[0]-2*p[0]-l[0];g*=g;let k=3*d[1]-2*p[1]-l[1];return k*=k,u<g&&(u=g),f<k&&(f=k),u+f})(a,t)<s){let h=a[t+0];n.length?(o=n[n.length-1],r=h,Math.sqrt(B(o,r))>1&&n.push(h)):n.push(h),n.push(a[t+3])}else{let i=a[t+0],l=a[t+1],c=a[t+2],d=a[t+3],p=z(i,l,.5),u=z(l,c,.5),f=z(c,d,.5),g=z(p,u,.5),k=z(u,f,.5),b=z(g,k,.5);pt([i,p,g,b],0,s,n),pt([b,k,f,d],0,s,n)}var o,r;return n}function qt(a,t){return U(a,0,a.length,t)}function U(a,t,s,e,n){let o=n||[],r=a[t],h=a[s-1],i=0,l=1;for(let c=t+1;c<s-1;++c){let d=jt(a[c],r,h);d>i&&(i=d,l=c)}return Math.sqrt(i)>e?(U(a,t,l+1,e,o),U(a,l,s,e,o)):(o.length||o.push(r),o.push(h)),o}function nt(a,t=.15,s){let e=[],n=(a.length-1)/3;for(let o=0;o<n;o++)pt(a,3*o,t,e);return s&&s>0?U(e,0,e.length,s):e}var O="none",$=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,s,e){return{shape:t,sets:s||[],options:e||this.defaultOptions}}line(t,s,e,n,o){let r=this._o(o);return this._d("line",[Dt(t,s,e,n,r)],r)}rectangle(t,s,e,n,o){let r=this._o(o),h=[],i=$t(t,s,e,n,r);if(r.fill){let l=[[t,s],[t+e,s],[t+e,s+n],[t,s+n]];r.fillStyle==="solid"?h.push(st([l],r)):h.push(G([l],r))}return r.stroke!==O&&h.push(i),this._d("rectangle",h,r)}ellipse(t,s,e,n,o){let r=this._o(o),h=[],i=At(e,n,r),l=lt(t,s,r,i);if(r.fill)if(r.fillStyle==="solid"){let c=lt(t,s,r,i).opset;c.type="fillPath",h.push(c)}else h.push(G([l.estimatedPoints],r));return r.stroke!==O&&h.push(l.opset),this._d("ellipse",h,r)}circle(t,s,e,n){let o=this.ellipse(t,s,e,e,n);return o.shape="circle",o}linearPath(t,s){let e=this._o(s);return this._d("linearPath",[N(t,!1,e)],e)}arc(t,s,e,n,o,r,h=!1,i){let l=this._o(i),c=[],d=mt(t,s,e,n,o,r,h,!0,l);if(h&&l.fill)if(l.fillStyle==="solid"){let p=Object.assign({},l);p.disableMultiStroke=!0;let u=mt(t,s,e,n,o,r,!0,!1,p);u.type="fillPath",c.push(u)}else c.push((function(p,u,f,g,k,b,M){let m=p,P=u,x=Math.abs(f/2),w=Math.abs(g/2);x+=y(.01*x,M),w+=y(.01*w,M);let L=k,A=b;for(;L<0;)L+=2*Math.PI,A+=2*Math.PI;A-L>2*Math.PI&&(L=0,A=2*Math.PI);let V=(A-L)/M.curveStepCount,D=[];for(let C=L;C<=A;C+=V)D.push([m+x*Math.cos(C),P+w*Math.sin(C)]);return D.push([m+x*Math.cos(A),P+w*Math.sin(A)]),D.push([m,P]),G([D],M)})(t,s,e,n,o,r,l));return l.stroke!==O&&c.push(d),this._d("arc",c,l)}curve(t,s){let e=this._o(s),n=[],o=yt(t,e);if(e.fill&&e.fill!==O)if(e.fillStyle==="solid"){let r=yt(t,Object.assign(Object.assign({},e),{disableMultiStroke:!0,roughness:e.roughness?e.roughness+e.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(r.ops)})}else{let r=[],h=t;if(h.length){let i=typeof h[0][0]=="number"?[h]:h;for(let l of i)l.length<3?r.push(...l):l.length===3?r.push(...nt(St([l[0],l[0],l[1],l[2]]),10,(1+e.roughness)/2)):r.push(...nt(St(l),10,(1+e.roughness)/2))}r.length&&n.push(G([r],e))}return e.stroke!==O&&n.push(o),this._d("curve",n,e)}polygon(t,s){let e=this._o(s),n=[],o=N(t,!0,e);return e.fill&&(e.fillStyle==="solid"?n.push(st([t],e)):n.push(G([t],e))),e.stroke!==O&&n.push(o),this._d("polygon",n,e)}path(t,s){let e=this._o(s),n=[];if(!t)return this._d("path",n,e);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let o=e.fill&&e.fill!=="transparent"&&e.fill!==O,r=e.stroke!==O,h=!!(e.simplification&&e.simplification<1),i=(function(c,d,p){let u=Lt(Ot(gt(c))),f=[],g=[],k=[0,0],b=[],M=()=>{b.length>=4&&g.push(...nt(b,d)),b=[]},m=()=>{M(),g.length&&(f.push(g),g=[])};for(let{key:x,data:w}of u)switch(x){case"M":m(),k=[w[0],w[1]],g.push(k);break;case"L":M(),g.push([w[0],w[1]]);break;case"C":if(!b.length){let L=g.length?g[g.length-1]:k;b.push([L[0],L[1]])}b.push([w[0],w[1]]),b.push([w[2],w[3]]),b.push([w[4],w[5]]);break;case"Z":M(),g.push([k[0],k[1]])}if(m(),!p)return f;let P=[];for(let x of f){let w=qt(x,p);w.length&&P.push(w)}return P})(t,1,h?4-4*(e.simplification||1):(1+e.roughness)/2),l=wt(t,e);if(o)if(e.fillStyle==="solid")if(i.length===1){let c=wt(t,Object.assign(Object.assign({},e),{disableMultiStroke:!0,roughness:e.roughness?e.roughness+e.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(c.ops)})}else n.push(st(i,e));else n.push(G(i,e));return r&&(h?i.forEach((c=>{n.push(N(c,!1,e))})):n.push(l)),this._d("path",n,e)}opsToPath(t,s){let e="";for(let n of t.ops){let o=typeof s=="number"&&s>=0?n.data.map((r=>+r.toFixed(s))):n.data;switch(n.op){case"move":e+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":e+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":e+=`L${o[0]} ${o[1]} `}}return e.trim()}toPaths(t){let s=t.sets||[],e=t.options||this.defaultOptions,n=[];for(let o of s){let r=null;switch(o.type){case"path":r={d:this.opsToPath(o),stroke:e.stroke,strokeWidth:e.strokeWidth,fill:O};break;case"fillPath":r={d:this.opsToPath(o),stroke:O,strokeWidth:0,fill:e.fill||O};break;case"fillSketch":r=this.fillSketch(o,e)}r&&n.push(r)}return n}fillSketch(t,s){let e=s.fillWeight;return e<0&&(e=s.strokeWidth/2),{d:this.opsToPath(t),stroke:s.fill||O,strokeWidth:e,fill:O}}_mergedShape(t){return t.filter(((s,e)=>e===0||s.op!=="move"))}},ft=class{constructor(t,s){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new $(s)}draw(t){let s=t.sets||[],e=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(let r of s)switch(r.type){case"path":n.save(),n.strokeStyle=e.stroke==="none"?"transparent":e.stroke,n.lineWidth=e.strokeWidth,e.strokeLineDash&&n.setLineDash(e.strokeLineDash),e.strokeLineDashOffset&&(n.lineDashOffset=e.strokeLineDashOffset),this._drawToContext(n,r,o),n.restore();break;case"fillPath":{n.save(),n.fillStyle=e.fill||"";let h=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,r,o,h),n.restore();break}case"fillSketch":this.fillSketch(n,r,e)}}fillSketch(t,s,e){let n=e.fillWeight;n<0&&(n=e.strokeWidth/2),t.save(),e.fillLineDash&&t.setLineDash(e.fillLineDash),e.fillLineDashOffset&&(t.lineDashOffset=e.fillLineDashOffset),t.strokeStyle=e.fill||"",t.lineWidth=n,this._drawToContext(t,s,e.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,s,e,n="nonzero"){t.beginPath();for(let o of s.ops){let r=typeof e=="number"&&e>=0?o.data.map((h=>+h.toFixed(e))):o.data;switch(o.op){case"move":t.moveTo(r[0],r[1]);break;case"bcurveTo":t.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case"lineTo":t.lineTo(r[0],r[1])}}s.type==="fillPath"?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,s,e,n,o){let r=this.gen.line(t,s,e,n,o);return this.draw(r),r}rectangle(t,s,e,n,o){let r=this.gen.rectangle(t,s,e,n,o);return this.draw(r),r}ellipse(t,s,e,n,o){let r=this.gen.ellipse(t,s,e,n,o);return this.draw(r),r}circle(t,s,e,n){let o=this.gen.circle(t,s,e,n);return this.draw(o),o}linearPath(t,s){let e=this.gen.linearPath(t,s);return this.draw(e),e}polygon(t,s){let e=this.gen.polygon(t,s);return this.draw(e),e}arc(t,s,e,n,o,r,h=!1,i){let l=this.gen.arc(t,s,e,n,o,r,h,i);return this.draw(l),l}curve(t,s){let e=this.gen.curve(t,s);return this.draw(e),e}path(t,s){let e=this.gen.path(t,s);return this.draw(e),e}},H="http://www.w3.org/2000/svg",dt=class{constructor(t,s){this.svg=t,this.gen=new $(s)}draw(t){let s=t.sets||[],e=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(H,"g"),r=t.options.fixedDecimalPlaceDigits;for(let h of s){let i=null;switch(h.type){case"path":i=n.createElementNS(H,"path"),i.setAttribute("d",this.opsToPath(h,r)),i.setAttribute("stroke",e.stroke),i.setAttribute("stroke-width",e.strokeWidth+""),i.setAttribute("fill","none"),e.strokeLineDash&&i.setAttribute("stroke-dasharray",e.strokeLineDash.join(" ").trim()),e.strokeLineDashOffset&&i.setAttribute("stroke-dashoffset",`${e.strokeLineDashOffset}`);break;case"fillPath":i=n.createElementNS(H,"path"),i.setAttribute("d",this.opsToPath(h,r)),i.setAttribute("stroke","none"),i.setAttribute("stroke-width","0"),i.setAttribute("fill",e.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||i.setAttribute("fill-rule","evenodd");break;case"fillSketch":i=this.fillSketch(n,h,e)}i&&o.appendChild(i)}return o}fillSketch(t,s,e){let n=e.fillWeight;n<0&&(n=e.strokeWidth/2);let o=t.createElementNS(H,"path");return o.setAttribute("d",this.opsToPath(s,e.fixedDecimalPlaceDigits)),o.setAttribute("stroke",e.fill||""),o.setAttribute("stroke-width",n+""),o.setAttribute("fill","none"),e.fillLineDash&&o.setAttribute("stroke-dasharray",e.fillLineDash.join(" ").trim()),e.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${e.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,s){return this.gen.opsToPath(t,s)}line(t,s,e,n,o){let r=this.gen.line(t,s,e,n,o);return this.draw(r)}rectangle(t,s,e,n,o){let r=this.gen.rectangle(t,s,e,n,o);return this.draw(r)}ellipse(t,s,e,n,o){let r=this.gen.ellipse(t,s,e,n,o);return this.draw(r)}circle(t,s,e,n){let o=this.gen.circle(t,s,e,n);return this.draw(o)}linearPath(t,s){let e=this.gen.linearPath(t,s);return this.draw(e)}polygon(t,s){let e=this.gen.polygon(t,s);return this.draw(e)}arc(t,s,e,n,o,r,h=!1,i){let l=this.gen.arc(t,s,e,n,o,r,h,i);return this.draw(l)}curve(t,s){let e=this.gen.curve(t,s);return this.draw(e)}path(t,s){let e=this.gen.path(t,s);return this.draw(e)}},Ft={canvas:(a,t)=>new ft(a,t),svg:(a,t)=>new dt(a,t),generator:a=>new $(a),newSeed:()=>$.newSeed()};export{Ft as a};
@@ -0,0 +1 @@
1
+ import{C as G,I as M}from"./chunk-IVZHB6RS.js";import{b as d}from"./chunk-QQIGL7OP.js";import{a as u}from"./chunk-RJFVWYCA.js";var B=Object.freeze({left:0,top:0,width:16,height:16}),g=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),v=Object.freeze({...B,...g}),$=Object.freeze({...v,body:"",hidden:!1});var K=Object.freeze({width:null,height:null}),z=Object.freeze({...K,...g});var E=(t,o,n,r="")=>{let e=t.split(":");if(t.slice(0,1)==="@"){if(e.length<2||e.length>3)return null;r=e.shift().slice(1)}if(e.length>3||!e.length)return null;if(e.length>1){let c=e.pop(),l=e.pop(),m={provider:e.length>0?e[0]:r,prefix:l,name:c};return o&&!w(m)?null:m}let s=e[0],i=s.split("-");if(i.length>1){let c={provider:r,prefix:i.shift(),name:i.join("-")};return o&&!w(c)?null:c}if(n&&r===""){let c={provider:r,prefix:"",name:s};return o&&!w(c,n)?null:c}return null},w=(t,o)=>t?!!((o&&t.prefix===""||t.prefix)&&t.name):!1;function A(t,o){let n={};!t.hFlip!=!o.hFlip&&(n.hFlip=!0),!t.vFlip!=!o.vFlip&&(n.vFlip=!0);let r=((t.rotate||0)+(o.rotate||0))%4;return r&&(n.rotate=r),n}function b(t,o){let n=A(t,o);for(let r in $)r in g?r in t&&!(r in n)&&(n[r]=g[r]):r in o?n[r]=o[r]:r in t&&(n[r]=t[r]);return n}function R(t,o){let n=t.icons,r=t.aliases||Object.create(null),e=Object.create(null);function s(i){if(n[i])return e[i]=[];if(!(i in e)){e[i]=null;let c=r[i]&&r[i].parent,l=c&&s(c);l&&(e[i]=[c].concat(l))}return e[i]}return(o||Object.keys(n).concat(Object.keys(r))).forEach(s),e}function U(t,o,n){let r=t.icons,e=t.aliases||Object.create(null),s={};function i(c){s=b(r[c]||e[c],s)}return i(o),n.forEach(i),b(t,s)}function j(t,o){if(t.icons[o])return U(t,o,[]);let n=R(t,[o])[o];return n?U(t,o,n):null}var W=/(-?[0-9.]*[0-9]+[0-9.]*)/g,_=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function D(t,o,n){if(o===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*o*n)/n;if(typeof t!="string")return t;let r=t.split(W);if(r===null||!r.length)return t;let e=[],s=r.shift(),i=_.test(s);for(;;){if(i){let c=parseFloat(s);isNaN(c)?e.push(s):e.push(Math.ceil(c*o*n)/n)}else e.push(s);if(s=r.shift(),s===void 0)return e.join("");i=!i}}function Q(t,o="defs"){let n="",r=t.indexOf("<"+o);for(;r>=0;){let e=t.indexOf(">",r),s=t.indexOf("</"+o);if(e===-1||s===-1)break;let i=t.indexOf(">",s);if(i===-1)break;n+=t.slice(e+1,s).trim(),t=t.slice(0,r).trim()+t.slice(i+1)}return{defs:n,content:t}}function J(t,o){return t?"<defs>"+t+"</defs>"+o:o}function q(t,o,n){let r=Q(t);return J(r.defs,o+r.content+n)}var X=t=>t==="unset"||t==="undefined"||t==="none";function F(t,o){let n={...v,...t},r={...z,...o},e={left:n.left,top:n.top,width:n.width,height:n.height},s=n.body;[n,r].forEach(h=>{let a=[],N=h.hFlip,P=h.vFlip,p=h.rotate;N?P?p+=2:(a.push("translate("+(e.width+e.left).toString()+" "+(0-e.top).toString()+")"),a.push("scale(-1 1)"),e.top=e.left=0):P&&(a.push("translate("+(0-e.left).toString()+" "+(e.height+e.top).toString()+")"),a.push("scale(1 -1)"),e.top=e.left=0);let f;switch(p<0&&(p-=Math.floor(p/4)*4),p=p%4,p){case 1:f=e.height/2+e.top,a.unshift("rotate(90 "+f.toString()+" "+f.toString()+")");break;case 2:a.unshift("rotate(180 "+(e.width/2+e.left).toString()+" "+(e.height/2+e.top).toString()+")");break;case 3:f=e.width/2+e.left,a.unshift("rotate(-90 "+f.toString()+" "+f.toString()+")")}p%2===1&&(e.left!==e.top&&(f=e.left,e.left=e.top,e.top=f),e.width!==e.height&&(f=e.width,e.width=e.height,e.height=f)),a.length&&(s=q(s,'<g transform="'+a.join(" ")+'">',"</g>"))});let i=r.width,c=r.height,l=e.width,m=e.height,I,S;i===null?(S=c===null?"1em":c==="auto"?m:c,I=D(S,l/m)):(I=i==="auto"?l:i,S=c===null?D(I,m/l):c==="auto"?m:c);let T={},k=(h,a)=>{X(a)||(T[h]=a.toString())};k("width",I),k("height",S);let V=[e.left,e.top,l,m];return T.viewBox=V.join(" "),{attributes:T,viewBox:V,body:s}}var Y=/\sid="(\S+)"/g,L=new Map;function Z(t){t=t.replace(/[0-9]+$/,"")||"a";let o=L.get(t)||0;return L.set(t,o+1),o?`${t}${o}`:t}function C(t){let o=[],n;for(;n=Y.exec(t);)o.push(n[1]);if(!o.length)return t;let r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return o.forEach(e=>{let s=Z(e),i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+s+r+"$3")}),t=t.replace(new RegExp(r,"g"),""),t}function y(t,o){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let r in o)n+=" "+r+'="'+o[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}var tt={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},x=new Map,O=new Map,Gt=u(t=>{for(let o of t){if(!o.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(d.debug("Registering icon pack:",o.name),"loader"in o)O.set(o.name,o.loader);else if("icons"in o)x.set(o.name,o.icons);else throw d.error("Invalid icon loader:",o),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Mt=u(t=>x.has(t)||O.has(t),"isIconPackRegistered"),H=u(async(t,o)=>{let n=E(t,!0,o!==void 0);if(!n)throw new Error(`Invalid icon name: ${t}`);let r=n.prefix||o;if(!r)throw new Error(`Icon name must contain a prefix: ${t}`);let e=x.get(r);if(!e){let i=O.get(r);if(!i)throw new Error(`Icon set not found: ${n.prefix}`);try{e={...await i(),prefix:r},x.set(r,e)}catch(c){throw d.error(c),new Error(`Failed to load icon set: ${n.prefix}`)}}let s=j(e,n.name);if(!s)throw new Error(`Icon not found: ${t}`);return s},"getRegisteredIconData"),$t=u(async t=>{try{return await H(t),!0}catch{return!1}},"isIconAvailable"),zt=u(async(t,o,n)=>{let r;try{r=await H(t,o?.fallbackPrefix)}catch(i){d.error(i),r=tt}let e=F(r,o),s=y(C(e.body),{...e.attributes,...n});return M(s,G())},"getIconSVG");export{tt as a,Gt as b,Mt as c,$t as d,zt as e};
@@ -0,0 +1 @@
1
+ import{a as t,b as s,c as d,d as o,e as l,g as u,p as c,w as f,y as m}from"./chunk-LT6LXKCR.js";var v=class extends m{static{t(this,"RailroadAbnfTokenBuilder")}constructor(){super(["railroad-abnf-beta"])}},b=class extends f{static{t(this,"RailroadAbnfValueConverter")}runConverter(r,e,a){let i=super.runConverter(r,e,a);if(r.name==="TITLE"&&typeof i=="string"){let n=i.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1)}return i}runCustomConverter(r,e,a){if(r.name==="ABNF_STRING")return e.slice(1,-1)}},A={parser:{TokenBuilder:t(()=>new v,"TokenBuilder"),ValueConverter:t(()=>new b,"ValueConverter")}};function C(r=l){let e=o(d(r),u),a=o(s({shared:e}),c,A);return e.ServiceRegistry.register(a),{shared:e,RailroadAbnf:a}}t(C,"createRailroadAbnfServices");export{A as a,C as b};
@@ -0,0 +1 @@
1
+ import{$ as s}from"./chunk-IVZHB6RS.js";import{d as e}from"./chunk-QQIGL7OP.js";import{a as n}from"./chunk-RJFVWYCA.js";var a=n(t=>{let{securityLevel:c}=s(),o=e("body");if(c==="sandbox"){let m=e(`#i${t}`).node()?.contentDocument??document;o=e(m.body)}return o.select(`#${t}`)},"selectSvgElement");export{a};
@@ -0,0 +1 @@
1
+ import{P as w}from"./chunk-IVZHB6RS.js";import{b as c}from"./chunk-QQIGL7OP.js";import{a as r}from"./chunk-RJFVWYCA.js";var l=r((t,e,i,h)=>{t.attr("class",i);let{width:o,height:n,x,y:u}=m(t,e);w(t,n,o,h);let a=s(x,u,o,n,e);t.attr("viewBox",a),c.debug(`viewBox configured: ${a} with padding: ${e}`)},"setupViewPortForSVG"),m=r((t,e)=>{let i=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+e*2,height:i.height+e*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),s=r((t,e,i,h,o)=>`${t-o} ${e-o} ${i} ${h}`,"createViewBox");export{l as a};
@@ -0,0 +1 @@
1
+ import{a as x}from"./chunk-ICJPOOXG.js";import{H as d}from"./chunk-IVZHB6RS.js";import{d as o}from"./chunk-QQIGL7OP.js";import{a as i}from"./chunk-RJFVWYCA.js";import{b as p}from"./chunk-SQE76S5B.js";var l=p(x(),1);var c=i((r,t)=>{let e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(let s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),f=i((r,t)=>{let e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};c(r,e).lower()},"drawBackgroundRect"),h=i((r,t)=>{let e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);let a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),w=i((r,t,e,s)=>{let a=r.append("image");a.attr("x",t),a.attr("y",e);let n=(0,l.sanitizeUrl)(s);a.attr("xlink:href",n)},"drawImage"),k=i((r,t,e,s)=>{let a=r.append("use");a.attr("x",t),a.attr("y",e);let n=(0,l.sanitizeUrl)(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),v=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),E=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),R=i(()=>{let r=o(".mermaidTooltip");return r.empty()&&(r=o("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{c as a,f as b,h as c,w as d,k as e,v as f,E as g,R as h};
@@ -0,0 +1,10 @@
1
+ import{a as Wt}from"./chunk-NDAMZVXQ.js";import{f as Z}from"./chunk-BOXAA5AP.js";import{a as $t}from"./chunk-4QDE4SUK.js";import{c as yt,d as gt}from"./chunk-DIDARDST.js";import{c as pt,e as Ut}from"./chunk-7LSMJ4VU.js";import{q as U,u as At}from"./chunk-QLS7NIYR.js";import{c as at,d as xt,f as bt,g as wt,h as dt,l as Mt,o as vt,s as St,t as Lt,u as _t,v as Et,w as Ot,x as Tt}from"./chunk-ICJPOOXG.js";import{$ as A,C as B,G as ct,b as ut}from"./chunk-IVZHB6RS.js";import{b as w,d as T}from"./chunk-QQIGL7OP.js";import{a as l}from"./chunk-RJFVWYCA.js";var j=l((r,t)=>{if(t)return"translate("+-r.width/2+", "+-r.height/2+")";let a=r.x??0,e=r.y??0;return"translate("+-(a+r.width/2)+", "+-(e+r.height/2)+")"},"computeLabelTransform"),v={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Ht={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5,arrow_open_head:4,arrow_hollow_circle:8};function J(r,t){if(r===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};r=x(r),t=x(t);let[a,e]=[r.x,r.y],[s,n]=[t.x,t.y],o=s-a,i=n-e;return{angle:Math.atan(i/o),deltaX:o,deltaY:i}}l(J,"calculateDeltaAndAngle");var x=l(r=>Array.isArray(r)?{x:r[0],y:r[1]}:r,"pointTransformer"),fr=l(r=>({x:l(function(t,a,e){let s=0,n=x(e[0]).x<x(e[e.length-1]).x?"left":"right";if(a===0&&Object.hasOwn(v,r.arrowTypeStart)){let{angle:p,deltaX:u}=J(e[0],e[1]);s=v[r.arrowTypeStart]*Math.cos(p)*(u>=0?1:-1)}else if(a===e.length-1&&Object.hasOwn(v,r.arrowTypeEnd)){let{angle:p,deltaX:u}=J(e[e.length-1],e[e.length-2]);s=v[r.arrowTypeEnd]*Math.cos(p)*(u>=0?1:-1)}let o=Math.abs(x(t).x-x(e[e.length-1]).x),i=Math.abs(x(t).y-x(e[e.length-1]).y),c=Math.abs(x(t).x-x(e[0]).x),h=Math.abs(x(t).y-x(e[0]).y),f=v[r.arrowTypeStart],m=v[r.arrowTypeEnd],d=1;if(o<m&&o>0&&i<m){let p=m+d-o;p*=n==="right"?-1:1,s-=p}if(c<f&&c>0&&h<f){let p=f+d-c;p*=n==="right"?-1:1,s+=p}return x(t).x+s},"x"),y:l(function(t,a,e){let s=0,n=x(e[0]).y<x(e[e.length-1]).y?"down":"up";if(a===0&&Object.hasOwn(v,r.arrowTypeStart)){let{angle:p,deltaY:u}=J(e[0],e[1]);s=v[r.arrowTypeStart]*Math.abs(Math.sin(p))*(u>=0?1:-1)}else if(a===e.length-1&&Object.hasOwn(v,r.arrowTypeEnd)){let{angle:p,deltaY:u}=J(e[e.length-1],e[e.length-2]);s=v[r.arrowTypeEnd]*Math.abs(Math.sin(p))*(u>=0?1:-1)}let o=Math.abs(x(t).y-x(e[e.length-1]).y),i=Math.abs(x(t).x-x(e[e.length-1]).x),c=Math.abs(x(t).y-x(e[0]).y),h=Math.abs(x(t).x-x(e[0]).x),f=v[r.arrowTypeStart],m=v[r.arrowTypeEnd],d=1;if(o<m&&o>0&&i<m){let p=m+d-o;p*=n==="up"?-1:1,s-=p}if(c<f&&c>0&&h<f){let p=f+d-c;p*=n==="up"?-1:1,s+=p}return x(t).y+s},"y")}),"getLineFunctionsWithOffset"),Qt=1,mr=l(r=>typeof r=="number"&&Number.isFinite(r)&&r>0?r:Qt,"getStepDuration"),mt=l(r=>typeof r.step=="number"&&Number.isInteger(r.step)&&r.step>0,"isStepEdge"),Yt=[.25,.35,.15,.65,.75,.5,.85,.1,.9],ht=9,kr=11,ur=2,yr="#333333",Xt=12,Pt=6,Bt=14,Ct=.01,gr=4.5,Gt=/translate\(\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i,xr=4,br=.6,wr=4,Mr=l((r,t,a=Qt)=>{let e=Math.max(t,r);return{begin:(r-1)*a,dur:a,gap:(e-1)*a}},"getEdgeStepTiming"),vr=l(r=>`step_${Array.from(r,t=>/[\dA-Za-z]/.test(t)?t:`_${(t.codePointAt(0)??0).toString(16)}_`).join("")}`,"toAnimationId"),Sr=l(r=>{let t=/^m\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i.exec(r.trim());return t?`translate(${t[1]},${t[2]}) `:""},"pathStartTranslate"),Lr=l(r=>Array.from(r,(t,a)=>{let e=t.codePointAt(0)??0;if(e===0)return"\uFFFD";let s=e<=31||e===127,n=/\d/.test(t)&&(a===0||a===1&&r.startsWith("-"));return s||n?`\\${e.toString(16)} `:r==="-"?"\\-":e>=128||/[\w-]/.test(t)?t:`\\${t}`}).join(""),"escapeCssIdentifierFallback"),_r=l(r=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(r):Lr(r),"escapeCssIdentifier"),Er=l((r,t)=>{let a=r.node(),e=a?.ownerSVGElement??a?.closest?.("svg")??a,s=t||e?.getAttribute("id");if(!e||!s||e.querySelector("style.edge-step-style"))return;let n=`#${_r(s)} `,o=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","style");o.setAttribute("class","edge-step-style"),o.textContent=`@media (prefers-reduced-motion: reduce) { ${n}.edge-step-dot, ${n}.edge-step-highlight { display: none; } }`,e.appendChild(o)},"ensureReducedMotionStyle"),Or=l((r,t)=>{let a=r.filter(n=>Number.isFinite(n.x)&&Number.isFinite(n.y));if(a.length===0)return;let e=a.slice(1).map((n,o)=>Math.hypot(n.x-a[o].x,n.y-a[o].y)),s=e.reduce((n,o)=>n+o,0)*t;for(let[n,o]of e.entries()){if(s<=o&&o>0){let i=s/o,c=a[n],h=a[n+1];return{x:c.x+(h.x-c.x)*i,y:c.y+(h.y-c.y)*i}}s-=o}return a[a.length-1]},"pointAlongPolyline"),Tr=l((r,t)=>{let a=typeof t?.getTotalLength=="function"?t.getTotalLength():0,e=t?.getPointAtLength?.bind(t);return a>0&&e?s=>{let{x:n,y:o}=e(a*s);return{x:n,y:o}}:s=>Or(r,s)},"createPathSampler"),Ar=l((r,t)=>Math.min(Number.POSITIVE_INFINITY,...t.map(a=>{let e=Math.max(Math.abs(r.x-a.x)-a.halfWidth,0),s=Math.max(Math.abs(r.y-a.y)-a.halfHeight,0);return Math.hypot(e,s)-ht})),"roomAround"),Ur=l((r,t)=>{let a=r(t),e=r(Math.max(t-Ct,0)),s=r(Math.min(t+Ct,1));if(!a||!e||!s)return[];let n=Math.hypot(s.x-e.x,s.y-e.y);if(n===0)return[];let o={x:-(s.y-e.y)/n,y:(s.x-e.x)/n};return[1,-1].map(i=>({x:a.x+o.x*Bt*i,y:a.y+o.y*Bt*i}))},"besideThePath"),$r=l((r,t)=>{let a=[...Yt.map(r),...Yt.flatMap(n=>Ur(r,n))],e,s=Number.NEGATIVE_INFINITY;for(let n of a){if(!n||!Number.isFinite(n.x)||!Number.isFinite(n.y))continue;let o=Ar(n,t);if(o>=ur)return n;o>s&&(e=n,s=o)}return e},"chooseBadgePosition"),Zt=l((r,t)=>({...r,halfWidth:t,halfHeight:t}),"square"),Wr=l(r=>{let t=Gt.exec(r.getAttribute("transform")??"");return t?{x:Number(t[1]),y:Number(t[2])}:{x:0,y:0}},"translationOf"),kt=l(r=>{let t={x:0,y:0};for(let a=r;a&&a.localName!=="svg";a=a.parentElement){let{x:e,y:s}=Wr(a);t.x+=e,t.y+=s}return t},"offsetInSvg"),Hr=l((r,t)=>{if(!Gt.test(r.getAttribute("transform")??""))return;let a=kt(r),e=a.x-t.x,s=a.y-t.y,n=r.getBBox?.();if(n)return{x:e+n.x+n.width/2,y:s+n.y+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2}},"boxedObstacle"),Yr=l(r=>{try{let t=JSON.parse(atob(r.getAttribute("data-points")??""));return Array.isArray(t)?t:[]}catch{return[]}},"readPoints"),Nt=l((r,t)=>{let a=Math.hypot(r.x-t.x,r.y-t.y);if(a===0)return Zt(r,Xt);let e={x:(r.x-t.x)/a,y:(r.y-t.y)/a},s=Xt/2;return{x:r.x-e.x*s,y:r.y-e.y*s,halfWidth:Math.abs(e.x)*s+Math.abs(e.y)*Pt,halfHeight:Math.abs(e.y)*s+Math.abs(e.x)*Pt}},"arrowheadObstacle"),Rt=l((r,t)=>{let a=r.getAttribute(t);return!!a&&a!=="none"},"hasMarker"),Xr=l((r,t)=>{let a=Yr(r).filter(i=>Number.isFinite(i?.x)&&Number.isFinite(i?.y));if(a.length===0)return[];let e=kt(r),s=l(i=>({x:i.x+e.x-t.x,y:i.y+e.y-t.y}),"toSvg"),n=a.length-1,o=[];return Rt(r,"marker-start")&&o.push(Nt(s(a[0]),s(a[Math.min(1,n)]))),Rt(r,"marker-end")&&o.push(Nt(s(a[n]),s(a[Math.max(n-1,0)]))),o},"arrowheadObstacles"),jt=l(r=>{let t={x:0,y:0},a=[...r?.querySelectorAll(".edgeLabel, .node")??[]].map(s=>Hr(s,t)).filter(s=>s!==void 0),e=[...r?.querySelectorAll('path[data-edge="true"]')??[]].flatMap(s=>Xr(s,t));return[...a,...e]},"collectBadgeObstacles"),Pr=l((r,t)=>{if(!r.label||t.length===0)return[];let{x:a,y:e}=U.calcLabelPosition(t);return[{x:a,y:e,halfWidth:(r.width??0)/2,halfHeight:(r.height??0)/2}]},"edgeLabelObstacles"),Br=l(r=>{let t=r/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},"linearChannel"),zt=l(r=>{try{let[t,a,e]=["r","g","b"].map(s=>Br(ut(r,s)));return .2126*t+.7152*a+.0722*e}catch{return}},"relativeLuminance"),Cr=l((r,t)=>{let a=zt(r),e=zt(t);return a===void 0||e===void 0?0:(Math.max(a,e)+.05)/(Math.min(a,e)+.05)},"contrastRatio"),Nr=l((r,t)=>{let e=[...t.filter(n=>!!n),"#ffffff","#000000"].map(n=>({color:n,ratio:Cr(r,n)}));return(e.find(({ratio:n})=>n>=gr)??e.reduce((n,o)=>o.ratio>n.ratio?o:n)).color},"pickBadgeTextColor"),Rr=l(r=>{let t=r?.replace(/^stroke:\s*/,"").trim();return t===""?void 0:t},"bareColor"),zr=l((r,t,a,e=jt(r.node()?.closest("svg")))=>{if(!mt(t)||!t.showStepNumber)return;let s=kt(r.node()),n=e.map(h=>({...h,x:h.x-s.x,y:h.y-s.y})),o=$r(Tr(a.points,a.pathNode),[...n,...Pr(t,a.points)]);if(!o)return;let i=Rr(a.color)??yr,c=r.append("g").attr("class","edge-step-badge").attr("transform",`translate(${o.x},${o.y})`).attr("pointer-events","none").attr("data-step",t.step);return c.append("circle").attr("r",ht).attr("fill",i),c.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",kr).attr("fill",Nr(i,a.textColors??[])).text(String(t.step)),Zt({x:o.x+s.x,y:o.y+s.y},ht)},"insertEdgeStepBadge"),Dt=l((r,t,a)=>{r.append("animateTransform").attr("attributeName","transform").attr("type","scale").attr("values","1;1").attr("dur",`${a}s`).attr("begin",`${t}.begin`).attr("fill","remove")},"showWhileStepPlays"),Dr=l((r,t,a,e,s)=>{if(!mt(t)||!a)return;let{begin:n,dur:o,gap:i}=Mr(t.step,t.stepCount??t.step,mr(t.stepDuration)),c=vr(`${e}-${t.id}-step`),h=`${Sr(a)}scale(0)`,f=s?.replace(/^stroke:\s*/,""),m=r.append("path").attr("class","edge-step-highlight").attr("aria-hidden","true").attr("d",a).attr("fill","none").attr("stroke",f??"currentColor").attr("stroke-width",xr).attr("stroke-linecap","round").attr("stroke-opacity",br).attr("pointer-events","none").attr("transform",h).attr("data-step",t.step);Dt(m,c,o);let d=r.append("circle").attr("class","edge-step-dot").attr("r",wr).attr("aria-hidden","true").attr("transform",h).attr("data-step",t.step);f&&d.attr("fill",f).attr("stroke","none"),d.append("animateMotion").attr("id",c).attr("path",a).attr("dur",`${o}s`).attr("begin",`${n}s;${c}.end+${i}s`).attr("fill","remove"),Dt(d,c,o),Er(r,e)},"insertEdgeStepDot"),et=new WeakMap,qr=l(r=>{let t=r.querySelector(":scope > g.edge-step-badges");if(t)return t;let a=r.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");return a.setAttribute("class","edge-step-badges"),r.appendChild(a)},"badgeLayer"),Na=l(r=>{let t=r?et.get(r):void 0;if(!r||!t)return;et.delete(r);let a=jt(r);for(let{elem:e,edge:s,options:n}of t){let o=e.node()?.parentElement;if(!o)continue;let i=T(qr(o)),c=zr(i,s,n,a);c&&a.push(c)}},"placeQueuedStepBadges"),Ir=l((r,t,a,e,s)=>{Dr(r,t,a,e,s.color);let n=r.node(),o=n?.ownerSVGElement??n;!o||!mt(t)||!t.showStepNumber||et.set(o,[...et.get(o)??[],{elem:r,edge:t,options:s}])},"insertEdgeStepMarks"),Fr=l((r,t,a,e,s,n=!1,o)=>{t.arrowTypeStart&&qt(r,"start",t.arrowTypeStart,a,e,s,n,o),t.arrowTypeEnd&&qt(r,"end",t.arrowTypeEnd,a,e,s,n,o)},"addEdgeMarkers"),Qr={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},arrow_open_head:{type:"openArrow",fill:!1},arrow_hollow_circle:{type:"hollowCircle",fill:!1},arrow_hierarchy:{type:"hierarchy",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},Gr=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],qt=l((r,t,a,e,s,n,o=!1,i)=>{if(!a||a==="none")return;let c=Qr[a],h=c&&Gr.includes(c.type);if(!c){w.warn(`Unknown arrow type: ${a}`);return}let f=c.type,p=`${s}_${n}-${f}${t==="start"?"Start":"End"}${o&&h?"-margin":""}`;if(i&&i.trim()!==""){let u=i.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${u}`;if(!document.getElementById(y)){let k=document.getElementById(p);if(k){let _=k.cloneNode(!0);_.id=y,_.querySelectorAll("path, circle, line").forEach(H=>{H.setAttribute("stroke",i),c.fill&&H.setAttribute("fill",i)}),k.parentNode?.appendChild(_)}}r.attr(`marker-${t}`,`url(${e}#${y})`)}else r.attr(`marker-${t}`,`url(${e}#${p})`)},"addEdgeMarker"),Zr=l(r=>typeof r=="string"?r:A()?.flowchart?.curve,"resolveEdgeCurveType"),nt=new Map,L=new Map,Da=l(()=>{nt.clear(),L.clear()},"clear"),qa=l(r=>!!(r.label||r.startLabelLeft||r.startLabelRight||r.endLabelLeft||r.endLabelRight),"hasEdgeLabel"),V=l(r=>r?typeof r=="string"?r:r.reduce((t,a)=>t+";"+a,""):"","getLabelStyles"),Ia=l(async(r,t)=>{let a=A(),e=ct(a),{labelStyles:s}=gt(t);t.labelStyle=s;let n=r.insert("g").attr("class","edgeLabel"),o=n.insert("g").attr("class","label").attr("data-id",t.id),i=t.labelType==="markdown",h=await Ut(r,t.label,{style:V(t.labelStyle),useHtmlLabels:e,addSvgBackground:!0,isNode:!1,markdown:i,width:i?void 0:void 0},a);o.node().appendChild(h),w.info("abc82",t,t.labelType);let f,m;if(e){let p=h.children[0],u=T(h);f=await pt.measure(()=>p.getBoundingClientRect()),m=f,u.attr("width",f.width),u.attr("height",f.height)}else{let p=T(h).select("text").node();await pt.measure(()=>{f=h.getBBox(),p&&typeof p.getBBox=="function"?m=p.getBBox():m=f})}o.attr("transform",j(m,e)),nt.set(t.id,n),t.width=f.width,t.height=f.height;let d;if(t.startLabelLeft){let p=r.insert("g").attr("class","edgeTerminals"),u=p.insert("g").attr("class","inner"),y=await Z(u,t.startLabelLeft,V(t.labelStyle)||"",!1,!1);d=y;let k=y.getBBox();if(e){let _=y.children[0],b=T(y);k=_.getBoundingClientRect(),b.attr("width",k.width),b.attr("height",k.height)}u.attr("transform",j(k,e)),L.get(t.id)||L.set(t.id,{}),L.get(t.id).startLeft=p,tt(d,t.startLabelLeft,k),K(t,"startLeft",k)}if(t.startLabelRight){let p=r.insert("g").attr("class","edgeTerminals"),u=p.insert("g").attr("class","inner"),y=await Z(u,t.startLabelRight,V(t.labelStyle)||"",!1,!1);d=y;let k=y.getBBox();if(e){let _=y.children[0],b=T(y);k=_.getBoundingClientRect(),b.attr("width",k.width),b.attr("height",k.height)}u.attr("transform",j(k,e)),L.get(t.id)||L.set(t.id,{}),L.get(t.id).startRight=p,tt(d,t.startLabelRight,k),K(t,"startRight",k)}if(t.endLabelLeft){let p=r.insert("g").attr("class","edgeTerminals"),u=p.insert("g").attr("class","inner"),y=await Z(u,t.endLabelLeft,V(t.labelStyle)||"",!1,!1);d=y;let k=y.getBBox();if(e){let _=y.children[0],b=T(y);k=_.getBoundingClientRect(),b.attr("width",k.width),b.attr("height",k.height)}u.attr("transform",j(k,e)),L.get(t.id)||L.set(t.id,{}),L.get(t.id).endLeft=p,tt(d,t.endLabelLeft,k),K(t,"endLeft",k)}if(t.endLabelRight){let p=r.insert("g").attr("class","edgeTerminals"),u=p.insert("g").attr("class","inner"),y=await Z(u,t.endLabelRight,V(t.labelStyle)||"",!1,!1);d=y;let k=y.getBBox();if(e){let _=y.children[0],b=T(y);k=_.getBoundingClientRect(),b.attr("width",k.width),b.attr("height",k.height)}u.attr("transform",j(k,e)),L.get(t.id)||L.set(t.id,{}),L.get(t.id).endRight=p,tt(d,t.endLabelRight,k),K(t,"endRight",k)}return h},"insertEdgeLabel");function K(r,t,a){r.terminalLabelSizes??={},r.terminalLabelSizes[t]={width:a.width,height:a.height}}l(K,"recordTerminalLabelSize");function tt(r,t,a){ct(A())&&r&&(r.style.width=Math.max(t.length*9,a.width)+"px",r.style.height=a.height+"px")}l(tt,"setTerminalWidth");var jr=l((r,t)=>{let a=r.x,e=r.y;if(t?.updatedPath){let s=U.calcLabelPosition(t.updatedPath);if(t.originalPath){let n=U.calcLabelPosition(t.originalPath);a=r.x+(s.x-n.x),e=r.y+(s.y-n.y)}else a=s.x,e=s.y}return{x:a,y:e}},"resolveEdgeLabelPosition"),Fa=l((r,t)=>{w.debug("Moving label abc88 ",r.id,r.label,nt.get(r.id),t);let a=A(),{subGraphTitleTotalMargin:e}=Wt(a);if(r.label){let n=nt.get(r.id),{x:o,y:i}=jr(r,t);w.debug("Moving label "+r.label+" from (",r.x,",",r.y,") to (",o,",",i,") abc88"),n.attr("transform",`translate(${o}, ${i+e/2})`)}let s=t.updatedPath?t.updatedPath:t.originalPath;if(r.startLabelLeft){let n=L.get(r.id).startLeft,o=r.x,i=r.y;if(s){let c=U.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_left",s);o=c.x,i=c.y}n.attr("transform",`translate(${o}, ${i})`)}if(r.startLabelRight){let n=L.get(r.id).startRight,o=r.x,i=r.y;if(s){let c=U.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_right",s);o=c.x,i=c.y}n.attr("transform",`translate(${o}, ${i})`)}if(r.endLabelLeft){let n=L.get(r.id).endLeft,o=r.x,i=r.y;if(s){let c=U.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_left",s);o=c.x,i=c.y}n.attr("transform",`translate(${o}, ${i})`)}if(r.endLabelRight){let n=L.get(r.id).endRight,o=r.x,i=r.y;if(s){let c=U.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_right",s);o=c.x,i=c.y}n.attr("transform",`translate(${o}, ${i})`)}},"positionEdgeLabel"),q=.5,$=l((r,t)=>Math.abs(r.x-t.x)<q,"sharesColumn"),W=l((r,t)=>Math.abs(r.y-t.y)<q,"sharesRow"),Vt=l((r,t)=>$(r,t)&&W(r,t),"coincides");function Jt(r,t,a){return $(r,t)&&!W(r,t)?$(a,t):W(r,t)&&!$(r,t)?W(a,t):$(a,t)||W(a,t)}l(Jt,"keepsArrivalAxis");function Kt(r,t,a){return Vt(r,t)?{heading:t,from:a}:{heading:r,from:t}}l(Kt,"arrivalSegment");function tr({heading:r,from:t},a,e){return(r.x-t.x)*(e.x-a.x)+(r.y-t.y)*(e.y-a.y)<0}l(tr,"runsAgainstHeading");function rr({heading:r,from:t},a,e){return W(r,t)&&!$(r,t)?{x:e.x,y:a.y}:$(r,t)&&!W(r,t)?{x:a.x,y:e.y}:e}l(rr,"snapToArrivalAxis");function ar(r,t,a,e){if(($(r,t)||W(r,t))&&!Jt(r,t,e))return r;let n=Kt(r,t,a);return tr(n,t,e)?t:rr(n,t,e)}l(ar,"dockFinalPoint");function er(r){let t=Object.hasOwn(v,r)?v[r]:0;return Number.isFinite(t)?t:0}l(er,"markerPullBack");function nr({originalLast:r,lastInner:t,newLast:a,minLength:e}){let s=!Vt(r,t),n=Math.hypot(a.x-t.x,a.y-t.y);return n>=Math.max(q,e)?a:s&&n>=q?r:void 0}l(nr,"finalDockPoint");var Vr=l((r,t)=>{if(!r?.isLabelEdge||!r?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;let[a,e]=t,s=Math.abs(e.x-a.x),n=Math.abs(e.y-a.y);return s<.001||n<.001?t:n>=s?[a,{x:a.x,y:e.y},e]:[a,{x:e.x,y:a.y},e]},"orthogonalizeToLabelClippedPoints"),Jr=l((r,t)=>{let a=r.x,e=r.y,s=Math.abs(t.x-a),n=Math.abs(t.y-e),o=r.width/2,i=r.height/2;return s>=o||n>=i},"outsideNode"),Kr=l((r,t,a)=>{w.debug(`intersection calc abc89:
2
+ outsidePoint: ${JSON.stringify(t)}
3
+ insidePoint : ${JSON.stringify(a)}
4
+ node : x:${r.x} y:${r.y} w:${r.width} h:${r.height}`);let e=r.x,s=r.y,n=Math.abs(e-a.x),o=r.width/2,i=a.x<t.x?o-n:o+n,c=r.height/2,h=Math.abs(t.y-a.y),f=Math.abs(t.x-a.x);if(Math.abs(s-t.y)*o>Math.abs(e-t.x)*c){let m=a.y<t.y?t.y-c-s:s-c-t.y;i=f*m/h;let d={x:a.x<t.x?a.x+i:a.x-f+i,y:a.y<t.y?a.y+h-m:a.y-h+m};return i===0&&(d.x=t.x,d.y=t.y),f===0&&(d.x=t.x),h===0&&(d.y=t.y),w.debug(`abc89 top/bottom calc, Q ${h}, q ${m}, R ${f}, r ${i}`,d),d}else{a.x<t.x?i=t.x-o-e:i=e-o-t.x;let m=h*i/f,d=a.x<t.x?a.x+f-i:a.x-f+i,p=a.y<t.y?a.y+m:a.y-m;return w.debug(`sides calc abc89, Q ${h}, q ${m}, R ${f}, r ${i}`,{_x:d,_y:p}),i===0&&(d=t.x,p=t.y),f===0&&(d=t.x),h===0&&(p=t.y),{x:d,y:p}}},"intersection"),It=l((r,t)=>{w.warn("abc88 cutPathAtIntersect",r,t);let a=[],e=r[0],s=!1;return r.forEach(n=>{if(w.info("abc88 checking point",n,t),!Jr(t,n)&&!s){let o=Kr(t,e,n);w.debug("abc88 inside",n,e,o),w.debug("abc88 intersection",o,t);let i=!1;a.forEach(c=>{i=i||c.x===o.x&&c.y===o.y}),a.some(c=>c.x===o.x&&c.y===o.y)?w.warn("abc88 no intersect",o,a):a.push(o),s=!0}else w.warn("abc88 outside",n,e),e=n,s||a.push(n)}),w.debug("returning points",a),a},"cutPathAtIntersect");function sr(r){let t=[],a=[];for(let e=1;e<r.length-1;e++){let s=r[e-1],n=r[e],o=r[e+1];(s.x===n.x&&n.y===o.y&&Math.abs(n.x-o.x)>5&&Math.abs(n.y-s.y)>5||s.y===n.y&&n.x===o.x&&Math.abs(n.x-s.x)>5&&Math.abs(n.y-o.y)>5)&&(t.push(n),a.push(e))}return{cornerPoints:t,cornerPointPositions:a}}l(sr,"extractCornerPoints");var Ft=l(function(r,t,a){let e=t.x-r.x,s=t.y-r.y,n=Math.sqrt(e*e+s*s),o=a/n;return{x:t.x-o*e,y:t.y-o*s}},"findAdjacentPoint"),ta=l(function(r){let{cornerPointPositions:t}=sr(r),a=[];for(let e=0;e<r.length;e++)if(t.includes(e)){let s=r[e-1],n=r[e+1],o=r[e],i=Ft(s,o,5),c=Ft(n,o,5),h=c.x-i.x,f=c.y-i.y;a.push(i);let m=Math.sqrt(2)*2,d={x:o.x,y:o.y};if(Math.abs(n.x-s.x)>10&&Math.abs(n.y-s.y)>=10){w.debug("Corner point fixing",Math.abs(n.x-s.x),Math.abs(n.y-s.y));let p=5;o.x===i.x?d={x:h<0?i.x-p+m:i.x+p-m,y:f<0?i.y-m:i.y+m}:d={x:h<0?i.x-m:i.x+m,y:f<0?i.y-p+m:i.y+p-m}}else w.debug("Corner point skipping fixing",Math.abs(n.x-s.x),Math.abs(n.y-s.y));a.push(d,c)}else a.push(r[e]);return a},"fixCorners"),ra=l((r,t,a)=>{let e=r-t-a,s=2,n=2,o=s+n,i=Math.floor(e/o),c=Number.isFinite(i)?Math.max(0,i):0,h=Array(c).fill(`${s} ${n}`).join(" ");return`0 ${t} ${h} ${a}`},"generateDashArray"),Qa=l(function(r,t,a,e,s,n,o,i=!1,c=void 0){if(!o)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:h,layout:f}=A(),m=c??f,d=t.points,p=!1,u=s;var y=n;let k=[];for(let g in t.cssCompiledStyles)yt(g)||k.push(t.cssCompiledStyles[g]);if(m==="swimlane"){if(!i&&y.intersect&&u.intersect&&Array.isArray(d)&&d.length>=2)if(d.length===2){let[g,E]=d;d=$(g,E)||W(g,E)?[u.intersect(g),y.intersect(E)]:[u.intersect(E),y.intersect(g)]}else{let g=d.slice(1,-1),E=g[0],Y=g[g.length-1],X=u.intersect(E),N=d[d.length-1],Q=y.intersect(Y),G=g.at(-2)??d[0],D=ar(N,Y,G,Q),P=nr({originalLast:N,lastInner:Y,newLast:D,minLength:er(t.arrowTypeEnd)}),pr=Math.abs(X.x-E.x)<q&&Math.abs(X.y-E.y)<q?[]:[X],hr=P?[P]:[];d=[...pr,...g,...hr]}d=Vr(t,d)}else y.intersect&&u.intersect&&!i&&(d=d.slice(1,t.points.length-1),d.unshift(u.intersect(d[0])),d.push(y.intersect(d[d.length-1])));let _=btoa(JSON.stringify(d));t.toCluster&&(w.info("to cluster abc88",a.get(t.toCluster)),d=It(t.points,a.get(t.toCluster).node),p=!0),t.fromCluster&&(w.debug("from cluster abc88",a.get(t.fromCluster),JSON.stringify(d,null,2)),d=It(d.reverse(),a.get(t.fromCluster).node).reverse(),p=!0);let b=d.filter(g=>!Number.isNaN(g.y)),H=Zr(t.curve);H!=="rounded"&&(b=ta(b));let S=at;switch(H){case"linear":S=at;break;case"basis":S=dt;break;case"cardinal":S=Mt;break;case"bumpX":S=bt;break;case"bumpY":S=wt;break;case"catmullRom":S=vt;break;case"monotoneX":S=St;break;case"monotoneY":S=Lt;break;case"natural":S=_t;break;case"step":S=Et;break;case"stepAfter":S=Tt;break;case"stepBefore":S=Ot;break;case"rounded":S=at;break;default:S=dt}let{x:I,y:R}=fr(t),st=xt().x(I).y(R).curve(S),O;switch(t.thickness){case"normal":O="edge-thickness-normal";break;case"thick":O="edge-thickness-thick";break;case"invisible":O="edge-thickness-invisible";break;default:O="edge-thickness-normal"}switch(t.pattern){case"solid":O+=" edge-pattern-solid";break;case"dotted":O+=" edge-pattern-dotted";break;case"dashed":O+=" edge-pattern-dashed";break;default:O+=" edge-pattern-solid"}let M,F=H==="rounded"?or(ir(b,t),5):st(b),C=Array.isArray(t.style)?t.style:[t.style],ot=C.find(g=>g?.startsWith("stroke:")),z="";t.animate&&(z="edge-animation-fast"),t.animation&&(z="edge-animation-"+t.animation);let it=!1;if(t.look==="handDrawn"){let g=$t.svg(r);Object.assign([],b);let E=g.path(F,{roughness:.3,seed:h});O+=" transition",M=T(E).select("path").attr("id",`${o}-${t.id}`).attr("class"," "+O+(t.classes?" "+t.classes:"")+(z?" "+z:"")).attr("style",C?C.reduce((X,N)=>X+";"+N,""):"");let Y=M.attr("d");M.attr("d",Y),r.node().appendChild(M.node())}else{let g=k.join(";"),E=C?C.reduce((D,P)=>D+P+";",""):"",Y=(g?g+";"+E+";":E)+";"+(C?C.reduce((D,P)=>D+";"+P,""):"");M=r.append("path").attr("d",F).attr("id",`${o}-${t.id}`).attr("class"," "+O+(t.classes?" "+t.classes:"")+(z?" "+z:"")).attr("style",Y),ot=Y.match(/stroke:([^;]+)/)?.[1],it=t.animate===!0||!!t.animation||g.includes("animation");let X=M.node(),N=typeof X.getTotalLength=="function"?X.getTotalLength():0,Q=Ht[t.arrowTypeStart]||0,G=Ht[t.arrowTypeEnd]||0;if(t.look==="neo"&&!it){let P=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?ra(N,Q,G):`0 ${Q} ${N-Q-G} ${G}`}; stroke-dashoffset: 0;`;M.attr("style",P+M.attr("style"))}}if(M.attr("data-edge",!0),M.attr("data-et","edge"),M.attr("data-id",t.id),M.attr("data-points",_),M.attr("data-look",At(t.look)),t.step!==void 0){let{themeVariables:g}=A(),E=ot??g?.lineColor;Ir(r,t,F,o,{points:b,pathNode:M.node(),color:E,textColors:[g?.background,g?.primaryTextColor]})}t.showPoints&&b.forEach(g=>{r.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",g.x).attr("cy",g.y)});let rt="";(A().flowchart.arrowMarkerAbsolute||A().state.arrowMarkerAbsolute)&&(rt=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,rt=rt.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),w.info("arrowTypeStart",t.arrowTypeStart),w.info("arrowTypeEnd",t.arrowTypeEnd);let lr=!it&&t?.look==="neo";Fr(M,t,rt,o,e,lr,ot);let cr=Math.floor(d.length/2),dr=d[cr];U.isLabelCoordinateInPath(dr,M.attr("d"))||(p=!0);let lt={};return p&&(lt.updatedPath=d),lt.originalPath=t.points,lt},"insertEdge");function or(r,t){if(r.length<2)return"";let a="",e=r.length,s=1e-5;for(let n=0;n<e;n++){let o=r[n],i=r[n-1],c=r[n+1];if(n===0)a+=`M${o.x},${o.y}`;else if(n===e-1)a+=`L${o.x},${o.y}`;else{let h=o.x-i.x,f=o.y-i.y,m=c.x-o.x,d=c.y-o.y,p=Math.hypot(h,f),u=Math.hypot(m,d);if(p<s||u<s){a+=`L${o.x},${o.y}`;continue}let y=h/p,k=f/p,_=m/u,b=d/u,H=y*_+k*b,S=Math.max(-1,Math.min(1,H)),I=Math.acos(S);if(I<s||Math.abs(Math.PI-I)<s){a+=`L${o.x},${o.y}`;continue}let R=Math.min(t/Math.sin(I/2),p/2,u/2),st=o.x-y*R,O=o.y-k*R,M=o.x+_*R,F=o.y+b*R;a+=`L${st},${O}`,a+=`Q${o.x},${o.y} ${M},${F}`}}return a}l(or,"generateRoundedPath");function ft(r,t){if(!r||!t)return{angle:0,deltaX:0,deltaY:0};let a=t.x-r.x,e=t.y-r.y;return{angle:Math.atan2(e,a),deltaX:a,deltaY:e}}l(ft,"calculateDeltaAndAngle");function ir(r,t){let a=r.map(s=>({...s}));if(r.length>=2&&v[t.arrowTypeStart]){let s=v[t.arrowTypeStart],n=r[0],o=r[1],{angle:i}=ft(n,o),c=s*Math.cos(i),h=s*Math.sin(i);a[0].x=n.x+c,a[0].y=n.y+h}let e=r.length;if(e>=2&&v[t.arrowTypeEnd]){let s=v[t.arrowTypeEnd],n=r[e-1],o=r[e-2],{angle:i}=ft(o,n),c=s*Math.cos(i),h=s*Math.sin(i);a[e-1].x=n.x-c,a[e-1].y=n.y-h}return a}l(ir,"applyMarkerOffsetsToPoints");var aa=l((r,t,a,e)=>{t.forEach(s=>{Oa[s](r,a,e)})},"insertMarkers"),ea=l((r,t,a)=>{w.trace("Making markers for ",a),r.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),r.append("marker").attr("id",a+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),r.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),na=l((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),sa=l((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),oa=l((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),ia=l((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),la=l((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),ca=l((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),da=l((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),r.append("marker").attr("id",a+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),pa=l((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),ha=l((r,t,a)=>{let e=B(),{themeVariables:s}=e,{transitionColor:n}=s;r.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${n}`)},"barbNeo"),fa=l((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),ma=l((r,t,a)=>{let e=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");e.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),e.append("path").attr("d","M9,0 L9,18");let s=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),ka=l((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),ua=l((r,t,a)=>{let e=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");e.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),e.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");let s=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),ya=l((r,t,a)=>{let e=B(),{themeVariables:s}=e,{strokeWidth:n}=s;r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${n}`),r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${n}`)},"only_one_neo"),ga=l((r,t,a)=>{let e=B(),{themeVariables:s}=e,{strokeWidth:n,mainBkg:o}=s,i=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");i.append("circle").attr("fill",o??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${n}`).attr("r",6),i.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${n}`);let c=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");c.append("circle").attr("fill",o??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${n}`).attr("r",6),c.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${n}`)},"zero_or_one_neo"),xa=l((r,t,a)=>{let e=B(),{themeVariables:s}=e,{strokeWidth:n}=s;r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${n}`),r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${n}`)},"one_or_more_neo"),ba=l((r,t,a)=>{let e=B(),{themeVariables:s}=e,{strokeWidth:n,mainBkg:o}=s,i=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");i.append("circle").attr("fill",o??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${n}`),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${n}`);let c=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");c.append("circle").attr("fill",o??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${n}`),c.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${n}`)},"zero_or_more_neo"),wa=l((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
5
+ L20,10
6
+ M20,10
7
+ L0,20`)},"requirement_arrow"),Ma=l((r,t,a)=>{let e=B(),{themeVariables:s}=e,{strokeWidth:n}=s;r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${n}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
8
+ L20,10
9
+ M20,10
10
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),va=l((r,t,a)=>{let e=r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");e.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),e.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),e.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Sa=l((r,t,a)=>{let e=B(),{themeVariables:s}=e,{strokeWidth:n}=s,o=r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${n}`)},"requirement_contains_neo"),La=l((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),r.append("marker").attr("id",a+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),_a=l((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-openArrowEnd").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",11).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1 1 L 11 6 L 1 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none"),r.append("marker").attr("id",a+"_"+t+"-openArrowStart").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",1).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 11 1 L 1 6 L 11 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none")},"openArrow"),Ea=l((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-hollowCircleStart").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none"),r.append("marker").attr("id",a+"_"+t+"-hollowCircleEnd").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none")},"hollowCircle"),Oa={extension:ea,composition:na,aggregation:sa,dependency:oa,lollipop:ia,point:la,circle:ca,cross:da,barb:pa,barbNeo:ha,hierarchy:La,only_one:fa,zero_or_one:ma,one_or_more:ka,zero_or_more:ua,only_one_neo:ya,zero_or_one_neo:ga,one_or_more_neo:xa,zero_or_more_neo:ba,requirement_arrow:wa,requirement_contains:va,requirement_arrow_neo:Ma,requirement_contains_neo:Sa,openArrow:_a,hollowCircle:Ea},Ga=aa;export{v as a,mr as b,mt as c,Na as d,nt as e,L as f,Da as g,qa as h,Ia as i,jr as j,Fa as k,Qa as l,Ga as m};
@@ -0,0 +1,72 @@
1
+ import{d as be,e as we}from"./chunk-5N2X2DXU.js";import{s as U}from"./chunk-QLS7NIYR.js";import{C as ke,I as G,L as Q,N as xe,O as me}from"./chunk-IVZHB6RS.js";import{b as N,d as R}from"./chunk-QQIGL7OP.js";import{a as g}from"./chunk-RJFVWYCA.js";function Y(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var S=Y();function ze(t){S=t}var P={exec:()=>null};function k(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(b.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var et=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},tt=/^(?:[ \t]*(?:\n|$))+/,rt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,nt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,I=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,st=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,J=/(?:[*+-]|\d{1,9}[.)])/,Ae=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Le=k(Ae).replace(/bull/g,J).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),it=k(Ae).replace(/bull/g,J).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,at=/^[^\n]+/,te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lt=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ot=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,J).getRegex(),O="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ct=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",re).replace("tag",O).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e=k(ee).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex(),pt=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",_e).getRegex(),ne={blockquote:pt,code:rt,def:lt,fences:nt,heading:st,hr:I,html:ct,lheading:Le,list:ot,newline:tt,paragraph:_e,table:P,text:at},ye=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex(),ht={...ne,lheading:it,table:ye,paragraph:k(ee).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ye).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex()},ut={...ne,html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(ee).replace("hr",I).replace("heading",` *#{1,6} *[^
2
+ ]`).replace("lheading",Le).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ft=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ee=/^( {2,}|\\)\n(?!\s*$)/,dt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,se=/[\s\p{P}\p{S}]/u,Pe=/[^\s\p{P}\p{S}]/u,kt=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,se).getRegex(),Ie=/(?!~)[\p{P}\p{S}]/u,xt=/(?!~)[\s\p{P}\p{S}]/u,mt=/(?:[^\s\p{P}\p{S}]|~)/u,bt=k(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",et?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Be=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,wt=k(Be,"u").replace(/punct/g,F).getRegex(),yt=k(Be,"u").replace(/punct/g,Ie).getRegex(),Ce="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Tt=k(Ce,"gu").replace(/notPunctSpace/g,Pe).replace(/punctSpace/g,se).replace(/punct/g,F).getRegex(),$t=k(Ce,"gu").replace(/notPunctSpace/g,mt).replace(/punctSpace/g,xt).replace(/punct/g,Ie).getRegex(),St=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Pe).replace(/punctSpace/g,se).replace(/punct/g,F).getRegex(),Rt=k(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),vt=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),zt=k(re).replace("(?:-->|$)","-->").getRegex(),At=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",zt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),C=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Lt=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",C).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Me=k(/^!?\[(label)\]\[(ref)\]/).replace("label",C).replace("ref",te).getRegex(),qe=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",te).getRegex(),_t=k("reflink|nolink(?!\\()","g").replace("reflink",Me).replace("nolink",qe).getRegex(),Te=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ie={_backpedal:P,anyPunctuation:Rt,autolink:vt,blockSkip:bt,br:Ee,code:ft,del:P,emStrongLDelim:wt,emStrongRDelimAst:Tt,emStrongRDelimUnd:St,escape:gt,link:Lt,nolink:qe,punctuation:kt,reflink:Me,reflinkSearch:_t,tag:At,text:dt,url:P},Et={...ie,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",C).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",C).getRegex()},K={...ie,emStrongRDelimAst:$t,emStrongLDelim:yt,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Te).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Te).getRegex()},Pt={...K,br:k(Ee).replace("{2,}","*").getRegex(),text:k(K.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},B={normal:ne,gfm:ht,pedantic:ut},L={normal:ie,gfm:K,breaks:Pt,pedantic:Et},It={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$e=t=>It[t];function T(t,e){if(e){if(b.escapeTest.test(t))return t.replace(b.escapeReplace,$e)}else if(b.escapeTestNoEncode.test(t))return t.replace(b.escapeReplaceNoEncode,$e);return t}function Se(t){try{t=encodeURI(t).replace(b.percentDecode,"%")}catch{return null}return t}function Re(t,e){let n=t.replace(b.findPipe,(a,i,o)=>{let l=!1,c=i;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),s=n.split(b.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(b.slashPipe,"|");return s}function _(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s;){let a=t.charAt(s-r-1);if(a===e&&!n)r++;else if(a!==e&&n)r++;else break}return t.slice(0,s-r)}function Bt(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function ve(t,e,n,s,r){let a=e.href,i=e.title||null,o=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:i,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,l}function Ct(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
3
+ `).map(a=>{let i=a.match(n.other.beginningSpace);if(i===null)return a;let[o]=i;return o.length>=r.length?a.slice(r.length):a}).join(`
4
+ `)}var M=class{options;rules;lexer;constructor(t){this.options=t||S}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:_(n,`
5
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=Ct(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=_(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:_(e[0],`
6
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=_(e[0],`
7
+ `).split(`
8
+ `),s="",r="",a=[];for(;n.length>0;){let i=!1,o=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),i=!0;else if(!i)o.push(n[l]);else break;n=n.slice(l);let c=o.join(`
9
+ `),p=c.replace(this.rules.other.blockquoteSetextReplace,`
10
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
11
+ ${c}`:c,r=r?`${r}
12
+ ${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=h,n.length===0)break;let u=a.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let d=u,f=d.raw+`
13
+ `+n.join(`
14
+ `),m=this.blockquote(f);a[a.length-1]=m,s=s.substring(0,s.length-d.raw.length)+m.raw,r=r.substring(0,r.length-d.text.length)+m.text;break}else if(u?.type==="list"){let d=u,f=d.raw+`
15
+ `+n.join(`
16
+ `),m=this.list(f);a[a.length-1]=m,s=s.substring(0,s.length-u.raw.length)+m.raw,r=r.substring(0,r.length-d.raw.length)+m.raw,n=f.substring(a.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:s,tokens:a,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let a=this.rules.other.listItemRegex(n),i=!1;for(;t;){let l=!1,c="",p="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let h=e[2].split(`
18
+ `,1)[0].replace(this.rules.other.listReplaceTabs,D=>" ".repeat(3*D.length)),u=t.split(`
19
+ `,1)[0],d=!h.trim(),f=0;if(this.options.pedantic?(f=2,p=h.trimStart()):d?f=e[1].length+1:(f=e[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,p=h.slice(f),f+=e[1].length),d&&this.rules.other.blankLine.test(u)&&(c+=u+`
20
+ `,t=t.substring(u.length+1),l=!0),!l){let D=this.rules.other.nextBulletRegex(f),ge=this.rules.other.hrRegex(f),fe=this.rules.other.fencesBeginRegex(f),de=this.rules.other.headingBeginRegex(f),Je=this.rules.other.htmlBeginRegex(f);for(;t;){let H=t.split(`
21
+ `,1)[0],A;if(u=H,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),A=u):A=u.replace(this.rules.other.tabCharGlobal," "),fe.test(u)||de.test(u)||Je.test(u)||D.test(u)||ge.test(u))break;if(A.search(this.rules.other.nonSpaceChar)>=f||!u.trim())p+=`
22
+ `+A.slice(f);else{if(d||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||fe.test(h)||de.test(h)||ge.test(h))break;p+=`
23
+ `+u}!d&&!u.trim()&&(d=!0),c+=H+`
24
+ `,t=t.substring(H.length+1),h=A.slice(f)}}r.loose||(i?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let m=null,z;this.options.gfm&&(m=this.rules.other.listIsTask.exec(p),m&&(z=m[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:c,task:!!m,checked:z,loose:!1,text:p,tokens:[]}),r.raw+=c}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l=0;l<r.items.length;l++)if(this.lexer.state.top=!1,r.items[l].tokens=this.lexer.blockTokens(r.items[l].text,[]),!r.loose){let c=r.items[l].tokens.filter(h=>h.type==="space"),p=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));r.loose=p}if(r.loose)for(let l=0;l<r.items.length;l++)r.items[l].loose=!0;return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Re(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
+ `):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?a.align.push("right"):this.rules.other.tableAlignCenter.test(i)?a.align.push("center"):this.rules.other.tableAlignLeft.test(i)?a.align.push("left"):a.align.push(null);for(let i=0;i<n.length;i++)a.header.push({text:n[i],tokens:this.lexer.inline(n[i]),header:!0,align:a.align[i]});for(let i of r)a.rows.push(Re(i,a.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:a.align[l]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
26
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=_(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Bt(e[2],"()");if(a===-2)return;if(a>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),ve(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return ve(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,a,i,o=r,l=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+r);(s=c.exec(e))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(i=[...a].length,s[3]||s[4]){o+=i;continue}else if((s[5]||s[6])&&r%3&&!((r+i)%3)){l+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+l);let p=[...s[0]][0].length,h=t.slice(0,r+s.index+p+i);if(Math.min(r,i)%2){let d=h.slice(1,-1);return{type:"em",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}let u=h.slice(2,-2);return{type:"strong",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},w=class X{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||S,this.options.tokenizer=this.options.tokenizer||new M,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:b,block:B.normal,inline:L.normal};this.options.pedantic?(n.block=B.pedantic,n.inline=L.pedantic):this.options.gfm&&(n.block=B.gfm,this.options.breaks?n.inline=L.breaks:n.inline=L.gfm),this.tokenizer.rules=n}static get rules(){return{block:B,inline:L}}static lex(e,n){return new X(n).lex(e)}static lexInline(e,n){return new X(n).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
27
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(i=>(r=i.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let i=n.at(-1);r.raw.length===1&&i!==void 0?i.raw+=`
28
+ `:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let i=n.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
29
+ `)?"":`
30
+ `)+r.raw,i.text+=`
31
+ `+r.text,this.inlineQueue.at(-1).src=i.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let i=n.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
32
+ `)?"":`
33
+ `)+r.raw,i.text+=`
34
+ `+r.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let i=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},o),typeof l=="number"&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(a=e.substring(0,i+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let i=n.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
35
+ `)?"":`
36
+ `)+r.raw,i.text+=`
37
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(r),s=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let i=n.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
38
+ `)?"":`
39
+ `)+r.raw,i.text+=`
40
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(r);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)a=r[2]?r[2].length:0,s=s.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,o="";for(;e;){i||(o=""),i=!1;let l;if(this.options.extensions?.inline?.some(p=>(l=p.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let p=n.at(-1);l.type==="text"&&p?.type==="text"?(p.raw+=l.raw,p.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,s,o)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let c=e;if(this.options.extensions?.startInline){let p=1/0,h=e.slice(1),u;this.options.extensions.startInline.forEach(d=>{u=d.call({lexer:this},h),typeof u=="number"&&u>=0&&(p=Math.min(p,u))}),p<1/0&&p>=0&&(c=e.substring(0,p+1))}if(l=this.tokenizer.inlineText(c)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),i=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=l.raw,p.text+=l.text):n.push(l);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},q=class{options;parser;constructor(t){this.options=t||S}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(b.notSpaceStart)?.[0],r=t.replace(b.endingNewline,"")+`
41
+ `;return s?'<pre><code class="language-'+T(s)+'">'+(n?r:T(r,!0))+`</code></pre>
42
+ `:"<pre><code>"+(n?r:T(r,!0))+`</code></pre>
43
+ `}blockquote({tokens:t}){return`<blockquote>
44
+ ${this.parser.parse(t)}</blockquote>
45
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
46
+ `}hr(t){return`<hr>
47
+ `}list(t){let e=t.ordered,n=t.start,s="";for(let i=0;i<t.items.length;i++){let o=t.items[i];s+=this.listitem(o)}let r=e?"ol":"ul",a=e&&n!==1?' start="'+n+'"':"";return"<"+r+a+`>
48
+ `+s+"</"+r+`>
49
+ `}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+T(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
50
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
51
+ `}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let s="";for(let r=0;r<t.rows.length;r++){let a=t.rows[r];n="";for(let i=0;i<a.length;i++)n+=this.tablecell(a[i]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
52
+ <thead>
53
+ `+e+`</thead>
54
+ `+s+`</table>
55
+ `}tablerow({text:t}){return`<tr>
56
+ ${t}</tr>
57
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
58
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${T(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),r=Se(t);if(r===null)return s;t=r;let a='<a href="'+t+'"';return e&&(a+=' title="'+T(e)+'"'),a+=">"+s+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Se(t);if(r===null)return T(n);t=r;let a=`<img src="${t}" alt="${n}"`;return e&&(a+=` title="${T(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:T(t.text)}},ae=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},y=class V{options;renderer;textRenderer;constructor(e){this.options=e||S,this.options.renderer=this.options.renderer||new q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ae}static parse(e,n){return new V(n).parse(e)}static parseInline(e,n){return new V(n).parseInline(e)}parse(e,n=!0){let s="";for(let r=0;r<e.length;r++){let a=e[r];if(this.options.extensions?.renderers?.[a.type]){let o=a,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){s+=l||"";continue}}let i=a;switch(i.type){case"space":{s+=this.renderer.space(i);continue}case"hr":{s+=this.renderer.hr(i);continue}case"heading":{s+=this.renderer.heading(i);continue}case"code":{s+=this.renderer.code(i);continue}case"table":{s+=this.renderer.table(i);continue}case"blockquote":{s+=this.renderer.blockquote(i);continue}case"list":{s+=this.renderer.list(i);continue}case"html":{s+=this.renderer.html(i);continue}case"def":{s+=this.renderer.def(i);continue}case"paragraph":{s+=this.renderer.paragraph(i);continue}case"text":{let o=i,l=this.renderer.text(o);for(;r+1<e.length&&e[r+1].type==="text";)o=e[++r],l+=`
59
+ `+this.renderer.text(o);n?s+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):s+=l;continue}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(e,n=this.renderer){let s="";for(let r=0;r<e.length;r++){let a=e[r];if(this.options.extensions?.renderers?.[a.type]){let o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=o||"";continue}}let i=a;switch(i.type){case"escape":{s+=n.text(i);break}case"html":{s+=n.html(i);break}case"link":{s+=n.link(i);break}case"image":{s+=n.image(i);break}case"strong":{s+=n.strong(i);break}case"em":{s+=n.em(i);break}case"codespan":{s+=n.codespan(i);break}case"br":{s+=n.br(i);break}case"del":{s+=n.del(i);break}case"text":{s+=n.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},E=class{options;block;constructor(t){this.options=t||S}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?w.lex:w.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},Mt=class{defaults=Y();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=q;TextRenderer=ae;Lexer=w;Tokenizer=M;Hooks=E;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let a of r.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of r.rows)for(let i of a)n=n.concat(this.walkTokens(i.tokens,e));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let i=r[a].flat(1/0);n=n.concat(this.walkTokens(i,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=e.renderers[r.name];a?e.renderers[r.name]=function(...i){let o=r.renderer.apply(this,i);return o===!1&&(o=a.apply(this,i)),o}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[r.level];a?a.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new q(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,o=n.renderer[i],l=r[i];r[i]=(...c)=>{let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new M(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,o=n.tokenizer[i],l=r[i];r[i]=(...c)=>{let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new E;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,o=n.hooks[i],l=r[i];E.passThroughHooks.has(a)?r[i]=c=>{if(this.defaults.async&&E.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await o.call(r,c);return l.call(r,h)})();let p=o.call(r,c);return l.call(r,p)}:r[i]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await o.apply(r,c);return h===!1&&(h=await l.apply(r,c)),h})();let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(i){let o=[];return o.push(a.call(this,i)),r&&(o=o.concat(r.call(this,i))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return w.lex(t,e??this.defaults)}parser(t,e){return y.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let i=r.hooks?await r.hooks.preprocess(e):e,o=await(r.hooks?await r.hooks.provideLexer():t?w.lex:w.lexInline)(i,r),l=r.hooks?await r.hooks.processAllTokens(o):o;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser():t?y.parse:y.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(a);try{r.hooks&&(e=r.hooks.preprocess(e));let i=(r.hooks?r.hooks.provideLexer():t?w.lex:w.lexInline)(e,r);r.hooks&&(i=r.hooks.processAllTokens(i)),r.walkTokens&&this.walkTokens(i,r.walkTokens);let o=(r.hooks?r.hooks.provideParser():t?y.parse:y.parseInline)(i,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(i){return a(i)}}}onError(t,e){return n=>{if(n.message+=`
60
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+T(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},$=new Mt;function x(t,e){return $.parse(t,e)}x.options=x.setOptions=function(t){return $.setOptions(t),x.defaults=$.defaults,ze(x.defaults),x};x.getDefaults=Y;x.defaults=S;x.use=function(...t){return $.use(...t),x.defaults=$.defaults,ze(x.defaults),x};x.walkTokens=function(t,e){return $.walkTokens(t,e)};x.parseInline=$.parseInline;x.Parser=y;x.parser=y.parse;x.Renderer=q;x.TextRenderer=ae;x.Lexer=w;x.lexer=w.lex;x.Tokenizer=M;x.Hooks=E;x.parse=x;var Nt=x.options,Gt=x.setOptions,Qt=x.use,Ut=x.walkTokens,Kt=x.parseInline;var Xt=y.parse,Vt=w.lex;function Oe(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var s=Array.from(typeof t=="string"?[t]:t);s[s.length-1]=s[s.length-1].replace(/\r?\n([\t ]*)$/,"");var r=s.reduce(function(o,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?o.concat(c.map(function(p){var h,u;return(u=(h=p.match(/[\t ]/g))===null||h===void 0?void 0:h.length)!==null&&u!==void 0?u:0})):o},[]);if(r.length){var a=new RegExp(`
61
+ [ ]{`.concat(Math.min.apply(Math,r),"}"),"g");s=s.map(function(o){return o.replace(a,`
62
+ `)})}s[0]=s[0].replace(/^\r?\n/,"");var i=s[0];return e.forEach(function(o,l){var c=i.match(/(?:^|\n)( *)$/),p=c?c[1]:"",h=o;typeof o=="string"&&o.includes(`
63
+ `)&&(h=String(o).split(`
64
+ `).map(function(u,d){return d===0?u:"".concat(p).concat(u)}).join(`
65
+ `)),i+=h+s[l+1]}),i}var oe=typeof performance<"u"&&typeof performance.now=="function",v=g(()=>oe?performance.now():0,"now"),le="\u{1F9DC} ",qt="Mermaid render",Ot="Mermaid",Ft={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},pr=class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}static{g(this,"Profiler")}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(t){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(t))}tickSync(t,e){if(!this.enabled)return e();let n=v();try{return e()}finally{this.buckets[t]=(this.buckets[t]??0)+(v()-n)}}async tick(t,e){if(!this.enabled)return e();let n=v();try{return await e()}finally{this.buckets[t]=(this.buckets[t]??0)+(v()-n)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();let t=this.roots.at(-1),e=this.runLabel??t?.name;return t&&(this.records.push({label:e??t.name,tree:t,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(t,e)),this.runLabel=void 0,t}begin(t){if(!this.enabled)return;let e={name:t,start:v(),duration:-1,children:[]},n=this.stack.at(-1);if(n?n.children.push(e):this.roots.push(e),this.stack.push(e),oe&&typeof performance.mark=="function")try{performance.mark(`${le}${t} \u25B6`)}catch{}}end(){if(!this.enabled)return;let t=this.stack.pop();if(!t)return;let e=v();if(t.duration=e-t.start,oe&&typeof performance.measure=="function")try{performance.measure(`${le}${t.name}`,{start:t.start,end:e,detail:{devtools:{dataType:"track-entry",track:qt,trackGroup:Ot,color:Ft[t.name]??"primary",tooltipText:`${t.name} \u2014 ${t.duration.toFixed(1)} ms`}}})}catch{}}async span(t,e){if(!this.enabled)return e();this.begin(t);try{return await e()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(t=this.report(),e){if(!t)return;let n=t.duration,s=e&&e!==t.name?`${t.name} [${e}]`:t.name,r=["ms % phase"],a=g((o,l)=>{let c=" ".repeat(l),p=o.duration.toFixed(1).padStart(8),h=n>0?`${(o.duration/n*100).toFixed(0).padStart(3)}%`:" -";r.push(`${p} ${h} ${c}${o.name}`);for(let u of o.children)a(u,l+1);if(o.children.length>0){let u=o.children.reduce((f,m)=>f+m.duration,0),d=o.duration-u;if(d>.5){let f=d.toFixed(1).padStart(8);r.push(`${f} ${c} (self)`)}}},"walk");a(t,0);let i=Object.keys(this.buckets);if(i.length>0){r.push("\u2014\u2014 buckets (summed) \u2014\u2014");for(let o of i)r.push(`${this.buckets[o].toFixed(1).padStart(8)} ${o}`)}console.log(`${le}mermaid render profile \xB7 ${s}
66
+ ${r.join(`
67
+ `)}`)}};globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};function je(t,{markdownAutoWrap:e}){let s=t.replace(/<br\/>/g,`
68
+ `).replace(/\n{2,}/g,`
69
+ `);return Oe(s)}g(je,"preprocessMarkdown");function We(t){return t.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(n=>({content:n,type:"normal"}))??[])}g(We,"nonMarkdownToLines");function Ze(t,e={}){let n=je(t,e),s=x.lexer(n),r=[[]],a=0;function i(o,l="normal"){o.type==="text"?o.text.split(`
70
+ `).forEach((p,h)=>{h!==0&&(a++,r.push([])),p.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&r[a].push({content:u,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(c=>{i(c,o.type)}):o.type==="html"&&r[a].push({content:o.text,type:"normal"})}return g(i,"processNode"),s.forEach(o=>{o.type==="paragraph"?o.tokens?.forEach(l=>{i(l)}):o.type==="html"?r[a].push({content:o.text,type:"normal"}):r[a].push({content:o.raw,type:"normal"})}),r}g(Ze,"markdownToLines");function De(t){return t?`<p>${t.replace(/\\n|\n/g,"<br />")}</p>`:""}g(De,"nonMarkdownToHTML");function He(t,{markdownAutoWrap:e}={}){let n=x.lexer(t);function s(r){return r.type==="text"?e===!1?r.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):r.text.replace(/\n */g,"<br/>"):r.type==="strong"?`<strong>${r.tokens?.map(s).join("")}</strong>`:r.type==="em"?`<em>${r.tokens?.map(s).join("")}</em>`:r.type==="paragraph"?`<p>${r.tokens?.map(s).join("")}</p>`:r.type==="space"?"":r.type==="html"?`${r.text}`:r.type==="escape"?r.text:(N.warn(`Unsupported markdown: ${r.type}`),r.raw)}return g(s,"output"),n.map(s).join("")}g(He,"markdownToHTML");var jt=(function(t){"use strict";var e=function(){},n=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function s(){var c=this;c.reads=[],c.writes=[],c.raf=n.bind(t),e("initialized",c)}g(s,"FastDom"),s.prototype={constructor:s,runTasks:g(function(c){e("run tasks");for(var p;p=c.shift();)p()},"runTasks"),measure:g(function(c,p){e("measure");var h=p?c.bind(p):c;return this.reads.push(h),r(this),h},"measure"),mutate:g(function(c,p){e("mutate");var h=p?c.bind(p):c;return this.writes.push(h),r(this),h},"mutate"),clear:g(function(c){return e("clear",c),i(this.reads,c)||i(this.writes,c)},"clear"),extend:g(function(c){if(e("extend",c),typeof c!="object")throw new Error("expected object");var p=Object.create(this);return o(p,c),p.fastdom=this,p.initialize&&p.initialize(),p},"extend"),catch:null};function r(c){c.scheduled||(c.scheduled=!0,c.raf(a.bind(null,c)),e("flush scheduled"))}g(r,"scheduleFlush");function a(c){e("flush");var p=c.writes,h=c.reads,u;try{e("flushing reads",h.length),c.runTasks(h),e("flushing writes",p.length),c.runTasks(p)}catch(d){u=d}if(c.scheduled=!1,(h.length||p.length)&&r(c),u)if(e("task errored",u.message),c.catch)c.catch(u);else throw u}g(a,"flush");function i(c,p){var h=c.indexOf(p);return!!~h&&!!c.splice(h,1)}g(i,"remove");function o(c,p){for(var h in p)p.hasOwnProperty(h)&&(c[h]=p[h])}g(o,"mixin");var l=t.fastdom=t.fastdom||new s;return l})(typeof window<"u"?window:globalThis),Ne={initialize:g(function(){this._tasks=new Map},"initialize"),mutate:g(function(t,e){return ce(this,"mutate",t,e)},"mutate"),measure:g(function(t,e){return ce(this,"measure",t,e)},"measure"),clear:g(function(t){var e=this._tasks,n=e.get(t);this.fastdom.clear(n),e.delete(t)},"clear")};function ce(t,e,n,s){var r=t._tasks,a=t.fastdom,i,o=new Promise(function(l,c){i=a[e](function(){r.delete(o);try{l(s?n.call(s):n())}catch(p){c(p)}},s)});return r.set(o,i),o}g(ce,"create");var{initialize:gr,mutate:fr,measure:dr,clear:kr}=Ne,Wt=Ne,Zt=jt.extend({raf(t){typeof queueMicrotask=="function"?queueMicrotask(t):setTimeout(t,0)}}).extend(Wt),Dt=Zt;function Ge(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}g(Ge,"splitTextToChars");function Qe(t,e){let n=Ge(e.content);return ue(t,[],n,e.type)}g(Qe,"splitWordToFitWidth");function ue(t,e,n,s){if(n.length===0)return[{content:e.join(""),type:s},{content:"",type:s}];let[r,...a]=n,i=[...e,r];return t([{content:i.join(""),type:s}])?ue(t,i,a,s):(e.length===0&&r&&(e.push(r),n.shift()),[{content:e.join(""),type:s},{content:n.join(""),type:s}])}g(ue,"splitWordToFitWidthRecursion");function Ue(t,e){if(t.some(({content:n})=>n.includes(`
71
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return j(t,e)}g(Ue,"splitLineToFitWidth");function j(t,e,n=[],s=[]){if(t.length===0)return s.length>0&&n.push(s),n.length>0?n:[];let r="";t[0].content===" "&&(r=" ",t.shift());let a=t.shift()??{content:" ",type:"normal"},i=[...s];if(r!==""&&i.push({content:r,type:"normal"}),i.push(a),e(i))return j(t,e,n,i);if(s.length>0)n.push(s),t.unshift(a);else if(a.content){let[o,l]=Qe(e,a);n.push([o]),l.content&&t.unshift(l)}return j(t,e,n)}g(j,"splitLineToFitWidthRecursion");function pe(t,e){e&&t.attr("style",e)}g(pe,"applyStyle");var Fe=16384;async function Ke(t,e,n,s,r=!1,a=ke(),i=0){let o=t.append("foreignObject");o.attr("width",`${Math.min(10*n,Fe)}px`),o.attr("height",`${Math.min(10*n,Fe)}px`);let l=o.append("xhtml:div"),c=Q(e.label)?await xe(e.label.replace(me.lineBreakRegex,`
72
+ `),a):G(e.label,a),p=e.isNode?"nodeLabel":"edgeLabel",h=l.append("span");h.html(c),pe(h,e.labelStyle),h.attr("class",`${p} ${s}`),pe(l,e.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),n!==Number.POSITIVE_INFINITY&&(l.style("max-width",n+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),r&&l.attr("class","labelBkg");let u=await Dt.measure(()=>l.node().getBoundingClientRect());return u.width===n?(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",n+"px")):u.width<i&&(l.style("display","table"),l.style("width",i+"px"),l.style("text-align","center")),o.node()}g(Ke,"addHtmlSpan");function W(t,e,n,s=!1){let r=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*n-.1+"em").attr("dy",n+"em");return s&&r.attr("text-anchor","middle"),r}g(W,"createTspan");function Xe(t,e,n){let s=t.append("text"),r=W(s,1,e);Z(r,n);let a=r.node().getComputedTextLength();return s.remove(),a}g(Xe,"computeWidthOfText");function Ht(t,e,n){let s=t.append("text"),r=W(s,1,e);Z(r,[{content:n,type:"normal"}]);let a=r.node()?.getBoundingClientRect();return a&&s.remove(),a}g(Ht,"computeDimensionOfText");function Ve(t,e,n,s=!1,r=!1){let i=e.append("g"),o=i.insert("rect").attr("class","background").attr("style","stroke: none"),l=i.append("text").attr("y","-10.1");r&&l.attr("text-anchor","middle");let c=0;for(let p of n){let h=g(d=>Xe(i,1.1,d)<=t,"checkWidth"),u=h(p)?[p]:Ue(p,h);for(let d of u){let f=W(l,c,1.1,r);Z(f,d),c++}}if(s){let p=l.node().getBBox(),h=2;return o.attr("x",p.x-h).attr("y",p.y-h).attr("width",p.width+2*h).attr("height",p.height+2*h),i.node()}else return l.node()}g(Ve,"createFormattedText");function he(t){let e=/&(amp|lt|gt);/g;return t.replace(e,(n,s)=>{switch(s){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return n}})}g(he,"decodeHTMLEntities");function Z(t,e){t.text(""),e.forEach((n,s)=>{let r=t.append("tspan").attr("font-style",n.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",n.type==="strong"?"bold":"normal");s===0?r.text(he(n.content)):r.text(" "+he(n.content))})}g(Z,"updateTextContentAndStyles");async function Ye(t,e={}){let n=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(r,a,i)=>(n.push((async()=>{let o=`${a}:${i}`;return await be(o)?await we(o,void 0,{class:"label-icon"}):`<i class='${G(r,e).replace(":"," ")}'></i>`})()),r));let s=await Promise.all(n);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>s.shift()??"")}g(Ye,"replaceIconSubstring");var mr=g(async(t,e="",{style:n="",isTitle:s=!1,classes:r="",useHtmlLabels:a=!0,markdown:i=!0,isNode:o=!0,width:l=200,minWidth:c=0,addSvgBackground:p=!1}={},h)=>{if(N.debug("XYZ createText",e,n,s,r,a,o,"addSvgBackground: ",p),a){let u=i?He(e,h):De(e),d=await Ye(U(u),h),f=e.replace(/\\\\/g,"\\"),m={isNode:o,label:Q(e)?f:d,labelStyle:n.replace("fill:","color:")};return await Ke(t,m,l,r,p,h,c)}else{let u=U(e.replace(/<br\s*\/?>/g,"<br/>")),d=i?Ze(u.replace("<br>","<br/>"),h):We(u),f=Ve(l,t,d,e?p:!1,!o);if(o){/stroke:/.exec(n)&&(n=n.replace("stroke:","lineColor:"));let m=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");R(f).attr("style",m)}else{let m=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");R(f).select("rect").attr("style",m.replace(/background:/g,"fill:"));let z=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");R(f).select("text").attr("style",z)}return s?R(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):R(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");export{Oe as a,Ze as b,Dt as c,Ht as d,mr as e};