const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-ChHCiuyG.js","assets/ui-vendor-CeCm8EER.js","assets/react-vendor-DEwriMA6.js","assets/feature-graph-c3KAmzq6.js","assets/graph-vendor-B-X5JegA.js","assets/utils-vendor-BysuhMZA.js","assets/feature-graph-BipNuM18.css","assets/feature-documents-DwnpZ4mM.js","assets/feature-retrieval-CZ47sqx5.js","assets/markdown-vendor-Dv0NSOeH.js","assets/index-DzTVXLx_.css","assets/dagre-JOIXM2OF-CN_2gOz7.js","assets/graph-PRt-G13g.js","assets/_baseUniq-CAqbga58.js","assets/layout-D-QAu7wS.js","assets/_basePickBy-wRSrd0Dh.js","assets/clone-DXKtE0u2.js","assets/c4Diagram-6F6E4RAY-C4OTcfWH.js","assets/chunk-67H74DCK-Blq2bv9m.js","assets/flowDiagram-KYDEHFYC-bQunOOqx.js","assets/chunk-E2GYISFI-D-9jMBXt.js","assets/chunk-BFAMUDN2-Cozth1gW.js","assets/chunk-SKB7J2MH-BkV0WR_d.js","assets/erDiagram-3M52JZNH-Dit0Au5l.js","assets/gitGraphDiagram-GW3U2K7C-B8uxjbUp.js","assets/chunk-353BL4L5-CffmyEvg.js","assets/chunk-AACKK3MU-CmfixfV9.js","assets/treemap-75Q7IDZK-DV-jJKWx.js","assets/ganttDiagram-EK5VF46D-CiNscdK_.js","assets/infoDiagram-LHK5PUON-4_fDDnTU.js","assets/pieDiagram-NIOCPIFQ-BQqCknB0.js","assets/quadrantDiagram-2OG54O6I-DEL86tlU.js","assets/xychartDiagram-H2YORKM3-B0P6RHmU.js","assets/requirementDiagram-QOLK2EJ7-BL7NAKs4.js","assets/sequenceDiagram-SKLFT4DO-DIFVJvLV.js","assets/classDiagram-M3E45YP4--5o3ueLV.js","assets/chunk-SZ463SBG-C04xGCyn.js","assets/classDiagram-v2-YAWTLIQI--5o3ueLV.js","assets/stateDiagram-MI5ZYTHO-p_9A1Zz-.js","assets/chunk-OW32GOEJ-0o-6HNpZ.js","assets/stateDiagram-v2-5AN5P6BG-BgF3Zds7.js","assets/journeyDiagram-EWQZEKCU-3mQNk2Ac.js","assets/timeline-definition-MYPXXCX6-D6pgan68.js","assets/mindmap-definition-6CBA2TL7-Bw7JDe96.js","assets/cytoscape.esm-CfBqOv7Q.js","assets/kanban-definition-ZSS6B67P-BkdRKy_Z.js","assets/sankeyDiagram-4UZDY2LN-DV10Guqe.js","assets/diagram-5UYTHUR4-CG8dr_Lj.js","assets/diagram-ZTM2IBQH-Dc0knWAT.js","assets/blockDiagram-6J76NXCF-8aqEK87K.js","assets/architectureDiagram-SUXI7LT5-97KzzNCH.js","assets/diagram-VMROVX33-DcK6br9E.js"])))=>i.map(i=>d[i]); var Qy=Object.defineProperty;var Jy=(e,t,r)=>t in e?Qy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vt=(e,t,r)=>Jy(e,typeof t!="symbol"?t+"":t,r);import{a8 as wt}from"./feature-graph-c3KAmzq6.js";import{g as tx}from"./react-vendor-DEwriMA6.js";var sa={exports:{}},ex=sa.exports,nh;function rx(){return nh||(nh=1,function(e,t){(function(r,i){e.exports=i()})(ex,function(){var r=1e3,i=6e4,n=36e5,a="millisecond",o="second",s="minute",c="hour",l="day",h="week",u="month",f="quarter",d="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var F=["th","st","nd","rd"],B=M%100;return"["+M+(F[(B-20)%10]||F[B]||F[0])+"]"}},C=function(M,F,B){var $=String(M);return!$||$.length>=F?M:""+Array(F+1-$.length).join(B)+M},k={s:C,z:function(M){var F=-M.utcOffset(),B=Math.abs(F),$=Math.floor(B/60),E=B%60;return(F<=0?"+":"-")+C($,2,"0")+":"+C(E,2,"0")},m:function M(F,B){if(F.date()1)return M(Y[0])}else{var U=F.name;_[U]=F,E=U}return!$&&E&&(w=E),E||!$&&w},O=function(M,F){if(D(M))return M.clone();var B=typeof F=="object"?F:{};return B.date=M,B.args=arguments,new R(B)},T=k;T.l=N,T.i=D,T.w=function(M,F){return O(M,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var R=function(){function M(B){this.$L=N(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[v]=!0}var F=M.prototype;return F.parse=function(B){this.$d=function($){var E=$.date,q=$.utc;if(E===null)return new Date(NaN);if(T.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var Y=E.match(y);if(Y){var U=Y[2]-1||0,pt=(Y[7]||"0").substring(0,3);return q?new Date(Date.UTC(Y[1],U,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,pt)):new Date(Y[1],U,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,pt)}}return new Date(E)}(B),this.init()},F.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},F.$utils=function(){return T},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(B,$){var E=O(B);return this.startOf($)<=E&&E<=this.endOf($)},F.isAfter=function(B,$){return O(B)e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const n=r<.5?r*(1+t):r+t-r*t,a=2*r-n;switch(i){case"r":return oa.hue2rgb(a,n,e+1/3)*255;case"g":return oa.hue2rgb(a,n,e)*255;case"b":return oa.hue2rgb(a,n,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const n=Math.max(e,t,r),a=Math.min(e,t,r),o=(n+a)/2;if(i==="l")return o*100;if(n===a)return 0;const s=n-a,c=o>.5?s/(2-n-a):s/(n+a);if(i==="s")return c*100;switch(n){case e:return((t-r)/s+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},sx={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ot={channel:oa,lang:ax,unit:sx},ar={};for(let e=0;e<=255;e++)ar[e]=ot.unit.dec2hex(e);const jt={ALL:0,RGB:1,HSL:2};class ox{constructor(){this.type=jt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=jt.ALL}is(t){return this.type===t}}class lx{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new ox}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=jt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:n}=t;r===void 0&&(t.h=ot.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=ot.channel.rgb2hsl(t,"s")),n===void 0&&(t.l=ot.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:n}=t;r===void 0&&(t.r=ot.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=ot.channel.hsl2rgb(t,"g")),n===void 0&&(t.b=ot.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(jt.HSL)&&r!==void 0?r:(this._ensureHSL(),ot.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(jt.HSL)&&r!==void 0?r:(this._ensureHSL(),ot.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(jt.HSL)&&r!==void 0?r:(this._ensureHSL(),ot.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(jt.RGB)&&r!==void 0?r:(this._ensureRGB(),ot.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(jt.RGB)&&r!==void 0?r:(this._ensureRGB(),ot.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(jt.RGB)&&r!==void 0?r:(this._ensureRGB(),ot.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(jt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(jt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(jt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(jt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(jt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(jt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ms=new lx({r:0,g:0,b:0,a:0},"transparent"),ii={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ii.re);if(!t)return;const r=t[1],i=parseInt(r,16),n=r.length,a=n%4===0,o=n>4,s=o?1:17,c=o?8:4,l=a?0:-1,h=o?255:15;return ms.set({r:(i>>c*(l+3)&h)*s,g:(i>>c*(l+2)&h)*s,b:(i>>c*(l+1)&h)*s,a:a?(i&h)*s/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:n}=e;return n<1?`#${ar[Math.round(t)]}${ar[Math.round(r)]}${ar[Math.round(i)]}${ar[Math.round(n*255)]}`:`#${ar[Math.round(t)]}${ar[Math.round(r)]}${ar[Math.round(i)]}`}},Cr={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Cr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return ot.channel.clamp.h(parseFloat(r)*.9);case"rad":return ot.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return ot.channel.clamp.h(parseFloat(r)*360)}}return ot.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Cr.re);if(!r)return;const[,i,n,a,o,s]=r;return ms.set({h:Cr._hue2deg(i),s:ot.channel.clamp.s(parseFloat(n)),l:ot.channel.clamp.l(parseFloat(a)),a:o?ot.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:n}=e;return n<1?`hsla(${ot.lang.round(t)}, ${ot.lang.round(r)}%, ${ot.lang.round(i)}%, ${n})`:`hsl(${ot.lang.round(t)}, ${ot.lang.round(r)}%, ${ot.lang.round(i)}%)`}},cn={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=cn.colors[e];if(t)return ii.parse(t)},stringify:e=>{const t=ii.stringify(e);for(const r in cn.colors)if(cn.colors[r]===t)return r}},en={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(en.re);if(!r)return;const[,i,n,a,o,s,c,l,h]=r;return ms.set({r:ot.channel.clamp.r(n?parseFloat(i)*2.55:parseFloat(i)),g:ot.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:ot.channel.clamp.b(c?parseFloat(s)*2.55:parseFloat(s)),a:l?ot.channel.clamp.a(h?parseFloat(l)/100:parseFloat(l)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:n}=e;return n<1?`rgba(${ot.lang.round(t)}, ${ot.lang.round(r)}, ${ot.lang.round(i)}, ${ot.lang.round(n)})`:`rgb(${ot.lang.round(t)}, ${ot.lang.round(r)}, ${ot.lang.round(i)})`}},ve={format:{keyword:cn,hex:ii,rgb:en,rgba:en,hsl:Cr,hsla:Cr},parse:e=>{if(typeof e!="string")return e;const t=ii.parse(e)||en.parse(e)||Cr.parse(e)||cn.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(jt.HSL)||e.data.r===void 0?Cr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?en.stringify(e):ii.stringify(e)},af=(e,t)=>{const r=ve.parse(e);for(const i in t)r[i]=ot.channel.clamp[i](t[i]);return ve.stringify(r)},hn=(e,t,r=0,i=1)=>{if(typeof e!="number")return af(e,{a:t});const n=ms.set({r:ot.channel.clamp.r(e),g:ot.channel.clamp.g(t),b:ot.channel.clamp.b(r),a:ot.channel.clamp.a(i)});return ve.stringify(n)},Y$=(e,t)=>ot.lang.round(ve.parse(e)[t]),cx=e=>{const{r:t,g:r,b:i}=ve.parse(e),n=.2126*ot.channel.toLinear(t)+.7152*ot.channel.toLinear(r)+.0722*ot.channel.toLinear(i);return ot.lang.round(n)},hx=e=>cx(e)>=.5,An=e=>!hx(e),sf=(e,t,r)=>{const i=ve.parse(e),n=i[t],a=ot.channel.clamp[t](n+r);return n!==a&&(i[t]=a),ve.stringify(i)},G=(e,t)=>sf(e,"l",t),it=(e,t)=>sf(e,"l",-t),A=(e,t)=>{const r=ve.parse(e),i={};for(const n in t)t[n]&&(i[n]=r[n]+t[n]);return af(e,i)},ux=(e,t,r=50)=>{const{r:i,g:n,b:a,a:o}=ve.parse(e),{r:s,g:c,b:l,a:h}=ve.parse(t),u=r/100,f=u*2-1,d=o-h,m=((f*d===-1?f:(f+d)/(1+f*d))+1)/2,y=1-m,x=i*m+s*y,b=n*m+c*y,C=a*m+l*y,k=o*u+h*(1-u);return hn(x,b,C,k)},H=(e,t=100)=>{const r=ve.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,ux(r,e,t)};/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */const{entries:of,setPrototypeOf:ah,isFrozen:fx,getPrototypeOf:dx,getOwnPropertyDescriptor:px}=Object;let{freeze:ie,seal:ye,create:lf}=Object,{apply:Fo,construct:$o}=typeof Reflect<"u"&&Reflect;ie||(ie=function(t){return t});ye||(ye=function(t){return t});Fo||(Fo=function(t,r,i){return t.apply(r,i)});$o||($o=function(t,r){return new t(...r)});const jn=ne(Array.prototype.forEach),gx=ne(Array.prototype.lastIndexOf),sh=ne(Array.prototype.pop),Ii=ne(Array.prototype.push),mx=ne(Array.prototype.splice),la=ne(String.prototype.toLowerCase),Js=ne(String.prototype.toString),oh=ne(String.prototype.match),Pi=ne(String.prototype.replace),yx=ne(String.prototype.indexOf),xx=ne(String.prototype.trim),be=ne(Object.prototype.hasOwnProperty),Qt=ne(RegExp.prototype.test),Ni=bx(TypeError);function ne(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n2&&arguments[2]!==void 0?arguments[2]:la;ah&&ah(e,null);let i=t.length;for(;i--;){let n=t[i];if(typeof n=="string"){const a=r(n);a!==n&&(fx(t)||(t[i]=a),n=a)}e[n]=!0}return e}function _x(e){for(let t=0;t/gm),Sx=ye(/\$\{[\w\W]*/gm),Tx=ye(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mx=ye(/^aria-[\-\w]+$/),cf=ye(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ax=ye(/^(?:\w+script|data):/i),Lx=ye(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hf=ye(/^html$/i),Bx=ye(/^[a-z][.\w]*(-[.\w]+)+$/i);var fh=Object.freeze({__proto__:null,ARIA_ATTR:Mx,ATTR_WHITESPACE:Lx,CUSTOM_ELEMENT:Bx,DATA_ATTR:Tx,DOCTYPE_NAME:hf,ERB_EXPR:vx,IS_ALLOWED_URI:cf,IS_SCRIPT_OR_DATA:Ax,MUSTACHE_EXPR:kx,TMPLIT_EXPR:Sx});const Wi={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ex=function(){return typeof window>"u"?null:window},Fx=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const n="data-tt-policy-suffix";r&&r.hasAttribute(n)&&(i=r.getAttribute(n));const a="dompurify"+(i?"#"+i:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},dh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function uf(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ex();const t=rt=>uf(rt);if(t.version="3.2.5",t.removed=[],!e||!e.document||e.document.nodeType!==Wi.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const i=r,n=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:d}=e,p=c.prototype,m=zi(p,"cloneNode"),y=zi(p,"remove"),x=zi(p,"nextSibling"),b=zi(p,"childNodes"),C=zi(p,"parentNode");if(typeof o=="function"){const rt=r.createElement("template");rt.content&&rt.content.ownerDocument&&(r=rt.content.ownerDocument)}let k,w="";const{implementation:_,createNodeIterator:v,createDocumentFragment:D,getElementsByTagName:N}=r,{importNode:O}=i;let T=dh();t.isSupported=typeof of=="function"&&typeof C=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:R,ERB_EXPR:L,TMPLIT_EXPR:M,DATA_ATTR:F,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:E,CUSTOM_ELEMENT:q}=fh;let{IS_ALLOWED_URI:Y}=fh,U=null;const pt=dt({},[...lh,...to,...eo,...ro,...ch]);let ht=null;const kt=dt({},[...hh,...io,...uh,...Gn]);let nt=Object.seal(lf(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),lt=null,ut=null,Ct=!0,z=!0,j=!1,et=!0,P=!1,Tt=!0,ft=!1,Pt=!1,Nt=!1,ae=!1,pr=!1,zn=!1,zc=!0,Wc=!1;const Uy="user-content-";let Gs=!0,Di=!1,Yr={},jr=null;const qc=dt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Hc=null;const Uc=dt({},["audio","video","img","source","image","track"]);let Vs=null;const Yc=dt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wn="http://www.w3.org/1998/Math/MathML",qn="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml";let Gr=Ne,Xs=!1,Zs=null;const Yy=dt({},[Wn,qn,Ne],Js);let Hn=dt({},["mi","mo","mn","ms","mtext"]),Un=dt({},["annotation-xml"]);const jy=dt({},["title","style","font","a","script"]);let Oi=null;const Gy=["application/xhtml+xml","text/html"],Vy="text/html";let Rt=null,Vr=null;const Xy=r.createElement("form"),jc=function(S){return S instanceof RegExp||S instanceof Function},Ks=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Vr&&Vr===S)){if((!S||typeof S!="object")&&(S={}),S=yr(S),Oi=Gy.indexOf(S.PARSER_MEDIA_TYPE)===-1?Vy:S.PARSER_MEDIA_TYPE,Rt=Oi==="application/xhtml+xml"?Js:la,U=be(S,"ALLOWED_TAGS")?dt({},S.ALLOWED_TAGS,Rt):pt,ht=be(S,"ALLOWED_ATTR")?dt({},S.ALLOWED_ATTR,Rt):kt,Zs=be(S,"ALLOWED_NAMESPACES")?dt({},S.ALLOWED_NAMESPACES,Js):Yy,Vs=be(S,"ADD_URI_SAFE_ATTR")?dt(yr(Yc),S.ADD_URI_SAFE_ATTR,Rt):Yc,Hc=be(S,"ADD_DATA_URI_TAGS")?dt(yr(Uc),S.ADD_DATA_URI_TAGS,Rt):Uc,jr=be(S,"FORBID_CONTENTS")?dt({},S.FORBID_CONTENTS,Rt):qc,lt=be(S,"FORBID_TAGS")?dt({},S.FORBID_TAGS,Rt):{},ut=be(S,"FORBID_ATTR")?dt({},S.FORBID_ATTR,Rt):{},Yr=be(S,"USE_PROFILES")?S.USE_PROFILES:!1,Ct=S.ALLOW_ARIA_ATTR!==!1,z=S.ALLOW_DATA_ATTR!==!1,j=S.ALLOW_UNKNOWN_PROTOCOLS||!1,et=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=S.SAFE_FOR_TEMPLATES||!1,Tt=S.SAFE_FOR_XML!==!1,ft=S.WHOLE_DOCUMENT||!1,ae=S.RETURN_DOM||!1,pr=S.RETURN_DOM_FRAGMENT||!1,zn=S.RETURN_TRUSTED_TYPE||!1,Nt=S.FORCE_BODY||!1,zc=S.SANITIZE_DOM!==!1,Wc=S.SANITIZE_NAMED_PROPS||!1,Gs=S.KEEP_CONTENT!==!1,Di=S.IN_PLACE||!1,Y=S.ALLOWED_URI_REGEXP||cf,Gr=S.NAMESPACE||Ne,Hn=S.MATHML_TEXT_INTEGRATION_POINTS||Hn,Un=S.HTML_INTEGRATION_POINTS||Un,nt=S.CUSTOM_ELEMENT_HANDLING||{},S.CUSTOM_ELEMENT_HANDLING&&jc(S.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(nt.tagNameCheck=S.CUSTOM_ELEMENT_HANDLING.tagNameCheck),S.CUSTOM_ELEMENT_HANDLING&&jc(S.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(nt.attributeNameCheck=S.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=S.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(z=!1),pr&&(ae=!0),Yr&&(U=dt({},ch),ht=[],Yr.html===!0&&(dt(U,lh),dt(ht,hh)),Yr.svg===!0&&(dt(U,to),dt(ht,io),dt(ht,Gn)),Yr.svgFilters===!0&&(dt(U,eo),dt(ht,io),dt(ht,Gn)),Yr.mathMl===!0&&(dt(U,ro),dt(ht,uh),dt(ht,Gn))),S.ADD_TAGS&&(U===pt&&(U=yr(U)),dt(U,S.ADD_TAGS,Rt)),S.ADD_ATTR&&(ht===kt&&(ht=yr(ht)),dt(ht,S.ADD_ATTR,Rt)),S.ADD_URI_SAFE_ATTR&&dt(Vs,S.ADD_URI_SAFE_ATTR,Rt),S.FORBID_CONTENTS&&(jr===qc&&(jr=yr(jr)),dt(jr,S.FORBID_CONTENTS,Rt)),Gs&&(U["#text"]=!0),ft&&dt(U,["html","head","body"]),U.table&&(dt(U,["tbody"]),delete lt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=S.TRUSTED_TYPES_POLICY,w=k.createHTML("")}else k===void 0&&(k=Fx(d,n)),k!==null&&typeof w=="string"&&(w=k.createHTML(""));ie&&ie(S),Vr=S}},Gc=dt({},[...to,...eo,...Cx]),Vc=dt({},[...ro,...wx]),Zy=function(S){let W=C(S);(!W||!W.tagName)&&(W={namespaceURI:Gr,tagName:"template"});const Z=la(S.tagName),Mt=la(W.tagName);return Zs[S.namespaceURI]?S.namespaceURI===qn?W.namespaceURI===Ne?Z==="svg":W.namespaceURI===Wn?Z==="svg"&&(Mt==="annotation-xml"||Hn[Mt]):!!Gc[Z]:S.namespaceURI===Wn?W.namespaceURI===Ne?Z==="math":W.namespaceURI===qn?Z==="math"&&Un[Mt]:!!Vc[Z]:S.namespaceURI===Ne?W.namespaceURI===qn&&!Un[Mt]||W.namespaceURI===Wn&&!Hn[Mt]?!1:!Vc[Z]&&(jy[Z]||!Gc[Z]):!!(Oi==="application/xhtml+xml"&&Zs[S.namespaceURI]):!1},Te=function(S){Ii(t.removed,{element:S});try{C(S).removeChild(S)}catch{y(S)}},Yn=function(S,W){try{Ii(t.removed,{attribute:W.getAttributeNode(S),from:W})}catch{Ii(t.removed,{attribute:null,from:W})}if(W.removeAttribute(S),S==="is")if(ae||pr)try{Te(W)}catch{}else try{W.setAttribute(S,"")}catch{}},Xc=function(S){let W=null,Z=null;if(Nt)S=""+S;else{const zt=oh(S,/^[\r\n\t ]+/);Z=zt&&zt[0]}Oi==="application/xhtml+xml"&&Gr===Ne&&(S=''+S+"");const Mt=k?k.createHTML(S):S;if(Gr===Ne)try{W=new f().parseFromString(Mt,Oi)}catch{}if(!W||!W.documentElement){W=_.createDocument(Gr,"template",null);try{W.documentElement.innerHTML=Xs?w:Mt}catch{}}const Ut=W.body||W.documentElement;return S&&Z&&Ut.insertBefore(r.createTextNode(Z),Ut.childNodes[0]||null),Gr===Ne?N.call(W,ft?"html":"body")[0]:ft?W.documentElement:Ut},Zc=function(S){return v.call(S.ownerDocument||S,S,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Qs=function(S){return S instanceof u&&(typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||!(S.attributes instanceof h)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function")},Kc=function(S){return typeof s=="function"&&S instanceof s};function ze(rt,S,W){jn(rt,Z=>{Z.call(t,S,W,Vr)})}const Qc=function(S){let W=null;if(ze(T.beforeSanitizeElements,S,null),Qs(S))return Te(S),!0;const Z=Rt(S.nodeName);if(ze(T.uponSanitizeElement,S,{tagName:Z,allowedTags:U}),S.hasChildNodes()&&!Kc(S.firstElementChild)&&Qt(/<[/\w!]/g,S.innerHTML)&&Qt(/<[/\w!]/g,S.textContent)||S.nodeType===Wi.progressingInstruction||Tt&&S.nodeType===Wi.comment&&Qt(/<[/\w]/g,S.data))return Te(S),!0;if(!U[Z]||lt[Z]){if(!lt[Z]&&th(Z)&&(nt.tagNameCheck instanceof RegExp&&Qt(nt.tagNameCheck,Z)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(Z)))return!1;if(Gs&&!jr[Z]){const Mt=C(S)||S.parentNode,Ut=b(S)||S.childNodes;if(Ut&&Mt){const zt=Ut.length;for(let se=zt-1;se>=0;--se){const Me=m(Ut[se],!0);Me.__removalCount=(S.__removalCount||0)+1,Mt.insertBefore(Me,x(S))}}}return Te(S),!0}return S instanceof c&&!Zy(S)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&Qt(/<\/no(script|embed|frames)/i,S.innerHTML)?(Te(S),!0):(P&&S.nodeType===Wi.text&&(W=S.textContent,jn([R,L,M],Mt=>{W=Pi(W,Mt," ")}),S.textContent!==W&&(Ii(t.removed,{element:S.cloneNode()}),S.textContent=W)),ze(T.afterSanitizeElements,S,null),!1)},Jc=function(S,W,Z){if(zc&&(W==="id"||W==="name")&&(Z in r||Z in Xy))return!1;if(!(z&&!ut[W]&&Qt(F,W))){if(!(Ct&&Qt(B,W))){if(!ht[W]||ut[W]){if(!(th(S)&&(nt.tagNameCheck instanceof RegExp&&Qt(nt.tagNameCheck,S)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(S))&&(nt.attributeNameCheck instanceof RegExp&&Qt(nt.attributeNameCheck,W)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck(W))||W==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&Qt(nt.tagNameCheck,Z)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(Z))))return!1}else if(!Vs[W]){if(!Qt(Y,Pi(Z,E,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&S!=="script"&&yx(Z,"data:")===0&&Hc[S])){if(!(j&&!Qt($,Pi(Z,E,"")))){if(Z)return!1}}}}}}return!0},th=function(S){return S!=="annotation-xml"&&oh(S,q)},eh=function(S){ze(T.beforeSanitizeAttributes,S,null);const{attributes:W}=S;if(!W||Qs(S))return;const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ht,forceKeepAttr:void 0};let Mt=W.length;for(;Mt--;){const Ut=W[Mt],{name:zt,namespaceURI:se,value:Me}=Ut,Ri=Rt(zt);let Kt=zt==="value"?Me:xx(Me);if(Z.attrName=Ri,Z.attrValue=Kt,Z.keepAttr=!0,Z.forceKeepAttr=void 0,ze(T.uponSanitizeAttribute,S,Z),Kt=Z.attrValue,Wc&&(Ri==="id"||Ri==="name")&&(Yn(zt,S),Kt=Uy+Kt),Tt&&Qt(/((--!?|])>)|<\/(style|title)/i,Kt)){Yn(zt,S);continue}if(Z.forceKeepAttr||(Yn(zt,S),!Z.keepAttr))continue;if(!et&&Qt(/\/>/i,Kt)){Yn(zt,S);continue}P&&jn([R,L,M],ih=>{Kt=Pi(Kt,ih," ")});const rh=Rt(S.nodeName);if(Jc(rh,Ri,Kt)){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!se)switch(d.getAttributeType(rh,Ri)){case"TrustedHTML":{Kt=k.createHTML(Kt);break}case"TrustedScriptURL":{Kt=k.createScriptURL(Kt);break}}try{se?S.setAttributeNS(se,zt,Kt):S.setAttribute(zt,Kt),Qs(S)?Te(S):sh(t.removed)}catch{}}}ze(T.afterSanitizeAttributes,S,null)},Ky=function rt(S){let W=null;const Z=Zc(S);for(ze(T.beforeSanitizeShadowDOM,S,null);W=Z.nextNode();)ze(T.uponSanitizeShadowNode,W,null),Qc(W),eh(W),W.content instanceof a&&rt(W.content);ze(T.afterSanitizeShadowDOM,S,null)};return t.sanitize=function(rt){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,Z=null,Mt=null,Ut=null;if(Xs=!rt,Xs&&(rt=""),typeof rt!="string"&&!Kc(rt))if(typeof rt.toString=="function"){if(rt=rt.toString(),typeof rt!="string")throw Ni("dirty is not a string, aborting")}else throw Ni("toString is not a function");if(!t.isSupported)return rt;if(Pt||Ks(S),t.removed=[],typeof rt=="string"&&(Di=!1),Di){if(rt.nodeName){const Me=Rt(rt.nodeName);if(!U[Me]||lt[Me])throw Ni("root node is forbidden and cannot be sanitized in-place")}}else if(rt instanceof s)W=Xc(""),Z=W.ownerDocument.importNode(rt,!0),Z.nodeType===Wi.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?W=Z:W.appendChild(Z);else{if(!ae&&!P&&!ft&&rt.indexOf("<")===-1)return k&&zn?k.createHTML(rt):rt;if(W=Xc(rt),!W)return ae?null:zn?w:""}W&&Nt&&Te(W.firstChild);const zt=Zc(Di?rt:W);for(;Mt=zt.nextNode();)Qc(Mt),eh(Mt),Mt.content instanceof a&&Ky(Mt.content);if(Di)return rt;if(ae){if(pr)for(Ut=D.call(W.ownerDocument);W.firstChild;)Ut.appendChild(W.firstChild);else Ut=W;return(ht.shadowroot||ht.shadowrootmode)&&(Ut=O.call(i,Ut,!0)),Ut}let se=ft?W.outerHTML:W.innerHTML;return ft&&U["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&Qt(hf,W.ownerDocument.doctype.name)&&(se=" `+se),P&&jn([R,L,M],Me=>{se=Pi(se,Me," ")}),k&&zn?k.createHTML(se):se},t.setConfig=function(){let rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ks(rt),Pt=!0},t.clearConfig=function(){Vr=null,Pt=!1},t.isValidAttribute=function(rt,S,W){Vr||Ks({});const Z=Rt(rt),Mt=Rt(S);return Jc(Z,Mt,W)},t.addHook=function(rt,S){typeof S=="function"&&Ii(T[rt],S)},t.removeHook=function(rt,S){if(S!==void 0){const W=gx(T[rt],S);return W===-1?void 0:mx(T[rt],W,1)[0]}return sh(T[rt])},t.removeHooks=function(rt){T[rt]=[]},t.removeAllHooks=function(){T=dh()},t}var gi=uf(),ff=Object.defineProperty,g=(e,t)=>ff(e,"name",{value:t,configurable:!0}),$x=(e,t)=>{for(var r in t)ff(e,r,{get:t[r],enumerable:!0})},We={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},I={trace:g((...e)=>{},"trace"),debug:g((...e)=>{},"debug"),info:g((...e)=>{},"info"),warn:g((...e)=>{},"warn"),error:g((...e)=>{},"error"),fatal:g((...e)=>{},"fatal")},Dl=g(function(e="fatal"){let t=We.fatal;typeof e=="string"?e.toLowerCase()in We&&(t=We[e]):typeof e=="number"&&(t=e),I.trace=()=>{},I.debug=()=>{},I.info=()=>{},I.warn=()=>{},I.error=()=>{},I.fatal=()=>{},t<=We.fatal&&(I.fatal=console.error?console.error.bind(console,pe("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",pe("FATAL"))),t<=We.error&&(I.error=console.error?console.error.bind(console,pe("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",pe("ERROR"))),t<=We.warn&&(I.warn=console.warn?console.warn.bind(console,pe("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",pe("WARN"))),t<=We.info&&(I.info=console.info?console.info.bind(console,pe("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",pe("INFO"))),t<=We.debug&&(I.debug=console.debug?console.debug.bind(console,pe("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",pe("DEBUG"))),t<=We.trace&&(I.trace=console.debug?console.debug.bind(console,pe("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",pe("TRACE")))},"setLogLevel"),pe=g(e=>`%c${nx().format("ss.SSS")} : ${e} : `,"format"),df=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,un=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Dx=/\s*%%.*\n/gm,oi,pf=(oi=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},g(oi,"UnknownDiagramError"),oi),Ar={},Ol=g(function(e,t){e=e.replace(df,"").replace(un,"").replace(Dx,` `);for(const[r,{detector:i}]of Object.entries(Ar))if(i(e,t))return r;throw new pf(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Do=g((...e)=>{for(const{id:t,detector:r,loader:i}of e)gf(t,r,i)},"registerLazyLoadedDiagrams"),gf=g((e,t,r)=>{Ar[e]&&I.warn(`Detector with key ${e} already exists. Overwriting.`),Ar[e]={detector:t,loader:r},I.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),Ox=g(e=>Ar[e].loader,"getDiagramLoader"),Oo=g((e,t,{depth:r=2,clobber:i=!1}={})=>{const n={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(a=>Oo(e,a,n)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(a=>{e.includes(a)||e.push(a)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(a=>{typeof t[a]=="object"&&(e[a]===void 0||typeof e[a]=="object")?(e[a]===void 0&&(e[a]=Array.isArray(t[a])?[]:{}),e[a]=Oo(e[a],t[a],{depth:r-1,clobber:i})):(i||typeof e[a]!="object"&&typeof t[a]!="object")&&(e[a]=t[a])}),e)},"assignWithDepth"),Ht=Oo,ys="#ffffff",xs="#f2f2f2",Jt=g((e,t)=>t?A(e,{s:-40,l:10}):A(e,{s:-40,l:-10}),"mkBorder"),li,Rx=(li=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var r,i,n,a,o,s,c,l,h,u,f,d,p,m,y,x,b,C,k,w,_;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||A(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||A(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Jt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Jt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Jt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||H(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||H(this.tertiaryColor),this.lineColor=this.lineColor||H(this.background),this.arrowheadColor=this.arrowheadColor||H(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?it(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||it(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||H(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||G(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||it(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||it(this.mainBkg,10)):(this.rowOdd=this.rowOdd||G(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||G(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||A(this.primaryColor,{h:30}),this.cScale4=this.cScale4||A(this.primaryColor,{h:60}),this.cScale5=this.cScale5||A(this.primaryColor,{h:90}),this.cScale6=this.cScale6||A(this.primaryColor,{h:120}),this.cScale7=this.cScale7||A(this.primaryColor,{h:150}),this.cScale8=this.cScale8||A(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||A(this.primaryColor,{h:270}),this.cScale10=this.cScale10||A(this.primaryColor,{h:300}),this.cScale11=this.cScale11||A(this.primaryColor,{h:330}),this.darkMode)for(let v=0;v{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(li,"Theme"),li),Ix=g(e=>{const t=new Rx;return t.calculate(e),t},"getThemeVariables"),ci,Px=(ci=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=G(this.primaryColor,16),this.tertiaryColor=A(this.primaryColor,{h:-160}),this.primaryBorderColor=H(this.background),this.secondaryBorderColor=Jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Jt(this.tertiaryColor,this.darkMode),this.primaryTextColor=H(this.primaryColor),this.secondaryTextColor=H(this.secondaryColor),this.tertiaryTextColor=H(this.tertiaryColor),this.lineColor=H(this.background),this.textColor=H(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=G(H("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=hn(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=it("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=it(this.sectionBkgColor,10),this.taskBorderColor=hn(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=hn(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||G(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||it(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,r,i,n,a,o,s,c,l,h,u,f,d,p,m,y,x,b,C,k,w;this.secondBkg=G(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=G(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=G(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=A(this.primaryColor,{h:64}),this.fillType3=A(this.secondaryColor,{h:64}),this.fillType4=A(this.primaryColor,{h:-64}),this.fillType5=A(this.secondaryColor,{h:-64}),this.fillType6=A(this.primaryColor,{h:128}),this.fillType7=A(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||A(this.primaryColor,{h:30}),this.cScale4=this.cScale4||A(this.primaryColor,{h:60}),this.cScale5=this.cScale5||A(this.primaryColor,{h:90}),this.cScale6=this.cScale6||A(this.primaryColor,{h:120}),this.cScale7=this.cScale7||A(this.primaryColor,{h:150}),this.cScale8=this.cScale8||A(this.primaryColor,{h:210}),this.cScale9=this.cScale9||A(this.primaryColor,{h:270}),this.cScale10=this.cScale10||A(this.primaryColor,{h:300}),this.cScale11=this.cScale11||A(this.primaryColor,{h:330});for(let _=0;_{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ci,"Theme"),ci),Nx=g(e=>{const t=new Px;return t.calculate(e),t},"getThemeVariables"),hi,zx=(hi=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=A(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=A(this.primaryColor,{h:-160}),this.primaryBorderColor=Jt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Jt(this.tertiaryColor,this.darkMode),this.primaryTextColor=H(this.primaryColor),this.secondaryTextColor=H(this.secondaryColor),this.tertiaryTextColor=H(this.tertiaryColor),this.lineColor=H(this.background),this.textColor=H(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=hn(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){var t,r,i,n,a,o,s,c,l,h,u,f,d,p,m,y,x,b,C,k,w;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||A(this.primaryColor,{h:30}),this.cScale4=this.cScale4||A(this.primaryColor,{h:60}),this.cScale5=this.cScale5||A(this.primaryColor,{h:90}),this.cScale6=this.cScale6||A(this.primaryColor,{h:120}),this.cScale7=this.cScale7||A(this.primaryColor,{h:150}),this.cScale8=this.cScale8||A(this.primaryColor,{h:210}),this.cScale9=this.cScale9||A(this.primaryColor,{h:270}),this.cScale10=this.cScale10||A(this.primaryColor,{h:300}),this.cScale11=this.cScale11||A(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||it(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||it(this.tertiaryColor,40);for(let _=0;_{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(hi,"Theme"),hi),Wx=g(e=>{const t=new zx;return t.calculate(e),t},"getThemeVariables"),ui,qx=(ui=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=G("#cde498",10),this.primaryBorderColor=Jt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Jt(this.tertiaryColor,this.darkMode),this.primaryTextColor=H(this.primaryColor),this.secondaryTextColor=H(this.secondaryColor),this.tertiaryTextColor=H(this.primaryColor),this.lineColor=H(this.background),this.textColor=H(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,i,n,a,o,s,c,l,h,u,f,d,p,m,y,x,b,C,k,w;this.actorBorder=it(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||A(this.primaryColor,{h:30}),this.cScale4=this.cScale4||A(this.primaryColor,{h:60}),this.cScale5=this.cScale5||A(this.primaryColor,{h:90}),this.cScale6=this.cScale6||A(this.primaryColor,{h:120}),this.cScale7=this.cScale7||A(this.primaryColor,{h:150}),this.cScale8=this.cScale8||A(this.primaryColor,{h:210}),this.cScale9=this.cScale9||A(this.primaryColor,{h:270}),this.cScale10=this.cScale10||A(this.primaryColor,{h:300}),this.cScale11=this.cScale11||A(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||it(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||it(this.tertiaryColor,40);for(let _=0;_{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ui,"Theme"),ui),Hx=g(e=>{const t=new qx;return t.calculate(e),t},"getThemeVariables"),fi,Ux=(fi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=G(this.contrast,55),this.background="#ffffff",this.tertiaryColor=A(this.primaryColor,{h:-160}),this.primaryBorderColor=Jt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Jt(this.tertiaryColor,this.darkMode),this.primaryTextColor=H(this.primaryColor),this.secondaryTextColor=H(this.secondaryColor),this.tertiaryTextColor=H(this.tertiaryColor),this.lineColor=H(this.background),this.textColor=H(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||G(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,i,n,a,o,s,c,l,h,u,f,d,p,m,y,x,b,C,k,w;this.secondBkg=G(this.contrast,55),this.border2=this.contrast,this.actorBorder=G(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let _=0;_{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(fi,"Theme"),fi),Yx=g(e=>{const t=new Ux;return t.calculate(e),t},"getThemeVariables"),Ze={base:{getThemeVariables:Ix},dark:{getThemeVariables:Nx},default:{getThemeVariables:Wx},forest:{getThemeVariables:Hx},neutral:{getThemeVariables:Yx}},Ae={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},mf={...Ae,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:Ze.default.getThemeVariables(),sequence:{...Ae.sequence,messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:g(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:g(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...Ae.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ae.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Ae.flowchart,inheritDir:!1},external_personFont:g(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:g(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:g(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:g(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:g(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:g(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:g(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:g(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:g(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:g(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:g(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:g(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:g(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:g(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:g(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:g(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:g(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:g(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:g(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:g(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Ae.pie,useWidth:984},xyChart:{...Ae.xyChart,useWidth:void 0},requirement:{...Ae.requirement,useWidth:void 0},packet:{...Ae.packet},radar:{...Ae.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},yf=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...yf(e[i],"")]:[...r,t+i],[]),"keyify"),jx=new Set(yf(mf,"")),xf=mf,Sa=g(e=>{if(I.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Sa(t));return}for(const t of Object.keys(e)){if(I.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!jx.has(t)||e[t]==null){I.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){I.debug("sanitizing object",t),Sa(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(I.debug("sanitizing css option",t),e[t]=Gx(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}I.debug("After sanitization",e)}},"sanitizeDirective"),Gx=g(e=>{let t=0,r=0;for(const i of e){if(t{let r=Ht({},e),i={};for(const n of t)wf(n),i=Ht(i,n);if(r=Ht(r,i),i.theme&&i.theme in Ze){const n=Ht({},bf),a=Ht(n.themeVariables||{},i.themeVariables);r.theme&&r.theme in Ze&&(r.themeVariables=Ze[r.theme].getThemeVariables(a))}return fn=r,kf(fn),fn},"updateCurrentConfig"),Vx=g(e=>(le=Ht({},mi),le=Ht(le,e),e.theme&&Ze[e.theme]&&(le.themeVariables=Ze[e.theme].getThemeVariables(e.themeVariables)),bs(le,yi),le),"setSiteConfig"),Xx=g(e=>{bf=Ht({},e)},"saveConfigFromInitialize"),Zx=g(e=>(le=Ht(le,e),bs(le,yi),le),"updateSiteConfig"),_f=g(()=>Ht({},le),"getSiteConfig"),Cf=g(e=>(kf(e),Ht(fn,e),he()),"setConfig"),he=g(()=>Ht({},fn),"getConfig"),wf=g(e=>{e&&(["secure",...le.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(I.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&wf(e[t])}))},"sanitize"),Kx=g(e=>{var t;Sa(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),yi.push(e),bs(le,yi)},"addDirective"),Ta=g((e=le)=>{yi=[],bs(e,yi)},"reset"),Qx={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},ph={},Jx=g(e=>{ph[e]||(I.warn(Qx[e]),ph[e]=!0)},"issueWarning"),kf=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Jx("LAZY_LOAD_DEPRECATED")},"checkConfig"),Ln=//gi,tb=g(e=>e?Tf(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),eb=(()=>{let e=!1;return()=>{e||(vf(),e=!0)}})();function vf(){const e="data-temp-href-target";gi.addHook("beforeSanitizeAttributes",t=>{t instanceof Element&&t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),gi.addHook("afterSanitizeAttributes",t=>{t instanceof Element&&t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}g(vf,"setupDompurifyHooks");var Sf=g(e=>(eb(),gi.sanitize(e)),"removeScript"),gh=g((e,t)=>{var r;if(((r=t.flowchart)==null?void 0:r.htmlLabels)!==!1){const i=t.securityLevel;i==="antiscript"||i==="strict"?e=Sf(e):i!=="loose"&&(e=Tf(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=ab(e))}return e},"sanitizeMore"),Lr=g((e,t)=>e&&(t.dompurifyConfig?e=gi.sanitize(gh(e,t),t.dompurifyConfig).toString():e=gi.sanitize(gh(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),rb=g((e,t)=>typeof e=="string"?Lr(e,t):e.flat().map(r=>Lr(r,t)),"sanitizeTextOrArray"),ib=g(e=>Ln.test(e),"hasBreaks"),nb=g(e=>e.split(Ln),"splitBreaks"),ab=g(e=>e.replace(/#br#/g,"
"),"placeholderToBreak"),Tf=g(e=>e.replace(Ln,"#br#"),"breakToPlaceholder"),Mf=g(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Dt=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),sb=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),ob=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),mh=g(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),lb=g((e,t)=>{const r=Ro(e,"~"),i=Ro(t,"~");return r===1&&i===1},"shouldCombineSets"),cb=g(e=>{const t=Ro(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let n=i.indexOf("~"),a=i.lastIndexOf("~");for(;n!==-1&&a!==-1&&n!==a;)i[n]="<",i[a]=">",n=i.indexOf("~"),a=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),yh=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Io=/\$\$(.*)\$\$/g,xi=g(e=>{var t;return(((t=e.match(Io))==null?void 0:t.length)??0)>0},"hasKatex"),j$=g(async(e,t)=>{e=await Rl(e,t);const r=document.createElement("div");r.innerHTML=e,r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const i=document.querySelector("body");i==null||i.insertAdjacentElement("beforeend",r);const n={width:r.clientWidth,height:r.clientHeight};return r.remove(),n},"calculateMathMLDimensions"),Rl=g(async(e,t)=>{if(!xi(e))return e;if(!(yh()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Io,"MathML is unsupported in this environment.");{const{default:r}=await wt(async()=>{const{default:n}=await import("./index-ChHCiuyG.js").then(a=>a.a);return{default:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),i=t.forceLegacyMathML||!yh()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Ln).map(n=>xi(n)?`
${n}
`:`
${n}
`).join("").replace(Io,(n,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatex"),Ai={getRows:tb,sanitizeText:Lr,sanitizeTextOrArray:rb,hasBreaks:ib,splitBreaks:nb,lineBreakRegex:Ln,removeScript:Sf,getUrl:Mf,evaluate:Dt,getMax:sb,getMin:ob},hb=g(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),ub=g(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Af=g(function(e,t,r,i){const n=ub(t,r,i);hb(e,n)},"configureSvgSize"),fb=g(function(e,t,r,i){const n=t.node().getBBox(),a=n.width,o=n.height;I.info(`SVG bounds: ${a}x${o}`,n);let s=0,c=0;I.info(`Graph bounds: ${s}x${c}`,e),s=a+r*2,c=o+r*2,I.info(`Calculated bounds: ${s}x${c}`),Af(t,c,s,i);const l=`${n.x-r} ${n.y-r} ${n.width+2*r} ${n.height+2*r}`;t.attr("viewBox",l)},"setupGraphViewbox"),ca={},db=g((e,t,r)=>{let i="";return e in ca&&ca[e]?i=ca[e](r):I.warn(`No theme found for ${e}`),` & { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} } @keyframes edge-animation-frame { from { stroke-dashoffset: 0; } } @keyframes dash { to { stroke-dashoffset: 0; } } & .edge-animation-slow { stroke-dasharray: 9,5 !important; stroke-dashoffset: 900; animation: dash 50s linear infinite; stroke-linecap: round; } & .edge-animation-fast { stroke-dasharray: 9,5 !important; stroke-dashoffset: 900; animation: dash 20s linear infinite; stroke-linecap: round; } /* Classes common for multiple diagrams */ & .error-icon { fill: ${r.errorBkgColor}; } & .error-text { fill: ${r.errorTextColor}; stroke: ${r.errorTextColor}; } & .edge-thickness-normal { stroke-width: 1px; } & .edge-thickness-thick { stroke-width: 3.5px } & .edge-pattern-solid { stroke-dasharray: 0; } & .edge-thickness-invisible { stroke-width: 0; fill: none; } & .edge-pattern-dashed{ stroke-dasharray: 3; } .edge-pattern-dotted { stroke-dasharray: 2; } & .marker { fill: ${r.lineColor}; stroke: ${r.lineColor}; } & .marker.cross { stroke: ${r.lineColor}; } & svg { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; } & p { margin: 0 } ${i} ${t} `},"getStyles"),pb=g((e,t)=>{t!==void 0&&(ca[e]=t)},"addStylesForDiagram"),gb=db,Lf={};$x(Lf,{clear:()=>mb,getAccDescription:()=>_b,getAccTitle:()=>xb,getDiagramTitle:()=>wb,setAccDescription:()=>bb,setAccTitle:()=>yb,setDiagramTitle:()=>Cb});var Il="",Pl="",Nl="",zl=g(e=>Lr(e,he()),"sanitizeText"),mb=g(()=>{Il="",Nl="",Pl=""},"clear"),yb=g(e=>{Il=zl(e).replace(/^\s+/g,"")},"setAccTitle"),xb=g(()=>Il,"getAccTitle"),bb=g(e=>{Nl=zl(e).replace(/\n\s+/g,` `)},"setAccDescription"),_b=g(()=>Nl,"getAccDescription"),Cb=g(e=>{Pl=zl(e)},"setDiagramTitle"),wb=g(()=>Pl,"getDiagramTitle"),xh=I,kb=Dl,xt=he,G$=Cf,V$=mi,_s=g(e=>Lr(e,xt()),"sanitizeText"),vb=fb,Sb=g(()=>Lf,"getCommonDb"),Ma={},Aa=g((e,t,r)=>{var i;Ma[e]&&xh.warn(`Diagram with id ${e} already registered. Overwriting.`),Ma[e]=t,r&&gf(e,r),pb(e,t.styles),(i=t.injectUtils)==null||i.call(t,xh,kb,xt,_s,vb,Sb(),()=>{})},"registerDiagram"),Po=g(e=>{if(e in Ma)return Ma[e];throw new Tb(e)},"getDiagram"),di,Tb=(di=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},g(di,"DiagramNotFoundError"),di);function Wl(e){return typeof e>"u"||e===null}g(Wl,"isNothing");function Bf(e){return typeof e=="object"&&e!==null}g(Bf,"isObject");function Ef(e){return Array.isArray(e)?e:Wl(e)?[]:[e]}g(Ef,"toArray");function Ff(e,t){var r,i,n,a;if(t)for(a=Object.keys(t),r=0,i=a.length;rs&&(a=" ... ",t=i-s+a.length),r-i>s&&(o=" ...",r=i+s-o.length),{str:a+e.slice(t,r).replace(/\t/g,"→")+o,pos:i-t+a.length}}g(ha,"getLine");function ua(e,t){return $t.repeat(" ",t-e.length)+e}g(ua,"padStart");function Of(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],n=[],a,o=-1;a=r.exec(e.buffer);)n.push(a.index),i.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var s="",c,l,h=Math.min(e.line+t.linesAfter,n.length).toString().length,u=t.maxLength-(t.indent+h+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)l=ha(e.buffer,i[o-c],n[o-c],e.position-(i[o]-i[o-c]),u),s=$t.repeat(" ",t.indent)+ua((e.line-c+1).toString(),h)+" | "+l.str+` `+s;for(l=ha(e.buffer,i[o],n[o],e.position,u),s+=$t.repeat(" ",t.indent)+ua((e.line+1).toString(),h)+" | "+l.str+` `,s+=$t.repeat("-",t.indent+h+3+l.pos)+`^ `,c=1;c<=t.linesAfter&&!(o+c>=n.length);c++)l=ha(e.buffer,i[o+c],n[o+c],e.position-(i[o]-i[o+c]),u),s+=$t.repeat(" ",t.indent)+ua((e.line+c+1).toString(),h)+" | "+l.str+` `;return s.replace(/\n$/,"")}g(Of,"makeSnippet");var $b=Of,Db=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ob=["scalar","sequence","mapping"];function Rf(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}g(Rf,"compileStyleAliases");function If(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Db.indexOf(r)===-1)throw new ce('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Rf(t.styleAliases||null),Ob.indexOf(this.kind)===-1)throw new ce('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}g(If,"Type$1");var Xt=If;function No(e,t){var r=[];return e[t].forEach(function(i){var n=r.length;r.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&a.multi===i.multi&&(n=o)}),r[n]=i}),r}g(No,"compileList");function Pf(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(g(i,"collectType"),t=0,r=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:g(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:g(function(e){return e.toString(10)},"decimal"),hexadecimal:g(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ub=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Kf(e){return!(e===null||!Ub.test(e)||e[e.length-1]==="_")}g(Kf,"resolveYamlFloat");function Qf(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}g(Qf,"constructYamlFloat");var Yb=/^[-+]?[0-9]+e/;function Jf(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if($t.isNegativeZero(e))return"-0.0";return r=e.toString(10),Yb.test(r)?r.replace("e",".e"):r}g(Jf,"representYamlFloat");function td(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||$t.isNegativeZero(e))}g(td,"isFloat");var jb=new Xt("tag:yaml.org,2002:float",{kind:"scalar",resolve:Kf,construct:Qf,predicate:td,represent:Jf,defaultStyle:"lowercase"}),ed=zb.extend({implicit:[Wb,qb,Hb,jb]}),Gb=ed,rd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),id=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function nd(e){return e===null?!1:rd.exec(e)!==null||id.exec(e)!==null}g(nd,"resolveYamlTimestamp");function ad(e){var t,r,i,n,a,o,s,c=0,l=null,h,u,f;if(t=rd.exec(e),t===null&&(t=id.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,i,n));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(h=+t[10],u=+(t[11]||0),l=(h*60+u)*6e4,t[9]==="-"&&(l=-l)),f=new Date(Date.UTC(r,i,n,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}g(ad,"constructYamlTimestamp");function sd(e){return e.toISOString()}g(sd,"representYamlTimestamp");var Vb=new Xt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:nd,construct:ad,instanceOf:Date,represent:sd});function od(e){return e==="<<"||e===null}g(od,"resolveYamlMerge");var Xb=new Xt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:od}),Hl=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function ld(e){if(e===null)return!1;var t,r,i=0,n=e.length,a=Hl;for(r=0;r64)){if(t<0)return!1;i+=6}return i%8===0}g(ld,"resolveYamlBinary");function cd(e){var t,r,i=e.replace(/[\r\n=]/g,""),n=i.length,a=Hl,o=0,s=[];for(t=0;t>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(i.charAt(t));return r=n%4*6,r===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):r===18?(s.push(o>>10&255),s.push(o>>2&255)):r===12&&s.push(o>>4&255),new Uint8Array(s)}g(cd,"constructYamlBinary");function hd(e){var t="",r=0,i,n,a=e.length,o=Hl;for(i=0;i>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]),r=(r<<8)+e[i];return n=a%3,n===0?(t+=o[r>>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]):n===2?(t+=o[r>>10&63],t+=o[r>>4&63],t+=o[r<<2&63],t+=o[64]):n===1&&(t+=o[r>>2&63],t+=o[r<<4&63],t+=o[64],t+=o[64]),t}g(hd,"representYamlBinary");function ud(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}g(ud,"isBinary");var Zb=new Xt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ld,construct:cd,predicate:ud,represent:hd}),Kb=Object.prototype.hasOwnProperty,Qb=Object.prototype.toString;function fd(e){if(e===null)return!0;var t=[],r,i,n,a,o,s=e;for(r=0,i=s.length;r>10)+55296,(e-65536&1023)+56320)}g(Td,"charFromCodepoint");var Md=new Array(256),Ad=new Array(256);for(gr=0;gr<256;gr++)Md[gr]=Wo(gr)?1:0,Ad[gr]=Wo(gr);var gr;function Ld(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||xd,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}g(Ld,"State$1");function Ul(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=$b(r),new ce(t,r)}g(Ul,"generateError");function tt(e,t){throw Ul(e,t)}g(tt,"throwError");function mn(e,t){e.onWarning&&e.onWarning.call(null,Ul(e,t))}g(mn,"throwWarning");var _h={YAML:g(function(t,r,i){var n,a,o;t.version!==null&&tt(t,"duplication of %YAML directive"),i.length!==1&&tt(t,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&tt(t,"ill-formed argument of the YAML directive"),a=parseInt(n[1],10),o=parseInt(n[2],10),a!==1&&tt(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&mn(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:g(function(t,r,i){var n,a;i.length!==2&&tt(t,"TAG directive accepts exactly two arguments"),n=i[0],a=i[1],Cd.test(n)||tt(t,"ill-formed tag handle (first argument) of the TAG directive"),lr.call(t.tagMap,n)&&tt(t,'there is a previously declared suffix for "'+n+'" tag handle'),wd.test(a)||tt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{tt(t,"tag prefix is malformed: "+a)}t.tagMap[n]=a},"handleTagDirective")};function Ke(e,t,r,i){var n,a,o,s;if(t1&&(e.result+=$t.repeat(` `,t-1))}g(ws,"writeFoldedLines");function Bd(e,t,r){var i,n,a,o,s,c,l,h,u=e.kind,f=e.result,d;if(d=e.input.charCodeAt(e.position),te(d)||wr(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(n=e.input.charCodeAt(e.position+1),te(n)||r&&wr(n)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;d!==0;){if(d===58){if(n=e.input.charCodeAt(e.position+1),te(n)||r&&wr(n))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),te(i))break}else{if(e.position===e.lineStart&&Bn(e)||r&&wr(d))break;if(we(d))if(c=e.line,l=e.lineStart,h=e.lineIndent,Bt(e,!1,-1),e.lineIndent>=t){s=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=h;break}}s&&(Ke(e,a,o,!1),ws(e,e.line-c),a=o=e.position,s=!1),or(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return Ke(e,a,o,!1),e.result?!0:(e.kind=u,e.result=f,!1)}g(Bd,"readPlainScalar");function Ed(e,t){var r,i,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Ke(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,n=e.position;else return!0;else we(r)?(Ke(e,i,n,!0),ws(e,Bt(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Bn(e)?tt(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);tt(e,"unexpected end of the stream within a single quoted scalar")}g(Ed,"readSingleQuotedScalar");function Fd(e,t){var r,i,n,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return Ke(e,r,e.position,!0),e.position++,!0;if(s===92){if(Ke(e,r,e.position,!0),s=e.input.charCodeAt(++e.position),we(s))Bt(e,!1,t);else if(s<256&&Md[s])e.result+=Ad[s],e.position++;else if((o=vd(s))>0){for(n=o,a=0;n>0;n--)s=e.input.charCodeAt(++e.position),(o=kd(s))>=0?a=(a<<4)+o:tt(e,"expected hexadecimal character");e.result+=Td(a),e.position++}else tt(e,"unknown escape sequence");r=i=e.position}else we(s)?(Ke(e,r,i,!0),ws(e,Bt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Bn(e)?tt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}tt(e,"unexpected end of the stream within a double quoted scalar")}g(Fd,"readDoubleQuotedScalar");function $d(e,t){var r=!0,i,n,a,o=e.tag,s,c=e.anchor,l,h,u,f,d,p=Object.create(null),m,y,x,b;if(b=e.input.charCodeAt(e.position),b===91)h=93,d=!1,s=[];else if(b===123)h=125,d=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),b=e.input.charCodeAt(++e.position);b!==0;){if(Bt(e,!0,t),b=e.input.charCodeAt(e.position),b===h)return e.position++,e.tag=o,e.anchor=c,e.kind=d?"mapping":"sequence",e.result=s,!0;r?b===44&&tt(e,"expected the node content, but found ','"):tt(e,"missed comma between flow collection entries"),y=m=x=null,u=f=!1,b===63&&(l=e.input.charCodeAt(e.position+1),te(l)&&(u=f=!0,e.position++,Bt(e,!0,t))),i=e.line,n=e.lineStart,a=e.position,Br(e,t,Ba,!1,!0),y=e.tag,m=e.result,Bt(e,!0,t),b=e.input.charCodeAt(e.position),(f||e.line===i)&&b===58&&(u=!0,b=e.input.charCodeAt(++e.position),Bt(e,!0,t),Br(e,t,Ba,!1,!0),x=e.result),d?kr(e,s,p,y,m,x,i,n,a):u?s.push(kr(e,null,p,y,m,x,i,n,a)):s.push(m),Bt(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(r=!0,b=e.input.charCodeAt(++e.position)):r=!1}tt(e,"unexpected end of the stream within a flow collection")}g($d,"readFlowCollection");function Dd(e,t){var r,i,n=no,a=!1,o=!1,s=t,c=0,l=!1,h,u;if(u=e.input.charCodeAt(e.position),u===124)i=!1;else if(u===62)i=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)no===n?n=u===43?bh:n1:tt(e,"repeat of a chomping mode identifier");else if((h=Sd(u))>=0)h===0?tt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?tt(e,"repeat of an indentation width identifier"):(s=t+h-1,o=!0);else break;if(or(u)){do u=e.input.charCodeAt(++e.position);while(or(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!we(u)&&u!==0)}for(;u!==0;){for(Cs(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndents&&(s=e.lineIndent),we(u)){c++;continue}if(e.lineIndentt)&&c!==0)tt(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(y&&(o=e.line,s=e.lineStart,c=e.position),Br(e,t,Ea,!0,n)&&(y?p=e.result:m=e.result),y||(kr(e,u,f,d,p,m,o,s,c),d=p=m=null),Bt(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&b!==0)tt(e,"bad indentation of a mapping entry");else if(e.lineIndentt?c=1:e.lineIndent===t?c=0:e.lineIndentt?c=1:e.lineIndent===t?c=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u"),e.result!==null&&p.kind!==e.kind&&tt(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):tt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}g(Br,"composeNode");function Nd(e){var t=e.position,r,i,n,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(Bt(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),r=e.position;o!==0&&!te(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),n=[],i.length<1&&tt(e,"directive name must not be less than one character in length");o!==0;){for(;or(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!we(o));break}if(we(o))break;for(r=e.position;o!==0&&!te(o);)o=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}o!==0&&Cs(e),lr.call(_h,i)?_h[i](e,i,n):mn(e,'unknown document directive "'+i+'"')}if(Bt(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Bt(e,!0,-1)):a&&tt(e,"directives end mark is expected"),Br(e,e.lineIndent-1,Ea,!1,!0),Bt(e,!0,-1),e.checkLineBreaks&&s1.test(e.input.slice(t,e.position))&&mn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Bn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Bt(e,!0,-1));return}if(e.position"u"&&(r=t,t=null);var i=Yl(e,r);if(typeof t!="function")return i;for(var n=0,a=i.length;n=55296&&r<=56319&&t+1=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}g(Jr,"codePointAt");function Gl(e){var t=/^\n* /;return t.test(e)}g(Gl,"needIndentIndicator");var tp=1,Vo=2,ep=3,rp=4,Kr=5;function ip(e,t,r,i,n,a,o,s){var c,l=0,h=null,u=!1,f=!1,d=i!==-1,p=-1,m=Qd(Jr(e,0))&&Jd(Jr(e,e.length-1));if(t||o)for(c=0;c=65536?c+=2:c++){if(l=Jr(e,c),!_i(l))return Kr;m=m&&Go(l,h,s),h=l}else{for(c=0;c=65536?c+=2:c++){if(l=Jr(e,c),l===yn)u=!0,d&&(f=f||c-p-1>i&&e[p+1]!==" ",p=c);else if(!_i(l))return Kr;m=m&&Go(l,h,s),h=l}f=f||d&&c-p-1>i&&e[p+1]!==" "}return!u&&!f?m&&!o&&!n(e)?tp:a===xn?Kr:Vo:r>9&&Gl(e)?Kr:o?a===xn?Kr:Vo:f?rp:ep}g(ip,"chooseScalarStyle");function np(e,t,r,i,n){e.dump=function(){if(t.length===0)return e.quotingType===xn?'""':"''";if(!e.noCompatMode&&(M1.indexOf(t)!==-1||A1.test(t)))return e.quotingType===xn?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,r),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=i||e.flowLevel>-1&&r>=e.flowLevel;function c(l){return Kd(e,l)}switch(g(c,"testAmbiguity"),ip(t,s,e.indent,o,c,e.quotingType,e.forceQuotes&&!i,n)){case tp:return t;case Vo:return"'"+t.replace(/'/g,"''")+"'";case ep:return"|"+Xo(t,e.indent)+Zo(Yo(t,a));case rp:return">"+Xo(t,e.indent)+Zo(Yo(ap(t,o),a));case Kr:return'"'+sp(t)+'"';default:throw new ce("impossible error: invalid scalar style")}}()}g(np,"writeScalar");function Xo(e,t){var r=Gl(e)?String(t):"",i=e[e.length-1]===` `,n=i&&(e[e.length-2]===` `||e===` `),a=n?"+":i?"":"-";return r+a+` `}g(Xo,"blockHeader");function Zo(e){return e[e.length-1]===` `?e.slice(0,-1):e}g(Zo,"dropEndingNewline");function ap(e,t){for(var r=/(\n+)([^\n]*)/g,i=function(){var l=e.indexOf(` `);return l=l!==-1?l:e.length,r.lastIndex=l,Ko(e.slice(0,l),t)}(),n=e[0]===` `||e[0]===" ",a,o;o=r.exec(e);){var s=o[1],c=o[2];a=c[0]===" ",i+=s+(!n&&!a&&c!==""?` `:"")+Ko(c,t),n=a}return i}g(ap,"foldString");function Ko(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,n=0,a,o=0,s=0,c="";i=r.exec(e);)s=i.index,s-n>t&&(a=o>n?o:s,c+=` `+e.slice(n,a),n=a+1),o=s;return c+=` `,e.length-n>t&&o>n?c+=e.slice(n,o)+` `+e.slice(o+1):c+=e.slice(n),c.slice(1)}g(Ko,"foldLine");function sp(e){for(var t="",r=0,i,n=0;n=65536?n+=2:n++)r=Jr(e,n),i=Zt[r],!i&&_i(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=i||Xd(r);return t}g(sp,"escapeString");function op(e,t,r){var i="",n=e.tag,a,o,s;for(a=0,o=r.length;a"u"&&Re(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=n,e.dump="["+i+"]"}g(op,"writeFlowSequence");function Qo(e,t,r,i){var n="",a=e.tag,o,s,c;for(o=0,s=r.length;o"u"&&Re(e,t+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=$a(e,t)),e.dump&&yn===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=a,e.dump=n||"[]"}g(Qo,"writeBlockSequence");function lp(e,t,r){var i="",n=e.tag,a=Object.keys(r),o,s,c,l,h;for(o=0,s=a.length;o1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Re(e,t,l,!1,!1)&&(h+=e.dump,i+=h));e.tag=n,e.dump="{"+i+"}"}g(lp,"writeFlowMapping");function cp(e,t,r,i){var n="",a=e.tag,o=Object.keys(r),s,c,l,h,u,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new ce("sortKeys must be a boolean or a function");for(s=0,c=o.length;s1024,u&&(e.dump&&yn===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=$a(e,t)),Re(e,t+1,h,!0,u)&&(e.dump&&yn===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,n+=f));e.tag=a,e.dump=n||"{}"}g(cp,"writeBlockMapping");function Jo(e,t,r){var i,n,a,o,s,c;for(n=r?e.explicitTypes:e.implicitTypes,a=0,o=n.length;a tag resolver accepts not "'+c+'" style');e.dump=i}return!0}return!1}g(Jo,"detectType");function Re(e,t,r,i,n,a,o){e.tag=null,e.dump=r,Jo(e,r,!1)||Jo(e,r,!0);var s=Wd.call(e.dump),c=i,l;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=s==="[object Object]"||s==="[object Array]",u,f;if(h&&(u=e.duplicates.indexOf(r),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(n=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")i&&Object.keys(e.dump).length!==0?(cp(e,t,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(lp(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Qo(e,t-1,e.dump,n):Qo(e,t,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(op(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&np(e,e.dump,t,a,c);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ce("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(l=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?l="!"+l:l.slice(0,18)==="tag:yaml.org,2002:"?l="!!"+l.slice(18):l="!<"+l+">",e.dump=l+" "+e.dump)}return!0}g(Re,"writeNode");function hp(e,t){var r=[],i=[],n,a;for(Da(e,r,i),n=0,a=i.length;nArray.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),D1=g(e=>({x:g(function(t,r,i){let n=0;const a=At(i[0]).x=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(ge,e.arrowTypeEnd)){const{angle:d,deltaX:p}=rn(i[i.length-1],i[i.length-2]);n=ge[e.arrowTypeEnd]*Math.cos(d)*(p>=0?1:-1)}const o=Math.abs(At(t).x-At(i[i.length-1]).x),s=Math.abs(At(t).y-At(i[i.length-1]).y),c=Math.abs(At(t).x-At(i[0]).x),l=Math.abs(At(t).y-At(i[0]).y),h=ge[e.arrowTypeStart],u=ge[e.arrowTypeEnd],f=1;if(o0&&s0&&l=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(ge,e.arrowTypeEnd)){const{angle:d,deltaY:p}=rn(i[i.length-1],i[i.length-2]);n=ge[e.arrowTypeEnd]*Math.abs(Math.sin(d))*(p>=0?1:-1)}const o=Math.abs(At(t).y-At(i[i.length-1]).y),s=Math.abs(At(t).x-At(i[i.length-1]).x),c=Math.abs(At(t).y-At(i[0]).y),l=Math.abs(At(t).x-At(i[0]).x),h=ge[e.arrowTypeStart],u=ge[e.arrowTypeEnd],f=1;if(o0&&s0&&l{var n,a;const t=((n=e==null?void 0:e.subGraphTitleMargin)==null?void 0:n.top)??0,r=((a=e==null?void 0:e.subGraphTitleMargin)==null?void 0:a.bottom)??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),O1=g(e=>{const{handDrawnSeed:t}=xt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Li=g(e=>{const t=R1([...e.cssCompiledStyles||[],...e.cssStyles||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),R1=g(e=>{const t=new Map;return e.forEach(r=>{const[i,n]=r.split(":");t.set(i.trim(),n==null?void 0:n.trim())}),t},"styles2Map"),up=g(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),J=g(e=>{const{stylesArray:t}=Li(e),r=[],i=[],n=[],a=[];return t.forEach(o=>{const s=o[0];up(s)?r.push(o.join(":")+" !important"):(i.push(o.join(":")+" !important"),s.includes("stroke")&&n.push(o.join(":")+" !important"),s==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:n,backgroundStyles:a}},"styles2String"),K=g((e,t)=>{var c;const{themeVariables:r,handDrawnSeed:i}=xt(),{nodeBorder:n,mainBkg:a}=r,{stylesMap:o}=Li(e);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||n,seed:i,strokeWidth:((c=o.get("stroke-width"))==null?void 0:c.replace("px",""))||1.3,fillLineDash:[0,0]},t)},"userNodeOverrides"),qi={},Ft={},Ch;function I1(){return Ch||(Ch=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.BLANK_URL=Ft.relativeFirstCharacters=Ft.whitespaceEscapeCharsRegex=Ft.urlSchemeRegex=Ft.ctrlCharactersRegex=Ft.htmlCtrlEntityRegex=Ft.htmlEntitiesRegex=Ft.invalidProtocolRegex=void 0,Ft.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Ft.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Ft.htmlCtrlEntityRegex=/&(newline|tab);/gi,Ft.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Ft.urlSchemeRegex=/^.+(:|:)/gim,Ft.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Ft.relativeFirstCharacters=[".","/"],Ft.BLANK_URL="about:blank"),Ft}var wh;function P1(){if(wh)return qi;wh=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.sanitizeUrl=void 0;var e=I1();function t(o){return e.relativeFirstCharacters.indexOf(o[0])>-1}function r(o){var s=o.replace(e.ctrlCharactersRegex,"");return s.replace(e.htmlEntitiesRegex,function(c,l){return String.fromCharCode(l)})}function i(o){return URL.canParse(o)}function n(o){try{return decodeURIComponent(o)}catch{return o}}function a(o){if(!o)return e.BLANK_URL;var s,c=n(o.trim());do c=r(c).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),c=n(c),s=c.match(e.ctrlCharactersRegex)||c.match(e.htmlEntitiesRegex)||c.match(e.htmlCtrlEntityRegex)||c.match(e.whitespaceEscapeCharsRegex);while(s&&s.length>0);var l=c;if(!l)return e.BLANK_URL;if(t(l))return l;var h=l.trimStart(),u=h.match(e.urlSchemeRegex);if(!u)return l;var f=u[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var d=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return d;if(f==="http:"||f==="https:"){if(!i(d))return e.BLANK_URL;var p=new URL(d);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return d}return qi.sanitizeUrl=a,qi}var N1=P1();function fa(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function z1(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Xl(e){let t,r,i;e.length!==2?(t=fa,r=(s,c)=>fa(e(s),c),i=(s,c)=>e(s)-c):(t=e===fa||e===z1?e:W1,r=e,i=e);function n(s,c,l=0,h=s.length){if(l>>1;r(s[u],c)<0?l=u+1:h=u}while(l>>1;r(s[u],c)<=0?l=u+1:h=u}while(ll&&i(s[u-1],c)>-i(s[u],c)?u-1:u}return{left:n,center:o,right:a}}function W1(){return 0}function q1(e){return e===null?NaN:+e}const H1=Xl(fa),U1=H1.right;Xl(q1).center;class kh extends Map{constructor(t,r=G1){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[i,n]of t)this.set(i,n)}get(t){return super.get(vh(this,t))}has(t){return super.has(vh(this,t))}set(t,r){return super.set(Y1(this,t),r)}delete(t){return super.delete(j1(this,t))}}function vh({_intern:e,_key:t},r){const i=t(r);return e.has(i)?e.get(i):r}function Y1({_intern:e,_key:t},r){const i=t(r);return e.has(i)?e.get(i):(e.set(i,r),r)}function j1({_intern:e,_key:t},r){const i=t(r);return e.has(i)&&(r=e.get(r),e.delete(i)),r}function G1(e){return e!==null&&typeof e=="object"?e.valueOf():e}const V1=Math.sqrt(50),X1=Math.sqrt(10),Z1=Math.sqrt(2);function Oa(e,t,r){const i=(t-e)/Math.max(0,r),n=Math.floor(Math.log10(i)),a=i/Math.pow(10,n),o=a>=V1?10:a>=X1?5:a>=Z1?2:1;let s,c,l;return n<0?(l=Math.pow(10,-n)/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=Math.pow(10,n)*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];const i=t=n))return[];const s=a-n+1,c=new Array(s);if(i)if(o<0)for(let l=0;l=i)&&(r=i);else{let i=-1;for(let n of e)(n=t(n,++i,e))!=null&&(r=n)&&(r=n)}return r}function Z$(e,t){let r;if(t===void 0)for(const i of e)i!=null&&(r>i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let n of e)(n=t(n,++i,e))!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}return r}function Q1(e,t,r){e=+e,t=+t,r=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+r;for(var i=-1,n=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(n);++i+e(t)}function i2(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function n2(){return!this.__axis}function fp(e,t){var r=[],i=null,n=null,a=6,o=6,s=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===da||e===Vn?-1:1,h=e===Vn||e===ao?"x":"y",u=e===da||e===rl?t2:e2;function f(d){var p=i??(t.ticks?t.ticks.apply(t,r):t.domain()),m=n??(t.tickFormat?t.tickFormat.apply(t,r):J1),y=Math.max(a,0)+s,x=t.range(),b=+x[0]+c,C=+x[x.length-1]+c,k=(t.bandwidth?i2:r2)(t.copy(),c),w=d.selection?d.selection():d,_=w.selectAll(".domain").data([null]),v=w.selectAll(".tick").data(p,t).order(),D=v.exit(),N=v.enter().append("g").attr("class","tick"),O=v.select("line"),T=v.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(N),O=O.merge(N.append("line").attr("stroke","currentColor").attr(h+"2",l*a)),T=T.merge(N.append("text").attr("fill","currentColor").attr(h,l*y).attr("dy",e===da?"0em":e===rl?"0.71em":"0.32em")),d!==w&&(_=_.transition(d),v=v.transition(d),O=O.transition(d),T=T.transition(d),D=D.transition(d).attr("opacity",Sh).attr("transform",function(R){return isFinite(R=k(R))?u(R+c):this.getAttribute("transform")}),N.attr("opacity",Sh).attr("transform",function(R){var L=this.parentNode.__axis;return u((L&&isFinite(L=L(R))?L:k(R))+c)})),D.remove(),_.attr("d",e===Vn||e===ao?o?"M"+l*o+","+b+"H"+c+"V"+C+"H"+l*o:"M"+c+","+b+"V"+C:o?"M"+b+","+l*o+"V"+c+"H"+C+"V"+l*o:"M"+b+","+c+"H"+C),v.attr("opacity",1).attr("transform",function(R){return u(k(R)+c)}),O.attr(h+"2",l*a),T.attr(h,l*y).text(m),w.filter(n2).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ao?"start":e===Vn?"end":"middle"),w.each(function(){this.__axis=k})}return f.scale=function(d){return arguments.length?(t=d,f):t},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(d){return arguments.length?(r=d==null?[]:Array.from(d),f):r.slice()},f.tickValues=function(d){return arguments.length?(i=d==null?null:Array.from(d),f):i&&i.slice()},f.tickFormat=function(d){return arguments.length?(n=d,f):n},f.tickSize=function(d){return arguments.length?(a=o=+d,f):a},f.tickSizeInner=function(d){return arguments.length?(a=+d,f):a},f.tickSizeOuter=function(d){return arguments.length?(o=+d,f):o},f.tickPadding=function(d){return arguments.length?(s=+d,f):s},f.offset=function(d){return arguments.length?(c=+d,f):c},f}function K$(e){return fp(da,e)}function Q$(e){return fp(rl,e)}var a2={value:()=>{}};function dp(){for(var e=0,t=arguments.length,r={},i;e=0&&(i=r.slice(n+1),r=r.slice(0,n)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}pa.prototype=dp.prototype={constructor:pa,on:function(e,t){var r=this._,i=s2(e+"",r),n,a=-1,o=i.length;if(arguments.length<2){for(;++a0)for(var r=new Array(n),i=0,n,a;i=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Mh.hasOwnProperty(t)?{space:Mh[t],local:e}:e}function l2(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===il&&t.documentElement.namespaceURI===il?t.createElement(e):t.createElementNS(r,e)}}function c2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pp(e){var t=ks(e);return(t.local?c2:l2)(t)}function h2(){}function Zl(e){return e==null?h2:function(){return this.querySelector(e)}}function u2(e){typeof e!="function"&&(e=Zl(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n=C&&(C=b+1);!(w=y[C])&&++C=0;)(o=i[n])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function R2(e){e||(e=I2);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!f}for(var r=this._groups,i=r.length,n=new Array(i),a=0;at?1:e>=t?0:NaN}function P2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function N2(){return Array.from(this)}function z2(){for(var e=this._groups,t=0,r=e.length;t1?this.each((t==null?K2:typeof t=="function"?J2:Q2)(e,t,r??"")):Ci(this.node(),e)}function Ci(e,t){return e.style.getPropertyValue(t)||bp(e).getComputedStyle(e,null).getPropertyValue(t)}function e_(e){return function(){delete this[e]}}function r_(e,t){return function(){this[e]=t}}function i_(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function n_(e,t){return arguments.length>1?this.each((t==null?e_:typeof t=="function"?i_:r_)(e,t)):this.node()[e]}function _p(e){return e.trim().split(/^|\s+/)}function Kl(e){return e.classList||new Cp(e)}function Cp(e){this._node=e,this._names=_p(e.getAttribute("class")||"")}Cp.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wp(e,t){for(var r=Kl(e),i=-1,n=t.length;++i=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function F_(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,n=t.length,a;r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Xn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Xn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=W_.exec(e))?new Vt(t[1],t[2],t[3],1):(t=q_.exec(e))?new Vt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=H_.exec(e))?Xn(t[1],t[2],t[3],t[4]):(t=U_.exec(e))?Xn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Y_.exec(e))?Dh(t[1],t[2]/100,t[3]/100,1):(t=j_.exec(e))?Dh(t[1],t[2]/100,t[3]/100,t[4]):Ah.hasOwnProperty(e)?Eh(Ah[e]):e==="transparent"?new Vt(NaN,NaN,NaN,0):null}function Eh(e){return new Vt(e>>16&255,e>>8&255,e&255,1)}function Xn(e,t,r,i){return i<=0&&(e=t=r=NaN),new Vt(e,t,r,i)}function Tp(e){return e instanceof Ir||(e=Er(e)),e?(e=e.rgb(),new Vt(e.r,e.g,e.b,e.opacity)):new Vt}function nl(e,t,r,i){return arguments.length===1?Tp(e):new Vt(e,t,r,i??1)}function Vt(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}Fn(Vt,nl,vs(Ir,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_n:Math.pow(_n,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vt(Tr(this.r),Tr(this.g),Tr(this.b),Pa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fh,formatHex:Fh,formatHex8:X_,formatRgb:$h,toString:$h}));function Fh(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}`}function X_(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}${vr((isNaN(this.opacity)?1:this.opacity)*255)}`}function $h(){const e=Pa(this.opacity);return`${e===1?"rgb(":"rgba("}${Tr(this.r)}, ${Tr(this.g)}, ${Tr(this.b)}${e===1?")":`, ${e})`}`}function Pa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vr(e){return e=Tr(e),(e<16?"0":"")+e.toString(16)}function Dh(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ce(e,t,r,i)}function Mp(e){if(e instanceof Ce)return new Ce(e.h,e.s,e.l,e.opacity);if(e instanceof Ir||(e=Er(e)),!e)return new Ce;if(e instanceof Ce)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,n=Math.min(t,r,i),a=Math.max(t,r,i),o=NaN,s=a-n,c=(a+n)/2;return s?(t===a?o=(r-i)/s+(r0&&c<1?0:o,new Ce(o,s,c,e.opacity)}function Z_(e,t,r,i){return arguments.length===1?Mp(e):new Ce(e,t,r,i??1)}function Ce(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Fn(Ce,Z_,vs(Ir,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new Ce(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_n:Math.pow(_n,e),new Ce(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,n=2*r-i;return new Vt(so(e>=240?e-240:e+120,n,i),so(e,n,i),so(e<120?e+240:e-120,n,i),this.opacity)},clamp(){return new Ce(Oh(this.h),Zn(this.s),Zn(this.l),Pa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Pa(this.opacity);return`${e===1?"hsl(":"hsla("}${Oh(this.h)}, ${Zn(this.s)*100}%, ${Zn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Oh(e){return e=(e||0)%360,e<0?e+360:e}function Zn(e){return Math.max(0,Math.min(1,e||0))}function so(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const K_=Math.PI/180,Q_=180/Math.PI,Na=18,Ap=.96422,Lp=1,Bp=.82521,Ep=4/29,ai=6/29,Fp=3*ai*ai,J_=ai*ai*ai;function $p(e){if(e instanceof Oe)return new Oe(e.l,e.a,e.b,e.opacity);if(e instanceof Ye)return Dp(e);e instanceof Vt||(e=Tp(e));var t=ho(e.r),r=ho(e.g),i=ho(e.b),n=oo((.2225045*t+.7168786*r+.0606169*i)/Lp),a,o;return t===r&&r===i?a=o=n:(a=oo((.4360747*t+.3850649*r+.1430804*i)/Ap),o=oo((.0139322*t+.0971045*r+.7141733*i)/Bp)),new Oe(116*n-16,500*(a-n),200*(n-o),e.opacity)}function tC(e,t,r,i){return arguments.length===1?$p(e):new Oe(e,t,r,i??1)}function Oe(e,t,r,i){this.l=+e,this.a=+t,this.b=+r,this.opacity=+i}Fn(Oe,tC,vs(Ir,{brighter(e){return new Oe(this.l+Na*(e??1),this.a,this.b,this.opacity)},darker(e){return new Oe(this.l-Na*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=Ap*lo(t),e=Lp*lo(e),r=Bp*lo(r),new Vt(co(3.1338561*t-1.6168667*e-.4906146*r),co(-.9787684*t+1.9161415*e+.033454*r),co(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function oo(e){return e>J_?Math.pow(e,1/3):e/Fp+Ep}function lo(e){return e>ai?e*e*e:Fp*(e-Ep)}function co(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ho(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function eC(e){if(e instanceof Ye)return new Ye(e.h,e.c,e.l,e.opacity);if(e instanceof Oe||(e=$p(e)),e.a===0&&e.b===0)return new Ye(NaN,0()=>e;function Op(e,t){return function(r){return e+r*t}}function rC(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function iC(e,t){var r=t-e;return r?Op(e,r>180||r<-180?r-360*Math.round(r/360):r):Ss(isNaN(e)?t:e)}function nC(e){return(e=+e)==1?dn:function(t,r){return r-t?rC(t,r,e):Ss(isNaN(t)?r:t)}}function dn(e,t){var r=t-e;return r?Op(e,r):Ss(isNaN(e)?t:e)}const za=function e(t){var r=nC(t);function i(n,a){var o=r((n=nl(n)).r,(a=nl(a)).r),s=r(n.g,a.g),c=r(n.b,a.b),l=dn(n.opacity,a.opacity);return function(h){return n.r=o(h),n.g=s(h),n.b=c(h),n.opacity=l(h),n+""}}return i.gamma=e,i}(1);function aC(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,i=t.slice(),n;return function(a){for(n=0;nr&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,c.push({i:o,x:_e(i,n)})),r=uo.lastIndex;return r180?h+=360:h-l>180&&(l+=360),f.push({i:u.push(n(u)+"rotate(",null,i)-2,x:_e(l,h)})):h&&u.push(n(u)+"rotate("+h+i)}function s(l,h,u,f){l!==h?f.push({i:u.push(n(u)+"skewX(",null,i)-2,x:_e(l,h)}):h&&u.push(n(u)+"skewX("+h+i)}function c(l,h,u,f,d,p){if(l!==u||h!==f){var m=d.push(n(d)+"scale(",null,",",null,")");p.push({i:m-4,x:_e(l,u)},{i:m-2,x:_e(h,f)})}else(u!==1||f!==1)&&d.push(n(d)+"scale("+u+","+f+")")}return function(l,h){var u=[],f=[];return l=e(l),h=e(h),a(l.translateX,l.translateY,h.translateX,h.translateY,u,f),o(l.rotate,h.rotate,u,f),s(l.skewX,h.skewX,u,f),c(l.scaleX,l.scaleY,h.scaleX,h.scaleY,u,f),l=h=null,function(d){for(var p=-1,m=f.length,y;++p=0&&e._call.call(void 0,t),e=e._next;--wi}function Ih(){Fr=(qa=wn.now())+Ts,wi=nn=0;try{bC()}finally{wi=0,CC(),Fr=0}}function _C(){var e=wn.now(),t=e-qa;t>Np&&(Ts-=t,qa=e)}function CC(){for(var e,t=Wa,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Wa=r);an=e,ll(i)}function ll(e){if(!wi){nn&&(nn=clearTimeout(nn));var t=e-Fr;t>24?(e<1/0&&(nn=setTimeout(Ih,e-wn.now()-Ts)),Hi&&(Hi=clearInterval(Hi))):(Hi||(qa=wn.now(),Hi=setInterval(_C,Np)),wi=1,zp(Ih))}}function Ph(e,t,r){var i=new Ha;return t=t==null?0:+t,i.restart(n=>{i.stop(),e(n+t)},t,r),i}var wC=dp("start","end","cancel","interrupt"),kC=[],qp=0,Nh=1,cl=2,ga=3,zh=4,hl=5,ma=6;function Ms(e,t,r,i,n,a){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;vC(e,r,{name:t,index:i,group:n,on:wC,tween:kC,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:qp})}function tc(e,t){var r=Se(e,t);if(r.state>qp)throw new Error("too late; already scheduled");return r}function Ie(e,t){var r=Se(e,t);if(r.state>ga)throw new Error("too late; already running");return r}function Se(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function vC(e,t,r){var i=e.__transition,n;i[t]=r,r.timer=Wp(a,0,r.time);function a(l){r.state=Nh,r.timer.restart(o,r.delay,r.time),r.delay<=l&&o(l-r.delay)}function o(l){var h,u,f,d;if(r.state!==Nh)return c();for(h in i)if(d=i[h],d.name===r.name){if(d.state===ga)return Ph(o);d.state===zh?(d.state=ma,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[h]):+hcl&&i.state=0&&(t=t.slice(0,r)),!t||t==="start"})}function ew(e,t,r){var i,n,a=tw(t)?tc:Ie;return function(){var o=a(this,e),s=o.on;s!==i&&(n=(i=s).copy()).on(t,r),o.on=n}}function rw(e,t){var r=this._id;return arguments.length<2?Se(this.node(),r).on.on(e):this.each(ew(r,e,t))}function iw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function nw(){return this.on("end.remove",iw(this._id))}function aw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Zl(e));for(var i=this._groups,n=i.length,a=new Array(n),o=0;o=0))throw new Error(`invalid digits: ${e}`);if(t>15)return jp;const r=10**t;return function(i){this._+=i[0];for(let n=1,a=i.length;nxr)if(!(Math.abs(u*c-l*h)>xr)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let d=i-o,p=n-s,m=c*c+l*l,y=d*d+p*p,x=Math.sqrt(m),b=Math.sqrt(f),C=a*Math.tan((ul-Math.acos((m+f-y)/(2*x*b)))/2),k=C/b,w=C/x;Math.abs(k-1)>xr&&this._append`L${t+k*h},${r+k*u}`,this._append`A${a},${a},0,0,${+(u*d>h*p)},${this._x1=t+w*c},${this._y1=r+w*l}`}}arc(t,r,i,n,a,o){if(t=+t,r=+r,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(n),c=i*Math.sin(n),l=t+s,h=r+c,u=1^o,f=o?n-a:a-n;this._x1===null?this._append`M${l},${h}`:(Math.abs(this._x1-l)>xr||Math.abs(this._y1-h)>xr)&&this._append`L${l},${h}`,i&&(f<0&&(f=f%fl+fl),f>Bw?this._append`A${i},${i},0,1,${u},${t-s},${r-c}A${i},${i},0,1,${u},${this._x1=l},${this._y1=h}`:f>xr&&this._append`A${i},${i},0,${+(f>=ul)},${u},${this._x1=t+i*Math.cos(a)},${this._y1=r+i*Math.sin(a)}`)}rect(t,r,i,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+n}h${-i}Z`}toString(){return this._}}function $w(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ua(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,i=e.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+e.slice(r+1)]}function ki(e){return e=Ua(Math.abs(e)),e?e[1]:NaN}function Dw(e,t){return function(r,i){for(var n=r.length,a=[],o=0,s=e[0],c=0;n>0&&s>0&&(c+s+1>i&&(s=Math.max(1,i-c)),a.push(r.substring(n-=s,n+s)),!((c+=s+1)>i));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Ow(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Rw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ya(e){if(!(t=Rw.exec(e)))throw new Error("invalid format: "+e);var t;return new rc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ya.prototype=rc.prototype;function rc(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}rc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Iw(e){t:for(var t=e.length,r=1,i=-1,n;r0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(n+1):e}var Gp;function Pw(e,t){var r=Ua(e,t);if(!r)return e+"";var i=r[0],n=r[1],a=n-(Gp=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+Ua(e,Math.max(0,t+a-1))[0]}function Wh(e,t){var r=Ua(e,t);if(!r)return e+"";var i=r[0],n=r[1];return n<0?"0."+new Array(-n).join("0")+i:i.length>n+1?i.slice(0,n+1)+"."+i.slice(n+1):i+new Array(n-i.length+2).join("0")}const qh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$w,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Wh(e*100,t),r:Wh,s:Pw,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Hh(e){return e}var Uh=Array.prototype.map,Yh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nw(e){var t=e.grouping===void 0||e.thousands===void 0?Hh:Dw(Uh.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",n=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Hh:Ow(Uh.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(u){u=Ya(u);var f=u.fill,d=u.align,p=u.sign,m=u.symbol,y=u.zero,x=u.width,b=u.comma,C=u.precision,k=u.trim,w=u.type;w==="n"?(b=!0,w="g"):qh[w]||(C===void 0&&(C=12),k=!0,w="g"),(y||f==="0"&&d==="=")&&(y=!0,f="0",d="=");var _=m==="$"?r:m==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",v=m==="$"?i:/[%p]/.test(w)?o:"",D=qh[w],N=/[defgprs%]/.test(w);C=C===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function O(T){var R=_,L=v,M,F,B;if(w==="c")L=D(T)+L,T="";else{T=+T;var $=T<0||1/T<0;if(T=isNaN(T)?c:D(Math.abs(T),C),k&&(T=Iw(T)),$&&+T==0&&p!=="+"&&($=!1),R=($?p==="("?p:s:p==="-"||p==="("?"":p)+R,L=(w==="s"?Yh[8+Gp/3]:"")+L+($&&p==="("?")":""),N){for(M=-1,F=T.length;++MB||B>57){L=(B===46?n+T.slice(M+1):T.slice(M))+L,T=T.slice(0,M);break}}}b&&!y&&(T=t(T,1/0));var E=R.length+T.length+L.length,q=E>1)+R+T+L+q.slice(E);break;default:T=q+R+T+L;break}return a(T)}return O.toString=function(){return u+""},O}function h(u,f){var d=l((u=Ya(u),u.type="f",u)),p=Math.max(-8,Math.min(8,Math.floor(ki(f)/3)))*3,m=Math.pow(10,-p),y=Yh[8+p/3];return function(x){return d(m*x)+y}}return{format:l,formatPrefix:h}}var Qn,Vp,Xp;zw({thousands:",",grouping:[3],currency:["$",""]});function zw(e){return Qn=Nw(e),Vp=Qn.format,Xp=Qn.formatPrefix,Qn}function Ww(e){return Math.max(0,-ki(Math.abs(e)))}function qw(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ki(t)/3)))*3-ki(Math.abs(e)))}function Hw(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ki(t)-ki(e))+1}function Uw(e){var t=0,r=e.children,i=r&&r.length;if(!i)t=1;else for(;--i>=0;)t+=r[i].value;e.value=t}function Yw(){return this.eachAfter(Uw)}function jw(e,t){let r=-1;for(const i of this)e.call(t,i,++r,this);return this}function Gw(e,t){for(var r=this,i=[r],n,a,o=-1;r=i.pop();)if(e.call(t,r,++o,this),n=r.children)for(a=n.length-1;a>=0;--a)i.push(n[a]);return this}function Vw(e,t){for(var r=this,i=[r],n=[],a,o,s,c=-1;r=i.pop();)if(n.push(r),a=r.children)for(o=0,s=a.length;o=0;)r+=i[n].value;t.value=r})}function Kw(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Qw(e){for(var t=this,r=Jw(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var n=i.length;e!==r;)i.splice(n,0,e),e=e.parent;return i}function Jw(e,t){if(e===t)return e;var r=e.ancestors(),i=t.ancestors(),n=null;for(e=r.pop(),t=i.pop();e===t;)n=e,e=r.pop(),t=i.pop();return n}function tk(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function ek(){return Array.from(this)}function rk(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function ik(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t}function*nk(){var e=this,t,r=[e],i,n,a;do for(t=r.reverse(),r=[];e=t.pop();)if(yield e,i=e.children)for(n=0,a=i.length;n=0;--s)n.push(a=o[s]=new ja(o[s])),a.parent=i,a.depth=i.depth+1;return r.eachBefore(ck)}function ak(){return Zp(this).eachBefore(lk)}function sk(e){return e.children}function ok(e){return Array.isArray(e)?e[1]:null}function lk(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function ck(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ja(e){this.data=e,this.depth=this.height=0,this.parent=null}ja.prototype=Zp.prototype={constructor:ja,count:Yw,each:jw,eachAfter:Vw,eachBefore:Gw,find:Xw,sum:Zw,sort:Kw,path:Qw,ancestors:tk,descendants:ek,leaves:rk,links:ik,copy:ak,[Symbol.iterator]:nk};function hk(e){if(typeof e!="function")throw new Error;return e}function Ui(){return 0}function Yi(e){return function(){return e}}function uk(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function fk(e,t,r,i,n){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-t)/e.value;++sb&&(b=l),_=y*y*w,C=Math.max(b/_,_/x),C>k){y-=l;break}k=C}o.push(c={value:y,dice:d1?i:1)},r}(pk);function t3(){var e=mk,t=!1,r=1,i=1,n=[0],a=Ui,o=Ui,s=Ui,c=Ui,l=Ui;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=i,f.eachBefore(u),n=[0],t&&f.eachBefore(uk),f}function u(f){var d=n[f.depth],p=f.x0+d,m=f.y0+d,y=f.x1-d,x=f.y1-d;yt&&(r=e,e=t,t=r),function(i){return Math.max(e,Math.min(t,i))}}function Ck(e,t,r){var i=e[0],n=e[1],a=t[0],o=t[1];return n2?wk:Ck,c=l=null,u}function u(f){return f==null||isNaN(f=+f)?a:(c||(c=s(e.map(i),t,r)))(i(o(f)))}return u.invert=function(f){return o(n((l||(l=s(t,e.map(i),_e)))(f)))},u.domain=function(f){return arguments.length?(e=Array.from(f,bk),h()):e.slice()},u.range=function(f){return arguments.length?(t=Array.from(f),h()):t.slice()},u.rangeRound=function(f){return t=Array.from(f),r=fC,h()},u.clamp=function(f){return arguments.length?(o=f?!0:ti,h()):o!==ti},u.interpolate=function(f){return arguments.length?(r=f,h()):r},u.unknown=function(f){return arguments.length?(a=f,u):a},function(f,d){return i=f,n=d,h()}}function Jp(){return kk()(ti,ti)}function vk(e,t,r,i){var n=el(e,t,r),a;switch(i=Ya(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(a=qw(n,o))&&(i.precision=a),Xp(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(a=Hw(n,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=a-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(a=Ww(n))&&(i.precision=a-(i.type==="%")*2);break}}return Vp(i)}function Sk(e){var t=e.domain;return e.ticks=function(r){var i=t();return K1(i[0],i[i.length-1],r??10)},e.tickFormat=function(r,i){var n=t();return vk(n[0],n[n.length-1],r??10,i)},e.nice=function(r){r==null&&(r=10);var i=t(),n=0,a=i.length-1,o=i[n],s=i[a],c,l,h=10;for(s0;){if(l=tl(o,s,r),l===c)return i[n]=o,i[a]=s,t(i);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Tk(){var e=Jp();return e.copy=function(){return Qp(e,Tk())},As.apply(e,arguments),Sk(e)}function Mk(e,t){e=e.slice();var r=0,i=e.length-1,n=e[r],a=e[i],o;return a(e(a=new Date(+a)),a),n.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),n.round=a=>{const o=n(a),s=n.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),n.range=(a,o,s)=>{const c=[];if(a=n.ceil(a),s=s==null?1:Math.floor(s),!(a0))return c;let l;do c.push(l=new Date(+a)),t(a,s),e(a);while(lOt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(n.count=(a,o)=>(fo.setTime(+a),po.setTime(+o),e(fo),e(po),Math.floor(r(fo,po))),n.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?n.filter(i?o=>i(o)%a===0:o=>n.count(0,o)%a===0):n)),n}const Ga=Ot(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ga.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ot(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Ga);Ga.range;const je=1e3,me=je*60,Ge=me*60,Je=Ge*24,ic=Je*7,Vh=Je*30,go=Je*365,ei=Ot(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*je)},(e,t)=>(t-e)/je,e=>e.getUTCSeconds());ei.range;const nc=Ot(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*je)},(e,t)=>{e.setTime(+e+t*me)},(e,t)=>(t-e)/me,e=>e.getMinutes());nc.range;const Ak=Ot(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*me)},(e,t)=>(t-e)/me,e=>e.getUTCMinutes());Ak.range;const ac=Ot(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*je-e.getMinutes()*me)},(e,t)=>{e.setTime(+e+t*Ge)},(e,t)=>(t-e)/Ge,e=>e.getHours());ac.range;const Lk=Ot(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ge)},(e,t)=>(t-e)/Ge,e=>e.getUTCHours());Lk.range;const $n=Ot(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*me)/Je,e=>e.getDate()-1);$n.range;const sc=Ot(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Je,e=>e.getUTCDate()-1);sc.range;const Bk=Ot(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Je,e=>Math.floor(e/Je));Bk.range;function Pr(e){return Ot(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*me)/ic)}const Ls=Pr(0),Va=Pr(1),Ek=Pr(2),Fk=Pr(3),vi=Pr(4),$k=Pr(5),Dk=Pr(6);Ls.range;Va.range;Ek.range;Fk.range;vi.range;$k.range;Dk.range;function Nr(e){return Ot(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ic)}const tg=Nr(0),Xa=Nr(1),Ok=Nr(2),Rk=Nr(3),Si=Nr(4),Ik=Nr(5),Pk=Nr(6);tg.range;Xa.range;Ok.range;Rk.range;Si.range;Ik.range;Pk.range;const oc=Ot(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());oc.range;const Nk=Ot(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Nk.range;const tr=Ot(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());tr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ot(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});tr.range;const $r=Ot(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());$r.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ot(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});$r.range;function zk(e,t,r,i,n,a){const o=[[ei,1,je],[ei,5,5*je],[ei,15,15*je],[ei,30,30*je],[a,1,me],[a,5,5*me],[a,15,15*me],[a,30,30*me],[n,1,Ge],[n,3,3*Ge],[n,6,6*Ge],[n,12,12*Ge],[i,1,Je],[i,2,2*Je],[r,1,ic],[t,1,Vh],[t,3,3*Vh],[e,1,go]];function s(l,h,u){const f=hy).right(o,f);if(d===o.length)return e.every(el(l/go,h/go,u));if(d===0)return Ga.every(Math.max(el(l,h,u),1));const[p,m]=o[f/o[d-1][2]53)return null;"w"in P||(P.w=1),"Z"in P?(ft=yo(ji(P.y,0,1)),Pt=ft.getUTCDay(),ft=Pt>4||Pt===0?Xa.ceil(ft):Xa(ft),ft=sc.offset(ft,(P.V-1)*7),P.y=ft.getUTCFullYear(),P.m=ft.getUTCMonth(),P.d=ft.getUTCDate()+(P.w+6)%7):(ft=mo(ji(P.y,0,1)),Pt=ft.getDay(),ft=Pt>4||Pt===0?Va.ceil(ft):Va(ft),ft=$n.offset(ft,(P.V-1)*7),P.y=ft.getFullYear(),P.m=ft.getMonth(),P.d=ft.getDate()+(P.w+6)%7)}else("W"in P||"U"in P)&&("w"in P||(P.w="u"in P?P.u%7:"W"in P?1:0),Pt="Z"in P?yo(ji(P.y,0,1)).getUTCDay():mo(ji(P.y,0,1)).getDay(),P.m=0,P.d="W"in P?(P.w+6)%7+P.W*7-(Pt+5)%7:P.w+P.U*7-(Pt+6)%7);return"Z"in P?(P.H+=P.Z/100|0,P.M+=P.Z%100,yo(P)):mo(P)}}function D(z,j,et,P){for(var Tt=0,ft=j.length,Pt=et.length,Nt,ae;Tt=Pt)return-1;if(Nt=j.charCodeAt(Tt++),Nt===37){if(Nt=j.charAt(Tt++),ae=w[Nt in Xh?j.charAt(Tt++):Nt],!ae||(P=ae(z,et,P))<0)return-1}else if(Nt!=et.charCodeAt(P++))return-1}return P}function N(z,j,et){var P=l.exec(j.slice(et));return P?(z.p=h.get(P[0].toLowerCase()),et+P[0].length):-1}function O(z,j,et){var P=d.exec(j.slice(et));return P?(z.w=p.get(P[0].toLowerCase()),et+P[0].length):-1}function T(z,j,et){var P=u.exec(j.slice(et));return P?(z.w=f.get(P[0].toLowerCase()),et+P[0].length):-1}function R(z,j,et){var P=x.exec(j.slice(et));return P?(z.m=b.get(P[0].toLowerCase()),et+P[0].length):-1}function L(z,j,et){var P=m.exec(j.slice(et));return P?(z.m=y.get(P[0].toLowerCase()),et+P[0].length):-1}function M(z,j,et){return D(z,t,j,et)}function F(z,j,et){return D(z,r,j,et)}function B(z,j,et){return D(z,i,j,et)}function $(z){return o[z.getDay()]}function E(z){return a[z.getDay()]}function q(z){return c[z.getMonth()]}function Y(z){return s[z.getMonth()]}function U(z){return n[+(z.getHours()>=12)]}function pt(z){return 1+~~(z.getMonth()/3)}function ht(z){return o[z.getUTCDay()]}function kt(z){return a[z.getUTCDay()]}function nt(z){return c[z.getUTCMonth()]}function lt(z){return s[z.getUTCMonth()]}function ut(z){return n[+(z.getUTCHours()>=12)]}function Ct(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var j=_(z+="",C);return j.toString=function(){return z},j},parse:function(z){var j=v(z+="",!1);return j.toString=function(){return z},j},utcFormat:function(z){var j=_(z+="",k);return j.toString=function(){return z},j},utcParse:function(z){var j=v(z+="",!0);return j.toString=function(){return z},j}}}var Xh={"-":"",_:" ",0:"0"},It=/^\s*\d+/,Uk=/^%/,Yk=/[\\^$*+?|[\]().{}]/g;function yt(e,t,r){var i=e<0?"-":"",n=(i?-e:e)+"",a=n.length;return i+(a[t.toLowerCase(),r]))}function Gk(e,t,r){var i=It.exec(t.slice(r,r+1));return i?(e.w=+i[0],r+i[0].length):-1}function Vk(e,t,r){var i=It.exec(t.slice(r,r+1));return i?(e.u=+i[0],r+i[0].length):-1}function Xk(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.U=+i[0],r+i[0].length):-1}function Zk(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.V=+i[0],r+i[0].length):-1}function Kk(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.W=+i[0],r+i[0].length):-1}function Zh(e,t,r){var i=It.exec(t.slice(r,r+4));return i?(e.y=+i[0],r+i[0].length):-1}function Kh(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),r+i[0].length):-1}function Qk(e,t,r){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),r+i[0].length):-1}function Jk(e,t,r){var i=It.exec(t.slice(r,r+1));return i?(e.q=i[0]*3-3,r+i[0].length):-1}function tv(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.m=i[0]-1,r+i[0].length):-1}function Qh(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.d=+i[0],r+i[0].length):-1}function ev(e,t,r){var i=It.exec(t.slice(r,r+3));return i?(e.m=0,e.d=+i[0],r+i[0].length):-1}function Jh(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.H=+i[0],r+i[0].length):-1}function rv(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.M=+i[0],r+i[0].length):-1}function iv(e,t,r){var i=It.exec(t.slice(r,r+2));return i?(e.S=+i[0],r+i[0].length):-1}function nv(e,t,r){var i=It.exec(t.slice(r,r+3));return i?(e.L=+i[0],r+i[0].length):-1}function av(e,t,r){var i=It.exec(t.slice(r,r+6));return i?(e.L=Math.floor(i[0]/1e3),r+i[0].length):-1}function sv(e,t,r){var i=Uk.exec(t.slice(r,r+1));return i?r+i[0].length:-1}function ov(e,t,r){var i=It.exec(t.slice(r));return i?(e.Q=+i[0],r+i[0].length):-1}function lv(e,t,r){var i=It.exec(t.slice(r));return i?(e.s=+i[0],r+i[0].length):-1}function tu(e,t){return yt(e.getDate(),t,2)}function cv(e,t){return yt(e.getHours(),t,2)}function hv(e,t){return yt(e.getHours()%12||12,t,2)}function uv(e,t){return yt(1+$n.count(tr(e),e),t,3)}function eg(e,t){return yt(e.getMilliseconds(),t,3)}function fv(e,t){return eg(e,t)+"000"}function dv(e,t){return yt(e.getMonth()+1,t,2)}function pv(e,t){return yt(e.getMinutes(),t,2)}function gv(e,t){return yt(e.getSeconds(),t,2)}function mv(e){var t=e.getDay();return t===0?7:t}function yv(e,t){return yt(Ls.count(tr(e)-1,e),t,2)}function rg(e){var t=e.getDay();return t>=4||t===0?vi(e):vi.ceil(e)}function xv(e,t){return e=rg(e),yt(vi.count(tr(e),e)+(tr(e).getDay()===4),t,2)}function bv(e){return e.getDay()}function _v(e,t){return yt(Va.count(tr(e)-1,e),t,2)}function Cv(e,t){return yt(e.getFullYear()%100,t,2)}function wv(e,t){return e=rg(e),yt(e.getFullYear()%100,t,2)}function kv(e,t){return yt(e.getFullYear()%1e4,t,4)}function vv(e,t){var r=e.getDay();return e=r>=4||r===0?vi(e):vi.ceil(e),yt(e.getFullYear()%1e4,t,4)}function Sv(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yt(t/60|0,"0",2)+yt(t%60,"0",2)}function eu(e,t){return yt(e.getUTCDate(),t,2)}function Tv(e,t){return yt(e.getUTCHours(),t,2)}function Mv(e,t){return yt(e.getUTCHours()%12||12,t,2)}function Av(e,t){return yt(1+sc.count($r(e),e),t,3)}function ig(e,t){return yt(e.getUTCMilliseconds(),t,3)}function Lv(e,t){return ig(e,t)+"000"}function Bv(e,t){return yt(e.getUTCMonth()+1,t,2)}function Ev(e,t){return yt(e.getUTCMinutes(),t,2)}function Fv(e,t){return yt(e.getUTCSeconds(),t,2)}function $v(e){var t=e.getUTCDay();return t===0?7:t}function Dv(e,t){return yt(tg.count($r(e)-1,e),t,2)}function ng(e){var t=e.getUTCDay();return t>=4||t===0?Si(e):Si.ceil(e)}function Ov(e,t){return e=ng(e),yt(Si.count($r(e),e)+($r(e).getUTCDay()===4),t,2)}function Rv(e){return e.getUTCDay()}function Iv(e,t){return yt(Xa.count($r(e)-1,e),t,2)}function Pv(e,t){return yt(e.getUTCFullYear()%100,t,2)}function Nv(e,t){return e=ng(e),yt(e.getUTCFullYear()%100,t,2)}function zv(e,t){return yt(e.getUTCFullYear()%1e4,t,4)}function Wv(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Si(e):Si.ceil(e),yt(e.getUTCFullYear()%1e4,t,4)}function qv(){return"+0000"}function ru(){return"%"}function iu(e){return+e}function nu(e){return Math.floor(+e/1e3)}var Xr,ag;Hv({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Hv(e){return Xr=Hk(e),ag=Xr.format,Xr.parse,Xr.utcFormat,Xr.utcParse,Xr}function Uv(e){return new Date(e)}function Yv(e){return e instanceof Date?+e:+new Date(+e)}function sg(e,t,r,i,n,a,o,s,c,l){var h=Jp(),u=h.invert,f=h.domain,d=l(".%L"),p=l(":%S"),m=l("%I:%M"),y=l("%I %p"),x=l("%a %d"),b=l("%b %d"),C=l("%B"),k=l("%Y");function w(_){return(c(_)<_?d:s(_)<_?p:o(_)<_?m:a(_)<_?y:i(_)<_?n(_)<_?x:b:r(_)<_?C:k)(_)}return h.invert=function(_){return new Date(u(_))},h.domain=function(_){return arguments.length?f(Array.from(_,Yv)):f().map(Uv)},h.ticks=function(_){var v=f();return e(v[0],v[v.length-1],_??10)},h.tickFormat=function(_,v){return v==null?w:l(v)},h.nice=function(_){var v=f();return(!_||typeof _.range!="function")&&(_=t(v[0],v[v.length-1],_??10)),_?f(Mk(v,_)):h},h.copy=function(){return Qp(h,sg(e,t,r,i,n,a,o,s,c,l))},h}function e3(){return As.apply(sg(Wk,qk,tr,oc,Ls,$n,ac,nc,ei,ag).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function jv(e){for(var t=e.length/6|0,r=new Array(t),i=0;i1?0:e<-1?kn:Math.acos(e)}function su(e){return e>=1?Za:e<=-1?-Za:Math.asin(e)}function og(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new Fw(t)}function Xv(e){return e.innerRadius}function Zv(e){return e.outerRadius}function Kv(e){return e.startAngle}function Qv(e){return e.endAngle}function Jv(e){return e&&e.padAngle}function tS(e,t,r,i,n,a,o,s){var c=r-e,l=i-t,h=o-n,u=s-a,f=u*c-h*l;if(!(f*fM*M+F*F&&(D=O,N=T),{cx:D,cy:N,x01:-h,y01:-u,x11:D*(n/w-1),y11:N*(n/w-1)}}function i3(){var e=Xv,t=Zv,r=Lt(0),i=null,n=Kv,a=Qv,o=Jv,s=null,c=og(l);function l(){var h,u,f=+e.apply(this,arguments),d=+t.apply(this,arguments),p=n.apply(this,arguments)-Za,m=a.apply(this,arguments)-Za,y=au(m-p),x=m>p;if(s||(s=h=c()),dGt))s.moveTo(0,0);else if(y>ya-Gt)s.moveTo(d*mr(p),d*Le(p)),s.arc(0,0,d,p,m,!x),f>Gt&&(s.moveTo(f*mr(m),f*Le(m)),s.arc(0,0,f,m,p,x));else{var b=p,C=m,k=p,w=m,_=y,v=y,D=o.apply(this,arguments)/2,N=D>Gt&&(i?+i.apply(this,arguments):ri(f*f+d*d)),O=xo(au(d-f)/2,+r.apply(this,arguments)),T=O,R=O,L,M;if(N>Gt){var F=su(N/f*Le(D)),B=su(N/d*Le(D));(_-=F*2)>Gt?(F*=x?1:-1,k+=F,w-=F):(_=0,k=w=(p+m)/2),(v-=B*2)>Gt?(B*=x?1:-1,b+=B,C-=B):(v=0,b=C=(p+m)/2)}var $=d*mr(b),E=d*Le(b),q=f*mr(w),Y=f*Le(w);if(O>Gt){var U=d*mr(C),pt=d*Le(C),ht=f*mr(k),kt=f*Le(k),nt;if(yGt?R>Gt?(L=Jn(ht,kt,$,E,d,R,x),M=Jn(U,pt,q,Y,d,R,x),s.moveTo(L.cx+L.x01,L.cy+L.y01),RGt)||!(_>Gt)?s.lineTo(q,Y):T>Gt?(L=Jn(q,Y,U,pt,f,-T,x),M=Jn($,E,ht,kt,f,-T,x),s.lineTo(L.cx+L.x01,L.cy+L.y01),Te?1:t>=e?0:NaN}function aS(e){return e}function n3(){var e=aS,t=nS,r=null,i=Lt(0),n=Lt(ya),a=Lt(0);function o(s){var c,l=(s=lg(s)).length,h,u,f=0,d=new Array(l),p=new Array(l),m=+i.apply(this,arguments),y=Math.min(ya,Math.max(-ya,n.apply(this,arguments)-m)),x,b=Math.min(Math.abs(y)/l,a.apply(this,arguments)),C=b*(y<0?-1:1),k;for(c=0;c0&&(f+=k);for(t!=null?d.sort(function(w,_){return t(p[w],p[_])}):r!=null&&d.sort(function(w,_){return r(s[w],s[_])}),c=0,u=f?(y-l*C)/f:0;c0?k*u:0)+C,p[h]={data:s[h],index:c,value:k,startAngle:m,endAngle:x,padAngle:b};return p}return o.value=function(s){return arguments.length?(e=typeof s=="function"?s:Lt(+s),o):e},o.sortValues=function(s){return arguments.length?(t=s,r=null,o):t},o.sort=function(s){return arguments.length?(r=s,t=null,o):r},o.startAngle=function(s){return arguments.length?(i=typeof s=="function"?s:Lt(+s),o):i},o.endAngle=function(s){return arguments.length?(n=typeof s=="function"?s:Lt(+s),o):n},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:Lt(+s),o):a},o}class hg{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function ug(e){return new hg(e,!0)}function fg(e){return new hg(e,!1)}function cr(){}function Qa(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Bs(e){this._context=e}Bs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Qa(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Qa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xa(e){return new Bs(e)}function dg(e){this._context=e}dg.prototype={areaStart:cr,areaEnd:cr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Qa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sS(e){return new dg(e)}function pg(e){this._context=e}pg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:Qa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function oS(e){return new pg(e)}function gg(e,t){this._basis=new Bs(e),this._beta=t}gg.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],n=t[0],a=e[r]-i,o=t[r]-n,s=-1,c;++s<=r;)c=s/r,this._basis.point(this._beta*e[s]+(1-this._beta)*(i+c*a),this._beta*t[s]+(1-this._beta)*(n+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const lS=function e(t){function r(i){return t===1?new Bs(i):new gg(i,t)}return r.beta=function(i){return e(+i)},r}(.85);function Ja(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function lc(e,t){this._context=e,this._k=(1-t)/6}lc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ja(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Ja(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const mg=function e(t){function r(i){return new lc(i,t)}return r.tension=function(i){return e(+i)},r}(0);function cc(e,t){this._context=e,this._k=(1-t)/6}cc.prototype={areaStart:cr,areaEnd:cr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ja(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const cS=function e(t){function r(i){return new cc(i,t)}return r.tension=function(i){return e(+i)},r}(0);function hc(e,t){this._context=e,this._k=(1-t)/6}hc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ja(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const hS=function e(t){function r(i){return new hc(i,t)}return r.tension=function(i){return e(+i)},r}(0);function uc(e,t,r){var i=e._x1,n=e._y1,a=e._x2,o=e._y2;if(e._l01_a>Gt){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,n=(n*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>Gt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/h,o=(o*l+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,n,a,o,e._x2,e._y2)}function yg(e,t){this._context=e,this._alpha=t}yg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:uc(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const xg=function e(t){function r(i){return t?new yg(i,t):new lc(i,0)}return r.alpha=function(i){return e(+i)},r}(.5);function bg(e,t){this._context=e,this._alpha=t}bg.prototype={areaStart:cr,areaEnd:cr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:uc(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const uS=function e(t){function r(i){return t?new bg(i,t):new cc(i,0)}return r.alpha=function(i){return e(+i)},r}(.5);function _g(e,t){this._context=e,this._alpha=t}_g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:uc(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const fS=function e(t){function r(i){return t?new _g(i,t):new hc(i,0)}return r.alpha=function(i){return e(+i)},r}(.5);function Cg(e){this._context=e}Cg.prototype={areaStart:cr,areaEnd:cr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function dS(e){return new Cg(e)}function ou(e){return e<0?-1:1}function lu(e,t,r){var i=e._x1-e._x0,n=t-e._x1,a=(e._y1-e._y0)/(i||n<0&&-0),o=(r-e._y1)/(n||i<0&&-0),s=(a*n+o*i)/(i+n);return(ou(a)+ou(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function cu(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function bo(e,t,r){var i=e._x0,n=e._y0,a=e._x1,o=e._y1,s=(a-i)/3;e._context.bezierCurveTo(i+s,n+s*t,a-s,o-s*r,a,o)}function ts(e){this._context=e}ts.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:bo(this,this._t0,cu(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,bo(this,cu(this,r=lu(this,e,t)),r);break;default:bo(this,this._t0,r=lu(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function wg(e){this._context=new kg(e)}(wg.prototype=Object.create(ts.prototype)).point=function(e,t){ts.prototype.point.call(this,t,e)};function kg(e){this._context=e}kg.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,n,a){this._context.bezierCurveTo(t,e,i,r,a,n)}};function vg(e){return new ts(e)}function Sg(e){return new wg(e)}function Tg(e){this._context=e}Tg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=hu(e),n=hu(t),a=0,o=1;o=0;--t)n[t]=(o[t]-n[t+1])/a[t];for(a[r-1]=(e[r]+n[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Ag(e){return new Es(e,.5)}function Lg(e){return new Es(e,0)}function Bg(e){return new Es(e,1)}function sn(e,t,r){this.k=e,this.x=t,this.y=r}sn.prototype={constructor:sn,scale:function(e){return e===1?this:new sn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new sn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};sn.prototype;var Eg=typeof global=="object"&&global&&global.Object===Object&&global,pS=typeof self=="object"&&self&&self.Object===Object&&self,Pe=Eg||pS||Function("return this")(),es=Pe.Symbol,Fg=Object.prototype,gS=Fg.hasOwnProperty,mS=Fg.toString,Xi=es?es.toStringTag:void 0;function yS(e){var t=gS.call(e,Xi),r=e[Xi];try{e[Xi]=void 0;var i=!0}catch{}var n=mS.call(e);return i&&(t?e[Xi]=r:delete e[Xi]),n}var xS=Object.prototype,bS=xS.toString;function _S(e){return bS.call(e)}var CS="[object Null]",wS="[object Undefined]",uu=es?es.toStringTag:void 0;function Bi(e){return e==null?e===void 0?wS:CS:uu&&uu in Object(e)?yS(e):_S(e)}function zr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var kS="[object AsyncFunction]",vS="[object Function]",SS="[object GeneratorFunction]",TS="[object Proxy]";function fc(e){if(!zr(e))return!1;var t=Bi(e);return t==vS||t==SS||t==kS||t==TS}var _o=Pe["__core-js_shared__"],fu=function(){var e=/[^.]+$/.exec(_o&&_o.keys&&_o.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function MS(e){return!!fu&&fu in e}var AS=Function.prototype,LS=AS.toString;function Wr(e){if(e!=null){try{return LS.call(e)}catch{}try{return e+""}catch{}}return""}var BS=/[\\^$.*+?()[\]{}|]/g,ES=/^\[object .+?Constructor\]$/,FS=Function.prototype,$S=Object.prototype,DS=FS.toString,OS=$S.hasOwnProperty,RS=RegExp("^"+DS.call(OS).replace(BS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function IS(e){if(!zr(e)||MS(e))return!1;var t=fc(e)?RS:ES;return t.test(Wr(e))}function PS(e,t){return e==null?void 0:e[t]}function qr(e,t){var r=PS(e,t);return IS(r)?r:void 0}var vn=qr(Object,"create");function NS(){this.__data__=vn?vn(null):{},this.size=0}function zS(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var WS="__lodash_hash_undefined__",qS=Object.prototype,HS=qS.hasOwnProperty;function US(e){var t=this.__data__;if(vn){var r=t[e];return r===WS?void 0:r}return HS.call(t,e)?t[e]:void 0}var YS=Object.prototype,jS=YS.hasOwnProperty;function GS(e){var t=this.__data__;return vn?t[e]!==void 0:jS.call(t,e)}var VS="__lodash_hash_undefined__";function XS(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=vn&&t===void 0?VS:t,this}function Dr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}function rT(e,t){var r=this.__data__,i=$s(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function rr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=LT}function Rs(e){return e!=null&&Ig(e.length)&&!fc(e)}function BT(e){return On(e)&&Rs(e)}function ET(){return!1}var Pg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bu=Pg&&typeof module=="object"&&module&&!module.nodeType&&module,FT=bu&&bu.exports===Pg,_u=FT?Pe.Buffer:void 0,$T=_u?_u.isBuffer:void 0,pc=$T||ET,DT="[object Object]",OT=Function.prototype,RT=Object.prototype,Ng=OT.toString,IT=RT.hasOwnProperty,PT=Ng.call(Object);function NT(e){if(!On(e)||Bi(e)!=DT)return!1;var t=Og(e);if(t===null)return!0;var r=IT.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ng.call(r)==PT}var zT="[object Arguments]",WT="[object Array]",qT="[object Boolean]",HT="[object Date]",UT="[object Error]",YT="[object Function]",jT="[object Map]",GT="[object Number]",VT="[object Object]",XT="[object RegExp]",ZT="[object Set]",KT="[object String]",QT="[object WeakMap]",JT="[object ArrayBuffer]",tM="[object DataView]",eM="[object Float32Array]",rM="[object Float64Array]",iM="[object Int8Array]",nM="[object Int16Array]",aM="[object Int32Array]",sM="[object Uint8Array]",oM="[object Uint8ClampedArray]",lM="[object Uint16Array]",cM="[object Uint32Array]",St={};St[eM]=St[rM]=St[iM]=St[nM]=St[aM]=St[sM]=St[oM]=St[lM]=St[cM]=!0;St[zT]=St[WT]=St[JT]=St[qT]=St[tM]=St[HT]=St[UT]=St[YT]=St[jT]=St[GT]=St[VT]=St[XT]=St[ZT]=St[KT]=St[QT]=!1;function hM(e){return On(e)&&Ig(e.length)&&!!St[Bi(e)]}function uM(e){return function(t){return e(t)}}var zg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,pn=zg&&typeof module=="object"&&module&&!module.nodeType&&module,fM=pn&&pn.exports===zg,Co=fM&&Eg.process,Cu=function(){try{var e=pn&&pn.require&&pn.require("util").types;return e||Co&&Co.binding&&Co.binding("util")}catch{}}(),wu=Cu&&Cu.isTypedArray,gc=wu?uM(wu):hM;function gl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var dM=Object.prototype,pM=dM.hasOwnProperty;function gM(e,t,r){var i=e[t];(!(pM.call(e,t)&&Fs(i,r))||r===void 0&&!(t in e))&&dc(e,t,r)}function mM(e,t,r,i){var n=!r;r||(r={});for(var a=-1,o=t.length;++a-1&&e%1==0&&e0){if(++t>=$M)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var IM=RM(FM);function PM(e,t){return IM(BM(e,t,Ug),e+"")}function NM(e,t,r){if(!zr(r))return!1;var i=typeof t;return(i=="number"?Rs(r)&&Wg(t,r.length):i=="string"&&t in r)?Fs(r[t],e):!1}function zM(e){return PM(function(t,r){var i=-1,n=r.length,a=n>1?r[n-1]:void 0,o=n>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(n--,a):void 0,o&&NM(r[0],r[1],o)&&(a=n<3?void 0:a,n=1),t=Object(t);++is.args);Sa(o),i=Ht(i,[...o])}else i=r.args;if(!i)return;let n=Ol(e,t);const a="config";return i[a]!==void 0&&(n==="flowchart-v2"&&(n="flowchart"),i[n]=i[a],delete i[a]),i},"detectInit"),Yg=g(function(e,t=null){var r,i;try{const n=new RegExp(`[%]{2}(?![{]${UM.source})(?=[}][%]{2}).* `,"ig");e=e.trim().replace(n,"").replace(/'/gm,'"'),I.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let a;const o=[];for(;(a=un.exec(e))!==null;)if(a.index===un.lastIndex&&un.lastIndex++,a&&!t||t&&((r=a[1])!=null&&r.match(t))||t&&((i=a[2])!=null&&i.match(t))){const s=a[1]?a[1]:a[2],c=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;o.push({type:s,args:c})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(n){return I.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),jM=g(function(e){return e.replace(un,"")},"removeDirectives"),GM=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function mc(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return HM[r]??t}g(mc,"interpolateToCurve");function jg(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?N1.sanitizeUrl(r):r}g(jg,"formatUrl");var VM=g((e,...t)=>{const r=e.split("."),i=r.length-1,n=r[i];let a=window;for(let o=0;o{r+=yc(n,t),t=n});const i=r/2;return xc(e,i)}g(Gg,"traverseEdge");function Vg(e){return e.length===1?e[0]:Gg(e)}g(Vg,"calcLabelPosition");var vu=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),xc=g((e,t)=>{let r,i=t;for(const n of e){if(r){const a=yc(n,r);if(a===0)return r;if(a=1)return{x:n.x,y:n.y};if(o>0&&o<1)return{x:vu((1-o)*r.x+o*n.x,5),y:vu((1-o)*r.y+o*n.y,5)}}}r=n}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),XM=g((e,t,r)=>{I.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const n=xc(t,25),a=e?10:5,o=Math.atan2(t[0].y-n.y,t[0].x-n.x),s={x:0,y:0};return s.x=Math.sin(o)*a+(t[0].x+n.x)/2,s.y=-Math.cos(o)*a+(t[0].y+n.y)/2,s},"calcCardinalityPosition");function Xg(e,t,r){const i=structuredClone(r);I.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const n=25+e,a=xc(i,n),o=10+e*.5,s=Math.atan2(i[0].y-a.y,i[0].x-a.x),c={x:0,y:0};return t==="start_left"?(c.x=Math.sin(s+Math.PI)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s+Math.PI)*o+(i[0].y+a.y)/2):t==="end_right"?(c.x=Math.sin(s-Math.PI)*o+(i[0].x+a.x)/2-5,c.y=-Math.cos(s-Math.PI)*o+(i[0].y+a.y)/2-5):t==="end_left"?(c.x=Math.sin(s)*o+(i[0].x+a.x)/2-5,c.y=-Math.cos(s)*o+(i[0].y+a.y)/2-5):(c.x=Math.sin(s)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s)*o+(i[0].y+a.y)/2),c}g(Xg,"calcTerminalLabelPosition");function Zg(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}g(Zg,"getStylesFromArray");var Su=0,ZM=g(()=>(Su++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Su),"generateId");function Kg(e){let t="";const r="0123456789abcdef",i=r.length;for(let n=0;nKg(e.length),"random"),QM=g(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),JM=g(function(e,t){const r=t.text.replace(Ai.lineBreakRegex," "),[,i]=Is(t.fontSize),n=e.append("text");n.attr("x",t.x),n.attr("y",t.y),n.style("text-anchor",t.anchor),n.style("font-family",t.fontFamily),n.style("font-size",i),n.style("font-weight",t.fontWeight),n.attr("fill",t.fill),t.class!==void 0&&n.attr("class",t.class);const a=n.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(r),n},"drawSimpleText"),tA=Dn((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Ai.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),n=[];let a="";return i.forEach((o,s)=>{const c=er(`${o} `,r),l=er(a,r);if(c>t){const{hyphenatedStrings:f,remainingWord:d}=eA(o,t,"-",r);n.push(a,...f),a=d}else l+c>=t?(n.push(a),a=o):a=[a,o].filter(Boolean).join(" ");s+1===i.length&&n.push(a)}),n.filter(o=>o!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),eA=Dn((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const n=[...e],a=[];let o="";return n.forEach((s,c)=>{const l=`${o}${s}`;if(er(l,i)>=t){const u=c+1,f=n.length===u,d=`${l}${r}`;a.push(f?l:d),o=""}else o=l}),{hyphenatedStrings:a,remainingWord:o}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Qg(e,t){return bc(e,t).height}g(Qg,"calculateTextHeight");function er(e,t){return bc(e,t).width}g(er,"calculateTextWidth");var bc=Dn((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:n=400}=t;if(!e)return{width:0,height:0};const[,a]=Is(r),o=["sans-serif",i],s=e.split(Ai.lineBreakRegex),c=[],l=gt("body");if(!l.remove)return{width:0,height:0,lineHeight:0};const h=l.append("svg");for(const f of o){let d=0;const p={width:0,height:0,lineHeight:0};for(const m of s){const y=QM();y.text=m||qM;const x=JM(h,y).style("font-size",a).style("font-weight",n).style("font-family",f),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");p.width=Math.round(Math.max(p.width,b.width)),d=Math.round(b.height),p.height+=d,p.lineHeight=Math.round(Math.max(p.lineHeight,d))}c.push(p)}h.remove();const u=isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1;return c[u]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),pi,rA=(pi=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},g(pi,"InitIDGenerator"),pi),ta,iA=g(function(e){return ta=ta||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),ta.innerHTML=e,unescape(ta.textContent)},"entityDecode");function _c(e){return"str"in e}g(_c,"isDetailedError");var nA=g((e,t,r,i)=>{var a;if(!i)return;const n=(a=e.node())==null?void 0:a.getBBox();n&&e.append("text").text(i).attr("text-anchor","middle").attr("x",n.x+n.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Is=g(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Cc(e,t){return WM({},e,t)}g(Cc,"cleanAndMerge");var $e={assignWithDepth:Ht,wrapLabel:tA,calculateTextHeight:Qg,calculateTextWidth:er,calculateTextDimensions:bc,cleanAndMerge:Cc,detectInit:YM,detectDirective:Yg,isSubstringInArray:GM,interpolateToCurve:mc,calcLabelPosition:Vg,calcCardinalityPosition:XM,calcTerminalLabelPosition:Xg,formatUrl:jg,getStylesFromArray:Zg,generateId:ZM,random:KM,runFunc:VM,entityDecode:iA,insertTitle:nA,parseFontSize:Is,InitIDGenerator:rA},aA=g(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),Hr=g(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),a3=g((e,t,{counter:r=0,prefix:i,suffix:n},a)=>a||`${i?`${i}_`:""}${e}_${t}_${r}${n?`_${n}`:""}`,"getEdgeId");function re(e){return e??null}g(re,"handleUndefinedAttr");const sA=Object.freeze({left:0,top:0,width:16,height:16}),as=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Jg=Object.freeze({...sA,...as}),oA=Object.freeze({...Jg,body:"",hidden:!1}),lA=Object.freeze({width:null,height:null}),cA=Object.freeze({...lA,...as}),hA=(e,t,r,i="")=>{const n=e.split(":");if(e.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const s=n.pop(),c=n.pop(),l={provider:n.length>0?n[0]:i,prefix:c,name:s};return wo(l)?l:null}const a=n[0],o=a.split("-");if(o.length>1){const s={provider:i,prefix:o.shift(),name:o.join("-")};return wo(s)?s:null}if(r&&i===""){const s={provider:i,prefix:"",name:a};return wo(s,r)?s:null}return null},wo=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function uA(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function Tu(e,t){const r=uA(e,t);for(const i in oA)i in as?i in e&&!(i in r)&&(r[i]=as[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function fA(e,t){const r=e.icons,i=e.aliases||Object.create(null),n=Object.create(null);function a(o){if(r[o])return n[o]=[];if(!(o in n)){n[o]=null;const s=i[o]&&i[o].parent,c=s&&a(s);c&&(n[o]=[s].concat(c))}return n[o]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(a),n}function Mu(e,t,r){const i=e.icons,n=e.aliases||Object.create(null);let a={};function o(s){a=Tu(i[s]||n[s],a)}return o(t),r.forEach(o),Tu(e,a)}function dA(e,t){if(e.icons[t])return Mu(e,t,[]);const r=fA(e,[t])[t];return r?Mu(e,t,r):null}const pA=/(-?[0-9.]*[0-9]+[0-9.]*)/g,gA=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Au(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(pA);if(i===null||!i.length)return e;const n=[];let a=i.shift(),o=gA.test(a);for(;;){if(o){const s=parseFloat(a);isNaN(s)?n.push(a):n.push(Math.ceil(s*t*r)/r)}else n.push(a);if(a=i.shift(),a===void 0)return n.join("");o=!o}}function mA(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const n=e.indexOf(">",i),a=e.indexOf("",a);if(o===-1)break;r+=e.slice(n+1,a).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:r,content:e}}function yA(e,t){return e?""+e+""+t:t}function xA(e,t,r){const i=mA(e);return yA(i.defs,t+i.content+r)}const bA=e=>e==="unset"||e==="undefined"||e==="none";function _A(e,t){const r={...Jg,...e},i={...cA,...t},n={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,b=m.vFlip;let C=m.rotate;x?b?C+=2:(y.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),y.push("scale(-1 1)"),n.top=n.left=0):b&&(y.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),y.push("scale(1 -1)"),n.top=n.left=0);let k;switch(C<0&&(C-=Math.floor(C/4)*4),C=C%4,C){case 1:k=n.height/2+n.top,y.unshift("rotate(90 "+k.toString()+" "+k.toString()+")");break;case 2:y.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:k=n.width/2+n.left,y.unshift("rotate(-90 "+k.toString()+" "+k.toString()+")");break}C%2===1&&(n.left!==n.top&&(k=n.left,n.left=n.top,n.top=k),n.width!==n.height&&(k=n.width,n.width=n.height,n.height=k)),y.length&&(a=xA(a,'',""))});const o=i.width,s=i.height,c=n.width,l=n.height;let h,u;o===null?(u=s===null?"1em":s==="auto"?l:s,h=Au(u,c/l)):(h=o==="auto"?c:o,u=s===null?Au(h,l/c):s==="auto"?l:s);const f={},d=(m,y)=>{bA(y)||(f[m]=y.toString())};d("width",h),d("height",u);const p=[n.left,n.top,c,l];return f.viewBox=p.join(" "),{attributes:f,viewBox:p,body:a}}const CA=/\sid="(\S+)"/g,wA="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let kA=0;function vA(e,t=wA){const r=[];let i;for(;i=CA.exec(e);)r.push(i[1]);if(!r.length)return e;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(a=>{const o=typeof t=="function"?t(a):t+(kA++).toString(),s=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+o+n+"$3")}),e=e.replace(new RegExp(n,"g"),""),e}function SA(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'"+e+""}function wc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ur=wc();function tm(e){Ur=e}var gn={exec:()=>null};function _t(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(n,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(ee.caret,"$1"),r=r.replace(n,o),i},getRegex:()=>new RegExp(r,t)};return i}var ee={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:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},TA=/^(?:[ \t]*(?:\n|$))+/,MA=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,AA=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Rn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,LA=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,kc=/(?:[*+-]|\d{1,9}[.)])/,em=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rm=_t(em).replace(/bull/g,kc).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(),BA=_t(em).replace(/bull/g,kc).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(),vc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,EA=/^[^\n]+/,Sc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,FA=_t(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Sc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$A=_t(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,kc).getRegex(),Ps="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",Tc=/|$))/,DA=_t("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Tc).replace("tag",Ps).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),im=_t(vc).replace("hr",Rn).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ps).getRegex(),OA=_t(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",im).getRegex(),Mc={blockquote:OA,code:MA,def:FA,fences:AA,heading:LA,hr:Rn,html:DA,lheading:rm,list:$A,newline:TA,paragraph:im,table:gn,text:EA},Lu=_t("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Rn).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ps).getRegex(),RA={...Mc,lheading:BA,table:Lu,paragraph:_t(vc).replace("hr",Rn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Lu).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ps).getRegex()},IA={...Mc,html:_t(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Tc).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_t(vc).replace("hr",Rn).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",rm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},PA=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,NA=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,nm=/^( {2,}|\\)\n(?!\s*$)/,zA=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,om=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,YA=_t(om,"u").replace(/punct/g,Ns).getRegex(),jA=_t(om,"u").replace(/punct/g,sm).getRegex(),lm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",GA=_t(lm,"gu").replace(/notPunctSpace/g,am).replace(/punctSpace/g,Ac).replace(/punct/g,Ns).getRegex(),VA=_t(lm,"gu").replace(/notPunctSpace/g,HA).replace(/punctSpace/g,qA).replace(/punct/g,sm).getRegex(),XA=_t("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,am).replace(/punctSpace/g,Ac).replace(/punct/g,Ns).getRegex(),ZA=_t(/\\(punct)/,"gu").replace(/punct/g,Ns).getRegex(),KA=_t(/^<(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(),QA=_t(Tc).replace("(?:-->|$)","-->").getRegex(),JA=_t("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",QA).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ss=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,tL=_t(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ss).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cm=_t(/^!?\[(label)\]\[(ref)\]/).replace("label",ss).replace("ref",Sc).getRegex(),hm=_t(/^!?\[(ref)\](?:\[\])?/).replace("ref",Sc).getRegex(),eL=_t("reflink|nolink(?!\\()","g").replace("reflink",cm).replace("nolink",hm).getRegex(),Lc={_backpedal:gn,anyPunctuation:ZA,autolink:KA,blockSkip:UA,br:nm,code:NA,del:gn,emStrongLDelim:YA,emStrongRDelimAst:GA,emStrongRDelimUnd:XA,escape:PA,link:tL,nolink:hm,punctuation:WA,reflink:cm,reflinkSearch:eL,tag:JA,text:zA,url:gn},rL={...Lc,link:_t(/^!?\[(label)\]\((.*?)\)/).replace("label",ss).getRegex(),reflink:_t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ss).getRegex()},ml={...Lc,emStrongRDelimAst:VA,emStrongLDelim:jA,url:_t(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Bu=e=>nL[e];function Be(e,t){if(t){if(ee.escapeTest.test(e))return e.replace(ee.escapeReplace,Bu)}else if(ee.escapeTestNoEncode.test(e))return e.replace(ee.escapeReplaceNoEncode,Bu);return e}function Eu(e){try{e=encodeURI(e).replace(ee.percentDecode,"%")}catch{return null}return e}function Fu(e,t){var a;let r=e.replace(ee.findPipe,(o,s,c)=>{let l=!1,h=s;for(;--h>=0&&c[h]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ee.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!((a=i.at(-1))!=null&&a.trim())&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function $u(e,t,r,i,n){let a=t.href,o=t.title||null,s=e[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,c}function sL(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let n=i[1];return t.split(` `).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=n.length?a.slice(n.length):a}).join(` `)}var os=class{constructor(t){vt(this,"options");vt(this,"rules");vt(this,"lexer");this.options=t||Ur}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Ki(i,` `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],n=sL(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:n}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let n=Ki(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(i=n.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Ki(r[0],` `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Ki(r[0],` `).split(` `),n="",a="",o=[];for(;i.length>0;){let s=!1,c=[],l;for(l=0;l1,a={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let o=this.rules.other.listItemRegex(i),s=!1;for(;t;){let l=!1,h="",u="";if(!(r=o.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),d=t.split(` `,1)[0],p=!f.trim(),m=0;if(this.options.pedantic?(m=2,u=f.trimStart()):p?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=f.slice(m),m+=r[1].length),p&&this.rules.other.blankLine.test(d)&&(h+=d+` `,t=t.substring(d.length+1),l=!0),!l){let b=this.rules.other.nextBulletRegex(m),C=this.rules.other.hrRegex(m),k=this.rules.other.fencesBeginRegex(m),w=this.rules.other.headingBeginRegex(m),_=this.rules.other.htmlBeginRegex(m);for(;t;){let v=t.split(` `,1)[0],D;if(d=v,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),D=d):D=d.replace(this.rules.other.tabCharGlobal," "),k.test(d)||w.test(d)||_.test(d)||b.test(d)||C.test(d))break;if(D.search(this.rules.other.nonSpaceChar)>=m||!d.trim())u+=` `+D.slice(m);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(f)||w.test(f)||C.test(f))break;u+=` `+d}!p&&!d.trim()&&(p=!0),h+=v+` `,t=t.substring(v.length+1),f=D.slice(m)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(s=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(u),y&&(x=y[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:u,tokens:[]}),a.raw+=h}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let l=0;lf.type==="space"),u=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=u}if(a.loose)for(let l=0;l({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[h]})));return o}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===` `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=Ki(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=aL(r[2],"()");if(o===-2)return;if(o>-1){let s=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,s).trim(),r[3]=""}}let n=r[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],a=o[3])}else a=r[3]?r[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?n=n.slice(1):n=n.slice(1,-1)),$u(r,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let n=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[n.toLowerCase()];if(!a){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return $u(i,a,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||n[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!i||this.rules.inline.punctuation.exec(i))){let a=[...n[0]].length-1,o,s,c=a,l=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+a);(n=h.exec(r))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(s=[...o].length,n[3]||n[4]){c+=s;continue}else if((n[5]||n[6])&&a%3&&!((a+s)%3)){l+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c+l);let u=[...n[0]][0].length,f=t.slice(0,a+n.index+u+s);if(Math.min(a,s)%2){let p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}let d=f.slice(2,-2);return{type:"strong",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),a=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&a&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,n;return r[2]==="@"?(i=r[1],n="mailto:"+i):(i=r[1],n=i),{type:"link",raw:r[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(t){var i;let r;if(r=this.rules.inline.url.exec(t)){let n,a;if(r[2]==="@")n=r[0],a="mailto:"+n;else{let o;do o=r[0],r[0]=((i=this.rules.inline._backpedal.exec(r[0]))==null?void 0:i[0])??"";while(o!==r[0]);n=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Ve=class yl{constructor(t){vt(this,"tokens");vt(this,"options");vt(this,"state");vt(this,"tokenizer");vt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ur,this.options.tokenizer=this.options.tokenizer||new os,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ee,block:ea.normal,inline:Zi.normal};this.options.pedantic?(r.block=ea.pedantic,r.inline=Zi.pedantic):this.options.gfm&&(r.block=ea.gfm,this.options.breaks?r.inline=Zi.breaks:r.inline=Zi.gfm),this.tokenizer.rules=r}static get rules(){return{block:ea,inline:Zi}}static lex(t,r){return new yl(r).lex(t)}static lexInline(t,r){return new yl(r).inlineTokens(t)}lex(t){t=t.replace(ee.carriageReturn,` `),this.blockTokens(t,this.tokens);for(let r=0;r(s=l.call({lexer:this},t,r))?(t=t.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let l=r.at(-1);s.raw.length===1&&l!==void 0?l.raw+=` `:r.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(` `)?"":` `)+s.raw,l.text+=` `+s.text,this.inlineQueue.at(-1).src=l.text):r.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(` `)?"":` `)+s.raw,l.text+=` `+s.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),r.push(s);continue}let c=t;if((o=this.options.extensions)!=null&&o.startBlock){let l=1/0,h=t.slice(1),u;this.options.extensions.startBlock.forEach(f=>{u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=t.substring(0,l+1))}if(this.state.top&&(s=this.tokenizer.paragraph(c))){let l=r.at(-1);i&&(l==null?void 0:l.type)==="paragraph"?(l.raw+=(l.raw.endsWith(` `)?"":` `)+s.raw,l.text+=` `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(s),i=c.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(` `)?"":` `)+s.raw,l.text+=` `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(s);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var s,c,l;let i=t,n=null;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)h.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,n.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(n=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,o="";for(;t;){a||(o=""),a=!1;let h;if((c=(s=this.options.extensions)==null?void 0:s.inline)!=null&&c.some(f=>(h=f.call({lexer:this},t,r))?(t=t.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.escape(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.tag(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.link(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(h.raw.length);let f=r.at(-1);h.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=h.raw,f.text+=h.text):r.push(h);continue}if(h=this.tokenizer.emStrong(t,i,o)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.codespan(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.br(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.del(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.autolink(t)){t=t.substring(h.raw.length),r.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(t))){t=t.substring(h.raw.length),r.push(h);continue}let u=t;if((l=this.options.extensions)!=null&&l.startInline){let f=1/0,d=t.slice(1),p;this.options.extensions.startInline.forEach(m=>{p=m.call({lexer:this},d),typeof p=="number"&&p>=0&&(f=Math.min(f,p))}),f<1/0&&f>=0&&(u=t.substring(0,f+1))}if(h=this.tokenizer.inlineText(u)){t=t.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(o=h.raw.slice(-1)),a=!0;let f=r.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=h.raw,f.text+=h.text):r.push(h);continue}if(t){let f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return r}},ls=class{constructor(t){vt(this,"options");vt(this,"parser");this.options=t||Ur}space(t){return""}code({text:t,lang:r,escaped:i}){var o;let n=(o=(r||"").match(ee.notSpaceStart))==null?void 0:o[0],a=t.replace(ee.endingNewline,"")+` `;return n?'
'+(i?a:Be(a,!0))+`
`:"
"+(i?a:Be(a,!0))+`
`}blockquote({tokens:t}){return`
${this.parser.parse(t)}
`}html({text:t}){return t}heading({tokens:t,depth:r}){return`${this.parser.parseInline(t)} `}hr(t){return`
`}list(t){let r=t.ordered,i=t.start,n="";for(let s=0;s `+n+" `}listitem(t){var i;let r="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?((i=t.tokens[0])==null?void 0:i.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+" "+Be(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):r+=n+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`
  • ${r}
  • `}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    `}table(t){let r="",i="";for(let a=0;a${n}`),` `+r+` `+n+`
    `}tablerow({text:t}){return` ${t} `}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+` `}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${Be(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:r,tokens:i}){let n=this.parser.parseInline(i),a=Eu(t);if(a===null)return n;t=a;let o='
    ",o}image({href:t,title:r,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let a=Eu(t);if(a===null)return Be(i);t=a;let o=`${i}{let l=s[c].flat(1/0);i=i.concat(this.walkTokens(l,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let o=r.renderers[a.name];o?r.renderers[a.name]=function(...s){let c=a.renderer.apply(this,s);return c===!1&&(c=o.apply(this,s)),c}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=r[a.level];o?o.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),n.extensions=r),i.renderer){let a=this.defaults.renderer||new ls(this.defaults);for(let o in i.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,c=i.renderer[s],l=a[s];a[s]=(...h)=>{let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u||""}}n.renderer=a}if(i.tokenizer){let a=this.defaults.tokenizer||new os(this.defaults);for(let o in i.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,c=i.tokenizer[s],l=a[s];a[s]=(...h)=>{let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u}}n.tokenizer=a}if(i.hooks){let a=this.defaults.hooks||new ba;for(let o in i.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,c=i.hooks[s],l=a[s];ba.passThroughHooks.has(o)?a[s]=h=>{if(this.defaults.async)return Promise.resolve(c.call(a,h)).then(f=>l.call(a,f));let u=c.call(a,h);return l.call(a,u)}:a[s]=(...h)=>{let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u}}n.hooks=a}if(i.walkTokens){let a=this.defaults.walkTokens,o=i.walkTokens;n.walkTokens=function(s){let c=[];return c.push(o.call(this,s)),a&&(c=c.concat(a.call(this,s))),c}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Ve.lex(t,r??this.defaults)}parser(t,r){return Xe.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let n={...i},a={...this.defaults,...n},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&n.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=t);let s=a.hooks?a.hooks.provideLexer():t?Ve.lex:Ve.lexInline,c=a.hooks?a.hooks.provideParser():t?Xe.parse:Xe.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(r):r).then(l=>s(l,a)).then(l=>a.hooks?a.hooks.processAllTokens(l):l).then(l=>a.walkTokens?Promise.all(this.walkTokens(l,a.walkTokens)).then(()=>l):l).then(l=>c(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(o);try{a.hooks&&(r=a.hooks.preprocess(r));let l=s(r,a);a.hooks&&(l=a.hooks.processAllTokens(l)),a.walkTokens&&this.walkTokens(l,a.walkTokens);let h=c(l,a);return a.hooks&&(h=a.hooks.postprocess(h)),h}catch(l){return o(l)}}}onError(t,r){return i=>{if(i.message+=` Please report this to https://github.com/markedjs/marked.`,t){let n="

    An error occurred:

    "+Be(i.message+"",!0)+"
    ";return r?Promise.resolve(n):n}if(r)return Promise.reject(i);throw i}}},Or=new oL;function bt(e,t){return Or.parse(e,t)}bt.options=bt.setOptions=function(e){return Or.setOptions(e),bt.defaults=Or.defaults,tm(bt.defaults),bt};bt.getDefaults=wc;bt.defaults=Ur;bt.use=function(...e){return Or.use(...e),bt.defaults=Or.defaults,tm(bt.defaults),bt};bt.walkTokens=function(e,t){return Or.walkTokens(e,t)};bt.parseInline=Or.parseInline;bt.Parser=Xe;bt.parser=Xe.parse;bt.Renderer=ls;bt.TextRenderer=Bc;bt.Lexer=Ve;bt.lexer=Ve.lex;bt.Tokenizer=os;bt.Hooks=ba;bt.parse=bt;bt.options;bt.setOptions;bt.use;bt.walkTokens;bt.parseInline;Xe.parse;Ve.lex;function um(e){for(var t=[],r=1;r?',height:80,width:80},bl=new Map,fm=new Map,cL=g(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(I.debug("Registering icon pack:",t.name),"loader"in t)fm.set(t.name,t.loader);else if("icons"in t)bl.set(t.name,t.icons);else throw I.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),dm=g(async(e,t)=>{const r=hA(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let n=bl.get(i);if(!n){const o=fm.get(i);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{n={...await o(),prefix:i},bl.set(i,n)}catch(s){throw I.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=dA(n,r.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),hL=g(async e=>{try{return await dm(e),!0}catch{return!1}},"isIconAvailable"),In=g(async(e,t,r)=>{let i;try{i=await dm(e,t==null?void 0:t.fallbackPrefix)}catch(o){I.error(o),i=lL}const n=_A(i,t);return SA(vA(n.body),{...n.attributes,...r})},"getIconSVG");function pm(e,{markdownAutoWrap:t}){const i=e.replace(//g,` `).replace(/\n{2,}/g,` `),n=um(i);return t===!1?n.replace(/ /g," "):n}g(pm,"preprocessMarkdown");function gm(e,t={}){const r=pm(e,t),i=bt.lexer(r),n=[[]];let a=0;function o(s,c="normal"){s.type==="text"?s.text.split(` `).forEach((h,u)=>{u!==0&&(a++,n.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&n[a].push({content:f,type:c})})}):s.type==="strong"||s.type==="em"?s.tokens.forEach(l=>{o(l,s.type)}):s.type==="html"&&n[a].push({content:s.text,type:"normal"})}return g(o,"processNode"),i.forEach(s=>{var c;s.type==="paragraph"?(c=s.tokens)==null||c.forEach(l=>{o(l)}):s.type==="html"&&n[a].push({content:s.text,type:"normal"})}),n}g(gm,"markdownToLines");function mm(e,{markdownAutoWrap:t}={}){const r=bt.lexer(e);function i(n){var a,o,s;return n.type==="text"?t===!1?n.text.replace(/\n */g,"
    ").replace(/ /g," "):n.text.replace(/\n */g,"
    "):n.type==="strong"?`${(a=n.tokens)==null?void 0:a.map(i).join("")}`:n.type==="em"?`${(o=n.tokens)==null?void 0:o.map(i).join("")}`:n.type==="paragraph"?`

    ${(s=n.tokens)==null?void 0:s.map(i).join("")}

    `:n.type==="space"?"":n.type==="html"?`${n.text}`:n.type==="escape"?n.text:`Unsupported markdown: ${n.type}`}return g(i,"output"),r.map(i).join("")}g(mm,"markdownToHTML");function ym(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}g(ym,"splitTextToChars");function xm(e,t){const r=ym(t.content);return Ec(e,[],r,t.type)}g(xm,"splitWordToFitWidth");function Ec(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[n,...a]=r,o=[...t,n];return e([{content:o.join(""),type:i}])?Ec(e,o,a,i):(t.length===0&&n&&(t.push(n),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}g(Ec,"splitWordToFitWidthRecursion");function bm(e,t){if(e.some(({content:r})=>r.includes(` `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return cs(e,t)}g(bm,"splitLineToFitWidth");function cs(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let n="";e[0].content===" "&&(n=" ",e.shift());const a=e.shift()??{content:" ",type:"normal"},o=[...i];if(n!==""&&o.push({content:n,type:"normal"}),o.push(a),t(o))return cs(e,t,r,o);if(i.length>0)r.push(i),e.unshift(a);else if(a.content){const[s,c]=xm(t,a);r.push([s]),c.content&&e.unshift(c)}return cs(e,t,r)}g(cs,"splitLineToFitWidthRecursion");function _l(e,t){t&&e.attr("style",t)}g(_l,"applyStyle");async function _m(e,t,r,i,n=!1){const a=e.append("foreignObject");a.attr("width",`${10*r}px`),a.attr("height",`${10*r}px`);const o=a.append("xhtml:div");let s=t.label;t.label&&xi(t.label)&&(s=await Rl(t.label.replace(Ai.lineBreakRegex,` `),xt()));const c=t.isNode?"nodeLabel":"edgeLabel",l=o.append("span");l.html(s),_l(l,t.labelStyle),l.attr("class",`${c} ${i}`),_l(o,t.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",r+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),n&&o.attr("class","labelBkg");let h=o.node().getBoundingClientRect();return h.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),h=o.node().getBoundingClientRect()),a.node()}g(_m,"addHtmlSpan");function zs(e,t,r){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em")}g(zs,"createTspan");function Cm(e,t,r){const i=e.append("text"),n=zs(i,1,t);Ws(n,r);const a=n.node().getComputedTextLength();return i.remove(),a}g(Cm,"computeWidthOfText");function uL(e,t,r){var o;const i=e.append("text"),n=zs(i,1,t);Ws(n,[{content:r,type:"normal"}]);const a=(o=n.node())==null?void 0:o.getBoundingClientRect();return a&&i.remove(),a}g(uL,"computeDimensionOfText");function wm(e,t,r,i=!1){const a=t.append("g"),o=a.insert("rect").attr("class","background").attr("style","stroke: none"),s=a.append("text").attr("y","-10.1");let c=0;for(const l of r){const h=g(f=>Cm(a,1.1,f)<=e,"checkWidth"),u=h(l)?[l]:bm(l,h);for(const f of u){const d=zs(s,c,1.1);Ws(d,f),c++}}if(i){const l=s.node().getBBox(),h=2;return o.attr("x",l.x-h).attr("y",l.y-h).attr("width",l.width+2*h).attr("height",l.height+2*h),a.node()}else return s.node()}g(wm,"createFormattedText");function Ws(e,t){e.text(""),t.forEach((r,i)=>{const n=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?n.text(r.content):n.text(" "+r.content)})}g(Ws,"updateTextContentAndStyles");async function km(e){const t=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,n,a)=>(t.push((async()=>{const o=`${n}:${a}`;return await hL(o)?await In(o,void 0,{class:"label-icon"}):``})()),i));const r=await Promise.all(t);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>r.shift()??"")}g(km,"replaceIconSubstring");var dr=g(async(e,t="",{style:r="",isTitle:i=!1,classes:n="",useHtmlLabels:a=!0,isNode:o=!0,width:s=200,addSvgBackground:c=!1}={},l)=>{if(I.debug("XYZ createText",t,r,i,n,a,o,"addSvgBackground: ",c),a){const h=mm(t,l),u=await km(Hr(h)),f=t.replace(/\\\\/g,"\\"),d={isNode:o,label:xi(t)?f:u,labelStyle:r.replace("fill:","color:")};return await _m(e,d,s,n,c)}else{const h=t.replace(//g,"
    "),u=gm(h.replace("
    ","
    "),l),f=wm(s,e,u,t?c:!1);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const d=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");gt(f).attr("style",d)}else{const d=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");gt(f).select("rect").attr("style",d.replace(/background:/g,"fill:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");gt(f).select("text").attr("style",p)}return f}},"createText");function ko(e,t,r){if(e&&e.length){const[i,n]=t,a=Math.PI/180*r,o=Math.cos(a),s=Math.sin(a);for(const c of e){const[l,h]=c;c[0]=(l-i)*o-(h-n)*s+i,c[1]=(l-i)*s+(h-n)*o+n}}}function fL(e,t){return e[0]===t[0]&&e[1]===t[1]}function dL(e,t,r,i=1){const n=r,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,s=[0,0];if(n)for(const l of o)ko(l,s,n);const c=function(l,h,u){const f=[];for(const b of l){const C=[...b];fL(C[0],C[C.length-1])||C.push([C[0][0],C[0][1]]),C.length>2&&f.push(C)}const d=[];h=Math.max(h,.1);const p=[];for(const b of f)for(let C=0;Cb.yminC.ymin?1:b.xC.x?1:b.ymax===C.ymax?0:(b.ymax-C.ymax)/Math.abs(b.ymax-C.ymax)),!p.length)return d;let m=[],y=p[0].ymin,x=0;for(;m.length||p.length;){if(p.length){let b=-1;for(let C=0;Cy);C++)b=C;p.splice(0,b+1).forEach(C=>{m.push({s:y,edge:C})})}if(m=m.filter(b=>!(b.edge.ymax<=y)),m.sort((b,C)=>b.edge.x===C.edge.x?0:(b.edge.x-C.edge.x)/Math.abs(b.edge.x-C.edge.x)),(u!==1||x%h==0)&&m.length>1)for(let b=0;b=m.length)break;const k=m[b].edge,w=m[C].edge;d.push([[Math.round(k.x),y],[Math.round(w.x),y]])}y+=u,m.forEach(b=>{b.edge.x=b.edge.x+u*b.edge.islope}),x++}return d}(o,a,i);if(n){for(const l of o)ko(l,s,-n);(function(l,h,u){const f=[];l.forEach(d=>f.push(...d)),ko(f,h,u)})(c,s,-n)}return c}function Pn(e,t){var r;const i=t.hachureAngle+90;let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.round(Math.max(n,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=n),dL(e,n,i,a||1)}class Fc{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Pn(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],r));return i}}function qs(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class pL extends Fc{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const n=Pn(t,Object.assign({},r,{hachureGap:i})),a=Math.PI/180*r.hachureAngle,o=[],s=.5*i*Math.cos(a),c=.5*i*Math.sin(a);for(const[l,h]of n)qs([l,h])&&o.push([[l[0]-s,l[1]+c],[...h]],[[l[0]+s,l[1]-c],[...h]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}}class gL extends Fc{fillPolygons(t,r){const i=this._fillPolygons(t,r),n=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,n);return i.ops=i.ops.concat(a.ops),i}}class mL{constructor(t){this.helper=t}fillPolygons(t,r){const i=Pn(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const o=n/4;for(const s of t){const c=qs(s),l=c/n,h=Math.ceil(l)-1,u=c-h*n,f=(s[0][0]+s[1][0])/2-n/4,d=Math.min(s[0][1],s[1][1]);for(let p=0;p{const s=qs(o),c=Math.floor(s/(i+n)),l=(s+n-c*(i+n))/2;let h=o[0],u=o[1];h[0]>u[0]&&(h=o[1],u=o[0]);const f=Math.atan((u[1]-h[1])/(u[0]-h[0]));for(let d=0;d{const o=qs(a),s=Math.round(o/(2*r));let c=a[0],l=a[1];c[0]>l[0]&&(c=a[1],l=a[0]);const h=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let u=0;uh%2?l+r:l+t);a.push({key:"C",data:c}),t=c[4],r=c[5];break}case"Q":a.push({key:"Q",data:[...s]}),t=s[2],r=s[3];break;case"q":{const c=s.map((l,h)=>h%2?l+r:l+t);a.push({key:"Q",data:c}),t=c[2],r=c[3];break}case"A":a.push({key:"A",data:[...s]}),t=s[5],r=s[6];break;case"a":t+=s[5],r+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,r]});break;case"H":a.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...s]}),r=s[0];break;case"v":r+=s[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...s]}),t=s[2],r=s[3];break;case"s":{const c=s.map((l,h)=>h%2?l+r:l+t);a.push({key:"S",data:c}),t=c[2],r=c[3];break}case"T":a.push({key:"T",data:[...s]}),t=s[0],r=s[1];break;case"t":t+=s[0],r+=s[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=i,r=n}return a}function Sm(e){const t=[];let r="",i=0,n=0,a=0,o=0,s=0,c=0;for(const{key:l,data:h}of e){switch(l){case"M":t.push({key:"M",data:[...h]}),[i,n]=h,[a,o]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],n=h[5],s=h[2],c=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,n]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,n]});break;case"V":n=h[0],t.push({key:"L",data:[i,n]});break;case"S":{let u=0,f=0;r==="C"||r==="S"?(u=i+(i-s),f=n+(n-c)):(u=i,f=n),t.push({key:"C",data:[u,f,...h]}),s=h[0],c=h[1],i=h[2],n=h[3];break}case"T":{const[u,f]=h;let d=0,p=0;r==="Q"||r==="T"?(d=i+(i-s),p=n+(n-c)):(d=i,p=n);const m=i+2*(d-i)/3,y=n+2*(p-n)/3,x=u+2*(d-u)/3,b=f+2*(p-f)/3;t.push({key:"C",data:[m,y,x,b,u,f]}),s=d,c=p,i=u,n=f;break}case"Q":{const[u,f,d,p]=h,m=i+2*(u-i)/3,y=n+2*(f-n)/3,x=d+2*(u-d)/3,b=p+2*(f-p)/3;t.push({key:"C",data:[m,y,x,b,d,p]}),s=u,c=f,i=d,n=p;break}case"A":{const u=Math.abs(h[0]),f=Math.abs(h[1]),d=h[2],p=h[3],m=h[4],y=h[5],x=h[6];u===0||f===0?(t.push({key:"C",data:[i,n,y,x,y,x]}),i=y,n=x):(i!==y||n!==x)&&(Tm(i,n,y,x,u,f,d,p,m).forEach(function(b){t.push({key:"C",data:b})}),i=y,n=x);break}case"Z":t.push({key:"Z",data:[]}),i=a,n=o}r=l}return t}function Qi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Tm(e,t,r,i,n,a,o,s,c,l){const h=(u=o,Math.PI*u/180);var u;let f=[],d=0,p=0,m=0,y=0;if(l)[d,p,m,y]=l;else{[e,t]=Qi(e,t,-h),[r,i]=Qi(r,i,-h);const L=(e-r)/2,M=(t-i)/2;let F=L*L/(n*n)+M*M/(a*a);F>1&&(F=Math.sqrt(F),n*=F,a*=F);const B=n*n,$=a*a,E=B*$-B*M*M-$*L*L,q=B*M*M+$*L*L,Y=(s===c?-1:1)*Math.sqrt(Math.abs(E/q));m=Y*n*M/a+(e+r)/2,y=Y*-a*L/n+(t+i)/2,d=Math.asin(parseFloat(((t-y)/a).toFixed(9))),p=Math.asin(parseFloat(((i-y)/a).toFixed(9))),ep&&(d-=2*Math.PI),!c&&p>d&&(p-=2*Math.PI)}let x=p-d;if(Math.abs(x)>120*Math.PI/180){const L=p,M=r,F=i;p=c&&p>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,f=Tm(r=m+n*Math.cos(p),i=y+a*Math.sin(p),M,F,n,a,o,0,c,[p,L,m,y])}x=p-d;const b=Math.cos(d),C=Math.sin(d),k=Math.cos(p),w=Math.sin(p),_=Math.tan(x/4),v=4/3*n*_,D=4/3*a*_,N=[e,t],O=[e+v*C,t-D*b],T=[r+v*w,i-D*k],R=[r,i];if(O[0]=2*N[0]-O[0],O[1]=2*N[1]-O[1],l)return[O,T,R].concat(f);{f=[O,T,R].concat(f);const L=[];for(let M=0;M2){const n=[];for(let a=0;a2*Math.PI&&(d=0,p=2*Math.PI);const m=2*Math.PI/c.curveStepCount,y=Math.min(m/2,(p-d)/2),x=zu(y,l,h,u,f,d,p,1,c);if(!c.disableMultiStroke){const b=zu(y,l,h,u,f,d,p,1.5,c);x.push(...b)}return o&&(s?x.push(...hr(l,h,l+u*Math.cos(d),h+f*Math.sin(d),c),...hr(l,h,l+u*Math.cos(p),h+f*Math.sin(p),c)):x.push({op:"lineTo",data:[l,h]},{op:"lineTo",data:[l+u*Math.cos(d),h+f*Math.sin(d)]})),{type:"path",ops:x}}function Iu(e,t){const r=Sm(vm($c(e))),i=[];let n=[0,0],a=[0,0];for(const{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],n=[s[0],s[1]];break;case"L":i.push(...hr(a[0],a[1],s[0],s[1],t)),a=[s[0],s[1]];break;case"C":{const[c,l,h,u,f,d]=s;i.push(...kL(c,l,h,u,f,d,a,t)),a=[f,d];break}case"Z":i.push(...hr(a[0],a[1],n[0],n[1],t)),a=[n[0],n[1]]}return{type:"path",ops:i}}function To(e,t){const r=[];for(const i of e)if(i.length){const n=t.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+at(n,t),i[0][1]+at(n,t)]});for(let o=1;o500?.4:-.0016668*c+1.233334;let h=n.maxRandomnessOffset||0;h*h*100>s&&(h=c/10);const u=h/2,f=.2+.2*Lm(n);let d=n.bowing*n.maxRandomnessOffset*(i-t)/200,p=n.bowing*n.maxRandomnessOffset*(e-r)/200;d=at(d,n,l),p=at(p,n,l);const m=[],y=()=>at(u,n,l),x=()=>at(h,n,l),b=n.preserveVertices;return o?m.push({op:"move",data:[e+(b?0:y()),t+(b?0:y())]}):m.push({op:"move",data:[e+(b?0:at(h,n,l)),t+(b?0:at(h,n,l))]}),o?m.push({op:"bcurveTo",data:[d+e+(r-e)*f+y(),p+t+(i-t)*f+y(),d+e+2*(r-e)*f+y(),p+t+2*(i-t)*f+y(),r+(b?0:y()),i+(b?0:y())]}):m.push({op:"bcurveTo",data:[d+e+(r-e)*f+x(),p+t+(i-t)*f+x(),d+e+2*(r-e)*f+x(),p+t+2*(i-t)*f+x(),r+(b?0:x()),i+(b?0:x())]}),m}function ia(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+at(t,r),e[0][1]+at(t,r)]),i.push([e[0][0]+at(t,r),e[0][1]+at(t,r)]);for(let n=1;n3){const a=[],o=1-r.curveTightness;n.push({op:"move",data:[e[1][0],e[1][1]]});for(let s=1;s+21&&n.push(s)):n.push(s),n.push(e[t+3])}else{const c=e[t+0],l=e[t+1],h=e[t+2],u=e[t+3],f=br(c,l,.5),d=br(l,h,.5),p=br(h,u,.5),m=br(f,d,.5),y=br(d,p,.5),x=br(m,y,.5);kl([c,f,m,x],0,r,n),kl([x,y,p,u],0,r,n)}var a,o;return n}function SL(e,t){return fs(e,0,e.length,t)}function fs(e,t,r,i,n){const a=n||[],o=e[t],s=e[r-1];let c=0,l=1;for(let h=t+1;hc&&(c=u,l=h)}return Math.sqrt(c)>i?(fs(e,t,l+1,i,a),fs(e,l,r,i,a)):(a.length||a.push(o),a.push(s)),a}function Mo(e,t=.15,r){const i=[],n=(e.length-1)/3;for(let a=0;a0?fs(i,0,i.length,r):i}const ue="none";class ds{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,n,a){const o=this._o(a);return this._d("line",[Mm(t,r,i,n,o)],o)}rectangle(t,r,i,n,a){const o=this._o(a),s=[],c=wL(t,r,i,n,o);if(o.fill){const l=[[t,r],[t+i,r],[t+i,r+n],[t,r+n]];o.fillStyle==="solid"?s.push(To([l],o)):s.push(Zr([l],o))}return o.stroke!==ue&&s.push(c),this._d("rectangle",s,o)}ellipse(t,r,i,n,a){const o=this._o(a),s=[],c=Am(i,n,o),l=Cl(t,r,o,c);if(o.fill)if(o.fillStyle==="solid"){const h=Cl(t,r,o,c).opset;h.type="fillPath",s.push(h)}else s.push(Zr([l.estimatedPoints],o));return o.stroke!==ue&&s.push(l.opset),this._d("ellipse",s,o)}circle(t,r,i,n){const a=this.ellipse(t,r,i,i,n);return a.shape="circle",a}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[_a(t,!1,i)],i)}arc(t,r,i,n,a,o,s=!1,c){const l=this._o(c),h=[],u=Ru(t,r,i,n,a,o,s,!0,l);if(s&&l.fill)if(l.fillStyle==="solid"){const f=Object.assign({},l);f.disableMultiStroke=!0;const d=Ru(t,r,i,n,a,o,!0,!1,f);d.type="fillPath",h.push(d)}else h.push(function(f,d,p,m,y,x,b){const C=f,k=d;let w=Math.abs(p/2),_=Math.abs(m/2);w+=at(.01*w,b),_+=at(.01*_,b);let v=y,D=x;for(;v<0;)v+=2*Math.PI,D+=2*Math.PI;D-v>2*Math.PI&&(v=0,D=2*Math.PI);const N=(D-v)/b.curveStepCount,O=[];for(let T=v;T<=D;T+=N)O.push([C+w*Math.cos(T),k+_*Math.sin(T)]);return O.push([C+w*Math.cos(D),k+_*Math.sin(D)]),O.push([C,k]),Zr([O],b)}(t,r,i,n,a,o,l));return l.stroke!==ue&&h.push(u),this._d("arc",h,l)}curve(t,r){const i=this._o(r),n=[],a=Ou(t,i);if(i.fill&&i.fill!==ue)if(i.fillStyle==="solid"){const o=Ou(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],s=t;if(s.length){const c=typeof s[0][0]=="number"?[s]:s;for(const l of c)l.length<3?o.push(...l):l.length===3?o.push(...Mo(Wu([l[0],l[0],l[1],l[2]]),10,(1+i.roughness)/2)):o.push(...Mo(Wu(l),10,(1+i.roughness)/2))}o.length&&n.push(Zr([o],i))}return i.stroke!==ue&&n.push(a),this._d("curve",n,i)}polygon(t,r){const i=this._o(r),n=[],a=_a(t,!0,i);return i.fill&&(i.fillStyle==="solid"?n.push(To([t],i)):n.push(Zr([t],i))),i.stroke!==ue&&n.push(a),this._d("polygon",n,i)}path(t,r){const i=this._o(r),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=i.fill&&i.fill!=="transparent"&&i.fill!==ue,o=i.stroke!==ue,s=!!(i.simplification&&i.simplification<1),c=function(h,u,f){const d=Sm(vm($c(h))),p=[];let m=[],y=[0,0],x=[];const b=()=>{x.length>=4&&m.push(...Mo(x,u)),x=[]},C=()=>{b(),m.length&&(p.push(m),m=[])};for(const{key:w,data:_}of d)switch(w){case"M":C(),y=[_[0],_[1]],m.push(y);break;case"L":b(),m.push([_[0],_[1]]);break;case"C":if(!x.length){const v=m.length?m[m.length-1]:y;x.push([v[0],v[1]])}x.push([_[0],_[1]]),x.push([_[2],_[3]]),x.push([_[4],_[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(C(),!f)return p;const k=[];for(const w of p){const _=SL(w,f);_.length&&k.push(_)}return k}(t,1,s?4-4*(i.simplification||1):(1+i.roughness)/2),l=Iu(t,i);if(a)if(i.fillStyle==="solid")if(c.length===1){const h=Iu(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else n.push(To(c,i));else n.push(Zr(c,i));return o&&(s?c.forEach(h=>{n.push(_a(h,!1,i))}):n.push(l)),this._d("path",n,i)}opsToPath(t,r){let i="";for(const n of t.ops){const a=typeof r=="number"&&r>=0?n.data.map(o=>+o.toFixed(r)):n.data;switch(n.op){case"move":i+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":i+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":i+=`L${a[0]} ${a[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const a of r){let o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ue};break;case"fillPath":o={d:this.opsToPath(a),stroke:ue,strokeWidth:0,fill:i.fill||ue};break;case"fillSketch":o=this.fillSketch(a,i)}o&&n.push(o)}return n}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ue,strokeWidth:i,fill:ue}}_mergedShape(t){return t.filter((r,i)=>i===0||r.op!=="move")}}class TL{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ds(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(const o of r)switch(o.type){case"path":n.save(),n.strokeStyle=i.stroke==="none"?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,o,a),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const s=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,o,a,s),n.restore();break}case"fillSketch":this.fillSketch(n,o,i)}}fillSketch(t,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,n="nonzero"){t.beginPath();for(const a of r.ops){const o=typeof i=="number"&&i>=0?a.data.map(s=>+s.toFixed(i)):a.data;switch(a.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}r.type==="fillPath"?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,n,a){const o=this.gen.line(t,r,i,n,a);return this.draw(o),o}rectangle(t,r,i,n,a){const o=this.gen.rectangle(t,r,i,n,a);return this.draw(o),o}ellipse(t,r,i,n,a){const o=this.gen.ellipse(t,r,i,n,a);return this.draw(o),o}circle(t,r,i,n){const a=this.gen.circle(t,r,i,n);return this.draw(a),a}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,n,a,o,s=!1,c){const l=this.gen.arc(t,r,i,n,a,o,s,c);return this.draw(l),l}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const na="http://www.w3.org/2000/svg";class ML{constructor(t,r){this.svg=t,this.gen=new ds(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,a=n.createElementNS(na,"g"),o=t.options.fixedDecimalPlaceDigits;for(const s of r){let c=null;switch(s.type){case"path":c=n.createElementNS(na,"path"),c.setAttribute("d",this.opsToPath(s,o)),c.setAttribute("stroke",i.stroke),c.setAttribute("stroke-width",i.strokeWidth+""),c.setAttribute("fill","none"),i.strokeLineDash&&c.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":c=n.createElementNS(na,"path"),c.setAttribute("d",this.opsToPath(s,o)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||c.setAttribute("fill-rule","evenodd");break;case"fillSketch":c=this.fillSketch(n,s,i)}c&&a.appendChild(c)}return a}fillSketch(t,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2);const a=t.createElementNS(na,"path");return a.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),a.setAttribute("stroke",i.fill||""),a.setAttribute("stroke-width",n+""),a.setAttribute("fill","none"),i.fillLineDash&&a.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,n,a){const o=this.gen.line(t,r,i,n,a);return this.draw(o)}rectangle(t,r,i,n,a){const o=this.gen.rectangle(t,r,i,n,a);return this.draw(o)}ellipse(t,r,i,n,a){const o=this.gen.ellipse(t,r,i,n,a);return this.draw(o)}circle(t,r,i,n){const a=this.gen.circle(t,r,i,n);return this.draw(a)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,n,a,o,s=!1,c){const l=this.gen.arc(t,r,i,n,a,o,s,c);return this.draw(l)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var X={canvas:(e,t)=>new TL(e,t),svg:(e,t)=>new ML(e,t),generator:e=>new ds(e),newSeed:()=>ds.newSeed()},ct=g(async(e,t,r)=>{var u,f;let i;const n=t.useHtmlLabels||Dt((u=xt())==null?void 0:u.htmlLabels);r?i=r:i="node default";const a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",re(t.labelStyle));let s;t.label===void 0?s="":s=typeof t.label=="string"?t.label:t.label[0];const c=await dr(o,Lr(Hr(s),xt()),{useHtmlLabels:n,width:t.width||((f=xt().flowchart)==null?void 0:f.wrappingWidth),cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let l=c.getBBox();const h=((t==null?void 0:t.padding)??0)/2;if(n){const d=c.children[0],p=gt(c),m=d.getElementsByTagName("img");if(m){const y=s.replace(/]*>/g,"").trim()==="";await Promise.all([...m].map(x=>new Promise(b=>{function C(){if(x.style.display="flex",x.style.flexDirection="column",y){const k=xt().fontSize?xt().fontSize:window.getComputedStyle(document.body).fontSize,w=5,[_=xf.fontSize]=Is(k),v=_*w+"px";x.style.minWidth=v,x.style.maxWidth=v}else x.style.width="100%";b(x)}g(C,"setupImage"),setTimeout(()=>{x.complete&&C()}),x.addEventListener("error",C),x.addEventListener("load",C)})))}l=d.getBoundingClientRect(),p.attr("width",l.width),p.attr("height",l.height)}return n?o.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"):o.attr("transform","translate(0, "+-l.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:l,halfPadding:h,label:o}},"labelHelper"),Ao=g(async(e,t,r)=>{var c,l,h,u,f,d;const i=r.useHtmlLabels||Dt((l=(c=xt())==null?void 0:c.flowchart)==null?void 0:l.htmlLabels),n=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await dr(n,Lr(Hr(t),xt()),{useHtmlLabels:i,width:r.width||((u=(h=xt())==null?void 0:h.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let o=a.getBBox();const s=r.padding/2;if(Dt((d=(f=xt())==null?void 0:f.flowchart)==null?void 0:d.htmlLabels)){const p=a.children[0],m=gt(a);o=p.getBoundingClientRect(),m.attr("width",o.width),m.attr("height",o.height)}return i?n.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):n.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&n.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:e,bbox:o,halfPadding:s,label:n}},"insertLabel"),Q=g((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),st=g((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function mt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}g(mt,"createPathFromPoints");function ur(e,t,r,i,n,a){const o=[],c=r-e,l=i-t,h=c/a,u=2*Math.PI/h,f=t+l/2;for(let d=0;d<=50;d++){const p=d/50,m=e+p*c,y=f+n*Math.sin(u*(m-e));o.push({x:m,y})}return o}g(ur,"generateFullSineWavePoints");function Dc(e,t,r,i,n,a){const o=[],s=n*Math.PI/180,h=(a*Math.PI/180-s)/(i-1);for(let u=0;u{var r=e.x,i=e.y,n=t.x-r,a=t.y-i,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(n)*s?(a<0&&(s=-s),c=a===0?0:s*n/a,l=s):(n<0&&(o=-o),c=o,l=n===0?0:o*a/n),{x:r+c,y:i+l}},"intersectRect"),Fi=AL;function Bm(e,t){t&&e.attr("style",t)}g(Bm,"applyStyle");async function Em(e){const t=gt(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div");let i=e.label;e.label&&xi(e.label)&&(i=await Rl(e.label.replace(Ai.lineBreakRegex,` `),xt()));const n=e.isNode?"nodeLabel":"edgeLabel";return r.html('"+i+""),Bm(r,e.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}g(Em,"addHtmlLabel");var LL=g(async(e,t,r,i)=>{let n=e||"";if(typeof n=="object"&&(n=n[0]),Dt(xt().flowchart.htmlLabels)){n=n.replace(/\\n|\n/g,"
    "),I.info("vertexText"+n);const a={isNode:i,label:Hr(n).replace(/fa[blrs]?:fa-[\w-]+/g,s=>``),labelStyle:t&&t.replace("fill:","color:")};return await Em(a)}else{const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",t.replace("color:","fill:"));let o=[];typeof n=="string"?o=n.split(/\\n|\n|/gi):Array.isArray(n)?o=n:o=[];for(const s of o){const c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),r?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=s.trim(),a.appendChild(c)}return a}},"createLabel"),Sr=LL,ir=g((e,t,r,i,n)=>["M",e+n,t,"H",e+r-n,"A",n,n,0,0,1,e+r,t+n,"V",t+i-n,"A",n,n,0,0,1,e+r-n,t+i,"H",e+n,"A",n,n,0,0,1,e,t+i-n,"V",t+n,"A",n,n,0,0,1,e+n,t,"Z"].join(" "),"createRoundedRectPathD"),Fm=g(async(e,t)=>{I.info("Creating subgraph rect for ",t.id,t);const r=xt(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:o}=i,{labelStyles:s,nodeStyles:c,borderStyles:l,backgroundStyles:h}=J(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),f=Dt(r.flowchart.htmlLabels),d=u.insert("g").attr("class","cluster-label "),p=await dr(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0});let m=p.getBBox();if(Dt(r.flowchart.htmlLabels)){const v=p.children[0],D=gt(p);m=v.getBoundingClientRect(),D.attr("width",m.width),D.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,b=t.x-y/2,C=t.y-x/2;I.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){const v=X.svg(u),D=K(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:n}),N=v.path(ir(b,C,y,x,0),D);k=u.insert(()=>(I.debug("Rough node insert CXC",N),N),":first-child"),k.select("path:nth-child(2)").attr("style",l.join(";")),k.select("path").attr("style",h.join(";").replace("fill","stroke"))}else k=u.insert("rect",":first-child"),k.attr("style",c).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",C).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:w}=Vl(r);if(d.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+w})`),s){const v=d.select("span");v&&v.attr("style",s)}const _=k.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(v){return Fi(t,v)},{cluster:u,labelBBox:m}},"rect"),BL=g((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.id),i=r.insert("rect",":first-child"),n=0*t.padding,a=n/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+n).attr("height",t.height+n).attr("fill","none");const o=i.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(s){return Fi(t,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),EL=g(async(e,t)=>{const r=xt(),{themeVariables:i,handDrawnSeed:n}=r,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,nodeBorder:c}=i,l=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),h=l.insert("g",":first-child"),u=l.insert("g").attr("class","cluster-label");let f=l.append("rect");const d=u.node().appendChild(await Sr(t.label,t.labelStyle,void 0,!0));let p=d.getBBox();if(Dt(r.flowchart.htmlLabels)){const N=d.children[0],O=gt(d);p=N.getBoundingClientRect(),O.attr("width",p.width),O.attr("height",p.height)}const m=0*t.padding,y=m/2,x=(t.width<=p.width+t.padding?p.width+t.padding:t.width)+m;t.width<=p.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height+m,C=t.height+m-p.height-6,k=t.x-x/2,w=t.y-b/2;t.width=x;const _=t.y-t.height/2-y+p.height+2;let v;if(t.look==="handDrawn"){const N=t.cssClasses.includes("statediagram-cluster-alt"),O=X.svg(l),T=t.rx||t.ry?O.path(ir(k,w,x,b,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:c,seed:n}):O.rectangle(k,w,x,b,{seed:n});v=l.insert(()=>T,":first-child");const R=O.rectangle(k,_,x,C,{fill:N?a:o,fillStyle:N?"hachure":"solid",stroke:c,seed:n});v=l.insert(()=>T,":first-child"),f=l.insert(()=>R)}else v=h.insert("rect",":first-child"),v.attr("class","outer").attr("x",k).attr("y",w).attr("width",x).attr("height",b).attr("data-look",t.look),f.attr("class","inner").attr("x",k).attr("y",_).attr("width",x).attr("height",C);u.attr("transform",`translate(${t.x-p.width/2}, ${w+1-(Dt(r.flowchart.htmlLabels)?0:3)})`);const D=v.node().getBBox();return t.height=D.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(N){return Fi(t,N)},{cluster:l,labelBBox:p}},"roundedWithTitle"),FL=g(async(e,t)=>{I.info("Creating subgraph rect for ",t.id,t);const r=xt(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:o}=i,{labelStyles:s,nodeStyles:c,borderStyles:l,backgroundStyles:h}=J(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),f=Dt(r.flowchart.htmlLabels),d=u.insert("g").attr("class","cluster-label "),p=await dr(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=p.getBBox();if(Dt(r.flowchart.htmlLabels)){const v=p.children[0],D=gt(p);m=v.getBoundingClientRect(),D.attr("width",m.width),D.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,b=t.x-y/2,C=t.y-x/2;I.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){const v=X.svg(u),D=K(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:n}),N=v.path(ir(b,C,y,x,t.rx),D);k=u.insert(()=>(I.debug("Rough node insert CXC",N),N),":first-child"),k.select("path:nth-child(2)").attr("style",l.join(";")),k.select("path").attr("style",h.join(";").replace("fill","stroke"))}else k=u.insert("rect",":first-child"),k.attr("style",c).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",C).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:w}=Vl(r);if(d.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+w})`),s){const v=d.select("span");v&&v.attr("style",s)}const _=k.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(v){return Fi(t,v)},{cluster:u,labelBBox:m}},"kanbanSection"),$L=g((e,t)=>{const r=xt(),{themeVariables:i,handDrawnSeed:n}=r,{nodeBorder:a}=i,o=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),s=o.insert("g",":first-child"),c=0*t.padding,l=t.width+c;t.diff=-t.padding;const h=t.height+c,u=t.x-l/2,f=t.y-h/2;t.width=l;let d;if(t.look==="handDrawn"){const y=X.svg(o).rectangle(u,f,l,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:n});d=o.insert(()=>y,":first-child")}else d=s.insert("rect",":first-child"),d.attr("class","divider").attr("x",u).attr("y",f).attr("width",l).attr("height",h).attr("data-look",t.look);const p=d.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Fi(t,m)},{cluster:o,labelBBox:{}}},"divider"),DL=Fm,OL={rect:Fm,squareRect:DL,roundedWithTitle:EL,noteGroup:BL,divider:$L,kanbanSection:FL},$m=new Map,RL=g(async(e,t)=>{const r=t.shape||"rect",i=await OL[r](e,t);return $m.set(t.id,i),i},"insertCluster"),u3=g(()=>{$m=new Map},"clear");function Dm(e,t){return e.intersect(t)}g(Dm,"intersectNode");var IL=Dm;function Om(e,t,r,i){var n=e.x,a=e.y,o=n-i.x,s=a-i.y,c=Math.sqrt(t*t*s*s+r*r*o*o),l=Math.abs(t*r*o/c);i.x0}g(vl,"sameSign");var NL=Pm;function Nm(e,t,r){let i=e.x,n=e.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){o=Math.min(o,h.x),s=Math.min(s,h.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=i-e.width/2-o,l=n-e.height/2-s;for(let h=0;h1&&a.sort(function(h,u){let f=h.x-r.x,d=h.y-r.y,p=Math.sqrt(f*f+d*d),m=u.x-r.x,y=u.y-r.y,x=Math.sqrt(m*m+y*y);return ph,":first-child");return u.attr("class","anchor").attr("style",re(s)),Q(t,u),t.intersect=function(f){return I.info("Circle intersect",t,o,f),V.circle(t,o,f)},a}g(zm,"anchor");function Sl(e,t,r,i,n,a,o){const c=(e+r)/2,l=(t+i)/2,h=Math.atan2(i-t,r-e),u=(r-e)/2,f=(i-t)/2,d=u/n,p=f/a,m=Math.sqrt(d**2+p**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=c+y*a*Math.sin(h)*(o?-1:1),b=l-y*n*Math.cos(h)*(o?-1:1),C=Math.atan2((t-b)/a,(e-x)/n);let w=Math.atan2((i-b)/a,(r-x)/n)-C;o&&w<0&&(w+=2*Math.PI),!o&&w>0&&(w-=2*Math.PI);const _=[];for(let v=0;v<20;v++){const D=v/19,N=C+D*w,O=x+n*Math.cos(N),T=b+a*Math.sin(N);_.push({x:O,y:T})}return _}g(Sl,"generateArcPoints");async function Wm(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=a.width+t.padding+20,s=a.height+t.padding,c=s/2,l=c/(2.5+s/50),{cssStyles:h}=t,u=[{x:o/2,y:-s/2},{x:-o/2,y:-s/2},...Sl(-o/2,-s/2,-o/2,s/2,l,c,!1),{x:o/2,y:s/2},...Sl(o/2,s/2,o/2,-s/2,l,c,!0)],f=X.svg(n),d=K(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=mt(u),m=f.path(p,d),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),y.attr("transform",`translate(${l/2}, 0)`),Q(t,y),t.intersect=function(x){return V.polygon(t,u,x)},n}g(Wm,"bowTieRect");function nr(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(n){return n.x+","+n.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(nr,"insertPolygonShape");async function qm(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=a.height+t.padding,s=12,c=a.width+t.padding+s,l=0,h=c,u=-o,f=0,d=[{x:l+s,y:u},{x:h,y:u},{x:h,y:f},{x:l,y:f},{x:l,y:u+s},{x:l+s,y:u}];let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=X.svg(n),x=K(t,{}),b=mt(d),C=y.path(b,x);p=n.insert(()=>C,":first-child").attr("transform",`translate(${-c/2}, ${o/2})`),m&&p.attr("style",m)}else p=nr(n,c,o,d);return i&&p.attr("style",i),Q(t,p),t.intersect=function(y){return V.polygon(t,d,y)},n}g(qm,"card");function Hm(e,t){const{nodeStyles:r}=J(t);t.label="";const i=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),{cssStyles:n}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=X.svg(i),c=K(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const l=mt(o),h=s.path(l,c),u=i.insert(()=>h,":first-child");return n&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),r&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return V.polygon(t,o,f)},i}g(Hm,"choice");async function Um(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o}=await ct(e,t,st(t)),s=a.width/2+o;let c;const{cssStyles:l}=t;if(t.look==="handDrawn"){const h=X.svg(n),u=K(t,{}),f=h.circle(0,0,s*2,u);c=n.insert(()=>f,":first-child"),c.attr("class","basic label-container").attr("style",re(l))}else c=n.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",s).attr("cx",0).attr("cy",0);return Q(t,c),t.intersect=function(h){return I.info("Circle intersect",t,s,h),V.circle(t,s,h)},n}g(Um,"circle");function Ym(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,n={x:i/2*t,y:i/2*r},a={x:-(i/2)*t,y:i/2*r},o={x:-(i/2)*t,y:-(i/2)*r},s={x:i/2*t,y:-(i/2)*r};return`M ${a.x},${a.y} L ${s.x},${s.y} M ${n.x},${n.y} L ${o.x},${o.y}`}g(Ym,"createLine");function jm(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r,t.label="";const n=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),a=Math.max(30,(t==null?void 0:t.width)??0),{cssStyles:o}=t,s=X.svg(n),c=K(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const l=s.circle(0,0,a*2,c),h=Ym(a),u=s.path(h,c),f=n.insert(()=>l,":first-child");return f.insert(()=>u),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Q(t,f),t.intersect=function(d){return I.info("crossedCircle intersect",t,{radius:a,point:d}),V.circle(t,a,d)},n}g(jm,"crossedCircle");function He(e,t,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,h=(a*Math.PI/180-s)/(i-1);for(let u=0;uC,":first-child").attr("stroke-opacity",0),k.insert(()=>x,":first-child"),k.attr("class","text"),h&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${l}, 0)`),o.attr("transform",`translate(${-s/2+l-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Q(t,k),t.intersect=function(w){return V.polygon(t,f,w)},n}g(Gm,"curlyBraceLeft");function Ue(e,t,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,h=(a*Math.PI/180-s)/(i-1);for(let u=0;uC,":first-child").attr("stroke-opacity",0),k.insert(()=>x,":first-child"),k.attr("class","text"),h&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${-l}, 0)`),o.attr("transform",`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Q(t,k),t.intersect=function(w){return V.polygon(t,f,w)},n}g(Vm,"curlyBraceRight");function Wt(e,t,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,h=(a*Math.PI/180-s)/(i-1);for(let u=0;uv,":first-child").attr("stroke-opacity",0),D.insert(()=>b,":first-child"),D.insert(()=>w,":first-child"),D.attr("class","text"),h&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",i),D.attr("transform",`translate(${l-l/4}, 0)`),o.attr("transform",`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Q(t,D),t.intersect=function(N){return V.polygon(t,d,N)},n}g(Xm,"curlyBraces");async function Zm(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=80,s=20,c=Math.max(o,(a.width+(t.padding??0)*2)*1.25,(t==null?void 0:t.width)??0),l=Math.max(s,a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=l/2,{cssStyles:u}=t,f=X.svg(n),d=K(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=c,m=l,y=p-h,x=m/4,b=[{x:y,y:0},{x,y:0},{x:0,y:m/2},{x,y:m},{x:y,y:m},...Dc(-y,-m/2,h,50,270,90)],C=mt(b),k=f.path(C,d),w=n.insert(()=>k,":first-child");return w.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),w.attr("transform",`translate(${-c/2}, ${-l/2})`),Q(t,w),t.intersect=function(_){return V.polygon(t,b,_)},n}g(Zm,"curvedTrapezoid");var WL=g((e,t,r,i,n,a)=>[`M${e},${t+a}`,`a${n},${a} 0,0,0 ${r},0`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),qL=g((e,t,r,i,n,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),HL=g((e,t,r,i,n,a)=>[`M${e-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function Km(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+t.padding,t.width??0),c=s/2,l=c/(2.5+s/50),h=Math.max(a.height+l+t.padding,t.height??0);let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=X.svg(n),p=qL(0,0,s,h,c,l),m=HL(0,l,s,h,c,l),y=d.path(p,K(t,{})),x=d.path(m,K(t,{fill:"none"}));u=n.insert(()=>x,":first-child"),u=n.insert(()=>y,":first-child"),u.attr("class","basic label-container"),f&&u.attr("style",f)}else{const d=WL(0,0,s,h,c,l);u=n.insert("path",":first-child").attr("d",d).attr("class","basic label-container").attr("style",re(f)).attr("style",i)}return u.attr("label-offset-y",l),u.attr("transform",`translate(${-s/2}, ${-(h/2+l)})`),Q(t,u),o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(d){const p=V.rect(t,d),m=p.x-(t.x??0);if(c!=0&&(Math.abs(m)<(t.width??0)/2||Math.abs(m)==(t.width??0)/2&&Math.abs(p.y-(t.y??0))>(t.height??0)/2-l)){let y=l*l*(1-m*m/(c*c));y>0&&(y=Math.sqrt(y)),y=l-y,d.y-(t.y??0)>0&&(y=-y),p.y+=y}return p},n}g(Km,"cylinder");async function Qm(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=a.width+t.padding,c=a.height+t.padding,l=c*.2,h=-s/2,u=-c/2-l/2,{cssStyles:f}=t,d=X.svg(n),p=K(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:h,y:u+l},{x:-h,y:u+l},{x:-h,y:-u},{x:h,y:-u},{x:h,y:u},{x:-h,y:u},{x:-h,y:u+l}],y=d.polygon(m.map(b=>[b.x,b.y]),p),x=n.insert(()=>y,":first-child");return x.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),o.attr("transform",`translate(${h+(t.padding??0)/2-(a.x-(a.left??0))}, ${u+l+(t.padding??0)/2-(a.y-(a.top??0))})`),Q(t,x),t.intersect=function(b){return V.rect(t,b)},n}g(Qm,"dividedRectangle");async function Jm(e,t){var f,d;const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o}=await ct(e,t,st(t)),c=a.width/2+o+5,l=a.width/2+o;let h;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=X.svg(n),m=K(t,{roughness:.2,strokeWidth:2.5}),y=K(t,{roughness:.2,strokeWidth:1.5}),x=p.circle(0,0,c*2,m),b=p.circle(0,0,l*2,y);h=n.insert("g",":first-child"),h.attr("class",re(t.cssClasses)).attr("style",re(u)),(f=h.node())==null||f.appendChild(x),(d=h.node())==null||d.appendChild(b)}else{h=n.insert("g",":first-child");const p=h.insert("circle",":first-child"),m=h.insert("circle");h.attr("class","basic label-container").attr("style",i),p.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",i).attr("r",l).attr("cx",0).attr("cy",0)}return Q(t,h),t.intersect=function(p){return I.info("DoubleCircle intersect",t,c,p),V.circle(t,c,p)},n}g(Jm,"doublecircle");function t0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=J(t);t.label="",t.labelStyle=i;const a=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),o=7,{cssStyles:s}=t,c=X.svg(a),{nodeBorder:l}=r,h=K(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const u=c.circle(0,0,o*2,h),f=a.insert(()=>u,":first-child");return f.selectAll("path").attr("style",`fill: ${l} !important;`),s&&s.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Q(t,f),t.intersect=function(d){return I.info("filledCircle intersect",t,{radius:o,point:d}),V.circle(t,o,d)},a}g(t0,"filledCircle");async function e0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=a.width+(t.padding??0),c=s+a.height,l=s+a.height,h=[{x:0,y:-c},{x:l,y:-c},{x:l/2,y:0}],{cssStyles:u}=t,f=X.svg(n),d=K(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=mt(h),m=f.path(p,d),y=n.insert(()=>m,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return u&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),t.width=s,t.height=c,Q(t,y),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-c/2+(t.padding??0)/2+(a.y-(a.top??0))})`),t.intersect=function(x){return I.info("Triangle intersect",t,h,x),V.polygon(t,h,x)},n}g(e0,"flippedTriangle");function r0(e,t,{dir:r,config:{state:i,themeVariables:n}}){const{nodeStyles:a}=J(t);t.label="";const o=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),{cssStyles:s}=t;let c=Math.max(70,(t==null?void 0:t.width)??0),l=Math.max(10,(t==null?void 0:t.height)??0);r==="LR"&&(c=Math.max(10,(t==null?void 0:t.width)??0),l=Math.max(70,(t==null?void 0:t.height)??0));const h=-1*c/2,u=-1*l/2,f=X.svg(o),d=K(t,{stroke:n.lineColor,fill:n.lineColor});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=f.rectangle(h,u,c,l,d),m=o.insert(()=>p,":first-child");s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),a&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Q(t,m);const y=(i==null?void 0:i.padding)??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(x){return V.rect(t,x)},o}g(r0,"forkJoin");async function i0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const n=80,a=50,{shapeSvg:o,bbox:s}=await ct(e,t,st(t)),c=Math.max(n,s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(a,s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=l/2,{cssStyles:u}=t,f=X.svg(o),d=K(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=[{x:-c/2,y:-l/2},{x:c/2-h,y:-l/2},...Dc(-c/2+h,0,h,50,90,270),{x:c/2-h,y:l/2},{x:-c/2,y:l/2}],m=mt(p),y=f.path(m,d),x=o.insert(()=>y,":first-child");return x.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),Q(t,x),t.intersect=function(b){return I.info("Pill intersect",t,{radius:h,point:b}),V.polygon(t,p,b)},o}g(i0,"halfRoundedRectangle");var UL=g((e,t,r,i,n)=>[`M${e+n},${t}`,`L${e+r-n},${t}`,`L${e+r},${t-i/2}`,`L${e+r-n},${t-i}`,`L${e+n},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function n0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=4,s=a.height+t.padding,c=s/o,l=a.width+2*c+t.padding,h=[{x:c,y:0},{x:l-c,y:0},{x:l,y:-s/2},{x:l-c,y:-s},{x:c,y:-s},{x:0,y:-s/2}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=X.svg(n),p=K(t,{}),m=UL(0,0,l,s,c),y=d.path(m,p);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-l/2}, ${s/2})`),f&&u.attr("style",f)}else u=nr(n,l,s,h);return i&&u.attr("style",i),t.width=l,t.height=s,Q(t,u),t.intersect=function(d){return V.polygon(t,h,d)},n}g(n0,"hexagon");async function a0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.label="",t.labelStyle=r;const{shapeSvg:n}=await ct(e,t,st(t)),a=Math.max(30,(t==null?void 0:t.width)??0),o=Math.max(30,(t==null?void 0:t.height)??0),{cssStyles:s}=t,c=X.svg(n),l=K(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],u=mt(h),f=c.path(u,l),d=n.insert(()=>f,":first-child");return d.attr("class","basic label-container"),s&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",s),i&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",i),d.attr("transform",`translate(${-a/2}, ${-o/2})`),Q(t,d),t.intersect=function(p){return I.info("Pill intersect",t,{points:h}),V.polygon(t,h,p)},n}g(a0,"hourglass");async function s0(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=J(t);t.labelStyle=n;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=i==null?void 0:i.wrappingWidth;t.width=Math.max(s,c??0);const{shapeSvg:l,bbox:h,label:u}=await ct(e,t,"icon-shape default"),f=t.pos==="t",d=s,p=s,{nodeBorder:m}=r,{stylesMap:y}=Li(t),x=-p/2,b=-d/2,C=t.label?8:0,k=X.svg(l),w=K(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const _=k.rectangle(x,b,p,d,w),v=Math.max(p,h.width),D=d+h.height+C,N=k.rectangle(-v/2,-D/2,v,D,{...w,fill:"transparent",stroke:"none"}),O=l.insert(()=>_,":first-child"),T=l.insert(()=>N);if(t.icon){const R=l.append("g");R.html(`${await In(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const L=R.node().getBBox(),M=L.width,F=L.height,B=L.x,$=L.y;R.attr("transform",`translate(${-M/2-B},${f?h.height/2+C/2-F/2-$:-h.height/2-C/2-F/2-$})`),R.attr("style",`color: ${y.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+C/2:-h.height/2-C/2})`),Q(t,T),t.intersect=function(R){if(I.info("iconSquare intersect",t,R),!t.label)return V.rect(t,R);const L=t.x??0,M=t.y??0,F=t.height??0;let B=[];return f?B=[{x:L-h.width/2,y:M-F/2},{x:L+h.width/2,y:M-F/2},{x:L+h.width/2,y:M-F/2+h.height+C},{x:L+p/2,y:M-F/2+h.height+C},{x:L+p/2,y:M+F/2},{x:L-p/2,y:M+F/2},{x:L-p/2,y:M-F/2+h.height+C},{x:L-h.width/2,y:M-F/2+h.height+C}]:B=[{x:L-p/2,y:M-F/2},{x:L+p/2,y:M-F/2},{x:L+p/2,y:M-F/2+d},{x:L+h.width/2,y:M-F/2+d},{x:L+h.width/2/2,y:M+F/2},{x:L-h.width/2,y:M+F/2},{x:L-h.width/2,y:M-F/2+d},{x:L-p/2,y:M-F/2+d}],V.polygon(t,B,R)},l}g(s0,"icon");async function o0(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=J(t);t.labelStyle=n;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=i==null?void 0:i.wrappingWidth;t.width=Math.max(s,c??0);const{shapeSvg:l,bbox:h,label:u}=await ct(e,t,"icon-shape default"),f=20,d=t.label?8:0,p=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Li(t),b=X.svg(l),C=K(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=x.get("fill");C.stroke=k??y;const w=l.append("g");t.icon&&w.html(`${await In(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const _=w.node().getBBox(),v=_.width,D=_.height,N=_.x,O=_.y,T=Math.max(v,D)*Math.SQRT2+f*2,R=b.circle(0,0,T,C),L=Math.max(T,h.width),M=T+h.height+d,F=b.rectangle(-L/2,-M/2,L,M,{...C,fill:"transparent",stroke:"none"}),B=l.insert(()=>R,":first-child"),$=l.insert(()=>F);return w.attr("transform",`translate(${-v/2-N},${p?h.height/2+d/2-D/2-O:-h.height/2-d/2-D/2-O})`),w.attr("style",`color: ${x.get("stroke")??m};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-M/2:M/2-h.height})`),B.attr("transform",`translate(0,${p?h.height/2+d/2:-h.height/2-d/2})`),Q(t,$),t.intersect=function(E){return I.info("iconSquare intersect",t,E),V.rect(t,E)},l}g(o0,"iconCircle");async function l0(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=J(t);t.labelStyle=n;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=i==null?void 0:i.wrappingWidth;t.width=Math.max(s,c??0);const{shapeSvg:l,bbox:h,halfPadding:u,label:f}=await ct(e,t,"icon-shape default"),d=t.pos==="t",p=s+u*2,m=s+u*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:b}=Li(t),C=-m/2,k=-p/2,w=t.label?8:0,_=X.svg(l),v=K(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const D=b.get("fill");v.stroke=D??x;const N=_.path(ir(C,k,m,p,5),v),O=Math.max(m,h.width),T=p+h.height+w,R=_.rectangle(-O/2,-T/2,O,T,{...v,fill:"transparent",stroke:"none"}),L=l.insert(()=>N,":first-child").attr("class","icon-shape2"),M=l.insert(()=>R);if(t.icon){const F=l.append("g");F.html(`${await In(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const B=F.node().getBBox(),$=B.width,E=B.height,q=B.x,Y=B.y;F.attr("transform",`translate(${-$/2-q},${d?h.height/2+w/2-E/2-Y:-h.height/2-w/2-E/2-Y})`),F.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-T/2:T/2-h.height})`),L.attr("transform",`translate(0,${d?h.height/2+w/2:-h.height/2-w/2})`),Q(t,M),t.intersect=function(F){if(I.info("iconSquare intersect",t,F),!t.label)return V.rect(t,F);const B=t.x??0,$=t.y??0,E=t.height??0;let q=[];return d?q=[{x:B-h.width/2,y:$-E/2},{x:B+h.width/2,y:$-E/2},{x:B+h.width/2,y:$-E/2+h.height+w},{x:B+m/2,y:$-E/2+h.height+w},{x:B+m/2,y:$+E/2},{x:B-m/2,y:$+E/2},{x:B-m/2,y:$-E/2+h.height+w},{x:B-h.width/2,y:$-E/2+h.height+w}]:q=[{x:B-m/2,y:$-E/2},{x:B+m/2,y:$-E/2},{x:B+m/2,y:$-E/2+p},{x:B+h.width/2,y:$-E/2+p},{x:B+h.width/2/2,y:$+E/2},{x:B-h.width/2,y:$+E/2},{x:B-h.width/2,y:$-E/2+p},{x:B-m/2,y:$-E/2+p}],V.polygon(t,q,F)},l}g(l0,"iconRounded");async function c0(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=J(t);t.labelStyle=n;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=i==null?void 0:i.wrappingWidth;t.width=Math.max(s,c??0);const{shapeSvg:l,bbox:h,halfPadding:u,label:f}=await ct(e,t,"icon-shape default"),d=t.pos==="t",p=s+u*2,m=s+u*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:b}=Li(t),C=-m/2,k=-p/2,w=t.label?8:0,_=X.svg(l),v=K(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const D=b.get("fill");v.stroke=D??x;const N=_.path(ir(C,k,m,p,.1),v),O=Math.max(m,h.width),T=p+h.height+w,R=_.rectangle(-O/2,-T/2,O,T,{...v,fill:"transparent",stroke:"none"}),L=l.insert(()=>N,":first-child"),M=l.insert(()=>R);if(t.icon){const F=l.append("g");F.html(`${await In(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const B=F.node().getBBox(),$=B.width,E=B.height,q=B.x,Y=B.y;F.attr("transform",`translate(${-$/2-q},${d?h.height/2+w/2-E/2-Y:-h.height/2-w/2-E/2-Y})`),F.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-T/2:T/2-h.height})`),L.attr("transform",`translate(0,${d?h.height/2+w/2:-h.height/2-w/2})`),Q(t,M),t.intersect=function(F){if(I.info("iconSquare intersect",t,F),!t.label)return V.rect(t,F);const B=t.x??0,$=t.y??0,E=t.height??0;let q=[];return d?q=[{x:B-h.width/2,y:$-E/2},{x:B+h.width/2,y:$-E/2},{x:B+h.width/2,y:$-E/2+h.height+w},{x:B+m/2,y:$-E/2+h.height+w},{x:B+m/2,y:$+E/2},{x:B-m/2,y:$+E/2},{x:B-m/2,y:$-E/2+h.height+w},{x:B-h.width/2,y:$-E/2+h.height+w}]:q=[{x:B-m/2,y:$-E/2},{x:B+m/2,y:$-E/2},{x:B+m/2,y:$-E/2+p},{x:B+h.width/2,y:$-E/2+p},{x:B+h.width/2/2,y:$+E/2},{x:B-h.width/2,y:$+E/2},{x:B-h.width/2,y:$-E/2+p},{x:B-m/2,y:$-E/2+p}],V.polygon(t,q,F)},l}g(c0,"iconSquare");async function h0(e,t,{config:{flowchart:r}}){const i=new Image;i.src=(t==null?void 0:t.img)??"",await i.decode();const n=Number(i.naturalWidth.toString().replace("px","")),a=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=n/a;const{labelStyles:o}=J(t);t.labelStyle=o;const s=r==null?void 0:r.wrappingWidth;t.defaultWidth=r==null?void 0:r.wrappingWidth;const c=Math.max(t.label?s??0:0,(t==null?void 0:t.assetWidth)??n),l=t.constraint==="on"&&t!=null&&t.assetHeight?t.assetHeight*t.imageAspectRatio:c,h=t.constraint==="on"?l/t.imageAspectRatio:(t==null?void 0:t.assetHeight)??a;t.width=Math.max(l,s??0);const{shapeSvg:u,bbox:f,label:d}=await ct(e,t,"image-shape default"),p=t.pos==="t",m=-l/2,y=-h/2,x=t.label?8:0,b=X.svg(u),C=K(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=b.rectangle(m,y,l,h,C),w=Math.max(l,f.width),_=h+f.height+x,v=b.rectangle(-w/2,-_/2,w,_,{...C,fill:"none",stroke:"none"}),D=u.insert(()=>k,":first-child"),N=u.insert(()=>v);if(t.img){const O=u.append("image");O.attr("href",t.img),O.attr("width",l),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-l/2},${p?_/2-h:-_/2})`)}return d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${p?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),D.attr("transform",`translate(0,${p?f.height/2+x/2:-f.height/2-x/2})`),Q(t,N),t.intersect=function(O){if(I.info("iconSquare intersect",t,O),!t.label)return V.rect(t,O);const T=t.x??0,R=t.y??0,L=t.height??0;let M=[];return p?M=[{x:T-f.width/2,y:R-L/2},{x:T+f.width/2,y:R-L/2},{x:T+f.width/2,y:R-L/2+f.height+x},{x:T+l/2,y:R-L/2+f.height+x},{x:T+l/2,y:R+L/2},{x:T-l/2,y:R+L/2},{x:T-l/2,y:R-L/2+f.height+x},{x:T-f.width/2,y:R-L/2+f.height+x}]:M=[{x:T-l/2,y:R-L/2},{x:T+l/2,y:R-L/2},{x:T+l/2,y:R-L/2+h},{x:T+f.width/2,y:R-L/2+h},{x:T+f.width/2/2,y:R+L/2},{x:T-f.width/2,y:R+L/2},{x:T-f.width/2,y:R-L/2+h},{x:T-l/2,y:R-L/2+h}],V.polygon(t,M,O)},u}g(h0,"imageSquare");async function u0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),s=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=[{x:0,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:-3*s/6,y:-s}];let l;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=X.svg(n),f=K(t,{}),d=mt(c),p=u.path(d,f);l=n.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),h&&l.attr("style",h)}else l=nr(n,o,s,c);return i&&l.attr("style",i),t.width=o,t.height=s,Q(t,l),t.intersect=function(u){return V.polygon(t,c,u)},n}g(u0,"inv_trapezoid");async function Nn(e,t,r){const{labelStyles:i,nodeStyles:n}=J(t);t.labelStyle=i;const{shapeSvg:a,bbox:o}=await ct(e,t,st(t)),s=Math.max(o.width+r.labelPaddingX*2,(t==null?void 0:t.width)||0),c=Math.max(o.height+r.labelPaddingY*2,(t==null?void 0:t.height)||0),l=-s/2,h=-c/2;let u,{rx:f,ry:d}=t;const{cssStyles:p}=t;if(r!=null&&r.rx&&r.ry&&(f=r.rx,d=r.ry),t.look==="handDrawn"){const m=X.svg(a),y=K(t,{}),x=f||d?m.path(ir(l,h,s,c,f||0),y):m.rectangle(l,h,s,c,y);u=a.insert(()=>x,":first-child"),u.attr("class","basic label-container").attr("style",re(p))}else u=a.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",n).attr("rx",re(f)).attr("ry",re(d)).attr("x",l).attr("y",h).attr("width",s).attr("height",c);return Q(t,u),t.intersect=function(m){return V.rect(t,m)},a}g(Nn,"drawRect");async function f0(e,t){const{shapeSvg:r,bbox:i,label:n}=await ct(e,t,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),n.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),Q(t,a),t.intersect=function(c){return V.rect(t,c)},r}g(f0,"labelRect");async function d0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),s=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),c=[{x:0,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:-(3*s)/6,y:-s}];let l;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=X.svg(n),f=K(t,{}),d=mt(c),p=u.path(d,f);l=n.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),h&&l.attr("style",h)}else l=nr(n,o,s,c);return i&&l.attr("style",i),t.width=o,t.height=s,Q(t,l),t.intersect=function(u){return V.polygon(t,c,u)},n}g(d0,"lean_left");async function p0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),s=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),c=[{x:-3*s/6,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:0,y:-s}];let l;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=X.svg(n),f=K(t,{}),d=mt(c),p=u.path(d,f);l=n.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),h&&l.attr("style",h)}else l=nr(n,o,s,c);return i&&l.attr("style",i),t.width=o,t.height=s,Q(t,l),t.intersect=function(u){return V.polygon(t,c,u)},n}g(p0,"lean_right");function g0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.label="",t.labelStyle=r;const n=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,(t==null?void 0:t.width)??0),s=Math.max(35,(t==null?void 0:t.height)??0),c=7,l=[{x:o,y:0},{x:0,y:s+c/2},{x:o-2*c,y:s+c/2},{x:0,y:2*s},{x:o,y:s-c/2},{x:2*c,y:s-c/2}],h=X.svg(n),u=K(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=mt(l),d=h.path(f,u),p=n.insert(()=>d,":first-child");return a&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${o/2},${-s})`),Q(t,p),t.intersect=function(m){return I.info("lightningBolt intersect",t,m),V.polygon(t,l,m)},n}g(g0,"lightningBolt");var YL=g((e,t,r,i,n,a,o)=>[`M${e},${t+a}`,`a${n},${a} 0,0,0 ${r},0`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+o}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),jL=g((e,t,r,i,n,a,o)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+o}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),GL=g((e,t,r,i,n,a)=>[`M${e-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function m0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0),t.width??0),c=s/2,l=c/(2.5+s/50),h=Math.max(a.height+l+(t.padding??0),t.height??0),u=h*.1;let f;const{cssStyles:d}=t;if(t.look==="handDrawn"){const p=X.svg(n),m=jL(0,0,s,h,c,l,u),y=GL(0,l,s,h,c,l),x=K(t,{}),b=p.path(m,x),C=p.path(y,x);n.insert(()=>C,":first-child").attr("class","line"),f=n.insert(()=>b,":first-child"),f.attr("class","basic label-container"),d&&f.attr("style",d)}else{const p=YL(0,0,s,h,c,l,u);f=n.insert("path",":first-child").attr("d",p).attr("class","basic label-container").attr("style",re(d)).attr("style",i)}return f.attr("label-offset-y",l),f.attr("transform",`translate(${-s/2}, ${-(h/2+l)})`),Q(t,f),o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+l-(a.y-(a.top??0))})`),t.intersect=function(p){const m=V.rect(t,p),y=m.x-(t.x??0);if(c!=0&&(Math.abs(y)<(t.width??0)/2||Math.abs(y)==(t.width??0)/2&&Math.abs(m.y-(t.y??0))>(t.height??0)/2-l)){let x=l*l*(1-y*y/(c*c));x>0&&(x=Math.sqrt(x)),x=l-x,p.y-(t.y??0)>0&&(x=-x),m.y+=x}return m},n}g(m0,"linedCylinder");async function y0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=c/4,h=c+l,{cssStyles:u}=t,f=X.svg(n),d=K(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=[{x:-s/2-s/2*.1,y:-h/2},{x:-s/2-s/2*.1,y:h/2},...ur(-s/2-s/2*.1,h/2,s/2+s/2*.1,h/2,l,.8),{x:s/2+s/2*.1,y:-h/2},{x:-s/2-s/2*.1,y:-h/2},{x:-s/2,y:-h/2},{x:-s/2,y:h/2*1.1},{x:-s/2,y:-h/2}],m=f.polygon(p.map(x=>[x.x,x.y]),d),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),y.attr("transform",`translate(0,${-l/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)+s/2*.1/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),Q(t,y),t.intersect=function(x){return V.polygon(t,p,x)},n}g(y0,"linedWaveEdgedRect");async function x0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=5,h=-s/2,u=-c/2,{cssStyles:f}=t,d=X.svg(n),p=K(t,{}),m=[{x:h-l,y:u+l},{x:h-l,y:u+c+l},{x:h+s-l,y:u+c+l},{x:h+s-l,y:u+c},{x:h+s,y:u+c},{x:h+s,y:u+c-l},{x:h+s+l,y:u+c-l},{x:h+s+l,y:u-l},{x:h+l,y:u-l},{x:h+l,y:u},{x:h,y:u},{x:h,y:u+l}],y=[{x:h,y:u+l},{x:h+s-l,y:u+l},{x:h+s-l,y:u+c},{x:h+s,y:u+c},{x:h+s,y:u},{x:h,y:u}];t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const x=mt(m),b=d.path(x,p),C=mt(y),k=d.path(C,{...p,fill:"none"}),w=n.insert(()=>k,":first-child");return w.insert(()=>b,":first-child"),w.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),o.attr("transform",`translate(${-(a.width/2)-l-(a.x-(a.left??0))}, ${-(a.height/2)+l-(a.y-(a.top??0))})`),Q(t,w),t.intersect=function(_){return V.polygon(t,m,_)},n}g(x0,"multiRect");async function b0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=c/4,h=c+l,u=-s/2,f=-h/2,d=5,{cssStyles:p}=t,m=ur(u-d,f+h+d,u+s-d,f+h+d,l,.8),y=m==null?void 0:m[m.length-1],x=[{x:u-d,y:f+d},{x:u-d,y:f+h+d},...m,{x:u+s-d,y:y.y-d},{x:u+s,y:y.y-d},{x:u+s,y:y.y-2*d},{x:u+s+d,y:y.y-2*d},{x:u+s+d,y:f-d},{x:u+d,y:f-d},{x:u+d,y:f},{x:u,y:f},{x:u,y:f+d}],b=[{x:u,y:f+d},{x:u+s-d,y:f+d},{x:u+s-d,y:y.y-d},{x:u+s,y:y.y-d},{x:u+s,y:f},{x:u,y:f}],C=X.svg(n),k=K(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const w=mt(x),_=C.path(w,k),v=mt(b),D=C.path(v,k),N=n.insert(()=>_,":first-child");return N.insert(()=>D),N.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),N.attr("transform",`translate(0,${-l/2})`),o.attr("transform",`translate(${-(a.width/2)-d-(a.x-(a.left??0))}, ${-(a.height/2)+d-l/2-(a.y-(a.top??0))})`),Q(t,N),t.intersect=function(O){return V.polygon(t,x,O)},n}g(b0,"multiWaveEdgedRectangle");async function _0(e,t,{config:{themeVariables:r}}){var b;const{labelStyles:i,nodeStyles:n}=J(t);t.labelStyle=i,t.useHtmlLabels||((b=he().flowchart)==null?void 0:b.htmlLabels)!==!1||(t.centerLabel=!0);const{shapeSvg:o,bbox:s,label:c}=await ct(e,t,st(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),u=-l/2,f=-h/2,{cssStyles:d}=t,p=X.svg(o),m=K(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=p.rectangle(u,f,l,h,m),x=o.insert(()=>y,":first-child");return x.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",n),c.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Q(t,x),t.intersect=function(C){return V.rect(t,C)},o}g(_0,"note");var VL=g((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function C0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=a.width+t.padding,s=a.height+t.padding,c=o+s,l=[{x:c/2,y:0},{x:c,y:-c/2},{x:c/2,y:-c},{x:0,y:-c/2}];let h;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=X.svg(n),d=K(t,{}),p=VL(0,0,c),m=f.path(p,d);h=n.insert(()=>m,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`),u&&h.attr("style",u)}else h=nr(n,c,c,l);return i&&h.attr("style",i),Q(t,h),t.intersect=function(f){return I.debug(`APA12 Intersect called SPLIT point:`,f,` node: `,t,` res:`,V.polygon(t,l,f)),V.polygon(t,l,f)},n}g(C0,"question");async function w0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),l=-s/2,h=-c/2,u=h/2,f=[{x:l+u,y:h},{x:l,y:0},{x:l+u,y:-h},{x:-l,y:-h},{x:-l,y:h}],{cssStyles:d}=t,p=X.svg(n),m=K(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=mt(f),x=p.path(y,m),b=n.insert(()=>x,":first-child");return b.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(${-u/2},0)`),o.attr("transform",`translate(${-u/2-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Q(t,b),t.intersect=function(C){return V.polygon(t,f,C)},n}g(w0,"rect_left_inv_arrow");async function k0(e,t){var D,N;const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;let n;t.cssClasses?n="node "+t.cssClasses:n="node default";const a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),o=a.insert("g"),s=a.insert("g").attr("class","label").attr("style",i),c=t.description,l=t.label,h=s.node().appendChild(await Sr(l,t.labelStyle,!0,!0));let u={width:0,height:0};if(Dt((N=(D=xt())==null?void 0:D.flowchart)==null?void 0:N.htmlLabels)){const O=h.children[0],T=gt(h);u=O.getBoundingClientRect(),T.attr("width",u.width),T.attr("height",u.height)}I.info("Text 2",c);const f=c||[],d=h.getBBox(),p=s.node().appendChild(await Sr(f.join?f.join("
    "):f,t.labelStyle,!0,!0)),m=p.children[0],y=gt(p);u=m.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height);const x=(t.padding||0)/2;gt(p).attr("transform","translate( "+(u.width>d.width?0:(d.width-u.width)/2)+", "+(d.height+x+5)+")"),gt(h).attr("transform","translate( "+(u.width(I.debug("Rough node insert CXC",R),L),":first-child"),_=a.insert(()=>(I.debug("Rough node insert CXC",R),R),":first-child")}else _=o.insert("rect",":first-child"),v=o.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-u.width/2-x).attr("y",-u.height/2-x).attr("width",u.width+(t.padding||0)).attr("height",u.height+(t.padding||0)),v.attr("class","divider").attr("x1",-u.width/2-x).attr("x2",u.width/2+x).attr("y1",-u.height/2-x+d.height+x).attr("y2",-u.height/2-x+d.height+x);return Q(t,_),t.intersect=function(O){return V.rect(t,O)},a}g(k0,"rectWithTitle");async function v0(e,t){const r={rx:5,ry:5,labelPaddingX:((t==null?void 0:t.padding)||0)*1,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return Nn(e,t,r)}g(v0,"roundedRect");async function S0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=(t==null?void 0:t.padding)??0,c=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=-a.width/2-s,u=-a.height/2-s,{cssStyles:f}=t,d=X.svg(n),p=K(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:h,y:u},{x:h+c+8,y:u},{x:h+c+8,y:u+l},{x:h-8,y:u+l},{x:h-8,y:u},{x:h,y:u},{x:h,y:u+l}],y=d.polygon(m.map(b=>[b.x,b.y]),p),x=n.insert(()=>y,":first-child");return x.attr("class","basic label-container").attr("style",re(f)),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),o.attr("transform",`translate(${-c/2+4+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-(a.y-(a.top??0))})`),Q(t,x),t.intersect=function(b){return V.rect(t,b)},n}g(S0,"shadedProcess");async function T0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=-s/2,h=-c/2,{cssStyles:u}=t,f=X.svg(n),d=K(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=[{x:l,y:h},{x:l,y:h+c},{x:l+s,y:h+c},{x:l+s,y:h-c/2}],m=mt(p),y=f.path(m,d),x=n.insert(()=>y,":first-child");return x.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),x.attr("transform",`translate(0, ${c/4})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))}, ${-c/4+(t.padding??0)-(a.y-(a.top??0))})`),Q(t,x),t.intersect=function(b){return V.polygon(t,p,b)},n}g(T0,"slopedRect");async function M0(e,t){const r={rx:0,ry:0,labelPaddingX:((t==null?void 0:t.padding)||0)*2,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return Nn(e,t,r)}g(M0,"squareRect");async function A0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=a.height+t.padding,s=a.width+o/4+t.padding;let c;const{cssStyles:l}=t;if(t.look==="handDrawn"){const h=X.svg(n),u=K(t,{}),f=ir(-s/2,-o/2,s,o,o/2),d=h.path(f,u);c=n.insert(()=>d,":first-child"),c.attr("class","basic label-container").attr("style",re(l))}else c=n.insert("rect",":first-child"),c.attr("class","basic label-container").attr("style",i).attr("rx",o/2).attr("ry",o/2).attr("x",-s/2).attr("y",-o/2).attr("width",s).attr("height",o);return Q(t,c),t.intersect=function(h){return V.rect(t,h)},n}g(A0,"stadium");async function L0(e,t){return Nn(e,t,{rx:5,ry:5})}g(L0,"state");function B0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=J(t);t.labelStyle=i;const{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c}=r,l=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),h=X.svg(l),u=K(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=h.circle(0,0,14,{...u,stroke:o,strokeWidth:2}),d=s??c,p=h.circle(0,0,5,{...u,fill:d,stroke:d,strokeWidth:2,fillStyle:"solid"}),m=l.insert(()=>f,":first-child");return m.insert(()=>p),a&&m.selectAll("path").attr("style",a),n&&m.selectAll("path").attr("style",n),Q(t,m),t.intersect=function(y){return V.circle(t,7,y)},l}g(B0,"stateEnd");function E0(e,t,{config:{themeVariables:r}}){const{lineColor:i}=r,n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const s=X.svg(n).circle(0,0,14,O1(i));a=n.insert(()=>s),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=n.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Q(t,a),t.intersect=function(o){return V.circle(t,7,o)},n}g(E0,"stateStart");async function F0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=((t==null?void 0:t.padding)||0)/2,s=a.width+t.padding,c=a.height+t.padding,l=-a.width/2-o,h=-a.height/2-o,u=[{x:0,y:0},{x:s,y:0},{x:s,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if(t.look==="handDrawn"){const f=X.svg(n),d=K(t,{}),p=f.rectangle(l-8,h,s+16,c,d),m=f.line(l,h,l,h+c,d),y=f.line(l+s,h,l+s,h+c,d);n.insert(()=>m,":first-child"),n.insert(()=>y,":first-child");const x=n.insert(()=>p,":first-child"),{cssStyles:b}=t;x.attr("class","basic label-container").attr("style",re(b)),Q(t,x)}else{const f=nr(n,s,c,u);i&&f.attr("style",i),Q(t,f)}return t.intersect=function(f){return V.polygon(t,u,f)},n}g(F0,"subroutine");async function $0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),s=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=-o/2,l=-s/2,h=.2*s,u=.2*s,{cssStyles:f}=t,d=X.svg(n),p=K(t,{}),m=[{x:c-h/2,y:l},{x:c+o+h/2,y:l},{x:c+o+h/2,y:l+s},{x:c-h/2,y:l+s}],y=[{x:c+o-h/2,y:l+s},{x:c+o+h/2,y:l+s},{x:c+o+h/2,y:l+s-u}];t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const x=mt(m),b=d.path(x,p),C=mt(y),k=d.path(C,{...p,fillStyle:"solid"}),w=n.insert(()=>k,":first-child");return w.insert(()=>b,":first-child"),w.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),Q(t,w),t.intersect=function(_){return V.polygon(t,m,_)},n}g($0,"taggedRect");async function D0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=c/4,h=.2*s,u=.2*c,f=c+l,{cssStyles:d}=t,p=X.svg(n),m=K(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-s/2-s/2*.1,y:f/2},...ur(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],x=-s/2+s/2*.1,b=-f/2-u*.4,C=[{x:x+s-h,y:(b+c)*1.4},{x:x+s,y:b+c-u},{x:x+s,y:(b+c)*.9},...ur(x+s,(b+c)*1.3,x+s-h,(b+c)*1.5,-c*.03,.5)],k=mt(y),w=p.path(k,m),_=mt(C),v=p.path(_,{...m,fillStyle:"solid"}),D=n.insert(()=>v,":first-child");return D.insert(()=>w,":first-child"),D.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",i),D.attr("transform",`translate(0,${-l/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),Q(t,D),t.intersect=function(N){return V.polygon(t,y,N)},n}g(D0,"taggedWaveEdgedRectangle");async function O0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=Math.max(a.width+t.padding,(t==null?void 0:t.width)||0),s=Math.max(a.height+t.padding,(t==null?void 0:t.height)||0),c=-o/2,l=-s/2,h=n.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",c).attr("y",l).attr("width",o).attr("height",s),Q(t,h),t.intersect=function(u){return V.rect(t,u)},n}g(O0,"text");var XL=g((e,t,r,i,n,a)=>`M${e},${t} a${n},${a} 0,0,1 0,${-i} l${r},0 a${n},${a} 0,0,1 0,${i} M${r},${-i} a${n},${a} 0,0,0 0,${i} l${-r},0`,"createCylinderPathD"),ZL=g((e,t,r,i,n,a)=>[`M${e},${t}`,`M${e+r},${t}`,`a${n},${a} 0,0,0 0,${-i}`,`l${-r},0`,`a${n},${a} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),KL=g((e,t,r,i,n,a)=>[`M${e+r/2},${-i/2}`,`a${n},${a} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD");async function R0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o,halfPadding:s}=await ct(e,t,st(t)),c=t.look==="neo"?s*2:s,l=a.height+c,h=l/2,u=h/(2.5+l/50),f=a.width+u+c,{cssStyles:d}=t;let p;if(t.look==="handDrawn"){const m=X.svg(n),y=ZL(0,0,f,l,u,h),x=KL(0,0,f,l,u,h),b=m.path(y,K(t,{})),C=m.path(x,K(t,{fill:"none"}));p=n.insert(()=>C,":first-child"),p=n.insert(()=>b,":first-child"),p.attr("class","basic label-container"),d&&p.attr("style",d)}else{const m=XL(0,0,f,l,u,h);p=n.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",re(d)).attr("style",i),p.attr("class","basic label-container"),d&&p.selectAll("path").attr("style",d),i&&p.selectAll("path").attr("style",i)}return p.attr("label-offset-x",u),p.attr("transform",`translate(${-f/2}, ${l/2} )`),o.attr("transform",`translate(${-(a.width/2)-u-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Q(t,p),t.intersect=function(m){const y=V.rect(t,m),x=y.y-(t.y??0);if(h!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-u)){let b=u*u*(1-x*x/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=u-b,m.x-(t.x??0)>0&&(b=-b),y.x+=b}return y},n}g(R0,"tiltedCylinder");async function I0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=a.width+t.padding,s=a.height+t.padding,c=[{x:-3*s/6,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:0,y:-s}];let l;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=X.svg(n),f=K(t,{}),d=mt(c),p=u.path(d,f);l=n.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),h&&l.attr("style",h)}else l=nr(n,o,s,c);return i&&l.attr("style",i),t.width=o,t.height=s,Q(t,l),t.intersect=function(u){return V.polygon(t,c,u)},n}g(I0,"trapezoid");async function P0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=60,s=20,c=Math.max(o,a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s,a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),{cssStyles:h}=t,u=X.svg(n),f=K(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const d=[{x:-c/2*.8,y:-l/2},{x:c/2*.8,y:-l/2},{x:c/2,y:-l/2*.6},{x:c/2,y:l/2},{x:-c/2,y:l/2},{x:-c/2,y:-l/2*.6}],p=mt(d),m=u.path(p,f),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",h),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),Q(t,y),t.intersect=function(x){return V.polygon(t,d,x)},n}g(P0,"trapezoidalPentagon");async function N0(e,t){var b;const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Dt((b=xt().flowchart)==null?void 0:b.htmlLabels),c=a.width+(t.padding??0),l=c+a.height,h=c+a.height,u=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-l}],{cssStyles:f}=t,d=X.svg(n),p=K(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=mt(u),y=d.path(m,p),x=n.insert(()=>y,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return f&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),t.width=c,t.height=l,Q(t,x),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${l/2-(a.height+(t.padding??0)/(s?2:1)-(a.y-(a.top??0)))})`),t.intersect=function(C){return I.info("Triangle intersect",t,u,C),V.polygon(t,u,C)},n}g(N0,"triangle");async function z0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=c/8,h=c+l,{cssStyles:u}=t,d=70-s,p=d>0?d/2:0,m=X.svg(n),y=K(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-s/2-p,y:h/2},...ur(-s/2-p,h/2,s/2+p,h/2,l,.8),{x:s/2+p,y:-h/2},{x:-s/2-p,y:-h/2}],b=mt(x),C=m.path(b,y),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-l/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l-(a.y-(a.top??0))})`),Q(t,k),t.intersect=function(w){return V.polygon(t,x,w)},n}g(z0,"waveEdgedRectangle");async function W0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await ct(e,t,st(t)),o=100,s=50,c=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=c/l;let u=c,f=l;u>f*h?f=u/h:u=f*h,u=Math.max(u,o),f=Math.max(f,s);const d=Math.min(f*.2,f/4),p=f+d*2,{cssStyles:m}=t,y=X.svg(n),x=K(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:-u/2,y:p/2},...ur(-u/2,p/2,u/2,p/2,d,1),{x:u/2,y:-p/2},...ur(u/2,-p/2,-u/2,-p/2,d,-1)],C=mt(b),k=y.path(C,x),w=n.insert(()=>k,":first-child");return w.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),Q(t,w),t.intersect=function(_){return V.polygon(t,b,_)},n}g(W0,"waveRectangle");async function q0(e,t){const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await ct(e,t,st(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=5,h=-s/2,u=-c/2,{cssStyles:f}=t,d=X.svg(n),p=K(t,{}),m=[{x:h-l,y:u-l},{x:h-l,y:u+c},{x:h+s,y:u+c},{x:h+s,y:u-l}],y=`M${h-l},${u-l} L${h+s},${u-l} L${h+s},${u+c} L${h-l},${u+c} L${h-l},${u-l} M${h-l},${u} L${h+s},${u} M${h},${u-l} L${h},${u+c}`;t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const x=d.path(y,p),b=n.insert(()=>x,":first-child");return b.attr("transform",`translate(${l/2}, ${l/2})`),b.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),o.attr("transform",`translate(${-(a.width/2)+l/2-(a.x-(a.left??0))}, ${-(a.height/2)+l/2-(a.y-(a.top??0))})`),Q(t,b),t.intersect=function(C){return V.polygon(t,m,C)},n}g(q0,"windowPane");async function Oc(e,t){var pt,ht,kt,nt;const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:lt}=he(),{background:ut}=lt,Ct={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ut}`]};await Oc(e,Ct)}const i=he();t.useHtmlLabels=i.htmlLabels;let n=((pt=i.er)==null?void 0:pt.diagramPadding)??10,a=((ht=i.er)==null?void 0:ht.entityPadding)??6;const{cssStyles:o}=t,{labelStyles:s,nodeStyles:c}=J(t);if(r.attributes.length===0&&t.label){const lt={rx:0,ry:0,labelPaddingX:n,labelPaddingY:n*1.5};er(t.label,i)+lt.labelPaddingX*20){const lt=u.width+n*2-(m+y+x+b);m+=lt/w,y+=lt/w,x>0&&(x+=lt/w),b>0&&(b+=lt/w)}const v=m+y+x+b,D=X.svg(h),N=K(t,{});t.look!=="handDrawn"&&(N.roughness=0,N.fillStyle="solid");let O=0;p.length>0&&(O=p.reduce((lt,ut)=>lt+((ut==null?void 0:ut.rowHeight)??0),0));const T=Math.max(_.width+n*2,(t==null?void 0:t.width)||0,v),R=Math.max((O??0)+u.height,(t==null?void 0:t.height)||0),L=-T/2,M=-R/2;h.selectAll("g:not(:first-child)").each((lt,ut,Ct)=>{const z=gt(Ct[ut]),j=z.attr("transform");let et=0,P=0;if(j){const ft=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(j);ft&&(et=parseFloat(ft[1]),P=parseFloat(ft[2]),z.attr("class").includes("attribute-name")?et+=m:z.attr("class").includes("attribute-keys")?et+=m+y:z.attr("class").includes("attribute-comment")&&(et+=m+y+x))}z.attr("transform",`translate(${L+n/2+et}, ${P+M+u.height+a/2})`)}),h.select(".name").attr("transform","translate("+-u.width/2+", "+(M+a/2)+")");const F=D.rectangle(L,M,T,R,N),B=h.insert(()=>F,":first-child").attr("style",o.join("")),{themeVariables:$}=he(),{rowEven:E,rowOdd:q,nodeBorder:Y}=$;d.push(0);for(const[lt,ut]of p.entries()){const z=(lt+1)%2===0&&ut.yOffset!==0,j=D.rectangle(L,u.height+M+(ut==null?void 0:ut.yOffset),T,ut==null?void 0:ut.rowHeight,{...N,fill:z?E:q,stroke:Y});h.insert(()=>j,"g.label").attr("style",o.join("")).attr("class",`row-rect-${z?"even":"odd"}`)}let U=D.line(L,u.height+M,T+L,u.height+M,N);h.insert(()=>U).attr("class","divider"),U=D.line(m+L,u.height+M,m+L,R+M,N),h.insert(()=>U).attr("class","divider"),C&&(U=D.line(m+y+L,u.height+M,m+y+L,R+M,N),h.insert(()=>U).attr("class","divider")),k&&(U=D.line(m+y+x+L,u.height+M,m+y+x+L,R+M,N),h.insert(()=>U).attr("class","divider"));for(const lt of d)U=D.line(L,u.height+M+lt,T+L,u.height+M+lt,N),h.insert(()=>U).attr("class","divider");if(Q(t,B),c&&t.look!=="handDrawn"){const lt=c.split(";"),ut=(nt=lt==null?void 0:lt.filter(Ct=>Ct.includes("stroke")))==null?void 0:nt.map(Ct=>`${Ct}`).join("; ");h.selectAll("path").attr("style",ut??""),h.selectAll(".row-rect-even path").attr("style",c)}return t.intersect=function(lt){return V.rect(t,lt)},h}g(Oc,"erBox");async function Qr(e,t,r,i=0,n=0,a=[],o=""){const s=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${i}, ${n})`).attr("style",o);t!==mh(t)&&(t=mh(t),t=t.replaceAll("<","<").replaceAll(">",">"));const c=s.node().appendChild(await dr(s,t,{width:er(t,r)+100,style:o,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=c.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let l=c.getBBox();if(Dt(r.htmlLabels)){const h=c.children[0];h.style.textAlign="start";const u=gt(c);l=h.getBoundingClientRect(),u.attr("width",l.width),u.attr("height",l.height)}return l}g(Qr,"addText");async function H0(e,t,r,i,n=r.class.padding??12){const a=i?0:3,o=e.insert("g").attr("class",st(t)).attr("id",t.domId||t.id);let s=null,c=null,l=null,h=null,u=0,f=0,d=0;if(s=o.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await on(s,{text:`«${b}»`},0),u=s.node().getBBox().height}c=o.insert("g").attr("class","label-group text"),await on(c,t,0,["font-weight: bolder"]);const p=c.node().getBBox();f=p.height,l=o.insert("g").attr("class","members-group text");let m=0;for(const b of t.members){const C=await on(l,b,m,[b.parseClassifier()]);m+=C+a}d=l.node().getBBox().height,d<=0&&(d=n/2),h=o.insert("g").attr("class","methods-group text");let y=0;for(const b of t.methods){const C=await on(h,b,y,[b.parseClassifier()]);y+=C+a}let x=o.node().getBBox();if(s!==null){const b=s.node().getBBox();s.attr("transform",`translate(${-b.width/2})`)}return c.attr("transform",`translate(${-p.width/2}, ${u})`),x=o.node().getBBox(),l.attr("transform",`translate(0, ${u+f+n*2})`),x=o.node().getBBox(),h.attr("transform",`translate(0, ${u+f+(d?d+n*4:n*2)})`),x=o.node().getBBox(),{shapeSvg:o,bbox:x}}g(H0,"textHelper");async function on(e,t,r,i=[]){const n=e.insert("g").attr("class","label").attr("style",i.join("; ")),a=he();let o="useHtmlLabels"in t?t.useHtmlLabels:Dt(a.htmlLabels)??!0,s="";"text"in t?s=t.text:s=t.label,!o&&s.startsWith("\\")&&(s=s.substring(1)),xi(s)&&(o=!0);const c=await dr(n,_s(Hr(s)),{width:er(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let l,h=1;if(o){const u=c.children[0],f=gt(c);h=u.innerHTML.split("
    ").length,u.innerHTML.includes("")&&(h+=u.innerHTML.split("").length-1);const d=u.getElementsByTagName("img");if(d){const p=s.replace(/]*>/g,"").trim()==="";await Promise.all([...d].map(m=>new Promise(y=>{function x(){var b;if(m.style.display="flex",m.style.flexDirection="column",p){const C=((b=a.fontSize)==null?void 0:b.toString())??window.getComputedStyle(document.body).fontSize,w=parseInt(C,10)*5+"px";m.style.minWidth=w,m.style.maxWidth=w}else m.style.width="100%";y(m)}g(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}l=u.getBoundingClientRect(),f.attr("width",l.width),f.attr("height",l.height)}else{i.includes("font-weight: bolder")&>(c).selectAll("tspan").attr("font-weight",""),h=c.children.length;const u=c.children[0];(c.textContent===""||c.textContent.includes(">"))&&(u.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),s[1]===" "&&(u.textContent=u.textContent[0]+" "+u.textContent.substring(1))),u.textContent==="undefined"&&(u.textContent=""),l=c.getBBox()}return n.attr("transform","translate(0,"+(-l.height/(2*h)+r)+")"),l.height}g(on,"addText");async function U0(e,t){var N,O;const r=xt(),i=r.class.padding??12,n=i,a=t.useHtmlLabels??Dt(r.htmlLabels)??!0,o=t;o.annotations=o.annotations??[],o.members=o.members??[],o.methods=o.methods??[];const{shapeSvg:s,bbox:c}=await H0(e,t,r,a,n),{labelStyles:l,nodeStyles:h}=J(t);t.labelStyle=l,t.cssStyles=o.styles||"";const u=((N=o.styles)==null?void 0:N.join(";"))||h||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const f=o.members.length===0&&o.methods.length===0&&!((O=r.class)!=null&&O.hideEmptyMembersBox),d=X.svg(s),p=K(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=c.width;let y=c.height;o.members.length===0&&o.methods.length===0?y+=n:o.members.length>0&&o.methods.length===0&&(y+=n*2);const x=-m/2,b=-y/2,C=d.rectangle(x-i,b-i-(f?i:o.members.length===0&&o.methods.length===0?-i/2:0),m+2*i,y+2*i+(f?i*2:o.members.length===0&&o.methods.length===0?-i:0),p),k=s.insert(()=>C,":first-child");k.attr("class","basic label-container");const w=k.node().getBBox();s.selectAll(".text").each((T,R,L)=>{var q;const M=gt(L[R]),F=M.attr("transform");let B=0;if(F){const U=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(F);U&&(B=parseFloat(U[2]))}let $=B+b+i-(f?i:o.members.length===0&&o.methods.length===0?-i/2:0);a||($-=4);let E=x;(M.attr("class").includes("label-group")||M.attr("class").includes("annotation-group"))&&(E=-((q=M.node())==null?void 0:q.getBBox().width)/2||0,s.selectAll("text").each(function(Y,U,pt){window.getComputedStyle(pt[U]).textAnchor==="middle"&&(E=0)})),M.attr("transform",`translate(${E}, ${$})`)});const _=s.select(".annotation-group").node().getBBox().height-(f?i/2:0)||0,v=s.select(".label-group").node().getBBox().height-(f?i/2:0)||0,D=s.select(".members-group").node().getBBox().height-(f?i/2:0)||0;if(o.members.length>0||o.methods.length>0||f){const T=d.line(w.x,_+v+b+i,w.x+w.width,_+v+b+i,p);s.insert(()=>T).attr("class","divider").attr("style",u)}if(f||o.members.length>0||o.methods.length>0){const T=d.line(w.x,_+v+D+b+n*2+i,w.x+w.width,_+v+D+b+i+n*2,p);s.insert(()=>T).attr("class","divider").attr("style",u)}if(o.look!=="handDrawn"&&s.selectAll("path").attr("style",u),k.select(":nth-child(2)").attr("style",u),s.selectAll(".divider").select("path").attr("style",u),t.labelStyle?s.selectAll("span").attr("style",t.labelStyle):s.selectAll("span").attr("style",u),!a){const T=RegExp(/color\s*:\s*([^;]*)/),R=T.exec(u);if(R){const L=R[0].replace("color","fill");s.selectAll("tspan").attr("style",L)}else if(l){const L=T.exec(l);if(L){const M=L[0].replace("color","fill");s.selectAll("tspan").attr("style",M)}}}return Q(t,k),t.intersect=function(T){return V.rect(t,T)},s}g(U0,"classBox");async function Y0(e,t){var _,v;const{labelStyles:r,nodeStyles:i}=J(t);t.labelStyle=r;const n=t,a=t,o=20,s=20,c="verifyMethod"in t,l=st(t),h=e.insert("g").attr("class",l).attr("id",t.domId??t.id);let u;c?u=await Ee(h,`<<${n.type}>>`,0,t.labelStyle):u=await Ee(h,"<<Element>>",0,t.labelStyle);let f=u;const d=await Ee(h,n.name,f,t.labelStyle+"; font-weight: bold;");if(f+=d+s,c){const D=await Ee(h,`${n.requirementId?`id: ${n.requirementId}`:""}`,f,t.labelStyle);f+=D;const N=await Ee(h,`${n.text?`Text: ${n.text}`:""}`,f,t.labelStyle);f+=N;const O=await Ee(h,`${n.risk?`Risk: ${n.risk}`:""}`,f,t.labelStyle);f+=O,await Ee(h,`${n.verifyMethod?`Verification: ${n.verifyMethod}`:""}`,f,t.labelStyle)}else{const D=await Ee(h,`${a.type?`Type: ${a.type}`:""}`,f,t.labelStyle);f+=D,await Ee(h,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,f,t.labelStyle)}const p=(((_=h.node())==null?void 0:_.getBBox().width)??200)+o,m=(((v=h.node())==null?void 0:v.getBBox().height)??200)+o,y=-p/2,x=-m/2,b=X.svg(h),C=K(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=b.rectangle(y,x,p,m,C),w=h.insert(()=>k,":first-child");if(w.attr("class","basic label-container").attr("style",i),h.selectAll(".label").each((D,N,O)=>{const T=gt(O[N]),R=T.attr("transform");let L=0,M=0;if(R){const E=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);E&&(L=parseFloat(E[1]),M=parseFloat(E[2]))}const F=M-m/2;let B=y+o/2;(N===0||N===1)&&(B=L),T.attr("transform",`translate(${B}, ${F+o})`)}),f>u+d+s){const D=b.line(y,x+u+d+s,y+p,x+u+d+s,C);h.insert(()=>D).attr("style",i)}return Q(t,w),t.intersect=function(D){return V.rect(t,D)},h}g(Y0,"requirementBox");async function Ee(e,t,r,i=""){if(t==="")return 0;const n=e.insert("g").attr("class","label").attr("style",i),a=xt(),o=a.htmlLabels??!0,s=await dr(n,_s(Hr(t)),{width:er(t,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:i},a);let c;if(o){const l=s.children[0],h=gt(s);c=l.getBoundingClientRect(),h.attr("width",c.width),h.attr("height",c.height)}else{const l=s.children[0];for(const h of l.children)h.textContent=h.textContent.replaceAll(">",">").replaceAll("<","<"),i&&h.setAttribute("style",i);c=s.getBBox(),c.height+=6}return n.attr("transform",`translate(${-c.width/2},${-c.height/2+r})`),c.height}g(Ee,"addText");var QL=g(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function j0(e,t,{config:r}){var R,L;const{labelStyles:i,nodeStyles:n}=J(t);t.labelStyle=i||"";const a=10,o=t.width;t.width=(t.width??200)-10;const{shapeSvg:s,bbox:c,label:l}=await ct(e,t,st(t)),h=t.padding||10;let u="",f;"ticket"in t&&t.ticket&&((R=r==null?void 0:r.kanban)!=null&&R.ticketBaseUrl)&&(u=(L=r==null?void 0:r.kanban)==null?void 0:L.ticketBaseUrl.replace("#TICKET#",t.ticket),f=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const d={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,m;f?{label:p,bbox:m}=await Ao(f,"ticket"in t&&t.ticket||"",d):{label:p,bbox:m}=await Ao(s,"ticket"in t&&t.ticket||"",d);const{label:y,bbox:x}=await Ao(s,"assigned"in t&&t.assigned||"",d);t.width=o;const b=10,C=(t==null?void 0:t.width)||0,k=Math.max(m.height,x.height)/2,w=Math.max(c.height+b*2,(t==null?void 0:t.height)||0)+k,_=-C/2,v=-w/2;l.attr("transform","translate("+(h-C/2)+", "+(-k-c.height/2)+")"),p.attr("transform","translate("+(h-C/2)+", "+(-k+c.height/2)+")"),y.attr("transform","translate("+(h+C/2-x.width-2*a)+", "+(-k+c.height/2)+")");let D;const{rx:N,ry:O}=t,{cssStyles:T}=t;if(t.look==="handDrawn"){const M=X.svg(s),F=K(t,{}),B=N||O?M.path(ir(_,v,C,w,N||0),F):M.rectangle(_,v,C,w,F);D=s.insert(()=>B,":first-child"),D.attr("class","basic label-container").attr("style",T||null)}else{D=s.insert("rect",":first-child"),D.attr("class","basic label-container __APA__").attr("style",n).attr("rx",N??5).attr("ry",O??5).attr("x",_).attr("y",v).attr("width",C).attr("height",w);const M="priority"in t&&t.priority;if(M){const F=s.append("line"),B=_+2,$=v+Math.floor((N??0)/2),E=v+w-Math.floor((N??0)/2);F.attr("x1",B).attr("y1",$).attr("x2",B).attr("y2",E).attr("stroke-width","4").attr("stroke",QL(M))}}return Q(t,D),t.height=w,t.intersect=function(M){return V.rect(t,M)},s}g(j0,"kanbanItem");var JL=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:M0},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:v0},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:A0},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:F0},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Km},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Um},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:C0},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:n0},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:p0},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:d0},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:I0},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:u0},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Jm},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:O0},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:qm},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:S0},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:E0},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:B0},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:r0},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:a0},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Gm},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Vm},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Xm},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:g0},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:z0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:i0},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:R0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:m0},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Zm},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Qm},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:N0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:q0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:t0},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:P0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:e0},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:T0},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:b0},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:x0},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Wm},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:jm},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:D0},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:$0},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:W0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:w0},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:y0}],tB=g(()=>{const t=[...Object.entries({state:L0,choice:Hm,note:_0,rectWithTitle:k0,labelRect:f0,iconSquare:c0,iconCircle:o0,icon:s0,iconRounded:l0,imageSquare:h0,anchor:zm,kanbanItem:j0,classBox:U0,erBox:Oc,requirementBox:Y0}),...JL.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(n=>[n,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),G0=tB();function eB(e){return e in G0}g(eB,"isValidShape");var Hs=new Map;async function V0(e,t,r){let i,n;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const a=t.shape?G0[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),n=await a(i,t,r)}else n=await a(e,t,r),i=n;return t.tooltip&&n.attr("title",t.tooltip),Hs.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(V0,"insertNode");var f3=g((e,t)=>{Hs.set(t.id,e)},"setNodeElem"),d3=g(()=>{Hs.clear()},"clear"),p3=g(e=>{const t=Hs.get(e.id);I.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),rB=g((e,t,r,i,n,a)=>{t.arrowTypeStart&&qu(e,"start",t.arrowTypeStart,r,i,n,a),t.arrowTypeEnd&&qu(e,"end",t.arrowTypeEnd,r,i,n,a)},"addEdgeMarkers"),iB={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},qu=g((e,t,r,i,n,a,o)=>{var u;const s=iB[r];if(!s){I.warn(`Unknown arrow type: ${r}`);return}const c=s.type,h=`${n}_${a}-${c}${t==="start"?"Start":"End"}`;if(o&&o.trim()!==""){const f=o.replace(/[^\dA-Za-z]/g,"_"),d=`${h}_${f}`;if(!document.getElementById(d)){const p=document.getElementById(h);if(p){const m=p.cloneNode(!0);m.id=d,m.querySelectorAll("path, circle, line").forEach(x=>{x.setAttribute("stroke",o),s.fill&&x.setAttribute("fill",o)}),(u=p.parentNode)==null||u.appendChild(m)}}e.attr(`marker-${t}`,`url(${i}#${d})`)}else e.attr(`marker-${t}`,`url(${i}#${h})`)},"addEdgeMarker"),ps=new Map,qt=new Map,g3=g(()=>{ps.clear(),qt.clear()},"clear"),tn=g(e=>e?e.reduce((r,i)=>r+";"+i,""):"","getLabelStyles"),nB=g(async(e,t)=>{let r=Dt(xt().flowchart.htmlLabels);const i=await dr(e,t.label,{style:tn(t.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1});I.info("abc82",t,t.labelType);const n=e.insert("g").attr("class","edgeLabel"),a=n.insert("g").attr("class","label");a.node().appendChild(i);let o=i.getBBox();if(r){const c=i.children[0],l=gt(i);o=c.getBoundingClientRect(),l.attr("width",o.width),l.attr("height",o.height)}a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),ps.set(t.id,n),t.width=o.width,t.height=o.height;let s;if(t.startLabelLeft){const c=await Sr(t.startLabelLeft,tn(t.labelStyle)),l=e.insert("g").attr("class","edgeTerminals"),h=l.insert("g").attr("class","inner");s=h.node().appendChild(c);const u=c.getBBox();h.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),qt.get(t.id)||qt.set(t.id,{}),qt.get(t.id).startLeft=l,ln(s,t.startLabelLeft)}if(t.startLabelRight){const c=await Sr(t.startLabelRight,tn(t.labelStyle)),l=e.insert("g").attr("class","edgeTerminals"),h=l.insert("g").attr("class","inner");s=l.node().appendChild(c),h.node().appendChild(c);const u=c.getBBox();h.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),qt.get(t.id)||qt.set(t.id,{}),qt.get(t.id).startRight=l,ln(s,t.startLabelRight)}if(t.endLabelLeft){const c=await Sr(t.endLabelLeft,tn(t.labelStyle)),l=e.insert("g").attr("class","edgeTerminals"),h=l.insert("g").attr("class","inner");s=h.node().appendChild(c);const u=c.getBBox();h.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),l.node().appendChild(c),qt.get(t.id)||qt.set(t.id,{}),qt.get(t.id).endLeft=l,ln(s,t.endLabelLeft)}if(t.endLabelRight){const c=await Sr(t.endLabelRight,tn(t.labelStyle)),l=e.insert("g").attr("class","edgeTerminals"),h=l.insert("g").attr("class","inner");s=h.node().appendChild(c);const u=c.getBBox();h.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),l.node().appendChild(c),qt.get(t.id)||qt.set(t.id,{}),qt.get(t.id).endRight=l,ln(s,t.endLabelRight)}return i},"insertEdgeLabel");function ln(e,t){xt().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(ln,"setTerminalWidth");var aB=g((e,t)=>{I.debug("Moving label abc88 ",e.id,e.label,ps.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=xt(),{subGraphTitleTotalMargin:n}=Vl(i);if(e.label){const a=ps.get(e.id);let o=e.x,s=e.y;if(r){const c=$e.calcLabelPosition(r);I.debug("Moving label "+e.label+" from (",o,",",s,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(o=c.x,s=c.y)}a.attr("transform",`translate(${o}, ${s+n/2})`)}if(e.startLabelLeft){const a=qt.get(e.id).startLeft;let o=e.x,s=e.y;if(r){const c=$e.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=c.x,s=c.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.startLabelRight){const a=qt.get(e.id).startRight;let o=e.x,s=e.y;if(r){const c=$e.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=c.x,s=c.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.endLabelLeft){const a=qt.get(e.id).endLeft;let o=e.x,s=e.y;if(r){const c=$e.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=c.x,s=c.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.endLabelRight){const a=qt.get(e.id).endRight;let o=e.x,s=e.y;if(r){const c=$e.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=c.x,s=c.y}a.attr("transform",`translate(${o}, ${s})`)}},"positionEdgeLabel"),sB=g((e,t)=>{const r=e.x,i=e.y,n=Math.abs(t.x-r),a=Math.abs(t.y-i),o=e.width/2,s=e.height/2;return n>=o||a>=s},"outsideNode"),oB=g((e,t,r)=>{I.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(t)} insidePoint : ${JSON.stringify(r)} node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,n=e.y,a=Math.abs(i-r.x),o=e.width/2;let s=r.xMath.abs(i-t.x)*c){let u=r.y{I.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],n=!1;return e.forEach(a=>{if(I.info("abc88 checking point",a,t),!sB(t,a)&&!n){const o=oB(t,i,a);I.debug("abc88 inside",a,i,o),I.debug("abc88 intersection",o,t);let s=!1;r.forEach(c=>{s=s||c.x===o.x&&c.y===o.y}),r.some(c=>c.x===o.x&&c.y===o.y)?I.warn("abc88 no intersect",o,r):r.push(o),n=!0}else I.warn("abc88 outside",a,i),i=a,n||r.push(a)}),I.debug("returning points",r),r},"cutPathAtIntersect");function X0(e){const t=[],r=[];for(let i=1;i5&&Math.abs(a.y-n.y)>5||n.y===a.y&&a.x===o.x&&Math.abs(a.x-n.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}g(X0,"extractCornerPoints");var Uu=g(function(e,t,r){const i=t.x-e.x,n=t.y-e.y,a=Math.sqrt(i*i+n*n),o=r/a;return{x:t.x-o*i,y:t.y-o*n}},"findAdjacentPoint"),lB=g(function(e){const{cornerPointPositions:t}=X0(e),r=[];for(let i=0;i10&&Math.abs(a.y-n.y)>=10){I.debug("Corner point fixing",Math.abs(a.x-n.x),Math.abs(a.y-n.y));const d=5;o.x===s.x?f={x:l<0?s.x-d+u:s.x+d-u,y:h<0?s.y-u:s.y+u}:f={x:l<0?s.x-u:s.x+u,y:h<0?s.y-d+u:s.y+d-u}}else I.debug("Corner point skipping fixing",Math.abs(a.x-n.x),Math.abs(a.y-n.y));r.push(f,c)}else r.push(e[i]);return r},"fixCorners"),cB=g(function(e,t,r,i,n,a,o){var N;const{handDrawnSeed:s}=xt();let c=t.points,l=!1;const h=n;var u=a;const f=[];for(const O in t.cssCompiledStyles)up(O)||f.push(t.cssCompiledStyles[O]);u.intersect&&h.intersect&&(c=c.slice(1,t.points.length-1),c.unshift(h.intersect(c[0])),I.debug("Last point APA12",t.start,"-->",t.end,c[c.length-1],u,u.intersect(c[c.length-1])),c.push(u.intersect(c[c.length-1]))),t.toCluster&&(I.info("to cluster abc88",r.get(t.toCluster)),c=Hu(t.points,r.get(t.toCluster).node),l=!0),t.fromCluster&&(I.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(c,null,2)),c=Hu(c.reverse(),r.get(t.fromCluster).node).reverse(),l=!0);let d=c.filter(O=>!Number.isNaN(O.y));d=lB(d);let p=xa;switch(p=Ka,t.curve){case"linear":p=Ka;break;case"basis":p=xa;break;case"cardinal":p=mg;break;case"bumpX":p=ug;break;case"bumpY":p=fg;break;case"catmullRom":p=xg;break;case"monotoneX":p=vg;break;case"monotoneY":p=Sg;break;case"natural":p=Mg;break;case"step":p=Ag;break;case"stepAfter":p=Bg;break;case"stepBefore":p=Lg;break;default:p=xa}const{x:m,y}=D1(t),x=iS().x(m).y(y).curve(p);let b;switch(t.thickness){case"normal":b="edge-thickness-normal";break;case"thick":b="edge-thickness-thick";break;case"invisible":b="edge-thickness-invisible";break;default:b="edge-thickness-normal"}switch(t.pattern){case"solid":b+=" edge-pattern-solid";break;case"dotted":b+=" edge-pattern-dotted";break;case"dashed":b+=" edge-pattern-dashed";break;default:b+=" edge-pattern-solid"}let C,k=x(d);const w=Array.isArray(t.style)?t.style:t.style?[t.style]:[];let _=w.find(O=>O==null?void 0:O.startsWith("stroke:"));if(t.look==="handDrawn"){const O=X.svg(e);Object.assign([],d);const T=O.path(k,{roughness:.3,seed:s});b+=" transition",C=gt(T).select("path").attr("id",t.id).attr("class"," "+b+(t.classes?" "+t.classes:"")).attr("style",w?w.reduce((L,M)=>L+";"+M,""):"");let R=C.attr("d");C.attr("d",R),e.node().appendChild(C.node())}else{const O=f.join(";"),T=w?w.reduce((M,F)=>M+F+";",""):"";let R="";t.animate&&(R=" edge-animation-fast"),t.animation&&(R=" edge-animation-"+t.animation);const L=O?O+";"+T+";":T;C=e.append("path").attr("d",k).attr("id",t.id).attr("class"," "+b+(t.classes?" "+t.classes:"")+(R??"")).attr("style",L),_=(N=L.match(/stroke:([^;]+)/))==null?void 0:N[1]}let v="";(xt().flowchart.arrowMarkerAbsolute||xt().state.arrowMarkerAbsolute)&&(v=Mf(!0)),I.info("arrowTypeStart",t.arrowTypeStart),I.info("arrowTypeEnd",t.arrowTypeEnd),rB(C,t,v,o,i,_);let D={};return l&&(D.updatedPath=c),D.originalPath=t.points,D},"insertEdge"),hB=g((e,t,r,i)=>{t.forEach(n=>{TB[n](e,r,i)})},"insertMarkers"),uB=g((e,t,r)=>{I.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),fB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),dB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),pB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),gB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),mB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),yB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),xB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),bB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),_B=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),CB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),wB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),kB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),vB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 L0,20`)},"requirement_arrow"),SB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),TB={extension:uB,composition:fB,aggregation:dB,dependency:pB,lollipop:gB,point:mB,circle:yB,cross:xB,barb:bB,only_one:_B,zero_or_one:CB,one_or_more:wB,zero_or_more:kB,requirement_arrow:vB,requirement_contains:SB},MB=hB,AB={common:Ai,getConfig:he,insertCluster:RL,insertEdge:cB,insertEdgeLabel:nB,insertMarkers:MB,insertNode:V0,interpolateToCurve:mc,labelHelper:ct,log:I,positionEdgeLabel:aB},Tn={},Z0=g(e=>{for(const t of e)Tn[t.name]=t},"registerLayoutLoaders"),LB=g(()=>{Z0([{name:"dagre",loader:g(async()=>await wt(()=>import("./dagre-JOIXM2OF-CN_2gOz7.js"),__vite__mapDeps([11,12,13,14,15,16,3,2,4,1,5,6])),"loader")}])},"registerDefaultLayoutLoaders");LB();var m3=g(async(e,t)=>{if(!(e.layoutAlgorithm in Tn))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=Tn[e.layoutAlgorithm];return(await r.loader()).render(e,t,AB,{algorithm:r.algorithm})},"render"),y3=g((e="",{fallback:t="dagre"}={})=>{if(e in Tn)return e;if(t in Tn)return I.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Yu={version:"11.9.0"},BB=g(e=>{var n;const{securityLevel:t}=xt();let r=gt("body");if(t==="sandbox"){const o=((n=gt(`#i${e}`).node())==null?void 0:n.contentDocument)??document;r=gt(o.body)}return r.select(`#${e}`)},"selectSvgElement"),K0="comm",Q0="rule",J0="decl",EB="@import",FB="@namespace",$B="@keyframes",DB="@layer",ty=Math.abs,Rc=String.fromCharCode;function ey(e){return e.trim()}function wa(e,t,r){return e.replace(t,r)}function OB(e,t,r){return e.indexOf(t,r)}function si(e,t){return e.charCodeAt(t)|0}function Ti(e,t,r){return e.slice(t,r)}function Fe(e){return e.length}function RB(e){return e.length}function aa(e,t){return t.push(e),e}var Us=1,Mi=1,ry=0,xe=0,Et=0,$i="";function Ic(e,t,r,i,n,a,o,s){return{value:e,root:t,parent:r,type:i,props:n,children:a,line:Us,column:Mi,length:o,return:"",siblings:s}}function IB(){return Et}function PB(){return Et=xe>0?si($i,--xe):0,Mi--,Et===10&&(Mi=1,Us--),Et}function ke(){return Et=xe2||Mn(Et)>3?"":" "}function qB(e,t){for(;--t&&ke()&&!(Et<48||Et>102||Et>57&&Et<65||Et>70&&Et<97););return Ys(e,ka()+(t<6&&sr()==32&&ke()==32))}function Tl(e){for(;ke();)switch(Et){case e:return xe;case 34:case 39:e!==34&&e!==39&&Tl(Et);break;case 40:e===41&&Tl(e);break;case 92:ke();break}return xe}function HB(e,t){for(;ke()&&e+Et!==57;)if(e+Et===84&&sr()===47)break;return"/*"+Ys(t,xe-1)+"*"+Rc(e===47?e:ke())}function UB(e){for(;!Mn(sr());)ke();return Ys(e,xe)}function YB(e){return zB(va("",null,null,null,[""],e=NB(e),0,[0],e))}function va(e,t,r,i,n,a,o,s,c){for(var l=0,h=0,u=o,f=0,d=0,p=0,m=1,y=1,x=1,b=0,C="",k=n,w=a,_=i,v=C;y;)switch(p=b,b=ke()){case 40:if(p!=108&&si(v,u-1)==58){OB(v+=wa(Lo(b),"&","&\f"),"&\f",ty(l?s[l-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:v+=Lo(b);break;case 9:case 10:case 13:case 32:v+=WB(p);break;case 92:v+=qB(ka()-1,7);continue;case 47:switch(sr()){case 42:case 47:aa(jB(HB(ke(),ka()),t,r,c),c),(Mn(p||1)==5||Mn(sr()||1)==5)&&Fe(v)&&Ti(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*m:s[l++]=Fe(v)*x;case 125*m:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+h:x==-1&&(v=wa(v,/\f/g,"")),d>0&&(Fe(v)-u||m===0&&p===47)&&aa(d>32?Gu(v+";",i,r,u-1,c):Gu(wa(v," ","")+";",i,r,u-2,c),c);break;case 59:v+=";";default:if(aa(_=ju(v,t,r,l,h,n,s,C,k=[],w=[],u,a),a),b===123)if(h===0)va(v,t,_,_,k,a,u,s,w);else{switch(f){case 99:if(si(v,3)===110)break;case 108:if(si(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?va(e,_,_,i&&aa(ju(e,_,_,0,0,n,s,C,n,k=[],u,w),w),n,w,u,s,i?k:w):va(v,_,_,_,[""],w,0,s,w)}}l=h=d=0,m=x=1,C=v="",u=o;break;case 58:u=1+Fe(v),d=p;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&PB()==125)continue}switch(v+=Rc(b),b*m){case 38:x=h>0?1:(v+="\f",-1);break;case 44:s[l++]=(Fe(v)-1)*x,x=1;break;case 64:sr()===45&&(v+=Lo(ke())),f=sr(),h=u=Fe(C=v+=UB(ka())),b++;break;case 45:p===45&&Fe(v)==2&&(m=0)}}return a}function ju(e,t,r,i,n,a,o,s,c,l,h,u){for(var f=n-1,d=n===0?a:[""],p=RB(d),m=0,y=0,x=0;m0?d[b]+" "+C:wa(C,/&\f/g,d[b])))&&(c[x++]=k);return Ic(e,t,r,n===0?Q0:s,c,l,h,u)}function jB(e,t,r,i){return Ic(e,t,r,K0,Rc(IB()),Ti(e,2,-2),0,i)}function Gu(e,t,r,i,n){return Ic(e,t,r,J0,Ti(e,0,i),Ti(e,i+1,-1),i,n)}function Ml(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),cE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./c4Diagram-6F6E4RAY-C4OTcfWH.js");return{diagram:t}},__vite__mapDeps([17,18,3,2,4,1,5,6]));return{id:iy,diagram:e}},"loader"),hE={id:iy,detector:lE,loader:cE},uE=hE,ny="flowchart",fE=g((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),dE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./flowDiagram-KYDEHFYC-bQunOOqx.js");return{diagram:t}},__vite__mapDeps([19,20,21,22,3,2,4,1,5,6]));return{id:ny,diagram:e}},"loader"),pE={id:ny,detector:fE,loader:dE},gE=pE,ay="flowchart-v2",mE=g((e,t)=>{var r,i,n;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),yE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./flowDiagram-KYDEHFYC-bQunOOqx.js");return{diagram:t}},__vite__mapDeps([19,20,21,22,3,2,4,1,5,6]));return{id:ay,diagram:e}},"loader"),xE={id:ay,detector:mE,loader:yE},bE=xE,sy="er",_E=g(e=>/^\s*erDiagram/.test(e),"detector"),CE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./erDiagram-3M52JZNH-Dit0Au5l.js");return{diagram:t}},__vite__mapDeps([23,21,22,3,2,4,1,5,6]));return{id:sy,diagram:e}},"loader"),wE={id:sy,detector:_E,loader:CE},kE=wE,oy="gitGraph",vE=g(e=>/^\s*gitGraph/.test(e),"detector"),SE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-GW3U2K7C-B8uxjbUp.js");return{diagram:t}},__vite__mapDeps([24,25,26,27,3,2,4,1,5,6,13,15,16]));return{id:oy,diagram:e}},"loader"),TE={id:oy,detector:vE,loader:SE},ME=TE,ly="gantt",AE=g(e=>/^\s*gantt/.test(e),"detector"),LE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./ganttDiagram-EK5VF46D-CiNscdK_.js");return{diagram:t}},__vite__mapDeps([28,2,3,4,1,5,6]));return{id:ly,diagram:e}},"loader"),BE={id:ly,detector:AE,loader:LE},EE=BE,cy="info",FE=g(e=>/^\s*info/.test(e),"detector"),$E=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./infoDiagram-LHK5PUON-4_fDDnTU.js");return{diagram:t}},__vite__mapDeps([29,27,3,2,4,1,5,6,13,15,16]));return{id:cy,diagram:e}},"loader"),DE={id:cy,detector:FE,loader:$E},hy="pie",OE=g(e=>/^\s*pie/.test(e),"detector"),RE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./pieDiagram-NIOCPIFQ-BQqCknB0.js");return{diagram:t}},__vite__mapDeps([30,25,27,3,2,4,1,5,6,13,15,16]));return{id:hy,diagram:e}},"loader"),IE={id:hy,detector:OE,loader:RE},uy="quadrantChart",PE=g(e=>/^\s*quadrantChart/.test(e),"detector"),NE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./quadrantDiagram-2OG54O6I-DEL86tlU.js");return{diagram:t}},__vite__mapDeps([31,3,2,4,1,5,6]));return{id:uy,diagram:e}},"loader"),zE={id:uy,detector:PE,loader:NE},WE=zE,fy="xychart",qE=g(e=>/^\s*xychart-beta/.test(e),"detector"),HE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./xychartDiagram-H2YORKM3-B0P6RHmU.js");return{diagram:t}},__vite__mapDeps([32,3,2,4,1,5,6]));return{id:fy,diagram:e}},"loader"),UE={id:fy,detector:qE,loader:HE},YE=UE,dy="requirement",jE=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),GE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./requirementDiagram-QOLK2EJ7-BL7NAKs4.js");return{diagram:t}},__vite__mapDeps([33,21,22,3,2,4,1,5,6]));return{id:dy,diagram:e}},"loader"),VE={id:dy,detector:jE,loader:GE},XE=VE,py="sequence",ZE=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),KE=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./sequenceDiagram-SKLFT4DO-DIFVJvLV.js");return{diagram:t}},__vite__mapDeps([34,18,26,3,2,4,1,5,6]));return{id:py,diagram:e}},"loader"),QE={id:py,detector:ZE,loader:KE},JE=QE,gy="class",tF=g((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),eF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./classDiagram-M3E45YP4--5o3ueLV.js");return{diagram:t}},__vite__mapDeps([35,36,20,21,22,3,2,4,1,5,6]));return{id:gy,diagram:e}},"loader"),rF={id:gy,detector:tF,loader:eF},iF=rF,my="classDiagram",nF=g((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),aF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./classDiagram-v2-YAWTLIQI--5o3ueLV.js");return{diagram:t}},__vite__mapDeps([37,36,20,21,22,3,2,4,1,5,6]));return{id:my,diagram:e}},"loader"),sF={id:my,detector:nF,loader:aF},oF=sF,yy="state",lF=g((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),cF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./stateDiagram-MI5ZYTHO-p_9A1Zz-.js");return{diagram:t}},__vite__mapDeps([38,39,21,22,12,13,14,15,3,2,4,1,5,6]));return{id:yy,diagram:e}},"loader"),hF={id:yy,detector:lF,loader:cF},uF=hF,xy="stateDiagram",fF=g((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),dF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-5AN5P6BG-BgF3Zds7.js");return{diagram:t}},__vite__mapDeps([40,39,21,22,3,2,4,1,5,6]));return{id:xy,diagram:e}},"loader"),pF={id:xy,detector:fF,loader:dF},gF=pF,by="journey",mF=g(e=>/^\s*journey/.test(e),"detector"),yF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./journeyDiagram-EWQZEKCU-3mQNk2Ac.js");return{diagram:t}},__vite__mapDeps([41,18,20,3,2,4,1,5,6]));return{id:by,diagram:e}},"loader"),xF={id:by,detector:mF,loader:yF},bF=xF,_F=g((e,t,r)=>{I.debug(`rendering svg for syntax error `);const i=BB(t),n=i.append("g");i.attr("viewBox","0 0 2412 512"),Af(i,100,512,!0),n.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),n.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),n.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),n.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),n.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),n.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),n.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),n.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),_y={draw:_F},CF=_y,wF={db:{},renderer:_y,parser:{parse:g(()=>{},"parse")}},kF=wF,Cy="flowchart-elk",vF=g((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*flowchart|graph/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),SF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./flowDiagram-KYDEHFYC-bQunOOqx.js");return{diagram:t}},__vite__mapDeps([19,20,21,22,3,2,4,1,5,6]));return{id:Cy,diagram:e}},"loader"),TF={id:Cy,detector:vF,loader:SF},MF=TF,wy="timeline",AF=g(e=>/^\s*timeline/.test(e),"detector"),LF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./timeline-definition-MYPXXCX6-D6pgan68.js");return{diagram:t}},__vite__mapDeps([42,3,2,4,1,5,6]));return{id:wy,diagram:e}},"loader"),BF={id:wy,detector:AF,loader:LF},EF=BF,ky="mindmap",FF=g(e=>/^\s*mindmap/.test(e),"detector"),$F=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./mindmap-definition-6CBA2TL7-Bw7JDe96.js");return{diagram:t}},__vite__mapDeps([43,44,2,3,4,1,5,6]));return{id:ky,diagram:e}},"loader"),DF={id:ky,detector:FF,loader:$F},OF=DF,vy="kanban",RF=g(e=>/^\s*kanban/.test(e),"detector"),IF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./kanban-definition-ZSS6B67P-BkdRKy_Z.js");return{diagram:t}},__vite__mapDeps([45,20,3,2,4,1,5,6]));return{id:vy,diagram:e}},"loader"),PF={id:vy,detector:RF,loader:IF},NF=PF,Sy="sankey",zF=g(e=>/^\s*sankey-beta/.test(e),"detector"),WF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./sankeyDiagram-4UZDY2LN-DV10Guqe.js");return{diagram:t}},__vite__mapDeps([46,3,2,4,1,5,6]));return{id:Sy,diagram:e}},"loader"),qF={id:Sy,detector:zF,loader:WF},HF=qF,Ty="packet",UF=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),YF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./diagram-5UYTHUR4-CG8dr_Lj.js");return{diagram:t}},__vite__mapDeps([47,25,27,3,2,4,1,5,6,13,15,16]));return{id:Ty,diagram:e}},"loader"),jF={id:Ty,detector:UF,loader:YF},My="radar",GF=g(e=>/^\s*radar-beta/.test(e),"detector"),VF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./diagram-ZTM2IBQH-Dc0knWAT.js");return{diagram:t}},__vite__mapDeps([48,25,27,3,2,4,1,5,6,13,15,16]));return{id:My,diagram:e}},"loader"),XF={id:My,detector:GF,loader:VF},Ay="block",ZF=g(e=>/^\s*block-beta/.test(e),"detector"),KF=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./blockDiagram-6J76NXCF-8aqEK87K.js");return{diagram:t}},__vite__mapDeps([49,20,16,13,12,3,2,4,1,5,6]));return{id:Ay,diagram:e}},"loader"),QF={id:Ay,detector:ZF,loader:KF},JF=QF,Ly="architecture",t$=g(e=>/^\s*architecture/.test(e),"detector"),e$=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./architectureDiagram-SUXI7LT5-97KzzNCH.js");return{diagram:t}},__vite__mapDeps([50,25,26,27,3,2,4,1,5,6,13,15,16,44]));return{id:Ly,diagram:e}},"loader"),r$={id:Ly,detector:t$,loader:e$},i$=r$,By="treemap",n$=g(e=>/^\s*treemap/.test(e),"detector"),a$=g(async()=>{const{diagram:e}=await wt(async()=>{const{diagram:t}=await import("./diagram-VMROVX33-DcK6br9E.js");return{diagram:t}},__vite__mapDeps([51,22,25,27,3,2,4,1,5,6,13,15,16]));return{id:By,diagram:e}},"loader"),s$={id:By,detector:n$,loader:a$},tf=!1,js=g(()=>{tf||(tf=!0,Aa("error",kF,e=>e.toLowerCase().trim()==="error"),Aa("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:g(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Do(MF,OF,i$),Do(uE,NF,oF,iF,kE,EE,DE,IE,XE,JE,bE,gE,EF,ME,gF,uF,bF,WE,HF,jF,YE,JF,XF,s$))},"addDiagrams"),o$=g(async()=>{I.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Ar).map(async([r,{detector:i,loader:n}])=>{if(n)try{Po(r)}catch{try{const{diagram:a,id:o}=await n();Aa(o,a,i)}catch(a){throw I.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Ar[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){I.error(`Failed to load ${t.length} external diagrams`);for(const r of t)I.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),l$="graphics-document document";function Ey(e,t){e.attr("role",l$),t!==""&&e.attr("aria-roledescription",t)}g(Ey,"setA11yDiagramInfo");function Fy(e,t,r,i){if(e.insert!==void 0){if(r){const n=`chart-desc-${i}`;e.attr("aria-describedby",n),e.insert("desc",":first-child").attr("id",n).text(r)}if(t){const n=`chart-title-${i}`;e.attr("aria-labelledby",n),e.insert("title",":first-child").attr("id",n).text(t)}}}g(Fy,"addSVGa11yTitleDescription");var Mr,Fl=(Mr=class{constructor(t,r,i,n,a){this.type=t,this.text=r,this.db=i,this.parser=n,this.renderer=a}static async fromText(t,r={}){var l,h;const i=he(),n=Ol(t,i);t=aA(t)+` `;try{Po(n)}catch{const u=Ox(n);if(!u)throw new pf(`Diagram ${n} not found.`);const{id:f,diagram:d}=await u();Aa(f,d)}const{db:a,parser:o,renderer:s,init:c}=Po(n);return o.parser&&(o.parser.yy=a),(l=a.clear)==null||l.call(a),c==null||c(i),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await o.parse(t),new Mr(n,t,a,o,s)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},g(Mr,"Diagram"),Mr),ef=[],c$=g(()=>{ef.forEach(e=>{e()}),ef=[]},"attachFunctions"),h$=g(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function $y(e){const t=e.match(df);if(!t)return{text:e,metadata:{}};let r=$1(t[1],{schema:F1})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}g($y,"extractFrontMatter");var u$=g(e=>e.replace(/\r\n?/g,` `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),f$=g(e=>{const{text:t,metadata:r}=$y(e),{displayMode:i,title:n,config:a={}}=r;return i&&(a.gantt||(a.gantt={}),a.gantt.displayMode=i),{title:n,config:a,text:t}},"processFrontmatter"),d$=g(e=>{const t=$e.detectInit(e)??{},r=$e.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):(r==null?void 0:r.type)==="wrap"&&(t.wrap=!0),{text:jM(e),directive:t}},"processDirectives");function Pc(e){const t=u$(e),r=f$(t),i=d$(r.text),n=Cc(r.config,i.directive);return e=h$(i.text),{code:e,title:r.title,config:n}}g(Pc,"preprocessDiagram");function Dy(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}g(Dy,"toBase64");var p$=5e4,g$="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",m$="sandbox",y$="loose",x$="http://www.w3.org/2000/svg",b$="http://www.w3.org/1999/xlink",_$="http://www.w3.org/1999/xhtml",C$="100%",w$="100%",k$="border:0;margin:0;",v$="margin:0",S$="allow-top-navigation-by-user-activation allow-popups",T$='The "iframe" tag is not supported by your browser.',M$=["foreignobject"],A$=["dominant-baseline"];function Nc(e){const t=Pc(e);return Ta(),Kx(t.config??{}),t}g(Nc,"processAndSetConfigs");async function Oy(e,t){js();try{const{code:r,config:i}=Nc(e);return{diagramType:(await Iy(r)).type,config:i}}catch(r){if(t!=null&&t.suppressErrors)return!1;throw r}}g(Oy,"parse");var rf=g((e,t,r=[])=>` .${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),L$=g((e,t=new Map)=>{var i;let r="";if(e.themeCSS!==void 0&&(r+=` ${e.themeCSS}`),e.fontFamily!==void 0&&(r+=` :root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=` :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const s=e.htmlLabels??((i=e.flowchart)==null?void 0:i.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(c=>{Ju(c.styles)||s.forEach(l=>{r+=rf(c.id,l,c.styles)}),Ju(c.textStyles)||(r+=rf(c.id,"tspan",((c==null?void 0:c.textStyles)||[]).map(l=>l.replace("color","fill"))))})}return r},"createCssStyles"),B$=g((e,t,r,i)=>{const n=L$(e,r),a=gb(t,n,e.themeVariables);return Ml(YB(`${i}{${a}}`),GB)},"createUserStyles"),E$=g((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Hr(i),i=i.replace(/
    /g,"
    "),i},"cleanUpSvgCode"),F$=g((e="",t)=>{var n,a;const r=(a=(n=t==null?void 0:t.viewBox)==null?void 0:n.baseVal)!=null&&a.height?t.viewBox.baseVal.height+"px":w$,i=Dy(`${e}`);return``},"putIntoIFrame"),nf=g((e,t,r,i,n)=>{const a=e.append("div");a.attr("id",r),i&&a.attr("style",i);const o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",x$);return n&&o.attr("xmlns:xlink",n),o.append("g"),e},"appendDivSvgG");function $l(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g($l,"sandboxedIframe");var $$=g((e,t,r,i)=>{var n,a,o;(n=e.getElementById(t))==null||n.remove(),(a=e.getElementById(r))==null||a.remove(),(o=e.getElementById(i))==null||o.remove()},"removeExistingElements"),D$=g(async function(e,t,r){var R,L,M,F,B,$;js();const i=Nc(t);t=i.code;const n=he();I.debug(n),t.length>((n==null?void 0:n.maxTextSize)??p$)&&(t=g$);const a="#"+e,o="i"+e,s="#"+o,c="d"+e,l="#"+c,h=g(()=>{const q=gt(f?s:l).node();q&&"remove"in q&&q.remove()},"removeTempElements");let u=gt("body");const f=n.securityLevel===m$,d=n.securityLevel===y$,p=n.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const E=$l(gt(r),o);u=gt(E.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=gt(r);nf(u,e,c,`font-family: ${p}`,b$)}else{if($$(document,e,c,o),f){const E=$l(gt("body"),o);u=gt(E.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=gt("body");nf(u,e,c)}let m,y;try{m=await Fl.fromText(t,{title:i.title})}catch(E){if(n.suppressErrorRendering)throw h(),E;m=await Fl.fromText("error"),y=E}const x=u.select(l).node(),b=m.type,C=x.firstChild,k=C.firstChild,w=(L=(R=m.renderer).getClasses)==null?void 0:L.call(R,t,m),_=B$(n,b,w,a),v=document.createElement("style");v.innerHTML=_,C.insertBefore(v,k);try{await m.renderer.draw(t,e,Yu.version,m)}catch(E){throw n.suppressErrorRendering?h():CF.draw(t,e,Yu.version),E}const D=u.select(`${l} svg`),N=(F=(M=m.db).getAccTitle)==null?void 0:F.call(M),O=($=(B=m.db).getAccDescription)==null?void 0:$.call(B);Py(b,D,N,O),u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",_$);let T=u.select(l).node().innerHTML;if(I.debug("config.arrowMarkerAbsolute",n.arrowMarkerAbsolute),T=E$(T,f,Dt(n.arrowMarkerAbsolute)),f){const E=u.select(l+" svg").node();T=F$(T,E)}else d||(T=gi.sanitize(T,{ADD_TAGS:M$,ADD_ATTR:A$,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(c$(),y)throw y;return h(),{diagramType:b,svg:T,bindFunctions:m.db.bindFunctions}},"render");function Ry(e={}){var i;const t=Ht({},e);t!=null&&t.fontFamily&&!((i=t.themeVariables)!=null&&i.fontFamily)&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),Xx(t),t!=null&&t.theme&&t.theme in Ze?t.themeVariables=Ze[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Ze.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?Vx(t):_f();Dl(r.logLevel),js()}g(Ry,"initialize");var Iy=g((e,t={})=>{const{code:r}=Pc(e);return Fl.fromText(r,t)},"getDiagramFromText");function Py(e,t,r,i){Ey(t,e),Fy(t,r,i,t.attr("id"))}g(Py,"addA11yInfo");var Rr=Object.freeze({render:D$,parse:Oy,getDiagramFromText:Iy,initialize:Ry,getConfig:he,setConfig:Cf,getSiteConfig:_f,updateSiteConfig:Zx,reset:g(()=>{Ta()},"reset"),globalReset:g(()=>{Ta(mi)},"globalReset"),defaultConfig:mi});Dl(he().logLevel);Ta(he());var O$=g((e,t,r)=>{I.warn(e),_c(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Ny=g(async function(e={querySelector:".mermaid"}){try{await R$(e)}catch(t){if(_c(t)&&I.error(t.str),fe.parseError&&fe.parseError(t),!e.suppressErrors)throw I.error("Use the suppressErrors option to suppress these errors"),t}},"run"),R$=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Rr.getConfig();I.debug(`${e?"":"No "}Callback function found`);let n;if(r)n=r;else if(t)n=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");I.debug(`Found ${n.length} diagrams`),(i==null?void 0:i.startOnLoad)!==void 0&&(I.debug("Start On Load: "+(i==null?void 0:i.startOnLoad)),Rr.updateSiteConfig({startOnLoad:i==null?void 0:i.startOnLoad}));const a=new $e.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let o;const s=[];for(const c of Array.from(n)){if(I.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const l=`mermaid-${a.next()}`;o=c.innerHTML,o=um($e.entityDecode(o)).trim().replace(//gi,"
    ");const h=$e.detectInit(o);h&&I.debug("Detected early reinit: ",h);try{const{svg:u,bindFunctions:f}=await Hy(l,o,c);c.innerHTML=u,e&&await e(l),f&&f(c)}catch(u){O$(u,s,fe.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),zy=g(function(e){Rr.initialize(e)},"initialize"),I$=g(async function(e,t,r){I.warn("mermaid.init is deprecated. Please use run instead."),e&&zy(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Ny(i)},"init"),P$=g(async(e,{lazyLoad:t=!0}={})=>{js(),Do(...e),t===!1&&await o$()},"registerExternalDiagrams"),Wy=g(function(){if(fe.startOnLoad){const{startOnLoad:e}=Rr.getConfig();e&&fe.run().catch(t=>I.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Wy,!1);var N$=g(function(e){fe.parseError=e},"setParseErrorHandler"),gs=[],Bo=!1,qy=g(async()=>{if(!Bo){for(Bo=!0;gs.length>0;){const e=gs.shift();if(e)try{await e()}catch(t){I.error("Error executing queue",t)}}Bo=!1}},"executeQueue"),z$=g(async(e,t)=>new Promise((r,i)=>{const n=g(()=>new Promise((a,o)=>{Rr.parse(e,t).then(s=>{a(s),r(s)},s=>{var c;I.error("Error parsing",s),(c=fe.parseError)==null||c.call(fe,s),o(s),i(s)})}),"performCall");gs.push(n),qy().catch(i)}),"parse"),Hy=g((e,t,r)=>new Promise((i,n)=>{const a=g(()=>new Promise((o,s)=>{Rr.render(e,t,r).then(c=>{o(c),i(c)},c=>{var l;I.error("Error parsing",c),(l=fe.parseError)==null||l.call(fe,c),s(c),n(c)})}),"performCall");gs.push(a),qy().catch(n)}),"render"),W$=g(()=>Object.keys(Ar).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),fe={startOnLoad:!0,mermaidAPI:Rr,parse:z$,render:Hy,init:I$,run:Ny,registerExternalDiagrams:P$,registerLayoutLoaders:Z0,initialize:zy,parseError:void 0,contentLoaded:Wy,setParseErrorHandler:N$,detectType:Ol,registerIconPacks:cL,getRegisteredDiagramsMetadata:W$},x3=fe;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution */export{mh as $,V$ as A,Y$ as B,hn as C,$x as D,vb as E,Cc as F,he as G,xf as H,KM as I,F1 as J,BB as K,Yu as L,Is as M,i3 as N,Kp as O,n3 as P,Wx as Q,Tk as R,yk as S,uL as T,iS as U,xi as V,j$ as W,Mf as X,Rl as Y,qM as Z,g as _,xb as a,NM as a$,xa as a0,ZM as a1,Ln as a2,fb as a3,An as a4,G as a5,it as a6,Lf as a7,RL as a8,V0 as a9,Ju as aA,In as aB,cL as aC,lL as aD,e3 as aE,Z$ as aF,X$ as aG,J$ as aH,nx as aI,Q$ as aJ,ag as aK,oc as aL,Ls as aM,Dk as aN,$k as aO,vi as aP,Fk as aQ,Ek as aR,Va as aS,$n as aT,ac as aU,nc as aV,ei as aW,Ga as aX,K$ as aY,r3 as aZ,zr as a_,p3 as aa,D1 as ab,Dt as ac,dr as ad,Vl as ae,km as af,Hr as ag,Zg as ah,Vp as ai,Zp as aj,t3 as ak,J as al,up as am,MB as an,d3 as ao,g3 as ap,u3 as aq,Q as ar,f3 as as,cB as at,aB as au,nB as av,PM as aw,BT as ax,EM as ay,fc as az,yb as b,qg as b0,Fs as b1,Rs as b2,ns as b3,Ug as b4,Wg as b5,gM as b6,IM as b7,BM as b8,yT as b9,zM as bA,Os as bB,dc as ba,uM as bb,WM as bc,On as bd,Bi as be,es as bf,wM as bg,KB as bh,Dn as bi,is as bj,mM as bk,Og as bl,_T as bm,CT as bn,_r as bo,Cu as bp,wT as bq,pc as br,bT as bs,ST as bt,Ei as bu,fr as bv,mu as bw,gc as bx,Ig as by,Bl as bz,xt as c,gt as d,Af as e,Ht as f,_b as g,er as h,Lr as i,N1 as j,Ai as k,I as l,x3 as m,Qg as n,G$ as o,y3 as p,Cb as q,m3 as r,bb as s,wb as t,$e as u,$1 as v,tA as w,eB as x,a3 as y,mb as z};