var _ve=Object.defineProperty;var Ave=(t,e,r)=>e in t?_ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Cr=(t,e,r)=>Ave(t,typeof e!="symbol"?e+"":e,r);const Rve="modulepreload",Lve=function(t){return"/"+t},DF={},Bt=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=s(r.map(u=>{if(u=Lve(u),u in DF)return;DF[u]=!0;const h=u.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=h?"stylesheet":Rve,h||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),h)return new Promise((p,g)=>{f.addEventListener("load",p),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var $H=Object.defineProperty,x=(t,e)=>$H(t,"name",{value:e,configurable:!0}),vS=(t,e)=>{for(var r in e)$H(t,r,{get:e[r],enumerable:!0})};function jl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var N2={exports:{}},Ive=N2.exports,MF;function Dve(){return MF||(MF=1,(function(t,e){(function(r,n){t.exports=n()})(Ive,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="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+)?$/,v=/\[([^\]]+)]|YYYY|YY|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,T={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(A){var I=["th","st","nd","rd"],O=A%100;return"["+A+(I[(O-20)%10]||I[O]||I[0])+"]"}},b=function(A,I,O){var N=String(A);return!N||N.length>=I?A:""+Array(I+1-N.length).join(O)+A},C={s:b,z:function(A){var I=-A.utcOffset(),O=Math.abs(I),N=Math.floor(O/60),M=O%60;return(I<=0?"+":"-")+b(N,2,"0")+":"+b(M,2,"0")},m:function A(I,O){if(I.date()1)return A(F[0])}else{var V=I.name;S[V]=I,M=V}return!N&&M&&(w=M),M||!N&&w},D=function(A,I){if(_(A))return A.clone();var O=typeof I=="object"?I:{};return O.date=A,O.args=arguments,new B(O)},L=C;L.l=R,L.i=_,L.w=function(A,I){return D(A,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var B=(function(){function A(O){this.$L=R(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[E]=!0}var I=A.prototype;return I.parse=function(O){this.$d=(function(N){var M=N.date,P=N.utc;if(M===null)return new Date(NaN);if(L.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var F=M.match(y);if(F){var V=F[2]-1||0,z=(F[7]||"0").substring(0,3);return P?new Date(Date.UTC(F[1],V,F[3]||1,F[4]||0,F[5]||0,F[6]||0,z)):new Date(F[1],V,F[3]||1,F[4]||0,F[5]||0,F[6]||0,z)}}return new Date(M)})(O),this.init()},I.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},I.$utils=function(){return L},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(O,N){var M=D(O);return this.startOf(N)<=M&&M<=this.endOf(N)},I.isAfter=function(O,N){return D(O){},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},GM=x(function(t="fatal"){let e=il.fatal;typeof t=="string"?t.toLowerCase()in il&&(e=il[t]):typeof t=="number"&&(e=t),he.trace=()=>{},he.debug=()=>{},he.info=()=>{},he.warn=()=>{},he.error=()=>{},he.fatal=()=>{},e<=il.fatal&&(he.fatal=console.error?console.error.bind(console,ls("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ls("FATAL"))),e<=il.error&&(he.error=console.error?console.error.bind(console,ls("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ls("ERROR"))),e<=il.warn&&(he.warn=console.warn?console.warn.bind(console,ls("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ls("WARN"))),e<=il.info&&(he.info=console.info?console.info.bind(console,ls("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ls("INFO"))),e<=il.debug&&(he.debug=console.debug?console.debug.bind(console,ls("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ls("DEBUG"))),e<=il.trace&&(he.trace=console.debug?console.debug.bind(console,ls("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ls("TRACE")))},"setLogLevel"),ls=x(t=>`%c${li().format("ss.SSS")} : ${t} : `,"format");const O2={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return O2.hue2rgb(a,i,t+1/3)*255;case"g":return O2.hue2rgb(a,i,t)*255;case"b":return O2.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},Ove={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},rr={channel:O2,lang:Nve,unit:Ove},yc={};for(let t=0;t<=255;t++)yc[t]=rr.unit.dec2hex(t);const zi={ALL:0,RGB:1,HSL:2};let $ve=class{constructor(){this.type=zi.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=zi.ALL}is(e){return this.type===e}};class Pve{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new $ve}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=zi.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=rr.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=rr.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=rr.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=rr.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=rr.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=rr.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(zi.HSL)&&r!==void 0?r:(this._ensureHSL(),rr.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(zi.HSL)&&r!==void 0?r:(this._ensureHSL(),rr.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(zi.HSL)&&r!==void 0?r:(this._ensureHSL(),rr.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(zi.RGB)&&r!==void 0?r:(this._ensureRGB(),rr.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(zi.RGB)&&r!==void 0?r:(this._ensureRGB(),rr.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(zi.RGB)&&r!==void 0?r:(this._ensureRGB(),rr.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(zi.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(zi.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(zi.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(zi.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(zi.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(zi.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const xS=new Pve({r:0,g:0,b:0,a:0},"transparent"),np={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(np.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return xS.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${yc[Math.round(e)]}${yc[Math.round(r)]}${yc[Math.round(n)]}${yc[Math.round(i*255)]}`:`#${yc[Math.round(e)]}${yc[Math.round(r)]}${yc[Math.round(n)]}`}},bh={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:t=>{const e=t.match(bh.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return rr.channel.clamp.h(parseFloat(r)*.9);case"rad":return rr.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return rr.channel.clamp.h(parseFloat(r)*360)}}return rr.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(bh.re);if(!r)return;const[,n,i,a,s,o]=r;return xS.set({h:bh._hue2deg(n),s:rr.channel.clamp.s(parseFloat(i)),l:rr.channel.clamp.l(parseFloat(a)),a:s?rr.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${rr.lang.round(e)}, ${rr.lang.round(r)}%, ${rr.lang.round(n)}%, ${i})`:`hsl(${rr.lang.round(e)}, ${rr.lang.round(r)}%, ${rr.lang.round(n)}%)`}},q1={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:t=>{t=t.toLowerCase();const e=q1.colors[t];if(e)return np.parse(e)},stringify:t=>{const e=np.stringify(t);for(const r in q1.colors)if(q1.colors[r]===e)return r}},f1={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:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(f1.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return xS.set({r:rr.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:rr.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:rr.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?rr.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${rr.lang.round(e)}, ${rr.lang.round(r)}, ${rr.lang.round(n)}, ${rr.lang.round(i)})`:`rgb(${rr.lang.round(e)}, ${rr.lang.round(r)}, ${rr.lang.round(n)})`}},ro={format:{keyword:q1,hex:np,rgb:f1,rgba:f1,hsl:bh,hsla:bh},parse:t=>{if(typeof t!="string")return t;const e=np.parse(t)||f1.parse(t)||bh.parse(t)||q1.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(zi.HSL)||t.data.r===void 0?bh.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?f1.stringify(t):np.stringify(t)},PH=(t,e)=>{const r=ro.parse(t);for(const n in e)r[n]=rr.channel.clamp[n](e[n]);return ro.stringify(r)},Hs=(t,e,r=0,n=1)=>{if(typeof t!="number")return PH(t,{a:e});const i=xS.set({r:rr.channel.clamp.r(t),g:rr.channel.clamp.g(e),b:rr.channel.clamp.b(r),a:rr.channel.clamp.a(n)});return ro.stringify(i)},VM=(t,e)=>rr.lang.round(ro.parse(t)[e]),Bve=t=>{const{r:e,g:r,b:n}=ro.parse(t),i=.2126*rr.channel.toLinear(e)+.7152*rr.channel.toLinear(r)+.0722*rr.channel.toLinear(n);return rr.lang.round(i)},Fve=t=>Bve(t)>=.5,ga=t=>!Fve(t),WM=(t,e,r)=>{const n=ro.parse(t),i=n[e],a=rr.channel.clamp[e](i+r);return i!==a&&(n[e]=a),ro.stringify(n)},He=(t,e)=>WM(t,"l",e),Ye=(t,e)=>WM(t,"l",-e),NF=(t,e)=>WM(t,"a",-e),pe=(t,e)=>{const r=ro.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return PH(t,n)},zve=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=ro.parse(t),{r:o,g:l,b:u,a:h}=ro.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,T=i*m+l*y,b=a*m+u*y,C=s*d+h*(1-d);return Hs(v,T,b,C)},Ge=(t,e=100)=>{const r=ro.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,zve(r,t,e)};/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function OF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:qn(BigInt.prototype.toString),GF=typeof Symbol>"u"?null:qn(Symbol.prototype.toString),Ra=qn(Object.prototype.hasOwnProperty),Mv=qn(Object.prototype.toString),Fi=qn(RegExp.prototype.test),Su=e1e(TypeError);function qn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:p1;if($F&&$F(t,null),!ip(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(Hve(e)||(e[n]=a),i=a)}t[i]=!0}return t}function t1e(t){for(let e=0;e/g),l1e=di(/\${[\w\W]*/g),c1e=di(/^data-[\-\w.\u00B7-\uFFFF]+$/),u1e=di(/^aria-[\-\w]+$/),HF=di(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),h1e=di(/^(?:\w+script|data):/i),d1e=di(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),f1e=di(/^html$/i),p1e=di(/^[a-z][.\w]*(-[.\w]+)+$/i),YF=di(/<[/\w!]/g),XF=di(/<[/\w]/g),g1e=di(/<\/no(script|embed|frames)/i),m1e=di(/\/>/i),Ha={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zH=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],y1e=Qn(_r({},zH)),v1e=(function(){const t={};return zu(zH,e=>{t[e]=di(new RegExp("])","i"))}),Qn(t)})(),x1e=function(){return typeof window>"u"?null:window},b1e=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},jF=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},hc=function(e,r,n,i){return Ra(e,r)&&ip(e[r])?_r(i.base?ja(i.base):{},e[r],i.transform):n},lA=function(e,r,n){const i=Ra(e,r)?e[r]:void 0;return i&&typeof i=="object"?ja(i):n()};function GH(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x1e();const e=gt=>GH(gt);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==Ha.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=Ds(f,"cloneNode"),g=Ds(f,"remove"),m=Ds(f,"nextSibling"),y=Ds(f,"childNodes"),v=Ds(f,"parentNode"),T=Ds(f,"shadowRoot"),b=Ds(f,"attributes"),C=s&&s.prototype?Ds(s.prototype,"nodeType"):null,w=s&&s.prototype?Ds(s.prototype,"nodeName"):null,S=s&&s.prototype?Ds(s.prototype,"ownerDocument"):null,E=function(Me){return C?C(Me):Me.nodeType},_=function(Me){return w?w(Me):Me.nodeName};if(typeof a=="function"){const gt=r.createElement("template");gt.content&>.content.ownerDocument&&(r=gt.content.ownerDocument)}let R,D="",L,B=!1,$=0;const A=function(){if($>0)throw Su('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},I=function(Me){A(),$++;try{return R.createHTML(Me)}finally{$--}},O=function(Me){A(),$++;try{return R.createScriptURL(Me)}finally{$--}},N=function(){return B||(L=b1e(d,i),B=!0),L},M=r,P=M.implementation,F=M.createNodeIterator,V=M.createDocumentFragment,z=M.getElementsByTagName,W=n.importNode;let X=jF();e.isSupported=typeof BH=="function"&&typeof v=="function"&&P&&P.createHTMLDocument!==void 0;const j=s1e,re=o1e,Q=l1e,oe=c1e,ee=u1e,ne=h1e,ie=d1e,ae=p1e;let de=HF,le=null;const ye=_r({},[...VF,...iA,...aA,...sA,...WF]);let $e=null;const Fe=_r({},[...qF,...oA,...UF,..._T]);let ce=Object.seal(mf(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}})),ve=null,Ce=null;const Ne=Object.seal(mf(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ie=!0,Ae=!0,be=!1,ke=!0,se=!1,J=!0,G=!1,q=!1,H=null,Z=null,te=!1,K=!1,U=!1,Y=!1,fe=!0,ue=!1;const Te="user-content-";let ge=!0,we=!1,xe={},Le=null;const _e=_r({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Be=null;const Ee=_r({},["audio","video","img","source","image","track"]);let Xe=null;const Re=_r({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Qe="http://www.w3.org/1998/Math/MathML",it="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let mt=Ue,ot=!1,Ke=null;const me=_r({},[Qe,it,Ue],nA),dt=Qn(["mi","mo","mn","ms","mtext"]);let at=_r({},dt);const et=Qn(["annotation-xml"]);let ct=_r({},et);const Gt=_r({},["title","style","font","a","script"]);let Se=null;const We=["application/xhtml+xml","text/html"],Je="text/html";let nt=null,wt=null;const Vt=r.createElement("form"),Mt=function(Me){return Me instanceof RegExp||Me instanceof Function},Yt=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wt&&wt===Me)return;(!Me||typeof Me!="object")&&(Me={}),Me=ja(Me),Se=We.indexOf(Me.PARSER_MEDIA_TYPE)===-1?Je:Me.PARSER_MEDIA_TYPE,nt=Se==="application/xhtml+xml"?nA:p1,le=hc(Me,"ALLOWED_TAGS",ye,{transform:nt}),$e=hc(Me,"ALLOWED_ATTR",Fe,{transform:nt}),Ke=hc(Me,"ALLOWED_NAMESPACES",me,{transform:nA}),Xe=hc(Me,"ADD_URI_SAFE_ATTR",Re,{transform:nt,base:Re}),Be=hc(Me,"ADD_DATA_URI_TAGS",Ee,{transform:nt,base:Ee}),Le=hc(Me,"FORBID_CONTENTS",_e,{transform:nt}),ve=hc(Me,"FORBID_TAGS",ja({}),{transform:nt}),Ce=hc(Me,"FORBID_ATTR",ja({}),{transform:nt}),xe=Ra(Me,"USE_PROFILES")?Me.USE_PROFILES&&typeof Me.USE_PROFILES=="object"?ja(Me.USE_PROFILES):Me.USE_PROFILES:!1,Ie=Me.ALLOW_ARIA_ATTR!==!1,Ae=Me.ALLOW_DATA_ATTR!==!1,be=Me.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=Me.ALLOW_SELF_CLOSE_IN_ATTR!==!1,se=Me.SAFE_FOR_TEMPLATES||!1,J=Me.SAFE_FOR_XML!==!1,G=Me.WHOLE_DOCUMENT||!1,K=Me.RETURN_DOM||!1,U=Me.RETURN_DOM_FRAGMENT||!1,Y=Me.RETURN_TRUSTED_TYPE||!1,te=Me.FORCE_BODY||!1,fe=Me.SANITIZE_DOM!==!1,ue=Me.SANITIZE_NAMED_PROPS||!1,ge=Me.KEEP_CONTENT!==!1,we=Me.IN_PLACE||!1,de=n1e(Me.ALLOWED_URI_REGEXP)?Me.ALLOWED_URI_REGEXP:HF,mt=typeof Me.NAMESPACE=="string"?Me.NAMESPACE:Ue,at=lA(Me,"MATHML_TEXT_INTEGRATION_POINTS",()=>_r({},dt)),ct=lA(Me,"HTML_INTEGRATION_POINTS",()=>_r({},et));const Ve=lA(Me,"CUSTOM_ELEMENT_HANDLING",()=>mf(null));if(ce=mf(null),Ra(Ve,"tagNameCheck")&&Mt(Ve.tagNameCheck)&&(ce.tagNameCheck=Ve.tagNameCheck),Ra(Ve,"attributeNameCheck")&&Mt(Ve.attributeNameCheck)&&(ce.attributeNameCheck=Ve.attributeNameCheck),Ra(Ve,"allowCustomizedBuiltInElements")&&typeof Ve.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=Ve.allowCustomizedBuiltInElements),di(ce),se&&(Ae=!1),U&&(K=!0),xe&&(le=_r({},WF),$e=mf(null),xe.html===!0&&(_r(le,VF),_r($e,qF)),xe.svg===!0&&(_r(le,iA),_r($e,oA),_r($e,_T)),xe.svgFilters===!0&&(_r(le,aA),_r($e,oA),_r($e,_T)),xe.mathMl===!0&&(_r(le,sA),_r($e,UF),_r($e,_T))),Ne.tagCheck=null,Ne.attributeCheck=null,Ra(Me,"ADD_TAGS")&&(typeof Me.ADD_TAGS=="function"?Ne.tagCheck=Me.ADD_TAGS:ip(Me.ADD_TAGS)&&(le===ye&&(le=ja(le)),_r(le,Me.ADD_TAGS,nt))),Ra(Me,"ADD_ATTR")&&(typeof Me.ADD_ATTR=="function"?Ne.attributeCheck=Me.ADD_ATTR:ip(Me.ADD_ATTR)&&($e===Fe&&($e=ja($e)),_r($e,Me.ADD_ATTR,nt))),Ra(Me,"ADD_FORBID_CONTENTS")&&ip(Me.ADD_FORBID_CONTENTS)&&(Le===_e&&(Le=ja(Le)),_r(Le,Me.ADD_FORBID_CONTENTS,nt)),ge&&(le["#text"]=!0),G&&_r(le,["html","head","body"]),le.table&&(_r(le,["tbody"]),delete ve.tbody),Me.TRUSTED_TYPES_POLICY){if(typeof Me.TRUSTED_TYPES_POLICY.createHTML!="function")throw Su('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Me.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Su('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ut=R;R=Me.TRUSTED_TYPES_POLICY;try{D=I("")}catch(vt){throw R=ut,vt}}else Me.TRUSTED_TYPES_POLICY===null?(R=void 0,D=""):(R===void 0&&(R=N()),R&&typeof D=="string"&&(D=I("")));Qn&&Qn(Me),wt=Me},$t=_r({},[...iA,...aA,...i1e]),tr=_r({},[...sA,...a1e]),Dt=function(Me,Ve,ut){return Ve.namespaceURI===Ue?Me==="svg":Ve.namespaceURI===Qe?Me==="svg"&&(ut==="annotation-xml"||at[ut]):!!$t[Me]},Xt=function(Me,Ve,ut){return Ve.namespaceURI===Ue?Me==="math":Ve.namespaceURI===it?Me==="math"&&ct[ut]:!!tr[Me]},hr=function(Me,Ve,ut){return Ve.namespaceURI===it&&!ct[ut]||Ve.namespaceURI===Qe&&!at[ut]?!1:!tr[Me]&&(Gt[Me]||!$t[Me])},je=function(Me){let Ve=v(Me);(!Ve||!Ve.tagName)&&(Ve={namespaceURI:mt,tagName:"template"});const ut=p1(Me.tagName),vt=p1(Ve.tagName);return Ke[Me.namespaceURI]?Me.namespaceURI===it?Dt(ut,Ve,vt):Me.namespaceURI===Qe?Xt(ut,Ve,vt):Me.namespaceURI===Ue?hr(ut,Ve,vt):!!(Se==="application/xhtml+xml"&&Ke[Me.namespaceURI]):!1},tt=function(Me){Iv(e.removed,{element:Me});try{v(Me).removeChild(Me)}catch{if(g(Me),!v(Me))throw Su("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},xt=function(Me,Ve,ut){try{Me.removeAttributeNode(Ve)}catch{try{Me.removeAttribute(ut)}catch{}}},Wt=function(Me){rt(Me);const Ve=y(Me);if(Ve){const vt=[];zu(Ve,Pt=>{Iv(vt,Pt)}),zu(vt,Pt=>{try{g(Pt)}catch{}})}const ut=b(Me);if(ut)for(let vt=ut.length-1;vt>=0;--vt){const Pt=ut[vt],nr=Pt&&Pt.name;typeof nr=="string"&&xt(Me,Pt,nr)}},ir=function(Me,Ve,ut){if(!ut)try{ut=Ve.getAttributeNode(Me)}catch{ut=null}Iv(e.removed,{attribute:ut||null,from:Ve});try{ut?Ve.removeAttributeNode(ut):Ve.removeAttribute(Me)}catch{try{Ve.removeAttribute(Me)}catch{}}if(Me==="is")if(K||U)try{tt(Ve)}catch{}else try{Ve.setAttribute(Me,"")}catch{}},st=function(Me){const Ve=b(Me);if(Ve)for(let ut=Ve.length-1;ut>=0;--ut){const vt=Ve[ut],Pt=vt&&vt.name;typeof Pt!="string"||$e[nt(Pt)]||xt(Me,vt,Pt)}},rt=function(Me){const Ve=[Me];for(;Ve.length>0;){const ut=Ve.pop();E(ut)===Ha.element&&st(ut);const Pt=y(ut);if(Pt)for(let nr=Pt.length-1;nr>=0;--nr)Ve.push(Pt[nr])}},pt=function(Me,Ve){return J?Me==="patchsrc"?!0:Me==="for"&&Ve!=="label"&&Ve!=="output":!1},Ze=function(Me){if(!J)return;const Ve=[Me];for(;Ve.length>0;){const ut=Ve.pop(),vt=E(ut);if(vt===Ha.processingInstruction||vt===Ha.comment&&Fi(XF,ut.data)){try{g(ut)}catch{}continue}if(vt===Ha.element){const nr=ut,jr=nt(_(ut));try{nr.hasAttribute&&nr.hasAttribute("patchsrc")&&nr.removeAttribute("patchsrc"),nr.hasAttribute&&nr.hasAttribute("for")&&pt("for",jr)&&nr.removeAttribute("for")}catch{}}const Pt=y(ut);if(Pt)for(let nr=Pt.length-1;nr>=0;--nr)Ve.push(Pt[nr])}},At=function(Me){let Ve=null,ut=null;if(te)Me=""+Me;else{const nr=BF(Me,/^[\r\n\t ]+/);ut=nr&&nr[0]}Se==="application/xhtml+xml"&&mt===Ue&&(Me=''+Me+"");const vt=R?I(Me):Me;if(mt===Ue)try{Ve=new h().parseFromString(vt,Se)}catch{}if(!Ve||!Ve.documentElement){Ve=P.createDocument(mt,"template",null);try{Ve.documentElement.innerHTML=ot?D:vt}catch{}}const Pt=Ve.body||Ve.documentElement;return Me&&ut&&Pt.insertBefore(r.createTextNode(ut),Pt.childNodes[0]||null),mt===Ue?z.call(Ve,G?"html":"body")[0]:G?Ve.documentElement:Pt},De=function(Me){const Ve=S?S(Me):Me.ownerDocument;return F.call(Ve||Me,Me,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Pr=function(Me){return Me=Dv(Me,j," "),Me=Dv(Me,re," "),Me=Dv(Me,Q," "),Me},Oe=function(Me){var Ve;Me.normalize();const ut=S?S(Me):Me.ownerDocument,vt=F.call(ut||Me,Me,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Pt=vt.nextNode();for(;Pt;)Pt.data=Pr(Pt.data),Pt=vt.nextNode();const nr=(Ve=Me.querySelectorAll)===null||Ve===void 0?void 0:Ve.call(Me,"template");nr&&zu(nr,jr=>{gr(jr.content)&&Oe(jr.content)})},ar=function(Me){const Ve=w?w(Me):null;return typeof Ve!="string"||nt(Ve)!=="form"?!1:typeof Me.nodeName!="string"||typeof Me.textContent!="string"||typeof Me.removeChild!="function"||Me.attributes!==b(Me)||typeof Me.removeAttribute!="function"||typeof Me.setAttribute!="function"||typeof Me.namespaceURI!="string"||typeof Me.insertBefore!="function"||typeof Me.hasChildNodes!="function"||Me.nodeType!==C(Me)||Me.childNodes!==y(Me)},gr=function(Me){if(!C||typeof Me!="object"||Me===null)return!1;try{return C(Me)===Ha.documentFragment}catch{return!1}},xn=function(Me){if(!C||typeof Me!="object"||Me===null)return!1;try{return typeof C(Me)=="number"}catch{return!1}};function cr(gt,Me,Ve){gt.length!==0&&zu(gt,ut=>{ut.call(e,Me,Ve,wt)})}const Vr=function(Me,Ve){return!!(J&&Me.hasChildNodes()&&!xn(Me.firstElementChild)&&Fi(YF,Me.textContent)&&Fi(YF,Me.innerHTML)||J&&Me.namespaceURI===Ue&&y1e[Ve]&&(xn(Me.firstElementChild)||typeof Me.textContent=="string"&&Fi(v1e[Ve],Me.textContent))||Me.nodeType===Ha.processingInstruction||J&&Me.nodeType===Ha.comment&&Fi(XF,Me.data))},mr=function(Me,Ve){if(Me instanceof RegExp)return Fi(Me,Ve);if(Me instanceof Function){for(var ut=arguments.length,vt=new Array(ut>2?ut-2:0),Pt=2;Pt=0;--jr){const bn=Me===ut?p(Pt[jr],!0):Pt[jr];vt.insertBefore(bn,m(Me))}}}return tt(Me),!0},Ls=function(Me,Ve,ut,vt){return Me.length===0?Ve:Ve===ut||Ve===vt?ja(Ve):Ve},co=function(Me,Ve){return Me===Ve||v(Me)!==null?!1:(we&&rt(Me),!0)},Cu=function(Me,Ve){if(cr(X.beforeSanitizeElements,Me,null),co(Me,Ve))return!0;if(ar(Me))return tt(Me),!0;const ut=nt(_(Me));if(le=Ls(X.uponSanitizeElement,le,ye,H),cr(X.uponSanitizeElement,Me,{tagName:ut,allowedTags:le}),co(Me,Ve))return!0;if(Vr(Me,ut))return tt(Me),!0;if(ve[ut]||!(Ne.tagCheck instanceof Function&&Ne.tagCheck(ut))&&!le[ut]){const Pt=$i(Me,ut,Ve);return Pt===!1&&cr(X.afterSanitizeElements,Me,null),Pt}if(E(Me)===Ha.element&&!je(Me)||(ut==="noscript"||ut==="noembed"||ut==="noframes")&&Fi(g1e,Me.innerHTML))return tt(Me),!0;if(se&&Me.nodeType===Ha.text){const Pt=Pr(Me.textContent);Me.textContent!==Pt&&(Iv(e.removed,{element:Me.cloneNode()}),Me.textContent=Pt)}return cr(X.afterSanitizeElements,Me,null),!1},wu=function(Me,Ve,ut){if(Ce[Ve]||pt(Ve,Me)||fe&&(Ve==="id"||Ve==="name")&&(ut in r||ut in Vt))return!1;const vt=$e[Ve]||Ne.attributeCheck instanceof Function&&Ne.attributeCheck(Ve,Me);return Ae&&Fi(oe,Ve)||Ie&&Fi(ee,Ve)?!0:vt?Xe[Ve]||Fi(de,Dv(ut,ie,""))||(Ve==="src"||Ve==="xlink:href"||Ve==="href")&&Me!=="script"&&FF(ut,"data:")===0&&Be[Me]||be&&!Fi(ne,Dv(ut,ie,""))?!0:!ut:Hn(Me)&&mr(ce.tagNameCheck,Me)&&mr(ce.attributeNameCheck,Ve,Me)||Ve==="is"&&ce.allowCustomizedBuiltInElements&&mr(ce.tagNameCheck,ut)},Eu=_r({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Hn=function(Me){return!Eu[p1(Me)]&&Fi(ae,Me)},Ca=function(Me,Ve,ut,vt){if(R&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!ut)switch(d.getAttributeType(Me,Ve)){case"TrustedHTML":return I(vt);case"TrustedScriptURL":return O(vt)}return vt},xi=function(Me,Ve,ut,vt){try{ut?Me.setAttributeNS(ut,Ve,vt):Me.setAttribute(Ve,vt),ar(Me)?tt(Me):PF(e.removed)}catch{ir(Ve,Me)}},Pn=function(Me){cr(X.beforeSanitizeAttributes,Me,null);const Ve=Me.attributes;if(!Ve||ar(Me))return;$e=Ls(X.uponSanitizeAttribute,$e,Fe,Z);const ut={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let vt=Ve.length;const Pt=nt(Me.nodeName);for(;vt--;){const nr=Ve[vt],jr=nr.name,bn=nr.namespaceURI,wa=nr.value,Ea=nt(jr),rA=wa;let Zi=jr==="value"?rA:Zve(rA);if(ut.attrName=Ea,ut.attrValue=Zi,ut.keepAttr=!0,ut.forceKeepAttr=void 0,cr(X.uponSanitizeAttribute,Me,ut),Zi=ut.attrValue,ue&&(Ea==="id"||Ea==="name")&&FF(Zi,Te)!==0&&(ir(jr,Me,nr),Zi=Te+Zi),J&&Fi(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Zi)){ir(jr,Me,nr);continue}if(Ea==="attributename"&&BF(Zi,"href")){ir(jr,Me,nr);continue}if(!ut.forceKeepAttr){if(!ut.keepAttr){ir(jr,Me,nr);continue}if(!ke&&Fi(m1e,Zi)){ir(jr,Me,nr);continue}if(se&&(Zi=Pr(Zi)),!wu(Pt,Ea,Zi)){ir(jr,Me,nr);continue}Zi=Ca(Pt,Ea,bn,Zi),Zi!==rA&&xi(Me,jr,bn,Zi)}}cr(X.afterSanitizeAttributes,Me,null)},Ua=function(Me){let Ve=null;const ut=De(Me);for(cr(X.beforeSanitizeShadowDOM,Me,null);Ve=ut.nextNode();)if(cr(X.uponSanitizeShadowNode,Ve,null),Cu(Ve,Me),Pn(Ve),gr(Ve.content)&&Ua(Ve.content),E(Ve)===Ha.element){const vt=T(Ve);gr(vt)&&(uc(vt),Ua(vt))}cr(X.afterSanitizeShadowDOM,Me,null)},uc=function(Me){const Ve=[{node:Me,shadow:null}];for(;Ve.length>0;){const ut=Ve.pop();if(ut.shadow){Ua(ut.shadow);continue}const vt=ut.node,nr=E(vt)===Ha.element,jr=y(vt);if(jr)for(let bn=jr.length-1;bn>=0;--bn)Ve.push({node:jr[bn],shadow:null});if(nr){const bn=w?w(vt):null;if(typeof bn=="string"&&nt(bn)==="template"){const wa=vt.content;gr(wa)&&Ve.push({node:wa,shadow:null})}}if(nr){const bn=T(vt);gr(bn)&&Ve.push({node:null,shadow:bn},{node:bn,shadow:null})}}};return e.sanitize=function(gt){let Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ve=null,ut=null,vt=null,Pt=null;if(ot=!gt,ot&&(gt=""),typeof gt!="string"&&!xn(gt)&&(gt=r1e(gt),typeof gt!="string"))throw Su("dirty is not a string, aborting");if(!e.isSupported)return gt;q?(le=H,$e=Z):Yt(Me),(X.uponSanitizeElement.length>0||X.uponSanitizeAttribute.length>0)&&(le=ja(le)),X.uponSanitizeAttribute.length>0&&($e=ja($e)),e.removed=[];const nr=we&&typeof gt!="string"&&xn(gt);if(nr){Ze(gt);const wa=_(gt);if(typeof wa=="string"){const Ea=nt(wa);if(!le[Ea]||ve[Ea])throw Wt(gt),Su("root node is forbidden and cannot be sanitized in-place")}if(ar(gt))throw Wt(gt),Su("root node is clobbered and cannot be sanitized in-place");try{uc(gt)}catch(Ea){throw Wt(gt),Ea}}else if(xn(gt))Ve=At(""),ut=Ve.ownerDocument.importNode(gt,!0),ut.nodeType===Ha.element&&ut.nodeName==="BODY"||ut.nodeName==="HTML"?Ve=ut:Ve.appendChild(ut),uc(ut);else{if(!K&&!se&&!G&>.indexOf("<")===-1)return R&&Y?I(gt):gt;if(Ve=At(gt),!Ve)return K?null:Y?D:""}Ve&&te&&tt(Ve.firstChild);const jr=nr?gt:Ve;try{const wa=De(jr);for(;vt=wa.nextNode();)Cu(vt,jr),Pn(vt),gr(vt.content)&&Ua(vt.content)}catch(wa){throw nr&&(Wt(gt),zu(e.removed,Ea=>{Ea.element&&rt(Ea.element)})),wa}if(nr)return zu(e.removed,wa=>{wa.element&&rt(wa.element)}),se&&Oe(gt),gt;if(K){if(se&&Oe(Ve),U)for(Pt=V.call(Ve.ownerDocument);Ve.firstChild;)Pt.appendChild(Ve.firstChild);else Pt=Ve;return($e.shadowroot||$e.shadowrootmode)&&(Pt=W.call(n,Pt,!0)),Pt}let bn=G?Ve.outerHTML:Ve.innerHTML;return G&&le["!doctype"]&&Ve.ownerDocument&&Ve.ownerDocument.doctype&&Ve.ownerDocument.doctype.name&&Fi(f1e,Ve.ownerDocument.doctype.name)&&(bn=" `+bn),se&&(bn=Pr(bn)),R&&Y?I(bn):bn},e.setConfig=function(){let gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yt(gt),q=!0,H=le,Z=$e},e.clearConfig=function(){wt=null,q=!1,H=null,Z=null,R=L,D=""},e.isValidAttribute=function(gt,Me,Ve){wt||Yt({});const ut=nt(gt),vt=nt(Me);return wu(ut,vt,Ve)},e.addHook=function(gt,Me){typeof Me=="function"&&Ra(X,gt)&&Iv(X[gt],Me)},e.removeHook=function(gt,Me){if(Ra(X,gt)){if(Me!==void 0){const Ve=jve(X[gt],Me);return Ve===-1?void 0:Kve(X[gt],Ve,1)[0]}return PF(X[gt])}},e.removeHooks=function(gt){Ra(X,gt)&&(X[gt]=[])},e.removeAllHooks=function(){X=jF()},e}var Dl=GH(),WI=x((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>WI(t,i,n)),t;if(Array.isArray(e)&&Array.isArray(t))return e.forEach(i=>{t.includes(i)||t.push(i)}),t;if(t==null||r<=0)return t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e;if(e!=null&&typeof t=="object"&&typeof e=="object"){const i=t;Object.entries(e).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(t,a)||Object.defineProperty(t,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[a]===void 0&&(i[a]=Array.isArray(s)?[]:{}),typeof i[a]=="object"&&(i[a]=WI(i[a],s,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(t,a)?i[a]=s:Object.defineProperty(t,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),Gn=WI,qo="#ffffff",Uo="#f2f2f2",er=x((t,e)=>e?pe(t,{s:-40,l:10}):pe(t,{s:-40,l:-10}),"mkBorder"),Sp,T1e=(Sp=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,C,w,S,E,_,R,D,L,B,$,A,I,O,N,M,P,F,V,z,W,X,j,re,Q,oe,ee,ne,ie,ae,de,le,ye;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||pe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||pe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||er(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||er(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||er(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ge(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ge(this.tertiaryColor),this.lineColor=this.lineColor||Ge(this.background),this.arrowheadColor=this.arrowheadColor||Ge(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?Ye(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||Ye(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ge(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,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||He(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.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Ye(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Ye(this.mainBkg,10)):(this.rowOdd=this.rowOdd||He(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||He(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||pe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||pe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||pe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||pe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||pe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||pe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||pe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||pe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||pe(this.primaryColor,{h:330}),this.darkMode)for(let $e=0;$e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Sp,"Theme"),Sp),C1e=x(t=>{const e=new T1e;return e.calculate(t),e},"getThemeVariables"),kp,w1e=(kp=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=He(this.primaryColor,16),this.tertiaryColor=pe(this.primaryColor,{h:-160}),this.primaryBorderColor=Ge(this.background),this.secondaryBorderColor=er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=er(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ge(this.primaryColor),this.secondaryTextColor=Ge(this.secondaryColor),this.tertiaryTextColor=Ge(this.tertiaryColor),this.lineColor=Ge(this.background),this.textColor=Ge(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=He(Ge("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Hs(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.radius=5,this.strokeWidth=1,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.clusterBkg="#302F3D",this.sectionBkgColor=Ye("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Ye(this.sectionBkgColor,10),this.taskBorderColor=Hs(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Hs(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||He(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Ye(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,C,w,S,E,_,R,D,L,B,$,A,I,O,N,M,P,F,V,z,W,X,j,re,Q,oe,ee,ne,ie,ae,de,le;this.secondBkg=He(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=He(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.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=He(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=Ge(this.doneTaskBkgColor),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=pe(this.primaryColor,{h:64}),this.fillType3=pe(this.secondaryColor,{h:64}),this.fillType4=pe(this.primaryColor,{h:-64}),this.fillType5=pe(this.secondaryColor,{h:-64}),this.fillType6=pe(this.primaryColor,{h:128}),this.fillType7=pe(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||pe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||pe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||pe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||pe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||pe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||pe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||pe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||pe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||pe(this.primaryColor,{h:330});for(let ye=0;ye{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(kp,"Theme"),kp),E1e=x(t=>{const e=new w1e;return e.calculate(t),e},"getThemeVariables"),_p,S1e=(_p=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=pe(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=pe(this.primaryColor,{h:-160}),this.primaryBorderColor=er(this.primaryColor,this.darkMode),this.secondaryBorderColor=er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=er(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ge(this.primaryColor),this.secondaryTextColor=Ge(this.secondaryColor),this.tertiaryTextColor=Ge(this.tertiaryColor),this.lineColor=Ge(this.background),this.textColor=Ge(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=er(this.primaryColor,this.darkMode),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.radius=5,this.strokeWidth=1,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.clusterBkg="#FBFBFF",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=Hs(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.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",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.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,C,w,S,E,_,R,D,L,B,$,A,I,O,N,M,P,F,V,z,W,X,j,re,Q,oe,ee,ne,ie,ae,de,le;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||pe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||pe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||pe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||pe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||pe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||pe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||pe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||pe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||pe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Ye(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Ye(this.tertiaryColor,40);for(let ye=0;ye{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(_p,"Theme"),_p),Kl=x(t=>{const e=new S1e;return e.calculate(t),e},"getThemeVariables"),Ap,k1e=(Ap=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=He("#cde498",10),this.primaryBorderColor=er(this.primaryColor,this.darkMode),this.secondaryBorderColor=er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=er(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ge(this.primaryColor),this.secondaryTextColor=Ge(this.secondaryColor),this.tertiaryTextColor=Ge(this.primaryColor),this.lineColor=Ge(this.background),this.textColor=Ge(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,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.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,C,w,S,E,_,R,D,L,B,$,A,I,O,N,M,P,F,V,z,W,X,j,re,Q,oe,ee,ne,ie,ae,de,le;this.actorBorder=Ye(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.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||pe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||pe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||pe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||pe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||pe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||pe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||pe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||pe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||pe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Ye(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Ye(this.tertiaryColor,40);for(let ye=0;ye{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Ap,"Theme"),Ap),_1e=x(t=>{const e=new k1e;return e.calculate(t),e},"getThemeVariables"),Rp,A1e=(Rp=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=He(this.contrast,55),this.background="#ffffff",this.tertiaryColor=pe(this.primaryColor,{h:-160}),this.primaryBorderColor=er(this.primaryColor,this.darkMode),this.secondaryBorderColor=er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=er(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ge(this.primaryColor),this.secondaryTextColor=Ge(this.secondaryColor),this.tertiaryTextColor=Ge(this.tertiaryColor),this.lineColor=Ge(this.background),this.textColor=Ge(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.radius=5,this.strokeWidth=1,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.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||He(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,C,w,S,E,_,R,D,L,B,$,A,I,O,N,M,P,F,V,z,W,X,j,re,Q,oe,ee,ne,ie,ae,de,le;this.secondBkg=He(this.contrast,55),this.border2=this.contrast,this.actorBorder=He(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,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 ye=0;ye{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Rp,"Theme"),Rp),R1e=x(t=>{const e=new A1e;return e.calculate(t),e},"getThemeVariables"),Lp,L1e=(Lp=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=er(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m,y;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||pe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||pe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||er(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||er(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||er(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ge(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ge(this.tertiaryColor),this.lineColor=this.lineColor||Ge(this.background),this.arrowheadColor=this.arrowheadColor||Ge(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?Ye(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||Ye(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ge(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=pe(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||He(e,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.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,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||"#f0f0f0",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||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||pe(e,{h:30}),this.cScale4=this.cScale4||pe(e,{h:60}),this.cScale5=this.cScale5||pe(e,{h:90}),this.cScale6=this.cScale6||pe(e,{h:120}),this.cScale7=this.cScale7||pe(e,{h:150}),this.cScale8=this.cScale8||pe(e,{h:210,l:150}),this.cScale9=this.cScale9||pe(e,{h:270}),this.cScale10=this.cScale10||pe(e,{h:300}),this.cScale11=this.cScale11||pe(e,{h:330}),this.darkMode)for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Lp,"Theme"),Lp),I1e=x(t=>{const e=new L1e;return e.calculate(t),e},"getThemeVariables"),Ip,D1e=(Ip=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=He(this.primaryColor,16),this.tertiaryColor=pe(this.primaryColor,{h:-160}),this.primaryBorderColor=Ge(this.background),this.secondaryBorderColor=er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=er(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ge(this.primaryColor),this.secondaryTextColor=Ge(this.secondaryColor),this.tertiaryTextColor=Ge(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=He(Ge("#323D47"),10),this.border1="#ccc",this.border2=Hs(255,255,255,.25),this.arrowheadColor=Ge(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||pe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||pe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||er(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||er(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||er(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ge(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ge(this.tertiaryColor),this.lineColor=this.lineColor||Ge(this.background),this.arrowheadColor=this.arrowheadColor||Ge(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.border1,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?Ye(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||Ye(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ge(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,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||He(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||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,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||"#f0f0f0",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||pe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||pe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||pe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||pe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||pe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||pe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||pe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||pe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||pe(this.primaryColor,{h:330}),this.darkMode)for(let g=0;g{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Ip,"Theme"),Ip),M1e=x(t=>{const e=new D1e;return e.calculate(t),e},"getThemeVariables"),Dp,N1e=(Dp=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=er("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m,y;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||pe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||pe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||er(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||er(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||er(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Ge(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ge(this.tertiaryColor),this.lineColor=this.lineColor||Ge(this.background),this.arrowheadColor=this.arrowheadColor||Ge(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?Ye(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,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||Ye(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ge(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=pe(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||He(e,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.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",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;for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Dp,"Theme"),Dp),O1e=x(t=>{const e=new N1e;return e.calculate(t),e},"getThemeVariables"),Mp,$1e=(Mp=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=He(this.primaryColor,16),this.tertiaryColor=pe(this.primaryColor,{h:-160}),this.primaryBorderColor=Ge(this.background),this.secondaryBorderColor=er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=er(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ge(this.primaryColor),this.secondaryTextColor=Ge(this.secondaryColor),this.tertiaryTextColor=Ge(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=He(Ge("#323D47"),10),this.border1="#ccc",this.border2=Hs(255,255,255,.25),this.arrowheadColor=Ge(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||pe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||pe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||er(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||er(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||er(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Ge(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ge(this.tertiaryColor),this.lineColor=this.lineColor||Ge(this.background),this.arrowheadColor=this.arrowheadColor||Ge(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.border1,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?Ye(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",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||Ye(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ge(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,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||He(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.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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",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||pe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||pe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||pe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||pe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||pe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||pe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||pe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||pe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||pe(this.primaryColor,{h:330}),this.darkMode)for(let g=0;g{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Mp,"Theme"),Mp),P1e=x(t=>{const e=new $1e;return e.calculate(t),e},"getThemeVariables"),Np,B1e=(Np=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=er(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m,y;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||pe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||pe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||er(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||er(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||er(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Ge(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ge(this.tertiaryColor),this.lineColor=this.lineColor||Ge(this.background),this.arrowheadColor=this.arrowheadColor||Ge(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?Ye(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||Ye(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ge(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=pe(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||He(e,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.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,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||"#f0f0f0",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||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Np,"Theme"),Np),F1e=x(t=>{const e=new B1e;return e.calculate(t),e},"getThemeVariables"),Op,z1e=(Op=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=He(this.primaryColor,16),this.tertiaryColor=pe(this.primaryColor,{h:-160}),this.primaryBorderColor=Ge(this.background),this.secondaryBorderColor=er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=er(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ge(this.primaryColor),this.secondaryTextColor=Ge(this.secondaryColor),this.tertiaryTextColor=Ge(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=He(Ge("#323D47"),10),this.border1="#ccc",this.border2=Hs(255,255,255,.25),this.arrowheadColor=Ge(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||pe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||pe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||er(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||er(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||er(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||er(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Ge(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ge(this.tertiaryColor),this.lineColor=this.lineColor||Ge(this.background),this.arrowheadColor=this.arrowheadColor||Ge(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.border1,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?Ye(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",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||Ye(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ge(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",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||He(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.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,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||"#f0f0f0",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||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let g=0;g{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Op,"Theme"),Op),G1e=x(t=>{const e=new z1e;return e.calculate(t),e},"getThemeVariables"),Ll={base:{getThemeVariables:C1e},dark:{getThemeVariables:E1e},default:{getThemeVariables:Kl},forest:{getThemeVariables:_1e},neutral:{getThemeVariables:R1e},neo:{getThemeVariables:I1e},"neo-dark":{getThemeVariables:M1e},redux:{getThemeVariables:O1e},"redux-dark":{getThemeVariables:P1e},"redux-color":{getThemeVariables:F1e},"redux-dark-color":{getThemeVariables:G1e}},bi={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!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,hierarchicalNamespaces:!0},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,donutHole:0,legendPosition:"right",highlightSlice:""},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,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,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,labelRotation:0},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,labelRotation:0},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,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},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:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},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},VH={...bi,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",nodePlacementAlignment:"NONE",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:Ll.default.getThemeVariables(),sequence:{...bi.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{defaultRenderer:"dagre-wrapper",hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...bi.gantt,tickInterval:void 0,useWidth:void 0},c4:{...bi.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...bi.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...bi.pie,useWidth:984},xyChart:{...bi.xyChart,useWidth:void 0},requirement:{...bi.requirement,useWidth:void 0},packet:{...bi.packet},eventmodeling:{...bi.eventmodeling},treeView:{...bi.treeView,useWidth:void 0},radar:{...bi.radar},railroad:{...bi.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...bi.ishikawa},sankey:{...bi.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...bi.venn},cynefin:{...bi.cynefin}},WH=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...WH(t[n],"")]:[...r,e+n],[]),"keyify"),V1e=new Set(WH(VH,"")),pr=VH,W1e={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},q1e=x((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(he.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),ew=x(t=>{if(he.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>ew(e));return}for(const e of Object.keys(t)){if(he.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!V1e.has(e)||t[e]==null){he.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=W1e[e];n?q1e(t[e],n):(he.debug("sanitizing object",e),ew(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(he.debug("sanitizing css option",e),t[e]=qH(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}he.debug("After sanitization",t)}},"sanitizeDirective"),qH=x(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Ia=Gn({},u0),tw,Bh=[],U1=Gn({},u0),_b=x((t,e)=>{let r=Gn({},t),n={};for(const i of e)YH(i),n=Gn(n,i);if(r=Gn(r,n),n.theme&&n.theme in Ll){const i=Gn({},tw),a=Gn(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Ll&&(r.themeVariables=Ll[r.theme].getThemeVariables(a))}return U1=r,K1e(U1),U1},"updateCurrentConfig"),U1e=x(t=>(Ia=Gn({},u0),Ia=Gn(Ia,t),t.theme&&Ll[t.theme]&&(Ia.themeVariables=Ll[t.theme].getThemeVariables(t.themeVariables)),_b(Ia,Bh),Ia),"setSiteConfig"),H1e=x(t=>{tw=Gn({},t)},"saveConfigFromInitialize"),Y1e=x(t=>(Ia=Gn(Ia,t),_b(Ia,Bh),Ia),"updateSiteConfig"),UH=x(()=>Gn({},Ia),"getSiteConfig"),HH=x(t=>(_b(U1,[t]),It()),"setConfig"),It=x(()=>Gn({},U1),"getConfig"),YH=x(t=>{t&&(["secure",...Ia.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(he.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&YH(t[e])}))},"sanitize"),X1e=x(t=>{var e;ew(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Bh.push(t),_b(Ia,Bh)},"addDirective"),rw=x((t=Ia)=>{Bh=[],_b(t,Bh)},"reset"),j1e={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},KF={},XH=x(t=>{KF[t]||(he.warn(j1e[t]),KF[t]=!0)},"issueWarning"),K1e=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&XH("LAZY_LOAD_DEPRECATED")},"checkConfig"),jH=x(()=>{let t={};tw&&(t=Gn(t,tw));for(const e of Bh)t=Gn(t,e);return t},"getUserDefinedConfig"),qi=x(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&XH("FLOWCHART_HTML_LABELS_DEPRECATED"),Ho(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),KH=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,H1=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Z1e=/\s*%%.*\n/gm,$p,ZH=($p=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},x($p,"UnknownDiagramError"),$p),Fh={},qM=x(function(t,e){t=t.replace(KH,"").replace(H1,"").replace(Z1e,` `);for(const[r,{detector:n}]of Object.entries(Fh))if(n(t,e))return r;throw new ZH(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),qI=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)QH(e,r,n)},"registerLazyLoadedDiagrams"),QH=x((t,e,r)=>{Fh[t]&&he.warn(`Detector with key ${t} already exists. Overwriting.`),Fh[t]={detector:e,loader:r},he.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Q1e=x(t=>Fh[t].loader,"getDiagramLoader"),ev=//gi,J1e=x(t=>t?tY(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),exe=(()=>{let t=!1;return()=>{t||(JH(),t=!0)}})();function JH(){const t="data-temp-href-target";Dl.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Dl.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(JH,"setupDompurifyHooks");var eY=x(t=>(exe(),Dl.sanitize(t)),"removeScript"),ZF=x((t,e)=>{if(qi(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=eY(t):r!=="loose"&&(t=tY(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=ixe(t))}return t},"sanitizeMore"),xr=x((t,e)=>t&&(e.dompurifyConfig?t=Dl.sanitize(ZF(t,e),e.dompurifyConfig).toString():t=Dl.sanitize(ZF(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),txe=x((t,e)=>typeof t=="string"?xr(t,e):t.flat().map(r=>xr(r,e)),"sanitizeTextOrArray"),rxe=x(t=>ev.test(t),"hasBreaks"),nxe=x(t=>t.split(ev),"splitBreaks"),ixe=x(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),tY=x(t=>t.replace(ev,"#br#"),"breakToPlaceholder"),UM=x(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),axe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),sxe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),vc=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),oxe=x((t,e)=>{const r=UI(t,"~"),n=UI(e,"~");return r===1&&n===1},"shouldCombineSets"),lxe=x(t=>{const e=UI(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),QF=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),HI=/\$\$(.*?)\$\$/g,On=x(t=>{var e;return(((e=t.match(HI))==null?void 0:e.length)??0)>0},"hasKatex"),Ab=x(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await bS(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),cxe=x(async(t,e)=>{if(!On(t))return t;if(!(QF()||e.legacyMathML||e.forceLegacyMathML))return t.replace(HI,"MathML is unsupported in this environment.");{const{default:r}=await Bt(async()=>{const{default:i}=await import("./katex-C5jXJg4s.js");return{default:i}},[]),n=e.forceLegacyMathML||!QF()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(ev).map(i=>On(i)?`
${i}
`:`
${i}
`).join("").replace(HI,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),bS=x(async(t,e)=>xr(await cxe(t,e),e),"renderKatexSanitized"),yt={getRows:J1e,sanitizeText:xr,sanitizeTextOrArray:txe,hasBreaks:rxe,splitBreaks:nxe,lineBreakRegex:ev,removeScript:eY,getUrl:UM,evaluate:Ho,getMax:axe,getMin:sxe},uxe=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),hxe=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Rn=x(function(t,e,r,n){const i=hxe(e,r,n);uxe(t,i)},"configureSvgSize"),tv=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;he.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;he.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,he.info(`Calculated bounds: ${o}x${l}`),Rn(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),$2={};function YI(t){return[...t.cssRules].map(e=>e.cssText).join(` `)}x(YI,"cssStyleSheetToString");var dxe=x((t,e,r,n)=>{let i="";return t in $2&&$2[t]?i=$2[t]({...r,svgId:n}):he.warn(`No theme found for ${t}`),`& { 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: ${r.strokeWidth??1}px; } & .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} .node .neo-node { stroke: ${r.nodeBorder}; } [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon { stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; } [data-look="neo"].swimlane.cluster rect { filter: none; } [data-look="neo"].node path { stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; stroke-width: ${r.strokeWidth??1}px; } [data-look="neo"].node .outer-path { filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; } [data-look="neo"].node .neo-line path { stroke: ${r.nodeBorder}; filter: none; } [data-look="neo"].node circle{ stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; } [data-look="neo"].node circle .state-start{ fill: #000000; } [data-look="neo"].icon-shape .icon { fill: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; } [data-look="neo"].icon-shape .icon-neo path { stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; } ${e} `},"getStyles"),fxe=x((t,e)=>{e!==void 0&&($2[t]=e)},"addStylesForDiagram"),pxe=dxe,HM={};vS(HM,{clear:()=>Xr,getAccDescription:()=>mn,getAccTitle:()=>pn,getDiagramTitle:()=>an,setAccDescription:()=>gn,setAccTitle:()=>rn,setDiagramTitle:()=>dn});var YM="",XM="",jM="",KM=x(t=>xr(t,It()),"sanitizeText"),Xr=x(()=>{YM="",jM="",XM=""},"clear"),rn=x(t=>{YM=KM(t).replace(/^\s+/g,"")},"setAccTitle"),pn=x(()=>YM,"getAccTitle"),gn=x(t=>{jM=KM(t).replace(/\n\s+/g,` `)},"setAccDescription"),mn=x(()=>jM,"getAccDescription"),dn=x(t=>{XM=KM(t)},"setDiagramTitle"),an=x(()=>XM,"getDiagramTitle"),JF=he,gxe=GM,Pe=It,XI=HH,rY=u0,ZM=x(t=>xr(t,Pe()),"sanitizeText"),QM=tv,mxe=x(()=>HM,"getCommonDb"),nw={},iw=x((t,e,r)=>{var n;nw[t]&&JF.warn(`Diagram with id ${t} already registered. Overwriting.`),nw[t]=e,r&&QH(t,r),fxe(t,e.styles),(n=e.injectUtils)==null||n.call(e,JF,gxe,Pe,ZM,QM,mxe(),()=>{})},"registerDiagram"),jI=x(t=>{if(t in nw)return nw[t];throw new yxe(t)},"getDiagram"),Pp,yxe=(Pp=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},x(Pp,"DiagramNotFoundError"),Pp);function P2(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function vxe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function JM(t){let e,r,n;t.length!==2?(e=P2,r=(o,l)=>P2(t(o),l),n=(o,l)=>t(o)-l):(e=t===P2||t===vxe?t:xxe,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function xxe(){return 0}function bxe(t){return t===null?NaN:+t}const Txe=JM(P2),Cxe=Txe.right;JM(bxe).center;class e8 extends Map{constructor(e,r=Sxe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(t8(this,e))}has(e){return super.has(t8(this,e))}set(e,r){return super.set(wxe(this,e),r)}delete(e){return super.delete(Exe(this,e))}}function t8({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function wxe({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Exe({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Sxe(t){return t!==null&&typeof t=="object"?t.valueOf():t}const kxe=Math.sqrt(50),_xe=Math.sqrt(10),Axe=Math.sqrt(2);function aw(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=kxe?10:a>=_xe?5:a>=Axe?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Ixe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function Dxe(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function Pxe(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Bxe(){return!this.__axis}function nY(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===B2||t===AT?-1:1,h=t===AT||t===cA?"x":"y",d=t===B2||t===QI?Nxe:Oxe;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):Mxe),y=Math.max(a,0)+o,v=e.range(),T=+v[0]+l,b=+v[v.length-1]+l,C=(e.bandwidth?Pxe:$xe)(e.copy(),l),w=p.selection?p.selection():p,S=w.selectAll(".domain").data([null]),E=w.selectAll(".tick").data(g,e).order(),_=E.exit(),R=E.enter().append("g").attr("class","tick"),D=E.select("line"),L=E.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(R),D=D.merge(R.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),L=L.merge(R.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===B2?"0em":t===QI?"0.71em":"0.32em")),p!==w&&(S=S.transition(p),E=E.transition(p),D=D.transition(p),L=L.transition(p),_=_.transition(p).attr("opacity",r8).attr("transform",function(B){return isFinite(B=C(B))?d(B+l):this.getAttribute("transform")}),R.attr("opacity",r8).attr("transform",function(B){var $=this.parentNode.__axis;return d(($&&isFinite($=$(B))?$:C(B))+l)})),_.remove(),S.attr("d",t===AT||t===cA?s?"M"+u*s+","+T+"H"+l+"V"+b+"H"+u*s:"M"+l+","+T+"V"+b:s?"M"+T+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+T+","+l+"H"+b),E.attr("opacity",1).attr("transform",function(B){return d(C(B)+l)}),D.attr(h+"2",u*a),L.attr(h,u*y).text(m),w.filter(Bxe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===cA?"start":t===AT?"end":"middle"),w.each(function(){this.__axis=C})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Fxe(t){return nY(B2,t)}function zxe(t){return nY(QI,t)}var Gxe={value:()=>{}};function iY(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}F2.prototype=iY.prototype={constructor:F2,on:function(t,e){var r=this._,n=Vxe(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),i8.hasOwnProperty(e)?{space:i8[e],local:t}:t}function qxe(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===JI&&e.documentElement.namespaceURI===JI?e.createElement(t):e.createElementNS(r,t)}}function Uxe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function aY(t){var e=TS(t);return(e.local?Uxe:qxe)(e)}function Hxe(){}function eN(t){return t==null?Hxe:function(){return this.querySelector(t)}}function Yxe(t){typeof t!="function"&&(t=eN(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=T+1);!(w=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function vbe(t){t||(t=xbe);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function bbe(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Tbe(){return Array.from(this)}function Cbe(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?Mbe:typeof e=="function"?Obe:Nbe)(t,e,r??"")):h0(this.node(),t)}function h0(t,e){return t.style.getPropertyValue(e)||uY(t).getComputedStyle(t,null).getPropertyValue(e)}function Pbe(t){return function(){delete this[t]}}function Bbe(t,e){return function(){this[t]=e}}function Fbe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function zbe(t,e){return arguments.length>1?this.each((e==null?Pbe:typeof e=="function"?Fbe:Bbe)(t,e)):this.node()[t]}function hY(t){return t.trim().split(/^|\s+/)}function tN(t){return t.classList||new dY(t)}function dY(t){this._node=t,this._names=hY(t.getAttribute("class")||"")}dY.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function fY(t,e){for(var r=tN(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function pTe(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?RT(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?RT(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=wTe.exec(t))?new Wi(e[1],e[2],e[3],1):(e=ETe.exec(t))?new Wi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=STe.exec(t))?RT(e[1],e[2],e[3],e[4]):(e=kTe.exec(t))?RT(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_Te.exec(t))?h8(e[1],e[2]/100,e[3]/100,1):(e=ATe.exec(t))?h8(e[1],e[2]/100,e[3]/100,e[4]):a8.hasOwnProperty(t)?l8(a8[t]):t==="transparent"?new Wi(NaN,NaN,NaN,0):null}function l8(t){return new Wi(t>>16&255,t>>8&255,t&255,1)}function RT(t,e,r,n){return n<=0&&(t=e=r=NaN),new Wi(t,e,r,n)}function yY(t){return t instanceof cd||(t=zh(t)),t?(t=t.rgb(),new Wi(t.r,t.g,t.b,t.opacity)):new Wi}function e3(t,e,r,n){return arguments.length===1?yY(t):new Wi(t,e,r,n??1)}function Wi(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Lb(Wi,e3,CS(cd,{brighter(t){return t=t==null?ow:Math.pow(ow,t),new Wi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?wx:Math.pow(wx,t),new Wi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Wi(Lh(this.r),Lh(this.g),Lh(this.b),lw(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:c8,formatHex:c8,formatHex8:ITe,formatRgb:u8,toString:u8}));function c8(){return`#${Th(this.r)}${Th(this.g)}${Th(this.b)}`}function ITe(){return`#${Th(this.r)}${Th(this.g)}${Th(this.b)}${Th((isNaN(this.opacity)?1:this.opacity)*255)}`}function u8(){const t=lw(this.opacity);return`${t===1?"rgb(":"rgba("}${Lh(this.r)}, ${Lh(this.g)}, ${Lh(this.b)}${t===1?")":`, ${t})`}`}function lw(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Lh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Th(t){return t=Lh(t),(t<16?"0":"")+t.toString(16)}function h8(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new qs(t,e,r,n)}function vY(t){if(t instanceof qs)return new qs(t.h,t.s,t.l,t.opacity);if(t instanceof cd||(t=zh(t)),!t)return new qs;if(t instanceof qs)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new qs(s,o,l,t.opacity)}function DTe(t,e,r,n){return arguments.length===1?vY(t):new qs(t,e,r,n??1)}function qs(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Lb(qs,DTe,CS(cd,{brighter(t){return t=t==null?ow:Math.pow(ow,t),new qs(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?wx:Math.pow(wx,t),new qs(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Wi(uA(t>=240?t-240:t+120,i,n),uA(t,i,n),uA(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new qs(d8(this.h),LT(this.s),LT(this.l),lw(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 t=lw(this.opacity);return`${t===1?"hsl(":"hsla("}${d8(this.h)}, ${LT(this.s)*100}%, ${LT(this.l)*100}%${t===1?")":`, ${t})`}`}}));function d8(t){return t=(t||0)%360,t<0?t+360:t}function LT(t){return Math.max(0,Math.min(1,t||0))}function uA(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const MTe=Math.PI/180,NTe=180/Math.PI,cw=18,xY=.96422,bY=1,TY=.82521,CY=4/29,sp=6/29,wY=3*sp*sp,OTe=sp*sp*sp;function EY(t){if(t instanceof No)return new No(t.l,t.a,t.b,t.opacity);if(t instanceof Cl)return SY(t);t instanceof Wi||(t=yY(t));var e=pA(t.r),r=pA(t.g),n=pA(t.b),i=hA((.2225045*e+.7168786*r+.0606169*n)/bY),a,s;return e===r&&r===n?a=s=i:(a=hA((.4360747*e+.3850649*r+.1430804*n)/xY),s=hA((.0139322*e+.0971045*r+.7141733*n)/TY)),new No(116*i-16,500*(a-i),200*(i-s),t.opacity)}function $Te(t,e,r,n){return arguments.length===1?EY(t):new No(t,e,r,n??1)}function No(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}Lb(No,$Te,CS(cd,{brighter(t){return new No(this.l+cw*(t??1),this.a,this.b,this.opacity)},darker(t){return new No(this.l-cw*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=xY*dA(e),t=bY*dA(t),r=TY*dA(r),new Wi(fA(3.1338561*e-1.6168667*t-.4906146*r),fA(-.9787684*e+1.9161415*t+.033454*r),fA(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function hA(t){return t>OTe?Math.pow(t,1/3):t/wY+CY}function dA(t){return t>sp?t*t*t:wY*(t-CY)}function fA(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function pA(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function PTe(t){if(t instanceof Cl)return new Cl(t.h,t.c,t.l,t.opacity);if(t instanceof No||(t=EY(t)),t.a===0&&t.b===0)return new Cl(NaN,0()=>t;function kY(t,e){return function(r){return t+r*e}}function BTe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function FTe(t,e){var r=e-t;return r?kY(t,r>180||r<-180?r-360*Math.round(r/360):r):wS(isNaN(t)?e:t)}function zTe(t){return(t=+t)==1?Y1:function(e,r){return r-e?BTe(e,r,t):wS(isNaN(e)?r:e)}}function Y1(t,e){var r=e-t;return r?kY(t,r):wS(isNaN(t)?e:t)}const uw=(function t(e){var r=zTe(e);function n(i,a){var s=r((i=e3(i)).r,(a=e3(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=Y1(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function GTe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Bs(n,i)})),r=gA.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Bs(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Bs(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Bs(u,d)},{i:m-2,x:Bs(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--d0}function p8(){Gh=(dw=Sx.now())+ES,d0=g1=0;try{r2e()}finally{d0=0,i2e(),Gh=0}}function n2e(){var t=Sx.now(),e=t-dw;e>LY&&(ES-=e,dw=t)}function i2e(){for(var t,e=hw,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:hw=r);m1=t,i3(n)}function i3(t){if(!d0){g1&&(g1=clearTimeout(g1));var e=t-Gh;e>24?(t<1/0&&(g1=setTimeout(p8,t-Sx.now()-ES)),Nv&&(Nv=clearInterval(Nv))):(Nv||(dw=Sx.now(),Nv=setInterval(n2e,LY)),d0=1,IY(p8))}}function g8(t,e,r){var n=new fw;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var a2e=iY("start","end","cancel","interrupt"),s2e=[],MY=0,m8=1,a3=2,z2=3,y8=4,s3=5,G2=6;function SS(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;o2e(t,r,{name:e,index:n,group:i,on:a2e,tween:s2e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:MY})}function iN(t,e){var r=oo(t,e);if(r.state>MY)throw new Error("too late; already scheduled");return r}function Yo(t,e){var r=oo(t,e);if(r.state>z2)throw new Error("too late; already running");return r}function oo(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function o2e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=DY(a,0,r.time);function a(u){r.state=m8,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==m8)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===z2)return g8(s);p.state===y8?(p.state=G2,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+ha3&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function B2e(t,e,r){var n,i,a=P2e(e)?iN:Yo;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function F2e(t,e){var r=this._id;return arguments.length<2?oo(this.node(),r).on.on(t):this.each(B2e(r,t,e))}function z2e(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function G2e(){return this.on("end.remove",z2e(this._id))}function V2e(t){var e=this._name,r=this._id;typeof t!="function"&&(t=eN(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return PY;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;iGu)if(!(Math.abs(d*l-u*h)>Gu)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),T=Math.sqrt(f),b=a*Math.tan((o3-Math.acos((m+f-y)/(2*v*T)))/2),C=b/T,w=b/v;Math.abs(C-1)>Gu&&this._append`L${e+C*h},${r+C*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+w*l},${this._y1=r+w*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Gu||Math.abs(this._y1-h)>Gu)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%l3+l3),f>fCe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>Gu&&this._append`A${n},${n},0,${+(f>=o3)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function mCe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function pw(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function f0(t){return t=pw(Math.abs(t)),t?t[1]:NaN}function yCe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function vCe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var xCe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function gw(t){if(!(e=xCe.exec(t)))throw new Error("invalid format: "+t);var e;return new sN({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}gw.prototype=sN.prototype;function sN(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}sN.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 bCe(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var mw;function TCe(t,e){var r=pw(t,e);if(!r)return mw=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(mw=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+pw(t,Math.max(0,e+a-1))[0]}function v8(t,e){var r=pw(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const x8={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:mCe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>v8(t*100,e),r:v8,s:TCe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function b8(t){return t}var T8=Array.prototype.map,C8=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function CCe(t){var e=t.grouping===void 0||t.thousands===void 0?b8:yCe(T8.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?b8:vCe(T8.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=gw(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,T=d.width,b=d.comma,C=d.precision,w=d.trim,S=d.type;S==="n"?(b=!0,S="g"):x8[S]||(C===void 0&&(C=12),w=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var E=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),_=(y==="$"?n:/[%p]/.test(S)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),R=x8[S],D=/[defgprs%]/.test(S);C=C===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function L(B){var $=E,A=_,I,O,N;if(S==="c")A=R(B)+A,B="";else{B=+B;var M=B<0||1/B<0;if(B=isNaN(B)?l:R(Math.abs(B),C),w&&(B=bCe(B)),M&&+B==0&&m!=="+"&&(M=!1),$=(M?m==="("?m:o:m==="-"||m==="("?"":m)+$,A=(S==="s"&&!isNaN(B)&&mw!==void 0?C8[8+mw/3]:"")+A+(M&&m==="("?")":""),D){for(I=-1,O=B.length;++IN||N>57){A=(N===46?i+B.slice(I+1):B.slice(I))+A,B=B.slice(0,I);break}}}b&&!v&&(B=e(B,1/0));var P=$.length+B.length+A.length,F=P>1)+$+B+A+F.slice(P);break;default:B=F+$+B+A;break}return a(B)}return L.toString=function(){return d+""},L}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(f0(f)/3)))*3,g=Math.pow(10,-p),m=u((d=gw(d),d.type="f",d),{suffix:C8[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var DT,rh,BY;wCe({thousands:",",grouping:[3],currency:["$",""]});function wCe(t){return DT=CCe(t),rh=DT.format,BY=DT.formatPrefix,DT}function ECe(t){return Math.max(0,-f0(Math.abs(t)))}function SCe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(f0(e)/3)))*3-f0(Math.abs(t)))}function kCe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,f0(e)-f0(t))+1}function _Ce(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function ACe(){return this.eachAfter(_Ce)}function RCe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function LCe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function ICe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function NCe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function OCe(t){for(var e=this,r=$Ce(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function $Ce(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function PCe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function BCe(){return Array.from(this)}function FCe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function zCe(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*GCe(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new yw(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(HCe)}function VCe(){return oN(this).eachBefore(UCe)}function WCe(t){return t.children}function qCe(t){return Array.isArray(t)?t[1]:null}function UCe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function HCe(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function yw(t){this.data=t,this.depth=this.height=0,this.parent=null}yw.prototype=oN.prototype={constructor:yw,count:ACe,each:RCe,eachAfter:ICe,eachBefore:LCe,find:DCe,sum:MCe,sort:NCe,path:OCe,ancestors:PCe,descendants:BCe,leaves:FCe,links:zCe,copy:VCe,[Symbol.iterator]:GCe};function YCe(t){if(typeof t!="function")throw new Error;return t}function Ov(){return 0}function $v(t){return function(){return t}}function XCe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function jCe(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++oT&&(T=u),S=y*y*w,b=Math.max(T/S,S/v),b>C){y-=u;break}C=b}s.push(l={value:y,dice:p1?n:1)},r})(ZCe);function ewe(){var t=JCe,e=!1,r=1,n=1,i=[0],a=Ov,s=Ov,o=Ov,l=Ov,u=Ov;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(XCe),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function iwe(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?awe:iwe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),Bs)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,rwe),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=XTe,h()},d.clamp=function(f){return arguments.length?(s=f?!0:zf,h()):s!==zf},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function zY(){return swe()(zf,zf)}function owe(t,e,r,n){var i=ZI(t,e,r),a;switch(n=gw(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=SCe(i,s))&&(n.precision=a),BY(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=kCe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=ECe(i))&&(n.precision=a-(n.type==="%")*2);break}}return rh(n)}function lwe(t){var e=t.domain;return t.ticks=function(r){var n=e();return Rxe(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return owe(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=KI(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function p0(){var t=zY();return t.copy=function(){return FY(t,p0())},kS.apply(t,arguments),lwe(t)}function cwe(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uri(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(mA.setTime(+a),yA.setTime(+s),t(mA),t(yA),Math.floor(r(mA,yA))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const g0=ri(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);g0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ri(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):g0);g0.range;const wl=1e3,ys=wl*60,El=ys*60,Nl=El*24,lN=Nl*7,S8=Nl*30,vA=Nl*365,Ac=ri(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*wl)},(t,e)=>(e-t)/wl,t=>t.getUTCSeconds());Ac.range;const kx=ri(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*wl)},(t,e)=>{t.setTime(+t+e*ys)},(t,e)=>(e-t)/ys,t=>t.getMinutes());kx.range;const uwe=ri(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ys)},(t,e)=>(e-t)/ys,t=>t.getUTCMinutes());uwe.range;const _x=ri(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*wl-t.getMinutes()*ys)},(t,e)=>{t.setTime(+t+e*El)},(t,e)=>(e-t)/El,t=>t.getHours());_x.range;const hwe=ri(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*El)},(t,e)=>(e-t)/El,t=>t.getUTCHours());hwe.range;const Vh=ri(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ys)/Nl,t=>t.getDate()-1);Vh.range;const cN=ri(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Nl,t=>t.getUTCDate()-1);cN.range;const dwe=ri(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Nl,t=>Math.floor(t/Nl));dwe.range;function ud(t){return ri(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*ys)/lN)}const Ib=ud(0),Ax=ud(1),GY=ud(2),VY=ud(3),Wh=ud(4),WY=ud(5),qY=ud(6);Ib.range;Ax.range;GY.range;VY.range;Wh.range;WY.range;qY.range;function hd(t){return ri(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/lN)}const UY=hd(0),vw=hd(1),fwe=hd(2),pwe=hd(3),m0=hd(4),gwe=hd(5),mwe=hd(6);UY.range;vw.range;fwe.range;pwe.range;m0.range;gwe.range;mwe.range;const Rx=ri(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rx.range;const ywe=ri(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());ywe.range;const Ol=ri(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Ol.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ri(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});Ol.range;const qh=ri(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());qh.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ri(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});qh.range;function vwe(t,e,r,n,i,a){const s=[[Ac,1,wl],[Ac,5,5*wl],[Ac,15,15*wl],[Ac,30,30*wl],[a,1,ys],[a,5,5*ys],[a,15,15*ys],[a,30,30*ys],[i,1,El],[i,3,3*El],[i,6,6*El],[i,12,12*El],[n,1,Nl],[n,2,2*Nl],[r,1,lN],[e,1,S8],[e,3,3*S8],[t,1,vA]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(ZI(u/vA,h/vA,d));if(p===0)return g0.every(Math.max(ZI(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in ae||(ae.w=1),"Z"in ae?(le=bA(Pv(ae.y,0,1)),ye=le.getUTCDay(),le=ye>4||ye===0?vw.ceil(le):vw(le),le=cN.offset(le,(ae.V-1)*7),ae.y=le.getUTCFullYear(),ae.m=le.getUTCMonth(),ae.d=le.getUTCDate()+(ae.w+6)%7):(le=xA(Pv(ae.y,0,1)),ye=le.getDay(),le=ye>4||ye===0?Ax.ceil(le):Ax(le),le=Vh.offset(le,(ae.V-1)*7),ae.y=le.getFullYear(),ae.m=le.getMonth(),ae.d=le.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),ye="Z"in ae?bA(Pv(ae.y,0,1)).getUTCDay():xA(Pv(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(ye+5)%7:ae.w+ae.U*7-(ye+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,bA(ae)):xA(ae)}}function _(ee,ne,ie,ae){for(var de=0,le=ne.length,ye=ie.length,$e,Fe;de=ye)return-1;if($e=ne.charCodeAt(de++),$e===37){if($e=ne.charAt(de++),Fe=w[$e in k8?ne.charAt(de++):$e],!Fe||(ae=Fe(ee,ie,ae))<0)return-1}else if($e!=ie.charCodeAt(ae++))return-1}return ae}function R(ee,ne,ie){var ae=u.exec(ne.slice(ie));return ae?(ee.p=h.get(ae[0].toLowerCase()),ie+ae[0].length):-1}function D(ee,ne,ie){var ae=p.exec(ne.slice(ie));return ae?(ee.w=g.get(ae[0].toLowerCase()),ie+ae[0].length):-1}function L(ee,ne,ie){var ae=d.exec(ne.slice(ie));return ae?(ee.w=f.get(ae[0].toLowerCase()),ie+ae[0].length):-1}function B(ee,ne,ie){var ae=v.exec(ne.slice(ie));return ae?(ee.m=T.get(ae[0].toLowerCase()),ie+ae[0].length):-1}function $(ee,ne,ie){var ae=m.exec(ne.slice(ie));return ae?(ee.m=y.get(ae[0].toLowerCase()),ie+ae[0].length):-1}function A(ee,ne,ie){return _(ee,e,ne,ie)}function I(ee,ne,ie){return _(ee,r,ne,ie)}function O(ee,ne,ie){return _(ee,n,ne,ie)}function N(ee){return s[ee.getDay()]}function M(ee){return a[ee.getDay()]}function P(ee){return l[ee.getMonth()]}function F(ee){return o[ee.getMonth()]}function V(ee){return i[+(ee.getHours()>=12)]}function z(ee){return 1+~~(ee.getMonth()/3)}function W(ee){return s[ee.getUTCDay()]}function X(ee){return a[ee.getUTCDay()]}function j(ee){return l[ee.getUTCMonth()]}function re(ee){return o[ee.getUTCMonth()]}function Q(ee){return i[+(ee.getUTCHours()>=12)]}function oe(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var ne=S(ee+="",b);return ne.toString=function(){return ee},ne},parse:function(ee){var ne=E(ee+="",!1);return ne.toString=function(){return ee},ne},utcFormat:function(ee){var ne=S(ee+="",C);return ne.toString=function(){return ee},ne},utcParse:function(ee){var ne=E(ee+="",!0);return ne.toString=function(){return ee},ne}}}var k8={"-":"",_:" ",0:"0"},pi=/^\s*\d+/,Cwe=/^%/,wwe=/[\\^$*+?|[\]().{}]/g;function Or(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function Swe(t,e,r){var n=pi.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function kwe(t,e,r){var n=pi.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function _we(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Awe(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Rwe(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function _8(t,e,r){var n=pi.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function A8(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Lwe(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Iwe(t,e,r){var n=pi.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Dwe(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function R8(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Mwe(t,e,r){var n=pi.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function L8(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Nwe(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Owe(t,e,r){var n=pi.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function $we(t,e,r){var n=pi.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Pwe(t,e,r){var n=pi.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Bwe(t,e,r){var n=Cwe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Fwe(t,e,r){var n=pi.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function zwe(t,e,r){var n=pi.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function I8(t,e){return Or(t.getDate(),e,2)}function Gwe(t,e){return Or(t.getHours(),e,2)}function Vwe(t,e){return Or(t.getHours()%12||12,e,2)}function Wwe(t,e){return Or(1+Vh.count(Ol(t),t),e,3)}function HY(t,e){return Or(t.getMilliseconds(),e,3)}function qwe(t,e){return HY(t,e)+"000"}function Uwe(t,e){return Or(t.getMonth()+1,e,2)}function Hwe(t,e){return Or(t.getMinutes(),e,2)}function Ywe(t,e){return Or(t.getSeconds(),e,2)}function Xwe(t){var e=t.getDay();return e===0?7:e}function jwe(t,e){return Or(Ib.count(Ol(t)-1,t),e,2)}function YY(t){var e=t.getDay();return e>=4||e===0?Wh(t):Wh.ceil(t)}function Kwe(t,e){return t=YY(t),Or(Wh.count(Ol(t),t)+(Ol(t).getDay()===4),e,2)}function Zwe(t){return t.getDay()}function Qwe(t,e){return Or(Ax.count(Ol(t)-1,t),e,2)}function Jwe(t,e){return Or(t.getFullYear()%100,e,2)}function eEe(t,e){return t=YY(t),Or(t.getFullYear()%100,e,2)}function tEe(t,e){return Or(t.getFullYear()%1e4,e,4)}function rEe(t,e){var r=t.getDay();return t=r>=4||r===0?Wh(t):Wh.ceil(t),Or(t.getFullYear()%1e4,e,4)}function nEe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Or(e/60|0,"0",2)+Or(e%60,"0",2)}function D8(t,e){return Or(t.getUTCDate(),e,2)}function iEe(t,e){return Or(t.getUTCHours(),e,2)}function aEe(t,e){return Or(t.getUTCHours()%12||12,e,2)}function sEe(t,e){return Or(1+cN.count(qh(t),t),e,3)}function XY(t,e){return Or(t.getUTCMilliseconds(),e,3)}function oEe(t,e){return XY(t,e)+"000"}function lEe(t,e){return Or(t.getUTCMonth()+1,e,2)}function cEe(t,e){return Or(t.getUTCMinutes(),e,2)}function uEe(t,e){return Or(t.getUTCSeconds(),e,2)}function hEe(t){var e=t.getUTCDay();return e===0?7:e}function dEe(t,e){return Or(UY.count(qh(t)-1,t),e,2)}function jY(t){var e=t.getUTCDay();return e>=4||e===0?m0(t):m0.ceil(t)}function fEe(t,e){return t=jY(t),Or(m0.count(qh(t),t)+(qh(t).getUTCDay()===4),e,2)}function pEe(t){return t.getUTCDay()}function gEe(t,e){return Or(vw.count(qh(t)-1,t),e,2)}function mEe(t,e){return Or(t.getUTCFullYear()%100,e,2)}function yEe(t,e){return t=jY(t),Or(t.getUTCFullYear()%100,e,2)}function vEe(t,e){return Or(t.getUTCFullYear()%1e4,e,4)}function xEe(t,e){var r=t.getUTCDay();return t=r>=4||r===0?m0(t):m0.ceil(t),Or(t.getUTCFullYear()%1e4,e,4)}function bEe(){return"+0000"}function M8(){return"%"}function N8(t){return+t}function O8(t){return Math.floor(+t/1e3)}var Hd,xw;TEe({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 TEe(t){return Hd=Twe(t),xw=Hd.format,Hd.parse,Hd.utcFormat,Hd.utcParse,Hd}function CEe(t){return new Date(t)}function wEe(t){return t instanceof Date?+t:+new Date(+t)}function KY(t,e,r,n,i,a,s,o,l,u){var h=zY(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),T=u("%b %d"),b=u("%B"),C=u("%Y");function w(S){return(l(S)1?0:t<-1?Lx:Math.acos(t)}function P8(t){return t>=1?bw:t<=-1?-bw:Math.asin(t)}function ZY(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new gCe(e)}function REe(t){return t.innerRadius}function LEe(t){return t.outerRadius}function IEe(t){return t.startAngle}function DEe(t){return t.endAngle}function MEe(t){return t&&t.padAngle}function NEe(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fA*A+I*I&&(_=D,R=L),{cx:_,cy:R,x01:-h,y01:-d,x11:_*(i/w-1),y11:R*(i/w-1)}}function y0(){var t=REe,e=LEe,r=Dn(0),n=null,i=IEe,a=DEe,s=MEe,o=null,l=ZY(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-bw,m=a.apply(this,arguments)-bw,y=$8(m-g),v=m>g;if(o||(o=h=l()),pGi))o.moveTo(0,0);else if(y>V2-Gi)o.moveTo(p*ku(g),p*uo(g)),o.arc(0,0,p,g,m,!v),f>Gi&&(o.moveTo(f*ku(m),f*uo(m)),o.arc(0,0,f,m,g,v));else{var T=g,b=m,C=g,w=m,S=y,E=y,_=s.apply(this,arguments)/2,R=_>Gi&&(n?+n.apply(this,arguments):Gf(f*f+p*p)),D=TA($8(p-f)/2,+r.apply(this,arguments)),L=D,B=D,$,A;if(R>Gi){var I=P8(R/f*uo(_)),O=P8(R/p*uo(_));(S-=I*2)>Gi?(I*=v?1:-1,C+=I,w-=I):(S=0,C=w=(g+m)/2),(E-=O*2)>Gi?(O*=v?1:-1,T+=O,b-=O):(E=0,T=b=(g+m)/2)}var N=p*ku(T),M=p*uo(T),P=f*ku(w),F=f*uo(w);if(D>Gi){var V=p*ku(b),z=p*uo(b),W=f*ku(C),X=f*uo(C),j;if(yGi?B>Gi?($=MT(W,X,N,M,p,B,v),A=MT(V,z,P,F,p,B,v),o.moveTo($.cx+$.x01,$.cy+$.y01),BGi)||!(S>Gi)?o.lineTo(P,F):L>Gi?($=MT(P,F,V,z,f,-L,v),A=MT(N,M,W,X,f,-L,v),o.lineTo($.cx+$.x01,$.cy+$.y01),Lt?1:e>=t?0:NaN}function BEe(t){return t}function FEe(){var t=BEe,e=PEe,r=null,n=Dn(0),i=Dn(V2),a=Dn(0);function s(o){var l,u=(o=QY(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(V2,Math.max(-V2,i.apply(this,arguments)-m)),v,T=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=T*(y<0?-1:1),C;for(l=0;l0&&(f+=C);for(e!=null?p.sort(function(w,S){return e(g[w],g[S])}):r!=null&&p.sort(function(w,S){return r(o[w],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?C*d:0)+b,g[h]={data:o[h],index:l,value:C,startAngle:m,endAngle:v,padAngle:T};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Dn(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Dn(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Dn(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Dn(+o),s):a},s}class eX{constructor(e,r){this._context=e,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(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function tX(t){return new eX(t,!0)}function rX(t){return new eX(t,!1)}function Wc(){}function Cw(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function _S(t){this._context=t}_S.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:Cw(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:Cw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function ww(t){return new _S(t)}function nX(t){this._context=t}nX.prototype={areaStart:Wc,areaEnd:Wc,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Cw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function zEe(t){return new nX(t)}function iX(t){this._context=t}iX.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(t,e){switch(t=+t,e=+e,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+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Cw(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function GEe(t){return new iX(t)}function aX(t,e){this._basis=new _S(t),this._beta=e}aX.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const VEe=(function t(e){function r(n){return e===1?new _S(n):new aX(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function Ew(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function uN(t,e){this._context=t,this._k=(1-e)/6}uN.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:Ew(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Ew(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sX=(function t(e){function r(n){return new uN(n,e)}return r.tension=function(n){return t(+n)},r})(0);function hN(t,e){this._context=t,this._k=(1-e)/6}hN.prototype={areaStart:Wc,areaEnd:Wc,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ew(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const WEe=(function t(e){function r(n){return new hN(n,e)}return r.tension=function(n){return t(+n)},r})(0);function dN(t,e){this._context=t,this._k=(1-e)/6}dN.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(t,e){switch(t=+t,e=+e,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:Ew(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const qEe=(function t(e){function r(n){return new dN(n,e)}return r.tension=function(n){return t(+n)},r})(0);function fN(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Gi){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Gi){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function oX(t,e){this._context=t,this._alpha=e}oX.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(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:fN(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const lX=(function t(e){function r(n){return e?new oX(n,e):new uN(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function cX(t,e){this._context=t,this._alpha=e}cX.prototype={areaStart:Wc,areaEnd:Wc,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(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:fN(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const UEe=(function t(e){function r(n){return e?new cX(n,e):new hN(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function uX(t,e){this._context=t,this._alpha=e}uX.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(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:fN(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const HEe=(function t(e){function r(n){return e?new uX(n,e):new dN(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function hX(t){this._context=t}hX.prototype={areaStart:Wc,areaEnd:Wc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function YEe(t){return new hX(t)}function B8(t){return t<0?-1:1}function F8(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(B8(a)+B8(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function z8(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function CA(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function Sw(t){this._context=t}Sw.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:CA(this,this._t0,z8(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,CA(this,z8(this,r=F8(this,t,e)),r);break;default:CA(this,this._t0,r=F8(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function dX(t){this._context=new fX(t)}(dX.prototype=Object.create(Sw.prototype)).point=function(t,e){Sw.prototype.point.call(this,e,t)};function fX(t){this._context=t}fX.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function pX(t){return new Sw(t)}function gX(t){return new dX(t)}function mX(t){this._context=t}mX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=G8(t),i=G8(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function vX(t){return new AS(t,.5)}function xX(t){return new AS(t,0)}function bX(t){return new AS(t,1)}function y1(t,e,r){this.k=t,this.x=e,this.y=r}y1.prototype={constructor:y1,scale:function(t){return t===1?this:new y1(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new y1(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};y1.prototype;var Yi=x(t=>{var i;const{securityLevel:e}=Pe();let r=ft("body");if(e==="sandbox"){const s=((i=ft(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=ft(s.body)}return r.select(`#${t}`)},"selectSvgElement"),XEe=x(t=>{const{handDrawnSeed:e}=Pe();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),jEe=x(t=>Array.isArray(t)?t:t?t.split(";").map(e=>e.trim()).filter(Boolean):[],"normalizeStyleList"),rv=x(t=>{const e=KEe([...t.cssCompiledStyles||[],...t.cssStyles||[],...jEe(t.labelStyle)]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),KEe=x(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),pN=x(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Et=x(t=>{const{stylesArray:e}=rv(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];pN(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),kt=x((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Pe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=rv(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:ZEe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),ZEe=x(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray");const QEe=Object.freeze({left:0,top:0,width:16,height:16}),kw=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),TX=Object.freeze({...QEe,...kw}),JEe=Object.freeze({...TX,body:"",hidden:!1}),eSe=Object.freeze({width:null,height:null}),tSe=Object.freeze({...eSe,...kw}),rSe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return wA(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return wA(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return wA(o,r)?o:null}return null},wA=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function nSe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function V8(t,e){const r=nSe(t,e);for(const n in JEe)n in kw?n in t&&!(n in r)&&(r[n]=kw[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function iSe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function W8(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=V8(n[o]||i[o],a)}return s(e),r.forEach(s),V8(t,a)}function aSe(t,e){if(t.icons[e])return W8(t,e,[]);const r=iSe(t,[e])[e];return r?W8(t,e,r):null}const sSe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,oSe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function q8(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(sSe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=oSe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function lSe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function cSe(t,e){return t?""+t+""+e:e}function uSe(t,e,r){const n=lSe(t);return cSe(n.defs,e+n.content+r)}const hSe=t=>t==="unset"||t==="undefined"||t==="none";function dSe(t,e){const r={...TX,...t},n={...tSe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,T=m.vFlip;let b=m.rotate;v?T?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):T&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let C;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:C=i.height/2+i.top,y.unshift("rotate(90 "+C.toString()+" "+C.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:C=i.width/2+i.left,y.unshift("rotate(-90 "+C.toString()+" "+C.toString()+")");break}b%2===1&&(i.left!==i.top&&(C=i.left,i.left=i.top,i.top=C),i.width!==i.height&&(C=i.width,i.width=i.height,i.height=C)),y.length&&(a=uSe(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=q8(d,l/u)):(h=s==="auto"?l:s,d=o===null?q8(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{hSe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const fSe=/\sid="(\S+)"/g,U8=new Map;function pSe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=U8.get(t)||0;return U8.set(t,e+1),e?`${t}${e}`:t}function gSe(t){const e=[];let r;for(;r=fSe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=pSe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function mSe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var CX={body:'?',height:80,width:80},h3=new Map,wX=new Map,gN=x(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(he.debug("Registering icon pack:",e.name),"loader"in e)wX.set(e.name,e.loader);else if("icons"in e)h3.set(e.name,e.icons);else throw he.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),EX=x(async(t,e)=>{const r=rSe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=h3.get(n);if(!i){const s=wX.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},h3.set(n,i)}catch(o){throw he.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=aSe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),ySe=x(async t=>{try{return await EX(t),!0}catch{return!1}},"isIconAvailable"),$l=x(async(t,e,r)=>{let n;try{n=await EX(t,e==null?void 0:e.fallbackPrefix)}catch(s){he.error(s),n=CX}const i=dSe(n,e),a=mSe(gSe(i.body),{...i.attributes,...r});return xr(a,It())},"getIconSVG"),NT={},Yn={},H8;function vSe(){return H8||(H8=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.BLANK_URL=Yn.relativeFirstCharacters=Yn.whitespaceEscapeCharsRegex=Yn.urlSchemeRegex=Yn.ctrlCharactersRegex=Yn.htmlCtrlEntityRegex=Yn.htmlEntitiesRegex=Yn.invalidProtocolRegex=void 0,Yn.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Yn.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Yn.htmlCtrlEntityRegex=/&(newline|tab);/gi,Yn.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Yn.urlSchemeRegex=/^.+(:|:)/gim,Yn.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Yn.relativeFirstCharacters=[".","/"],Yn.BLANK_URL="about:blank"),Yn}var Y8;function xSe(){if(Y8)return NT;Y8=1,Object.defineProperty(NT,"__esModule",{value:!0}),NT.sanitizeUrl=a;var t=vSe();function e(s){return t.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return NT}var nv=xSe();function bSe(t){return Array.isArray(t)}function EA(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function TSe(){}function SX(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Db(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const kX="[object RegExp]",mN="[object String]",yN="[object Number]",vN="[object Boolean]",xN="[object Arguments]",_X="[object Symbol]",AX="[object Date]",RX="[object Map]",LX="[object Set]",IX="[object Array]",DX="[object ArrayBuffer]",MX="[object Object]",NX="[object DataView]",OX="[object Uint8Array]",$X="[object Uint8ClampedArray]",PX="[object Uint16Array]",BX="[object Uint32Array]",FX="[object Int8Array]",zX="[object Int16Array]",GX="[object Int32Array]",VX="[object Float32Array]",WX="[object Float64Array]",X8=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function bN(t){return typeof X8.Buffer<"u"&&X8.Buffer.isBuffer(t)}function CSe(t){return Number.isSafeInteger(t)&&t>=0}function qX(t){return t!=null&&typeof t!="function"&&CSe(t.length)}function wSe(t){return t==="__proto__"}function RS(t){return t==null||typeof t!="object"&&typeof t!="function"}function TN(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ESe(t,e){return Vf(t,void 0,t,new Map,e)}function Vf(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(RS(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(Db(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Os(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case yN:case mN:case vN:{const s=new t.constructor(t==null?void 0:t.valueOf());return Os(s,t),s}case xN:{const s={};return Os(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function j8(t){return kSe(t)}function d3(t){return t!==null&&typeof t=="object"&&Db(t)==="[object Arguments]"}function f3(t){return typeof t=="object"&&t!==null}function _Se(t){return f3(t)&&qX(t)}function j1(t){return TN(t)}function ASe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function Mb(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Mb.Cache||Map),r}Mb.Cache=Map;function RSe(t){if(RS(t))return t;const e=Db(t);if(!LSe(t))return{};if(bSe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(j1(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?DSe(i,t):SA(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return SA(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return MSe(r,t),SA(r,t),ISe(r,t),r}function LSe(t){switch(Db(t)){case xN:case IX:case DX:case NX:case vN:case AX:case VX:case WX:case FX:case zX:case GX:case RX:case yN:case MX:case kX:case LX:case mN:case _X:case OX:case $X:case PX:case BX:return!0;default:return!1}}function SA(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function ISe(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function MSe(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function NSe(t){if(RS(t))return t;if(Array.isArray(t)||TN(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function OSe(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var UX="​",PSe={curveBasis:ww,curveBasisClosed:zEe,curveBasisOpen:GEe,curveBumpX:tX,curveBumpY:rX,curveBundle:VEe,curveCardinalClosed:WEe,curveCardinalOpen:qEe,curveCardinal:sX,curveCatmullRomClosed:UEe,curveCatmullRomOpen:HEe,curveCatmullRom:lX,curveLinear:X1,curveLinearClosed:YEe,curveMonotoneX:pX,curveMonotoneY:gX,curveNatural:yX,curveStep:vX,curveStepAfter:bX,curveStepBefore:xX},BSe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,FSe=x(function(t,e){const r=HX(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);ew(s),n=Gn(n,[...s])}else n=r.args;if(!n)return;let i=qM(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),HX=x(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${BSe.source})(?=[}][%]{2}).* `,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),he.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=H1.exec(t))!==null;)if(a.index===H1.lastIndex&&H1.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return he.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),zSe=x(function(t){return t.replace(H1,"")},"removeDirectives"),GSe=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function CN(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return PSe[r]??e}x(CN,"interpolateToCurve");function YX(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?nv.sanitizeUrl(r):r}x(YX,"formatUrl");var VSe=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=wN(i,e),e=i});const n=r/2;return EN(t,n)}x(XX,"traverseEdge");function jX(t){return t.length===1?t[0]:XX(t)}x(jX,"calcLabelPosition");var Z8=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),EN=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=wN(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:Z8((1-s)*r.x+s*i.x,5),y:Z8((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),WSe=x((t,e,r)=>{he.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=EN(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function KX(t,e,r){const n=structuredClone(r);he.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=EN(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(KX,"calcTerminalLabelPosition");function SN(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(SN,"getStylesFromArray");var Q8=0,ZX=x(()=>(Q8++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Q8),"generateId");function QX(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iQX(t.length),"random"),qSe=x(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"),USe=x(function(t,e){const r=e.text.replace(yt.lineBreakRegex," "),[,n]=Zl(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),K1=Mb((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),yt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=$a(`${s} `,r),u=$a(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=HSe(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),HSe=Mb((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if($a(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function _w(t,e){return LS(t,e).height}x(_w,"calculateTextHeight");function $a(t,e){return LS(t,e).width}x($a,"calculateTextWidth");var LS=Mb((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Zl(r),s=["sans-serif",n],o=t.split(yt.lineBreakRegex),l=[],u=ft("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=qSe();y.text=m||UX;const v=USe(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),T=(v._groups||v)[0][0].getBBox();if(T.width===0&&T.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,T.width)),p=Math.round(T.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Bp,YSe=(Bp=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},x(Bp,"InitIDGenerator"),Bp),OT,XSe=x(function(t){return OT=OT||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),OT.innerHTML=t,unescape(OT.textContent)},"entityDecode");function kN(t){return"str"in t}x(kN,"isDetailedError");var jSe=x((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Zl=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function fn(t,e){return $Se({},t,e)}x(fn,"cleanAndMerge");var sr={assignWithDepth:Gn,wrapLabel:K1,calculateTextHeight:_w,calculateTextWidth:$a,calculateTextDimensions:LS,cleanAndMerge:fn,detectInit:FSe,detectDirective:HX,isSubstringInArray:GSe,interpolateToCurve:CN,calcLabelPosition:jX,calcCardinalityPosition:WSe,calcTerminalLabelPosition:KX,formatUrl:YX,getStylesFromArray:SN,generateId:ZX,random:JX,runFunc:VSe,entityDecode:XSe,insertTitle:jSe,isLabelCoordinateInPath:ej,parseFontSize:Zl,InitIDGenerator:YSe},KSe=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),qc=x(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),op=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Wn(t){return t??null}x(Wn,"handleUndefinedAttr");function ej(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(ej,"isLabelCoordinateInPath");var q2={exports:{}},J8=q2.exports,e7;function ZSe(){return e7||(e7=1,(function(t){(function(e){var r=function(){},n=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(h){return setTimeout(h,16)};function i(){var h=this;h.reads=[],h.writes=[],h.raf=n.bind(e)}i.prototype={constructor:i,runTasks:function(h){for(var d;d=h.shift();)d()},measure:function(h,d){var f=d?h.bind(d):h;return this.reads.push(f),a(this),f},mutate:function(h,d){var f=d?h.bind(d):h;return this.writes.push(f),a(this),f},clear:function(h){return o(this.reads,h)||o(this.writes,h)},extend:function(h){if(typeof h!="object")throw new Error("expected object");var d=Object.create(this);return l(d,h),d.fastdom=this,d.initialize&&d.initialize(),d},catch:null};function a(h){h.scheduled||(h.scheduled=!0,h.raf(s.bind(null,h)))}function s(h){var d=h.writes,f=h.reads,p;try{r("flushing reads",f.length),h.runTasks(f),r("flushing writes",d.length),h.runTasks(d)}catch(g){p=g}if(h.scheduled=!1,(f.length||d.length)&&a(h),p)if(r("task errored",p.message),h.catch)h.catch(p);else throw p}function o(h,d){var f=h.indexOf(d);return!!~f&&!!h.splice(f,1)}function l(h,d){for(var f in d)d.hasOwnProperty(f)&&(h[f]=d[f])}var u=e.fastdom=e.fastdom||new i;t.exports=u})(typeof window<"u"?window:typeof J8<"u"?J8:globalThis)})(q2)),q2.exports}var QSe=ZSe();const JSe=jl(QSe);var kA={exports:{}},t7;function eke(){return t7||(t7=1,(function(t){(function(){var e={initialize:function(){this._tasks=new Map},mutate:function(n,i){return r(this,"mutate",n,i)},measure:function(n,i){return r(this,"measure",n,i)},clear:function(n){var i=this._tasks,a=i.get(n);this.fastdom.clear(a),i.delete(n)}};function r(n,i,a,s){var o=n._tasks,l=n.fastdom,u,h=new Promise(function(d,f){u=l[i](function(){o.delete(h);try{d(s?a.call(s):a())}catch(p){f(p)}},s)});return o.set(h,u),h}t.exports=e})()})(kA)),kA.exports}var tke=eke();const rke=jl(tke);function _N(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var dd=_N();function tj(t){dd=t}var Z1={exec:()=>null};function $r(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(ia.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var nke=(()=>{try{return!!new RegExp("(?<=1)(?/,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:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},ike=/^(?:[ \t]*(?:\n|$))+/,ake=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ske=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Nb=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,oke=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,AN=/(?:[*+-]|\d{1,9}[.)])/,rj=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nj=$r(rj).replace(/bull/g,AN).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(),lke=$r(rj).replace(/bull/g,AN).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(),RN=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cke=/^[^\n]+/,LN=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,uke=$r(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",LN).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hke=$r(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,AN).getRegex(),IS="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",IN=/|$))/,dke=$r("^ {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",IN).replace("tag",IS).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ij=$r(RN).replace("hr",Nb).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",IS).getRegex(),fke=$r(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ij).getRegex(),DN={blockquote:fke,code:ake,def:uke,fences:ske,heading:oke,hr:Nb,html:dke,lheading:nj,list:hke,newline:ike,paragraph:ij,table:Z1,text:cke},r7=$r("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Nb).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",IS).getRegex(),pke={...DN,lheading:lke,table:r7,paragraph:$r(RN).replace("hr",Nb).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",r7).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",IS).getRegex()},gke={...DN,html:$r(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",IN).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:Z1,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$r(RN).replace("hr",Nb).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",nj).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},mke=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yke=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,aj=/^( {2,}|\\)\n(?!\s*$)/,vke=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",nke?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),lj=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,wke=$r(lj,"u").replace(/punct/g,DS).getRegex(),Eke=$r(lj,"u").replace(/punct/g,oj).getRegex(),cj="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ske=$r(cj,"gu").replace(/notPunctSpace/g,sj).replace(/punctSpace/g,MN).replace(/punct/g,DS).getRegex(),kke=$r(cj,"gu").replace(/notPunctSpace/g,Tke).replace(/punctSpace/g,bke).replace(/punct/g,oj).getRegex(),_ke=$r("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,sj).replace(/punctSpace/g,MN).replace(/punct/g,DS).getRegex(),Ake=$r(/\\(punct)/,"gu").replace(/punct/g,DS).getRegex(),Rke=$r(/^<(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(),Lke=$r(IN).replace("(?:-->|$)","-->").getRegex(),Ike=$r("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Lke).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Aw=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Dke=$r(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Aw).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),uj=$r(/^!?\[(label)\]\[(ref)\]/).replace("label",Aw).replace("ref",LN).getRegex(),hj=$r(/^!?\[(ref)\](?:\[\])?/).replace("ref",LN).getRegex(),Mke=$r("reflink|nolink(?!\\()","g").replace("reflink",uj).replace("nolink",hj).getRegex(),n7=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,NN={_backpedal:Z1,anyPunctuation:Ake,autolink:Rke,blockSkip:Cke,br:aj,code:yke,del:Z1,emStrongLDelim:wke,emStrongRDelimAst:Ske,emStrongRDelimUnd:_ke,escape:mke,link:Dke,nolink:hj,punctuation:xke,reflink:uj,reflinkSearch:Mke,tag:Ike,text:vke,url:Z1},Nke={...NN,link:$r(/^!?\[(label)\]\((.*?)\)/).replace("label",Aw).getRegex(),reflink:$r(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Aw).getRegex()},p3={...NN,emStrongRDelimAst:kke,emStrongLDelim:Eke,url:$r(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",n7).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$r(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},i7=t=>$ke[t];function go(t,e){if(e){if(ia.escapeTest.test(t))return t.replace(ia.escapeReplace,i7)}else if(ia.escapeTestNoEncode.test(t))return t.replace(ia.escapeReplaceNoEncode,i7);return t}function a7(t){try{t=encodeURI(t).replace(ia.percentDecode,"%")}catch{return null}return t}function s7(t,e){var a;let r=t.replace(ia.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ia.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function o7(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function Bke(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(` `)}var Rw=class{constructor(e){Cr(this,"options");Cr(this,"rules");Cr(this,"lexer");this.options=e||dd}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Gv(n,` `)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=Bke(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Gv(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Gv(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Gv(r[0],` `).split(` `),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,T=>" ".repeat(3*T.length)),p=e.split(` `,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+` `,e=e.substring(p.length+1),u=!0),!u){let T=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),C=this.rules.other.fencesBeginRegex(m),w=this.rules.other.headingBeginRegex(m),S=this.rules.other.htmlBeginRegex(m);for(;e;){let E=e.split(` `,1)[0],_;if(p=E,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),_=p):_=p.replace(this.rules.other.tabCharGlobal," "),C.test(p)||w.test(p)||S.test(p)||T.test(p)||b.test(p))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` `+_.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(f)||w.test(f)||b.test(f))break;d+=` `+p}!g&&!p.trim()&&(g=!0),h+=E+` `,e=e.substring(E.length+1),f=_.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);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(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);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(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Gv(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Pke(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),o7(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return o7(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Fs=class g3{constructor(e){Cr(this,"tokens");Cr(this,"options");Cr(this,"state");Cr(this,"tokenizer");Cr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||dd,this.options.tokenizer=this.options.tokenizer||new Rw,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:ia,block:$T.normal,inline:zv.normal};this.options.pedantic?(r.block=$T.pedantic,r.inline=zv.pedantic):this.options.gfm&&(r.block=$T.gfm,this.options.breaks?r.inline=zv.breaks:r.inline=zv.gfm),this.tokenizer.rules=r}static get rules(){return{block:$T,inline:zv}}static lex(e,r){return new g3(r).lex(e)}static lexInline(e,r){return new g3(r).inlineTokens(e)}lex(e){e=e.replace(ia.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` `+o.text,this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` `+o.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),r.push(o);continue}let l=e;if((s=this.options.extensions)!=null&&s.startBlock){let u=1/0,h=e.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(l))){let u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(T=>{v=T.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},Lw=class{constructor(e){Cr(this,"options");Cr(this,"parser");this.options=e||dd}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(ia.notSpaceStart))==null?void 0:s[0],a=e.replace(ia.endingNewline,"")+` `;return i?'
'+(n?a:go(a,!0))+`
`:"
"+(n?a:go(a,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o `+i+" `}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+go(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let r="",n="";for(let a=0;a${i}`),` `+r+` `+i+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${go(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=a7(e);if(a===null)return i;e=a;let s='
    ",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=a7(e);if(a===null)return go(n);e=a;let s=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}: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 s=r[a.level];s?s.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)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Lw(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Rw(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new v1;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];v1.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&v1.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Fs.lex(e,r??this.defaults)}parser(e,r){return zs.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?Fs.lex:Fs.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?zs.parse:zs.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?Fs.lex:Fs.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?zs.parse:zs.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+go(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Uh=new Fke;function zr(t,e){return Uh.parse(t,e)}zr.options=zr.setOptions=function(t){return Uh.setOptions(t),zr.defaults=Uh.defaults,tj(zr.defaults),zr};zr.getDefaults=_N;zr.defaults=dd;zr.use=function(...t){return Uh.use(...t),zr.defaults=Uh.defaults,tj(zr.defaults),zr};zr.walkTokens=function(t,e){return Uh.walkTokens(t,e)};zr.parseInline=Uh.parseInline;zr.Parser=zs;zr.parser=zs.parse;zr.Renderer=Lw;zr.TextRenderer=ON;zr.Lexer=Fs;zr.lexer=Fs.lex;zr.Tokenizer=Rw;zr.Hooks=v1;zr.parse=zr;zr.options;zr.setOptions;zr.use;zr.walkTokens;zr.parseInline;zs.parse;Fs.lex;function dj(t){for(var e=[],r=1;ry3?performance.now():0,"now"),_A="🧜 ",zke="Mermaid render",Gke="Mermaid",Vke={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},Fp;Fp=class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(e){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(e))}tickSync(e,r){if(!this.enabled)return r();const n=Yd();try{return r()}finally{this.buckets[e]=(this.buckets[e]??0)+(Yd()-n)}}async tick(e,r){if(!this.enabled)return r();const n=Yd();try{return await r()}finally{this.buckets[e]=(this.buckets[e]??0)+(Yd()-n)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();const e=this.roots.at(-1),r=this.runLabel??(e==null?void 0:e.name);return e&&(this.records.push({label:r??e.name,tree:e,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(e,r)),this.runLabel=void 0,e}begin(e){if(!this.enabled)return;const r={name:e,start:Yd(),duration:-1,children:[]},n=this.stack.at(-1);if(n?n.children.push(r):this.roots.push(r),this.stack.push(r),y3&&typeof performance.mark=="function")try{performance.mark(`${_A}${e} ▶`)}catch{}}end(){if(!this.enabled)return;const e=this.stack.pop();if(!e)return;const r=Yd();if(e.duration=r-e.start,y3&&typeof performance.measure=="function")try{performance.measure(`${_A}${e.name}`,{start:e.start,end:r,detail:{devtools:{dataType:"track-entry",track:zke,trackGroup:Gke,color:Vke[e.name]??"primary",tooltipText:`${e.name} — ${e.duration.toFixed(1)} ms`}}})}catch{}}async span(e,r){if(!this.enabled)return r();this.begin(e);try{return await r()}finally{this.end()}}report(){var e;return((e=this.records.at(-1))==null?void 0:e.tree)??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(e=this.report(),r){if(!e)return;const n=e.duration,i=r&&r!==e.name?`${e.name} [${r}]`:e.name,a=["ms % phase"],s=x((l,u)=>{const h=" ".repeat(u),d=l.duration.toFixed(1).padStart(8),f=n>0?`${(l.duration/n*100).toFixed(0).padStart(3)}%`:" -";a.push(`${d} ${f} ${h}${l.name}`);for(const p of l.children)s(p,u+1);if(l.children.length>0){const p=l.children.reduce((m,y)=>m+y.duration,0),g=l.duration-p;if(g>.5){const m=g.toFixed(1).padStart(8);a.push(`${m} ${h} (self)`)}}},"walk");s(e,0);const o=Object.keys(this.buckets);if(o.length>0){a.push("—— buckets (summed) ——");for(const l of o)a.push(`${this.buckets[l].toFixed(1).padStart(8)} ${l}`)}console.log(`${_A}mermaid render profile · ${i} ${a.join(` `)}`)}},x(Fp,"Profiler");globalThis.injected??(globalThis.injected={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"});var Wke=JSe.extend({raf(t){typeof queueMicrotask=="function"?queueMicrotask(t):setTimeout(t,0)}}).extend(rke),Hh=Wke;function fj(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` `);return dj(n)}x(fj,"preprocessMarkdown");function pj(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}x(pj,"nonMarkdownToLines");function gj(t,e={}){const r=fj(t,e),n=zr.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` `).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return x(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}x(gj,"markdownToLines");function mj(t){return t?`

    ${t.replace(/\\n|\n/g,"
    ")}

    `:""}x(mj,"nonMarkdownToHTML");function yj(t,{markdownAutoWrap:e}={}){const r=zr.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
    ").replace(/ /g," "):i.text.replace(/\n */g,"
    "):i.type==="strong"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="em"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="paragraph"?`

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

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(he.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(yj,"markdownToHTML");function vj(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}x(vj,"splitTextToChars");function xj(t,e){const r=vj(e.content);return $N(t,[],r,e.type)}x(xj,"splitWordToFitWidth");function $N(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?$N(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}x($N,"splitWordToFitWidthRecursion");function bj(t,e){if(t.some(({content:r})=>r.includes(` `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Iw(t,e)}x(bj,"splitLineToFitWidth");function Iw(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return Iw(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=xj(e,a);r.push([o]),l.content&&t.unshift(l)}return Iw(t,e,r)}x(Iw,"splitLineToFitWidthRecursion");function v3(t,e){e&&t.attr("style",e)}x(v3,"applyStyle");var l7=16384;async function Tj(t,e,r,n,i=!1,a=It()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,l7)}px`),s.attr("height",`${Math.min(10*r,l7)}px`);const o=s.append("xhtml:div"),l=On(e.label)?await bS(e.label.replace(yt.lineBreakRegex,` `),a):xr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");return h.html(l),v3(h,e.labelStyle),h.attr("class",`${u} ${n}`),v3(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg"),(await Hh.measure(()=>o.node().getBoundingClientRect())).width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px")),s.node()}x(Tj,"addHtmlSpan");function MS(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}x(MS,"createTspan");function Cj(t,e,r){const n=t.append("text"),i=MS(n,1,e);NS(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}x(Cj,"computeWidthOfText");function wj(t,e,r){var s;const n=t.append("text"),i=MS(n,1,e);NS(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}x(wj,"computeDimensionOfText");function Ej(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=x(p=>Cj(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:bj(h,d);for(const p of f){const g=MS(l,u,1.1,i);NS(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}x(Ej,"createFormattedText");function x3(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}x(x3,"decodeHTMLEntities");function NS(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(x3(r.content)):i.text(" "+x3(r.content))})}x(NS,"updateTextContentAndStyles");async function Sj(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await ySe(o)?await $l(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(Sj,"replaceIconSubstring");var Va=x(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(he.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?yj(e,h):mj(e),f=await Sj(qc(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:On(e)?p:f,labelStyle:r.replace("fill:","color:")};return await Tj(t,g,l,i,u,h)}else{const d=qc(e.replace(//g,"
    ")),f=s?gj(d.replace("
    ","
    "),h):pj(d),p=Ej(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ft(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ft(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ft(p).select("text").attr("style",m)}return n?ft(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ft(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function AA(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function qke(t,e){return t[0]===e[0]&&t[1]===e[1]}function Uke(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)AA(u,o,i);const l=(function(u,h,d){const f=[];for(const T of u){const b=[...T];qke(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const T of f)for(let b=0;bT.yminb.ymin?1:T.xb.x?1:T.ymax===b.ymax?0:(T.ymax-b.ymax)/Math.abs(T.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let T=-1;for(let b=0;by);b++)T=b;g.splice(0,T+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((T=>!(T.edge.ymax<=y))),m.sort(((T,b)=>T.edge.x===b.edge.x?0:(T.edge.x-b.edge.x)/Math.abs(T.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let T=0;T=m.length)break;const C=m[T].edge,w=m[b].edge;p.push([[Math.round(C.x),y],[Math.round(w.x),y]])}y+=d,m.forEach((T=>{T.edge.x=T.edge.x+d*T.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)AA(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),AA(f,h,d)})(l,o,-i)}return l}function Ob(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),Uke(t,i,n,a||1)}class PN{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=Ob(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function OS(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class Hke extends PN{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=Ob(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)OS([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class Yke extends PN{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let Xke=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=Ob(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=OS(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=OS(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=OS(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function _j(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,T=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,T,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,T=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,T,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(Aj(n,i,y,v,d,f,p,g,m).forEach((function(T){e.push({key:"C",data:T})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function Vv(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function Aj(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=Vv(t,e,-h),[r,n]=Vv(r,n,-h);const $=(t-r)/2,A=(e-n)/2;let I=$*$/(i*i)+A*A/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);const O=i*i,N=a*a,M=O*N-O*A*A-N*$*$,P=O*A*A+N*$*$,F=(o===l?-1:1)*Math.sqrt(Math.abs(M/P));m=F*i*A/a+(t+r)/2,y=F*-a*$/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const $=g,A=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=Aj(r=m+i*Math.cos(g),n=y+a*Math.sin(g),A,I,i,a,s,0,l,[g,$,m,y])}v=g-p;const T=Math.cos(p),b=Math.sin(p),C=Math.cos(g),w=Math.sin(g),S=Math.tan(v/4),E=4/3*i*S,_=4/3*a*S,R=[t,e],D=[t+E*b,e-_*T],L=[r+E*w,n-_*C],B=[r,n];if(D[0]=2*R[0]-D[0],D[1]=2*R[1]-D[1],u)return[D,L,B].concat(f);{f=[D,L,B].concat(f);const $=[];for(let A=0;A2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=g7(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const T=g7(y,u,h,d,f,p,g,1.5,l);v.push(...T)}return s&&(o?v.push(...Uc(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Uc(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function d7(t,e){const r=_j(kj(BN(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Uc(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...t_e(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Uc(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function IA(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+Qt(i,e),n[0][1]+Qt(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*Ij(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=Qt(p,i,u),g=Qt(g,i,u);const m=[],y=()=>Qt(d,i,u),v=()=>Qt(h,i,u),T=i.preserveVertices;return s?m.push({op:"move",data:[t+(T?0:y()),e+(T?0:y())]}):m.push({op:"move",data:[t+(T?0:Qt(h,i,u)),e+(T?0:Qt(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(T?0:y()),n+(T?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(T?0:v()),n+(T?0:v())]}),m}function BT(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+Qt(e,r),t[0][1]+Qt(e,r)]),n.push([t[0][0]+Qt(e,r),t[0][1]+Qt(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=Vu(l,u,.5),p=Vu(u,h,.5),g=Vu(h,d,.5),m=Vu(f,p,.5),y=Vu(p,g,.5),v=Vu(m,y,.5);C3([l,f,m,v],0,r,i),C3([v,y,g,d],0,r,i)}var a,s;return i}function n_e(t,e){return Nw(t,0,t.length,e)}function Nw(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(Nw(t,e,u+1,n,a),Nw(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function DA(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?Nw(n,0,n.length,r):n}const Ya="none";class Ow{constructor(e){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=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[Rj(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=e_e(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(IA([u],s)):o.push(Xd([u],s))}return s.stroke!==Ya&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=Lj(n,i,s),u=b3(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=b3(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(Xd([u.estimatedPoints],s));return s.stroke!==Ya&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[U2(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=h7(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=h7(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,T){const b=f,C=p;let w=Math.abs(g/2),S=Math.abs(m/2);w+=Qt(.01*w,T),S+=Qt(.01*S,T);let E=y,_=v;for(;E<0;)E+=2*Math.PI,_+=2*Math.PI;_-E>2*Math.PI&&(E=0,_=2*Math.PI);const R=(_-E)/T.curveStepCount,D=[];for(let L=E;L<=_;L+=R)D.push([b+w*Math.cos(L),C+S*Math.sin(L)]);return D.push([b+w*Math.cos(_),C+S*Math.sin(_)]),D.push([b,C]),Xd([D],T)})(e,r,n,i,a,s,u));return u.stroke!==Ya&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=u7(e,n);if(n.fill&&n.fill!==Ya)if(n.fillStyle==="solid"){const s=u7(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...DA(m7([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...DA(m7(u),10,(1+n.roughness)/2))}s.length&&i.push(Xd([s],n))}return n.stroke!==Ya&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=U2(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(IA([e],n)):i.push(Xd([e],n))),n.stroke!==Ya&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Ya,s=n.stroke!==Ya,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=_j(kj(BN(h))),g=[];let m=[],y=[0,0],v=[];const T=()=>{v.length>=4&&m.push(...DA(v,d)),v=[]},b=()=>{T(),m.length&&(g.push(m),m=[])};for(const{key:w,data:S}of p)switch(w){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":T(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const E=m.length?m[m.length-1]:y;v.push([E[0],E[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":T(),m.push([y[0],y[1]])}if(b(),!f)return g;const C=[];for(const w of g){const S=n_e(w,f);S.length&&C.push(S)}return C})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=d7(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=d7(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(IA(l,n));else i.push(Xd(l,n));return s&&(o?l.forEach((h=>{i.push(U2(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Ya};break;case"fillPath":s={d:this.opsToPath(a),stroke:Ya,strokeWidth:0,fill:n.fill||Ya};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Ya,strokeWidth:n,fill:Ya}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class i_e{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new Ow(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const FT="http://www.w3.org/2000/svg";class a_e{constructor(e,r){this.svg=e,this.gen=new Ow(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(FT,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(FT,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(FT,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(FT,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var St={canvas:(t,e)=>new i_e(t,e),svg:(t,e)=>new a_e(t,e),generator:t=>new Ow(t),newSeed:()=>Ow.newSeed()},s_e=1,o_e=3;async function FN(t){const e=t.getElementsByTagName("img");if(!e||e.length===0)return;const r=!zN(t);await Promise.all([...e].map(n=>new Promise(i=>{function a(){if(n.style.display="flex",n.style.flexDirection="column",r){const s=Pe().fontSize?Pe().fontSize:window.getComputedStyle(document.body).fontSize,o=5,[l=pr.fontSize]=Zl(s),u=l*o+"px";n.style.minWidth=u,n.style.maxWidth=u}else n.style.width="100%";i(n)}x(a,"setupImage"),setTimeout(()=>{n.complete&&a()}),n.addEventListener("error",a),n.addEventListener("load",a)})))}x(FN,"configureLabelImages");function zN(t){var r;return t.nodeType===o_e?((r=t.textContent)==null?void 0:r.trim())!=="":t.nodeType!==s_e||t.tagName.toLowerCase()==="img"?!1:[...t.childNodes].some(zN)}x(zN,"hasTextBesidesImages");var y7=3,l_e=32,c_e=x(async(t,e,r)=>{var v,T,b;const n=Pe(),i=t.insert("g").attr("class",r??"node default").attr("id",e.domId||e.id),a=i.insert("g").attr("class","label").attr("style",Wn(e.labelStyle)),o=[{text:typeof e.label=="string"?e.label:((v=e.label)==null?void 0:v[0])??"",cssClass:"c4-name"},{text:e.stereotype,cssClass:"c4-type"},...(e.description??[]).map(C=>({text:C,cssClass:"c4-descr"}))].filter(C=>C.text),l=e.width?Math.max(e.width-2*(e.padding??0),l_e):((T=Pe().flowchart)==null?void 0:T.wrappingWidth)??200,h=((b=n.c4)==null?void 0:b.wrap)??!0?l:Number.POSITIVE_INFINITY,d=await Promise.all(o.map(async C=>{const w=a.append("g").attr("class",C.cssClass),S=await Va(w,xr(qc(C.text??""),n),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:e.labelStyle},n);return ft(S).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),ft(S).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:w,box:w.node().getBBox()}})),f=Math.max(...d.map(({box:C})=>C.width),0);let p=0;for(const{el:C,box:w}of d)C.attr("transform",`translate(${f/2-w.x-w.width/2}, ${p-w.y})`),p+=w.height+y7;const g=d.length>0?p-y7:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-f/2}, ${-g/2})`);const m=a.node().getBBox(),y=(e.padding??0)/2;return{shapeSvg:i,bbox:m,halfPadding:y,label:a}},"c4LabelHelper"),Nt=x(async(t,e,r)=>{var p,g;if(e.stereotype!==void 0)return c_e(t,e,r);let n;const i=e.useHtmlLabels||Ho((p=Pe())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",Wn(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Va(s,xr(qc(o),Pe()),{useHtmlLabels:i,width:e.width||e.wrappingWidth||((g=Pe().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Pe()),d=((e==null?void 0:e.padding)??0)/2;let f;if(i){const m=h.children[0],y=ft(h);await FN(m),f=await Hh.measure(()=>m.getBoundingClientRect()),y.attr("width",f.width),y.attr("height",f.height)}else f=await Hh.measure(()=>h.getBBox());return i?s.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):s.attr("transform","translate(0, "+-f.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:f,halfPadding:d,label:s}},"labelHelper"),MA=x(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??qi(Pe()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Va(i,xr(qc(e),Pe()),{useHtmlLabels:n,width:r.width||((u=(l=Pe())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=r.padding/2;let o;if(qi(Pe())){const h=a.children[0],d=ft(a);o=await Hh.measure(()=>h.getBoundingClientRect()),d.attr("width",o.width),d.attr("height",o.height)}else o=await Hh.measure(()=>a.getBBox());return n?i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):i.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:o,halfPadding:s,label:i}},"insertLabel"),_t=x((t,e,r)=>{if(r){t.width=r.width,t.height=r.height;return}const n=e.node().getBBox();t.width=n.width,t.height=n.height},"updateNodeBounds"),Ot=x((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Sr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}x(Sr,"createPathFromPoints");function Hc(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}x(Hc,"generateFullSineWavePoints");function _o(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=x((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}x(w3,"mergePaths");var u_e=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),fd=u_e,Ss=x((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),h_e=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=qi(s);return await Va(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Rc=h_e;function Dj(t,e){return t.intersect(e)}x(Dj,"intersectNode");var d_e=Dj;function Mj(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(E3,"sameSign");var p_e=$j;function Pj(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",Wn(o)),_t(e,d),e.intersect=function(f){return he.info("Circle intersect",e,s,f),Ct.circle(e,s,f)},a}x(Bj,"anchor");function S3(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**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),v=l+y*a*Math.sin(h)*(s?-1:1),T=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-T)/a,(t-v)/i);let w=Math.atan2((n-T)/a,(r-v)/i)-b;s&&w<0&&(w+=2*Math.PI),!s&&w>0&&(w-=2*Math.PI);const S=[];for(let E=0;E<20;E++){const _=E/19,R=b+_*w,D=v+i*Math.cos(R),L=T+a*Math.sin(R);S.push({x:D,y:L})}return S}x(S3,"generateArcPoints");function Fj(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}x(Fj,"calculateArcSagitta");async function zj(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=x(R=>R+s,"calcTotalHeight"),l=x(R=>{const D=R/2;return[D/(2.5+R/50),D]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Nt(t,e,Ot(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=Fj(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:T}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...S3(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...S3(y/2,v/2,y/2,-v/2,f,p,!0)],C=St.svg(u),w=kt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=Sr(b),E=C.path(S,w),_=u.insert(()=>E,":first-child");return _.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${f/2}, 0)`),_t(e,_),e.intersect=function(R){return Ct.polygon(e,b,R)},u}x(zj,"bowTieRect");async function Gj(t,e,{config:{themeVariables:r}}){var E;const{labelStyles:n,nodeStyles:i}=Et(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,label:o}=await Nt(t,e,Ot(e)),l=(r==null?void 0:r.nodeBorder)??(r==null?void 0:r.lineColor)??"currentColor",u=e.padding??12,h=Math.max(s.width+u*2,e.width??0,80),d=Math.max(Math.min(h*.08,12),5),f=Math.max(s.height+u*2+d,e.height??0),p=-f/2+d,g=f/2,m=h*.72,y=[`M${-h/2},${p}`,`L${-m/2},${g}`,`A${m/2},${d} 0 0 0 ${m/2},${g}`,`L${h/2},${p}`,`A${h/2},${d} 0 0 0 ${-h/2},${p}`,"Z"].join(" "),{cssStyles:v}=e,T=a.insert("g",":first-child").attr("class","basic label-container");if(e.look==="handDrawn"){const R=St.svg(a).path(y,kt(e,{}));(E=T.node())==null||E.appendChild(R),v&&T.attr("style",v)}else T.append("path").attr("d",y).attr("style",i);T.append("ellipse").attr("cx",0).attr("cy",p).attr("rx",h/2).attr("ry",d).attr("style",`fill:none;stroke:${l};stroke-width:1px`),_t(e,T);const b=p+(g-p)/2;o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${b-s.height/2-(s.y-(s.top??0))})`);const C=12,w=x((_,R,D)=>Array.from({length:C+1},(L,B)=>{const $=Math.PI-B*Math.PI/C;return{x:_*Math.cos($),y:R+D*d*Math.sin($)}}),"arc"),S=[...w(h/2,p,-1),...w(m/2,g,1).reverse()];return e.intersect=function(_){return Ct.polygon(e,S,_)},a}x(Gj,"bucket");var v7=20,x7=8,m_e=80,NA=8;async function Vj(t,e){const{themeVariables:r}=Pe(),n=r.clusterBkg,i=r.clusterBorder,{nodeStyles:a}=Et(e),{shapeSvg:s,bbox:o}=await Nt(t,e,Ot(e)),l=e.padding??8,u=o.height,h=Math.max(o.width+l*2,m_e,(e==null?void 0:e.width)??0),d=Math.max(u+x7+v7+l*2,(e==null?void 0:e.height)??0),f=-h/2,p=-d/2,g=-28/2,m=s.select(".label");m&&(e.useHtmlLabels??qi(Pe())?m.attr("transform",`translate(${-o.width/2}, ${-o.height/2+g})`):m.attr("transform",`translate(0, ${-o.height/2+g})`));let y;if(e.look==="handDrawn"){const w=St.svg(s),S=kt(e,{fill:n,stroke:i,fillStyle:"solid"}),E=w.path(Ss(f,p,h,d,NA),S);y=s.insert(()=>E,":first-child"),y.attr("class","basic label-container collapsed-group").attr("style",Wn(e.cssStyles))}else y=s.insert("rect",":first-child"),y.attr("class","basic label-container collapsed-group").attr("style",a).attr("rx",NA).attr("ry",NA).attr("x",f).attr("y",p).attr("width",h).attr("height",d).attr("fill",n).attr("stroke",i);const v=p+l+u+x7;s.append("line").attr("class","collapsed-separator").attr("x1",f+8).attr("y1",v).attr("x2",f+h-8).attr("y2",v).attr("stroke",i).attr("stroke-dasharray","3, 3");const T=v+v7/2,b=2.5,C=10;for(let w=-1;w<=1;w++)s.append("circle").attr("class","collapsed-indicator").attr("cx",w*C).attr("cy",T).attr("r",b).attr("fill",i);return _t(e,y),e.calcIntersect=function(w,S){return Ct.rect(w,S)},e.intersect=function(w){return Ct.rect(e,w)},s}x(Vj,"collapsedGroup");function Xo(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(Xo,"insertPolygonShape");var y_e=["right","left","up","down"],GN="point",v_e=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),x_e=x(t=>y_e.filter(e=>t.has(e)).join("|")||GN,"getDirectionKey"),b7={"right|left|up|down":x(({height:t,midpoint:e,padding:r,width:n})=>[{x:0,y:0},{x:e,y:0},{x:n/2,y:2*r},{x:n-e,y:0},{x:n,y:0},{x:n,y:-t/3},{x:n+2*r,y:-t/2},{x:n,y:-2*t/3},{x:n,y:-t},{x:n-e,y:-t},{x:n/2,y:-t-2*r},{x:e,y:-t},{x:0,y:-t},{x:0,y:-2*t/3},{x:-2*r,y:-t/2},{x:0,y:-t/3}],"right|left|up|down"),"right|left|up":x(({height:t,midpoint:e,width:r})=>[{x:e,y:0},{x:r-e,y:0},{x:r,y:-t/2},{x:r-e,y:-t},{x:e,y:-t},{x:0,y:-t/2}],"right|left|up"),"right|left|down":x(({height:t,midpoint:e,width:r})=>[{x:0,y:0},{x:e,y:-t},{x:r-e,y:-t},{x:r,y:0}],"right|left|down"),"right|up|down":x(({height:t,midpoint:e,width:r})=>[{x:0,y:0},{x:r,y:-e},{x:r,y:-t+e},{x:0,y:-t}],"right|up|down"),"left|up|down":x(({height:t,midpoint:e,width:r})=>[{x:r,y:0},{x:0,y:-e},{x:0,y:-t+e},{x:r,y:-t}],"left|up|down"),"right|left":x(({height:t,midpoint:e,padding:r,width:n})=>[{x:e,y:0},{x:e,y:-r},{x:n-e,y:-r},{x:n-e,y:0},{x:n,y:-t/2},{x:n-e,y:-t},{x:n-e,y:-t+r},{x:e,y:-t+r},{x:e,y:-t},{x:0,y:-t/2}],"right|left"),"up|down":x(({height:t,midpoint:e,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:e,y:-r},{x:e,y:-t+r},{x:0,y:-t+r},{x:n/2,y:-t},{x:n,y:-t+r},{x:n-e,y:-t+r},{x:n-e,y:-r},{x:n,y:-r}],"up|down"),"right|up":x(({height:t,midpoint:e,width:r})=>[{x:0,y:0},{x:r,y:-e},{x:0,y:-t}],"right|up"),"right|down":x(({height:t,width:e})=>[{x:0,y:0},{x:e,y:0},{x:0,y:-t}],"right|down"),"left|up":x(({height:t,midpoint:e,width:r})=>[{x:r,y:0},{x:0,y:-e},{x:r,y:-t}],"left|up"),"left|down":x(({height:t,width:e})=>[{x:e,y:0},{x:0,y:0},{x:e,y:-t}],"left|down"),right:x(({height:t,midpoint:e,padding:r,width:n})=>[{x:e,y:-r},{x:e,y:-r},{x:n-e,y:-r},{x:n-e,y:0},{x:n,y:-t/2},{x:n-e,y:-t},{x:n-e,y:-t+r},{x:e,y:-t+r},{x:e,y:-t+r}],"right"),left:x(({height:t,midpoint:e,padding:r,width:n})=>[{x:e,y:0},{x:e,y:-r},{x:n-e,y:-r},{x:n-e,y:-t+r},{x:e,y:-t+r},{x:e,y:-t},{x:0,y:-t/2}],"left"),up:x(({height:t,midpoint:e,padding:r,width:n})=>[{x:e,y:-r},{x:e,y:-t+r},{x:0,y:-t+r},{x:n/2,y:-t},{x:n,y:-t+r},{x:n-e,y:-t+r},{x:n-e,y:-r}],"up"),down:x(({height:t,midpoint:e,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:e,y:-r},{x:e,y:-t+r},{x:n-e,y:-t+r},{x:n-e,y:-r},{x:n,y:-r}],"down"),[GN]:()=>[{x:0,y:0}]},b_e=x((t,e,r,n)=>{const i=v_e(t),a=(r.padding??0)/2,s=e.height+4*a,o=s/2,l=n??e.width+2*o+2*a,u=x_e(i);return(b7[u]??b7[GN])({height:s,midpoint:o,padding:a,width:l})},"getArrowPoints");async function Wj(t,e){const r=e,{shapeSvg:n,bbox:i}=await Nt(t,r,Ot(r)),a=r.padding??0,s=i.height+2*a,o=s/2,l=i.width+2*o+a,u=r.width??0,d=r.positioned&&(r.widthInColumns??1)>1&&u>l?u:l,f=b_e(r.directions??[],i,r,d),p=Xo(n,d,s,f);return p.attr("style",r.style??null),_t(r,p),r.intersect=function(g){return Ct.polygon(r,f,g)},n}x(Wj,"block_arrow");async function qj(t,e,{config:{themeVariables:r}}){var T;const{labelStyles:n,nodeStyles:i}=Et(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,label:o}=await Nt(t,e,Ot(e)),l=(r==null?void 0:r.nodeBorder)??(r==null?void 0:r.lineColor)??"currentColor",u=e.padding??12,h=18,d=12,f=Math.max(s.width+u*2,e.width??0,90),p=Math.max(s.height+u*2+h,e.height??0),g=-p/2,{cssStyles:m}=e,y=a.insert("g",":first-child").attr("class","basic label-container");if(e.look==="handDrawn"){const C=St.svg(a).path(Ss(-f/2,g,f,p,d),kt(e,{}));(T=y.node())==null||T.appendChild(C),m&&y.attr("style",m)}else y.append("rect").attr("x",-f/2).attr("y",g).attr("width",f).attr("height",p).attr("rx",d).attr("ry",d).attr("style",i);y.append("line").attr("x1",-f/2).attr("y1",g+h).attr("x2",f/2).attr("y2",g+h).attr("style",`stroke:${l};stroke-width:1px`);for(let b=0;b<3;b++)y.append("circle").attr("cx",-f/2+12+b*9).attr("cy",g+h/2).attr("r",2.5).attr("style",`fill:${l};stroke:none`);y.append("rect").attr("class","browser-address-bar").attr("x",-f/2+44).attr("y",g+4).attr("width",Math.max(f-56,10)).attr("height",h-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),_t(e,y);const v=g+h+(p-h)/2;return o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${v-s.height/2-(s.y-(s.top??0))})`),e.intersect=function(b){return Ct.rect(e,b)},a}x(qj,"browser");var zT=12;async function Uj(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+zT),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+zT,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+zT},{x:d+zT,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=St.svg(o),b=kt(e,{}),C=Sr(m),w=T.path(C,b);y=o.insert(()=>w,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=Xo(o,u,h,m);return n&&y.attr("style",n),_t(e,y),e.intersect=function(T){return Ct.polygon(e,m,T)},o}x(Uj,"card");function Hj(t,e){const{nodeStyles:r}=Et(e);e.label="";const n=t.insert("g").attr("class",Ot(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=St.svg(n),l=kt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Sr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Ct.polygon(e,s,f)},n}x(Hj,"choice");async function VN(t,e,r){const{labelStyles:n,nodeStyles:i}=Et(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await Nt(t,e,Ot(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=St.svg(a),g=kt(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Wn(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return _t(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Ct.circle(p,m,g)},e.intersect=function(p){return he.info("Circle intersect",e,h,p),Ct.circle(e,h,p)},a}x(VN,"circle");async function Yj(t,e){const r=e,n=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:i,bbox:a,halfPadding:s}=await Nt(t,r,n),o=i.insert("rect",":first-child"),l=r.padding??0,u=r.positioned?r.width??0:a.width+l,h=r.positioned?r.height??0:a.height+l,d=r.positioned?-u/2:-a.width/2-s,f=r.positioned?-h/2:-a.height/2-s;return o.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",d).attr("y",f).attr("width",u).attr("height",h),_t(r,o),r.intersect=function(p){return Ct.rect(r,p)},i}x(Yj,"composite");async function Xj(t,e,{config:{themeVariables:r}}){var T;const{labelStyles:n,nodeStyles:i}=Et(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,label:o}=await Nt(t,e,Ot(e)),l=(r==null?void 0:r.nodeBorder)??(r==null?void 0:r.lineColor)??"currentColor",u=e.padding??12,h=20,d=12,f=Math.max(s.width+u*2,e.width??0,90),p=Math.max(s.height+u*2+h,e.height??0),g=-p/2,{cssStyles:m}=e,y=a.insert("g",":first-child").attr("class","basic label-container");if(e.look==="handDrawn"){const C=St.svg(a).path(Ss(-f/2,g,f,p,d),kt(e,{}));(T=y.node())==null||T.appendChild(C),m&&y.attr("style",m)}else y.append("rect").attr("x",-f/2).attr("y",g).attr("width",f).attr("height",p).attr("rx",d).attr("ry",d).attr("style",i);y.append("text").attr("x",-f/2+12).attr("y",g+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(">_"),_t(e,y);const v=g+h+(p-h)/2;return o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${v-s.height/2-(s.y-(s.top??0))})`),e.intersect=function(b){return Ct.rect(e,b)},a}x(Xj,"consoleWindow");function jj(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} M ${i.x},${i.y} L ${s.x},${s.y}`}x(jj,"createLine");function Kj(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",Ot(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=St.svg(i),l=kt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=jj(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),_t(e,f),e.intersect=function(p){return he.info("crossedCircle intersect",e,{radius:a,point:p}),Ct.circle(e,a,p)},i}x(Kj,"crossedCircle");function hl(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dw,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),_t(e,S),e.intersect=function(E){return Ct.polygon(e,g,E)},i}x(Zj,"curlyBraceLeft");function dl(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dw,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),_t(e,S),e.intersect=function(E){return Ct.polygon(e,g,E)},i}x(Qj,"curlyBraceRight");function Ci(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dR,":first-child").attr("stroke-opacity",0),D.insert(()=>C,":first-child"),D.insert(()=>E,":first-child"),D.attr("class","text"),f&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",n),D.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),_t(e,D),e.intersect=function(L){return Ct.polygon(e,m,L)},i}x(Jj,"curlyBraces");async function eK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await Nt(t,e,Ot(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=St.svg(u),y=kt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,T=f,b=v-p,C=T/4,w=[{x:b,y:0},{x:C,y:0},{x:0,y:T/2},{x:C,y:T},{x:b,y:T},..._o(-b,-T/2,p,50,270,90)],S=Sr(w),E=m.path(S,y),_=u.insert(()=>E,":first-child");return _.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",n),_.attr("transform",`translate(${-d/2}, ${-f/2})`),_t(e,_),e.intersect=function(R){return Ct.polygon(e,w,R)},u}x(eK,"curvedTrapezoid");async function tK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Nt(t,e,Ot(e)),o=e.padding??20,l=Math.max(a.width+o*2,e.width??0,100),u=Math.min(Math.max(l*.23,16),56),h=u*.27,d=Math.max(a.height+o*2,e.height?e.height-(2*u-h):0),f=Math.min(l*.177,d*.45),p=d+2*u-h,g=-p/2,m=g+2*u-h,y=i.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:v}=e;if(e.look==="handDrawn"){const _=St.svg(i),R=kt(e,{}),D=_.path(Ss(-l/2,m,l,d,f),R),L=_.circle(0,g+u,u*2,R);y.insert(()=>L,":first-child"),y.insert(()=>D,":first-child"),v&&y.attr("style",v)}else y.append("rect").attr("x",-l/2).attr("y",m).attr("width",l).attr("height",d).attr("rx",f).attr("ry",f).attr("style",n),y.append("circle").attr("cx",0).attr("cy",g+u).attr("r",u).attr("style",n);_t(e,y);const T=m+d/2;s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${T-a.height/2-(a.y-(a.top??0))})`);const b=g+u,C=Math.asin(Math.min(1,(m-b)/u))*180/Math.PI,E=[..._o(0,-b,u,24,180+C,-C),..._o(-(-l/2+f),-(m+f),f,12,90,0),..._o(-(-l/2+f),-(p/2-f),f,12,360,270),..._o(-(l/2-f),-(p/2-f),f,12,270,180),..._o(-(l/2-f),-(m+f),f,12,180,90)];return e.intersect=function(_){return Ct.polygon(e,E,_)},i}x(tK,"person");var T_e=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),C_e=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),w_e=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),T7=8,C7=8;async function rK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i,o=e.width??0;if(e.width&&(e.width=e.width-s,e.widthS,":first-child"),m=l.insert(()=>w,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=T_e(0,0,d,g,f,p);m=l.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Wn(y)).attr("style",n)}return m.attr("label-offset-y",p),m.attr("transform",`translate(${-d/2}, ${-(g/2+p)})`),_t(e,m),h.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+(e.padding??0)/1.5-(u.y-(u.top??0))})`),e.intersect=function(v){const T=Ct.rect(e,v),b=T.x-(e.x??0);if(f!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(T.y-(e.y??0))>(e.height??0)/2-p)){let C=p*p*(1-b*b/(f*f));C>0&&(C=Math.sqrt(C)),C=p-C,v.y-(e.y??0)>0&&(C=-C),T.y+=C}return T},l}x(rK,"cylinder");async function iv(t,e,r){const{labelStyles:n,nodeStyles:i}=Et(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await Nt(t,e,Ot(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=St.svg(a),y=kt(e,{}),v=f||p?m.path(Ss(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",Wn(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Wn(f)).attr("ry",Wn(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return _t(e,d,e.look==="handDrawn"?void 0:{width:o,height:l}),e.calcIntersect=function(m,y){return Ct.rect(m,y)},e.intersect=function(m){return Ct.rect(e,m)},a}x(iv,"drawRect");async function nK(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await iv(t,e,l);if(e.look==="handDrawn"){const p=St.svg(u),g=kt(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}x(nK,"datastore");async function iK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await Nt(t,e,Ot(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=St.svg(s),y=kt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],T=m.polygon(v.map(C=>[C.x,C.y]),y),b=s.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),_t(e,b),e.intersect=function(C){return Ct.rect(e,C)},s}x(iK,"dividedRectangle");async function aK(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Et(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=St.svg(o),y=kt(e,{roughness:.2,strokeWidth:2.5}),v=kt(e,{roughness:.2,strokeWidth:1.5}),T=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Wn(e.cssClasses)).attr("style",Wn(f)),(p=d.node())==null||p.appendChild(T),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return _t(e,d),e.intersect=function(m){return he.info("DoubleCircle intersect",e,u,m),Ct.circle(e,u,m)},o}x(aK,"doublecircle");function sK(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Et(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",Ot(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=St.svg(a),{nodeBorder:u}=r,h=kt(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),_t(e,f),e.intersect=function(p){return he.info("filledCircle intersect",e,{radius:s,point:p}),Ct.circle(e,s,p)},a}x(sK,"filledCircle");var w7=10,E7=10;async function oK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),e.width=u,e.height=h,_t(e,T),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return he.info("Triangle intersect",e,f,b),Ct.polygon(e,f,b)},s}x(oK,"flippedTriangle");async function lK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Nt(t,e,Ot(e)),o=e.padding??12,l=Math.max(a.width+o*2,e.width??0,90),u=a.height+o*2,h=Math.max(Math.min(u*.16,14),8),d=Math.max(u+h,e.height??0),f=d-h,p=Math.max(l*.38,28),g=-d/2,m=[{x:-l/2,y:g},{x:-l/2+p,y:g},{x:-l/2+p,y:g+h},{x:l/2,y:g+h},{x:l/2,y:d/2},{x:-l/2,y:d/2}],y=[`M${m[0].x},${m[0].y}`,...m.slice(1).map(C=>`L${C.x},${C.y}`),"Z"].join(" "),{cssStyles:v}=e;let T;if(e.look==="handDrawn"){const w=St.svg(i).path(y,kt(e,{}));T=i.insert(()=>w,":first-child").attr("class","basic label-container"),v&&T.attr("style",v)}else T=i.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",n);e.look==="handDrawn"?_t(e,T):_t(e,T,{width:l,height:d});const b=g+h+f/2;return s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`),e.intersect=function(C){return Ct.polygon(e,m,C)},i}x(lK,"folder");function cK(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Et(e);e.label="";const s=t.insert("g").attr("class",Ot(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=St.svg(s),p=kt(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),_t(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Ct.rect(e,v)},s}x(cK,"forkJoin");async function uK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),_t(e,b),e.intersect=function(C){return he.info("Pill intersect",e,{radius:f,point:C}),Ct.polygon(e,y,C)},l}x(uK,"halfRoundedRectangle");var E_e=x((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function hK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await Nt(t,e,Ot(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=St.svg(h),b=kt(e,{}),C=E_e(0,0,g,f,p),w=T.path(C,b);y=h.insert(()=>w,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=Xo(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,_t(e,y),e.intersect=function(T){return Ct.polygon(e,m,T)},h}x(hK,"hexagon");async function dK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Nt(t,e,Ot(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=St.svg(i),u=kt(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Sr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),_t(e,p),e.intersect=function(g){return he.info("Pill intersect",e,{points:h}),Ct.polygon(e,h,g)},i}x(dK,"hourglass");async function fK(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Et(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Nt(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=rv(e),v=-g/2,T=-p/2,b=e.label?8:0,C=St.svg(u),w=kt(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=C.rectangle(v,T,g,p,w),E=Math.max(g,h.width),_=p+h.height+b,R=C.rectangle(-E/2,-_/2,E,_,{...w,fill:"transparent",stroke:"none"}),D=u.insert(()=>S,":first-child"),L=u.insert(()=>R);if(e.icon){const B=u.append("g");B.html(`${await $l(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=B.node().getBBox(),A=$.width,I=$.height,O=$.x,N=$.y;B.attr("transform",`translate(${-A/2-O},${f?h.height/2+b/2-I/2-N:-h.height/2-b/2-I/2-N})`),B.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-_/2:_/2-h.height})`),D.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),_t(e,L),e.intersect=function(B){if(he.info("iconSquare intersect",e,B),!e.label)return Ct.rect(e,B);const $=e.x??0,A=e.y??0,I=e.height??0;let O=[];return f?O=[{x:$-h.width/2,y:A-I/2},{x:$+h.width/2,y:A-I/2},{x:$+h.width/2,y:A-I/2+h.height+b},{x:$+g/2,y:A-I/2+h.height+b},{x:$+g/2,y:A+I/2},{x:$-g/2,y:A+I/2},{x:$-g/2,y:A-I/2+h.height+b},{x:$-h.width/2,y:A-I/2+h.height+b}]:O=[{x:$-g/2,y:A-I/2},{x:$+g/2,y:A-I/2},{x:$+g/2,y:A-I/2+p},{x:$+h.width/2,y:A-I/2+p},{x:$+h.width/2/2,y:A+I/2},{x:$-h.width/2,y:A+I/2},{x:$-h.width/2,y:A-I/2+p},{x:$-g/2,y:A-I/2+p}],Ct.polygon(e,O,B)},u}x(fK,"icon");async function pK(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Et(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Nt(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=rv(e),T=St.svg(u),b=kt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const C=v.get("fill");b.stroke=C??y;const w=u.append("g");e.icon&&w.html(`${await $l(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=w.node().getBBox(),E=S.width,_=S.height,R=S.x,D=S.y,L=Math.max(E,_)*Math.SQRT2+f*2,B=T.circle(0,0,L,b),$=Math.max(L,h.width),A=L+h.height+p,I=T.rectangle(-$/2,-A/2,$,A,{...b,fill:"transparent",stroke:"none"}),O=u.insert(()=>B,":first-child"),N=u.insert(()=>I);return w.attr("transform",`translate(${-E/2-R},${g?h.height/2+p/2-_/2-D:-h.height/2-p/2-_/2-D})`),w.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-A/2:A/2-h.height})`),O.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),_t(e,N),e.intersect=function(M){return he.info("iconSquare intersect",e,M),Ct.rect(e,M)},u}x(pK,"iconCircle");async function gK(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Et(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Nt(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=rv(e),b=-m/2,C=-g/2,w=e.label?8:0,S=St.svg(u),E=kt(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const _=T.get("fill");E.stroke=_??v;const R=S.path(Ss(b,C,m,g,5),E),D=Math.max(m,h.width),L=g+h.height+w,B=S.rectangle(-D/2,-L/2,D,L,{...E,fill:"transparent",stroke:"none"}),$=u.insert(()=>R,":first-child").attr("class","icon-shape2"),A=u.insert(()=>B);if(e.icon){const I=u.append("g");I.html(`${await $l(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const O=I.node().getBBox(),N=O.width,M=O.height,P=O.x,F=O.y;I.attr("transform",`translate(${-N/2-P},${p?h.height/2+w/2-M/2-F:-h.height/2-w/2-M/2-F})`),I.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),$.attr("transform",`translate(0,${p?h.height/2+w/2:-h.height/2-w/2})`),_t(e,A),e.intersect=function(I){if(he.info("iconSquare intersect",e,I),!e.label)return Ct.rect(e,I);const O=e.x??0,N=e.y??0,M=e.height??0;let P=[];return p?P=[{x:O-h.width/2,y:N-M/2},{x:O+h.width/2,y:N-M/2},{x:O+h.width/2,y:N-M/2+h.height+w},{x:O+m/2,y:N-M/2+h.height+w},{x:O+m/2,y:N+M/2},{x:O-m/2,y:N+M/2},{x:O-m/2,y:N-M/2+h.height+w},{x:O-h.width/2,y:N-M/2+h.height+w}]:P=[{x:O-m/2,y:N-M/2},{x:O+m/2,y:N-M/2},{x:O+m/2,y:N-M/2+g},{x:O+h.width/2,y:N-M/2+g},{x:O+h.width/2/2,y:N+M/2},{x:O-h.width/2,y:N+M/2},{x:O-h.width/2,y:N-M/2+g},{x:O-m/2,y:N-M/2+g}],Ct.polygon(e,P,I)},u}x(gK,"iconRounded");async function mK(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Et(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Nt(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=rv(e),b=-m/2,C=-g/2,w=e.label?8:0,S=St.svg(u),E=kt(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const _=T.get("fill");E.stroke=_??v;const R=S.path(Ss(b,C,m,g,.1),E),D=Math.max(m,h.width),L=g+h.height+w,B=S.rectangle(-D/2,-L/2,D,L,{...E,fill:"transparent",stroke:"none"}),$=u.insert(()=>R,":first-child"),A=u.insert(()=>B);if(e.icon){const I=u.append("g");I.html(`${await $l(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const O=I.node().getBBox(),N=O.width,M=O.height,P=O.x,F=O.y;I.attr("transform",`translate(${-N/2-P},${p?h.height/2+w/2-M/2-F:-h.height/2-w/2-M/2-F})`),I.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),$.attr("transform",`translate(0,${p?h.height/2+w/2:-h.height/2-w/2})`),_t(e,A),e.intersect=function(I){if(he.info("iconSquare intersect",e,I),!e.label)return Ct.rect(e,I);const O=e.x??0,N=e.y??0,M=e.height??0;let P=[];return p?P=[{x:O-h.width/2,y:N-M/2},{x:O+h.width/2,y:N-M/2},{x:O+h.width/2,y:N-M/2+h.height+w},{x:O+m/2,y:N-M/2+h.height+w},{x:O+m/2,y:N+M/2},{x:O-m/2,y:N+M/2},{x:O-m/2,y:N-M/2+h.height+w},{x:O-h.width/2,y:N-M/2+h.height+w}]:P=[{x:O-m/2,y:N-M/2},{x:O+m/2,y:N-M/2},{x:O+m/2,y:N-M/2+g},{x:O+h.width/2,y:N-M/2+g},{x:O+h.width/2/2,y:N+M/2},{x:O-h.width/2,y:N+M/2},{x:O-h.width/2,y:N-M/2+g},{x:O-m/2,y:N-M/2+g}],Ct.polygon(e,P,I)},u}x(mK,"iconSquare");async function yK(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Et(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await Nt(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,T=St.svg(d),b=kt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const C=T.rectangle(m,y,u,h,b),w=Math.max(u,f.width),S=h+f.height+v,E=T.rectangle(-w/2,-S/2,w,S,{...b,fill:"none",stroke:"none"}),_=d.insert(()=>C,":first-child"),R=d.insert(()=>E);if(e.img){const D=d.append("image");D.attr("href",e.img),D.attr("width",u),D.attr("height",h),D.attr("preserveAspectRatio","none"),D.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),_.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),_t(e,R),e.intersect=function(D){if(he.info("iconSquare intersect",e,D),!e.label)return Ct.rect(e,D);const L=e.x??0,B=e.y??0,$=e.height??0;let A=[];return g?A=[{x:L-f.width/2,y:B-$/2},{x:L+f.width/2,y:B-$/2},{x:L+f.width/2,y:B-$/2+f.height+v},{x:L+u/2,y:B-$/2+f.height+v},{x:L+u/2,y:B+$/2},{x:L-u/2,y:B+$/2},{x:L-u/2,y:B-$/2+f.height+v},{x:L-f.width/2,y:B-$/2+f.height+v}]:A=[{x:L-u/2,y:B-$/2},{x:L+u/2,y:B-$/2},{x:L+u/2,y:B-$/2+h},{x:L+f.width/2,y:B-$/2+h},{x:L+f.width/2/2,y:B+$/2},{x:L-f.width/2,y:B+$/2},{x:L-f.width/2,y:B-$/2+h},{x:L-u/2,y:B-$/2+h}],Ct.polygon(e,A,D)},d}x(yK,"imageSquare");async function vK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=Math.max(l.height+a*2,e.height??0),h=Math.max(l.width+s*2,(e.width??0)-u),d=[{x:0,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:-3*u/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=St.svg(o),m=kt(e,{}),y=Sr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=Xo(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,_t(e,f),e.intersect=function(g){return Ct.polygon(e,d,g)},o}x(vK,"inv_trapezoid");async function xK(t,e){const{shapeSvg:r,bbox:n,label:i}=await Nt(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),_t(e,a),e.intersect=function(l){return Ct.rect(e,l)},r}x(xK,"labelRect");async function bK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=Math.max(l.height+a,e.height??0),h=Math.max(l.width+s,(e.width??0)-u),d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=St.svg(o),m=kt(e,{}),y=Sr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=Xo(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,_t(e,f),e.intersect=function(g){return Ct.polygon(e,d,g)},o}x(bK,"lean_left");async function TK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=Math.max(l.height+a,e.height??0),h=Math.max(l.width+s,(e.width??0)-u),d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=St.svg(o),m=kt(e,{}),y=Sr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=Xo(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,_t(e,f),e.intersect=function(g){return Ct.polygon(e,d,g)},o}x(TK,"lean_right");function CK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",Ot(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=St.svg(i),d=kt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Sr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),_t(e,g),e.intersect=function(m){return he.info("lightningBolt intersect",e,m),Ct.polygon(e,u,m)},i}x(CK,"lightningBolt");var S_e=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),k_e=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),__e=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),S7=10,k7=10;async function wK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>w,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=S_e(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Wn(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),_t(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const T=Ct.rect(e,v),b=T.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(T.y-(e.y??0))>(e.height??0)/2-f)){let C=f*f*(1-b*b/(d*d));C>0&&(C=Math.sqrt(C)),C=f-C,v.y-(e.y??0)>0&&(C=-C),T.y+=C}return T},o}x(wK,"linedCylinder");async function EK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const C=e.width;e.width=(C??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await Nt(t,e,Ot(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=St.svg(o),y=kt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Hc(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],T=m.polygon(v.map(C=>[C.x,C.y]),y),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),_t(e,b),e.intersect=function(C){return Ct.polygon(e,v,C)},o}x(EK,"linedWaveEdgedRect");async function SK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await Nt(t,e,Ot(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,T=St.svg(l),b=kt(e,{}),C=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],w=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Sr(C);let E=T.path(S,b);const _=Sr(w);let R=T.path(_,b);e.look!=="handDrawn"&&(E=w3(E),R=w3(R));const D=l.insert("g",":first-child");return D.insert(()=>E),D.insert(()=>R),D.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),_t(e,D),e.intersect=function(L){return Ct.polygon(e,C,L)},l}x(SK,"multiRect");async function kK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Nt(t,e,Ot(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:T}=e,b=Hc(m-v,y+g+v,m+d-v,y+g+v,p,.8),C=b==null?void 0:b[b.length-1],w=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:C.y-v},{x:m+d,y:C.y-v},{x:m+d,y:C.y-2*v},{x:m+d+v,y:C.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:C.y-v},{x:m+d,y:C.y-v},{x:m+d,y},{x:m,y}],E=St.svg(i),_=kt(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const R=Sr(w),D=E.path(R,_),L=Sr(S),B=E.path(L,_),$=i.insert(()=>D,":first-child");return $.insert(()=>B),$.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",n),$.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),_t(e,$),e.intersect=function(A){return Ct.polygon(e,w,A)},i}x(kK,"multiWaveEdgedRectangle");async function _K(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Et(e);e.labelStyle=n,e.useHtmlLabels||qi(It())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await Nt(t,e,Ot(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=St.svg(s),m=kt(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),_t(e,v),e.intersect=function(T){return Ct.rect(e,T)},s}x(_K,"note");var A_e=x((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function AK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Nt(t,e,Ot(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=St.svg(i),g=kt(e,{}),m=A_e(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=Xo(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),_t(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Ct.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}x(AK,"question");async function RK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await Nt(t,e,Ot(e)),h=l.width+(e.look==="neo"?a*2:a),d=Math.max(l.height+(e.look==="neo"?s*2:s),e.height??0),f=d/4,g=-Math.max(h,(e.width??0)-f)/2,m=-d/2,y=m/2,v=[{x:g+y,y:m},{x:g,y:0},{x:g+y,y:-m},{x:-g,y:-m},{x:-g,y:m}],{cssStyles:T}=e,b=St.svg(o),C=kt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=Sr(v),S=b.path(w,C),E=o.insert(()=>S,":first-child");return E.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${-y/2},0)`),u.attr("transform",`translate(${-y/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),_t(e,E),e.intersect=function(_){return Ct.polygon(e,v,_)},o}x(RK,"rect_left_inv_arrow");async function LK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Rc(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(qi(Pe())){const _=h.children[0],R=ft(h);d=_.getBoundingClientRect(),R.attr("width",d.width),R.attr("height",d.height)}he.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Rc(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],y=ft(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;ft(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),ft(h).attr("transform","translate( "+(d.width(he.debug("Rough node insert CXC",D),L),":first-child"),S=a.insert(()=>(he.debug("Rough node insert CXC",D),D),":first-child")}else S=s.insert("rect",":first-child"),E=s.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),E.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return _t(e,S),e.intersect=function(_){return Ct.rect(e,_)},a}x(LK,"rectWithTitle");async function IK(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return iv(t,e,i)}x(IK,"roundedRect");var _u=8;async function DK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await Nt(t,e,Ot(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?_u:_u*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-_u,f=h,p=_u-u/2,g=-h/2,{cssStyles:m}=e,y=St.svg(s),v=kt(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-_u,y:g+f},{x:p-_u,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(T.map(w=>[w.x,w.y]),v),C=s.insert(()=>b,":first-child");return C.attr("class","basic label-container outer-path").attr("style",Wn(m)),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${_u/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),_t(e,C),e.intersect=function(w){return Ct.rect(e,w)},s}x(DK,"shadedProcess");async function MK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await Nt(t,e,Ot(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=St.svg(o),T=kt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],C=Sr(b),w=v.path(C,T),S=o.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),_t(e,S),e.intersect=function(E){return Ct.polygon(e,b,E)},o}x(MK,"slopedRect");async function NK(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return iv(t,e,a)}x(NK,"squareRect");async function OK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=St.svg(o),g=kt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},..._o(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},..._o(h/2-d,0,d,50,270,450)],y=Sr(m),v=p.path(y,g),T=o.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),_t(e,T),e.intersect=function(b){return Ct.polygon(e,m,b)},o}x(OK,"stadium");async function $K(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return iv(t,e,r)}x($K,"state");function PK(t,e,{config:{themeVariables:r}}){var T,b;const{labelStyles:n,nodeStyles:i}=Et(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=St.svg(h),f=kt(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const C=((b=(T=t.node())==null?void 0:T.ownerSVGElement)==null?void 0:b.id)??"",w=C?`${C}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${w})`)}return _t(e,v),e.intersect=function(C){return Ct.circle(e,(e.width??0)/2,C)},h}x(PK,"stateEnd");function BK(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=St.svg(a).circle(0,0,e.width,XEe(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return _t(e,s),e.intersect=function(u){return Ct.circle(e,(e.width??7)/2,u)},a}x(BK,"stateStart");var jd=8;async function FK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=Math.max(l.width+2*jd+a,e.width??0),h=Math.max(l.height+s,e.height??0),d=u-2*jd,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=St.svg(o),v=kt(e,{}),T=y.rectangle(p,g,d+16,f,v),b=y.line(p+jd,g,p+jd,g+f,v),C=y.line(p+jd+d,g,p+jd+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>C,":first-child");const w=o.insert(()=>T,":first-child"),{cssStyles:S}=e;w.attr("class","basic label-container").attr("style",Wn(S)),_t(e,w)}else{const y=Xo(o,d,f,m);n&&y.attr("style",n),_t(e,y)}return e.intersect=function(y){return Ct.polygon(e,m,y)},o}x(FK,"subroutine");var OA=.2;async function zK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-OA*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=OA*u,d=OA*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,T=St.svg(o),b=kt(e,{}),C=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],w=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Sr(C),E=T.path(S,b),_=Sr(w),R=T.path(_,{...b,fillStyle:"solid"}),D=o.insert(()=>R,":first-child");return D.insert(()=>E,":first-child"),D.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",n),_t(e,D),e.intersect=function(L){return Ct.polygon(e,C,L)},o}x(zK,"taggedRect");async function GK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Nt(t,e,Ot(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=St.svg(i),m=kt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Hc(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,T=-f/2-d*.4,b=[{x:v+o-h,y:(T+l)*1.3},{x:v+o,y:T+l-d},{x:v+o,y:(T+l)*.9},...Hc(v+o,(T+l)*1.25,v+o-h,(T+l)*1.3,-l*.02,.5)],C=Sr(y),w=g.path(C,m),S=Sr(b),E=g.path(S,{...m,fillStyle:"solid"}),_=i.insert(()=>E,":first-child");return _.insert(()=>w,":first-child"),_.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),_t(e,_),e.intersect=function(R){return Ct.polygon(e,y,R)},i}x(GK,"taggedWaveEdgedRectangle");async function VK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Nt(t,e,Ot(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),_t(e,h),e.intersect=function(d){return Ct.rect(e,d)},i}x(VK,"text");var R_e=x((t,e,r,n,i,a)=>`M${t},${e} a${i},${a} 0,0,1 0,${-n} l${r},0 a${i},${a} 0,0,1 0,${n} M${r},${-n} a${i},${a} 0,0,0 0,${n} l${-r},0`,"createCylinderPathD"),L_e=x((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),I_e=x((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),_7=5,A7=10;async function WK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2,s=e.height??0;if(e.height&&(e.height=e.height-a,e.height<_7&&(e.height=_7)),e.width){const v=s/2/(2.5+s/50);e.width=e.width-a-v*3,e.widthC,":first-child"),m=o.insert(()=>b,":first-child"),m.attr("class","basic label-container"),g&&m.attr("style",g)}else{const y=R_e(0,0,p,h,f,d);m=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",Wn(g)).attr("style",n),m.attr("class","basic label-container outer-path"),g&&m.selectAll("path").attr("style",g),n&&m.selectAll("path").attr("style",n)}return m.attr("label-offset-x",f),m.attr("transform",`translate(${-p/2}, ${h/2} )`),u.attr("transform",`translate(${-(l.width/2)-f-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),_t(e,m),e.intersect=function(y){const v=Ct.rect(e,y),T=v.y-(e.y??0);if(d!=0&&(Math.abs(T)<(e.height??0)/2||Math.abs(T)==(e.height??0)/2&&Math.abs(v.x-(e.x??0))>(e.width??0)/2-f)){let b=f*f*(1-T*T/(d*d));b!=0&&(b=Math.sqrt(Math.abs(b))),b=f-b,y.x-(e.x??0)>0&&(b=-b),v.x+=b}return v},o}x(WK,"tiltedCylinder");async function qK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=Math.max(l.height+a,e.height??0),h=Math.max(l.width+s,(e.width??0)-u),d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=St.svg(o),m=kt(e,{}),y=Sr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=Xo(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,_t(e,f),e.intersect=function(g){return Ct.polygon(e,d,g)},o}x(qK,"trapezoid");async function UK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),_t(e,b),e.intersect=function(C){return Ct.polygon(e,y,C)},u}x(UK,"trapezoidalPentagon");var R7=10,L7=10;async function HK(t,e){var C;const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthT,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,_t(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(w){return he.info("Triangle intersect",e,p,w),Ct.polygon(e,p,w)},s}x(HK,"triangle");async function YK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await Nt(t,e,Ot(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,T=v>0?v/2:0,b=St.svg(l),C=kt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=[{x:-d/2-T,y:g/2},...Hc(-d/2-T,g/2,d/2+T,g/2,p,.8),{x:d/2+T,y:-g/2},{x:-d/2-T,y:-g/2}],S=Sr(w),E=b.path(S,C),_=l.insert(()=>E,":first-child");return _.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),_t(e,_),e.intersect=function(R){return Ct.polygon(e,w,R)},l}x(YK,"waveEdgedRectangle");async function XK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const C=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-C*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await Nt(t,e,Ot(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=St.svg(o),m=kt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Hc(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Hc(u/2,-f/2,-u/2,-f/2,d,-1)],v=Sr(y),T=g.path(v,m),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),_t(e,b),e.intersect=function(C){return Ct.polygon(e,y,C)},o}x(XK,"waveRectangle");var En=10;async function jK(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-En,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-En,10));const{shapeSvg:s,bbox:o,label:l}=await Nt(t,e,Ot(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+En,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+En,d=u-En,f=h-En,p=-d/2,g=-f/2,{cssStyles:m}=e,y=St.svg(s),v=kt(e,{}),T=[{x:p-En,y:g-En},{x:p-En,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-En}],b=`M${p-En},${g-En} L${p+d},${g-En} L${p+d},${g+f} L${p-En},${g+f} L${p-En},${g-En} M${p-En},${g} L${p+d},${g} M${p},${g-En} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const C=y.path(b,v),w=s.insert(()=>C,":first-child");return w.attr("transform",`translate(${En/2}, ${En/2})`),w.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+En/2-(o.x-(o.left??0))}, ${-(o.height/2)+En/2-(o.y-(o.top??0))})`),_t(e,w),e.intersect=function(S){return Ct.polygon(e,T,S)},s}x(jK,"windowPane");var I7=new Set(["redux-color","redux-dark-color"]),D_e=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function WN(t,e){var re,Q,oe,ee;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=It(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:ne}=It(),{background:ie}=ne,ae={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ie}`]};await WN(t,ae)}const u=It();e.useHtmlLabels=u.htmlLabels;let h=((re=u.er)==null?void 0:re.diagramPadding)??10,d=((Q=u.er)==null?void 0:Q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Et(e);if(r.attributes.length===0&&e.label){const ne={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};$a(e.label,u)+ne.labelPaddingX*20){const ne=v.width+h*2-(w+S+E+_);w+=ne/L,S+=ne/L,E>0&&(E+=ne/L),_>0&&(_+=ne/L)}const $=w+S+E+_,A=St.svg(y),I=kt(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let O=0;C.length>0&&(O=C.reduce((ne,ie)=>ne+((ie==null?void 0:ie.rowHeight)??0),0));const N=Math.max(B.width+h*2,(e==null?void 0:e.width)||0,$),M=Math.max((O??0)+v.height,(e==null?void 0:e.height)||0),P=-N/2,F=-M/2;if(y.selectAll("g:not(:first-child)").each((ne,ie,ae)=>{const de=ft(ae[ie]),le=de.attr("transform");let ye=0,$e=0;if(le){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(le);ce&&(ye=parseFloat(ce[1]),$e=parseFloat(ce[2]),de.attr("class").includes("attribute-name")?ye+=w:de.attr("class").includes("attribute-keys")?ye+=w+S:de.attr("class").includes("attribute-comment")&&(ye+=w+S+E))}de.attr("transform",`translate(${P+h/2+ye}, ${$e+F+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(F+d/2)+")"),n!=null&&I7.has(n)){const ne=r.colorIndex??0;y.attr("data-color-id",`color-${ne%l.length}`)}const V=A.rectangle(P,F,N,M,I),z=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[ne,ie]of C.entries()){const de=(ne+1)%2===0&&ie.yOffset!==0,le=A.rectangle(P,v.height+F+(ie==null?void 0:ie.yOffset),N,ie==null?void 0:ie.rowHeight,{...I,fill:de?a:s,stroke:o});y.insert(()=>le,"g.label").attr("style",f.join("")).attr("class",`row-rect-${de?"even":"odd"}`)}const W=1e-4;let X=vf(P,v.height+F,N+P,v.height+F,W),j=A.polygon(X.map(ne=>[ne.x,ne.y]),I);if(y.insert(()=>j).attr("class","divider"),X=vf(w+P,v.height+F,w+P,M+F,W),j=A.polygon(X.map(ne=>[ne.x,ne.y]),I),y.insert(()=>j).attr("class","divider"),R){const ne=w+S+P;X=vf(ne,v.height+F,ne,M+F,W),j=A.polygon(X.map(ie=>[ie.x,ie.y]),I),y.insert(()=>j).attr("class","divider")}if(D){const ne=w+S+E+P;X=vf(ne,v.height+F,ne,M+F,W),j=A.polygon(X.map(ie=>[ie.x,ie.y]),I),y.insert(()=>j).attr("class","divider")}for(const ne of b){const ie=v.height+F+ne;X=vf(P,ie,N+P,ie,W),j=A.polygon(X.map(ae=>[ae.x,ae.y]),I),y.insert(()=>j).attr("class","divider")}if(_t(e,z),g&&e.look!=="handDrawn")if(n!=null&&D_e.has(n))y.selectAll("path").attr("style",g);else{const ne=g.split(";"),ie=(ee=ne==null?void 0:ne.filter(ae=>ae.includes("stroke")))==null?void 0:ee.map(ae=>`${ae}`).join("; ");y.selectAll("path").attr("style",ie??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(ne){return Ct.rect(e,ne)},y}x(WN,"erBox");async function yf(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==vc(e)&&(e=vc(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Va(o,e,{width:$a(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Ho(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=ft(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}x(yf,"addText");function vf(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}x(vf,"lineToPolygon");async function KK(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",Ot(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const T=e.annotations[0];await x1(o,{text:`«${T}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await x1(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const T of e.members){const b=await x1(u,T,m,[T.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const T of e.methods){const b=await x1(h,T,y,[T.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const T=o.node().getBBox();o.attr("transform",`translate(${-T.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}x(KK,"textHelper");async function x1(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=It();let s="useHtmlLabels"in e?e.useHtmlLabels:Ho(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),On(o)&&(s=!0);const l=await Va(i,ZM(qc(o)),{width:$a(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=ft(l);h=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1),await FN(d),u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&ft(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}x(x1,"addText");async function ZK(t,e){var A,I;const r=Pe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??Ho(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await KK(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Et(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((A=l.styles)==null?void 0:A.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=St.svg(u),y=kt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let T=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?T+=s:l.members.length>0&&l.methods.length===0&&(T+=s*2);const C=-v/2,w=-T/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(S=a*2);const E=m.rectangle(C-a,w-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,T+2*a+S,y),_=u.insert(()=>E,":first-child");_.attr("class","basic label-container outer-path");const R=_.node().getBBox(),D=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,L=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,B=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,$=(D+L+w+a-(w-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((O,N,M)=>{var X,j;const P=ft(M[N]),F=P.attr("transform");let V=0;if(F){const Q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(F);Q&&(V=parseFloat(Q[2]))}let z=V+w+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(P.attr("class").includes("methods-group")){const re=Math.max(B,s/2);b?z=Math.max($,D+L+re+w+s*2+a)+s*2:z=D+L+re+w+s*4+a}l.members.length===0&&l.methods.length===0&&((X=r.class)!=null&&X.hideEmptyMembersBox)&&(l.annotations.length>0?z=V-s:z=V),o||(z-=4);let W=C;(P.attr("class").includes("label-group")||P.attr("class").includes("annotation-group"))&&(W=-((j=P.node())==null?void 0:j.getBBox().width)/2||0,u.selectAll("text").each(function(re,Q,oe){window.getComputedStyle(oe[Q]).textAnchor==="middle"&&(W=0)})),P.attr("transform",`translate(${W}, ${z})`)}),l.members.length>0||l.methods.length>0||g){const O=D+L+w+a,N=m.line(R.x,O,R.x+R.width,O+.001,y);u.insert(()=>N).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const O=D+L+B+w+s*2+a,N=m.line(R.x,b?Math.max($,O):O,R.x+R.width,(b?Math.max($,O):O)+.001,y);u.insert(()=>N).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),_.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const O=RegExp(/color\s*:\s*([^;]*)/),N=O.exec(p);if(N){const M=N[0].replace("color","fill");u.selectAll("tspan").attr("style",M)}else if(d){const M=O.exec(d);if(M){const P=M[0].replace("color","fill");u.selectAll("tspan").attr("style",P)}}}return _t(e,_),e.intersect=function(O){return Ct.rect(e,O)},u}x(ZK,"classBox");async function QK(t,e){var L,B;const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=Ot(e),h=Pe(),{themeVariables:d}=h,{borderColorArray:f,requirementEdgeLabelBackground:p}=d,g=h.layout==="elk"?"start":"center",m=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let y;l?y=await mo(m,`<<${i.type}>>`,0,e.labelStyle):y=await mo(m,"<<Element>>",0,e.labelStyle);let v=y;const T=await mo(m,i.name,v,e.labelStyle+"; font-weight: bold;");if(v+=T+o,l){const $=await mo(m,`${i.requirementId?`ID: ${i.requirementId}`:""}`,v,e.labelStyle,g);v+=$;const A=await mo(m,`${i.text?`Text: ${i.text}`:""}`,v,e.labelStyle,g);v+=A;const I=await mo(m,`${i.risk?`Risk: ${i.risk}`:""}`,v,e.labelStyle,g);v+=I,await mo(m,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,v,e.labelStyle,g)}else{const $=await mo(m,`${a.type?`Type: ${a.type}`:""}`,v,e.labelStyle,g);v+=$,await mo(m,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,v,e.labelStyle,g)}const b=(((L=m.node())==null?void 0:L.getBBox().width)??200)+s,C=(((B=m.node())==null?void 0:B.getBBox().height)??200)+s,w=-b/2,S=-C/2,E=St.svg(m),_=kt(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const R=E.rectangle(w,S,b,C,_),D=m.insert(()=>R,":first-child");if(D.attr("class","basic label-container outer-path").attr("style",n),f!=null&&f.length){const $=e.colorIndex??0;m.attr("data-color-id",`color-${$%f.length}`)}if(m.selectAll(".label").each(($,A,I)=>{const O=ft(I[A]),N=O.attr("transform");let M=0,P=0;if(N){const W=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(N);W&&(M=parseFloat(W[1]),P=parseFloat(W[2]))}const F=P-C/2;let V=w+s/2;(A===0||A===1)&&(V=M),O.attr("transform",`translate(${V}, ${F+s})`)}),v>y+T+o){const $=S+y+T+o;let A;if(e.look==="neo"){const N=[[w,$],[w+b,$],[w+b,$+.001],[w,$+.001]];A=E.polygon(N,_)}else A=E.line(w,$,w+b,$,_);m.insert(()=>A).attr("class","divider")}return _t(e,D),e.intersect=function($){return Ct.rect(e,$)},n&&e.look!=="handDrawn"&&(p||f!=null&&f.length)&&m.selectAll("path").attr("style",n),m}x(QK,"requirementBox");async function mo(t,e,r,n="",i="center"){if(e==="")return 0;const a=t.insert("g").attr("class","label").attr("style",n),s=Pe(),o=s.htmlLabels??!0,l=await Va(a,ZM(qc(e)),{width:$a(e,s)+50,classes:"markdown-node-label",useHtmlLabels:o,style:n},s);let u;if(o){const h=l.children[0],d=ft(l);i==="start"&&ft(h).style("text-align","left"),u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}else{const h=l.children[0];for(const d of h.children)n&&d.setAttribute("style",n);if(i==="start"){h.setAttribute("text-anchor","start");for(const d of h.children)d.setAttribute("text-anchor","start")}u=l.getBBox(),u.height+=6}return a.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}x(mo,"addText");var M_e=x(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function JK(t,e,{config:r}){var B,$;const{labelStyles:n,nodeStyles:i}=Et(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Nt(t,e,Ot(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((B=r==null?void 0:r.kanban)!=null&&B.ticketBaseUrl)&&(d=($=r==null?void 0:r.kanban)==null?void 0:$.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await MA(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await MA(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await MA(o,"assigned"in e&&e.assigned||"",p);e.width=s;const T=10,b=(e==null?void 0:e.width)||0,C=Math.max(m.height,v.height)/2,w=Math.max(l.height+T*2,(e==null?void 0:e.height)||0)+C,S=-b/2,E=-w/2;u.attr("transform","translate("+(h-b/2)+", "+(-C-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-C+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-C+l.height/2)+")");let _;const{rx:R,ry:D}=e,{cssStyles:L}=e;if(e.look==="handDrawn"){const A=St.svg(o),I=kt(e,{}),O=R||D?A.path(Ss(S,E,b,w,R||0),I):A.rectangle(S,E,b,w,I);_=o.insert(()=>O,":first-child"),_.attr("class","basic label-container").attr("style",L||null)}else{_=o.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",i).attr("rx",R??5).attr("ry",D??5).attr("x",S).attr("y",E).attr("width",b).attr("height",w);const A="priority"in e&&e.priority;if(A){const I=o.append("line"),O=S+2,N=E+Math.floor((R??0)/2),M=E+w-Math.floor((R??0)/2);I.attr("x1",O).attr("y1",N).attr("x2",O).attr("y2",M).attr("stroke-width","4").attr("stroke",M_e(A))}}return _t(e,_),e.height=w,e.intersect=function(A){return Ct.rect(e,A)},o}x(JK,"kanbanItem");async function eZ(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Nt(t,e,Ot(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},${m*.1} a${h},${h} 1 0,0 ${g*.15},${m*.33} a${h*.8},${h*.8} 1 0,0 0,${m*.34} a${h},${h} 1 0,0 ${-1*g*.15},${m*.33} a${h},${h} 1 0,0 ${-1*g*.25},${m*.15} a${h},${h} 1 0,0 ${-1*g*.25},0 a${h},${h} 1 0,0 ${-1*g*.25},0 a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15} a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} H0 V0 Z`;if(e.look==="handDrawn"){const T=St.svg(i),b=kt(e,{}),C=T.path(v,b);y=i.insert(()=>C,":first-child"),y.attr("class","basic label-container").attr("style",Wn(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),_t(e,y),e.calcIntersect=function(T,b){return Ct.rect(T,b)},e.intersect=function(T){return he.info("Bang intersect",e,T),Ct.rect(e,T)},i}x(eZ,"bang");async function tZ(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Nt(t,e,Ot(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} a${d},${d} 1 0,1 ${l*.35},${l*.2} a${h},${h} 1 0,1 ${l*.15},${u*.35} a${p},${p} 1 0,1 ${-1*l*.15},${u*.65} a${d},${h} 1 0,1 ${-1*l*.25},${l*.15} a${f},${f} 1 0,1 ${-1*l*.5},0 a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15} a${h},${h} 1 0,1 ${-1*l*.1},${-1*u*.35} a${p},${p} 1 0,1 ${l*.1},${-1*u*.65} H0 V0 Z`;if(e.look==="handDrawn"){const v=St.svg(i),T=kt(e,{}),b=v.path(y,T);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Wn(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),_t(e,m),e.calcIntersect=function(v,T){return Ct.rect(v,T)},e.intersect=function(v){return he.info("Cloud intersect",e,v),Ct.rect(e,v)},i}x(tZ,"cloud");async function rZ(t,e){const{labelStyles:r,nodeStyles:n}=Et(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Nt(t,e,Ot(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} h${l-2*h} q${h},0 ${h},${h} v${u-h} H${-l/2} Z `:` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} h${l-2*h} q${h},0 ${h},${h} v${u-2*h} q0,${h} ${-h},${h} h${-(l-2*h)} q${-h},0 ${-h},${-h} Z `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),_t(e,f),e.calcIntersect=function(p,g){return Ct.rect(p,g)},e.intersect=function(p){return Ct.rect(e,p)},i}x(rZ,"defaultMindmapNode");async function nZ(t,e){const r={padding:e.padding??0};return VN(t,e,r)}x(nZ,"mindmapCircle");var N_e=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:NK},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:IK},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:OK},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:FK},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:rK},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:nK},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:lK},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:Gj},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Xj},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:qj},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:tK},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:VN},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:eZ},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:tZ},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:AK},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:hK},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:TK},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:bK},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:qK},{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:vK},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:aK},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:VK},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Uj},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:DK},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:BK},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:PK},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:cK},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:dK},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Zj},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Qj},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Jj},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:CK},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:YK},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:uK},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:WK},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:wK},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:eK},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:iK},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:HK},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:jK},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:sK},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:UK},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:oK},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:MK},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:kK},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:SK},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:zj},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Kj},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:GK},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:zK},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:XK},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:RK},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:EK}],O_e=x(()=>{const e=[...Object.entries({state:$K,choice:Hj,note:_K,composite:Yj,rectWithTitle:LK,labelRect:xK,block_arrow:Wj,collapsedGroup:Vj,iconSquare:mK,iconCircle:pK,icon:fK,iconRounded:gK,imageSquare:yK,anchor:Bj,kanbanItem:JK,mindmapCircle:nZ,defaultMindmapNode:rZ,classBox:ZK,erBox:WN,requirementBox:QK}),...N_e.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),qN=O_e();function iZ(t){return t in qN}x(iZ,"isValidShape");var $b=x(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins"),$S=new Map;async function av(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?qN[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Wn(e.look)),e.tooltip&&i.attr("title",e.tooltip),$S.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(av,"insertNode");var $_e=x((t,e)=>{$S.set(e.id,t)},"setNodeElem"),P_e=x(()=>{$S.clear()},"clear"),v0=x(t=>{const e=$S.get(t.id);he.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),B_e=x(async(t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=Et(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=Ho(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Va(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const $=y.children[0],A=ft(y);v=$.getBoundingClientRect(),A.attr("width",v.width),A.attr("height",v.height)}const T=e.padding??0,b=e.width<=v.width+T?v.width+T:e.width;e.width<=v.width+T?e.diff=(b-e.width)/2-T:e.diff=-T;const C=e.height,w=e.y-C/2,S=e.y+C/2,E=e.x-b/2,_=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:w+C/3,R=g?4:0,D=v.height+2*R;let L,B;if(g){const $=Math.max(D,v.height+2*R),A=E+$,I=Math.max(0,b-$);if(e.look==="handDrawn"){const M=St.svg(f),P=kt(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),F=kt(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=M.rectangle(E,w,$,C,P);L=f.insert(()=>V,":first-child");const z=M.rectangle(A,w,I,C,F);B=f.insert(()=>z,":first-child"),L.select("path:nth-child(2)").attr("style",h.join(";")),L.select("path").attr("style",d.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),B=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",E).attr("y",w).attr("width",$).attr("height",C).attr("fill",a).attr("stroke",o),B.attr("class","swimlane-body").attr("style",u).attr("x",A).attr("y",w).attr("width",I).attr("height",C).attr("fill","none").attr("stroke",o);const O=E+$/2,N=e.y;m.attr("transform",`translate(${O}, ${N}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const $=Math.max(0,_-w),A=Math.min(D,$),I=w+A,O=Math.max(0,S-I),N=e.x-b/2;if(e.look==="handDrawn"){const F=St.svg(f),V=kt(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=kt(e,{roughness:.7,fill:"none",stroke:o,seed:i}),W=F.rectangle(N,w,b,A,V);L=f.insert(()=>W,":first-child");const X=F.rectangle(N,I,b,O,z);B=f.insert(()=>X,":first-child"),L.select("path:nth-child(2)").attr("style",h.join(";")),L.select("path").attr("style",d.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),B=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",N).attr("y",w).attr("width",b).attr("height",A).attr("fill",a).attr("stroke",o),B.attr("class","swimlane-body").attr("style",u).attr("x",N).attr("y",I).attr("width",b).attr("height",O).attr("fill","none").attr("stroke",o);const M=e.x-v.width/2,P=w+(A-v.height)/2;m.attr("transform",`translate(${M}, ${P})`)}if(he.trace("Swimlane data ",e,JSON.stringify(e)),l){const $=m.select("span");$&&$.attr("style",l)}return e.offsetX=0,e.width=b,e.height=C,e.offsetY=v.height-T/2,e.intersect=function($){return fd(e,$)},{cluster:f,labelBBox:v}},"swimlane"),aZ=x(async(t,e)=>{he.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Et(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=qi(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Va(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Rc(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(qi(r)){const E=g.children[0],_=ft(g);m=E.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;he.trace("Data ",e,JSON.stringify(e));let C;if(e.look==="handDrawn"){const E=St.svg(d),_=kt(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),R=E.path(Ss(T,b,y,v,0),_);C=d.insert(()=>(he.debug("Rough node insert CXC",R),R),":first-child"),C.select("path:nth-child(2)").attr("style",u.join(";")),C.select("path").attr("style",h.join(";").replace("fill","stroke"))}else C=d.insert("rect",":first-child"),C.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:w}=$b(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+w})`),o){const E=p.select("span");E&&E.attr("style",o)}const S=C.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(E){return fd(e,E)},{cluster:d,labelBBox:m}},"rect"),F_e=x((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return fd(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),z_e=x(async(t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Rc(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(qi(r)){const R=p.children[0],D=ft(p);g=R.getBoundingClientRect(),D.attr("width",g.width),D.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height+m,b=e.height+m-g.height-6,C=e.x-v/2,w=e.y-T/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let E;if(e.look==="handDrawn"){const R=e.cssClasses.includes("statediagram-cluster-alt"),D=St.svg(u),L=e.rx||e.ry?D.path(Ss(C,w,v,T,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):D.rectangle(C,w,v,T,{seed:i});E=u.insert(()=>L,":first-child");const B=D.rectangle(C,S,v,b,{fill:R?a:s,fillStyle:R?"hachure":"solid",stroke:l,seed:i});E=u.insert(()=>L,":first-child"),f=u.insert(()=>B)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",C).attr("y",w).attr("width",v).attr("height",T).attr("data-look",e.look),f.attr("class","inner").attr("x",C).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${w+1-(qi(r)?0:3)})`);const _=E.node().getBBox();return e.height=_.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(R){return fd(e,R)},{cluster:u,labelBBox:g}},"roundedWithTitle"),G_e=x(async(t,e)=>{he.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Et(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=qi(r),p=d.insert("g").attr("class","cluster-label "),g=await Va(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(qi(r)){const E=g.children[0],_=ft(g);m=E.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;he.trace("Data ",e,JSON.stringify(e));let C;if(e.look==="handDrawn"){const E=St.svg(d),_=kt(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),R=E.path(Ss(T,b,y,v,e.rx),_);C=d.insert(()=>(he.debug("Rough node insert CXC",R),R),":first-child"),C.select("path:nth-child(2)").attr("style",u.join(";")),C.select("path").attr("style",h.join(";").replace("fill","stroke"))}else C=d.insert("rect",":first-child"),C.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:w}=$b(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+w})`),o){const E=p.select("span");E&&E.attr("style",o)}const S=C.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(E){return fd(e,E)},{cluster:d,labelBBox:m}},"kanbanSection"),V_e=x((t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=St.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return fd(e,m)},{cluster:s,labelBBox:{}}},"divider"),W_e=aZ,q_e={rect:aZ,squareRect:W_e,roundedWithTitle:z_e,noteGroup:F_e,divider:V_e,kanbanSection:G_e,swimlane:B_e},sZ=new Map,PS=x(async(t,e)=>{const r=e.shape||"rect",n=await q_e[r](t,e);return sZ.set(e.id,n),n},"insertCluster"),U_e=x(()=>{sZ=new Map},"clear"),qv=x((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),ai={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},D7={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function b1(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=yn(t),e=yn(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}x(b1,"calculateDeltaAndAngle");var yn=x(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),H_e=x(t=>({x:x(function(e,r,n){let i=0;const a=yn(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ai,t.arrowTypeEnd)){const{angle:p,deltaX:g}=b1(n[n.length-1],n[n.length-2]);i=ai[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(yn(e).x-yn(n[n.length-1]).x),o=Math.abs(yn(e).y-yn(n[n.length-1]).y),l=Math.abs(yn(e).x-yn(n[0]).x),u=Math.abs(yn(e).y-yn(n[0]).y),h=ai[t.arrowTypeStart],d=ai[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ai,t.arrowTypeEnd)){const{angle:p,deltaY:g}=b1(n[n.length-1],n[n.length-2]);i=ai[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(yn(e).y-yn(n[n.length-1]).y),o=Math.abs(yn(e).x-yn(n[n.length-1]).x),l=Math.abs(yn(e).y-yn(n[0]).y),u=Math.abs(yn(e).x-yn(n[0]).x),h=ai[t.arrowTypeStart],d=ai[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&M7(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&M7(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),X_e={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},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}},j_e=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],M7=x((t,e,r,n,i,a,s=!1,o)=>{var g;if(!r||r==="none")return;const l=X_e[r],u=l&&j_e.includes(l.type);if(!l){he.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const T=v.cloneNode(!0);T.id=y,T.querySelectorAll("path, circle, line").forEach(C=>{C.setAttribute("stroke",o),l.fill&&C.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(T)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),K_e=x(t=>{var e,r;return typeof t=="string"?t:(r=(e=Pe())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),x0=new Map,In=new Map,Z_e=x(()=>{x0.clear(),In.clear()},"clear"),oZ=x(t=>!!(t.label||t.startLabelLeft||t.startLabelRight||t.endLabelLeft||t.endLabelRight),"hasEdgeLabel"),Uv=x(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),b0=x(async(t,e)=>{const r=Pe();let n=qi(r);const{labelStyles:i}=Et(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Va(t,e.label,{style:Uv(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),he.info("abc82",e,e.labelType);let h,d;if(n){const p=u.children[0],g=ft(u);h=await Hh.measure(()=>p.getBoundingClientRect()),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=ft(u).select("text").node();await Hh.measure(()=>{h=u.getBBox(),p&&typeof p.getBBox=="function"?d=p.getBBox():d=h})}s.attr("transform",qv(d,n)),x0.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rc(g,e.startLabelLeft,Uv(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ft(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",qv(y,n)),In.get(e.id)||In.set(e.id,{}),In.get(e.id).startLeft=p,T1(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rc(g,e.startLabelRight,Uv(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ft(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",qv(y,n)),In.get(e.id)||In.set(e.id,{}),In.get(e.id).startRight=p,T1(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rc(p,e.endLabelLeft,Uv(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ft(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",qv(y,n)),In.get(e.id)||In.set(e.id,{}),In.get(e.id).endLeft=p,T1(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rc(p,e.endLabelRight,Uv(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ft(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",qv(y,n)),In.get(e.id)||In.set(e.id,{}),In.get(e.id).endRight=p,T1(f,e.endLabelRight)}return u},"insertEdgeLabel");function T1(t,e){qi(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(T1,"setTerminalWidth");var UN=x((t,e)=>{he.debug("Moving label abc88 ",t.id,t.label,x0.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=$b(n);if(t.label){const a=x0.get(t.id);let s=t.x,o=t.y;if(r){const l=sr.calcLabelPosition(r);he.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=In.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=sr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=In.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=sr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=In.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=sr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=In.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=sr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),Q_e=x((t,e)=>{var s;if(!(t!=null&&t.isLabelEdge)||!((s=t==null?void 0:t.id)!=null&&s.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?e:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),J_e=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),eAe=x((t,e,r)=>{he.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{he.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(he.info("abc88 checking point",a,e),!J_e(e,a)&&!i){const s=eAe(e,n,a);he.debug("abc88 inside",a,n,s),he.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?he.warn("abc88 no intersect",s,r):r.push(s),i=!0}else he.warn("abc88 outside",a,n),n=a,i||r.push(a)}),he.debug("returning points",r),r},"cutPathAtIntersect");function lZ(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}x(lZ,"extractCornerPoints");var O7=x(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),tAe=x(function(t){const{cornerPointPositions:e}=lZ(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){he.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else he.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),rAe=x((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Number.isFinite(o)?Math.max(0,o):0,u=Array(l).fill(`${i} ${a}`).join(" ");return`0 ${e} ${u} ${r}`},"generateDashArray"),BS=x(function(t,e,r,n,i,a,s,o=!1){var M;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Pe();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const P in e.cssCompiledStyles)pN(P)||g.push(e.cssCompiledStyles[P]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const P=h.slice(1,-1),F=P[0],V=P[P.length-1],z=.5,W=Math.abs(h[h.length-1].x-V.x)!Number.isNaN(P.y));const v=K_e(e.curve);v!=="rounded"&&(y=tAe(y));let T=X1;switch(v){case"linear":T=X1;break;case"basis":T=ww;break;case"cardinal":T=sX;break;case"bumpX":T=tX;break;case"bumpY":T=rX;break;case"catmullRom":T=lX;break;case"monotoneX":T=pX;break;case"monotoneY":T=gX;break;case"natural":T=yX;break;case"step":T=vX;break;case"stepAfter":T=bX;break;case"stepBefore":T=xX;break;case"rounded":T=X1;break;default:T=ww}const{x:b,y:C}=H_e(e),w=Tw().x(b).y(C).curve(T);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let E,_=v==="rounded"?cZ(uZ(y,e),5):w(y);const R=Array.isArray(e.style)?e.style:[e.style];let D=R.find(P=>P==null?void 0:P.startsWith("stroke:")),L="";e.animate&&(L="edge-animation-fast"),e.animation&&(L="edge-animation-"+e.animation);let B=!1;if(e.look==="handDrawn"){const P=St.svg(t);Object.assign([],y);const F=P.path(_,{roughness:.3,seed:l});S+=" transition",E=ft(F).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",R?R.reduce((z,W)=>z+";"+W,""):"");let V=E.attr("d");E.attr("d",V),t.node().appendChild(E.node())}else{const P=g.join(";"),F=R?R.reduce((re,Q)=>re+Q+";",""):"",V=(P?P+";"+F+";":F)+";"+(R?R.reduce((re,Q)=>re+";"+Q,""):"");E=t.append("path").attr("d",_).attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",V),D=(M=V.match(/stroke:([^;]+)/))==null?void 0:M[1],B=e.animate===!0||!!e.animation||P.includes("animation");const z=E.node(),W=typeof z.getTotalLength=="function"?z.getTotalLength():0,X=D7[e.arrowTypeStart]||0,j=D7[e.arrowTypeEnd]||0;if(e.look==="neo"&&!B){const Q=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?rAe(W,X,j):`0 ${X} ${W-X-j} ${j}`}; stroke-dashoffset: 0;`;E.attr("style",Q+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",e.id),E.attr("data-points",m),E.attr("data-look",Wn(e.look)),e.showPoints&&y.forEach(P=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",P.x).attr("cy",P.y)});let $="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&($=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,$=$.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),he.info("arrowTypeStart",e.arrowTypeStart),he.info("arrowTypeEnd",e.arrowTypeEnd);const A=!B&&(e==null?void 0:e.look)==="neo";Y_e(E,e,$,s,n,A,D);const I=Math.floor(h.length/2),O=h[I];sr.isLabelCoordinateInPath(O,E.attr("d"))||(d=!0);let N={};return d&&(N.updatedPath=h),N.originalPath=e.points,N},"insertEdge");function cZ(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&ai[e.arrowTypeStart]){const i=ai[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=k3(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&ai[e.arrowTypeEnd]){const i=ai[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=k3(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}x(uZ,"applyMarkerOffsetsToPoints");var nAe=x((t,e,r,n)=>{e.forEach(i=>{kAe[i](t,r,n)})},"insertMarkers"),iAe=x((t,e,r)=>{he.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),aAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),sAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),oAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),cAe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),uAe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),hAe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),dAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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"),fAe=x((t,e,r)=>{const n=It(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),pAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).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"),gAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),mAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).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"),yAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),vAe=x((t,e,r)=>{const n=It(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),xAe=x((t,e,r)=>{const n=It(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),bAe=x((t,e,r)=>{const n=It(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),TAe=x((t,e,r)=>{const n=It(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),CAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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"),wAe=x((t,e,r)=>{const n=It(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),EAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),SAe=x((t,e,r)=>{const n=It(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),kAe={extension:iAe,composition:aAe,aggregation:sAe,dependency:oAe,lollipop:lAe,point:cAe,circle:uAe,cross:hAe,barb:dAe,barbNeo:fAe,only_one:pAe,zero_or_one:gAe,one_or_more:mAe,zero_or_more:yAe,only_one_neo:vAe,zero_or_one_neo:xAe,one_or_more_neo:bAe,zero_or_more_neo:TAe,requirement_arrow:CAe,requirement_contains:EAe,requirement_arrow_neo:wAe,requirement_contains_neo:SAe},HN=nAe,hZ=typeof global=="object"&&global&&global.Object===Object&&global,_Ae=typeof self=="object"&&self&&self.Object===Object&&self,jo=hZ||_Ae||Function("return this")(),bs=jo.Symbol,dZ=Object.prototype,AAe=dZ.hasOwnProperty,RAe=dZ.toString,Hv=bs?bs.toStringTag:void 0;function LAe(t){var e=AAe.call(t,Hv),r=t[Hv];try{t[Hv]=void 0;var n=!0}catch{}var i=RAe.call(t);return n&&(e?t[Hv]=r:delete t[Hv]),i}var IAe=Object.prototype,DAe=IAe.toString;function MAe(t){return DAe.call(t)}var NAe="[object Null]",OAe="[object Undefined]",$7=bs?bs.toStringTag:void 0;function pd(t){return t==null?t===void 0?OAe:NAe:$7&&$7 in Object(t)?LAe(t):MAe(t)}function Bo(t){return t!=null&&typeof t=="object"}var $Ae="[object Symbol]";function Yh(t){return typeof t=="symbol"||Bo(t)&&pd(t)==$Ae}function lp(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=pRe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Wf(t){return function(){return t}}var $w=(function(){try{var t=yd(Object,"defineProperty");return t({},"",{}),t}catch{}})(),vRe=$w?function(t,e){return $w(t,"toString",{configurable:!0,enumerable:!1,value:Wf(e),writable:!0})}:gd,pZ=yRe(vRe);function gZ(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var wRe=9007199254740991,ERe=/^(?:0|[1-9]\d*)$/;function FS(t,e){var r=typeof t;return e=e??wRe,!!e&&(r=="number"||r!="symbol"&&ERe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=ARe}function au(t){return t!=null&&YN(t.length)&&!Ix(t)}function Dx(t,e,r){if(!rs(r))return!1;var n=typeof e;return(n=="number"?au(r)&&FS(e,r.length):n=="string"&&e in r)?sv(r[e],t):!1}function RRe(t){return VS(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&Dx(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function BLe(t,e){var r=this.__data__,n=YS(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Ql(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&$3e?new Ox:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&Dx(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var S5e=Math.max;function k5e(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:YAe(r);return i<0&&(i=S5e(n+i,0)),mZ(t,su(e),i)}var nO=E5e(k5e);function UZ(t,e){var r=-1,n=au(t)?Array(t.length):[];return ZS(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function ci(t,e){var r=Un(t)?lp:UZ;return r(t,su(e))}function _5e(t,e){return t==null?t:eO(t,rO(e),HS)}function A5e(t,e){return t&&tO(t,rO(e))}function R5e(t,e){return t>e}var L5e=Object.prototype,I5e=L5e.hasOwnProperty;function D5e(t,e){return t!=null&&I5e.call(t,e)}function HZ(t,e){return t!=null&&zZ(t,e,D5e)}function M5e(t,e){return lp(e,function(r){return t[r]})}function Il(t){return t==null?[]:M5e(t,Gs(t))}var N5e="[object Map]",O5e="[object Set]",$5e=Object.prototype,P5e=$5e.hasOwnProperty;function d9(t){if(t==null)return!0;if(au(t)&&(Un(t)||typeof t=="string"||typeof t.splice=="function"||C0(t)||US(t)||T0(t)))return!t.length;var e=ps(t);if(e==N5e||e==O5e)return!t.size;if(WS(t))return!wZ(t).length;for(var r in t)if(P5e.call(t,r))return!1;return!0}function Vi(t){return t===void 0}function YZ(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function W5e(t,e,r){e.length?e=lp(e,function(a){return Un(a)?function(s){return KS(s,a.length===1?a[0]:a)}:a}):e=[gd];var n=-1;e=lp(e,qS(su));var i=UZ(t,function(a,s,o){var l=lp(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return z5e(i,function(a,s){return V5e(a,s,r)})}function q5e(t,e){return F5e(t,e,function(r,n){return GZ(t,n)})}var Fw=JLe(function(t,e){return t==null?{}:q5e(t,e)}),U5e=Math.ceil,H5e=Math.max;function Y5e(t,e,r,n){for(var i=-1,a=H5e(U5e((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function X5e(t){return function(e,r,n){return n&&typeof n!="number"&&Dx(e,r,n)&&(r=n=void 0),e=Y2(e),r===void 0?(r=e,e=0):r=Y2(r),n=n===void 0?e1&&Dx(t,e[0],e[1])?e=[]:r>2&&Dx(e[0],e[1],e[2])&&(e=[e[0]]),W5e(t,KN(e),[])}),K5e=1/0,Z5e=cp&&1/QN(new cp([,-0]))[1]==K5e?function(t){return new cp(t)}:dRe,Q5e=200;function J5e(t,e,r){var n=-1,i=CRe,a=t.length,s=!0,o=[],l=o;if(a>=Q5e){var u=Z5e(t);if(u)return QN(u);s=!1,i=$Z,l=new Ox}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Au,this._children[e]={},this._children[Au][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],lt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),lt(Gs(this._in[e]),r),delete this._in[e],delete this._preds[e],lt(Gs(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Vi(r))r=Au;else{r+="";for(var n=r;!Vi(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Au)return r}}children(e){if(Vi(e)&&(e=Au),this._isCompound){var r=this._children[e];if(r)return Gs(r)}else{if(e===Au)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Gs(r)}successors(e){var r=this._sucs[e];if(r)return Gs(r)}neighbors(e){var r=this.predecessors(e);if(r)return e4e(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;lt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),lt(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&<(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return Ix(e)||(e=Wf(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Il(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Bb(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,Vi(n)||(n=""+n);var o=C1(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Vi(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=a4e(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,p9(this._preds[r],e),p9(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?FA(this._isDirected,arguments[0]):C1(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?FA(this._isDirected,arguments[0]):C1(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?FA(this._isDirected,arguments[0]):C1(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],g9(this._preds[r],e),g9(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Il(n);return r?Sl(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Il(n);return r?Sl(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}ma.prototype._nodeCount=0;ma.prototype._edgeCount=0;function p9(t,e){t[e]?t[e]++:t[e]=1}function g9(t,e){--t[e]||delete t[e]}function C1(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+f9+a+f9+(Vi(n)?i4e:n)}function a4e(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function FA(t,e){return C1(t,e.v,e.w,e.name)}function oO(t,{edgePathsClass:e="edges edgePaths"}={}){const r=t.insert("g").attr("class","root"),n=r.insert("g").attr("class","clusters"),i=r.insert("g").attr("class",e),a=r.insert("g").attr("class","edgeLabels"),s=r.insert("g").attr("class","nodes");return{clusters:n,edgePaths:i,edgeLabels:a,nodes:s,rootGroups:r}}x(oO,"createLayoutElementGroups");async function XZ(t,e){if(e.label){const{shapeSvg:r,bbox:n}=await Nt(t,e);e.labelBBox={width:n.width,height:n.height},r.remove()}else e.labelBBox={width:0,height:0}}x(XZ,"measureGroupLabel");async function lO(t,e,r){var a;const n=await av(t,e,r),i=((a=n.node())==null?void 0:a.getBBox())??{width:0,height:0};return e.width=i.width,e.height=i.height,n}x(lO,"insertMeasuredNode");async function jZ(t,e){const r=new ma({multigraph:!0,compound:!0}),n=[...e.edges],i=Pe(),a=oO(t),{edgeLabels:s,nodes:o}=a,l=new Map,u=t.node()!=null;await Promise.all(e.nodes.map(async h=>{if(h.isGroup)u&&await XZ(o,h),r.setNode(h.id,{...h});else{if(u){const d=await lO(o,h,{config:i,dir:h.dir});l.set(h.id,d)}r.setNode(h.id,{...h})}}));for(const h of n)u&&oZ(h)&&await b0(s,h),r.setEdge(h.start,h.end,{...h},h.id),e.edges.some(f=>f.id===h.id)||e.edges.push(h);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:h}=await Bt(async()=>{const{captureNodeSizes:d}=await Promise.resolve().then(()=>eOe);return{captureNodeSizes:d}},void 0);h(t,e)}return{graph:r,groups:a,nodeElements:l}}x(jZ,"createGraphWithElements");var lr=new Map,Ch=new Map,KZ=new Map,s4e=x(()=>{Ch.clear(),KZ.clear(),lr.clear()},"clear"),Px=x((t,e)=>{const r=Ch.get(e)||[];return he.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),o4e=x((t,e)=>{const r=Ch.get(e)||[];return he.info("Descendants of ",e," is ",r),he.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||Px(t.v,e)||Px(t.w,e)||r.includes(t.w):(he.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),ZZ=x((t,e,r,n)=>{he.debug("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),he.debug("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)ZZ(a,e,r,n);else{const s=e.node(a);he.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(he.debug("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(he.debug("Setting parent",a,t),r.setParent(a,t)):(he.info("In copy ",t,"root",n,"data",e.node(t),n),he.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);he.debug("Copying Edges",o),o.forEach(l=>{he.info("Edge",l);const u=e.edge(l.v,l.w,l.name);he.info("Edge data",u,n);try{o4e(l,n)?(he.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),he.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):he.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){he.error(h)}})}he.debug("Removing node",a),e.removeNode(a)})},"copy"),QZ=x((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)KZ.set(i,t),n=[...n,...QZ(i,e)];return n},"extractDescendants"),l4e=x((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),S0=x((t,e,r)=>{const n=e.children(t);if(he.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=S0(a,e,r),o=l4e(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),m9=x(t=>!lr.has(t)||!lr.get(t).externalConnections?t:lr.has(t)?lr.get(t).id:t,"getAnchorId"),c4e=x((t,e)=>{var r;if(!t||e>10){he.debug("Opting out, no graph ");return}else he.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(he.debug("Cluster identified",n," Replacement id in edges: ",S0(n,t,n)),Ch.set(n,QZ(n,t)),lr.set(n,{id:S0(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(he.debug("Cluster identified",n,Ch),a.forEach(s=>{const o=Px(s.v,n),l=Px(s.w,n);o^l&&(he.debug("Edge: ",s," leaves cluster ",n),he.debug("Descendants of XXX ",n,": ",Ch.get(n)),lr.get(n).externalConnections=!0)})):he.debug("Not a cluster ",n,Ch)});for(let n of lr.keys()){const i=lr.get(n).id,a=t.parent(i);a!==n&&lr.has(a)&&!lr.get(a).externalConnections&&(lr.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=lr.get(n))!=null&&r.externalConnections)&&s&&tQ(t,i,n)){const o=u4e(t,n,t.parent(i));o&&(lr.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);he.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),he.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(he.debug("Fix XXX",lr,"ids:",n.v,n.w,"Translating: ",lr.get(n.v)," --- ",lr.get(n.w)),lr.get(n.v)||lr.get(n.w)){if(he.debug("Fixing and trying - removing XXX",n.v,n.w,n.name),a=m9(n.v),s=m9(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);lr.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);lr.get(o).externalConnections=!0,i.toCluster=n.w}he.debug("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),JZ(t,0),he.trace(lr)},"adjustClustersAndEdges"),JZ=x((t,e)=>{var i,a;if(e>10){he.error("Bailing out");return}let r=t.nodes(),n=!1;for(const s of r){const o=t.children(s);n=n||o.length>0}if(!n){he.debug("Done, no node has children",t.nodes());return}he.debug("Nodes = ",r,e);for(const s of r)if(he.debug("Extracting node",s,lr,lr.has(s)&&!lr.get(s).externalConnections,!t.parent(s),t.node(s),t.children("D")," Depth ",e),!lr.has(s))he.debug("Not a cluster",s,e);else if(!lr.get(s).externalConnections&&t.children(s)&&t.children(s).length>0){he.debug("Cluster without external connections, without a parent and with children",s,e);let l=t.graph().rankdir==="TB"?"LR":"TB";(a=(i=lr.get(s))==null?void 0:i.clusterData)!=null&&a.dir&&(l=lr.get(s).clusterData.dir,he.debug("Fixing dir",lr.get(s).clusterData.dir,l));const u=new ma({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});ZZ(s,t,u,s),t.setNode(s,{clusterNode:!0,id:s,clusterData:lr.get(s).clusterData,label:lr.get(s).label,graph:u})}else he.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!lr.get(s).externalConnections," no parent: ",!t.parent(s)," children ",t.children(s)&&t.children(s).length>0,t.children("D"),e),he.debug(lr);r=t.nodes(),he.debug("New list of nodes",r);for(const s of r){const o=t.node(s);he.debug(" Now next level",s,o),o!=null&&o.clusterNode&&JZ(o.graph,e+1)}},"extractor"),eQ=x((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=eQ(t,i);r=[...r,...a]}),r},"sorter"),cO=x(t=>eQ(t,t.children()),"sortNodesByHierarchy"),tQ=x((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=lr.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),u4e=x((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||Px(i,r))continue;const a=S0(i,t,e);if(a&&!tQ(t,a,e))return a}return null},"findSafeAnchorNode");function JS({prepareLayout:t,measureLayout:e,runLayoutCore:r,paintLayout:n,afterPaint:i,paintOptions:a}){const s=e??hO;return x(async function(l,u,h,d){const f=u.select("g");((h==null?void 0:h.insertMarkers)??HN)(f,l.markers,l.type,l.diagramId),uO();const p={element:f,helpers:h,options:d};p.preparedLayout=await(t==null?void 0:t(l,p));const g=await s(l,p),m=await r(l,p),y={...p,measure:g};n?await n(l,y,m):await dO(l,y,a),await(i==null?void 0:i(l,y,m))},"render")}x(JS,"createCommonLayoutRenderer");function uO(){P_e(),Z_e(),U_e(),s4e()}x(uO,"clearLayoutRenderState");async function hO(t,{element:e}){return await jZ(e,t)}x(hO,"defaultMeasureLayout");async function dO(t,e,r={}){var s,o;const{measure:n}=e,{groups:i}=n;for(const l of((s=r.getNodes)==null?void 0:s.call(r,t,e))??t.nodes)(o=r.skipNode)!=null&&o.call(r,l,e)||await rQ(i,l,e,r);const a=iQ(t.nodes);for(const l of t.edges)aQ(l,r)||await sQ(i,l,a,t,r,e)}x(dO,"paintLayoutData");async function rQ(t,e,r,n){e.clusterNode?v0(e):nQ(e,r,n)?await PS(t.clusters,e):v0(e)}x(rQ,"paintLayoutNode");function nQ(t,e,r){var n;return t.isGroup===!0&&(((n=r.isCluster)==null?void 0:n.call(r,t,e))??!0)}x(nQ,"shouldPaintAsCluster");function iQ(t){const e=new Map;for(const r of t)r!=null&&r.id&&e.set(r.id,r);return e}x(iQ,"buildNodeLookup");function aQ(t,e){var r;return t.isLayoutOnly||!!((r=e.skipEdge)!=null&&r.call(e,t))}x(aQ,"shouldSkipPaintEdge");async function sQ(t,e,r,n,i,a){const s=BS(t.edgePaths,{...e},i.clusterDb??new Map,n.type,N3(e.start,e,r,a,i),N3(e.end,e,r,a,i),n.diagramId,oQ(e,i));oZ(e)&&(x0.has(e.id)||await b0(t.edgeLabels,e),lQ(e,s))}x(sQ,"paintLayoutEdge");function N3(t,e,r,n,i){var a;return((a=i.getEdgeNode)==null?void 0:a.call(i,t,e,n))??(t?r.get(t)??{}:{})}x(N3,"getRenderedNode");function oQ(t,e){return typeof e.skipIntersect=="function"?e.skipIntersect(t):e.skipIntersect??!1}x(oQ,"shouldSkipIntersect");function lQ(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=It(),{subGraphTitleTotalMargin:i}=$b({flowchart:n.flowchart??{}});if(t.label){const a=x0.get(t.id);let s=t.x,o=t.y;if(r){const l=sr.calcLabelPosition(r);he.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e!=null&&e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const a=In.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=sr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=In.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=sr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=In.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=sr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=In.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=sr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}x(lQ,"positionRenderedEdgeLabel");function cQ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}x(cQ,"getDefaultExportFromCjs");var Bi={},VT={},dc={},y9;function lv(){if(y9)return dc;y9=1;function t(s){return typeof s>"u"||s===null}x(t,"isNothing");function e(s){return typeof s=="object"&&s!==null}x(e,"isObject");function r(s){return Array.isArray(s)?s:t(s)?[]:[s]}x(r,"toArray");function n(s,o){if(o){const l=Object.keys(o);for(let u=0,h=l.length;ud&&(u=" ... ",a=o-d+u.length),s-o>d&&(h=" ...",s=o+d-h.length),{str:u+i.slice(a,s).replace(/\t/g,"→")+h,pos:o-a+u.length}}x(e,"getLine");function r(i,a){return t.repeat(" ",a-i.length)+i}x(r,"padStart");function n(i,a){if(a=Object.create(a||null),!i.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);const s=/\r?\n|\r|\0/g,o=[0],l=[];let u,h=-1;for(;u=s.exec(i.buffer);)l.push(u.index),o.push(u.index+u[0].length),i.position<=u.index&&h<0&&(h=o.length-2);h<0&&(h=o.length-1);let d="";const f=Math.min(i.line+a.linesAfter,l.length).toString().length,p=a.maxLength-(a.indent+f+3);for(let m=1;m<=a.linesBefore&&!(h-m<0);m++){const y=e(i.buffer,o[h-m],l[h-m],i.position-(o[h]-o[h-m]),p);d=t.repeat(" ",a.indent)+r((i.line-m+1).toString(),f)+" | "+y.str+` `+d}const g=e(i.buffer,o[h],l[h],i.position,p);d+=t.repeat(" ",a.indent)+r((i.line+1).toString(),f)+" | "+g.str+` `,d+=t.repeat("-",a.indent+f+3+g.pos)+`^ `;for(let m=1;m<=a.linesAfter&&!(h+m>=l.length);m++){const y=e(i.buffer,o[h+m],l[h+m],i.position-(o[h]-o[h+m]),p);d+=t.repeat(" ",a.indent)+r((i.line+m+1).toString(),f)+" | "+y.str+` `}return d.replace(/\n$/,"")}return x(n,"makeSnippet"),GA=n,GA}x(uQ,"requireSnippet");var VA,b9;function Xi(){if(b9)return VA;b9=1;const t=cv(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function n(a){const s={};return a!==null&&Object.keys(a).forEach(function(o){a[o].forEach(function(l){s[String(l)]=o})}),s}x(n,"compileStyleAliases");function i(a,s){if(s=s||{},Object.keys(s).forEach(function(o){if(e.indexOf(o)===-1)throw new t('Unknown option "'+o+'" is met in definition of "'+a+'" YAML type.')}),this.options=s,this.tag=a,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(o){return o},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=n(s.styleAliases||null),r.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+a+'" YAML type.')}return x(i,"Type2"),VA=i,VA}x(Xi,"requireType");var WA,T9;function fO(){if(T9)return WA;T9=1;const t=cv(),e=Xi();function r(a,s){const o=[];return a[s].forEach(function(l){let u=o.length;o.forEach(function(h,d){h.tag===l.tag&&h.kind===l.kind&&h.multi===l.multi&&(u=d)}),o[u]=l}),o}x(r,"compileList");function n(){const a={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(o){o.multi?(a.multi[o.kind].push(o),a.multi.fallback.push(o)):a[o.kind][o.tag]=a.fallback[o.tag]=o}x(s,"collectType");for(let o=0,l=arguments.length;o=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}x(r,"isHexCode");function n(u){return u>=48&&u<=55}x(n,"isOctCode");function i(u){return u>=48&&u<=57}x(i,"isDecCode");function a(u){if(u===null)return!1;const h=u.length;let d=0,f=!1;if(!h)return!1;let p=u[d];if((p==="-"||p==="+")&&(p=u[++d]),p==="0"){if(d+1===h)return!0;if(p=u[++d],p==="b"){for(d++;d=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},"binary"),octal:x(function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},"octal"),decimal:x(function(u){return u.toString(10)},"decimal"),hexadecimal:x(function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),KA}x(bO,"requireInt");var ZA,R9;function TO(){if(R9)return ZA;R9=1;const t=lv(),e=Xi(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),n=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function i(u){return u===null||!r.test(u)?!1:isFinite(parseFloat(u,10))?!0:n.test(u)}x(i,"resolveYamlFloat");function a(u){let h=u.toLowerCase();const d=h[0]==="-"?-1:1;return"+-".indexOf(h[0])>=0&&(h=h.slice(1)),h===".inf"?d===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:h===".nan"?NaN:d*parseFloat(h,10)}x(a,"constructYamlFloat");const s=/^[-+]?[0-9]+e/;function o(u,h){if(isNaN(u))switch(h){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(h){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(h){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(u))return"-0.0";const d=u.toString(10);return s.test(d)?d.replace("e",".e"):d}x(o,"representYamlFloat");function l(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||t.isNegativeZero(u))}return x(l,"isFloat"),ZA=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:a,predicate:l,represent:o,defaultStyle:"lowercase"}),ZA}x(TO,"requireFloat");var QA,L9;function CO(){return L9||(L9=1,QA=yO().extend({implicit:[vO(),xO(),bO(),TO()]})),QA}x(CO,"requireJson");var JA,I9;function wO(){return I9||(I9=1,JA=CO()),JA}x(wO,"requireCore");var eR,D9;function EO(){if(D9)return eR;D9=1;const t=Xi(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=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 n(s){return s===null?!1:e.exec(s)!==null||r.exec(s)!==null}x(n,"resolveYamlTimestamp");function i(s){let o=0,l=null,u=e.exec(s);if(u===null&&(u=r.exec(s)),u===null)throw new Error("Date resolve error");const h=+u[1],d=+u[2]-1,f=+u[3];if(!u[4])return new Date(Date.UTC(h,d,f));const p=+u[4],g=+u[5],m=+u[6];if(u[7]){for(o=u[7].slice(0,3);o.length<3;)o+="0";o=+o}if(u[9]){const v=+u[10],T=+(u[11]||0);l=(v*60+T)*6e4,u[9]==="-"&&(l=-l)}const y=new Date(Date.UTC(h,d,f,p,g,m,o));return l&&y.setTime(y.getTime()-l),y}x(i,"constructYamlTimestamp");function a(s){return s.toISOString()}return x(a,"representYamlTimestamp"),eR=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:a}),eR}x(EO,"requireTimestamp");var tR,M9;function SO(){if(M9)return tR;M9=1;const t=Xi();function e(r){return r==="<<"||r===null}return x(e,"resolveYamlMerge"),tR=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),tR}x(SO,"requireMerge");var rR,N9;function kO(){if(N9)return rR;N9=1;const t=Xi(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function r(s){if(s===null)return!1;let o=0;const l=s.length,u=e;for(let h=0;h64)){if(d<0)return!1;o+=6}}return o%8===0}x(r,"resolveYamlBinary");function n(s){const o=s.replace(/[\r\n=]/g,""),l=o.length,u=e;let h=0;const d=[];for(let p=0;p>16&255),d.push(h>>8&255),d.push(h&255)),h=h<<6|u.indexOf(o.charAt(p));const f=l%4*6;return f===0?(d.push(h>>16&255),d.push(h>>8&255),d.push(h&255)):f===18?(d.push(h>>10&255),d.push(h>>2&255)):f===12&&d.push(h>>4&255),new Uint8Array(d)}x(n,"constructYamlBinary");function i(s){let o="",l=0;const u=s.length,h=e;for(let f=0;f>18&63],o+=h[l>>12&63],o+=h[l>>6&63],o+=h[l&63]),l=(l<<8)+s[f];const d=u%3;return d===0?(o+=h[l>>18&63],o+=h[l>>12&63],o+=h[l>>6&63],o+=h[l&63]):d===2?(o+=h[l>>10&63],o+=h[l>>4&63],o+=h[l<<2&63],o+=h[64]):d===1&&(o+=h[l>>2&63],o+=h[l<<4&63],o+=h[64],o+=h[64]),o}x(i,"representYamlBinary");function a(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return x(a,"isBinary"),rR=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:n,predicate:a,represent:i}),rR}x(kO,"requireBinary");var nR,O9;function _O(){if(O9)return nR;O9=1;const t=Xi(),e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(a){if(a===null)return!0;const s=[],o=a;for(let l=0,u=o.length;l=48&&G<=57)return G-48;const q=G|32;return q>=97&&q<=102?q-97+10:-1}x(S,"fromHexCode");function E(G){return G===120?2:G===117?4:G===85?8:0}x(E,"escapedHexLen");function _(G){return G>=48&&G<=57?G-48:-1}x(_,"fromDecimalCode");function R(G){switch(G){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}x(R,"simpleEscapeSequence");function D(G){return G<=65535?String.fromCharCode(G):String.fromCharCode((G-65536>>10)+55296,(G-65536&1023)+56320)}x(D,"charFromCodepoint");function L(G,q,H){q==="__proto__"?Object.defineProperty(G,q,{configurable:!0,enumerable:!0,writable:!0,value:H}):G[q]=H}x(L,"setProperty");const B=new Array(256),$=new Array(256);for(let G=0;G<256;G++)B[G]=R(G)?1:0,$[G]=R(G);function A(G,q){this.input=G,this.filename=q.filename||null,this.schema=q.schema||n,this.onWarning=q.onWarning||null,this.legacy=q.legacy||!1,this.json=q.json||!1,this.listener=q.listener||null,this.maxDepth=typeof q.maxDepth=="number"?q.maxDepth:100,this.maxTotalMergeKeys=typeof q.maxTotalMergeKeys=="number"?q.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=G.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}x(A,"State");function I(G,q){const H={name:G.filename,buffer:G.input.slice(0,-1),position:G.position,line:G.line,column:G.position-G.lineStart};return H.snippet=r(H),new e(q,H)}x(I,"generateError");function O(G,q){throw I(G,q)}x(O,"throwError");function N(G,q){G.onWarning&&G.onWarning.call(null,I(G,q))}x(N,"throwWarning");function M(G,q,H){const Z=G.anchorMapTransactions;if(Z.length!==0){const te=Z[Z.length-1];i.call(te,q)||(te[q]={existed:i.call(G.anchorMap,q),value:G.anchorMap[q]})}G.anchorMap[q]=H}x(M,"storeAnchor");function P(G){G.anchorMapTransactions.push(Object.create(null))}x(P,"beginAnchorTransaction");function F(G){const q=G.anchorMapTransactions.pop(),H=G.anchorMapTransactions;if(H.length===0)return;const Z=H[H.length-1],te=Object.keys(q);for(let K=0,U=te.length;K=0;Z-=1){const te=q[H[Z]];te.existed?G.anchorMap[H[Z]]=te.value:delete G.anchorMap[H[Z]]}}x(V,"rollbackAnchorTransaction");function z(G){return{position:G.position,line:G.line,lineStart:G.lineStart,lineIndent:G.lineIndent,firstTabInLine:G.firstTabInLine,tag:G.tag,anchor:G.anchor,kind:G.kind,result:G.result}}x(z,"snapshotState");function W(G,q){G.position=q.position,G.line=q.line,G.lineStart=q.lineStart,G.lineIndent=q.lineIndent,G.firstTabInLine=q.firstTabInLine,G.tag=q.tag,G.anchor=q.anchor,G.kind=q.kind,G.result=q.result}x(W,"restoreState");const X={YAML:x(function(q,H,Z){q.version!==null&&O(q,"duplication of %YAML directive"),Z.length!==1&&O(q,"YAML directive accepts exactly one argument");const te=/^([0-9]+)\.([0-9]+)$/.exec(Z[0]);te===null&&O(q,"ill-formed argument of the YAML directive");const K=parseInt(te[1],10),U=parseInt(te[2],10);K!==1&&O(q,"unacceptable YAML version of the document"),q.version=Z[0],q.checkLineBreaks=U<2,U!==1&&U!==2&&N(q,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(q,H,Z){let te;Z.length!==2&&O(q,"TAG directive accepts exactly two arguments");const K=Z[0];te=Z[1],m.test(K)||O(q,"ill-formed tag handle (first argument) of the TAG directive"),i.call(q.tagMap,K)&&O(q,'there is a previously declared suffix for "'+K+'" tag handle'),y.test(te)||O(q,"ill-formed tag prefix (second argument) of the TAG directive");try{te=decodeURIComponent(te)}catch{O(q,"tag prefix is malformed: "+te)}q.tagMap[K]=te},"handleTagDirective")};function j(G,q,H,Z){if(q=32&&Y<=1114111||O(G,"expected valid JSON character")}else f.test(te)&&O(G,"the stream contains non-printable characters");G.result+=te}}x(j,"captureSegment");function re(G,q,H,Z){t.isObject(H)||O(G,"cannot merge mappings; the provided source object is unacceptable");const te=Object.keys(H);for(let K=0,U=te.length;KG.maxTotalMergeKeys&&O(G,"merge keys exceeded maxTotalMergeKeys ("+G.maxTotalMergeKeys+")"),i.call(q,Y)||(L(q,Y,H[Y]),Z[Y]=!0)}}x(re,"mergeMappings");function Q(G,q,H,Z,te,K,U,Y,fe){if(Array.isArray(te)){te=Array.prototype.slice.call(te);for(let ue=0,Te=te.length;ue1&&(G.result+=t.repeat(` `,q-1))}x(ie,"writeFoldedLines");function ae(G,q,H){let Z,te,K,U,Y,fe;const ue=G.kind,Te=G.result;let ge=G.input.charCodeAt(G.position);if(C(ge)||w(ge)||ge===35||ge===38||ge===42||ge===33||ge===124||ge===62||ge===39||ge===34||ge===37||ge===64||ge===96)return!1;if(ge===63||ge===45){const we=G.input.charCodeAt(G.position+1);if(C(we)||H&&w(we))return!1}for(G.kind="scalar",G.result="",Z=te=G.position,K=!1;ge!==0;){if(ge===58){const we=G.input.charCodeAt(G.position+1);if(C(we)||H&&w(we))break}else if(ge===35){const we=G.input.charCodeAt(G.position-1);if(C(we))break}else{if(G.position===G.lineStart&&ne(G)||H&&w(ge))break;if(T(ge))if(U=G.line,Y=G.lineStart,fe=G.lineIndent,ee(G,!1,-1),G.lineIndent>=q){K=!0,ge=G.input.charCodeAt(G.position);continue}else{G.position=te,G.line=U,G.lineStart=Y,G.lineIndent=fe;break}}K&&(j(G,Z,te,!1),ie(G,G.line-U),Z=te=G.position,K=!1),b(ge)||(te=G.position+1),ge=G.input.charCodeAt(++G.position)}return j(G,Z,te,!1),G.result?!0:(G.kind=ue,G.result=Te,!1)}x(ae,"readPlainScalar");function de(G,q){let H,Z,te=G.input.charCodeAt(G.position);if(te!==39)return!1;for(G.kind="scalar",G.result="",G.position++,H=Z=G.position;(te=G.input.charCodeAt(G.position))!==0;)if(te===39)if(j(G,H,G.position,!0),te=G.input.charCodeAt(++G.position),te===39)H=G.position,G.position++,Z=G.position;else return!0;else T(te)?(j(G,H,Z,!0),ie(G,ee(G,!1,q)),H=Z=G.position):G.position===G.lineStart&&ne(G)?O(G,"unexpected end of the document within a single quoted scalar"):(G.position++,b(te)||(Z=G.position));O(G,"unexpected end of the stream within a single quoted scalar")}x(de,"readSingleQuotedScalar");function le(G,q){let H,Z,te,K=G.input.charCodeAt(G.position);if(K!==34)return!1;for(G.kind="scalar",G.result="",G.position++,H=Z=G.position;(K=G.input.charCodeAt(G.position))!==0;){if(K===34)return j(G,H,G.position,!0),G.position++,!0;if(K===92){if(j(G,H,G.position,!0),K=G.input.charCodeAt(++G.position),T(K))ee(G,!1,q);else if(K<256&&B[K])G.result+=$[K],G.position++;else if((te=E(K))>0){let U=te,Y=0;for(;U>0;U--)K=G.input.charCodeAt(++G.position),(te=S(K))>=0?Y=(Y<<4)+te:O(G,"expected hexadecimal character");G.result+=D(Y),G.position++}else O(G,"unknown escape sequence");H=Z=G.position}else T(K)?(j(G,H,Z,!0),ie(G,ee(G,!1,q)),H=Z=G.position):G.position===G.lineStart&&ne(G)?O(G,"unexpected end of the document within a double quoted scalar"):(G.position++,b(K)||(Z=G.position))}O(G,"unexpected end of the stream within a double quoted scalar")}x(le,"readDoubleQuotedScalar");function ye(G,q){let H=!0,Z,te,K;const U=G.tag;let Y;const fe=G.anchor;let ue,Te,ge,we;const xe=Object.create(null);let Le,_e,Be,Ee=G.input.charCodeAt(G.position);if(Ee===91)ue=93,we=!1,Y=[];else if(Ee===123)ue=125,we=!0,Y={};else return!1;for(G.anchor!==null&&M(G,G.anchor,Y),Ee=G.input.charCodeAt(++G.position);Ee!==0;){if(ee(G,!0,q),Ee=G.input.charCodeAt(G.position),Ee===ue)return G.position++,G.tag=U,G.anchor=fe,G.kind=we?"mapping":"sequence",G.result=Y,!0;if(H?Ee===44&&O(G,"expected the node content, but found ','"):O(G,"missed comma between flow collection entries"),_e=Le=Be=null,Te=ge=!1,Ee===63){const Xe=G.input.charCodeAt(G.position+1);C(Xe)&&(Te=ge=!0,G.position++,ee(G,!0,q))}Z=G.line,te=G.lineStart,K=G.position,Ae(G,q,a,!1,!0),_e=G.tag,Le=G.result,ee(G,!0,q),Ee=G.input.charCodeAt(G.position),(ge||G.line===Z)&&Ee===58&&(Te=!0,Ee=G.input.charCodeAt(++G.position),ee(G,!0,q),Ae(G,q,a,!1,!0),Be=G.result),we?Q(G,Y,xe,_e,Le,Be,Z,te,K):Te?Y.push(Q(G,null,xe,_e,Le,Be,Z,te,K)):Y.push(Le),ee(G,!0,q),Ee=G.input.charCodeAt(G.position),Ee===44?(H=!0,Ee=G.input.charCodeAt(++G.position)):H=!1}O(G,"unexpected end of the stream within a flow collection")}x(ye,"readFlowCollection");function $e(G,q){let H,Z=u,te=!1,K=!1,U=q,Y=0,fe=!1,ue,Te=G.input.charCodeAt(G.position);if(Te===124)H=!1;else if(Te===62)H=!0;else return!1;for(G.kind="scalar",G.result="";Te!==0;)if(Te=G.input.charCodeAt(++G.position),Te===43||Te===45)u===Z?Z=Te===43?d:h:O(G,"repeat of a chomping mode identifier");else if((ue=_(Te))>=0)ue===0?O(G,"bad explicit indentation width of a block scalar; it cannot be less than one"):K?O(G,"repeat of an indentation width identifier"):(U=q+ue-1,K=!0);else break;if(b(Te)){do Te=G.input.charCodeAt(++G.position);while(b(Te));if(Te===35)do Te=G.input.charCodeAt(++G.position);while(!T(Te)&&Te!==0)}for(;Te!==0;){for(oe(G),G.lineIndent=0,Te=G.input.charCodeAt(G.position);(!K||G.lineIndentU&&(U=G.lineIndent),T(Te)){Y++;continue}if(!K&&U===0&&O(G,"missing indentation for block scalar"),G.lineIndentq)&&U!==0)O(G,"bad indentation of a sequence entry");else if(G.lineIndentq)&&(Le&&(te=G.line,K=G.lineStart,U=G.position),Ae(G,q,l,!0,Z)&&(Le?we=G.result:xe=G.result),Le||(Q(G,ue,Te,ge,we,xe,te,K,U),ge=we=xe=null),ee(G,!0,-1),Be=G.input.charCodeAt(G.position)),(G.line===Xe||G.lineIndent>q)&&Be!==0)O(G,"bad indentation of a mapping entry");else if(G.lineIndent=G.maxDepth&&O(G,"nesting exceeded maxDepth ("+G.maxDepth+")"),G.depth+=1,G.listener!==null&&G.listener("open",G),G.tag=null,G.anchor=null,G.kind=null,G.result=null;const Le=K=U=l===H||o===H;if(Z&&ee(G,!0,-1)&&(fe=!0,G.lineIndent>q?Y=1:G.lineIndent===q?Y=0:G.lineIndentq?Y=1:G.lineIndent===q?Y=0:G.lineIndent tag; it should be "scalar", not "'+G.kind+'"');for(let _e=0,Be=G.implicitTypes.length;_e"),G.result!==null&&ge.kind!==G.kind&&O(G,"unacceptable node kind for !<"+G.tag+'> tag; it should be "'+ge.kind+'", not "'+G.kind+'"'),ge.resolve(G.result,G.tag)?(G.result=ge.construct(G.result,G.tag),G.anchor!==null&&M(G,G.anchor,G.result)):O(G,"cannot resolve a node with !<"+G.tag+"> explicit tag")}return G.listener!==null&&G.listener("close",G),G.depth-=1,G.tag!==null||G.anchor!==null||ue}x(Ae,"composeNode");function be(G){const q=G.position;let H=!1,Z;for(G.version=null,G.checkLineBreaks=G.legacy,G.tagMap=Object.create(null),G.anchorMap=Object.create(null);(Z=G.input.charCodeAt(G.position))!==0&&(ee(G,!0,-1),Z=G.input.charCodeAt(G.position),!(G.lineIndent>0||Z!==37));){H=!0,Z=G.input.charCodeAt(++G.position);let te=G.position;for(;Z!==0&&!C(Z);)Z=G.input.charCodeAt(++G.position);const K=G.input.slice(te,G.position),U=[];for(K.length<1&&O(G,"directive name must not be less than one character in length");Z!==0;){for(;b(Z);)Z=G.input.charCodeAt(++G.position);if(Z===35){do Z=G.input.charCodeAt(++G.position);while(Z!==0&&!T(Z));break}if(T(Z))break;for(te=G.position;Z!==0&&!C(Z);)Z=G.input.charCodeAt(++G.position);U.push(G.input.slice(te,G.position))}Z!==0&&oe(G),i.call(X,K)?X[K](G,K,U):N(G,'unknown document directive "'+K+'"')}if(ee(G,!0,-1),G.lineIndent===0&&G.input.charCodeAt(G.position)===45&&G.input.charCodeAt(G.position+1)===45&&G.input.charCodeAt(G.position+2)===45?(G.position+=3,ee(G,!0,-1)):H&&O(G,"directives end mark is expected"),Ae(G,G.lineIndent-1,l,!1,!0),ee(G,!0,-1),G.checkLineBreaks&&p.test(G.input.slice(q,G.position))&&N(G,"non-ASCII line breaks are interpreted as content"),G.documents.push(G.result),G.position===G.lineStart&&ne(G)){G.input.charCodeAt(G.position)===46&&(G.position+=3,ee(G,!0,-1));return}G.position"u"&&(H=q,q=null);const Z=ke(G,H);if(typeof q!="function")return Z;for(let te=0,K=Z.length;te=32&&U<=126||U>=161&&U<=55295&&U!==8232&&U!==8233||U>=57344&&U<=65533&&U!==a||U>=65536&&U<=1114111}x(re,"isPrintable");function Q(U){return re(U)&&U!==a&&U!==l&&U!==o}x(Q,"isNsCharOrWhitespace");function oe(U,Y,fe){const ue=Q(U),Te=ue&&!j(U);return(fe?ue:ue&&U!==v&&U!==_&&U!==R&&U!==L&&U!==$)&&U!==f&&!(Y===b&&!Te)||Q(Y)&&!j(Y)&&U===f||Y===b&&Te}x(oe,"isPlainSafe");function ee(U){return re(U)&&U!==a&&!j(U)&&U!==T&&U!==S&&U!==b&&U!==v&&U!==_&&U!==R&&U!==L&&U!==$&&U!==f&&U!==g&&U!==y&&U!==h&&U!==B&&U!==C&&U!==w&&U!==m&&U!==d&&U!==p&&U!==E&&U!==D}x(ee,"isPlainSafeFirst");function ne(U){return!j(U)&&U!==b}x(ne,"isPlainSafeLast");function ie(U,Y){const fe=U.charCodeAt(Y);let ue;return fe>=55296&&fe<=56319&&Y+1=56320&&ue<=57343)?(fe-55296)*1024+ue-56320+65536:fe}x(ie,"codePointAt");function ae(U){return/^\n* /.test(U)}x(ae,"needIndentIndicator");const de=1,le=2,ye=3,$e=4,Fe=5;function ce(U,Y,fe,ue,Te,ge,we,xe){let Le,_e=0,Be=null,Ee=!1,Xe=!1;const Re=ue!==-1;let Qe=-1,it=ee(ie(U,0))&&ne(ie(U,U.length-1));if(Y||we)for(Le=0;Le=65536?Le+=2:Le++){if(_e=ie(U,Le),!re(_e))return Fe;it=it&&oe(_e,Be,xe),Be=_e}else{for(Le=0;Le=65536?Le+=2:Le++){if(_e=ie(U,Le),_e===o)Ee=!0,Re&&(Xe=Xe||Le-Qe-1>ue&&U[Qe+1]!==" ",Qe=Le);else if(!re(_e))return Fe;it=it&&oe(_e,Be,xe),Be=_e}Xe=Xe||Re&&Le-Qe-1>ue&&U[Qe+1]!==" "}return!Ee&&!Xe?it&&!we&&!Te(U)?de:ge===F?Fe:le:fe>9&&ae(U)?Fe:we?ge===F?Fe:le:Xe?$e:ye}x(ce,"chooseScalarStyle");function ve(U,Y,fe,ue,Te){U.dump=(function(){if(Y.length===0)return U.quotingType===F?'""':"''";if(!U.noCompatMode&&(I.indexOf(Y)!==-1||O.test(Y)))return U.quotingType===F?'"'+Y+'"':"'"+Y+"'";const ge=U.indent*Math.max(1,fe),we=U.lineWidth===-1?-1:Math.max(Math.min(U.lineWidth,40),U.lineWidth-ge),xe=ue||U.flowLevel>-1&&fe>=U.flowLevel;function Le(_e){return X(U,_e)}switch(x(Le,"testAmbiguity"),ce(Y,xe,U.indent,we,Le,U.quotingType,U.forceQuotes&&!ue,Te)){case de:return Y;case le:return"'"+Y.replace(/'/g,"''")+"'";case ye:return"|"+Ce(Y,U.indent)+Ne(z(Y,ge));case $e:return">"+Ce(Y,U.indent)+Ne(z(Ie(Y,we),ge));case Fe:return'"'+be(Y)+'"';default:throw new e("impossible error: invalid scalar style")}})()}x(ve,"writeScalar");function Ce(U,Y){const fe=ae(U)?String(Y):"",ue=U[U.length-1]===` `,ge=ue&&(U[U.length-2]===` `||U===` `)?"+":ue?"":"-";return fe+ge+` `}x(Ce,"blockHeader");function Ne(U){return U[U.length-1]===` `?U.slice(0,-1):U}x(Ne,"dropEndingNewline");function Ie(U,Y){const fe=/(\n+)([^\n]*)/g;let ue=(function(){let xe=U.indexOf(` `);return xe=xe!==-1?xe:U.length,fe.lastIndex=xe,Ae(U.slice(0,xe),Y)})(),Te=U[0]===` `||U[0]===" ",ge,we;for(;we=fe.exec(U);){const xe=we[1],Le=we[2];ge=Le[0]===" ",ue+=xe+(!Te&&!ge&&Le!==""?` `:"")+Ae(Le,Y),Te=ge}return ue}x(Ie,"foldString");function Ae(U,Y){if(U===""||U[0]===" ")return U;const fe=/ [^ ]/g;let ue,Te=0,ge,we=0,xe=0,Le="";for(;ue=fe.exec(U);)xe=ue.index,xe-Te>Y&&(ge=we>Te?we:xe,Le+=` `+U.slice(Te,ge),Te=ge+1),we=xe;return Le+=` `,U.length-Te>Y&&we>Te?Le+=U.slice(Te,we)+` `+U.slice(we+1):Le+=U.slice(Te),Le.slice(1)}x(Ae,"foldLine");function be(U){let Y="",fe=0;for(let ue=0;ue=65536?ue+=2:ue++){fe=ie(U,ue);const Te=A[fe];!Te&&re(fe)?(Y+=U[ue],fe>=65536&&(Y+=U[ue+1])):Y+=Te||M(fe)}return Y}x(be,"escapeString");function ke(U,Y,fe){let ue="";const Te=U.tag;for(let ge=0,we=fe.length;ge"u"&&H(U,Y,null,!1,!1))&&(ue!==""&&(ue+=","+(U.condenseFlow?"":" ")),ue+=U.dump)}U.tag=Te,U.dump="["+ue+"]"}x(ke,"writeFlowSequence");function se(U,Y,fe,ue){let Te="";const ge=U.tag;for(let we=0,xe=fe.length;we"u"&&H(U,Y+1,null,!0,!0,!1,!0))&&((!ue||Te!=="")&&(Te+=W(U,Y)),U.dump&&o===U.dump.charCodeAt(0)?Te+="-":Te+="- ",Te+=U.dump)}U.tag=ge,U.dump=Te||"[]"}x(se,"writeBlockSequence");function J(U,Y,fe){let ue="";const Te=U.tag,ge=Object.keys(fe);for(let we=0,xe=ge.length;we1024&&(Le+="? "),Le+=U.dump+(U.condenseFlow?'"':"")+":"+(U.condenseFlow?"":" "),H(U,Y,Be,!1,!1)&&(Le+=U.dump,ue+=Le))}U.tag=Te,U.dump="{"+ue+"}"}x(J,"writeFlowMapping");function G(U,Y,fe,ue){let Te="";const ge=U.tag,we=Object.keys(fe);if(U.sortKeys===!0)we.sort();else if(typeof U.sortKeys=="function")we.sort(U.sortKeys);else if(U.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let xe=0,Le=we.length;xe1024;Xe&&(U.dump&&o===U.dump.charCodeAt(0)?_e+="?":_e+="? "),_e+=U.dump,Xe&&(_e+=W(U,Y)),H(U,Y+1,Ee,!0,Xe)&&(U.dump&&o===U.dump.charCodeAt(0)?_e+=":":_e+=": ",_e+=U.dump,Te+=_e)}U.tag=ge,U.dump=Te||"{}"}x(G,"writeBlockMapping");function q(U,Y,fe){const ue=fe?U.explicitTypes:U.implicitTypes;for(let Te=0,ge=ue.length;Te tag resolver accepts not "'+xe+'" style');U.dump=Le}return!0}}return!1}x(q,"detectType");function H(U,Y,fe,ue,Te,ge,we){U.tag=null,U.dump=fe,q(U,fe,!1)||q(U,fe,!0);const xe=n.call(U.dump),Le=ue;ue&&(ue=U.flowLevel<0||U.flowLevel>Y);const _e=xe==="[object Object]"||xe==="[object Array]";let Be,Ee;if(_e&&(Be=U.duplicates.indexOf(fe),Ee=Be!==-1),(U.tag!==null&&U.tag!=="?"||Ee||U.indent!==2&&Y>0)&&(Te=!1),Ee&&U.usedDuplicates[Be])U.dump="*ref_"+Be;else{if(_e&&Ee&&!U.usedDuplicates[Be]&&(U.usedDuplicates[Be]=!0),xe==="[object Object]")ue&&Object.keys(U.dump).length!==0?(G(U,Y,U.dump,Te),Ee&&(U.dump="&ref_"+Be+U.dump)):(J(U,Y,U.dump),Ee&&(U.dump="&ref_"+Be+" "+U.dump));else if(xe==="[object Array]")ue&&U.dump.length!==0?(U.noArrayIndent&&!we&&Y>0?se(U,Y-1,U.dump,Te):se(U,Y,U.dump,Te),Ee&&(U.dump="&ref_"+Be+U.dump)):(ke(U,Y,U.dump),Ee&&(U.dump="&ref_"+Be+" "+U.dump));else if(xe==="[object String]")U.tag!=="?"&&ve(U,U.dump,Y,ge,Le);else{if(xe==="[object Undefined]")return!1;if(U.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+xe)}if(U.tag!==null&&U.tag!=="?"){let Xe=encodeURI(U.tag[0]==="!"?U.tag.slice(1):U.tag).replace(/!/g,"%21");U.tag[0]==="!"?Xe="!"+Xe:Xe.slice(0,18)==="tag:yaml.org,2002:"?Xe="!!"+Xe.slice(18):Xe="!<"+Xe+">",U.dump=Xe+" "+U.dump}}return!0}x(H,"writeNode");function Z(U,Y){const fe=[],ue=[];te(U,fe,ue);const Te=ue.length;for(let ge=0;ge{for(const e of t)Bx[e.name]=e},"registerLayoutLoaders"),p4e=x(()=>{pQ([{name:"dagre",loader:x(async()=>await Bt(()=>Promise.resolve().then(()=>ePe),void 0),"loader")},{name:"swimlane",loader:x(async()=>await Bt(()=>Promise.resolve().then(()=>fPe),void 0),"loader")},{name:"cose-bilkent",loader:x(async()=>await Bt(()=>Promise.resolve().then(()=>nze),void 0),"loader")}])},"registerDefaultLayoutLoaders");p4e();var uv=x(async(t,e)=>{if(!(t.layoutAlgorithm in Bx))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const h of t.nodes){const d=h.domId||h.id;h.domId=`${t.diagramId}-${d}`}const r=Bx[t.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=t.config,{useGradient:s,gradientStart:o,gradientStop:l}=a,u=e.attr("id");if(e.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),s){const h=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return n.render(t,e,f4e,{algorithm:r.algorithm})},"render"),zb=x((t="",{fallback:e="dagre"}={})=>{if(t in Bx)return t;if(e in Bx)return he.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),LO="comm",gQ="rule",mQ="decl",g4e="@media",m4e="@import",y4e="@supports",v4e="@namespace",O3="@keyframes",yQ="@layer",x4e="@scope",b4e=Math.abs,J1=String.fromCharCode;function vQ(t){return t.trim()}function $3(t,e,r){return t.replace(e,r)}function up(t,e){return t.charCodeAt(e)|0}function k0(t,e,r){return t.slice(e,r)}function Co(t){return t.length}function xQ(t){return t.length}function WT(t,e){return e.push(t),t}var nk=1,_0=1,bQ=0,Ts=0,zn=0,hv="";function IO(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:nk,column:_0,length:s,return:"",siblings:o}}function T4e(){return zn}function C4e(){return zn=Ts>0?up(hv,--Ts):0,_0--,zn===10&&(_0=1,nk--),zn}function Xs(){return zn=Ts2||Fx(zn)>3?"":" "}function k4e(t,e){for(;--e&&Xs()&&!(zn<48||zn>102||zn>57&&zn<65||zn>70&&zn<97););return ik(t,j2()+(e<6&&Lc()==32&&Xs()==32))}function P3(t){for(;Xs();)switch(zn){case t:return Ts;case 34:case 39:t!==34&&t!==39&&P3(zn);break;case 40:t===41&&P3(t);break;case 92:Xs();break}return Ts}function _4e(t,e){for(;Xs()&&t+zn!==57;)if(t+zn===84&&Lc()===47)break;return"/*"+ik(e,Ts-1)+"*"+J1(t===47?t:Xs())}function A4e(t){for(;!Fx(Lc());)Xs();return ik(t,Ts)}function R4e(t){return E4e(K2("",null,null,null,[""],t=w4e(t),0,[0],t))}function K2(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,T=0,b=0,C="",w=i,S=a,E=n,_=C;y;)switch(g=b,b=Xs()){case 40:g!=108&&up(_,d-1)==58?(T++,_+="("):_+=lR(b);break;case 41:T--,_+=")";break;case 34:case 39:case 91:_+=lR(b);break;case 9:case 10:case 13:case 32:if(T>0){_+=J1(b);break}_+=S4e(g);break;case 92:_+=k4e(j2()-1,7);continue;case 47:switch(Lc()){case 42:case 47:WT(L4e(_4e(Xs(),j2()),e,r,l),l),(Fx(g||1)==5||Fx(Lc()||1)==5)&&Co(_)&&k0(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:o[u++]=Co(_)*v;case 125*m:case 59:case 0:if(T>0&&b){_+=J1(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(_=$3(_,/\f/g,"")),p>0&&(Co(_)-d||m===0)&&WT(p>32?W9(_+";",n,r,d-1,l):W9($3(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(WT(E=V9(_,e,r,u,h,i,o,C,w=[],S=[],d,a),a),b===123)if(h===0)K2(_,e,E,E,w,a,d,o,S);else{switch(f){case 99:if(up(_,3)===110)break;case 108:if(up(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?K2(t,E,E,n&&WT(V9(t,E,E,0,0,i,o,C,i,w=[],d,S),S),i,S,d,o,n?w:S):K2(_,E,E,E,[""],S,0,o,S)}}u=h=p=0,m=v=1,C=_="",d=s;break;case 58:d=1+Co(_),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&C4e()==125)continue}switch(_+=J1(b),b*m){case 38:v=h>0?1:(_+="\f",-1);break;case 44:if(T>0)break;o[u++]=(Co(_)-1)*v,v=1;break;case 64:Lc()===45&&(_+=lR(Xs())),f=Lc(),h=d=Co(C=_+=A4e(j2())),b++;break;case 45:g===45&&Co(_)==2&&(m=0)}}return a}function V9(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=xQ(p),m=0,y=0,v=0;m0?p[T]+" "+b:$3(b,/&\f/g,p[T])))&&(l[v++]=C);return IO(t,e,r,i===0?gQ:o,l,u,h,d)}function L4e(t,e,r,n){return IO(t,e,r,LO,J1(T4e()),k0(t,2,-2),0,n)}function W9(t,e,r,n,i){return IO(t,e,r,mQ,k0(t,0,n),k0(t,n+1,-1),n,i)}function B3(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),N4e=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>cGe);return{diagram:e}},void 0);return{id:TQ,diagram:t}},"loader"),O4e={id:TQ,detector:M4e,loader:N4e},$4e=O4e,CQ="flowchart",P4e=x((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),B4e=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>F$);return{diagram:e}},void 0);return{id:CQ,diagram:t}},"loader"),F4e={id:CQ,detector:P4e,loader:B4e},z4e=F4e,wQ="flowchart-v2",G4e=x((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),V4e=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>F$);return{diagram:e}},void 0);return{id:wQ,diagram:t}},"loader"),W4e={id:wQ,detector:G4e,loader:V4e},q4e=W4e,EQ="swimlane",U4e=x(t=>/^\s*swimlane-beta\b/.test(t),"detector"),H4e=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>EGe);return{diagram:e}},void 0);return{id:EQ,diagram:t}},"loader"),Y4e={id:EQ,detector:U4e,loader:H4e},X4e=Y4e,SQ="er",j4e=x(t=>/^\s*erDiagram/.test(t),"detector"),K4e=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>DGe);return{diagram:e}},void 0);return{id:SQ,diagram:t}},"loader"),Z4e={id:SQ,detector:j4e,loader:K4e},Q4e=Z4e,kQ="gitGraph",J4e=x(t=>/^\s*gitGraph/.test(t),"detector"),eDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Prt);return{diagram:e}},void 0);return{id:kQ,diagram:t}},"loader"),tDe={id:kQ,detector:J4e,loader:eDe},rDe=tDe,_Q="gantt",nDe=x(t=>/^\s*gantt/.test(t),"detector"),iDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Unt);return{diagram:e}},void 0);return{id:_Q,diagram:t}},"loader"),aDe={id:_Q,detector:nDe,loader:iDe},sDe=aDe,AQ="info",oDe=x(t=>/^\s*info/.test(t),"detector"),lDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Jnt);return{diagram:e}},void 0);return{id:AQ,diagram:t}},"loader"),cDe={id:AQ,detector:oDe,loader:lDe},RQ="pie",uDe=x(t=>/^\s*pie/.test(t),"detector"),hDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>mit);return{diagram:e}},void 0);return{id:RQ,diagram:t}},"loader"),dDe={id:RQ,detector:uDe,loader:hDe},LQ="quadrantChart",fDe=x(t=>/^\s*quadrantChart/.test(t),"detector"),pDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Eit);return{diagram:e}},void 0);return{id:LQ,diagram:t}},"loader"),gDe={id:LQ,detector:fDe,loader:pDe},mDe=gDe,IQ="xychart",yDe=x(t=>/^\s*xychart(-beta)?/.test(t),"detector"),vDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Wit);return{diagram:e}},void 0);return{id:IQ,diagram:t}},"loader"),xDe={id:IQ,detector:yDe,loader:vDe},bDe=xDe,DQ="requirement",TDe=x(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),CDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Zit);return{diagram:e}},void 0);return{id:DQ,diagram:t}},"loader"),wDe={id:DQ,detector:TDe,loader:CDe},EDe=wDe,MQ="sequence",SDe=x(t=>/^\s*sequenceDiagram/.test(t),"detector"),kDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Hat);return{diagram:e}},void 0);return{id:MQ,diagram:t}},"loader"),_De={id:MQ,detector:SDe,loader:kDe},ADe=_De,NQ="class",RDe=x((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),LDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Qat);return{diagram:e}},void 0);return{id:NQ,diagram:t}},"loader"),IDe={id:NQ,detector:RDe,loader:LDe},DDe=IDe,OQ="classDiagram",MDe=x((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),NDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>est);return{diagram:e}},void 0);return{id:OQ,diagram:t}},"loader"),ODe={id:OQ,detector:MDe,loader:NDe},$De=ODe,$Q="state",PDe=x((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),BDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Wst);return{diagram:e}},void 0);return{id:$Q,diagram:t}},"loader"),FDe={id:$Q,detector:PDe,loader:BDe},zDe=FDe,PQ="stateDiagram",GDe=x((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),VDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ust);return{diagram:e}},void 0);return{id:PQ,diagram:t}},"loader"),WDe={id:PQ,detector:GDe,loader:VDe},qDe=WDe,BQ="journey",UDe=x(t=>/^\s*journey/.test(t),"detector"),HDe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>fot);return{diagram:e}},void 0);return{id:BQ,diagram:t}},"loader"),YDe={id:BQ,detector:UDe,loader:HDe},XDe=YDe,jDe=x((t,e,r)=>{he.debug(`rendering svg for syntax error `);const n=Yi(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Rn(n,100,512,!0),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),FQ={draw:jDe},KDe=FQ,ZDe={db:{},renderer:FQ,parser:{parse:x(()=>{},"parse")}},QDe=ZDe,zQ="flowchart-elk",JDe=x((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),eMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>F$);return{diagram:e}},void 0);return{id:zQ,diagram:t}},"loader"),tMe={id:zQ,detector:JDe,loader:eMe},rMe=tMe,GQ="timeline",nMe=x(t=>/^\s*timeline/.test(t),"detector"),iMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Vot);return{diagram:e}},void 0);return{id:GQ,diagram:t}},"loader"),aMe={id:GQ,detector:nMe,loader:iMe},sMe=aMe,VQ="mindmap",oMe=x(t=>/^\s*mindmap/.test(t),"detector"),lMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ilt);return{diagram:e}},void 0);return{id:VQ,diagram:t}},"loader"),cMe={id:VQ,detector:oMe,loader:lMe},uMe=cMe,WQ="kanban",hMe=x(t=>/^\s*kanban/.test(t),"detector"),dMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Elt);return{diagram:e}},void 0);return{id:WQ,diagram:t}},"loader"),fMe={id:WQ,detector:hMe,loader:dMe},pMe=fMe,qQ="sankey",gMe=x(t=>/^\s*sankey(-beta)?/.test(t),"detector"),mMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>cct);return{diagram:e}},void 0);return{id:qQ,diagram:t}},"loader"),yMe={id:qQ,detector:gMe,loader:mMe},vMe=yMe,UQ="packet",xMe=x(t=>/^\s*packet(-beta)?/.test(t),"detector"),bMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bct);return{diagram:e}},void 0);return{id:UQ,diagram:t}},"loader"),TMe={id:UQ,detector:xMe,loader:bMe},HQ="radar",CMe=x(t=>/^\s*radar-beta/.test(t),"detector"),wMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Gct);return{diagram:e}},void 0);return{id:HQ,diagram:t}},"loader"),EMe={id:HQ,detector:CMe,loader:wMe},YQ="block",SMe=x(t=>/^\s*block(-beta)?/.test(t),"detector"),kMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>mut);return{diagram:e}},void 0);return{id:YQ,diagram:t}},"loader"),_Me={id:YQ,detector:SMe,loader:kMe},AMe=_Me,XQ="treeView",RMe=x(t=>/^\s*treeView-beta/.test(t),"detector"),LMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>zut);return{diagram:e}},void 0);return{id:XQ,diagram:t}},"loader"),IMe={id:XQ,detector:RMe,loader:LMe},DMe=IMe,jQ="architecture",MMe=x(t=>/^\s*architecture/.test(t),"detector"),NMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>pht);return{diagram:e}},void 0);return{id:jQ,diagram:t}},"loader"),OMe={id:jQ,detector:MMe,loader:NMe},$Me=OMe,KQ="eventmodeling",PMe=x(t=>/^\s*eventmodeling/.test(t),"detector"),BMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Lht);return{diagram:e}},void 0);return{id:KQ,diagram:t}},"loader"),FMe={id:KQ,detector:PMe,loader:BMe},zMe=FMe,ZQ="ishikawa",GMe=x(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),VMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Yht);return{diagram:e}},void 0);return{id:ZQ,diagram:t}},"loader"),WMe={id:ZQ,detector:GMe,loader:VMe},QQ="venn",qMe=x(t=>/^\s*venn-beta/.test(t),"detector"),UMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ddt);return{diagram:e}},void 0);return{id:QQ,diagram:t}},"loader"),HMe={id:QQ,detector:qMe,loader:UMe},YMe=HMe,JQ="treemap",XMe=x(t=>/^\s*treemap/.test(t),"detector"),jMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Wdt);return{diagram:e}},void 0);return{id:JQ,diagram:t}},"loader"),KMe={id:JQ,detector:XMe,loader:jMe},eJ="wardley",ZMe=x(t=>/^\s*wardley-beta/i.test(t),"detector"),QMe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>tft);return{diagram:e}},void 0);return{id:eJ,diagram:t}},"loader"),JMe={id:eJ,detector:ZMe,loader:QMe},eNe=JMe,tJ="cynefin",tNe=x(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),rNe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vft);return{diagram:e}},void 0);return{id:tJ,diagram:t}},"loader"),nNe={id:tJ,detector:tNe,loader:rNe},rJ="railroad",iNe=x(t=>/^\s*railroad-beta/i.test(t),"detector"),aNe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Wft);return{diagram:e}},void 0);return{id:rJ,diagram:t}},"loader"),sNe={id:rJ,detector:iNe,loader:aNe},nJ="railroadEbnf",oNe=x(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),lNe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Qft);return{diagram:e}},void 0);return{id:nJ,diagram:t}},"loader"),cNe={id:nJ,detector:oNe,loader:lNe},iJ="railroadAbnf",uNe=x(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),hNe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>lpt);return{diagram:e}},void 0);return{id:iJ,diagram:t}},"loader"),dNe={id:iJ,detector:uNe,loader:hNe},aJ="railroadPeg",fNe=x(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),pNe=x(async()=>{const{diagram:t}=await Bt(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vpt);return{diagram:e}},void 0);return{id:aJ,diagram:t}},"loader"),gNe={id:aJ,detector:fNe,loader:pNe},q9=!1,ak=x(()=>{q9||(q9=!0,iw("error",QDe,t=>t.toLowerCase().trim()==="error"),iw("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{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:x(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),qI(rMe,uMe,$Me),qI($4e,pMe,$De,DDe,Q4e,sDe,cDe,dDe,EDe,ADe,X4e,q4e,z4e,sMe,rDe,qDe,zDe,XDe,mDe,vMe,TMe,bDe,AMe,zMe,DMe,EMe,WMe,KMe,sNe,cNe,dNe,gNe,YMe,eNe,nNe))},"addDiagrams"),mNe=x(async()=>{he.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(Fh).map(async([r,{detector:n,loader:i}])=>{if(i)try{jI(r)}catch{try{const{diagram:a,id:s}=await i();iw(s,a,n)}catch(a){throw he.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Fh[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){he.error(`Failed to load ${e.length} external diagrams`);for(const r of e)he.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),yNe="graphics-document document";function sJ(t,e){t.attr("role",yNe),e!==""&&t.attr("aria-roledescription",e)}x(sJ,"setA11yDiagramInfo");function oJ(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}x(oJ,"addSVGa11yTitleDescription");var Nh,F3=(Nh=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=It(),i=qM(e,n);e=KSe(e)+` `;try{jI(i)}catch{const d=Q1e(i);if(!d)throw new ZH(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();iw(f,p)}const{db:a,parser:s,renderer:o,init:l}=jI(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new Nh(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},x(Nh,"Diagram"),Nh),U9=[],vNe=x(()=>{U9.forEach(t=>{t()}),U9=[]},"attachFunctions"),xNe=x(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function lJ(t){const e=t.match(KH);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` `).map(s=>s.startsWith(r)?s.slice(r.length):s).join(` `):e[2];let i=rk(n,{schema:tk})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:t.slice(e[0].length),metadata:a}}x(lJ,"extractFrontMatter");var bNe=x(t=>t.replace(/\r\n?/g,` `).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),TNe=x(t=>{const{text:e,metadata:r}=lJ(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),CNe=x(t=>{const e=sr.detectInit(t)??{},r=sr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:zSe(t),directive:e}},"processDirectives");function DO(t){const e=bNe(t),r=TNe(e),n=CNe(r.text),i=fn(r.config,n.directive);return t=xNe(n.text),{code:t,title:r.title,config:i}}x(DO,"preprocessDiagram");function cJ(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(cJ,"toBase64");var wNe=5e4,ENe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",SNe="sandbox",kNe="loose",_Ne="http://www.w3.org/2000/svg",ANe="http://www.w3.org/1999/xlink",RNe="http://www.w3.org/1999/xhtml",LNe="100%",INe="100%",DNe="border:0;margin:0;",MNe="margin:0",NNe="allow-top-navigation-by-user-activation allow-popups",ONe='The "iframe" tag is not supported by your browser.',$Ne=["foreignobject"],PNe=["dominant-baseline"];function MO(t){const e=DO(t);return rw(),X1e(e.config??{}),e}x(MO,"processAndSetConfigs");async function uJ(t,e){ak();try{const{code:r,config:n}=MO(t);return{diagramType:(await dJ(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}x(uJ,"parse");var H9=x((t,e,r=[])=>{const n=qH(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),BNe=x((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=qi(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{K8(l.styles)||o.forEach(u=>{r.insertRule(H9(l.id,u,l.styles),r.cssRules.length)}),K8(l.textStyles)||r.insertRule(H9(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=YI(i)+` `}else n+=`${t.themeCSS} `;return n+YI(r)},"createCssStyles"),FNe=x((t,e)=>B3(R4e(`${t}{${e}}`),D4e([x(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===O3)return;n.props=n.props.map(o=>o===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(o.startsWith(`${t} `)||o.startsWith(`${t}>`))&&!o.startsWith(`${t} ||`)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[g4e,y4e,yQ,x4e,"@container","@starting-style"],O3].includes(n.type)||(he.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=LO))},"addNamespace"),I4e])),"compileCSS"),zNe=x((t,e,r,n)=>{const i=BNe(t,r),a=pxe(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return FNe(n,a)},"createUserStyles"),GNe=x((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=qc(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),VNe=x((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":INe,n=cJ(`${t}`);return``},"putIntoIFrame"),Y9=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",_Ne);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function z3(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(z3,"sandboxedIframe");var WNe=x((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),qNe=x(async function(t,e,r){var $,A,I,O,N,M;ak();const n=MO(e);e=n.code;const i=It();he.debug(i),e.length>((i==null?void 0:i.maxTextSize)??wNe)&&(e=ENe);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const F=ft(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=ft(document.body);const f=i.securityLevel===SNe,p=i.securityLevel===kNe,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const P=z3(ft(r),s);d=ft(P.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ft(r);Y9(d,t,l,`font-family: ${g}`,ANe)}else{if(WNe(document,t,l,s),f){const P=z3(ft(document.body),s);d=ft(P.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ft("body");Y9(d,t,l)}let m,y;try{m=await F3.fromText(e,{title:n.title})}catch(P){if(i.suppressErrorRendering)throw h(),P;m=await F3.fromText("error"),y=P}const v=d.select(u).node(),T=m.type,b=v.firstChild,C=b.firstChild,w=(A=($=m.renderer).getClasses)==null?void 0:A.call($,e,m),S=zNe(i,T,w,a),E=document.createElement("style");E.innerHTML=S,b.insertBefore(E,C);try{await m.renderer.draw(e,t,"11.17.2",m)}catch(P){throw i.suppressErrorRendering?h():KDe.draw(e,t,"11.17.2"),P}const _=d.select(`${u} svg`),R=(O=(I=m.db).getAccTitle)==null?void 0:O.call(I),D=(M=(N=m.db).getAccDescription)==null?void 0:M.call(N);fJ(T,_,R,D);const B=x(()=>{d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",RNe);let P=d.select(u).node().innerHTML;if(he.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),P=GNe(P,f,Ho(i.arrowMarkerAbsolute)),f){const F=d.select(u+" svg").node();P=VNe(P,F)}else p||(P=Dl.sanitize(P,{ADD_TAGS:$Ne,ADD_ATTR:PNe,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return vNe(),P},"serializeSvg")();if(y)throw y;return h(),{diagramType:T,svg:B,bindFunctions:m.db.bindFunctions}},"render");function hJ(t={}){var n;const e=Gn({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),H1e(e),e!=null&&e.theme&&e.theme in Ll?e.themeVariables=Ll[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Ll.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?U1e(e):UH();GM(r.logLevel),ak()}x(hJ,"initialize");var dJ=x((t,e={})=>{const{code:r}=DO(t);return F3.fromText(r,e)},"getDiagramFromText");function fJ(t,e,r,n){sJ(e,t),oJ(e,r,n,e.attr("id"))}x(fJ,"addA11yInfo");var Kh=Object.freeze({render:qNe,parse:uJ,getDiagramFromText:dJ,initialize:hJ,getConfig:It,setConfig:HH,getSiteConfig:UH,updateSiteConfig:Y1e,reset:x(()=>{rw()},"reset"),globalReset:x(()=>{rw(u0)},"globalReset"),defaultConfig:u0});GM(It().logLevel);rw(It());var UNe=x((t,e,r)=>{he.warn(t),kN(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),pJ=x(async function(t={querySelector:".mermaid"}){try{await HNe(t)}catch(e){if(kN(e)&&he.error(e.str),Qa.parseError&&Qa.parseError(e),!t.suppressErrors)throw he.error("Use the suppressErrors option to suppress these errors"),e}},"run"),HNe=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=Kh.getConfig();he.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");he.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(he.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),Kh.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new sr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(he.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=dj(sr.entityDecode(s)).trim().replace(//gi,"
    ");const h=sr.detectInit(s);h&&he.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await vJ(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){UNe(d,o,Qa.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),gJ=x(function(t){Kh.initialize(t)},"initialize"),YNe=x(async function(t,e,r){he.warn("mermaid.init is deprecated. Please use run instead."),t&&gJ(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await pJ(n)},"init"),XNe=x(async(t,{lazyLoad:e=!0}={})=>{ak(),qI(...t),e===!1&&await mNe()},"registerExternalDiagrams"),mJ=x(function(){if(Qa.startOnLoad){const{startOnLoad:t}=Kh.getConfig();t&&Qa.run().catch(e=>he.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",mJ,!1);var jNe=x(function(t){Qa.parseError=t},"setParseErrorHandler"),zw=[],cR=!1,yJ=x(async()=>{if(!cR){for(cR=!0;zw.length>0;){const t=zw.shift();if(t)try{await t()}catch(e){he.error("Error executing queue",e)}}cR=!1}},"executeQueue"),KNe=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{Kh.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;he.error("Error parsing",o),(l=Qa.parseError)==null||l.call(Qa,o),s(o),n(o)})}),"performCall");zw.push(i),yJ().catch(n)}),"parse"),vJ=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{Kh.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;he.error("Error parsing",l),(u=Qa.parseError)==null||u.call(Qa,l),o(l),i(l)})}),"performCall");zw.push(a),yJ().catch(i)}),"render"),ZNe=x(()=>Object.keys(Fh).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Qa={startOnLoad:!0,mermaidAPI:Kh,parse:KNe,render:vJ,init:YNe,run:pJ,registerExternalDiagrams:XNe,registerLayoutLoaders:pQ,initialize:gJ,parseError:void 0,contentLoaded:mJ,setParseErrorHandler:jNe,detectType:qM,registerIconPacks:gN,getRegisteredDiagramsMetadata:ZNe},QNe=Qa;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution */const ngt=Object.freeze(Object.defineProperty({__proto__:null,clearLayoutRenderState:uO,createCommonLayoutRenderer:JS,default:QNe,defaultMeasureLayout:hO,paintLayoutData:dO},Symbol.toStringTag,{value:"Module"}));var JNe=1;function NO(){if(!(typeof globalThis>"u"))return globalThis}x(NO,"getCaptureGlobal");function xJ(){var t;return!!((t=NO())!=null&&t.mermaidCaptureSizes)}x(xJ,"shouldCaptureSizes");function bJ(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}x(bJ,"capturedFromLocation");function TJ(t,e){const r=NO();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}x(TJ,"emitCapturedSizes");function CJ(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&TJ({metadata:{captureVersion:JNe,capturedAt:new Date().toISOString(),capturedFrom:bJ()},nodes:r},t)}x(CJ,"captureNodeSizes");const eOe=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:CJ,shouldCaptureSizes:xJ},Symbol.toStringTag,{value:"Module"}));class tOe{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return X9(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&X9(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,rOe)),n=n._prev;return"["+e.join(", ")+"]"}}function X9(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function rOe(t,e){if(t!=="_next"&&t!=="_prev")return e}var nOe=Wf(1);function iOe(t,e){if(t.nodeCount()<=1)return[];var r=sOe(t,e||nOe),n=aOe(r.graph,r.buckets,r.zeroIdx);return ov(ci(n,function(i){return t.outEdges(i.v,i.w)}))}function aOe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)uR(t,e,r,s);for(;s=i.dequeue();)uR(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(uR(t,e,r,s,!0));break}}}return n}function uR(t,e,r,n,i){var a=i?[]:void 0;return lt(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,G3(e,r,l)}),lt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,G3(e,r,u)}),t.removeNode(n.v),a}function sOe(t,e){var r=new ma,n=0,i=0;lt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),lt(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=E0(i+n+3).map(function(){return new tOe}),s=n+1;return lt(r.nodes(),function(o){G3(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function G3(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function oOe(t){var e=t.graph().acyclicer==="greedy"?iOe(t,r(t)):lOe(t);lt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,sO("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function lOe(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,lt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return lt(t.nodes(),i),e}function cOe(t){lt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function dv(t,e,r,n){var i;do i=sO(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function uOe(t){var e=new ma().setGraph(t.graph());return lt(t.nodes(),function(r){e.setNode(r,t.node(r))}),lt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function wJ(t){var e=new ma({multigraph:t.isMultigraph()}).setGraph(t.graph());return lt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),lt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function j9(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function sk(t){var e=ci(E0(EJ(t)+1),function(){return[]});return lt(t.nodes(),function(r){var n=t.node(r),i=n.rank;Vi(i)||(e[i][n.order]=r)}),e}function hOe(t){var e=$x(ci(t.nodes(),function(r){return t.node(r).rank}));lt(t.nodes(),function(r){var n=t.node(r);HZ(n,"rank")&&(n.rank-=e)})}function dOe(t){var e=$x(ci(t.nodes(),function(a){return t.node(a).rank})),r=[];lt(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;lt(r,function(a,s){Vi(a)&&s%i!==0?--n:n&<(a,function(o){t.node(o).rank+=n})})}function K9(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),dv(t,"border",i,e)}function EJ(t){return jh(ci(t.nodes(),function(e){var r=t.node(e).rank;if(!Vi(r))return r}))}function fOe(t,e){var r={lhs:[],rhs:[]};return lt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function pOe(t,e){return e()}function gOe(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&<(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=Sl(e.edges(),function(h){return l===J9(t,t.node(h.v),o)&&l!==J9(t,t.node(h.w),o)});return aO(u,function(h){return zx(e,h)})}function MJ(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),PO(t),$O(t,e),LOe(t,e)}function LOe(t,e){var r=nO(t.nodes(),function(i){return!e.node(i).parent}),n=AOe(t,r);n=n.slice(1),lt(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function IOe(t,e,r){return t.hasEdge(e,r)}function J9(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function DOe(t){switch(t.graph().ranker){case"network-simplex":ez(t);break;case"tight-tree":NOe(t);break;case"longest-path":MOe(t);break;default:ez(t)}}var MOe=OO;function NOe(t){OO(t),kJ(t)}function ez(t){vd(t)}function OOe(t){var e=dv(t,"root",{},"_root"),r=$Oe(t),n=jh(Il(r))-1,i=2*n+1;t.graph().nestingRoot=e,lt(t.edges(),function(s){t.edge(s).minlen*=i});var a=POe(t)+1;lt(t.children(),function(s){NJ(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function NJ(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=K9(t,"_bt"),u=K9(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,lt(o,function(d){NJ(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function $Oe(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&<(a,function(s){r(s,i+1)}),e[n]=i}return lt(t.children(),function(n){r(n,1)}),e}function POe(t){return Bb(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function BOe(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,lt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function FOe(t,e,r){var n={},i;lt(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function zOe(t,e,r){var n=GOe(t),i=new ma({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return lt(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),lt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Vi(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function GOe(t){for(var e;t.hasNode(e=sO("_root")););return e}function VOe(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function qOe(t){var e={},r=Sl(t.nodes(),function(o){return!t.children(o).length}),n=jh(ci(r,function(o){return t.node(o).rank})),i=ci(E0(n+1),function(){return[]});function a(o){if(!HZ(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),lt(t.successors(o),a)}}var s=Fb(r,function(o){return t.node(o).rank});return lt(s,a),i}function UOe(t,e){return ci(e,function(r){var n=t.inEdges(r);if(n.length){var i=Bb(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function HOe(t,e){var r={};lt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Vi(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),lt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Vi(a)&&!Vi(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=Sl(r,function(i){return!i.indegree});return YOe(n)}function YOe(t){var e=[];function r(a){return function(s){s.merged||(Vi(s.barycenter)||Vi(a.barycenter)||s.barycenter>=a.barycenter)&&XOe(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),lt(i.in.reverse(),r(i)),lt(i.out,n(i))}return ci(Sl(e,function(a){return!a.merged}),function(a){return Fw(a,["vs","i","barycenter","weight"])})}function XOe(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function jOe(t,e){var r=fOe(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Fb(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(KOe(!!e)),l=tz(a,i,l),lt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=tz(a,i,l)});var u={vs:ov(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function tz(t,e,r){for(var n;e.length&&(n=Bw(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function KOe(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function OJ(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=Sl(i,function(g){return g!==s&&g!==o}));var u=UOe(t,i);lt(u,function(g){if(t.children(g.v).length){var m=OJ(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&QOe(g,m)}});var h=HOe(u,r);ZOe(h,l);var d=jOe(h,n);if(s&&(d.vs=ov([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function ZOe(t,e){lt(t,function(r){r.vs=ov(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function QOe(t,e){Vi(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function JOe(t){var e=EJ(t),r=rz(t,E0(1,e+1),"inEdges"),n=rz(t,E0(e-1,-1,-1),"outEdges"),i=qOe(t);nz(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){e$e(o%2?r:n,o%4>=2),i=sk(t);var u=VOe(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function n$e(t){var e={},r=0;function n(i){var a=r;lt(t.children(i),n),e[i]={low:a,lim:r++}}return lt(t.children(),n),e}function i$e(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=Bw(a);return lt(a,function(h,d){var f=s$e(t,h),p=f?t.node(f).order:l;(f||h===u)&&(lt(a.slice(o,d+1),function(g){lt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&$J(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return lt(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return Bb(e,i),r}function s$e(t,e){if(t.node(e).dummy)return nO(t.predecessors(e),function(r){return t.node(r).dummy})}function $J(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function o$e(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function l$e(t,e,r,n){var i={},a={},s={};return lt(e,function(o){lt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),lt(e,function(o){var l=-1;lt(o,function(u){var h=n(u);if(h.length){h=Fb(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>R$e(t));r(" runLayout",()=>x$e(n,r)),r(" updateInputGraph",()=>b$e(t,n))})}function x$e(t,e){e(" makeSpaceForEdgeLabels",()=>L$e(t)),e(" removeSelfEdges",()=>F$e(t)),e(" acyclic",()=>oOe(t)),e(" nestingGraph.run",()=>OOe(t)),e(" rank",()=>DOe(wJ(t))),e(" injectEdgeLabelProxies",()=>I$e(t)),e(" removeEmptyRanks",()=>dOe(t)),e(" nestingGraph.cleanup",()=>BOe(t)),e(" normalizeRanks",()=>hOe(t)),e(" assignRankMinMax",()=>D$e(t)),e(" removeEdgeLabelProxies",()=>M$e(t)),e(" normalize.run",()=>bOe(t)),e(" parentDummyChains",()=>t$e(t)),e(" addBorderSegments",()=>gOe(t)),e(" order",()=>JOe(t)),e(" insertSelfEdges",()=>z$e(t)),e(" adjustCoordinateSystem",()=>mOe(t)),e(" position",()=>y$e(t)),e(" positionSelfEdges",()=>G$e(t)),e(" removeBorderNodes",()=>B$e(t)),e(" normalize.undo",()=>COe(t)),e(" fixupEdgeLabelCoords",()=>$$e(t)),e(" undoCoordinateSystem",()=>yOe(t)),e(" translateGraph",()=>N$e(t)),e(" assignNodeIntersects",()=>O$e(t)),e(" reversePoints",()=>P$e(t)),e(" acyclic.undo",()=>cOe(t))}function b$e(t,e){lt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),lt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var T$e=["nodesep","edgesep","ranksep","marginx","marginy"],C$e={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w$e=["acyclicer","ranker","rankdir","align"],E$e=["width","height"],S$e={width:0,height:0},k$e=["minlen","weight","width","height","labeloffset"],_$e={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A$e=["labelpos"];function R$e(t){var e=new ma({multigraph:!0,compound:!0}),r=pR(t.graph());return e.setGraph(M3({},C$e,fR(r,T$e),Fw(r,w$e))),lt(t.nodes(),function(n){var i=pR(t.node(n));e.setNode(n,b5e(fR(i,E$e),S$e)),e.setParent(n,t.parent(n))}),lt(t.edges(),function(n){var i=pR(t.edge(n));e.setEdge(n,M3({},_$e,fR(i,k$e),Fw(i,A$e)))}),e}function L$e(t){var e=t.graph();e.ranksep/=2,lt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function I$e(t){lt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};dv(t,"edge-proxy",a,"_ep")}})}function D$e(t){var e=0;lt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=jh(e,n.maxRank))}),t.graph().maxRank=e}function M$e(t){lt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function N$e(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}lt(t.nodes(),function(u){l(t.node(u))}),lt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,lt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),lt(t.edges(),function(u){var h=t.edge(u);lt(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function O$e(t){lt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(j9(n,a)),r.points.push(j9(i,s))})}function $$e(t){lt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function P$e(t){lt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function B$e(t){lt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(Bw(r.borderLeft)),s=t.node(Bw(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),lt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function F$e(t){lt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function z$e(t){var e=sk(t);lt(e,function(r){var n=0;lt(r,function(i,a){var s=t.node(i);s.order=a+n,lt(s.selfEdges,function(o){dv(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function G$e(t){lt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function fR(t,e){return QS(Fw(t,e),Number)}function pR(t){var e={};return lt(t,function(r,n){e[n.toLowerCase()]=r}),e}var iz=x((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),az=x((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V$e=x(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),W$e=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],q$e=x((t,e,r,n,i)=>{const a=[],s=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&s.add(h),d!==n&&s.add(d)}),s.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)}),a.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)})}),a.length===0)return az(i);const o=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":az(i)},"getSelfLoopSide"),U$e=x((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,s=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=iz(Math.max(n,t.width*.35),36,l),h=iz(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+s;return[{x:d,y:a-u/2},{x:d+h,y:a-u/2},{x:d+h,y:a+u/2},{x:d,y:a+u/2}]}case"left":{const d=i-s;return[{x:d,y:a-u/2},{x:d-h,y:a-u/2},{x:d-h,y:a+u/2},{x:d,y:a+u/2}]}case"top":default:{const d=a-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),H$e=x((t,e,r="top",n=0,i={})=>{const s=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:s,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:s,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),BO=x((t,e=0,{mergeSelfLoops:r=!0}={})=>{var s;const n=new Map,i=[],a=(s=t.graph())==null?void 0:s.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,b)=>T.edge.selfLoop.order-b.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(T=>i.push(T));return}const p={width:u.edge.width,height:u.edge.height},g=q$e(t,f,o,d.start,a),m=U$e(f,g,e,p.width??0),y=H$e(f,m,g,e,p),v={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),BJ=x(async({element:t,graph:e,diagramType:r,id:n,parentCluster:i,siteConfig:a})=>{const s=e.graph().rankdir;he.trace("Dir in recursive render - dir:",s);const{clusters:o,edgePaths:l,edgeLabels:u,nodes:h,rootGroups:d}=oO(t,{edgePathsClass:"edgePaths"});e.nodes()?he.info("Recursive render XXX",e.nodes()):he.info("No nodes found for",e),e.edges().length>0&&he.info("Recursive edges",e.edge(e.edges()[0]));const f=V$e(r);await Promise.all(e.nodes().map(async function(m){const y=e.node(m);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));he.trace(`Setting data for parent cluster XXX Node.id = `,m,` data=`,v.height,` Parent cluster`,i.height),e.setNode(i.id,v),e.parent(m)||(he.trace("Setting parent",m,i.id),e.setParent(m,i.id,v))}if(he.info("(Insert) Node XXX"+m+": "+JSON.stringify(e.node(m))),y!=null&&y.clusterNode){he.info("Cluster identified XBX",m,y.width,e.node(m));const{ranksep:v,nodesep:T}=e.graph();y.graph.setGraph({...y.graph.graph(),ranksep:v+25,nodesep:T});const b=await K$e({element:h,graph:y.graph,diagramType:r,id:n,parentCluster:e.node(m),siteConfig:a}),C=b.elem;_t(y,C),y.diff=b.diff||0,he.info("New compound node after recursive render XAX",m,"width",y.width,"height",y.height),$_e(C,y)}else e.children(m).length>0?(he.trace("Cluster - the non recursive path XBX",m,y.id,y,y.width,"Graph:",e),he.trace(S0(y.id,e)),lr.set(y.id,{id:S0(y.id,e),node:y})):(he.trace("Node - the non recursive path XAX",m,h,e.node(m),s),await lO(h,e.node(m),{config:a,dir:s}))})),await x(async()=>{const m=e.edges().map(async function(y){var T,b,C,w;const v=e.edge(y.v,y.w,y.name);if(he.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(y)),he.info("Edge "+y.v+" -> "+y.w+": ",y," ",JSON.stringify(e.edge(y))),he.info("Fix",lr,"ids:",y.v,y.w,"Translating: ",lr.get(y.v),lr.get(y.w)),f&&v.selfLoop){if(v.selfLoop.order!==1)return;const S={...v.originalEdge,...v,id:v.selfLoop.id,startLabelLeft:((T=v.originalEdge)==null?void 0:T.startLabelLeft)??v.startLabelLeft,startLabelRight:((b=v.originalEdge)==null?void 0:b.startLabelRight)??v.startLabelRight,endLabelLeft:((C=v.originalEdge)==null?void 0:C.endLabelLeft)??v.endLabelLeft,endLabelRight:((w=v.originalEdge)==null?void 0:w.endLabelRight)??v.endLabelRight};await b0(u,S),v.width=S.width,v.height=S.height,v.labelStyle=S.labelStyle;return}await b0(u,v)});await Promise.all(m)},"processEdges")();const{subGraphTitleTotalMargin:g}=$b(a);return{elem:d,graph:e,groups:{clusters:o,edgePaths:l,edgeLabels:u,nodes:h,rootGroups:d},diagramType:r,id:n,mergeSelfLoops:f,subGraphTitleTotalMargin:g}},"measureDagreGraph"),FJ=x(t=>{he.info("############################################# XXX"),he.info("### Layout ### XXX"),he.info("############################################# XXX"),PJ(t)},"runDagreGraphLayout"),Y$e=x((t,e,r)=>{const n=t.node(e);if(!n)return;const i={...n};return n!=null&&n.clusterNode?i.y=(n.y??0)+r:t.children(e).length>0?i.height=(n.height??0)+r:i.y=(n.y??0)+r/2,i},"normalizeDagreNode"),sz=x((t,e)=>{W$e.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),X$e=x((t,e,r,n)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(i=>({...i,y:typeof i.y=="number"?i.y+n:i.y}))}),"normalizeDagreEdge"),zJ=x((t,e)=>{const{graph:r,mergeSelfLoops:n,subGraphTitleTotalMargin:i=0}=e,a=new Map(t.nodes.map(o=>[o.id,o]));cO(r).forEach(o=>{const l=Y$e(r,o,i);if(!l)return;sz(r.node(o),l);const u=a.get(o);u&&sz(u,l)});const s=i/2;return t.edges=BO(r,s,{mergeSelfLoops:n}).map(({edge:o,start:l,end:u})=>X$e(o,l,u,s)),t},"applyDagreLayoutResult"),j$e=x(async({elem:t,graph:e,groups:{clusters:r,edgePaths:n},diagramType:i,id:a,mergeSelfLoops:s,subGraphTitleTotalMargin:o})=>{let l=0;await Promise.all(cO(e).map(async function(d){var p;const f=e.node(d);if(he.info("Position XBX => "+d+": ("+f.x,","+f.y,") width: ",f.width," height: ",f.height),f!=null&&f.clusterNode)f.y+=o,he.info("A tainted cluster node XBX1",d,f.id,f.width,f.height,f.x,f.y,e.parent(d)),lr.get(f.id).node=f,v0(f);else if(e.children(d).length>0){he.info("A pure cluster node XBX1",d,f.id,f.x,f.y,f.width,f.height,e.parent(d)),f.height+=o,e.node(f.parentId);const g=(f==null?void 0:f.padding)/2||0,m=((p=f==null?void 0:f.labelBBox)==null?void 0:p.height)||0,y=m-g||0;he.debug("OffsetY",y,"labelHeight",m,"halfPadding",g),await PS(r,f),lr.get(f.id).node=f}else{const g=e.node(f.parentId);f.y+=o/2,he.info("A regular node XBX1 - using the padding",f.id,"parent",f.parentId,f.width,f.height,f.x,f.y,"offsetY",f.offsetY,"parent",g,g==null?void 0:g.offsetY,f),v0(f)}}));const u=o/2;return BO(e,u,{mergeSelfLoops:s}).forEach(function({edge:d,start:f,end:p}){he.info("Edge "+f+" -> "+p+": "+JSON.stringify(d),d),d.points.forEach(v=>v.y+=u);const g=e.node(f),m=e.node(p),y=BS(n,d,lr,i,g,m,a);UN(d,y)}),e.nodes().forEach(function(d){const f=e.node(d);he.info(d,f.type,f.diff),f.isGroup&&(l=f.diff)}),he.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),K$e=x(async t=>{const e=await BJ(t);return FJ(e.graph),await j$e(e)},"renderDagreSubgraph"),FO=x(t=>{var r,n,i,a,s,o;const e=new ma({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((r=t.config)==null?void 0:r.nodeSpacing)||t.nodeSpacing||((i=(n=t.config)==null?void 0:n.flowchart)==null?void 0:i.nodeSpacing),ranksep:((a=t.config)==null?void 0:a.rankSpacing)||t.rankSpacing||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.rankSpacing),marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(l=>{e.setNode(l.id,{...l}),l.parentId&&e.setParent(l.id,l.parentId)}),he.debug("Edges:",t.edges),t.edges.forEach(l=>{if(l.start===l.end){const u=l.start,h=u+"---"+u+"---1",d=u+"---"+u+"---2",f=e.node(u);e.setNode(h,{domId:h,id:h,parentId:f.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(h,f.parentId),e.setNode(d,{domId:d,id:d,parentId:f.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(d,f.parentId);const p=structuredClone(l),g=structuredClone(l),m=structuredClone(l),y=structuredClone(l);g.originalEdge=p,g.selfLoop={id:p.id,order:0},m.originalEdge=p,m.selfLoop={id:p.id,order:1},y.originalEdge=p,y.selfLoop={id:p.id,order:2},g.label="",g.arrowTypeEnd="none",g.endLabelLeft="",g.endLabelRight="",g.startLabelLeft="",g.id=u+"-cyclic-special-1",m.startLabelRight="",m.startLabelLeft="",m.endLabelLeft="",m.endLabelRight="",m.arrowTypeStart="none",m.arrowTypeEnd="none",m.id=u+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",f.isGroup&&(g.fromCluster=u,y.toCluster=u),y.id=u+"-cyclic-special-2",y.arrowTypeStart="none",e.setEdge(u,h,g,u+"-cyclic-special-0"),e.setEdge(h,d,m,u+"-cyclic-special-1"),e.setEdge(d,u,y,u+"-cyclic-special-2")}else e.setEdge(l.start,l.end,{...l},l.id)}),c4e(e),{graph:e}},"prepareLayoutForDagre"),GJ=x(async(t,{element:e,preparedLayout:r})=>{const n=r??FO(t),i=Pe(),a=await BJ({element:e,graph:n.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:i});return n.measuredLayout=a,a},"measureDagreLayout"),VJ=x((t,e)=>{var n;const r=(n=e.preparedLayout)==null?void 0:n.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return FJ(r.graph),zJ(t,r),r},"runDagreLayoutCore"),Z$e=x((t,{measure:e})=>cO(e.graph).map(r=>e.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),Q$e=x((t,e,{measure:r})=>t?r.graph.node(t):void 0,"getDagreEdgeNode"),J$e=JS({prepareLayout:FO,measureLayout:GJ,runLayoutCore:VJ,paintOptions:{clusterDb:lr,getNodes:Z$e,getEdgeNode:Q$e,skipNode:x((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:x((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});const ePe=Object.freeze(Object.defineProperty({__proto__:null,applyDagreLayoutResult:zJ,getEdgesToRender:BO,measureDagreLayout:GJ,prepareLayoutForDagre:FO,render:J$e,runDagreLayoutCore:VJ},Symbol.toStringTag,{value:"Module"}));var oz=5,qT=1e-5,UT=1e-6;function Gw(t){const e=[];for(let r=0;r=1-UT||f<=UT||f>=1-UT?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}x(WJ,"segmentIntersection");function V3(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}x(V3,"isHorizontalSeg");function qJ(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}x(UJ,"getArcSweepFlag");var tPe=.001;function HJ(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&ai[e.arrowTypeStart];if(n){const a=t[0],s=t[1],o=Math.atan2(s.y-a.y,s.x-a.x);r[0].x=a.x+n*Math.cos(o),r[0].y=a.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&ai[e.arrowTypeEnd];if(i){const a=t.length,s=t[a-2],o=t[a-1],l=Math.atan2(o.y-s.y,o.x-s.x);r[a-1].x=o.x-i*Math.cos(l),r[a-1].y=o.y-i*Math.sin(l)}return r}x(HJ,"applyMarkerOffsets");function YJ(t,e,r,n,i){const a=t.point.x,s=t.point.y,o={x:a-e*t.r,y:s-r*t.r},l={x:a+e*t.r,y:s+r*t.r},u=[`L${hp(o)}`];return i==="arc"?u.push(`A${Vs(t.r)},${Vs(t.r)} 0 0 ${n} ${hp(l)}`):u.push(`M${hp(l)}`),u}x(YJ,"emitJump");function W3(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(s,o);if(l0){const b=W3(i[u-1],i[u],i[u+1]??i[u],oz);b&&(m=b.cutLen)}let y=d,v=null;a&&ub.t-C.t);for(const b of T)b.r=Math.min(b.r,b.d-m,y-b.d);for(let b=0;bC){const w=C/2;T[b].r=Math.min(T[b].r,w),T[b+1].r=Math.min(T[b+1].r,w)}}for(const b of T)b.r=2?n:null}catch{return null}}x(ZJ,"decodeDataPoints");function QJ(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const a=[],s=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;s.set(u.id,d);const p=ZJ(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=qJ(a);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of a){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!KJ(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!jJ(b))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),y=m?Number.parseFloat(m[1]):null,v=m?Number.parseFloat(m[2]):null,T=XJ(u,h,r);if(p.setAttribute("d",T),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const b=p.getTotalLength(),C=Math.max(0,b-y-v),w=`0 ${y} ${C} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${w};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}x(QJ,"applyLineJumpsToSvg");function JJ(t,{measure:e}){var a,s;const r=(s=(a=t.config)==null?void 0:a.swimlane)==null?void 0:s.lineHops;if(r===!1)return;const n=r==="gap"?"gap":"arc",i=t.edges.filter(o=>Array.isArray(o.points)&&o.points.length>=2).map(o=>({id:o.id,points:o.points,curve:o.curve,arrowTypeStart:o.arrowTypeStart,arrowTypeEnd:o.arrowTypeEnd}));QJ(e.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:n})}x(JJ,"applySwimlaneLineJumps");var gR="__swimlane_default__",rPe=21,lz=20;function q3(t){return Math.max(t.padding??lz,lz)}x(q3,"topLaneHorizontalPadding");function eee(t){const{x:e,y:r,width:n,height:i}=t,a=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete t.groupTitleRect;return}const s=r-i/2,o=Math.min(a,r+i/2),l=Math.min(rPe,Math.max(0,o-s)),u=s+l;if(u<=s){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:s,bottom:u}}x(eee,"assignTopLaneTitleRect");function tee(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const a of t.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",e&&(a.direction=e));const n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===gR);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:gR,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=gR}x(tee,"prepareLayoutForSwimlanes");function ree(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:t,nodeById:e}}x(ree,"toGraphView");function nee(t,e,r,n){const{layout:i}=t,a=t.nodeById,s=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=a.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const y=r.x[g]??p*o,v=r.y[g]??l*s;m.x=y,m.y=v,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(T=>T.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const T of p){const b=T.x??r.x[T.id],C=T.y??r.y[T.id],w=T.width??0,S=T.height??0;b!=null&&C!=null&&(g=Math.min(g,b-w/2),m=Math.max(m,b+w/2),y=Math.min(y,C-S/2),v=Math.max(v,C+S/2))}if(g===1/0||y===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const T=f.padding??20,b=f.parentId?T:2*q3(f),C=T,w=Math.max(0,m-g)+b,S=Math.max(0,v-y)+C,E=(g+m)/2,_=(y+v)/2;f.x=E,f.y=_,f.width=w,f.height=S,h.set(f.id,{minX:g,maxX:m,minY:y,maxY:v})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const y=m.padding??20;y>g&&(g=y);const v=h.get(m.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),v=Math.max(g,36),T=m+2*v,b=(f+p)/2;for(const R of d)R.y=b,R.height=T,R.swimlaneContentTop=f;const C=[...d].sort((R,D)=>{const L=R.x??0,B=D.x??0;return L-B}),w=[],S=[],E=[];for(const R of C){const D=h.get(R.id);if(!D)continue;const L=Math.max(0,D.maxX-D.minX)+2*q3(R),B=(D.minX+D.maxX)/2;w.push(R.id),S.push(B),E.push(L)}const _=w.length;if(_>0){const R=new Map;if(_===1)R.set(w[0],E[0]);else{const D=[];for(let I=0;I<_-1;I++)D.push(S[I+1]-S[I]);const L=new Array(_);L[0]=0;for(let I=0;I<_-1;I++)L[I+1]=2*D[I]-L[I];let B=0,$=Number.POSITIVE_INFINITY;for(let I=0;I<_;I++){const O=E[I];I%2===0?B=Math.max(B,O-L[I]):$=Math.min($,L[I]-O)}let A=B;B<=$?A=(B+$)/2:A=B;for(let I=0;I<_;I++){const O=L[I]+(I%2===0?A:-A),N=Math.max(E[I],O);R.set(w[I],N)}}for(const D of d){const L=R.get(D.id);L!=null&&(D.width=L),eee(D)}}}}}x(nee,"writeBackToLayoutData");var nPe="[EdgeLabelNodes]";function iee(t){const e=[],r=[],n=new Map;for(const s of t.nodes)n.set(s.id,s);for(const s of t.edges){if(!s.label||s.label.length===0||s.isLayoutOnly||s.labelNodeId)continue;const o=s.start?n.get(s.start):void 0,l=s.end?n.get(s.end):void 0;if(!o||!l){he.warn(nPe,`Edge ${s.id} has missing source or target node`);continue}const u=`edge-label-${s.start}-${s.end}-${s.id}`,d=o.parentId!==l.parentId?l.parentId:o.parentId,f={id:u,label:s.label,edgeStart:s.start??"",edgeEnd:s.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:d,isGroup:!1,labelStyle:Array.isArray(s.labelStyle)?s.labelStyle[0]:s.labelStyle??"",...o.dir?{dir:o.dir}:{}};e.push(f),s.labelNodeId=u,s.label=void 0,s.text=void 0;const p={id:`${s.id}-to-label`,start:s.start,end:u,type:"normal",isLayoutOnly:!0},g={id:`${s.id}-from-label`,start:u,end:s.end,type:"normal",isLayoutOnly:!0};r.push(p,g)}const i=[...t.nodes,...e],a=[...t.edges,...r];return{...t,nodes:i,edges:a}}x(iee,"createEdgeLabelNodes");var fi=.001;function zO(t){const e=t.x??0,r=t.y??0,n=t.width??0,i=t.height??0;return n>0&&i>0?{cx:e,cy:r,rect:dp(e,r,n,i)}:void 0}x(zO,"measuredNodeRect");function GO(t){if(t.isGroup)return;const e=zO(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}x(GO,"nodeBoundsInfoFor");function Cs(t,e,r=fi){return Math.abs(t.x-e.x)r}x(Sn,"isHorizontalSegment");function kn(t,e,r=fi){return br(t,e,r)&&Math.abs(t.y-e.y)>r}x(kn,"isVerticalSegment");function ca(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}x(ca,"overlapLength");function Oo(t,e,r=fi){return t.horizontal&&e.horizontal&&Er(t.a,e.a,r)?ca(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&br(t.a,e.a,r)?ca(t.a.y,t.b.y,e.a.y,e.b.y):0}x(Oo,"sameAxisSegmentOverlapLength");function A0(t,e=fi){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Cs(i,n,e))&&r.push({x:n.x,y:n.y})}return r}x(Lr,"dedupeConsecutivePoints");function VO(t,e=fi){if(!t||t.length!==4)return;const[r,n,i,a]=t;return Sn(r,n,e)&&kn(n,i,e)&&Sn(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:kn(r,n,e)&&Sn(n,i,e)&&kn(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}x(VO,"classifyThreeSegmentRoute");function ok(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&se.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}x(aee,"rectContainsRect");function Vw(t,e){return t.lefte.left&&t.tope.top}x(Vw,"rectsOverlap");function U3(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}x(U3,"inflateRect");function dp(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}x(dp,"rectFromCenterSize");function Fa(t){var e;return(e=zO(t))==null?void 0:e.rect}x(Fa,"rectOfNodeBounds");function wh(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}x(wh,"portForRectSide");function qO(t,e,r,n,i,a=fi){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Er(t,r,a))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(Er(t,r,a))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!s&&!o){if(e===n){if(br(t,r,a))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.yr.y))return;if(br(t,r,a))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(s&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}x(qO,"buildOrthogonalPortPath");function UO(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}x(UO,"buildSameSideTrackPath");function lk(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=GO(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}x(lk,"collectRealNodeBounds");function ou(t){const e=[],r=[];for(const n of t){const i=GO(n);if(!i)continue;const a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):e.push(a)}return{realNodeRects:e,labelNodeRects:r}}x(ou,"collectNodeRectEntries");function see(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,a=n.y??0,s=n.width??0,o=n.height??0;r.push({nodeId:n.id,...dp(i,a,s,o)})}return r}x(see,"collectLayoutNodeRects");function HO(t,e,r=fi){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),s=e.get(i);if(!(!a||!s))return{srcId:n,dstId:i,srcInfo:a,dstInfo:s,collinearX:Math.abs(a.cx-s.cx)g||fv)return!1;const T=Math.abs(m-h.a.x)i:a&&o&&Er(t,r,i)?ca(t.x,e.x,r.x,n.x)>i:!1}x(oee,"sameAxisSegmentsOverlap");function Ww(t,e,r,n,{epsilon:i=fi,skipDegenerateOther:a=!1}={}){for(const s of r){if(s===n||s.isLayoutOnly)continue;const o=s.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+fi&&t=2?e[e.length-2]:void 0,l=(s?br(s,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};e.push(l)}e.push(a)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!Cs(i,n))&&r.push(n)}return r}x(qw,"orthogonalizePolyline");function Fo(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=cee(e);if(e=n.points,!n.changed)break}return e}x(Fo,"simplifyPolyline");var Kt=.001,iPe=.5,cz=4;function XO(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const a=i-n;if(a<0||a>=t.length)return t;const s=uee(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}x(Y3,"clipEndpoint");function hee(t,e){for(const r of t){const n=XO(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=Y3(i,n.srcRect,!0)),n.dstRect&&(i=Y3(i,n.dstRect,!1)),i=Fo(qw(i)),i=jO(i,n.srcRect,n.dstRect),n.edge.points=Fo(qw(i))}}x(hee,"clipEdgeEndpointsToNodeBoundaries");function X3(t,e,r,n=!1){if(Er(t,e,Kt)){if(e.yr.bottom+Kt)return e;if(n){if(t.xr.right+Kt)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(br(t,e,Kt)){if(e.xr.right+Kt)return e;if(n){if(t.yr.bottom+Kt)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}x(X3,"snapEndpointToBoundary");function Uw(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}x(dee,"intersectRanges");function K3(t,e){return e==="left"||e==="right"?Hw(t.top,t.bottom):Hw(t.left,t.right)}x(K3,"clearanceRangeForSide");function Yw(t,e,r){const n=t.y>=r.top-Kt&&t.y<=r.bottom+Kt,i=t.x>=r.left-Kt&&t.x<=r.right+Kt;if(Er(t,e,Kt)&&n){if(Math.abs(t.x-r.left)0?dee(a):void 0}x(fee,"straightClearanceRange");function Z3(t,e,r,n,i){const a=fee(t,e,r,n,i);if(!a)return;const s=i?t.y:t.x,o=Math.min(a.hi,Math.max(a.lo,s));if(!(Math.abs(o-s)({...o}));for(let o=e;o>=0&&o=r.left-Kt&&Math.max(t.x,e.x)<=r.right+Kt,i=Math.min(t.y,e.y)>=r.top-Kt&&Math.max(t.y,e.y)<=r.bottom+Kt;if(Math.abs(t.y-r.top)n.bottom+Kt;case"left":return Er(e,r,Kt)&&r.xn.right+Kt}}x(e5,"leavesOutward");function t5(t,e,r){if(t.length<3)return t;if(r){const a=J3(t[0],t[1],e);return a&&e5(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=J3(t[n-1],t[n],e);return i&&e5(i,t[n-1],t[n-2],e)?t.slice(0,n):t}x(t5,"collapseOwnBorderStub");function mee(t,e,r){let n=t;if(e){const a=Uw(n,0,1);if(a){const s=X3(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=t5(n,e,!0)}if(r){const a=n.length-1,s=Uw(n,a,-1);if(s){const o=X3(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=t5(n,r,!1)}const i=jO(n,e,r);return i!==n||n.length===2?i:(e&&(n=Q3(n,e,!0)),r&&(n=Q3(n,r,!1)),n)}x(mee,"snapAndCollapseEndpoints");function r5(t,e){for(const r of t){const n=XO(r,e,2);if(!n)continue;const i=Lr(n.points,Kt),a=mee(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const s=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=s}}x(r5,"prepareEdgeEndpointsForRenderer");function KO(t){return new Map(t.map(e=>[e.id,e]))}x(KO,"buildNodeMap");function yee(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}x(yee,"resolveTopLevelGroupId");function n5(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}x(n5,"groupDepth");function ZO(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const s=a.x,o=a.y;if(typeof s!="number"||typeof o!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,s-l/2),r=Math.max(r,s+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}x(ZO,"boundsForChildren");function vee(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}x(vee,"applyGroupBounds");function xee(t){const e=KO(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>n5(i,e)-n5(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=ZO(i);a&&vee(n,a)}}x(xee,"recomputeNestedGroupBounds");function Xw(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,s=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),s=Math.max(s,u))}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=x(l=>a+s-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}x(Xw,"mirrorAxis");function bee(t){return(t.nodes??[]).some(r=>!r.isGroup)?Xw(t,"y"):!0}x(bee,"applyBtDirectionTransform");function Tee(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter($=>!$.isGroup);let a=1/0,s=1/0;for(const $ of i){const A=$.x??0,I=$.y??0;A0?Math.max(1,h/d):1;for(const $ of i){const A=$.x??0,O=(($.y??0)-s)*f+o,N=A-a;$.x=O,$.y=N}for(const $ of n)if($.points)for(const A of $.points){const I=A.x,N=(A.y-s)*f+o,M=I-a;A.x=N,A.y=M}xee(r);const p=r.filter($=>$.isGroup&&!$.parentId);if(p.length===0)return e==="RL"&&Xw(t,"x"),!0;const g=KO(r),m=new Map;for(const $ of r){if($.isGroup)continue;const A=yee($,g);if(!A)continue;const I=m.get(A)??[];I.push($),m.set(A,I)}let y=0;for(const $ of p){const A=$.padding??0;A>y&&(y=A)}const v=[];let T=1/0,b=-1/0;for(const $ of p){const A=m.get($.id)??[],I=ZO(A);I&&(T=Math.min(T,I.minX),b=Math.max(b,I.maxX),v.push({lane:$,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(T===1/0||b===-1/0)return!0;const C=Math.max(0,b-T),w=Math.max(y,10),S=C+2*w,E=o+S,D=(T+b)/2-S/2-o,L=D+E/2,B=Math.max(y,o);v.sort(($,A)=>$.centerY-A.centerY);for(let $=0;$f.cy?v.bottom:v.top,B=f.cx+T;if(B<=v.left+Is||B>=v.right-Is)continue;b={x:B,y:L},C={x:B,y:o.y},w={x:o.x,y:o.y}}else{const L=p.cx>f.cx?v.right:v.left,B=f.cy+T;if(B<=v.top+Is||B>=v.bottom-Is)continue;b={x:L,y:B},C={x:o.x,y:B},w={x:o.x,y:o.y}}const S=Cs(b,C,Is),E=Cs(C,w,Is);if(S&&E||!S&&Nn(b,C,n,[h],1)||!E&&Nn(C,w,n,[d],1))continue;const _=!S&&Ww(b,C,t,i,{epsilon:Is,skipDegenerateOther:!0}),R=!E&&Ww(C,w,t,i,{epsilon:Is,skipDegenerateOther:!0});if(!(_||R)){S?y=[C,w]:E?y=[b,C]:y=[b,C,w];break}}y&&(i.points=y)}}x(Cee,"portSwapToLShape");function wee(t,e){const{realNodeRects:a,labelNodeRects:s}=ou(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Lr(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,y=Math.hypot(g,m);if(y>=10||y<.001)continue;const v=f.x-p.x,T=f.y-p.y;if(Math.hypot(v,T)<.001)continue;const C=Sn(f,d,.001),w=kn(f,d,.001),S=Sn(p,f,.001),E=kn(p,f,.001);if(!(C&&E||w&&S))continue;const _=o.end,R=o.start,D=_?e.get(_):void 0;if(!D)continue;const L=D.x??0,B=D.y??0,$=Fa(D);if(!$)continue;let A,I;if(E){const z=T<0;A={x:L,y:p.y},I={x:L,y:z?$.bottom:$.top}}else{const z=v>0;A={x:p.x,y:B},I={x:z?$.right:$.left,y:B}}if(Nn(A,I,a,_?[_]:[],-2)||Nn(A,I,s,[],-2))continue;if(R){const z=e.get(R),W=z?Fa(z):void 0;if(W&&WO(A,W,2))continue}const O=x((z,W)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${W.x.toFixed(3)},${W.y.toFixed(3)}`,"ownSegmentKey"),N=new Set;for(let z=0;z{for(const X of t){if(X===o||X.isLayoutOnly)continue;const j=X.points;if(!(!j||j.length<2))for(let re=0;re=0){const z=u[h-3],W=[R,_].filter(X=>!!X);if(Nn(z,A,a,W,-2)||M(z,A))continue}const F=[...u.slice(0,h-2),A,I];o.points=F;const V=o.labelNodeId;if(V){const z=e.get(V);if(z){const W=z.width??0,X=z.height??0;if(W>0&&X>0){let j,re,Q=-1;for(let oe=0;oe=W+2||de&&ie>=X+2)&&ie>Q&&(Q=ie,j=(ee.x+ne.x)/2,re=(ee.y+ne.y)/2)}j!==void 0&&re!==void 0&&(z.x=j,z.y=re)}}}}}x(wee,"collapseShortTerminalStub");var Lt=.001,ui=8,ur=A0,mR=x((t,e)=>br(t,e,Lt)||Er(t,e,Lt),"orthogonallyAligned");function Eee(t,e){const i=x((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,T=g.y-y;let b=(p.width??0)/2,C=(p.height??0)/2;return Math.abs(T)*b>Math.abs(v)*C?(T<0&&(C=-C),{x:m+(T===0?0:C*v/T),y:y+C}):(v<0&&(b=-b),{x:m+b,y:y+(v===0?0:b*T/v)})},"rectIntersect"),a=x((p,g)=>{const m=Lr(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,T=v?Fa(v):void 0;if(!v||!y||!T)return;const b=g?m[0]:m[m.length-1],C=g?m[1]:m[m.length-2],w=i(v,b);let S=b;if(mR(C,w)&&(S=C),br(w,S,Lt))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:w.x,min:Math.min(w.y,S.y),max:Math.max(w.y,S.y),boundary:w,railEnd:S,rect:T};if(Er(w,S,Lt))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:w.y,min:Math.min(w.x,S.x),max:Math.max(w.x,S.x),boundary:w,railEnd:S,rect:T}},"terminalLaneFor"),s=x((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&br(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Er(p.boundary,g.boundary,1),"sameTerminalFace"),l=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=ui&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=x((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=s(p,g);if(m2*y?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=x((p,g)=>{const m=Lr(p.edge.points??[]);if(m.length<2)return;const y=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},v=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!x(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Er(y,p.boundary,Lt)&&y.x>=p.rect.left+1&&y.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?br(y,p.boundary,Lt)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&Cs(m[1],p.railEnd,Lt),E=m.slice(S?2:1),_=E[0];return _&&!mR(_,v)?void 0:[y,v,...E]}const b=m.length>1&&Cs(m[m.length-2],p.railEnd,Lt),C=m.slice(0,b?-2:-1),w=C[C.length-1];if(!(w&&!mR(w,v)))return[...C,v,y]},"shiftedCandidate"),d=x(p=>{const g=p.edge,m=Lr(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,T=y?e.get(y):void 0,b=v?e.get(v):void 0;if(!T||!b)return!1;const C=T.x??0,w=T.y??0,S=b.x??0,E=b.y??0,[_,R]=m;return Er(_,R,Lt)&&Math.abs(w-E)<1&&Math.abs(C-S)>1||br(_,R,Lt)&&Math.abs(C-S)<1&&Math.abs(w-E)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[a(y,!0),a(y,!1)]).filter(y=>!!y);let m=!1;for(let y=0;y{const _=d(S),R=d(E);return _!==R?Number(_)-Number(R):+!E.atStart-+!S.atStart});for(const S of w){for(const E of f){const _=h(S,E);if(!_)continue;const R=a({...S.edge,points:_},S.atStart);if(!(!R||g.some(D=>D.edge!==S.edge&&(l(R,D)||C&&u(R,D))))){S.edge.points=_,m=!0;break}}if(m)break}}if(!m)return}}x(Eee,"separateSharedRenderedTerminalLanes");function See(t,e){const{realNodeRects:n,labelNodeRects:i}=ou(e.values()),a=x((o,l)=>{const u=o.start,h=o.end,d=ur(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Nn(p.a,p.b,n,f,-2)||Nn(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const y of ur(Lr(g)))if(Oo(m,y,.5)>=ui||ec(m.a,m.b,y.a,y.b,Lt))return!1}}return!0},"candidateIsSafe"),s=x((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=Sn(u,h)&&kn(h,d)&&Sn(d,f)&&kn(f,p)&&br(u,f,Lt)&&br(u,p,Lt)&&br(h,d,Lt)&&(h.x-u.x)*(f.x-d.x)<0,m=kn(u,h)&&Sn(h,d)&&kn(d,f)&&Sn(f,p)&&Er(u,f,Lt)&&Er(u,p,Lt)&&Er(h,d,Lt)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Lr([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=kn(u,h)&&Sn(h,d)&&kn(d,f)&&Sn(f,p)&&kn(p,y)&&br(u,p,Lt)&&br(u,y,Lt)&&br(d,f,Lt)&&(d.x-h.x)*(p.x-f.x)<0,T=Sn(u,h)&&kn(h,d)&&Sn(d,f)&&kn(f,p)&&Sn(p,y)&&Er(u,p,Lt)&&Er(u,y,Lt)&&Er(d,f,Lt)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!T))return Lr([...o.slice(0,l+1),y,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=Lr(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=s(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}x(See,"collapseRedundantRectangularDoglegs");function i5(t,e){const{realNodeRects:a,labelNodeRects:s}=ou(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=x((g,m,y)=>Lr(g===m?y??[]:g.points??[]),"pointsFor"),u=x((g,m)=>{let y=0;for(let v=0;v{const m=ur(g);if(m.length!==3)return;const y=m[1];if(!(m[0].horizontal===y.horizontal||m[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),d=x((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return a.filter(v=>{if(y.includes(v.id))return!1;const T=v.rect;return m.horizontal?ca(m.a.x,m.b.x,T.left,T.right)>=ui&&m.a.y>=T.top-2&&m.a.y<=T.bottom+2:ca(m.a.y,m.b.y,T.top,T.bottom)>=ui&&m.a.x>=T.left-2&&m.a.x<=T.right+2})},"blockingRectsFor"),f=x((g,m,y)=>{const v=g.map(b=>({...b}));if(m.horizontal)v[m.index].y=y,v[m.index+1].y=y;else if(m.vertical)v[m.index].x=y,v[m.index+1].x=y;else return;const T=Fo(Lr(v));return ur(T).length===T.length-1?T:void 0},"candidateByMovingRail"),p=x((g,m,y)=>{const v=[g.start,g.end].filter(b=>!!b),T=ur(m);if(T.length!==m.length-1)return!1;for(const b of T)if(Nn(b.a,b.b,a,v,-2)||Nn(b.a,b.b,s,[],-2))return!1;for(const b of o)if(b!==g){for(const C of T)for(const w of ur(l(b)))if(Oo(C,w,.5)>=ui)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const T=l(v),b=h(T);if(!b)continue;const C=d(v,b.segment);if(C.length===0)continue;const w=b.horizontal?[Math.min(...C.map(S=>S.rect.top))-20,Math.max(...C.map(S=>S.rect.bottom))+20]:[Math.min(...C.map(S=>S.rect.left))-20,Math.max(...C.map(S=>S.rect.right))+20];for(const S of w){const E=f(T,b.segment,S);if(!(!E||!p(v,E,m))){v.points=E,y=!0;break}}if(y)break}if(!y)return}}x(i5,"liftObstacleHuggingSameSideRails");function a5(t,e){const n=x(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=x(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+Lt||h>=u.bottom-Lt?!1:ca(l.a.x,l.b.x,u.left,u.right)>=ui},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(l=>!!l);if(s.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=Lr(l.points??[]);for(const h of ur(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=Lt))for(const l of s){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}x(a5,"liftTopLaneTitleBandsAboveRails");function s5(t,e){const n=x(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=x(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+Lt||d>=h.right-Lt?!1:ca(u.a.y,u.b.y,h.top,h.bottom)>=ui},"verticalSegmentIntersectsTitle"),s=x((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+Lt||d>=h.bottom-Lt?!1:ca(u.a.x,u.b.x,h.left,h.right)>=ui},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=Lr(u.points??[]);for(const d of ur(h))for(const f of o)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(s(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Lt))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}x(s5,"shiftLeftLaneTitleBandsLeftOfRails");function kee(t,e){const{realNodeRects:n}=ou(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=x((g,m=new Map)=>Lr(m.get(g)??g.points??[]),"replacementPointsFor"),s=x((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+Za(a(y,g)),0),"totalBends"),l=x(g=>{const m=a(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!Sn(y,v,Lt)&&!kn(y,v,Lt)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=x((g,m)=>{const y=a(g);if(y.length<3)return;const v=y[0],T=y[1];let b;if(Sn(v,T,Lt))b={x:T.x,y:m.tailStart.y};else if(kn(v,T,Lt))b={x:m.tailStart.x,y:T.y};else return;const C=Fo(Lr([v,T,b,m.tailStart,m.terminal]));return ur(C).length===C.length-1?C:void 0},"candidateWithDestinationTail"),h=x((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of ur(m))if(Nn(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=x((g,m,y)=>{for(const v of i)if(v!==g){for(const T of ur(m))for(const b of ur(a(v,y)))if(Oo(T,b,.5)>=ui)return!0}return!1},"pathHasSharedTrack"),f=x((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=x(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||a(m).length<4)continue;const T=g.get(y)??[];T.push(m),g.set(y,T)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const y=o();let v,T=m,b=y;for(const C of p().values())for(let w=0;w=m||A>T||A===T&&I>=b||(v=$,T=A,b=I)}if(!v)return;for(const[C,w]of v)C.points=w}}x(kee,"swapDestinationTerminalTailsToReduceCrossings");function _ee(t,e){const{realNodeRects:a,labelNodeRects:s}=ou(e.values()),o=t.filter(C=>!C.isLayoutOnly),l=x((C,w=new Map)=>Lr(w.get(C)??C.points??[]),"replacementPointsFor"),u=x((C=new Map)=>{let w=0;for(let S=0;So.reduce((w,S)=>w+Za(l(S,C)),0),"totalBends"),d=x(C=>{const w=C.start,S=C.end,E=w?e.get(w):void 0,_=S?e.get(S):void 0,R=E?Fa(E):void 0,D=_?Fa(_):void 0;return R&&D?{src:R,dst:D}:void 0},"endpointRectsFor"),f=x((C,w,S)=>{if(S.index<=0||S.index+1>=w.length-1)return;const E=d(C);if(E){if(S.vertical){const _=S.a.x,R=Math.min(E.src.left,E.dst.left),D=Math.max(E.src.right,E.dst.right),L=_D+Lt?"right":void 0;return L?{edge:C,points:w,segmentIndex:S.index,axis:"vertical",side:L,coord:_,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const _=S.a.y,R=Math.min(E.src.top,E.dst.top),D=Math.max(E.src.bottom,E.dst.bottom),L=_D+Lt?"bottom":void 0;return L?{edge:C,points:w,segmentIndex:S.index,axis:"horizontal",side:L,coord:_,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=x(()=>{const C=[];for(const w of o){const S=l(w);for(const E of ur(S)){const _=f(w,S,E);_&&C.push(_)}}return C},"collectExternalRails"),g=x((C,w)=>C.edge!==w.edge&&C.axis===w.axis&&C.side===w.side&&ca(C.min,C.max,w.min,w.max)>=ui,"railsInteract"),m=x(C=>{const w=[],S=new Set;for(const E of C){if(S.has(E))continue;const _=[E],R=[];for(S.add(E);_.length>0;){const D=_.pop();R.push(D);for(const L of C)!S.has(L)&&g(D,L)&&(S.add(L),_.push(L))}R.length>1&&w.push(R)}return w},"connectedComponents"),y=x(C=>{const w=[];for(const S of C)w.some(E=>Math.abs(E-S.coord){const w=C.map(_=>_.coord),S=y(C),E=[];if(C.length<=6){const _=new Array(S.length).fill(!1),R=[],D=x(()=>{if(R.length===C.length){R.some((L,B)=>Math.abs(L-w[B])>=Lt)&&E.push([...R]);return}for(const[L,B]of S.entries())_[L]||(_[L]=!0,R.push(B),D(),R.pop(),_[L]=!1)},"visit");return D(),E}for(let _=0;_{const S=new Map;for(const[_,R]of C.entries()){const D=w[_],L=S.get(R.edge)??R.points.map(B=>({x:B.x,y:B.y}));R.axis==="vertical"?(L[R.segmentIndex].x=D,L[R.segmentIndex+1].x=D):(L[R.segmentIndex].y=D,L[R.segmentIndex+1].y=D),S.set(R.edge,L)}const E=new Map;for(const[_,R]of S){const D=Fo(Lr(R));if(ur(D).length!==D.length-1)return;E.set(_,D)}return E},"replacementsForAssignment"),b=x(C=>{for(const[w,S]of C){const E=[w.start,w.end].filter(_=>!!_);for(const _ of ur(S))if(Nn(_.a,_.b,a,E,-2)||Nn(_.a,_.b,s,[],-2))return!1}for(let w=0;w=ui)return!1}}return!0},"candidateIsSafe");for(let C=0;C<4;C++){const w=u();if(w===0)return;let S,E=w,_=h(),R=Number.POSITIVE_INFINITY;for(const D of m(p()))for(const L of v(D)){const B=T(D,L);if(!B||!b(B))continue;const $=u(B);if($>=w)continue;const A=h(B),I=D.reduce((O,N,M)=>O+Math.abs(L[M]-N.coord),0);$>E||$===E&&(A>_||A===_&&I>=R)||(S=B,E=$,_=A,R=I)}if(!S)return;for(const[D,L]of S)D.points=L}}x(_ee,"reassignCrossingExternalRailChannels");function Aee(t,e){const{realNodeRects:n,labelNodeRects:i}=ou(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=x((p,g,m)=>Lr(p===g?m??[]:p.points??[]),"pointsFor"),o=x(p=>ur(p).reduce((g,m)=>{const y=m.a.x-m.b.x,v=m.a.y-m.b.y;return g+Math.hypot(y,v)},0),"pathLength"),l=x((p,g)=>{let m=0;for(let y=0;y{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&ca(p.a.x,p.b.x,g.left,g.right)>=ui}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&ca(p.a.y,p.b.y,g.top,g.bottom)>=ui}return!1},"segmentRunsAlongRectBorder"),h=x(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),T=v?Fa(v):void 0;T&&m.push(T)}return m},"endpointRectsFor"),d=x((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],T=p[g+3],b=Sn(m,y,Lt)&&kn(y,v,Lt)&&Sn(v,T,Lt),C=kn(m,y,Lt)&&Sn(y,v,Lt)&&kn(v,T,Lt);if(!b&&!C)return[];if(!(b?Math.sign(y.x-m.x)!==Math.sign(T.x-v.x):Math.sign(y.y-m.y)!==Math.sign(T.y-v.y)))return[];const S=br(m,T,Lt)||Er(m,T,Lt)?[]:[{x:m.x,y:T.y},{x:T.x,y:m.y}],E=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(R=>[...p.slice(0,g+1),R,...p.slice(g+3)]),_=new Set;return E.map(R=>Fo(Lr(R))).filter(R=>{if(ur(R).length!==R.length-1||!R.some(L=>Cs(L,T,Lt)))return!1;const D=R.map(L=>`${L.x.toFixed(3)},${L.y.toFixed(3)}`).join("|");return _.has(D)?!1:(_.add(D),!0)})},"shortcutCandidatesAt"),f=x((p,g,m)=>{const y=[p.start,p.end].filter(T=>!!T),v=h(p);for(const T of ur(g))if(Nn(T.a,T.b,n,y,-2)||Nn(T.a,T.b,i,[],-2)||v.some(b=>u(T,b)))return!1;for(const T of a)if(T!==p){for(const b of ur(g))for(const C of ur(s(T)))if(Oo(b,C,.5)>=ui)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,T=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY;for(const C of a){const w=s(C),S=Za(w,Lt),E=o(w);for(let _=0;_<=w.length-4;_++)for(const R of d(w,_)){const D=Za(R,Lt),L=o(R);if(!(Dv||$===v&&(D>T||D===T&&L>=b)||(m=C,y=R,v=$,T=D,b=L)}}if(!m||!y)return;m.points=y}}x(Aee,"shortcutRedundantOrthogonalJogs");function Ree(t,e){const s=[];for(const ce of e.values()){if(ce.isGroup||ce.isEdgeLabel)continue;const ve=ce.x??0,Ce=ce.y??0,Ne=Fa(ce);Ne&&s.push({id:String(ce.id??""),cx:ve,cy:Ce,rect:Ne})}if(s.length===0)return;const o=new Map(s.map(ce=>[ce.id,ce])),l=s.map(ce=>({id:ce.id,rect:ce.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(ce=>ce.rect.top))-20,bottom:Math.max(...s.map(ce=>ce.rect.bottom))+20,left:Math.min(...s.map(ce=>ce.rect.left))-20,right:Math.max(...s.map(ce=>ce.rect.right))+20},d=t.filter(ce=>!ce.isLayoutOnly),f=new Map(d.map((ce,ve)=>[ce,ve])),p=x(ce=>{const ve=ce==="left"||ce==="top"?-1:1,Ce=[];for(let Ne=0;Ne<=2;Ne++)Ce.push(h[ce]+ve*20*Ne);return Ce},"outwardTracksForSide"),g=x((ce,ve=new Map)=>Lr(ve.get(ce)??ce.points??[]),"replacementPointsFor"),m=x((ce,ve)=>{let Ce=0;for(const Ne of ce)for(const Ie of ve)ec(Ne.a,Ne.b,Ie.a,Ie.b,Lt)&&Ce++;return Ce},"crossingCountBetweenSegments"),y=x((ce,ve)=>m(ur(ce),ur(ve)),"crossingCountBetweenPaths"),v=x((ce=new Map)=>{let ve=0;const Ce=[],Ne=new Set,Ie=[],Ae=x(be=>{Ne.has(be)||(Ne.add(be),Ie.push(be))},"addEdge");for(let be=0;be0&&(ve+=q,Ce.push({first:ke,second:G,count:q}),Ae(ke),Ae(G))}}return Ie.sort((be,ke)=>(f.get(be)??0)-(f.get(ke)??0)),{count:ve,pairs:Ce,edgeSet:Ne,edges:Ie}},"crossingSnapshot"),T=x((ce,ve)=>{const Ce=new Set(ve.keys());if(Ce.size===0)return ce.count;let Ne=0;for(const Ae of ce.pairs)(Ce.has(Ae.first)||Ce.has(Ae.second))&&(Ne+=Ae.count);let Ie=0;for(let Ae=0;Ae{const ve=new Map;for(const Ie of ce.pairs){const Ae=ve.get(Ie.first)??new Set;Ae.add(Ie.second),ve.set(Ie.first,Ae);const be=ve.get(Ie.second)??new Set;be.add(Ie.first),ve.set(Ie.second,be)}const Ce=[],Ne=new Set;for(const Ie of ce.edges){if(Ne.has(Ie))continue;const Ae=[Ie],be=[];for(Ne.add(Ie);Ae.length>0;){const ke=Ae.pop();be.push(ke);for(const se of ve.get(ke)??[])Ne.has(se)||(Ne.add(se),Ae.push(se))}be.sort((ke,se)=>(f.get(ke)??0)-(f.get(se)??0)),be.length>1&&Ce.push(be)}return Ce},"crossingComponents"),C=x(ce=>[ce.start,ce.end].filter(ve=>!!ve),"endpointIdsFor"),w=x(ce=>{const ve=[];for(const Ce of b(ce)){const Ne=new Set(Ce),Ie=new Set(Ce.flatMap(be=>C(be))),Ae=[...Ce];for(const be of d)Ne.has(be)||C(be).some(ke=>Ie.has(ke))&&Ae.push(be);Ae.sort((be,ke)=>(f.get(be)??0)-(f.get(ke)??0)),ve.push(Ae)}return ve},"pairSearchGroups"),S=x((ce,ve,Ce)=>T(ce,new Map([[ve,Ce]])),"crossingCountWithSingleReplacement"),E=x(ce=>{const ve=new Map;for(const Ce of ce.pairs)ve.set(Ce.first,(ve.get(Ce.first)??0)+Ce.count),ve.set(Ce.second,(ve.get(Ce.second)??0)+Ce.count);return ve},"currentCrossingsByEdge"),_=x(ce=>ce.slice(1).reduce((ve,Ce,Ne)=>{const Ie=ce[Ne];return ve+Math.abs(Ce.x-Ie.x)+Math.abs(Ce.y-Ie.y)},0),"pathLength"),R=x((ce=new Map)=>d.reduce((ve,Ce)=>ve+Za(g(Ce,ce)),0),"totalBends"),D=x((ce=new Map)=>d.reduce((ve,Ce)=>ve+_(g(Ce,ce)),0),"totalLength"),L=x((ce,ve,Ce=new Map)=>{const Ne=ur(ve);for(const Ie of d)if(Ie!==ce){for(const Ae of Ne)for(const be of ur(g(Ie,Ce)))if(Oo(Ae,be,.5)>=ui)return!0}return!1},"pathHasSegmentConflict"),B=x((ce,ve)=>{const Ce=[ce.start,ce.end].filter(Ne=>!!Ne);for(const Ne of ur(ve))if(Nn(Ne.a,Ne.b,l,Ce,-2))return!0;return!1},"pathHitsNode"),$=x((ce,ve)=>{const Ce=Fo(Lr(ve));ur(Ce).length===Ce.length-1&&ce.push(Ce)},"pushOrthogonalCandidate"),A=x(ce=>ce==="left"||ce==="right","sideIsHorizontal"),I=x((ce,ve,Ce)=>{switch(ve){case"left":return Math.min(ce.x,Ce.x)-20;case"right":return Math.max(ce.x,Ce.x)+20;case"top":return Math.min(ce.y,Ce.y)-20;case"bottom":return Math.max(ce.y,Ce.y)+20}},"localTrackForSameSide"),O=x((ce,ve,Ce,Ne)=>{const Ie=Ce==="left"||Ce==="top"?-1:1,Ae=[I(ve,Ce,Ne),h[Ce]];for(const be of Ae)for(let ke=0;ke<=2;ke++)$(ce,UO(ve,Ce,Ne,be+Ie*20*ke))},"addSameSideCandidates"),N=x((ce,ve,Ce,Ne,Ie)=>{for(const Ae of p(Ce))for(const be of p(Ie))$(ce,[ve,{x:Ae,y:ve.y},{x:Ae,y:be},{x:Ne.x,y:be},Ne])},"addHorizontalToVerticalCandidates"),M=x((ce,ve,Ce,Ne,Ie)=>{for(const Ae of p(Ce))for(const be of p(Ie))$(ce,[ve,{x:ve.x,y:Ae},{x:be,y:Ae},{x:be,y:Ne.y},Ne])},"addVerticalToHorizontalCandidates"),P=x((ce,ve,Ce,Ne,Ie)=>{const Ae=[...p("top"),...p("bottom")];for(const be of p(Ce))for(const ke of p(Ie))for(const se of Ae)$(ce,[ve,{x:be,y:ve.y},{x:be,y:se},{x:ke,y:se},{x:ke,y:Ne.y},Ne])},"addHorizontalPairCandidates"),F=x((ce,ve,Ce,Ne,Ie)=>{const Ae=[...p("left"),...p("right")];for(const be of p(Ce))for(const ke of p(Ie))for(const se of Ae)$(ce,[ve,{x:ve.x,y:be},{x:se,y:be},{x:se,y:ke},{x:Ne.x,y:ke},Ne])},"addVerticalPairCandidates"),V=x(ce=>{const ve=new Set;return ce.map(Ce=>Lr(Ce)).filter(Ce=>{const Ne=Ce.map(Ie=>`${Ie.x.toFixed(3)},${Ie.y.toFixed(3)}`).join("|");return ve.has(Ne)||Ce.length<2?!1:(ve.add(Ne),!0)})},"dedupeCandidatePaths"),z=x((ce,ve,Ce,Ne)=>{const Ie=[],Ae=qO(ce,ve,Ce,Ne,20,Lt);Ae&&$(Ie,Ae),ve===Ne&&O(Ie,ce,ve,Ce);const be=A(ve),ke=A(Ne);return be&&!ke?N(Ie,ce,ve,Ce,Ne):!be&&ke?M(Ie,ce,ve,Ce,Ne):be?P(Ie,ce,ve,Ce,Ne):F(Ie,ce,ve,Ce,Ne),V(Ie)},"buildCandidatesForSides"),W=x((ce,ve,Ce,Ne)=>{const Ie=[...p("left"),...p("right")],Ae=[...p("top"),...p("bottom")];for(const be of u){const ke=wh(Ne,be),se=be==="top"||be==="bottom"?p(be):Ae;for(const J of Ie){$(ce,[ve,Ce,{x:J,y:Ce.y},{x:J,y:ke.y},ke]);for(const G of se)$(ce,[ve,Ce,{x:J,y:Ce.y},{x:J,y:G},{x:ke.x,y:G},ke])}}},"addVerticalDepartureOuterTrackCandidates"),X=x((ce,ve,Ce,Ne)=>{const Ie=[...p("left"),...p("right")],Ae=[...p("top"),...p("bottom")];for(const be of u){const ke=wh(Ne,be),se=be==="left"||be==="right"?p(be):Ie;for(const J of Ae){$(ce,[ve,Ce,{x:Ce.x,y:J},{x:ke.x,y:J},ke]);for(const G of se)$(ce,[ve,Ce,{x:Ce.x,y:J},{x:G,y:J},{x:G,y:ke.y},ke])}}},"addHorizontalDepartureOuterTrackCandidates"),j=x(ce=>{const ve=ce.start,Ce=ce.end,Ne=Ce?o.get(Ce):void 0;if(!ve||!Ne)return[];const Ie=Lr(ce.points??[]);if(Ie.length<4)return[];const Ae=Ie[0],be=Ie[1],ke=[];return kn(Ae,be,Lt)?W(ke,Ae,be,Ne):Sn(Ae,be,Lt)&&X(ke,Ae,be,Ne),ke},"terminalPreservingOuterTrackCandidates"),re=x(ce=>{const ve=ce.start,Ce=ce.end,Ne=ve?o.get(ve):void 0,Ie=Ce?o.get(Ce):void 0;if(!Ne||!Ie)return[];const Ae=[];for(const be of u){const ke=wh(Ne,be);for(const se of u)Ae.push(...z(ke,be,wh(Ie,se),se))}return Ae.push(...j(ce)),Ae},"candidatePathsFor"),Q=x(()=>new Map(d.map(ce=>[ce,ur(g(ce))])),"currentSegmentsByEdge"),oe=x((ce,ve,Ce)=>{const Ne=new Set;for(const Ie of d){if(Ie===ce)continue;const Ae=Ce.get(Ie)??ur(g(Ie));ve.some(be=>Ae.some(ke=>Oo(be,ke,.5)>=ui))&&Ne.add(Ie)}return Ne},"sharedTrackConflictsFor"),ee=x((ce,ve,Ce,Ne)=>{const Ie=new Set;return re(ce).map(be=>Fo(Lr(be))).filter(be=>{if(B(ce,be))return!1;const ke=be.map(se=>`${se.x.toFixed(3)},${se.y.toFixed(3)}`).join("|");return Ie.has(ke)||be.length<2?!1:(Ie.add(ke),!0)}).map(be=>{const ke=ur(be);let se=0;for(const J of d)J!==ce&&(se+=m(ke,Ce.get(J)??ur(g(J))));return{candidate:be,candidateSegments:ke,crossings:ve.count-(Ne.get(ce)??0)+se,bends:Za(be,Lt),totalBends:Za(be),length:_(be)}}).filter(({crossings:be})=>be<=ve.count).sort((be,ke)=>be.crossings-ke.crossings||be.bends-ke.bends||be.length-ke.length).slice(0,48).map(be=>({path:be.candidate,segments:be.candidateSegments,sharedTrackConflicts:oe(ce,be.candidateSegments,Ce),totalBends:be.totalBends,length:be.length}))},"pairCandidatesFor"),ne=x((ce,ve,Ce,Ne,Ie,Ae)=>{let be=0;for(const se of ce.pairs)(se.first===ve||se.second===ve||se.first===Ne||se.second===Ne)&&(be+=se.count);let ke=m(Ce.segments,Ie.segments);for(const se of d){if(se===ve||se===Ne)continue;const J=Ae.get(se)??ur(g(se));ke+=m(Ce.segments,J)+m(Ie.segments,J)}return ce.count-be+ke},"pairCrossingCount"),ie=x((ce,ve)=>{for(const Ce of ce.sharedTrackConflicts)if(Ce!==ve)return!1;return!0},"conflictsOnlyWith"),ae=x((ce,ve)=>ce.segments.some(Ce=>ve.segments.some(Ne=>Oo(Ce,Ne,.5)>=ui)),"candidatesShareTrack"),de=x((ce,ve,Ce,Ne)=>ie(ve,Ce.edge)&&ie(Ne,ce.edge)&&!ae(ve,Ne),"pairCandidatesAreCompatible"),le=x((ce,ve,Ce,Ne,Ie)=>{const Ae=ne(ce.current,ve.edge,Ce,Ne.edge,Ie,ce.baseSegments);if(!(Ae>=ce.current.count))return{replacements:new Map([[ve.edge,Ce.path],[Ne.edge,Ie.path]]),crossings:Ae,bends:ce.currentBends-(ce.baseBendsByEdge.get(ve.edge)??0)-(ce.baseBendsByEdge.get(Ne.edge)??0)+Ce.totalBends+Ie.totalBends,length:ce.currentLength-(ce.baseLengthByEdge.get(ve.edge)??0)-(ce.baseLengthByEdge.get(Ne.edge)??0)+Ce.length+Ie.length}},"scorePairReplacement"),ye=x((ce,ve)=>ce.crossings{let Ie=Ne;for(const Ae of ve.candidates)for(const be of Ce.candidates){if(!de(ve,Ae,Ce,be))continue;const ke=le(ce,ve,Ae,Ce,be);ke&&ye(ke,Ie)&&(Ie=ke)}return Ie},"bestScoreForOptionPair"),Fe=x(ce=>{const ve=R(),Ce=D(),Ne=Q(),Ie=E(ce),Ae=new Map(d.map(q=>[q,Za(g(q))])),be=new Map(d.map(q=>[q,_(g(q))])),ke=new Map,se=w(ce);for(const q of se)for(const H of q){if(ke.has(H))continue;const Z=ee(H,ce,Ne,Ie);Z.length>0&&ke.set(H,{edge:H,candidates:Z})}let J={replacements:new Map,crossings:ce.count,bends:ve,length:Ce};const G={current:ce,currentBends:ve,currentLength:Ce,baseBendsByEdge:Ae,baseLengthByEdge:be,baseSegments:Ne};for(const q of se){const H=new Set(q.filter(te=>ce.edgeSet.has(te))),Z=q.map(te=>ke.get(te)).filter(te=>!!te);for(let te=0;te0?J.replacements:void 0},"bestPairedReplacement");for(let ce=0;ce<4;ce++){const ve=v(),Ce=ve.count;if(Ce===0)return;let Ne,Ie,Ae=Ce,be=Number.POSITIVE_INFINITY;for(const se of ve.edges){const J=Za(g(se),Lt);for(const G of re(se)){const q=B(se,G),H=!q&&L(se,G),Z=S(ve,se,G),te=Za(G,Lt);q||H||!(ZAe||Z===Ae&&te>=be||(Ne=se,Ie=G,Ae=Z,be=te)}}if(Ne&&Ie){Ne.points=Ie;continue}const ke=Fe(ve);if(!ke)return;for(const[se,J]of ke)se.points=J}}x(Ree,"resolveRenderedOrthogonalCrossings");var fc=.001,oPe=8;function Lee(t,e){const{nodeInfoById:r,realNodeRects:n}=lk(e),i=["top","bottom","left","right"],a=20,s={top:Math.min(...n.map(m=>m.rect.top))-a,bottom:Math.max(...n.map(m=>m.rect.bottom))+a,left:Math.min(...n.map(m=>m.rect.left))-a,right:Math.max(...n.map(m=>m.rect.right))+a},o=x((m,y,v,T)=>{const b=[],C=qO(m,y,v,T,a,fc);return C&&b.push(C),y===T&&b.push(UO(m,y,v,s[y])),b},"buildOrthogonalPathCandidates"),l=x((m,y)=>{for(let v=0;v{let T=0;const b=A0(m,fc),C=y.start,w=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const E=S.start,_=S.end;if(!v&&C&&w&&(E===C||E===w||_===C||_===w))continue;const R=S.points;if(!(!R||R.length<2))for(const D of b)for(const L of A0(R,fc)){if(YO(D.a,D.b,L.a,L.b,fc,fc)){T++;continue}Oo(D,L,fc)>=oPe&&T++}}return T},"pathConflictCount"),h=4,d=x((m,y)=>{const v=Math.abs(m.y-y.rect.top),T=Math.abs(m.y-y.rect.bottom),b=Math.abs(m.x-y.rect.left),C=Math.abs(m.x-y.rect.right);let w="top",S=v;return T{const T=f.get(m)??[];T.push({side:y,edgeId:v}),f.set(m,T)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",T=m.start,b=m.end;if(T){const C=r.get(T);C&&p(T,d(y[0],C),v)}if(b){const C=r.get(b);C&&p(b,d(y[y.length-1],C),v)}}const g=x((m,y,v)=>{var T;return((T=f.get(m))==null?void 0:T.some(b=>b.edgeId!==v&&b.side===y))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points;if(!y||y.length<2)continue;const v=Za(y,fc);if(v0){const M=u(O,m,!0);if(M>D||M===D&&N>=L)continue;D=M,L=N,R=O;continue}u(O,m)>_||NA.edgeId!==S));const $=f.get(b);$&&f.set(b,$.filter(A=>A.edgeId!==S)),p(T,d(R[0],C),S),p(b,d(R[R.length-1],w),S)}}}x(Lee,"simplifyDetouredEdges");var Aa=.001,uz=10,YT=7;function o5(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],a=t[r+n];if(!i||!a)return;const s=a.x-i.x,o=a.y-i.y;if(!(Math.abs(s)+Math.abs(o)a&&Vw(t,Iee(a)))}x(l5,"labelOverlapsOwnMarker");function Z2(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let y=0;y{const y=U3(m,a);for(const{nodeId:v,rect:T}of n)if(v!==g&&Vw(y,T))return!0;return!1},"labelOverlapsForeignNode"),u=x((g,m)=>{const y=U3(m,a);for(const v of r)if(v.edgeId!==g&&ok(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=x((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=x(g=>{for(const{id:m,rect:y}of i)if(aee(y,g))return m},"findContainingLane"),p=x((g,m)=>d.some(y=>y.labelId!==g&&Vw(m,y.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const y=e.get(m);if(!y)continue;const v=g.points;if(!v||v.length<2)continue;const T=y.width??0,b=y.height??0;if(T<=0||b<=0)continue;const C=[];for(let V=0;V=Aa&&j>=Aa||C.push({idx:V,length:X+j,orientation:X>=Aa?"horizontal":"vertical",midX:(z.x+W.x)/2,midY:(z.y+W.y)/2})}if(C.length===0)continue;const w=C.length>=3?C.filter(V=>V.idx>0&&V.idx0?w:C,E=T>=b?"horizontal":"vertical",_=x(V=>[...V].sort((z,W)=>{const X=z.orientation===E,j=W.orientation===E;if(X!==j)return X?-1:1;const re=z.length>=(z.orientation==="horizontal"?T:b)+2,Q=W.length>=(W.orientation==="horizontal"?T:b)+2;return re!==Q?re?-1:1:W.length-z.length}),"rankSegments"),R=C[0],D=C[C.length-1],L=[.5,.25,.75,.05,.95,.15,.85,.1,.9],B=x((V,z)=>{const W=v[V.idx],X=v[V.idx+1];return{midX:W.x+(X.x-W.x)*z,midY:W.y+(X.y-W.y)*z}},"anchorAtT"),$=x((V,z,W)=>Math.min(W,Math.max(z,V)),"clamp"),A=x((V,z)=>V.midX>=z.left-Aa&&V.midX<=z.right+Aa&&V.midY>=z.top-Aa&&V.midY<=z.bottom+Aa,"pointInsideRectInclusive"),I=x(V=>{const z=dp(V.midX,V.midY,T,b),W=f(z);if(W)return{laneId:W,anchor:V,rect:z};const X=i.find(({rect:ie})=>A(V,ie));if(!X)return;const j=X.rect.left+T/2+s,re=X.rect.right-T/2-s,Q=X.rect.top+b/2+s,oe=X.rect.bottom-b/2-s;if(j>re||Q>oe)return;const ee={midX:$(V.midX,j,re),midY:$(V.midY,Q,oe)},ne=dp(ee.midX,ee.midY,T,b);return A(V,ne)?{laneId:X.id,anchor:ee,rect:ne}:void 0},"placementForAnchor"),O=x((V,z,W)=>V.orientation==="horizontal"?Math.abs(z.midX-W.x):Math.abs(z.midY-W.y),"distanceAlongSegment"),N=x((V,z)=>{const X=(V.orientation==="horizontal"?T/2:b/2)+o;if(V===R){const j=v[V.idx];if(O(V,z,j)+Aa{const z=_(V);for(const W of z)for(const X of L){const j=B(W,X);if(!N(W,j))continue;const re=I(j);if(re&&!l5(re.rect,v)&&!p(m,re.rect)&&!h(m,g.id,re.rect))return{laneId:re.laneId,anchor:re.anchor}}},"tryPool"),P=x((V,z,W=!1)=>{const X=_(V);for(const j of X){const re={midX:j.midX,midY:j.midY};if(z&&!N(j,re))continue;const Q=I(re);if(Q&&!l5(Q.rect,v)&&!p(m,Q.rect)&&!l(m,Q.rect)&&(W||!u(g.id,Q.rect)))return{laneId:Q.laneId,anchor:Q.anchor}}},"findLaneContainingFallback"),F=M(S)??(S.lengthW.labelId===m);z>=0?d[z]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}x(Z2,"anchorLabelsToPolyline");var yR=1e-6,lPe=8,hz=lPe/2,cPe=3;function c5(t,e){return t{const h=c5(o,l);let d=0;const f=x(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(s.labelNodeId);for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||c5(g,m)===h&&f(p.labelNodeId)}return d>0?d+cPe:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!VO(o,yR))continue;const l=HO(s,r,yR);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,y;if(p){const w=f.cy>d.cy;m={x:d.cx,y:w?d.rect.bottom:d.rect.top},y={x:f.cx,y:w?f.rect.top:f.rect.bottom}}else{const w=f.cx>d.cx;m={x:w?d.rect.right:d.rect.left,y:d.cy},y={x:w?f.rect.left:f.rect.right,y:f.cy}}if(Nn(m,y,n,[u,h],1))continue;const T=a(s,u,h,p?"x":"y"),b=T>hz?T:hz,C=[0,b,-b];for(const w of C){const S={...m},E={...y};if(p){if(S.x+=w,E.x+=w,S.x<=d.rect.left||S.x>=d.rect.right||E.x<=f.rect.left||E.x>=f.rect.right)continue}else if(S.y+=w,E.y+=w,S.y<=d.rect.top||S.y>=d.rect.bottom||E.y<=f.rect.top||E.y>=f.rect.bottom)continue;if(!Nn(S,E,n,[u,h],1)&&!Ww(S,E,t,s,{epsilon:yR})){s.points=[S,E];break}}}}x(Dee,"straightenCollinearSiblingDetours");function u5(t,e){const{realNodeRects:l,labelNodeRects:u}=ou(e.values()),h=x((w,S)=>A0(S,.001).map(E=>({...E,edge:w,interior:E.index>=1&&E.index<=S.length-3})),"segmentsFor"),d=x(()=>{const w=[];for(const S of t){if(S.isLayoutOnly)continue;const E=S.points;!E||E.length<2||w.push(...h(S,Lr(E)))}return w},"allSegments"),f=x((w,S)=>w.horizontal&&S.horizontal?ca(w.a.x,w.b.x,S.a.x,S.b.x)>=8&&Math.abs(w.a.y-S.a.y)<7:w.vertical&&S.vertical?ca(w.a.y,w.b.y,S.a.y,S.b.y)>=8&&Math.abs(w.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=x((w,S)=>{const E=w.start,_=w.end,R=h(w,S);if(R.length!==S.length-1)return!1;const D=[E,_].filter(B=>!!B),L=w.labelNodeId?[w.labelNodeId]:[];for(const B of R)if(Nn(B.a,B.b,l,D,-2)||Nn(B.a,B.b,u,L,-2))return!1;for(const B of t){if(B===w||B.isLayoutOnly)continue;const $=B.points;if(!(!$||$.length<2)){for(const A of R)for(const I of h(B,Lr($)))if(f(A,I)||ec(A.a,A.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=x((w,S)=>{const E=Lr(w.edge.points??[]);if(E.length<4||w.index>=E.length-1)return;const _=E.map(R=>({...R}));if(w.horizontal)_[w.index].y+=S,_[w.index+1].y+=S;else if(w.vertical)_[w.index].x+=S,_[w.index+1].x+=S;else return;return h(w.edge,_).length===_.length-1?_:void 0},"shiftedCandidate"),m=x((w,S)=>({x:w.x??(S.left+S.right)/2,y:w.y??(S.top+S.bottom)/2}),"nodeCenter"),y=x(w=>{const S=w.edge,E=Lr(S.points??[]);if(E.length!==4||w.index!==1)return;const _=S.start?e.get(S.start):void 0,R=S.end?e.get(S.end):void 0,D=_?Fa(_):void 0,L=R?Fa(R):void 0,B=E.slice(w.index+2);if(!(!_||!R||!D||!L||B.length===0))return{sourceCenter:m(_,D),targetCenter:m(R,L),sourceRect:D,tail:B}},"sourceDetourContextFor"),v=x((w,S,E,_,R,D)=>{const L=_.y>=E.y,B=L?R.bottom:R.top,$=B+(L?20:-20);if(L&&w.b.y<=$+.001||!L&&w.b.y>=$-.001)return;const A=w.a.x+S;return Lr([{x:E.x,y:B},{x:E.x,y:$},{x:A,y:$},{x:A,y:w.b.y},...D],.001)},"verticalSourceDetour"),T=x((w,S,E,_,R,D)=>{const L=_.x>=E.x,B=L?R.right:R.left,$=B+(L?20:-20);if(L&&w.b.x<=$+.001||!L&&w.b.x>=$-.001)return;const A=w.a.y+S;return Lr([{x:B,y:E.y},{x:$,y:E.y},{x:$,y:A},{x:w.b.x,y:A},...D],.001)},"horizontalSourceDetour"),b=x((w,S)=>{const E=y(w);if(E){if(w.vertical)return v(w,S,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail);if(w.horizontal)return T(w,S,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail)}},"sourceDetourCandidate"),C=[-7,7,-14,14,-21,21];for(let w=0;w<12;w++){const S=d();let E=!1;for(let _=0;_$.interior);for(const $ of B){for(const A of C){const I=g($,A);if(I&&p($.edge,I)){$.edge.points=I,E=!0;break}const O=b($,A);if(O&&p($.edge,O)){$.edge.points=O,E=!0;break}}if(E)break}}if(!E)return}}x(u5,"nudgeSharedInteriorSubpaths");function Mee(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}x(Mee,"segmentsIntersect");function Nee(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=see(e),a=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;he.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)he.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}x(Nee,"validateSwimlanesLayout");function Oee(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!Tee(t,e)||e==="BT"&&i.length>0&&!bee(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Fo(qw(l)))}Lee(n,r),Dee(n,r),Cee(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);Z2(n,a),hee(n,a),wee(n,a),u5(n,a),Eee(n,a),See(n,a),i5(n,a),kee(n,a);const s=x(()=>{Ree(n,a),_ee(n,a),Aee(n,a),Z2(n,a),r5(n,a),i5(n,a),Z2(n,a),r5(n,a)},"finalizeRenderedEdges");s(),u5(n,a),s(),a5(n,a),s5(n,a),a5(n,a),s5(n,a)}x(Oee,"postProcessSwimlaneLayout");function lu(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const a of t.edges){if(!e.has(a.src)||!e.has(a.dst))continue;const s=`${a.id}:${a.src}->${a.dst}`;r.has(s)||(r.add(s),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}x(lu,"normalizeGraph");function QO(t,e){return t.edges.filter(r=>r.dst===e)}x(QO,"incoming");function $ee(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}x($ee,"buildSuccessorMap");function JO(t){const e=$ee(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}x(JO,"buildSortedSuccessorMap");function e$(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}x(e$,"buildInDegreeMap");function t$(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}x(t$,"sortedZeroInDegreeNodes");function ck(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}x(ck,"buildPredecessorSuccessorMaps");function r$(t,e,r,n){var s,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}x(r$,"buildLayersFromRanks");function Gb(t){const e=e$(t),r=t$(e),n=[],i=JO(t);for(;r.length;){const a=r.shift();n.push(a);for(const s of i.get(a)??[])if(e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const a=n+i>>1;let s=r(n,a)+r(a,i),o=n,l=a,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],a=x(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?a(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),s=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of s)n[h]===0&&a(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}x(Pee,"removeCycles_DFS");function Bee(t){const e=new Map,r=x(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const a=i.parentId;if(!a)return e.set(n,null),null;const o=r(a)??a;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}x(Bee,"buildTopLaneMap");function tc(t){const e=Bee(t);return r=>e.get(r)??null}x(tc,"createTopLaneResolver");function uk(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}x(uk,"buildTopLaneOrder");function i$(t,e){const r=uk(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const s of e)!n.has(s)||i.has(s)||(i.add(s),a.push(s));for(const s of r)i.has(s)||a.push(s);return a}x(i$,"resolveTopLaneOrder");var uPe={EPSILON:1e-6},jw={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},dz={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Fee(t,e){const r=lu(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=ck(r);for(const w of a.values())w.sort((S,E)=>S.localeCompare(E));const s=Gb(r)??[...r.nodes].sort((w,S)=>w.localeCompare(S)),o=new Map;for(const[w,S]of s.entries())o.set(S,w);const l=new Map,u=new Map;for(const w of r.nodes)u.set(w,[]);for(const w of s){const S=(a.get(w)??[]).filter(E=>l.has(E));if(S.length>0){const E=zee(w,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(w,E),u.get(E).push(w)}else l.has(w)||l.set(w,null)}for(const w of r.nodes)l.has(w)||l.set(w,null);const h=new Set;for(const w of r.nodes)(l.get(w)??null)===null&&h.add(w);const d=[...h].sort((w,S)=>{const E=o.get(w)??0,_=o.get(S)??0;return E===_?w.localeCompare(S):E-_}),f=Gee(r),p=new Map;for(const[w,S]of f.entries())p.set(w,[...S].sort((E,_)=>E.localeCompare(_)));const g=Vee(p),m=Wee(p),y=new Map;for(const w of r.nodes)y.set(w,[]);for(const w of m)for(const S of w.nodes){const E=y.get(S);E?E.push(w.id):y.set(S,[w.id])}const v=[],T=[],b=new Set,C=x(w=>{if(!b.has(w)){b.add(w),v.push(w);for(const S of u.get(w)??[])C(S);T.push(w)}},"walk");for(const w of d)C(w);for(const w of s)C(w);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:T,topologicalOrder:s}}x(Fee,"buildDrivingTree");function zee(t,e,r){const n=r.laneOf(t);return[...e].sort((a,s)=>{var m,y;const o=r.laneOf(a),l=r.laneOf(s),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[a],f=(y=r.rankHint)==null?void 0:y[s];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(s)??0;return p!==g?p-g:a.localeCompare(s)})[0]}x(zee,"chooseParent");function Gee(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}x(Gee,"buildAdjacency");function Vee(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const a=i.pop();if(!e.has(a)){e.set(a,r);for(const s of t.get(a)??[])e.has(s)||i.push(s)}}r++}return e}x(Vee,"assignComponents");function Wee(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=x((o,l)=>{e.set(o,++a),r.set(o,a);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??a,e.get(u)??a))):(n.push([o,u]),s(u,o),r.set(o,Math.min(r.get(o)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(qee(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}x(Wee,"computeBlocks");function qee(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const s=r.pop();if(i.push(s),a.add(s[0]),a.add(s[1]),s[0]===t&&s[1]===e||s[0]===e&&s[1]===t)break}return{id:n,edges:i,nodes:[...a]}}x(qee,"popBlock");function Uee(t,e,r){const n=[...t.nodes],i=new Map;for(const[T,b]of n.entries())i.set(b,T);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const T of n){const b=r.parent.get(T)??null,C=i.get(T);C!=null&&b==null&&(s[C]=-1,o[C]=0,u.has(T)||(u.add(T),l.push(T)))}for(;l.length>0;){const T=l.shift(),b=i.get(T);if(b==null)continue;const C=r.children.get(T)??[];for(const w of C){if(u.has(w))continue;const S=i.get(w);S!=null&&(s[S]=b,o[S]=o[b]+1,u.add(w),l.push(w))}}for(const T of n){if(u.has(T))continue;const b=i.get(T);b!=null&&(s[b]=-1,o[b]=0,u.add(T))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),d=Array.from({length:h},()=>new Array(a).fill(-1));for(let T=0;T{if(T===-1||b===-1)return-1;o[T]>w&1&&(T=d[w][T],T===-1))return-1;if(T===b)return T;for(let w=h-1;w>=0;w--){const S=d[w][T],E=d[w][b];S===-1||E===-1||S!==E&&(T=S,b=E)}return d[0][T]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const T of t.edges){let b=T.src,C=T.dst,w=e[b],S=e[C];if(w==null||S==null||(w>S&&([b,C]=[C,b],[w,S]=[S,w]),w==null||S==null||w===S))continue;const E=i.get(b),_=i.get(C);if(E==null||_==null)continue;const R=f(E,_);if(R===-1)continue;const D=p[R];for(let L=w;L{if(b.size!==0)for(const[C,w]of b)T.set(C,(T.get(C)??0)+w)},"mergeInto"),y=new Set,v=x(T=>{const b=i.get(T);y.add(T);const C=b==null?void 0:p[b],w=C?new Map(C):new Map,S=r.children.get(T)??[];for(const E of S){const _=v(E),R=e[T];if(R!=null){let D=g.get(T);D||(D=new Map,g.set(T,D));let L=_.get(R)??0;const B=e[E];B!=null&&B>R&&(L+=1),D.set(E,L)}m(w,_)}return w},"dfs");for(const T of r.roots)y.has(T)||v(T);for(const T of n)y.has(T)||v(T);return g}x(Uee,"computeSubtreeCrossCounts");function Hee(t,e,r){const n=new Map,i=x(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(a$(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(s=Math.min(s,u))}n.set(a,s)},"annotate");for(const a of t)i(a);return n}x(Hee,"annotateMinimumLayers");function a$(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}x(a$,"compareByRankThenId");function Yee(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const a=Array.from({length:i+1},()=>[]),s=new Set,o=x(l=>{if(s.has(l))return;s.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!s.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),s.add(l)}return a}x(Yee,"emitNodesInTreeOrder");function Xee(t){const e=[];for(const r of t){const n=new Set,i=[];for(const a of r)n.has(a)||(n.add(a),i.push(a));e.push(i)}return e}x(Xee,"deduplicateLayers");function jee(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const s=e[i]??0,o=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??s;d>s?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??s,m=n.get(d)??s;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}x(jee,"createChildOrderer");function Kw(t,e,r){const n=Fee(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=Uee(t,e,n),o=[...a].sort(a$(e)),l=Hee(o,i,e),u=jee(i,e,s,l);let h=Yee(o,t.nodes,e,u);return h=Xee(h),h}x(Kw,"buildMultitreeLayerOrder");function Kee(t,e,r){const n=new Set(t),i=new Set(e),a=R0(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return n$(s)}x(Kee,"countCrossingsBetweenAdjacent");function h5(t,e,r){const n=[];for(const a of e){const s=r[a.src],o=r[a.dst];if(s==null||o==null||s===o)continue;let l=a.src,u=a.dst,h=s,d=o;s>o&&(l=a.dst,u=a.src,h=o,d=s);for(let f=h;f(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const v of n.get(d)??[])p=Math.max(p,(r[v]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=Kw(t,r,i),y=h5(m,t.edges,r);y(e[i]??0)-(e[a]??0)||i.localeCompare(a));for(const i of n){const a=r(i);if(!a)continue;const s=t.edges.filter(m=>m.src===i);if(s.length===0)continue;let o=!1,l=0;for(const m of s){const y=r(m.dst);y==null||y===a?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const y=r(m.src);y&&(y===a?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}x(Qee,"adjustCrossLaneSources");function Jee(t,e){const r=lu(t),n=Gb(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=tc(r);let s=Object.create(null);for(const l of n){const u=QO(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=a(d.src),p=a(l);return!f||!p?!0:f===p}):u;if(h.length===0)s[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?s[l]=s[d]??0:s[l]=(s[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(s[f.src]??0)+1);s[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(s=Zee(r,s)),e!=null&&e.ignoreCrossLaneEdges&&Qee(r,s),{layers:Kw(r,s,a),rankOf:s,dummy:new Set}}x(Jee,"assignLayers_LongestPath");function ete(t,e){const r=lu(t),i={...Jee(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=tc(r),{preds:s,succs:o}=ck(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=a(g.src),y=a(g.dst);if(m&&y&&m!==y)return!1}return!0}),l=Gb(r)??[...r.nodes],u=[...l].reverse(),h=x((g,m)=>{let y=0;for(const b of s.get(g)??[])y=Math.max(y,(i[b]??0)+1);let v=Number.POSITIVE_INFINITY;const T=o.get(g)??[];return T.length>0&&(v=Math.min(...T.map(b=>(i[b]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=jw.GRAVITY_ITERATIONS,f=x(g=>{let m=!1;for(const y of g){const v=s.get(y)??[],T=o.get(y)??[];if(v.length===0&&T.length===0)continue;const b=v.length>0?v.reduce((E,_)=>E+(i[_]??0)+1,0)/v.length:i[y]??0,C=T.length>0?T.reduce((E,_)=>E+(i[_]??0)-1,0)/T.length:i[y]??0,w=Math.round((b+C)/2),S=h(y,w);S!==i[y]&&(i[y]=S,m=!0)}return m},"relaxOrder");for(let g=0;g0){const y=Math.min(...m.map(v=>(i[v]??0)-1));(i[g]??0)>y&&(i[g]=y)}}return{layers:r$(r,l,i),rankOf:i,dummy:new Set}}x(ete,"assignLayers_Gravity");function tte(t){const e=e$(t),r=JO(t);let n=t$(e);const i=[];for(;n.length>0;){const a=[];for(const s of n){i.push(s);for(const o of r.get(s)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&a.push(o)}n=a.sort((s,o)=>s.localeCompare(o))}return i.length===t.nodes.length?i:null}x(tte,"topoSortByGenerationIfAcyclic");function rte(t,e){const r=lu(t),n=(e==null?void 0:e.direction)==="LR"?tte(r)??[...r.nodes].sort():Gb(r)??[...r.nodes].sort(),i=tc(r),a=x(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=x((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(h)===a(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=QO(r,h);let p=0;if(f.length>0)for(const v of f){const T=v.src,b=s[T]??0;p=Math.max(p,b+l(T,h))}const g=a(h),m=o.get(g)??0,y=Math.max(p,m);s[h]=y,o.set(g,y+1)}return{layers:r$(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}x(rte,"assignLayers_LaneAwareCompact");function nte(t,e){const r=lu(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let s=0;const o=new Map(r.nodeById),l=x(p=>{const g=`placeholder-${s++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),a.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let y=p.src;for(let T=g+1,b=0;T!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}x(nte,"makeProperLayering");function d5(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}x(d5,"median");function f5(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}x(f5,"barycenter");function ite(t,e,r,n){const i=new Map;for(const a of t)i.set(a,[]);for(const a of r)n==="down"?e.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(e.get(a.src)):e.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(e.get(a.dst));return i}x(ite,"neighborPositionsFor");function ate(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}x(ate,"currentOrderTieBreak");function p5(t,e,r){const n=new Set(t),i=new Set(e),a=R0(t),s=R0(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:a.get(u.src),v:s.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return n$(l)}x(p5,"countCrossingsBetweenAdjacent");function Q2(t,e,r){return[...t].sort((n,i)=>{const a=d5(e.get(n)??[]),s=d5(e.get(i)??[]);return a===s?ate(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}x(Q2,"sortByHeuristic");function g5(t,e,r,n,i,a){const s=R0(t),o=R0(e),l=ite(e,s,r,n);if(!i||!a||a.length===0)return Q2(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=Q2(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=Q2(d,l,o);for(const p of f){const g=f5(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const T=f5(l.get(v)??[]);if(gs.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=x(m=>{let y=p5(t,m,u);return h&&n&&(y+=p5(m,n,h)),y},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(a);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,a=tc(e),s=i$(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=g5(n[l+1],n[l],i,"up",a,s),n[l]=m5(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}x(ste,"orderLayers");function ote(t,e,r){const n=(r==null?void 0:r.layerGap)??dz.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??dz.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,s=(r==null?void 0:r.direction)??"TB",o=s==="LR"||s==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=x(D=>e.nodeById.get(D),"getNode"),f=x(D=>{var L;return((L=d(D))==null?void 0:L.width)??0},"getWidth"),p=x(D=>{var L;return((L=d(D))==null?void 0:L.height)??0},"getHeight"),g=tc(e),m=i$(e,r==null?void 0:r.laneOrder),y=l.map(D=>D.reduce((L,B)=>Math.max(L,p(B)),0)),v=[];if(o)for(let D=0;D+1Math.max(M,f(P)),0),B=l[D+1].reduce((M,P)=>Math.max(M,f(P)),0),$=y[D],A=y[D+1],I=$/2+A/2,O=(L+B)/2,N=Math.max(0,O-I-n);v.push(N)}const T=new Set;for(const D of l)for(const L of D)T.add(g(L));const b=T.has(null),C=m.filter(D=>T.has(D)),w=[...b?[null]:[],...C],S=Object.create(null);for(const D of C)S[D]=0;b&&(S.null=0);for(const D of l){const L=Object.create(null),B=[];for(const $ of D){const A=g($);A===null?B.push($):(L[A]||(L[A]=[])).push($)}for(const[$,A]of Object.entries(L)){const I=A.reduce((O,N)=>O+f(N),0)+i*Math.max(0,A.length-1);S[$]=Math.max(S[$]??0,I)}if(b&&B.length){const $=B.reduce((A,I)=>A+f(I),0)+i*Math.max(0,B.length-1);S.null=Math.max(S.null??0,$)}}const E=new Map;{const D=w.map($=>($===null?S.null:S[$])??0);let B=-(D.reduce(($,A)=>$+A,0)+a*Math.max(0,w.length-1))/2;for(let $=0;$f(V)),P=M.reduce((V,z)=>V+z,0)+i*(O.length-1);let F=N-P/2;for(const[V,z]of O.entries()){const W=M[V];u[z]=F+W/2,h[z]=_+B/2,F+=W+i}}}const A=v[D]??0;_+=B+n+A}const R=new Map;for(const D of e.edges){const L=D.ref.id;R.has(L)||R.set(L,[]),R.get(L).push(D)}for(const[,D]of R){if(D.length===0)continue;const L=D[0].ref,B=L.start,$=L.end;if(B==null||$==null)continue;const A=Math.round(((u[B]??0)+(u[$]??0))/2),I=new Set;for(const O of D)I.add(O.src),I.add(O.dst);for(const O of I){if(O===B||O===$)continue;const N=e.nodeById.get(O);N!=null&&N.isDummy&&(u[O]=A)}}return{x:u,y:h}}x(ote,"assignCoordinates");var lte=8;function cte(t){let e=2166136261;for(let r=0;r>>0}x(cte,"hashString");function ute(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}x(ute,"mulberry32");function hte(t,e){const r=[...t],n=ute(e);for(let i=r.length-1;i>0;i--){const a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}x(hte,"deterministicShuffle");function dte(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}x(dte,"sourceDistance");function y5(t,e){const r=new Map;for(const[i,a]of t.entries())r.set(a,i);let n=0;for(const{a:i,b:a,weight:s}of e){const o=r.get(i),l=r.get(a);o==null||l==null||(n+=s*Math.abs(o-l))}return n}x(y5,"laneArrangementCost");function fte(t){const e=uk(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=tc(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const s=typeof a.start=="string"?a.start:void 0,o=typeof a.end=="string"?a.end:void 0;if(!s||!o||!t.nodeById.has(s)||!t.nodeById.has(o))continue;const l=n(s),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}x(fte,"buildWeightedLaneEdges");function v5(t,e,r){const n=[...t];let i=y5(n,e),a=!0,s=0;const o=Math.max(1,n.length);for(;a&&si.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:s})=>`${i}:${a}:${s}`).join("|");return cte(`${t.join("|")}#${n}#${r}`)}x(gte,"seedForRestart");function mte(t,e={}){const r=uk(t);if(r.length<2)return r;const n=fte(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=v5(r,n,i);const s=Math.max(0,e.restarts??lte);for(let o=0;odr&&l*3>=o?s>0?"bottom":"top":o>dr?a>0?"right":"left":r}x(x5,"chooseOrthogonalSide");function b5(t,e){return Math.abs(t.to-e.from)se.isGroup&&!se.parentId);for(const se of u){const J={id:se.id},G=x(q=>{s.set(q.id,J),r.filter(H=>H.parentId===q.id).forEach(G)},"assignLane");G(se)}const h=r.filter(se=>!se.isGroup&&!se.isEdgeLabel).map(se=>{const J=se.width??10,G=se.height??10,q=se.x??0,H=se.y??0,Z=hPe;return{nodeId:se.id,minX:q-J/2-Z,maxX:q+J/2+Z,minY:H-G/2-Z,maxY:H+G/2+Z,visualXHalfExtent:l?G/2+Z:J/2+Z}}),d=x((se,J,G,q)=>{let H=o.find(Z=>Z.orientation===se&&Math.abs(Z.coord-J)<1);return H||(H={id:`pipe-${se}-${J.toFixed(0)}`,orientation:se,coord:J,spanMin:G,spanMax:q,tracks:[]},o.push(H)),H.spanMin=Math.min(H.spanMin,G),H.spanMax=Math.max(H.spanMax,q),H},"getOrAddPipe"),f=x((se,J)=>{const G=se.width??10,q=se.height??10,H=se.x??0,Z=se.y??0;switch(J){case"top":return{x:H,y:Z-q/2};case"bottom":return{x:H,y:Z+q/2};case"left":return{x:H-G/2,y:Z};case"right":return{x:H+G/2,y:Z}}},"portForSide"),p=x((se,J,G)=>f(se,x5(se,J,G?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,T=x((se,J,G)=>{if(g.length===0)return 0;const q=Math.abs(J.y-G.y)U||Y.from-dr<=te&&Y.to+dr>=te&&(Z+=v)}else if(H){const te=J.x,K=Math.min(J.y,G.y)-dr,U=Math.max(J.y,G.y)+dr;if(U<=K)return 0;for(const Y of g)Y.edgeIndex===se||Y.orientation!=="horizontal"||Y.pipe.coordU||Y.from-dr<=te&&Y.to+dr>=te&&(Z+=v)}return Z},"crossingPenalty"),b=i.map((se,J)=>{if(!se.start||!se.end)return{idx:J,crossLane:0,dx:0,dy:0};const G=a.get(se.start),q=a.get(se.end),H=s.get(se.start),Z=s.get(se.end),te=H&&Z&&H.id!==Z.id?1:0,K=G&&q?Math.abs((q.x??0)-(G.x??0)):0,U=G&&q?Math.abs((q.y??0)-(G.y??0)):0;return{idx:J,crossLane:te,dx:K,dy:U}}).sort((se,J)=>{if(se.crossLane!==J.crossLane)return J.crossLane-se.crossLane;const G=se.dx+se.dy,q=J.dx+J.dy;return Math.abs(G-q)>1?G-q:se.idx-J.idx}).map(se=>se.idx),C=x((se,J,G,q)=>{const H=Math.min(se.x,J.x),Z=Math.max(se.x,J.x),te=Math.min(se.y,J.y),K=Math.max(se.y,J.y);return!!h.find(Y=>G&&Y.nodeId===G||q&&Y.nodeId===q?!1:Math.abs(se.x-J.x)>dr?Y.minYse.y&&Y.maxX>H&&Y.minXse.x&&Y.maxY>te&&Y.minYx5(se,J,"bottom"),"determineSide"),_=new Map;for(const[se,J]of i.entries()){if(!J.start||!J.end||J.start===J.end||J.points&&J.points.length>0)continue;const G=a.get(J.start),q=a.get(J.end);if(!G||!q)continue;const H=(q.x??0)-(G.x??0),Z=(q.y??0)-(G.y??0);_.set(se,{edgeIdx:se,srcId:J.start,dstId:J.end,srcSide:E(G,{x:q.x??0,y:q.y??0}),dstSide:E(q,{x:G.x??0,y:G.y??0}),absDx:Math.abs(H),absDy:Math.abs(Z),dxSign:Math.sign(H),dySign:Math.sign(Z)})}const R=x(se=>se.srcSide==="top"||se.srcSide==="bottom"?se.absDx===0?1/0:se.absDy/se.absDx:se.absDy===0?1/0:se.absDx/se.absDy,"preferenceStrength"),D=x(se=>se.srcSide==="top"||se.srcSide==="bottom"?se.dxSign>=0?"right":"left":se.dySign>=0?"bottom":"top","secondarySide"),L=new Map;for(const se of _.values()){const J=`${se.srcId}:${se.srcSide}`;L.has(J)||L.set(J,[]),L.get(J).push(se)}const B=new Map,$=x((se,J)=>`${se}:${J}`,"loadKey");for(const se of _.values())B.set($(se.srcId,se.srcSide),(B.get($(se.srcId,se.srcSide))??0)+1),B.set($(se.dstId,se.dstSide),(B.get($(se.dstId,se.dstSide))??0)+1);for(const se of L.values())if(!(se.length<2)){se.sort((J,G)=>{const q=R(J),H=R(G);return Math.abs(q-H)>1e-9?H-q:J.edgeIdx-G.edgeIdx});for(let J=1;J=H||(B.set($(G.srcId,G.srcSide),H-1),B.set($(G.srcId,q),Z+1),G.srcSide=q)}}const A=x(se=>{const J=se==null?void 0:se.shape;return J==="question"||J==="diamond"},"isDiamondNode"),I=new Map;for(const se of _.values())I.has(se.dstId)||I.set(se.dstId,new Set),I.get(se.dstId).add(se.dstSide);for(const se of _.values()){if(!A(a.get(se.srcId)))continue;const J=I.get(se.srcId);if(!(J!=null&&J.has(se.srcSide)))continue;const G=D(se);if(J.has(G)||(B.get($(se.srcId,G))??0)>0)continue;const q=B.get($(se.srcId,se.srcSide))??0;B.set($(se.srcId,se.srcSide),Math.max(0,q-1)),B.set($(se.srcId,G),1),se.srcSide=G}for(const se of _.values()){const{edgeIdx:J,srcId:G,dstId:q,srcSide:H,dstSide:Z}=se,te=a.get(G),K=a.get(q),U=`${G}:${H}:src`,Y=H==="top"||H==="bottom"?K.x??0:K.y??0;w.has(U)||w.set(U,[]),w.get(U).push({edgeIdx:J,oppositeCoord:Y});const fe=`${q}:${Z}:dst`,ue=Z==="top"||Z==="bottom"?te.x??0:te.y??0;w.has(fe)||w.set(fe,[]),w.get(fe).push({edgeIdx:J,oppositeCoord:ue})}const O=new Map,N=8;for(const[se,J]of w){if(J.length<2)continue;J.sort((Le,_e)=>Le.oppositeCoord-_e.oppositeCoord);const G=se.split(":"),q=G.slice(0,-2).join(":"),H=G[G.length-2],Z=G[G.length-1],te=a.get(q);if(!te)continue;const U=H==="left"||H==="right"?te.height??10:te.width??10,Y=te.shape,ue=Y==="question"||Y==="diamond"?U*.3:U,ge=Math.min(20,Math.max(N,ue/(J.length+1))),xe=-(ge*(J.length-1))/2;for(const[Le,_e]of J.entries()){const Be=xe+Le*ge,Ee=`${_e.edgeIdx}:${Z}`;O.set(Ee,Be)}}const M=x(se=>{var J;return!!((J=i[se])!=null&&J.labelNodeId)},"edgeHasLabelNode"),P=x((se,J)=>se?(w.get(`${se}:${J}:src`)??[]).some(({edgeIdx:G})=>M(G))||(w.get(`${se}:${J}:dst`)??[]).some(({edgeIdx:G})=>M(G)):!1,"faceHasLabelNode"),F=x((se,J,G)=>J==="top"||J==="bottom"?{x:se.x+G,y:se.y}:{x:se.x,y:se.y+G},"applyPortOffset"),V=x((se,J,G)=>{const q=_.get(se),H={x:G.x??0,y:G.y??0},Z={x:J.x??0,y:J.y??0},te=(q==null?void 0:q.srcSide)??E(J,H),K=(q==null?void 0:q.dstSide)??E(G,Z);let U=q?f(J,q.srcSide):p(J,H,!0),Y=q?f(G,q.dstSide):p(G,Z,!1);const fe=O.get(`${se}:src`),ue=O.get(`${se}:dst`);return fe!==void 0&&(U=F(U,te,fe)),ue!==void 0&&(Y=F(Y,K,ue)),{pSrcPort:U,pDstPort:Y,srcSide:te,dstSide:K}},"portsForEdge");for(const se of b){const J=i[se];if(m[se]=[],!J.start||!J.end||J.points&&J.points.length>0||J.start===J.end)continue;const G=a.get(J.start),q=a.get(J.end);if(!G||!q)continue;const{pSrcPort:H,pDstPort:Z,srcSide:te,dstSide:K}=V(se,G,q),U={...H},Y={...Z},fe=te==="top"||te==="bottom",ue=K==="top"||K==="bottom";if(fe){const je=H.y>(G.y??0);U.y=je?H.y+cs:H.y-cs}else{const je=H.x>(G.x??0);U.x=je?H.x+cs:H.x-cs}if(ue){const je=Z.y>(q.y??0);Y.y=je?Z.y+cs:Z.y-cs}else{const je=Z.x>(q.x??0);Y.x=je?Z.x+cs:Z.x-cs}const Te=x((je,tt)=>{for(const xt of h)if(!tt.includes(xt.nodeId)&&je.x>xt.minX&&je.xxt.minY&&je.y{if(ir){const pt=je.y>(tt.y??0);return{x:(xt.x??0)>=je.x?Wt.maxX+Ru:Wt.minX-Ru,y:pt?Wt.maxY+Kd:Wt.minY-Kd,leavesPositiveSide:pt}}const st=je.x>(tt.x??0),rt=(xt.y??0)>=je.y;return{x:st?Wt.maxX+Ru:Wt.minX-Ru,y:rt?Wt.maxY+Kd:Wt.minY-Kd,leavesPositiveSide:st}},"obstacleDetour");let we=[];const xe=[J.start,J.end],Le=Te(U,xe);if(Le.inside&&Le.obstacle){const je=Le.obstacle;if(fe){const tt=ge(H,G,q,je,!0);U.x=tt.x,U.y=tt.y;const xt=tt.leavesPositiveSide?Math.min(je.minY-2,H.y+cs):Math.max(je.maxY+2,H.y-cs);we=[{x:H.x,y:xt},{x:tt.x,y:xt},{x:tt.x,y:tt.y}]}else{const tt=ge(H,G,q,je,!1),xt=tt.leavesPositiveSide?Math.min(je.minX-2,H.x+cs):Math.max(je.maxX+2,H.x-cs);U.x=tt.x,U.y=tt.y,we=[{x:xt,y:H.y},{x:xt,y:tt.y},{x:tt.x,y:tt.y}]}}let _e=[];const Be=Te(Y,xe);if(Be.inside&&Be.obstacle){const je=Be.obstacle;if(ue){const tt=ge(Z,q,G,je,!0);Y.x=tt.x,Y.y=tt.y,_e=[{x:tt.x,y:tt.y},{x:Z.x,y:tt.y}]}else{const tt=ge(Z,q,G,je,!1);Y.x=tt.x,Y.y=tt.y,_e=[{x:tt.x,y:tt.y},{x:tt.x,y:Z.y}]}}if(we.length===0&&_e.length===0){const je=Ru,tt=Math.abs(U.x-Y.x)1||st>1,pt=S.get(J.start??"")??0,Ze=S.get(J.end??"")??0,At=ir>1&&P(J.start,te)||st>1&&P(J.end,K),De=ir<=1||pt<=2,Pr=st<=1||Ze<=2;if((tt||xt)&&!Wt&&(!rt||rt&&!At&&De&&Pr)&&!C(H,Z,J.start,J.end)){J.points=[{...H},{...U},{...Y},{...Z}],y.add(se);const gr=xt?"horizontal":"vertical",xn=xt?H.y:H.x,cr=xt?Math.min(H.x,Z.x):Math.min(H.y,Z.y),Vr=xt?Math.max(H.x,Z.x):Math.max(H.y,Z.y),mr={id:`fast-path-${gr}-${xn.toFixed(0)}-${se}`,orientation:gr,coord:xn,spanMin:cr,spanMax:Vr,tracks:[]};g.push({edgeIndex:se,segmentIndex:0,orientation:gr,pipe:mr,trackIndex:0,from:cr,to:Vr});continue}}const Ee=d("vertical",U.x,U.y,U.y);U.x=Ee.coord;const Xe=d("vertical",Y.x,Y.y,Y.y);Y.x=Xe.coord;let Re=Math.min(U.x,Y.x)-50,Qe=Math.max(U.x,Y.x)+50,it=Math.min(U.y,Y.y)-50,Ue=Math.max(U.y,Y.y)+50;for(const je of h){const tt=Math.min(U.x,Y.x),xt=Math.max(U.x,Y.x),Wt=Math.min(U.y,Y.y),ir=Math.max(U.y,Y.y);je.minXtt&&je.minYWt&&(Re=Math.min(Re,je.minX-XT),Qe=Math.max(Qe,je.maxX+XT),it=Math.min(it,je.minY-XT),Ue=Math.max(Ue,je.maxY+XT))}for(const je of h){if(je.maxXQe||je.maxYUe)continue;const tt=Ru;d("horizontal",je.minY-tt,Re,Qe),d("horizontal",je.maxY+tt,Re,Qe);const xt=Kd;d("vertical",je.minX-xt,it,Ue),d("vertical",je.maxX+xt,it,Ue)}d("horizontal",U.y,Re,Qe),d("horizontal",Y.y,Re,Qe);const mt=o.filter(je=>je.orientation==="horizontal"&&je.coord>=it&&je.coord<=Ue),ot=o.filter(je=>je.orientation==="vertical"&&je.coord>=Re&&je.coord<=Qe),Ke=x((je,tt)=>`${je.toFixed(1)},${tt.toFixed(1)}`,"getKey"),me=Ke(U.x,U.y),dt=Ke(Y.x,Y.y),at=new Map,et=new Map,ct=new Map,Gt=new Set,Se=[];at.set(me,0),ct.set(me,"n"),Se.push({key:me,f:Math.hypot(Y.x-U.x,Y.y-U.y),pt:U}),Gt.add(me);let We=[];const Je=x((je,tt)=>C(je,tt,J.start,J.end),"checkSegmentBlocked"),nt={x:Y.x,y:U.y},wt=Je(U,nt),Vt=Je(nt,Y),Mt=wt||Vt,Yt={x:U.x,y:Y.y},$t=Je(U,Yt),tr=Je(Yt,Y);if(Mt?$t||tr||(Math.abs(U.x-Y.x)0;){Se.sort((Ze,At)=>Ze.f-At.f);const je=Se.shift();if(Gt.delete(je.key),je.key===dt){let Ze=dt,At=Y;for(We=[At];et.has(Ze);){const De=et.get(Ze);We.unshift(De),At=De,Ze=Ke(De.x,De.y)}break}const tt=je.pt.x,xt=je.pt.y,Wt=ot.sort((Ze,At)=>Ze.coord-At.coord),ir=Wt.findIndex(Ze=>Math.abs(Ze.coord-tt)<1),st=mt.sort((Ze,At)=>Ze.coord-At.coord),rt=st.findIndex(Ze=>Math.abs(Ze.coord-xt)<1),pt=[];ir>0&&pt.push({x:Wt[ir-1].coord,y:xt}),ir>=0&&ir0&&pt.push({x:tt,y:st[rt-1].coord}),rt>=0&&rtPn.nodeId===J.start||Pn.nodeId===J.end?!1:At!==De?Pn.minYxt&&Pn.maxX>At&&Pn.minXtt&&Pn.maxY>Pr&&Pn.minY10&&co<-5||$i<-10&&co>5)&&(Vr=Math.abs(co)*100),(mr>10&&Ls<-5||mr<-10&&Ls>5)&&(Vr+=Math.abs(Ls)*50);let Cu=0;const wu=ct.get(je.key)??"n",Eu=Math.abs(Ls)>dr?"h":"v";wu!=="n"&&wu!==Eu&&(Cu=50);const Hn=xn+cr+Vr+Cu,Ca=(at.get(je.key)??1/0)+Hn,xi=Math.abs(Y.x-Ze.x)+Math.abs(Y.y-Ze.y);if(Ca<(at.get(gr)??1/0))if(et.set(gr,je.pt),at.set(gr,Ca),ct.set(gr,Eu),!Gt.has(gr))Se.push({key:gr,f:Ca+xi,pt:Ze}),Gt.add(gr);else{const Pn=Se.findIndex(Ua=>Ua.key===gr);Pn!==-1&&(Se[Pn].f=Ca+xi)}}}if(We.length===0&&(We=[U,{x:U.x,y:Y.y},Y]),We.length>4){const je=We[0],tt=We[We.length-1];let xt=Math.min(je.x,tt.x),Wt=Math.max(je.x,tt.x),ir=Math.min(je.y,tt.y),st=Math.max(je.y,tt.y);for(const Pr of We)xt=Math.min(xt,Pr.x),Wt=Math.max(Wt,Pr.x),ir=Math.min(ir,Pr.y),st=Math.max(st,Pr.y);const rt=Wt>Math.max(je.x,tt.x),pt=xtcr.minXOe&&cr.minYar);if(xn.length>0){let cr=Math.max(je.x,tt.x);for(const Vr of xn){const mr=(Vr.minX+Vr.maxX)/2;if(Vr.visualXHalfExtent===void 0||isNaN(Vr.visualXHalfExtent))continue;const $i=mr+Vr.visualXHalfExtent+Pr;cr=Math.max(cr,$i)}isNaN(cr)||(Wt=cr)}}if(pt){const Oe=h.filter(ar=>ar.minXMath.min(je.y,tt.y));if(Oe.length>0){let ar=Math.min(je.x,tt.x);for(const gr of Oe){const cr=(gr.minX+gr.maxX)/2-gr.visualXHalfExtent-Pr;ar=Math.min(ar,cr)}xt=ar}}}const Ze=x(Pr=>{const Oe=tt.y>je.y,ar=h.filter(cr=>{const Vr=Math.min(je.x,tt.x)cr.minX,mr=Math.min(je.y,tt.y)cr.minY;return Vr&&mr});let gr=ar;if(l&&ar.length>0){const cr=ar.filter(Vr=>Vr.minXPr);cr.length>0&&(gr=cr)}if(gr.length===0)return tt.y;const xn=Ru;if(Oe){const Vr=Math.max(...gr.map(mr=>mr.maxY))+xn;if(Vrmr.minY))-xn;if(Vr>tt.y+dr)return Vr}return tt.y},"findBestReturnY"),At=x(Pr=>{const Oe=Ze(Pr),ar={x:Pr,y:je.y},gr={x:Pr,y:Oe},xn={x:tt.x,y:Oe},cr=Je(je,ar),Vr=Je(ar,gr),mr=Je(gr,xn),$i=Oe!==tt.y?Je(xn,tt):!1;return!cr&&!Vr&&!mr&&!$i?Math.abs(Oe-tt.y)=3){const je=Xt[Xt.length-1],tt=Xt[Xt.length-2],xt=Xt[Xt.length-3],Wt=Math.abs(xt.y-tt.y)Math.abs(je.x-xt.x)&&Xt.splice(-2,1)}else if(ir){const st=Math.sign(tt.y-xt.y),rt=Math.sign(je.y-xt.y);st!==0&&st===rt&&Math.abs(tt.y-xt.y)>Math.abs(je.y-xt.y)&&Xt.splice(-2,1)}}const hr=[Xt[0]];for(let je=1;jett.x,st=Wt.x>xt.x;if(ir!==st){hr.push(xt);continue}continue}if(Math.abs(tt.x-xt.x)tt.y,st=Wt.y>xt.y;if(ir!==st){hr.push(xt);continue}continue}hr.push(xt)}hr.push(Xt[Xt.length-1]);for(let je=0;jese.from{const H=!q.segments.some(te=>(te.edgeIndex!==J.edgeIndex||te.segmentIndex!==J.segmentIndex)&&z(te,se)),Z=!G.segments.some(te=>(te.edgeIndex!==se.edgeIndex||te.segmentIndex!==se.segmentIndex)&&z(te,J));return H&&Z?(se.trackIndex=q.index,J.trackIndex=G.index,G.segments=[...G.segments.filter(te=>te.edgeIndex!==se.edgeIndex||te.segmentIndex!==se.segmentIndex),{edgeIndex:J.edgeIndex,segmentIndex:J.segmentIndex,from:J.from,to:J.to}],q.segments=[...q.segments.filter(te=>te.edgeIndex!==J.edgeIndex||te.segmentIndex!==J.segmentIndex),{edgeIndex:se.edgeIndex,segmentIndex:se.segmentIndex,from:se.from,to:se.to}],!0):!1},"trySwapSegmentsAcrossTracks"),X=x(se=>{const J=se.tracks.length;return se.tracks[J]={index:J,coord:se.coord,segments:[]},J},"createNewTrack"),j=x((se,J)=>{const G=se.pipe.tracks[se.trackIndex];G.segments=G.segments.filter(H=>H.edgeIndex!==se.edgeIndex||H.segmentIndex!==se.segmentIndex),se.trackIndex=J,se.pipe.tracks[J].segments.push({edgeIndex:se.edgeIndex,segmentIndex:se.segmentIndex,from:se.from,to:se.to})},"moveSegmentToTrack"),re=x((se,J)=>{const G=m[se.edgeIndex];for(const q of G){const H=g[q];H.pipe===se.pipe&&j(H,J)}},"moveSegmentChainToTrack"),Q=x(se=>{const J=m[se.edgeIndex],G=J.indexOf(g.indexOf(se)),q=[];return G>0&&q.push(g[J[G-1]]),G{if(se.orientation===J.orientation)return!1;const G=se.orientation==="horizontal"?se:J,q=se.orientation==="horizontal"?J:se;return q.pipe.coord>G.from&&q.pipe.coordq.from&&G.pipe.coord{for(const G of se.tracks)if(!G.segments.some(H=>(H.edgeIndex!==J.edgeIndex||H.segmentIndex!==J.segmentIndex)&&z(H,J)))return G.index;return-1},"findAvailableTrack"),ne=x((se,J)=>{if(se.trackIndex===J.trackIndex)return z(se,J);const G=Q(se),q=Q(J);return G.some(H=>q.some(Z=>oe(H,Z)))},"segmentsConflict"),ie=x((se,J,G)=>{if(W(se,J,se.pipe.tracks[se.trackIndex],J.pipe.tracks[J.trackIndex]))return;const q=ee(se.pipe,J);G(J,q!==-1?q:X(se.pipe))},"resolveTrackConflict"),ae=x(se=>{let J=0;for(let G=0;G{if(de.has(se))return de.get(se);const J=m[se];if(J.length===0){const K={dest:0,deviation:0,base:0,delta:0};return de.set(se,K),K}const q=g[J[0]].pipe.coord;let H=q;for(let K=1;KMath.abs(fe-q)?Y:fe;break}}const Z=Math.abs(H-q),te={dest:H,deviation:Z,base:q,delta:H-q};return de.set(se,te),te},"getDestInfo"),ye=x(()=>{let se=0;const J=new Map;for(const[q,H]of i.entries())m[q].length!==0&&H.start&&(J.has(H.start)||J.set(H.start,[]),J.get(H.start).push(q));const G=x(q=>{const H=i[q];if(!H.start||!H.end)return 0;const Z=a.get(H.start),te=a.get(H.end);if(!Z||!te)return 0;const K=(te.x??0)-(Z.x??0),U=(te.y??0)-(Z.y??0);return Math.abs(K)+Math.abs(U)},"getEdgeDistance");for(const q of J.values()){q.sort((Z,te)=>{const K=le(Z),U=le(te);if(Math.abs(K.deviation-U.deviation)>1)return K.deviation-U.deviation;if(Math.abs(K.dest-U.dest)>1)return K.dest-U.dest;const Y=G(Z),fe=G(te);if(Math.abs(Y-fe)>1)return fe-Y;const ue=m[Z].length,Te=m[te].length;if(ue!==Te)return ue-Te;if(ue===1){const ge=m[Z][0],we=m[te][0];if(g[ge]&&g[we]){const xe=g[ge],Le=g[we],_e=Math.abs(xe.to-xe.from),Be=Math.abs(Le.to-Le.from);if(Math.abs(_e-Be)>1)return _e-Be}}return 0});const H=q.map(Z=>g[m[Z][0]]);se+=ae(H)}return se},"fixSourceHandleCrossings"),$e=x(()=>{let se=0;const J=new Map;for(const[G,q]of i.entries())m[G].length!==0&&q.end&&(J.has(q.end)||J.set(q.end,[]),J.get(q.end).push(G));for(const G of J.values()){G.sort((H,Z)=>{const te=x(Y=>{const fe=m[Y];if(fe.length<2)return 0;const ue=g[fe[fe.length-2]];return Math.abs(ue.to-ue.from)},"getDist"),K=te(H),U=te(Z);return Math.abs(K-U)>.1?K-U:H-Z});const q=G.map(H=>g[m[H][m[H].length-1]]);se+=ae(q)}return se},"fixTargetHandleCrossings"),Fe=x(()=>{let se=0;for(const J of o){const G=[];for(const q of J.tracks)for(const H of q.segments){const Z=m[H.edgeIndex].find(te=>g[te].segmentIndex===H.segmentIndex);Z!==void 0&&G.push(g[Z])}G.sort((q,H)=>q.edgeIndex-H.edgeIndex||q.segmentIndex-H.segmentIndex);for(let q=0;q{q.segments.forEach(H=>{J.push({edgeIndex:H.edgeIndex,segmentIndex:H.segmentIndex,trackIndex:q.index,from:H.from,to:H.to})})}),J.sort((q,H)=>q.from-H.from);const G=[];if(J.length>0){let q=[J[0]],H=J[0].to;for(let Z=1;ZH.add(ge.trackIndex));const Z=new Map;q.forEach(ge=>{const we=le(ge.edgeIndex);Z.set(ge.trackIndex,(Z.get(ge.trackIndex)??0)+we.delta)});const te=[...H].filter(ge=>(Z.get(ge)??0)<-1),K=[...H].filter(ge=>(Z.get(ge)??0)>1),U=[...H].filter(ge=>Math.abs(Z.get(ge)??0)<=1);te.sort((ge,we)=>(Z.get(we)??0)-(Z.get(ge)??0)),K.sort((ge,we)=>(Z.get(ge)??0)-(Z.get(we)??0));const Y=x((ge,we)=>{q.filter(xe=>xe.trackIndex===ge).forEach(xe=>{const Le=y.has(xe.edgeIndex)?se.coord:we;Ce.set(`${xe.edgeIndex}-${xe.segmentIndex}`,Le)})},"assignCoord");let fe=0;for(const ge of te)fe++,Y(ge,se.coord-fe*vR);if(U.length===0&&H.size>0){const ge=[...H].sort((Le,_e)=>Math.abs(Z.get(Le)??0)-Math.abs(Z.get(_e)??0))[0],we=te.indexOf(ge);we!==-1&&te.splice(we,1);const xe=K.indexOf(ge);xe!==-1&&K.splice(xe,1),U.push(ge)}let ue=0;for(const ge of U){if(ue===0)Y(ge,se.coord);else{const we=ue%2===1?1:-1,xe=Math.ceil(ue/2);Y(ge,se.coord+we*xe*vR*.5)}ue++}let Te=0;for(const ge of K)Te++,Y(ge,se.coord+Te*vR)}}for(const[se,J]of i.entries()){const G=m[se]??[];if(G.length===0)continue;const q=[],H=a.get(J.start),Z=a.get(J.end),{pSrcPort:te,pDstPort:K}=V(se,H,Z),U=G.map(ue=>{const Te=g[ue],ge=Ce.get(`${Te.edgeIndex}-${Te.segmentIndex}`)??Te.pipe.coord;return{orient:Te.orientation,coord:ge,from:Te.from,to:Te.to}});q.push(te);for(let ue=0;uedr&&q.push(Wu(Te,we)),_e&&Le.orient===Te.orient)if(Math.abs(Te.coord-Le.coord)>dr){const Be=Te.orient==="vertical"?(we+Le.from)/2:b5(Te,Le);q.push(Wu(Te,Be),Wu(Le,Be))}else(ue===0||ue===U.length-2)&&q.push(Wu(Te,b5(Te,Le)));else if(_e)q.push(Wu(Te,Le.coord));else{const Be=Math.abs(Te.from-we)dr||Math.abs(Y.y-K.y)>dr)&&q.push(K);const fe=[];q.length>0&&fe.push(q[0]);for(let ue=1;uedr||Math.abs(Te.y-ge.y)>dr)&&fe.push(Te)}J.points=fe}for(const se of i){const J=se.__originalEdge;J&&se.points&&(J.points=se.points)}t.edges=(t.edges??[]).filter(se=>!se.isLayoutOnly);const Ne=x((se,J)=>{const G=J.x??0,q=J.y??0,H=J.width??0,Z=J.height??0;if(H<=0||Z<=0)return se;const te=G-H/2,K=G+H/2,U=q-Z/2,Y=q+Z/2;if(se.xK||se.yY)return se;const fe=se.x-te,ue=K-se.x,Te=se.y-U,ge=Y-se.y,we=Math.min(fe,ue,Te,ge);return we===fe?{x:te,y:se.y}:we===ue?{x:K,y:se.y}:we===Te?{x:se.x,y:U}:{x:se.x,y:Y}},"nodeBoundaryClamp");for(const se of t.edges){const J=se.points;if(!J||J.length<2)continue;const G=se.start,q=se.end,H=G?a.get(G):void 0,Z=q?a.get(q):void 0;H&&(J[0]=Ne(J[0],H)),Z&&(J[J.length-1]=Ne(J[J.length-1],Z))}return t}x(vte,"routeEdgesOrthogonal");function xte(t){return t.direction??"TB"}x(xte,"getSwimlaneDirection");function bte(t){var h,d,f,p,g;const e=ree(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,a=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,s=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=xte(t),{ordered:l,coordinates:u}=yte(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});nee(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;vte(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return Oee(t,o),Nee(t),o}x(bte,"runSwimlaneLayoutCore");function Tte(t){tee(t);const e=iee(t);t.nodes=e.nodes,t.edges=e.edges}x(Tte,"prepareSwimlaneLayout");var dPe=JS({prepareLayout:Tte,runLayoutCore:bte,afterPaint:JJ});const fPe=Object.freeze(Object.defineProperty({__proto__:null,render:dPe},Symbol.toStringTag,{value:"Module"}));function T5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function Cte(t,e,r){return(e=wte(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vPe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function xPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fn(t,e){return pPe(t)||vPe(t,e)||s$(t,e)||xPe()}function Zw(t){return gPe(t)||yPe(t)||s$(t)||bPe()}function TPe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function wte(t){var e=TPe(t,"string");return typeof e=="symbol"?e:e+""}function ti(t){"@babel/helpers - typeof";return ti=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ti(t)}function s$(t,e){if(t){if(typeof t=="string")return T5(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T5(t,e):void 0}}var jn=typeof window>"u"?null:window,fz=jn?jn.navigator:null;jn&&jn.document;var CPe=ti(""),Ete=ti({}),wPe=ti(function(){}),EPe=typeof HTMLElement>"u"?"undefined":ti(HTMLElement),Vb=function(e){return e&&e.instanceString&&Cn(e.instanceString)?e.instanceString():null},zt=function(e){return e!=null&&ti(e)==CPe},Cn=function(e){return e!=null&&ti(e)===wPe},Yr=function(e){return!Ja(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ir=function(e){return e!=null&&ti(e)===Ete&&!Yr(e)&&e.constructor===Object},SPe=function(e){return e!=null&&ti(e)===Ete},bt=function(e){return e!=null&&ti(e)===ti(1)&&!isNaN(e)},Ste=function(e){return bt(e)&&Math.floor(e)===e},Qw=function(e){if(EPe!=="undefined")return e!=null&&e instanceof HTMLElement},Ja=function(e){return Wb(e)||kte(e)},Wb=function(e){return Vb(e)==="collection"&&e._private.single},kte=function(e){return Vb(e)==="collection"&&!e._private.single},o$=function(e){return Vb(e)==="core"},_te=function(e){return Vb(e)==="stylesheet"},kPe=function(e){return Vb(e)==="event"},Yc=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},_Pe=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},APe=function(e){return Ir(e)&&bt(e.x1)&&bt(e.x2)&&bt(e.y1)&&bt(e.y2)},RPe=function(e){return SPe(e)&&Cn(e.then)},LPe=function(){return fz&&fz.userAgent.match(/msie|trident|edge/i)},L0=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},PPe=function(e,r){return-1*Rte(e,r)},Ut=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+MPe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},zPe=function(e){var r,n=new RegExp("^"+IPe+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},GPe=function(e){return VPe[e.toLowerCase()]},Lte=function(e){return(Yr(e)?e:null)||GPe(e)||BPe(e)||zPe(e)||FPe(e)},VPe={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ite=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||A<0||T&&I>=f}function _(){var $=e();if(E($))return R($);g=setTimeout(_,S($))}function R($){return g=void 0,b&&h?C($):(h=d=void 0,p)}function D(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function L(){return g===void 0?p:R(e())}function B(){var $=e(),A=E($);if(h=arguments,d=this,m=$,A){if(g===void 0)return w(m);if(T)return clearTimeout(g),g=setTimeout(_,l),C(m)}return g===void 0&&(g=setTimeout(_,l)),p}return B.cancel=D,B.flush=L,B}return DR=s,DR}var QPe=ZPe(),Yb=qb(QPe),MR=jn?jn.performance:null,Nte=MR&&MR.now?function(){return MR.now()}:function(){return Date.now()},JPe=(function(){if(jn){if(jn.requestAnimationFrame)return function(t){jn.requestAnimationFrame(t)};if(jn.mozRequestAnimationFrame)return function(t){jn.mozRequestAnimationFrame(t)};if(jn.webkitRequestAnimationFrame)return function(t){jn.webkitRequestAnimationFrame(t)};if(jn.msRequestAnimationFrame)return function(t){jn.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Nte())},1e3/60)}})(),Jw=function(e){return JPe(e)},Pl=Nte,nh=9261,Ote=65599,xf=5381,$te=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nh,n=r,i;i=e.next(),!i.done;)n=n*Ote+i.value|0;return n},Vx=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nh;return r*Ote+e|0},Wx=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xf;return(r<<5)+r+e|0},e6e=function(e,r){return e*2097152+r},pc=function(e){return e[0]*2097152+e[1]},KT=function(e,r){return[Vx(e[0],r[0]),Wx(e[1],r[1])]},Rz=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},d$=function(e){e.splice(0,e.length)},u6e=function(e,r){for(var n=0;n"u"?"undefined":ti(Set))!==d6e?Set:f6e,fk=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!o$(e)){vn("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){vn("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new fv,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Yr(r.classes)?u=r.classes:zt(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hT?1:0},h=function(v,T,b,C,w){var S;if(b==null&&(b=0),w==null&&(w=n),b<0)throw new Error("lo must be non-negative");for(C==null&&(C=v.length);bD;0<=D?R++:R--)_.push(R);return _}).apply(this).reverse(),E=[],C=0,w=S.length;CL;0<=L?++_:--_)B.push(s(v,b));return B},m=function(v,T,b,C){var w,S,E;for(C==null&&(C=n),w=v[b];b>T;){if(E=b-1>>1,S=v[E],C(w,S)<0){v[b]=S,b=E;continue}break}return v[b]=w},y=function(v,T,b){var C,w,S,E,_;for(b==null&&(b=n),w=v.length,_=T,S=v[T],C=2*T+1;C0;){var S=T.pop(),E=y(S),_=S.id();if(f[_]=E,E!==1/0)for(var R=S.neighborhood().intersect(g),D=0;D0)for(M.unshift(N);d[F];){var V=d[F];M.unshift(V.edge),M.unshift(V.node),P=V.node,F=P.id()}return o.spawn(M)}}}},b6e={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(C){for(var w=0;w0;){if(w(),E++,C===h){for(var _=[],R=a,D=h,L=v[D];_.unshift(R),L!=null&&_.unshift(L),R=y[D],R!=null;)D=R.id(),L=v[D];return{found:!0,distance:d[C],path:this.spawn(_),steps:E}}p[C]=!0;for(var B=b._private.edges,$=0;$L&&(g[D]=L,T[D]=R,b[D]=w),!a){var B=R*h+_;!a&&g[B]>L&&(g[B]=L,T[B]=_,b[B]=w)}}}for(var $=0;$1&&arguments[1]!==void 0?arguments[1]:s,Ce=b(ce),Ne=[],Ie=Ce;;){if(Ie==null)return r.spawn();var Ae=T(Ie),be=Ae.edge,ke=Ae.pred;if(Ne.unshift(Ie[0]),Ie.same(ve)&&Ne.length>0)break;be!=null&&Ne.unshift(be),Ie=ke}return l.spawn(Ne)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=A6e(a,e,r),n--}return r},R6e={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(M){return M.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/_6e);if(a<2){vn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},Wte=function(e,r){return r===0?e:Wte(r,e%r)},O6e=function(e){for(var r=e[0],n=0;n0&&(r=Wte(r,e[n]));else return 0;return r},$6e=function(e){return Math.PI*e/180},ZT=function(e,r){return Math.atan2(r,e)-Math.PI/2},f$=Math.log2||function(t){return Math.log(t)/Math.log(2)},p$=function(e){return e>0?1:e<0?-1:0},Qh=function(e,r){return Math.sqrt(qu(e,r))},qu=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},P6e=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},F6e=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},z6e=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},G6e=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},qte=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},eC=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},tC=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=Fn(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Oz=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},g$=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Dc=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},$z=function(e,r){return Dc(e,r.x,r.y)},Ute=function(e,r){return Dc(e,r.x1,r.y1)&&Dc(e,r.x2,r.y2)},V6e=($R=Math.hypot)!==null&&$R!==void 0?$R:function(t,e){return Math.sqrt(t*t+e*e)};function W6e(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(_,R){return{x:_.x+R.x,y:_.y+R.y}},n=function(_,R){return{x:_.x-R.x,y:_.y-R.y}},i=function(_,R){return{x:_.x*R,y:_.y*R}},a=function(_,R){return _.x*R.y-_.y*R.x},s=function(_){var R=V6e(_.x,_.y);return R===0?{x:0,y:0}:{x:_.x/R,y:_.y/R}},o=function(_){for(var R=0,D=0;D<_.length;D++){var L=_[D],B=_[(D+1)%_.length];R+=L.x*B.y-B.x*L.y}return R/2},l=function(_,R,D,L){var B=n(R,_),$=n(L,D),A=a(B,$);if(Math.abs(A)<1e-9)return r(_,i(B,.5));var I=a(n(D,_),$)/A;return r(_,i(B,I))},u=t.map(function(E){return{x:E.x,y:E.y}});o(u)<0&&u.reverse();for(var h=u.length,d=[],f=0;f7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?jc(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,T=y;if(g=Mc(e,r,n,i,m,y,v,T,!1),g.length>0)return g}if(p){var b=n+h+o,C=i-d+u-o,w=b,S=i+d-u+o;if(g=Mc(e,r,n,i,b,C,w,S,!1),g.length>0)return g}if(f){var E=n-h+u-o,_=i+d+o,R=n+h-u+o,D=_;if(g=Mc(e,r,n,i,E,_,R,D,!1),g.length>0)return g}if(p){var L=n-h-o,B=i-d+u-o,$=L,A=i+d-u+o;if(g=Mc(e,r,n,i,L,B,$,A,!1),g.length>0)return g}var I;{var O=n-h+u,N=i-d+u;if(I=w1(e,r,n,i,O,N,u+o),I.length>0&&I[0]<=O&&I[1]<=N)return[I[0],I[1]]}{var M=n+h-u,P=i-d+u;if(I=w1(e,r,n,i,M,P,u+o),I.length>0&&I[0]>=M&&I[1]<=P)return[I[0],I[1]]}{var F=n+h-u,V=i+d-u;if(I=w1(e,r,n,i,F,V,u+o),I.length>0&&I[0]>=F&&I[1]>=V)return[I[0],I[1]]}{var z=n-h+u,W=i+d-u;if(I=w1(e,r,n,i,z,W,u+o),I.length>0&&I[0]<=z&&I[1]>=W)return[I[0],I[1]]}return[]},U6e=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},H6e=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},Y6e=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},X6e=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},j6e=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];X6e(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,T,b,C,w=0;w=0?Cu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Da=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},Bl=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=rE(h,-u);m=tE(y)}else m=h;return Da(e,r,m)},Z6e=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&T.push(y),v>=0&&v<=1&&T.push(v),T.length===0)return[];var b=T[0]*l[0]+e,C=T[0]*l[1]+r;if(T.length>1){if(T[0]==T[1])return[b,C];var w=T[1]*l[0]+e,S=T[1]*l[1]+r;return[b,C,w,S]}else return[b,C]},PR=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Mc=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,T=m*d-f*g;if(T!==0){var b=y/T,C=v/T,w=.001,S=0-w,E=1+w;return S<=b&&b<=E&&S<=C&&C<=E?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?PR(e,n,o)===o?[o,l]:PR(e,n,a)===a?[a,s]:PR(a,o,n)===n?[n,i]:[]:[]},J6e=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=rE(d,-l);p=tE(m)}else p=d}else p=n;for(var y,v,T,b,C=0;C2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=C)},get:function(b){return u[b]}},f=0;f0?I=A.edgesTo($)[0]:I=$.edgesTo(A)[0];var O=i(I);$=$.id(),E[$]>E[L]+O&&(E[$]=E[L]+O,_.nodes.indexOf($)<0?_.push($):_.updateItem($),S[$]=0,w[$]=[]),E[$]==E[L]+O&&(S[$]=S[$]+S[L],w[$].push(L))}else for(var N=0;N0;){for(var V=C.pop(),z=0;z0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},pBe=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:yBe,o=i,l,u,h=0;h=2?Yv(e,r,n,0,Gz,vBe):Yv(e,r,n,0,zz)},squaredEuclidean:function(e,r,n){return Yv(e,r,n,0,Gz)},manhattan:function(e,r,n){return Yv(e,r,n,0,zz)},max:function(e,r,n){return Yv(e,r,n,-1/0,xBe)}};I0["squared-euclidean"]=I0.squaredEuclidean;I0.squaredeuclidean=I0.squaredEuclidean;function gk(t,e,r,n,i,a){var s;return Cn(t)?s=t:s=I0[t]||I0.euclidean,e===0&&Cn(t)?s(i,a):s(e,r,n,i,a)}var bBe=Mi({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),y$=function(e){return bBe(e)},nE=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return gk(e,i.length,o,l,u,h)},FR=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},wBe=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][T.key]&&(l=n[m.key][T.key])):a.linkage==="max"?(l=n[g.key][T.key],n[g.key][T.key]0&&i.push(a);return i},Yz=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=Yz(e,r,n),i},Xz=function(e){for(var r=this.cy(),n=this.nodes(),i=OBe(e),a={},s=0;s=L?(B=L,L=A,$=I):A>B&&(B=A);for(var O=0;O0?1:0;E[R%i.minIterations*o+z]=W,V+=W}if(V>0&&(R>=i.minIterations-1||R==i.maxIterations-1)){for(var X=0,j=0;j1||S>1)&&(o=!0),d[b]=[],T.outgoers().forEach(function(_){_.isEdge()&&d[b].push(_.id())})}else f[b]=[void 0,T.target().id()]}):s.forEach(function(T){var b=T.id();if(T.isNode()){var C=T.degree(!0);C%2&&(l?u?o=!0:u=b:l=b),d[b]=[],T.connectedEdges().forEach(function(w){return d[b].push(w.id())})}else f[b]=[T.source().id(),T.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var C=b,w=[b],S,E,_;d[C].length;)S=d[C].shift(),E=f[S][0],_=f[S][1],C!=_?(d[_]=d[_].filter(function(R){return R!=S}),C=_):!a&&C!=E&&(d[E]=d[E].filter(function(R){return R!=S}),C=E),w.unshift(S),w.unshift(C);return w},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},JT=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var T=v.connectedNodes().intersection(e);y.merge(v),T.forEach(function(b){var C=b.id(),w=b.connectedEdges().intersection(e);y.merge(b),r[C].cutVertex?y.merge(w.filter(function(S){return S.isLoop()})):y.merge(w)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,T,b;m.forEach(function(C){y=C.source().id(),v=C.target().id(),T=y===p?v:y,T!==g&&(b=C.id(),o[b]||(o[b]=!0,s.push({x:p,y:T,edge:C})),T in r?r[p].low=Math.min(r[p].low,r[T].id):(u(f,T,p),r[p].low=Math.min(r[p].low,r[T].low),r[p].id<=r[T].low&&(r[p].cutVertex=!0,l(p,T))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},WBe={hopcroftTarjanBiconnected:JT,htbc:JT,htb:JT,hopcroftTarjanBiconnectedComponents:JT},e2=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},qBe={tarjanStronglyConnected:e2,tsc:e2,tscc:e2,tarjanStronglyConnectedComponents:e2},Jte={};[qx,x6e,b6e,C6e,E6e,k6e,R6e,nBe,pp,gp,E5,mBe,RBe,MBe,zBe,VBe,WBe,qBe].forEach(function(t){Ut(Jte,t)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) */var ere=0,tre=1,rre=2,no=function(e){if(!(this instanceof no))return new no(e);this.id="Thenable/1.0.7",this.state=ere,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};no.prototype={fulfill:function(e){return jz(this,tre,"fulfillValue",e)},reject:function(e){return jz(this,rre,"rejectReason",e)},then:function(e,r){var n=this,i=new no;return n.onFulfilled.push(Zz(e,i,"fulfill")),n.onRejected.push(Zz(r,i,"reject")),nre(n),i.proxy}};var jz=function(e,r,n,i){return e.state===ere&&(e.state=r,e[n]=i,nre(e)),e},nre=function(e){e.state===tre?Kz(e,"onFulfilled",e.fulfillValue):e.state===rre&&Kz(e,"onRejected",e.rejectReason)},Kz=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var o=0;o0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return oL=e,oL}var lL,bG;function cFe(){if(bG)return lL;bG=1;var t=vk();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return lL=e,lL}var cL,TG;function uFe(){if(TG)return cL;TG=1;var t=aFe(),e=sFe(),r=oFe(),n=lFe(),i=cFe();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Yr(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};rC.className=rC.classNames=rC.classes;var Ar={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Jn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ar.variable="(?:[\\w-.]|(?:\\\\"+Ar.metaChar+"))+";Ar.className="(?:[\\w-]|(?:\\\\"+Ar.metaChar+"))+";Ar.value=Ar.string+"|"+Ar.number;Ar.id=Ar.variable;(function(){var t,e,r;for(t=Ar.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Ar.comparatorOp+="|\\!"+e)})();var qr=function(){return{checks:[]}},Rt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},A5=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return PPe(t.selector,e.selector)}),GFe=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return Gr("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Gr("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Gr("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},YFe=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return zt(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case Rt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case Rt.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case Rt.DATA_BOOL:{var v=h.operator,T=h.field;return"["+e(v)+T+"]"}case Rt.DATA_EXIST:{var b=h.field;return"["+b+"]"}case Rt.META_COMPARE:{var C=h.operator,w=h.field;return"[["+w+n(e(C))+r(p)+"]]"}case Rt.STATE:return p;case Rt.ID:return"#"+p;case Rt.CLASS:return"."+p;case Rt.PARENT:case Rt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case Rt.ANCESTOR:case Rt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case Rt.COMPOUND_SPLIT:{var S=a(h.left,d),E=a(h.subject,d),_=a(h.right,d);return S+(S.length>0?" ":"")+E+_}case Rt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function hre(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return T$(this,t,e,hre)};function dre(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}D0.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return T$(this,t,e,dre)};function t8e(t,e,r){dre(t,e,r),hre(t,e,r)}D0.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return T$(this,t,e,t8e)};D0.ancestors=D0.parents;var Yx,fre;Yx=fre={data:Fr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Fr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Fr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Fr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Fr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Fr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Yx.attr=Yx.data;Yx.removeAttr=Yx.removeData;var r8e=fre,bk={};function PL(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:Qd("indegree",function(t,e){return te}),minOutdegree:Qd("outdegree",function(t,e){return te})});Ut(bk,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var T=v?m.position():{x:0,y:0};return a={x:g.x-T.x,y:g.y-T.y},e===void 0?a:a[e]}else if(!s)return;return this}};js.modelPosition=js.point=js.position;js.modelPositions=js.points=js.positions;js.renderedPoint=js.renderedPosition;js.relativePoint=js.relativePosition;var n8e=pre,M0=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},N0=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},i8e=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},mp,hu;mp=hu={};hu.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}};hu.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};hu.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(R,D,L){var B=0,$=0,A=D+L;return R>0&&A>0&&(B=D/A*R,$=L/A*R),{biasDiff:B,biasComplementDiff:$}}function g(R,D,L,B){if(L.units==="%")switch(B){case"width":return R>0?L.pfValue*R:0;case"height":return D>0?L.pfValue*D:0;case"average":return R>0&&D>0?L.pfValue*(R+D)/2:0;case"min":return R>0&&D>0?R>D?L.pfValue*D:L.pfValue*R:0;case"max":return R>0&&D>0?R>D?L.pfValue*R:L.pfValue*D:0;default:return 0}else return L.units==="px"?L.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var T=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(T=T*100/h.height.val);var b=p(h.width.val-d.w,m,y),C=b.biasDiff,w=b.biasComplementDiff,S=p(h.height.val-d.h,v,T),E=S.biasDiff,_=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-C+d.x1+d.x2+w)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-E+d.y1+d.y2+_)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},xc=function(e,r){return r==null?e:Ps(e,r.x1,r.y1,r.x2,r.y2)},Xv=function(e,r,n){return ta(e,r,n)},t2=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,eC(d,1),Ps(e,d.x1,d.y1,d.x2,d.y2)}}},BL=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=Xv(s,"labelWidth",n),d=Xv(s,"labelHeight",n),f=Xv(s,"labelX",n),p=Xv(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),T=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,C=b/2,w=r.pstyle("text-background-padding").pfValue,S=2,E=d,_=h,R=_/2,D=E/2,L,B,$,A;if(y)L=f-R,B=f+R,$=p-D,A=p+D;else{switch(M0(l.value)){case"left":L=f-_,B=f;break;case"center":L=f-R,B=f+R;break;case"right":L=f,B=f+_;break}switch(N0(u.value)){case"top":$=p-E,A=p;break;case"center":$=p-D,A=p+D;break;case"bottom":$=p,A=p+E;break}}var I=g-Math.max(T,C)-w-S,O=g+Math.max(T,C)+w+S,N=m-Math.max(T,C)-w-S,M=m+Math.max(T,C)+w+S;L+=I,B+=O,$+=N,A+=M;var P=n||"main",F=a.labelBounds,V=F[P]=F[P]||{};V.x1=L,V.y1=$,V.x2=B,V.y2=A,V.w=B-L,V.h=A-$,V.leftPad=I,V.rightPad=O,V.topPad=N,V.botPad=M;var z=y&&v.strValue==="autorotate",W=v.pfValue!=null&&v.pfValue!==0;if(z||W){var X=z?Xv(a.rstyle,"labelAngle",n):v.pfValue,j=Math.cos(X),re=Math.sin(X),Q=(L+B)/2,oe=($+A)/2;if(!y){switch(M0(l.value)){case"left":Q=B;break;case"right":Q=L;break}switch(N0(u.value)){case"top":oe=A;break;case"bottom":oe=$;break}}var ee=function(Fe,ce){return Fe=Fe-Q,ce=ce-oe,{x:Fe*j-ce*re+Q,y:Fe*re+ce*j+oe}},ne=ee(L,$),ie=ee(L,A),ae=ee(B,$),de=ee(B,A);L=Math.min(ne.x,ie.x,ae.x,de.x),B=Math.max(ne.x,ie.x,ae.x,de.x),$=Math.min(ne.y,ie.y,ae.y,de.y),A=Math.max(ne.y,ie.y,ae.y,de.y)}var le=P+"Rot",ye=F[le]=F[le]||{};ye.x1=L,ye.y1=$,ye.x2=B,ye.y2=A,ye.w=B-L,ye.h=A-$,Ps(e,L,$,B,A),Ps(a.labelBounds.all,L,$,B,A)}return e}},KG=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;mre(e,r,n,s,"outside",s/2)}},mre=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);xc(e,m)}else s!=null&&s>0&&tC(e,[s,s,s,s])}}},a8e=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;mre(e,r,n,i,a)}},s8e=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=ua(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],T=function($e){return $e.pstyle("display").value!=="none"},b=!i||T(e)&&(!u||T(e.source())&&T(e.target()));if(b){var C=0,w=0;i&&r.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(w=e.pstyle("overlay-padding").value));var S=0,E=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(E=e.pstyle("underlay-padding").value));var _=Math.max(w,E),R=0,D=0;if(i&&(R=e.pstyle("width").pfValue,D=R/2),l&&r.includeNodes){var L=e.position();g=L.x,m=L.y;var B=e.outerWidth(),$=B/2,A=e.outerHeight(),I=A/2;h=g-$,d=g+$,f=m-I,p=m+I,Ps(s,h,f,d,p),i&&KG(s,e),i&&r.includeOutlines&&!a&&KG(s,e),i&&a8e(s,e)}else if(u&&r.includeEdges)if(i&&!a){var O=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=D,d+=D,f-=D,p+=D,Ps(s,h,f,d,p),O==="haystack"){var N=y.haystackPts;if(N&&N.length===2){if(h=N[0].x,f=N[0].y,d=N[1].x,p=N[1].y,h>d){var M=h;h=d,d=M}if(f>p){var P=f;f=p,p=P}Ps(s,h-D,f-D,d+D,p+D)}}else if(O==="bezier"||O==="unbundled-bezier"||Ic(O,"segments")||Ic(O,"taxi")){var F;switch(O){case"bezier":case"unbundled-bezier":F=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=y.linePts;break}if(F!=null)for(var V=0;Vd){var Q=h;h=d,d=Q}if(f>p){var oe=f;f=p,p=oe}h-=D,d+=D,f-=D,p+=D,Ps(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(t2(s,e,"mid-source"),t2(s,e,"mid-target"),t2(s,e,"source"),t2(s,e,"target")),i){var ee=e.pstyle("ghost").value==="yes";if(ee){var ne=e.pstyle("ghost-offset-x").pfValue,ie=e.pstyle("ghost-offset-y").pfValue;Ps(s,s.x1+ne,s.y1+ie,s.x2+ne,s.y2+ie)}}var ae=o.bodyBounds=o.bodyBounds||{};Oz(ae,s),tC(ae,v),eC(ae,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Ps(s,h-_,f-_,d+_,p+_));var de=o.overlayBounds=o.overlayBounds||{};Oz(de,s),tC(de,v),eC(de,1);var le=o.labelBounds=o.labelBounds||{};le.all!=null?z6e(le.all):le.all=ua(),i&&r.includeLabels&&(r.includeMainLabels&&BL(s,e,null),u&&(r.includeSourceLabels&&BL(s,e,"source"),r.includeTargetLabels&&BL(s,e,"target")))}return s.x1=gs(s.x1),s.y1=gs(s.y1),s.x2=gs(s.x2),s.y2=gs(s.y2),s.w=gs(s.x2-s.x1),s.h=gs(s.y2-s.y1),s.w>0&&s.h>0&&b&&(tC(s,v),eC(s,1)),s},yre=function(e){var r=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:T8e,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this};Qc.removeAllListeners=function(){return this.removeListener("*")};Qc.emit=Qc.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Yr(e)||(e=[e]),C8e(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===b8e)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&u6e(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&zt(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":ti(Symbol))!=e&&ti(Symbol.iterator)!=e;r&&(iE[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return Cte({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Ir(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(zt(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});Ui.neighbourhood=Ui.neighborhood;Ui.closedNeighbourhood=Ui.closedNeighborhood;Ui.openNeighbourhood=Ui.openNeighborhood;Ut(Ui,{source:vs(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:vs(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:oV({attr:"source"}),targets:oV({attr:"target"})});function oV(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Ui.componentsOf=Ui.components;var Li=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){vn("A collection must have a reference to the core");return}var a=new kl,s=!1;if(!r)r=[];else if(r.length>0&&Ir(r[0])&&!Wb(r[0])){s=!0;for(var o=[],l=new fv,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var P=o.length===r.length?r:new Li(n,o),F=0;F0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(A){for(var I=A._private.edges,O=0;O0&&(t?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var B=0;B0?B=A:L=A;while(Math.abs($)>s&&++I=a?T(D,I):O===0?I:C(D,L,L+u)}var S=!1;function E(){S=!0,(t!==e||r!==n)&&b()}var _=function(L){return S||E(),t===e&&r===n?L:L===0?0:L===1?1:y(w(L),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var R="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return R},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var M8e=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),Kr=function(e,r,n,i){var a=D8e(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},iC={linear:function(e,r,n){return e+(r-e)*n},ease:Kr(.25,.1,.25,1),"ease-in":Kr(.42,0,1,1),"ease-out":Kr(0,0,.58,1),"ease-in-out":Kr(.42,0,.58,1),"ease-in-sine":Kr(.47,0,.745,.715),"ease-out-sine":Kr(.39,.575,.565,1),"ease-in-out-sine":Kr(.445,.05,.55,.95),"ease-in-quad":Kr(.55,.085,.68,.53),"ease-out-quad":Kr(.25,.46,.45,.94),"ease-in-out-quad":Kr(.455,.03,.515,.955),"ease-in-cubic":Kr(.55,.055,.675,.19),"ease-out-cubic":Kr(.215,.61,.355,1),"ease-in-out-cubic":Kr(.645,.045,.355,1),"ease-in-quart":Kr(.895,.03,.685,.22),"ease-out-quart":Kr(.165,.84,.44,1),"ease-in-out-quart":Kr(.77,0,.175,1),"ease-in-quint":Kr(.755,.05,.855,.06),"ease-out-quint":Kr(.23,1,.32,1),"ease-in-out-quint":Kr(.86,0,.07,1),"ease-in-expo":Kr(.95,.05,.795,.035),"ease-out-expo":Kr(.19,1,.22,1),"ease-in-out-expo":Kr(1,0,0,1),"ease-in-circ":Kr(.6,.04,.98,.335),"ease-out-circ":Kr(.075,.82,.165,1),"ease-in-out-circ":Kr(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return iC.linear;var i=M8e(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Kr};function uV(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function hV(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Jd(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=hV(t,i),o=hV(e,i);if(bt(s)&&bt(o))return uV(a,s,o,r,n);if(Yr(s)&&Yr(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=iC[p].apply(null,g)):s.easingImpl=iC[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,T=s.position;if(T&&i&&!t.locked()){var b={};Kv(v.x,T.x)&&(b.x=Jd(v.x,T.x,y,m)),Kv(v.y,T.y)&&(b.y=Jd(v.y,T.y,y,m)),t.position(b)}var C=s.startPan,w=s.pan,S=a.pan,E=w!=null&&n;E&&(Kv(C.x,w.x)&&(S.x=Jd(C.x,w.x,y,m)),Kv(C.y,w.y)&&(S.y=Jd(C.y,w.y,y,m)),t.emit("pan"));var _=s.startZoom,R=s.zoom,D=R!=null&&n;D&&(Kv(_,R)&&(a.zoom=Ux(a.minZoom,Jd(_,R,y,m),a.maxZoom)),t.emit("zoom")),(E||D)&&t.emit("viewport");var L=s.style;if(L&&L.length>0&&i){for(var B=0;B=0;E--){var _=S[E];_()}S.splice(0,S.length)},T=p.length-1;T>=0;T--){var b=p[T],C=b._private;if(C.stopped){p.splice(T,1),C.hooked=!1,C.playing=!1,C.started=!1,v(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||O8e(h,b,t),N8e(h,b,t,d),C.applying&&(C.applying=!1),v(C.frames),C.step!=null&&C.step(t),b.completed()&&(p.splice(T,1),C.hooked=!1,C.playing=!1,C.started=!1,v(C.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var $8e={animate:Fr.animate(),animation:Fr.animation(),animated:Fr.animated(),clearQueue:Fr.clearQueue(),delay:Fr.delay(),delayAnimation:Fr.delayAnimation(),stop:Fr.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Jw(function(a){dV(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){dV(s,e)},n.beforeRenderPriorities.animations):r()}},P8e={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Wb(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},i2=function(e){return zt(e)?new Kc(e):e},Are={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Tk(P8e,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,i2(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,i2(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,i2(r),n),this},once:function(e,r,n){return this.emitter().one(e,i2(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Fr.eventAliasesOn(Are);var L5={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};L5.jpeg=L5.jpg;var aC={layout:function(e){var r=this;if(e==null){vn("Layout options must be specified to make a layout");return}if(e.name==null){vn("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){vn("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;zt(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Ut({},e,{cy:r,eles:a}));return s}};aC.createLayout=aC.makeLayout=aC.layout;var B8e={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};I5.invalidateDimensions=I5.resize;var sC={collection:function(e,r){return zt(e)?this.$(e):Ja(e)?e.collection():Yr(e)?(r||(r={}),new Li(this,e,r.unique,r.removed)):new Li(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};sC.elements=sC.filter=sC.$;var gi={},ex="t",z8e="f";gi.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(C=1),o.color){var S=n.valueMin[0],E=n.valueMax[0],_=n.valueMin[1],R=n.valueMax[1],D=n.valueMin[2],L=n.valueMax[2],B=n.valueMin[3]==null?1:n.valueMin[3],$=n.valueMax[3]==null?1:n.valueMax[3],A=[Math.round(S+(E-S)*C),Math.round(_+(R-_)*C),Math.round(D+(L-D)*C),Math.round(B+($-B)*C)];a={bypass:n.bypass,name:n.name,value:A,strValue:"rgb("+A[0]+", "+A[1]+", "+A[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*C;a=this.parse(n.name,I,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var O=n.field.split("."),N=d.data,M=0;M0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)};gi.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)};gi.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};gi.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};gi.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};gi.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};gi.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var Kb={};Kb.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Gr("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new Kc(d);if(f.invalid){Gr("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){Gr("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var T=v[1],b=v[2],C=e.properties[T];if(!C){Gr("Skipping property: Invalid property name in: "+s),l();continue}var w=r.parse(T,b);if(!w){Gr("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:T,val:b}),l()}if(g){o();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return Gr("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,T=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(T)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):Yr(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var C=[],w=[],S=[],E="",_=!1,R=0;R0?" ":"")+D.strValue}return u.validate&&!u.validate(C,w)?null:u.singleEnum&&_?C.length===1&&zt(C[0])?{name:t,value:C[0],strValue:C[0],bypass:r}:null:{name:t,value:C,pfValue:S,strValue:E,bypass:r,units:w}}var L=function(){for(var ee=0;eeu.max||u.strictMax&&e===u.max))return null;var O={name:t,value:e,strValue:""+e+(B||""),units:B,bypass:r};return u.unitless||B!=="px"&&B!=="em"?O.pfValue=e:O.pfValue=B==="px"||!B?e:this.getEmSizeInPixels()*e,(B==="ms"||B==="s")&&(O.pfValue=B==="ms"?e:1e3*e),(B==="deg"||B==="rad")&&(O.pfValue=B==="rad"?e:$6e(e)),B==="%"&&(O.pfValue=e/100),O}else if(u.propList){var N=[],M=""+e;if(M!=="none"){for(var P=M.split(/\s*,\s*|\s+/),F=0;F0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),bt(e)?s=e:Ir(e)&&(s=e.level,e.position!=null?a=pk(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;bt(u.x)&&(r.pan.x=u.x,o=!1),bt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(zt(e)){var n=e;e=this.mutableElements().filter(n)}else Ja(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};ed.centre=ed.center;ed.autolockNodes=ed.autolock;ed.autoungrabifyNodes=ed.autoungrabify;var jx={data:Fr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Fr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Fr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Fr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};jx.attr=jx.data;jx.removeAttr=jx.removeData;var Kx=function(e){var r=this;e=Ut({},e);var n=e.container;n&&!Qw(n)&&Qw(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=jn!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Ut({name:s?"grid":"null"},o.layout),o.renderer=Ut({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new Li(this),listeners:[],aniEles:new Li(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:bt(o.zoom)?o.zoom:1,pan:{x:Ir(o.pan)&&bt(o.pan.x)?o.pan.x:0,y:Ir(o.pan)&&bt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(RPe);if(y)return pv.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Ut({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(Ir(g)||Yr(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var T=Ut({},r._private.options.layout);T.eles=r.elements(),r.layout(T).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,Cn(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=ua(o?t.boundingBox:structuredClone(e.extent())),u;if(Ja(t.roots))u=t.roots;else if(Yr(t.roots)){for(var h=[],d=0;d0;){var A=$(),I=R(A,L);if(I)A.outgoers().filter(function(ve){return ve.isNode()&&r.has(ve)}).forEach(B);else if(I===null){Gr("Detected double maximal shift for node `"+A.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var O=0;if(t.avoidOverlap)for(var N=0;N0&&v[0].length<=3?be/2:0),se=2*Math.PI/v[Ie].length*Ae;return Ie===0&&v[0].length===1&&(ke=1),{x:ae.x+ke*Math.cos(se),y:ae.y+ke*Math.sin(se)}}else{var J=v[Ie].length,G=Math.max(J===1?0:o?(l.w-t.padding*2-de.w)/((t.grid?ye:J)-1):(l.w-t.padding*2-de.w)/((t.grid?ye:J)+1),O),q={x:ae.x+(Ae+1-(J+1)/2)*G,y:ae.y+(Ie+1-(j+1)/2)*le};return q}},Fe={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Fe).indexOf(t.direction)===-1&&vn("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Fe).join(", ")));var ce=function(Ce){return i6e($e(Ce),l,Fe[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var U8e={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Lre(t){this.options=Ut({},U8e,t)}Lre.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=ua(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),T=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+T*T));h=Math.max(b,h)}var C=function(S,E){var _=e.startAngle+E*u*(i?1:-1),R=h*Math.cos(_),D=h*Math.sin(_),L={x:o.x+R,y:o.y+D};return L};return n.nodes().layoutPositions(this,e,C),this};var H8e={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Ire(t){this.options=Ut({},H8e,t)}Ire.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=ua(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var w=Math.abs(T[0].value-C.value);w>=y&&(T=[],v.push(T))}T.push(C)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var E=v.length>0&&v[0].length>1,_=Math.min(s.w,s.h)/2-S,R=_/(v.length+E?1:0);S=Math.min(S,R)}for(var D=0,L=0;L1&&e.avoidOverlap){var I=Math.cos(A)-Math.cos(0),O=Math.sin(A)-Math.sin(0),N=Math.sqrt(S*S/(I*I+O*O));D=Math.max(N,D)}B.r=D,D+=S}if(e.equidistant){for(var M=0,P=0,F=0;F=t.numIter||(J8e(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),Jw(h)}};h()}else{for(;u;)u=s(l),l++;gV(n,t),o()}return this};kk.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};kk.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var X8e=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=ua(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(_);for(var h=0;h<_.length;h++)v[++b]=_[h]}}for(var h=0;hi.count?0:i.graph},Dre=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=sE(e,o,l),y=sE(r,-1*o,-1*l),v=y.x-m.x,T=y.y-m.y,b=v*v+T*T,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*T/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},r7e=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},sE=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},n7e=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},a7e=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},Nre=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},l7e={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Ore(t){this.options=Ut({},l7e,t)}Ore.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=ua(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(W){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(X){if(X==null)return Math.min(l,u);var j=Math.min(l,u);j==l?l=X:u=X},d=function(X){if(X==null)return Math.max(l,u);var j=Math.max(l,u);j==l?l=X:u=X},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var T=a.w/u,b=a.h/l;if(e.condense&&(T=0,b=0),e.avoidOverlap)for(var C=0;C=u&&(I=0,A++)},N={},M=0;M(I=K6e(t,e,O[N],O[N+1],O[N+2],O[N+3])))return y(E,I),!0}else if(R.edgeType==="bezier"||R.edgeType==="multibezier"||R.edgeType==="self"||R.edgeType==="compound"){for(var O=R.allpts,N=0;N+5(I=j6e(t,e,O[N],O[N+1],O[N+2],O[N+3],O[N+4],O[N+5])))return y(E,I),!0}for(var M=M||_.source,P=P||_.target,F=i.getArrowWidth(D,L),V=[{name:"source",x:R.arrowStartX,y:R.arrowStartY,angle:R.srcArrowAngle},{name:"target",x:R.arrowEndX,y:R.arrowEndY,angle:R.tgtArrowAngle},{name:"mid-source",x:R.midX,y:R.midY,angle:R.midsrcArrowAngle},{name:"mid-target",x:R.midX,y:R.midY,angle:R.midtgtArrowAngle}],N=0;N0&&(v(M),v(P))}function b(E,_,R){return ta(E,_,R)}function C(E,_){var R=E._private,D=f,L;_?L=_+"-":L="",E.boundingBox();var B=R.labelBounds[_||"main"],$=E.pstyle(L+"label").value,A=E.pstyle("text-events").strValue==="yes";if(!(!A||!$)){var I=b(R.rscratch,"labelX",_),O=b(R.rscratch,"labelY",_),N=b(R.rscratch,"labelAngle",_),M=E.pstyle(L+"text-margin-x").pfValue,P=E.pstyle(L+"text-margin-y").pfValue,F=B.x1-D-M,V=B.x2+D-M,z=B.y1-D-P,W=B.y2+D-P;if(N){var X=Math.cos(N),j=Math.sin(N),re=function(de,le){return de=de-I,le=le-O,{x:de*X-le*j+I,y:de*j+le*X+O}},Q=re(F,z),oe=re(F,W),ee=re(V,z),ne=re(V,W),ie=[Q.x+M,Q.y+P,ee.x+M,ee.y+P,ne.x+M,ne.y+P,oe.x+M,oe.y+P];if(Da(t,e,ie))return y(E),!0}else if(Dc(B,t,e))return y(E),!0}}for(var w=s.length-1;w>=0;w--){var S=s[w];S.isNode()?v(S)||C(S):T(S)||C(S)||C(S,"source")||C(S,"target")}return o};xd.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=ua({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(de,le,ye){return ta(de,le,ye)}function y(de,le){var ye=de._private,$e=s,Fe="";de.boundingBox();var ce=ye.labelBounds.main;if(!ce)return null;var ve=m(ye.rscratch,"labelX",le),Ce=m(ye.rscratch,"labelY",le),Ne=m(ye.rscratch,"labelAngle",le),Ie=de.pstyle(Fe+"text-margin-x").pfValue,Ae=de.pstyle(Fe+"text-margin-y").pfValue,be=ce.x1-$e-Ie,ke=ce.x2+$e-Ie,se=ce.y1-$e-Ae,J=ce.y2+$e-Ae;if(Ne){var G=Math.cos(Ne),q=Math.sin(Ne),H=function(te,K){return te=te-ve,K=K-Ce,{x:te*G-K*q+ve,y:te*q+K*G+Ce}};return[H(be,se),H(ke,se),H(ke,J),H(be,J)]}else return[{x:be,y:se},{x:ke,y:se},{x:ke,y:J},{x:be,y:J}]}function v(de,le,ye,$e){function Fe(ce,ve,Ce){return(Ce.y-ce.y)*(ve.x-ce.x)>(ve.y-ce.y)*(Ce.x-ce.x)}return Fe(de,ye,$e)!==Fe(le,ye,$e)&&Fe(de,le,ye)!==Fe(de,le,$e)}for(var T=0;T0?-(Math.PI-e.ang):Math.PI+e.ang},p7e=function(e,r,n,i,a){if(e!==bV?TV(r,e,yo):f7e(hs,yo),TV(r,n,hs),vV=yo.nx*hs.ny-yo.ny*hs.nx,xV=yo.nx*hs.nx-yo.ny*-hs.ny,sl=Math.asin(Math.max(-1,Math.min(1,vV))),Math.abs(sl)<1e-6){D5=r.x,M5=r.y,Uu=tf=0;return}ih=1,oC=!1,xV<0?sl<0?sl=Math.PI+sl:(sl=Math.PI-sl,ih=-1,oC=!0):sl>0&&(ih=-1,oC=!0),r.radius!==void 0?tf=r.radius:tf=i,Lu=sl/2,a2=Math.min(yo.len/2,hs.len/2),a?(ho=Math.abs(Math.cos(Lu)*tf/Math.sin(Lu)),ho>a2?(ho=a2,Uu=Math.abs(ho*Math.sin(Lu)/Math.cos(Lu))):Uu=tf):(ho=Math.min(a2,tf),Uu=Math.abs(ho*Math.sin(Lu)/Math.cos(Lu))),N5=r.x+hs.nx*ho,O5=r.y+hs.ny*ho,D5=N5-hs.ny*Uu*ih,M5=O5+hs.nx*Uu*ih,Fre=r.x+yo.nx*ho,zre=r.y+yo.ny*ho,bV=r};function Gre(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function _$(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(p7e(t,e,r,n,i),{cx:D5,cy:M5,radius:Uu,startX:Fre,startY:zre,stopX:N5,stopY:O5,startAngle:yo.ang+Math.PI/2*ih,endAngle:hs.ang-Math.PI/2*ih,counterClockwise:oC})}var Zx=.01,g7e=Math.sqrt(2*Zx),ji={};ji.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(w,S,E,_){var R=_-S,D=E-w,L=Math.sqrt(D*D+R*R);return{x:-R/L,y:D/L}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Fn(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Fn(m,2),v=y[0],T=y[1],b={x1:p,y1:g,x2:v,y2:T};i=u(p,g,v,T),a=b}else Gr("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};ji.findHaystackPoints=function(t){for(var e=0;e0?Math.max(K-U,0):Math.min(K+U,0)},$=B(D,_),A=B(L,R),I=!1;T===u?v=Math.abs($)>Math.abs(A)?i:n:T===l||T===o?(v=n,I=!0):(T===a||T===s)&&(v=i,I=!0);var O=v===n,N=O?A:$,M=O?L:D,P=p$(M),F=!1;!(I&&(C||S))&&(T===o&&M<0||T===l&&M>0||T===a&&M>0||T===s&&M<0)&&(P*=-1,N=P*Math.abs(N),F=!0);var V;if(C){var z=w<0?1+w:w;V=z*N}else{var W=w<0?N:0;V=W+w*P}var X=function(K){return Math.abs(K)=Math.abs(N)},j=X(V),re=X(Math.abs(N)-Math.abs(V)),Q=j||re;if(Q&&!F)if(O){var oe=Math.abs(M)<=f/2,ee=Math.abs(D)<=p/2;if(oe){var ne=(h.x1+h.x2)/2,ie=h.y1,ae=h.y2;r.segpts=[ne,ie,ne,ae]}else if(ee){var de=(h.y1+h.y2)/2,le=h.x1,ye=h.x2;r.segpts=[le,de,ye,de]}else r.segpts=[h.x1,h.y2]}else{var $e=Math.abs(M)<=d/2,Fe=Math.abs(L)<=g/2;if($e){var ce=(h.y1+h.y2)/2,ve=h.x1,Ce=h.x2;r.segpts=[ve,ce,Ce,ce]}else if(Fe){var Ne=(h.x1+h.x2)/2,Ie=h.y1,Ae=h.y2;r.segpts=[Ne,Ie,Ne,Ae]}else r.segpts=[h.x2,h.y1]}else if(O){var be=h.y1+V+(y?f/2*P:0),ke=h.x1,se=h.x2;r.segpts=[ke,be,se,be]}else{var J=h.x1+V+(y?d/2*P:0),G=h.y1,q=h.y2;r.segpts=[J,G,J,q]}if(r.isRound){var H=t.pstyle("taxi-radius").value,Z=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(H),r.isArcRadius=new Array(r.segpts.length/2).fill(Z)}};ji.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!bt(r.startX)||!bt(r.startY),y=!bt(r.arrowStartX)||!bt(r.arrowStartY),v=!bt(r.endX)||!bt(r.endY),T=!bt(r.arrowEndX)||!bt(r.arrowEndY),b=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,w=b*C,S=Qh({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),E=SM.poolIndex()){var P=N;N=M,M=P}var F=$.srcPos=N.position(),V=$.tgtPos=M.position(),z=$.srcW=N.outerWidth(),W=$.srcH=N.outerHeight(),X=$.tgtW=M.outerWidth(),j=$.tgtH=M.outerHeight(),re=$.srcShape=r.nodeShapes[e.getNodeShape(N)],Q=$.tgtShape=r.nodeShapes[e.getNodeShape(M)],oe=$.srcCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,ee=$.tgtCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,ne=$.tgtRs=M._private.rscratch,ie=$.srcRs=N._private.rscratch;$.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ae=0;ae<$.eles.length;ae++){var de=$.eles[ae],le=de[0]._private.rscratch,ye=de.pstyle("curve-style").value,$e=ye==="unbundled-bezier"||Ic(ye,"segments")||Ic(ye,"taxi"),Fe=!N.same(de.source());if(!$.calculatedIntersection&&N!==M&&($.hasBezier||$.hasUnbundled)){$.calculatedIntersection=!0;var ce=re.intersectLine(F.x,F.y,z,W,V.x,V.y,0,oe,ie),ve=$.srcIntn=ce,Ce=Q.intersectLine(V.x,V.y,X,j,F.x,F.y,0,ee,ne),Ne=$.tgtIntn=Ce,Ie=$.intersectionPts={x1:ce[0],x2:Ce[0],y1:ce[1],y2:Ce[1]},Ae=$.posPts={x1:F.x,x2:V.x,y1:F.y,y2:V.y},be=Ce[1]-ce[1],ke=Ce[0]-ce[0],se=Math.sqrt(ke*ke+be*be);bt(se)&&se>=g7e||(se=Math.sqrt(Math.max(ke*ke,Zx)+Math.max(be*be,Zx)));var J=$.vector={x:ke,y:be},G=$.vectorNorm={x:J.x/se,y:J.y/se},q={x:-G.y,y:G.x};$.nodesOverlap=!bt(se)||Q.checkPoint(ce[0],ce[1],0,X,j,V.x,V.y,ee,ne)||re.checkPoint(Ce[0],Ce[1],0,z,W,F.x,F.y,oe,ie),$.vectorNormInverse=q,A={nodesOverlap:$.nodesOverlap,dirCounts:$.dirCounts,calculatedIntersection:!0,hasBezier:$.hasBezier,hasUnbundled:$.hasUnbundled,eles:$.eles,srcPos:V,srcRs:ne,tgtPos:F,tgtRs:ie,srcW:X,srcH:j,tgtW:z,tgtH:W,srcIntn:Ne,tgtIntn:ve,srcShape:Q,tgtShape:re,posPts:{x1:Ae.x2,y1:Ae.y2,x2:Ae.x1,y2:Ae.y1},intersectionPts:{x1:Ie.x2,y1:Ie.y2,x2:Ie.x1,y2:Ie.y1},vector:{x:-J.x,y:-J.y},vectorNorm:{x:-G.x,y:-G.y},vectorNormInverse:{x:-q.x,y:-q.y}}}var H=Fe?A:$;le.nodesOverlap=H.nodesOverlap,le.srcIntn=H.srcIntn,le.tgtIntn=H.tgtIntn,le.isRound=ye.startsWith("round"),i&&(N.isParent()||N.isChild()||M.isParent()||M.isChild())&&(N.parents().anySame(M)||M.parents().anySame(N)||N.same(M)&&N.isParent())?e.findCompoundLoopPoints(de,H,ae,$e):N===M?e.findLoopPoints(de,H,ae,$e):ye.endsWith("segments")?e.findSegmentsPoints(de,H):ye.endsWith("taxi")?e.findTaxiPoints(de,H):ye==="straight"||!$e&&$.eles.length%2===1&&ae===Math.floor($.eles.length/2)?e.findStraightEdgePoints(de):e.findBezierPoints(de,H,ae,$e,Fe),e.findEndpoints(de),e.tryToCorrectInvalidPoints(de,H),e.checkForInvalidEdgeWarning(de),e.storeAllpts(de),e.storeEdgeProjections(de),e.calculateArrowAngles(de),e.recalculateEdgeLabelProjections(de),e.calculateLabelAngles(de)}},E=0;E0){var ce=u,ve=qu(ce,qf(s)),Ce=qu(ce,qf(Fe)),Ne=ve;if(Ce2){var Ie=qu(ce,{x:Fe[2],y:Fe[3]});Ie0){var Y=h,fe=qu(Y,qf(s)),ue=qu(Y,qf(U)),Te=fe;if(ue2){var ge=qu(Y,{x:U[2],y:U[3]});ge=g||E){y={cp:C,segment:S};break}}if(y)break}var _=y.cp,R=y.segment,D=(g-v)/R.length,L=R.t1-R.t0,B=p?R.t0+L*D:R.t1-L*D;B=Ux(0,B,1),e=fp(_.p0,_.p1,_.p2,B),f=y7e(_.p0,_.p1,_.p2,B);break}case"straight":case"segments":case"haystack":{for(var $=0,A,I,O,N,M=n.allpts.length,P=0;P+3=g));P+=2);var F=g-I,V=F/A;V=Ux(0,V,1),e=B6e(O,N,V),f=qre(O,N);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};Ko.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Ko.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Zh(n,t._private.labelDimsKey);if(ta(r.rscratch,"prefixedLabelDimsKey",e)!==i){wo(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=ta(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;wo(r.rstyle,"labelWidth",e,f),wo(r.rscratch,"labelWidth",e,f),wo(r.rstyle,"labelHeight",e,p),wo(r.rscratch,"labelHeight",e,p),wo(r.rscratch,"labelLineHeight",e,d),wo(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}};Ko.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(W,X){return X?(wo(r.rscratch,W,e,X),X):ta(r.rscratch,W,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` `),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var w=v.matchAll(m),S="",E=0,_=Oa(w),R;try{for(_.s();!(R=_.n()).done;){var D=R.value,L=D[0],B=v.substring(E,D.index);E=D.index+L.length;var $=S.length===0?B:S+B+L,A=this.calculateLabelDimensions(t,$),I=A.width;I<=d?S+=B+L:(S&&g.push(S),S=B+L)}}catch(z){_.e(z)}finally{_.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` `)),s("labelWrapKey",l)}else if(o==="ellipsis"){var O=t.pstyle("text-max-width").pfValue,N="",M="…",P=!1;if(this.calculateLabelDimensions(t,i).widthO)break;N+=i[F],F===i.length-1&&(P=!0)}return P||(N+=M),N}return i};Ko.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?i8e(r):"center":e};Ko.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` `),v=y.length,T=0,b=0,C=0;C1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var mt=a(H);Ee&&(t.hoverData.tapholdCancelled=!0);var ot=function(){var nt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];nt.length===0?(nt.push(_e[0]),nt.push(_e[1])):(nt[0]+=_e[0],nt[1]+=_e[1])};te=!0,i(we,["mousemove","vmousemove","tapdrag"],H,{x:fe[0],y:fe[1]});var Ke=function(nt){return{originalEvent:H,type:nt,position:{x:fe[0],y:fe[1]}}},me=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||K.emit(Ke("boxstart")),ge[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Ee){var dt=Ke("cxtdrag");Le?Le.emit(dt):K.emit(dt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||we!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(Ke("cxtdragout")),t.hoverData.cxtOver=we,we&&we.emit(Ke("cxtdragover")))}}else if(t.hoverData.dragging){if(te=!0,K.panningEnabled()&&K.userPanningEnabled()){var at;if(t.hoverData.justStartedPan){var et=t.hoverData.mdownPos;at={x:(fe[0]-et[0])*U,y:(fe[1]-et[1])*U},t.hoverData.justStartedPan=!1}else at={x:_e[0]*U,y:_e[1]*U};K.panBy(at),K.emit(Ke("dragpan")),t.hoverData.dragged=!0}fe=t.projectIntoViewport(H.clientX,H.clientY)}else if(ge[4]==1&&(Le==null||Le.pannable())){if(Ee){if(!t.hoverData.dragging&&K.boxSelectionEnabled()&&(mt||!K.panningEnabled()||!K.userPanningEnabled()))me();else if(!t.hoverData.selecting&&K.panningEnabled()&&K.userPanningEnabled()){var ct=s(Le,t.hoverData.downs);ct&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,ge[4]=0,t.data.bgActivePosistion=qf(ue),t.redrawHint("select",!0),t.redraw())}Le&&Le.pannable()&&Le.active()&&Le.unactivate()}}else{if(Le&&Le.pannable()&&Le.active()&&Le.unactivate(),(!Le||!Le.grabbed())&&we!=xe&&(xe&&i(xe,["mouseout","tapdragout"],H,{x:fe[0],y:fe[1]}),we&&i(we,["mouseover","tapdragover"],H,{x:fe[0],y:fe[1]}),t.hoverData.last=we),Le)if(Ee){if(K.boxSelectionEnabled()&&mt)Le&&Le.grabbed()&&(m(Be),Le.emit(Ke("freeon")),Be.emit(Ke("free")),t.dragData.didDrag&&(Le.emit(Ke("dragfreeon")),Be.emit(Ke("dragfree")))),me();else if(Le&&Le.grabbed()&&t.nodeIsDraggable(Le)){var Gt=!t.dragData.didDrag;Gt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Be,{inDragLayer:!0});var Se={x:0,y:0};if(bt(_e[0])&&bt(_e[1])&&(Se.x+=_e[0],Se.y+=_e[1],Gt)){var We=t.hoverData.dragDelta;We&&bt(We[0])&&bt(We[1])&&(Se.x+=We[0],Se.y+=We[1])}t.hoverData.draggingEles=!0,Be.silentShift(Se).emit(Ke("position")).emit(Ke("drag")),t.redrawHint("drag",!0),t.redraw()}}else ot();te=!0}if(ge[2]=fe[0],ge[3]=fe[1],te)return H.stopPropagation&&H.stopPropagation(),H.preventDefault&&H.preventDefault(),!1}},!1);var D,L,B;t.registerBinding(e,"mouseup",function(H){if(!(t.hoverData.which===1&&H.which!==1&&t.hoverData.capture)){var Z=t.hoverData.capture;if(Z){t.hoverData.capture=!1;var te=t.cy,K=t.projectIntoViewport(H.clientX,H.clientY),U=t.selection,Y=t.findNearestElement(K[0],K[1],!0,!1),fe=t.dragData.possibleDragElements,ue=t.hoverData.down,Te=a(H);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ue&&ue.unactivate();var ge=function(Xe){return{originalEvent:H,type:Xe,position:{x:K[0],y:K[1]}}};if(t.hoverData.which===3){var we=ge("cxttapend");if(ue?ue.emit(we):te.emit(we),!t.hoverData.cxtDragged){var xe=ge("cxttap");ue?ue.emit(xe):te.emit(xe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Y,["mouseup","tapend","vmouseup"],H,{x:K[0],y:K[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(ue,["click","tap","vclick"],H,{x:K[0],y:K[1]}),L=!1,H.timeStamp-B<=te.multiClickDebounceTime()?(D&&clearTimeout(D),L=!0,B=null,i(ue,["dblclick","dbltap","vdblclick"],H,{x:K[0],y:K[1]})):(D=setTimeout(function(){L||i(ue,["oneclick","onetap","voneclick"],H,{x:K[0],y:K[1]})},te.multiClickDebounceTime()),B=H.timeStamp)),ue==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(H)&&(te.$(r).unselect(["tapunselect"]),fe.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=fe=te.collection()),Y==ue&&!t.dragData.didDrag&&!t.hoverData.selecting&&Y!=null&&Y._private.selectable&&(t.hoverData.dragging||(te.selectionType()==="additive"||Te?Y.selected()?Y.unselect(["tapunselect"]):Y.select(["tapselect"]):Te||(te.$(r).unmerge(Y).unselect(["tapunselect"]),Y.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Le=te.collection(t.getAllInBox(U[0],U[1],U[2],U[3]));t.redrawHint("select",!0),Le.length>0&&t.redrawHint("eles",!0),te.emit(ge("boxend"));var _e=function(Xe){return Xe.selectable()&&!Xe.selected()};te.selectionType()==="additive"||Te||te.$(r).unmerge(Le).unselect(),Le.emit(ge("box")).stdFilter(_e).select().emit(ge("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!U[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Be=ue&&ue.grabbed();m(fe),Be&&(ue.emit(ge("freeon")),fe.emit(ge("free")),t.dragData.didDrag&&(ue.emit(ge("dragfreeon")),fe.emit(ge("dragfree"))))}}U[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var $=[],A=4,I,O=1e5,N=function(H){for(var Z=Math.abs(H[0]),te=1;te=A){I=!1;var K=$;if(K[0]>=5){var U;N(K)?U=K[0]:U=O6e(K),U>1&&(I=!0,O=U)}}else $.push(Math.abs(te)),Z=!0;else I&&(O=Math.min(Math.abs(te),O));if(!t.scrollingPage){var Y=t.cy,fe=Y.zoom(),ue=Y.pan(),Te=t.projectIntoViewport(H.clientX,H.clientY),ge=[Te[0]*fe+ue.x,Te[1]*fe+ue.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||E()){H.preventDefault();return}if(Y.panningEnabled()&&Y.userPanningEnabled()&&Y.zoomingEnabled()&&Y.userZoomingEnabled()){H.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var we;Z&&Math.abs(te)>5&&(te=p$(te)*5),we=te/-250,I&&(we/=O,we*=3),we=we*t.wheelSensitivity;var xe=H.deltaMode===1;xe&&(we*=33);var Le=Y.zoom()*Math.pow(10,we);H.type==="gesturechange"&&(Le=t.gestureStartZoom*H.scale),Y.zoom({level:Le,renderedPosition:{x:ge[0],y:ge[1]}}),Y.emit({type:H.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:H,position:{x:Te[0],y:Te[1]}})}}}};t.registerBinding(t.container,"wheel",M,!0),t.registerBinding(e,"scroll",function(H){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(H){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||H.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(q){t.hasTouchStarted||M(q)},!0),t.registerBinding(t.container,"mouseout",function(H){var Z=t.projectIntoViewport(H.clientX,H.clientY);t.cy.emit({originalEvent:H,type:"mouseout",position:{x:Z[0],y:Z[1]}})},!1),t.registerBinding(t.container,"mouseover",function(H){var Z=t.projectIntoViewport(H.clientX,H.clientY);t.cy.emit({originalEvent:H,type:"mouseover",position:{x:Z[0],y:Z[1]}})},!1);var P,F,V,z,W,X,j,re,Q,oe,ee,ne,ie,ae=function(H,Z,te,K){return Math.sqrt((te-H)*(te-H)+(K-Z)*(K-Z))},de=function(H,Z,te,K){return(te-H)*(te-H)+(K-Z)*(K-Z)},le;t.registerBinding(t.container,"touchstart",le=function(H){if(t.hasTouchStarted=!0,!!_(H)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var Z=t.cy,te=t.touchData.now,K=t.touchData.earlier;if(H.touches[0]){var U=t.projectIntoViewport(H.touches[0].clientX,H.touches[0].clientY);te[0]=U[0],te[1]=U[1]}if(H.touches[1]){var U=t.projectIntoViewport(H.touches[1].clientX,H.touches[1].clientY);te[2]=U[0],te[3]=U[1]}if(H.touches[2]){var U=t.projectIntoViewport(H.touches[2].clientX,H.touches[2].clientY);te[4]=U[0],te[5]=U[1]}var Y=function(mt){return{originalEvent:H,type:mt,position:{x:te[0],y:te[1]}}};if(H.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var fe=t.findContainerClientCoords();Q=fe[0],oe=fe[1],ee=fe[2],ne=fe[3],P=H.touches[0].clientX-Q,F=H.touches[0].clientY-oe,V=H.touches[1].clientX-Q,z=H.touches[1].clientY-oe,ie=0<=P&&P<=ee&&0<=V&&V<=ee&&0<=F&&F<=ne&&0<=z&&z<=ne;var ue=Z.pan(),Te=Z.zoom();W=ae(P,F,V,z),X=de(P,F,V,z),j=[(P+V)/2,(F+z)/2],re=[(j[0]-ue.x)/Te,(j[1]-ue.y)/Te];var ge=200,we=ge*ge;if(X=1){for(var Re=t.touchData.startPosition=[null,null,null,null,null,null],Qe=0;Qe=t.touchTapThreshold2}if(Z&&t.touchData.cxt){H.preventDefault();var Qe=H.touches[0].clientX-Q,it=H.touches[0].clientY-oe,Ue=H.touches[1].clientX-Q,mt=H.touches[1].clientY-oe,ot=de(Qe,it,Ue,mt),Ke=ot/X,me=150,dt=me*me,at=1.5,et=at*at;if(Ke>=et||ot>=dt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ct=Te("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(ct),t.touchData.start=null):K.emit(ct)}}if(Z&&t.touchData.cxt){var ct=Te("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(ct):K.emit(ct),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Gt=t.findNearestElement(U[0],U[1],!0,!0);(!t.touchData.cxtOver||Gt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Te("cxtdragout")),t.touchData.cxtOver=Gt,Gt&&Gt.emit(Te("cxtdragover")))}else if(Z&&H.touches[2]&&K.boxSelectionEnabled())H.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||K.emit(Te("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,te[4]=1,!te||te.length===0||te[0]===void 0?(te[0]=(U[0]+U[2]+U[4])/3,te[1]=(U[1]+U[3]+U[5])/3,te[2]=(U[0]+U[2]+U[4])/3+1,te[3]=(U[1]+U[3]+U[5])/3+1):(te[2]=(U[0]+U[2]+U[4])/3,te[3]=(U[1]+U[3]+U[5])/3),t.redrawHint("select",!0),t.redraw();else if(Z&&H.touches[1]&&!t.touchData.didSelect&&K.zoomingEnabled()&&K.panningEnabled()&&K.userZoomingEnabled()&&K.userPanningEnabled()){H.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Se=t.dragData.touchDragEles;if(Se){t.redrawHint("drag",!0);for(var We=0;We0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var $e;t.registerBinding(e,"touchcancel",$e=function(H){var Z=t.touchData.start;t.touchData.capture=!1,Z&&Z.unactivate()});var Fe,ce,ve,Ce;if(t.registerBinding(e,"touchend",Fe=function(H){var Z=t.touchData.start,te=t.touchData.capture;if(te)H.touches.length===0&&(t.touchData.capture=!1),H.preventDefault();else return;var K=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var U=t.cy,Y=U.zoom(),fe=t.touchData.now,ue=t.touchData.earlier;if(H.touches[0]){var Te=t.projectIntoViewport(H.touches[0].clientX,H.touches[0].clientY);fe[0]=Te[0],fe[1]=Te[1]}if(H.touches[1]){var Te=t.projectIntoViewport(H.touches[1].clientX,H.touches[1].clientY);fe[2]=Te[0],fe[3]=Te[1]}if(H.touches[2]){var Te=t.projectIntoViewport(H.touches[2].clientX,H.touches[2].clientY);fe[4]=Te[0],fe[5]=Te[1]}var ge=function(dt){return{originalEvent:H,type:dt,position:{x:fe[0],y:fe[1]}}};Z&&Z.unactivate();var we;if(t.touchData.cxt){if(we=ge("cxttapend"),Z?Z.emit(we):U.emit(we),!t.touchData.cxtDragged){var xe=ge("cxttap");Z?Z.emit(xe):U.emit(xe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!H.touches[2]&&U.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Le=U.collection(t.getAllInBox(K[0],K[1],K[2],K[3]));K[0]=void 0,K[1]=void 0,K[2]=void 0,K[3]=void 0,K[4]=0,t.redrawHint("select",!0),U.emit(ge("boxend"));var _e=function(dt){return dt.selectable()&&!dt.selected()};Le.emit(ge("box")).stdFilter(_e).select().emit(ge("boxselect")),Le.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(Z!=null&&Z.unactivate(),H.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!H.touches[1]){if(!H.touches[0]){if(!H.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Be=t.dragData.touchDragEles;if(Z!=null){var Ee=Z._private.grabbed;m(Be),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ee&&(Z.emit(ge("freeon")),Be.emit(ge("free")),t.dragData.didDrag&&(Z.emit(ge("dragfreeon")),Be.emit(ge("dragfree")))),i(Z,["touchend","tapend","vmouseup","tapdragout"],H,{x:fe[0],y:fe[1]}),Z.unactivate(),t.touchData.start=null}else{var Xe=t.findNearestElement(fe[0],fe[1],!0,!0);i(Xe,["touchend","tapend","vmouseup","tapdragout"],H,{x:fe[0],y:fe[1]})}var Re=t.touchData.startPosition[0]-fe[0],Qe=Re*Re,it=t.touchData.startPosition[1]-fe[1],Ue=it*it,mt=Qe+Ue,ot=mt*Y*Y;t.touchData.singleTouchMoved||(Z||U.$(":selected").unselect(["tapunselect"]),i(Z,["tap","vclick"],H,{x:fe[0],y:fe[1]}),ce=!1,H.timeStamp-Ce<=U.multiClickDebounceTime()?(ve&&clearTimeout(ve),ce=!0,Ce=null,i(Z,["dbltap","vdblclick"],H,{x:fe[0],y:fe[1]})):(ve=setTimeout(function(){ce||i(Z,["onetap","voneclick"],H,{x:fe[0],y:fe[1]})},U.multiClickDebounceTime()),Ce=H.timeStamp)),Z!=null&&!t.dragData.didDrag&&Z._private.selectable&&ot"u"){var Ne=[],Ie=function(H){return{clientX:H.clientX,clientY:H.clientY,force:1,identifier:H.pointerId,pageX:H.pageX,pageY:H.pageY,radiusX:H.width/2,radiusY:H.height/2,screenX:H.screenX,screenY:H.screenY,target:H.target}},Ae=function(H){return{event:H,touch:Ie(H)}},be=function(H){Ne.push(Ae(H))},ke=function(H){for(var Z=0;Z0)return z[0]}return null},g=Object.keys(f),m=0;m0?p:Hte(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?jc(i,a):l;var u=2*l;if(Bl(e,r,this.points,s,o,i,a-u,[0,-1],n)||Bl(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Da(e,r,f)||Eh(e,r,u,u,s+i/2-l,o+a/2-l,n)||Eh(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};rc.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ea(3,0)),this.generateRoundPolygon("round-triangle",ea(3,0)),this.generatePolygon("rectangle",ea(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",ea(5,0)),this.generateRoundPolygon("round-pentagon",ea(5,0)),this.generatePolygon("hexagon",ea(6,0)),this.generateRoundPolygon("round-hexagon",ea(6,0)),this.generatePolygon("heptagon",ea(7,0)),this.generateRoundPolygon("round-heptagon",ea(7,0)),this.generatePolygon("octagon",ea(8,0)),this.generateRoundPolygon("round-octagon",ea(8,0));var n=new Array(20);{var i=C5(5,0),a=C5(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*C)break}else if(u){if(T>=e.deqCost*p||T>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*GL)break;var w=e.deq(n,y,m);if(w.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||h$;i.beforeRender(s,o(n))}}}},T7e=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:eE;cu(this,t),this.idsByKey=new kl,this.keyForId=new kl,this.cachesByLvl=new kl,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return uu(t,[{key:"getIdsFor",value:function(r){r==null&&vn("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new fv,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new kl,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),SV=25,s2=50,lC=-4,$5=3,Zre=7.99,C7e=8,w7e=1024,E7e=1024,S7e=1024,k7e=.2,_7e=.8,A7e=10,R7e=.15,L7e=.1,I7e=.9,D7e=.9,M7e=100,N7e=1,Hf={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},O7e=Mi({getKey:null,doesEleInvalidateKey:eE,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Bte,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),S1=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=O7e(r);Ut(n,i),n.lookup=new T7e(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},ni=S1.prototype;ni.reasons=Hf;ni.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};ni.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};ni.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Xb(function(r,n){return n.reqs-r.reqs});return e};ni.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};ni.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(f$(o*r))),n=Zre||n>$5)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=SV?g=SV:h<=s2?g=s2:g=Math.ceil(h/s2)*s2,h>S7e||d>E7e)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;L--)R=a.getElement(t,e,r,L,Hf.downscale);D()}else return a.queueElement(t,S.level-1),S;else{var B;if(!b&&!C&&!w)for(var $=n-1;$>=lC;$--){var A=l.get(t,$);if(A){B=A;break}}if(T(B))return a.queueElement(t,n),B;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+C7e),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p};ni.invalidateElements=function(t){for(var e=0;e=k7e*t.width&&this.retireTexture(t)};ni.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>_7e&&t.fullnessChecks>=A7e?Xc(r,t):t.fullnessChecks++};ni.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Xc(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,d$(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Xc(i,s),n.push(s),s}};ni.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}};ni.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Hf.dequeue)}return i};ni.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=u$,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};ni.onDequeue=function(t){this.onDequeues.push(t)};ni.offDequeue=function(t){Xc(this.onDequeues,t)};ni.setupDequeueing=Kre.setupDequeueing({deqRedrawThreshold:M7e,deqCost:R7e,deqAvgCost:L7e,deqNoDrawCost:I7e,deqFastCost:D7e,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=P7e||r>lE)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var D=function(I){if(n.validateLayersElesOrdering(I,t),n.levelIsComplete(I,t))return p=l[I],!0},L=function(I){if(!p)for(var O=r+I;tx<=O&&O<=lE&&!D(O);O+=I);};L(1),L(-1);for(var B=h.length-1;B>=0;B--){var $=h[B];$.invalid&&Xc(h,$)}};if(!f)g();else return h;var m=function(){if(!d){d=ua();for(var D=0;D_V||$>_V)return null;var A=B*$;if(A>U7e)return null;var I=n.makeLayer(d,r);if(L!=null){var O=h.indexOf(L)+1;h.splice(O,0,I)}else(D.insert===void 0||D.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,T=t.length/$7e,b=!o,C=0;C=T||!Ute(v.bb,w.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,w):n.drawEleInLayer(v,w,r,e),v.eles.push(w),E[r]=v}return p||(b?null:h)};Ni.getEleLevelForLayerLevel=function(t,e){return t};Ni.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,H7e),a.setImgSmoothing(s,!0))};Ni.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length};Ni.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};Ni.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Pl(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};Ni.invalidateLayer=function(t){if(this.lastInvalidationTime=Pl(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Xc(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,T=u*h,b=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,I),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,I),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],I);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},E=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;s.drawArrowheads(t,e,I)},_=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var R=e.pstyle("ghost").value==="yes";if(R){var D=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue,B=e.pstyle("ghost-opacity").value,$=v*B;t.translate(D,L),b($),E($),t.translate(-D,-L)}else C();S(),b(),E(),w(),_(),r&&t.translate(l.x1,l.y1)}};var ene=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};nc.drawEdgeOverlay=ene("overlay");nc.drawEdgeUnderlay=ene("underlay");nc.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)};bd.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function n9e(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function IV(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}bd.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=ta(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};bd.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=ta(s,"labelX",r),u=ta(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=ta(s,"labelWidth",r),m=ta(s,"labelHeight",r),y=ta(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,T=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),C=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;b&&(C="center",w="center"),l+=v,u+=T;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var E=M0(C),_=N0(w);switch(_){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var R=e.pstyle("text-background-opacity").value,D=e.pstyle("text-border-opacity").value,L=e.pstyle("text-border-width").pfValue,B=e.pstyle("text-background-padding").pfValue,$=e.pstyle("text-background-shape").strValue,A=$==="round-rectangle"||$==="roundrectangle",I=$==="circle",O=2;if(R>0||L>0&&D>0){var N=t.fillStyle,M=t.strokeStyle,P=t.lineWidth,F=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value,W=R>0,X=L>0&&D>0,j=l-B;switch(E){case"left":j-=g;break;case"center":j-=g/2;break}var re=u-m-B,Q=g+2*B,oe=m+2*B;if(W&&(t.fillStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(R*o,")")),X&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(D*o,")"),t.lineWidth=L,t.setLineDash))switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=L/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(A?(t.beginPath(),IV(t,j,re,Q,oe,O)):I?(t.beginPath(),n9e(t,j,re,Q,oe)):(t.beginPath(),t.rect(j,re,Q,oe)),W&&t.fill(),X&&t.stroke(),X&&z==="double"){var ee=L/2;t.beginPath(),A?IV(t,j+ee,re+ee,Q-2*ee,oe-2*ee,O):t.rect(j+ee,re+ee,Q-2*ee,oe-2*ee),t.stroke()}t.fillStyle=N,t.strokeStyle=M,t.lineWidth=P,t.setLineDash&&t.setLineDash([])}var ne=2*e.pstyle("text-outline-width").pfValue;if(ne>0&&(t.lineWidth=ne),u-=y,e.pstyle("text-wrap").value==="wrap"){var ie=ta(s,"labelWrapCachedLines",r),ae=ta(s,"labelLineHeight",r),de=g/2,le=this.getLabelJustification(e);switch(le==="auto"||(E==="left"?le==="left"?l+=-g:le==="center"&&(l+=-de):E==="center"?le==="left"?l+=-de:le==="right"&&(l+=de):E==="right"&&(le==="center"?l+=de:le==="right"&&(l+=g))),_){case"top":u-=(ie.length-1)*ae;break;case"center":case"bottom":u-=(ie.length-1)*ae;break}for(var ye=0;ye0&&t.strokeText(ie[ye],l,u),t.fillText(ie[ye],l,u),u+=ae}else ne>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var du={};du.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!bt(d.x)||!bt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var T=e.pstyle("background-image"),b=T.value,C=new Array(b.length),w=new Array(b.length),S=0,E=0;E0&&arguments[0]!==void 0?arguments[0]:$;s.eleFillStyle(t,e,Z)},ee=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;s.colorStrokeStyle(t,A[0],A[1],A[2],Z)},ne=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:j;s.colorStrokeStyle(t,W[0],W[1],W[2],Z)},ie=function(Z,te,K,U){var Y=s.nodePathCache=s.nodePathCache||[],fe=Pte(K==="polygon"?K+","+U.join(","):K,""+te,""+Z,""+Q),ue=Y[fe],Te,ge=!1;return ue!=null?(Te=ue,ge=!0,h.pathCache=Te):(Te=new Path2D,Y[fe]=h.pathCache=Te),{path:Te,cacheHit:ge}},ae=e.pstyle("shape").strValue,de=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var le=ie(o,l,ae,de);g=le.path,m=le.cacheHit}var ye=function(){if(!m){var Z=d;p&&(Z={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,Z.x,Z.y,o,l,Q,h)}p?t.fill(g):t.fill()},$e=function(){for(var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=u.backgrounding,U=0,Y=0;Y0&&arguments[0]!==void 0?arguments[0]:!1,te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,te),Z&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Q,h)))},ce=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Q,h),t.clip()),s.drawStripe(t,e,te),t.restore(),Z&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Q,h)))},ve=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,te=(L>0?L:-L)*Z,K=L>0?0:255;L!==0&&(s.colorFillStyle(t,K,K,K,te),p?t.fill(g):t.fill())},Ce=function(){if(B>0){if(t.lineWidth=B,t.lineCap=N,t.lineJoin=O,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(P),t.lineDashOffset=F;break;case"solid":case"double":t.setLineDash([]);break}if(M!=="center"){if(t.save(),t.lineWidth*=2,M==="inside")p?t.clip(g):t.clip();else{var Z=new Path2D;Z.rect(-o/2-B,-l/2-B,o+2*B,l+2*B),Z.addPath(g),t.clip(Z,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(I==="double"){t.lineWidth=B/3;var te=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=te}t.setLineDash&&t.setLineDash([])}},Ne=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(X){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Z=d;p&&(Z={x:0,y:0});var te=s.getNodeShape(e),K=B;M==="inside"&&(K=0),M==="outside"&&(K*=2);var U=(o+K+(z+re))/o,Y=(l+K+(z+re))/l,fe=o*U,ue=l*Y,Te=s.nodeShapes[te].points,ge;if(p){var we=ie(fe,ue,te,Te);ge=we.path}if(te==="ellipse")s.drawEllipsePath(ge||t,Z.x,Z.y,fe,ue);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(te)){var xe=0,Le=0,_e=0;te==="round-diamond"?xe=(K+re+z)*1.4:te==="round-heptagon"?(xe=(K+re+z)*1.075,_e=-(K/2+re+z)/35):te==="round-hexagon"?xe=(K+re+z)*1.12:te==="round-pentagon"?(xe=(K+re+z)*1.13,_e=-(K/2+re+z)/15):te==="round-tag"?(xe=(K+re+z)*1.12,Le=(K/2+z+re)*.07):te==="round-triangle"&&(xe=(K+re+z)*(Math.PI/2),_e=-(K+re/2+z)/Math.PI),xe!==0&&(U=(o+xe)/o,fe=o*U,["round-hexagon","round-tag"].includes(te)||(Y=(l+xe)/l,ue=l*Y)),Q=Q==="auto"?Xte(fe,ue):Q;for(var Be=fe/2,Ee=ue/2,Xe=Q+(K+z+re)/2,Re=new Array(Te.length/2),Qe=new Array(Te.length/2),it=0;it0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};du.drawNodeOverlay=tne("overlay");du.drawNodeUnderlay=tne("underlay");du.hasPie=function(t){return t=t[0],t._private.hasPie};du.hasStripe=function(t){return t=t[0],t._private.hasStripe};du.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,T=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,C=v/100;C+g>1&&(C=1-g);var w=1.5*Math.PI+2*Math.PI*g;w+=o;var S=2*Math.PI*C,E=w+S;v===0||g>=1||g+C>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,w,E),t.closePath()):(t.beginPath(),t.arc(l,u,f,w,E),t.arc(l,u,p,E,w,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],b),t.fill(),g+=C)}};du.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,T=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],T),t.fill(),u+=b)}t.restore()};var ya={},i9e=100;ya.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};ya.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var T=r.style(),b=r.zoom(),C=s!==void 0?s:b,w=r.pan(),S={x:w.x,y:w.y},E={zoom:b,pan:{x:w.x,y:w.y}},_=e.prevViewport,R=_===void 0||E.zoom!==_.zoom||E.pan.x!==_.pan.x||E.pan.y!==_.pan.y;!R&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),C*=l,S.x*=l,S.y*=l;var D=e.getCachedZSortedEles();function L(ee,ne,ie,ae,de){var le=ee.globalCompositeOperation;ee.globalCompositeOperation="destination-out",e.colorFillStyle(ee,255,255,255,e.motionBlurTransparency),ee.fillRect(ne,ie,ae,de),ee.globalCompositeOperation=le}function B(ee,ne){var ie,ae,de,le;!e.clearingMotionBlur&&(ee===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||ee===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ie={x:w.x*p,y:w.y*p},ae=b*p,de=e.canvasWidth*p,le=e.canvasHeight*p):(ie=S,ae=C,de=e.canvasWidth,le=e.canvasHeight),ee.setTransform(1,0,0,1,0,0),ne==="motionBlur"?L(ee,0,0,de,le):!n&&(ne===void 0||ne)&&ee.clearRect(0,0,de,le),i||(ee.translate(ie.x,ie.y),ee.scale(ae,ae)),o&&ee.translate(o.x,o.y),s&&ee.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var $=e.data.bufferContexts[e.TEXTURE_BUFFER];$.setTransform(1,0,0,1,0,0),$.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:$,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var E=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var A=u.contexts[e.NODE],I=e.textureCache.texture,E=e.textureCache.viewport;A.setTransform(1,0,0,1,0,0),f?L(A,0,0,E.width,E.height):A.clearRect(0,0,E.width,E.height);var O=T.core("outside-texture-bg-color").value,N=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(A,O[0],O[1],O[2],N),A.fillRect(0,0,E.width,E.height);var b=r.zoom();B(A,!1),A.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),A.drawImage(I,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var M=r.extent(),P=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),F=e.hideEdgesOnViewport&&P,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||V[e.NODE]){var z=f&&!V[e.NODE]&&p!==1,A=n||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),W=f&&!z?"motionBlur":void 0;B(A,W),F?e.drawCachedNodes(A,D.nondrag,l,M):e.drawLayeredElements(A,D.nondrag,l,M),e.debug&&e.drawDebugPoints(A,D.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||V[e.DRAG])){var z=f&&!V[e.DRAG]&&p!==1,A=n||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);B(A,f&&!z?"motionBlur":void 0),F?e.drawCachedNodes(A,D.drag,l,M):e.drawCachedElements(A,D.drag,l,M),e.debug&&e.drawDebugPoints(A,D.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,B),f&&p!==1){var X=u.contexts[e.NODE],j=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],re=u.contexts[e.DRAG],Q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],oe=function(ne,ie,ae){ne.setTransform(1,0,0,1,0,0),ae||!v?ne.clearRect(0,0,e.canvasWidth,e.canvasHeight):L(ne,0,0,e.canvasWidth,e.canvasHeight);var de=p;ne.drawImage(ie,0,0,e.canvasWidth*de,e.canvasHeight*de,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(oe(X,j,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(oe(re,Q,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=E,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},i9e)),n||r.emit("render")};var Zv;ya.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!Zv){var v=h.measureText(y);Zv=v.actualBoundingBoxAscent}h.fillText(y,0,Zv);var T=60;h.strokeRect(0,Zv+10,250,20),h.fillRect(0,Zv+10,250*Math.min(m/T,1),20)}o||(l[r.SELECT_BOX]=!1)}};function DV(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function a9e(t,e,r){var n=DV(t,t.VERTEX_SHADER,e),i=DV(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function s9e(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function L$(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function o9e(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function l9e(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function c9e(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function u9e(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function h9e(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function d9e(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function rne(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function nne(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function f9e(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function p9e(t,e,r,n){var i=rne(t,e),a=Fn(i,2),s=a[0],o=a[1],l=nne(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function fo(t,e,r,n){var i=rne(t,r),a=Fn(i,3),s=a[0],o=a[1],l=a[2],u=nne(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,C){if(i&&C){var w=C.context,S=b.x,E=b.row,_=S,R=l*E;w.save(),w.translate(_,R),w.scale(h,h),i(w,n),w.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,C=a.canvas;b.clear(),p({x:0,row:0},b);var w=s-a.freePointer.x,S=d-w,E=l;{var _=a.freePointer.x,R=a.freePointer.row*l,D=w;C.context.drawImage(b,0,0,D,E,_,R,D,E),g[0]={x:_,y:R,w:D,h:f}}{var L=w,B=(a.freePointer.row+1)*l,$=S;C&&C.context.drawImage(b,L,0,$,E,0,B,$,E),g[1]={x:0,y:B,w:$,h:f}}a.freePointer.x=S,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=Oa(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=Oa(this.renderTypes.values()),v;try{var T=function(){var C=v.value,w=C.type;if(h(w)){var S=n.collections.get(C.collection),E=C.getKey(m),_=Array.isArray(E)?E:[E];if(s)_.forEach(function(B){return S.markKeyForGC(B)}),f=!0;else{var R=C.getID?C.getID(m):m.id(),D=n._key(w,R),L=n.typeAndIdToKey.get(D);L!==void 0&&!u9e(_,L)&&(d=!0,n.typeAndIdToKey.delete(D),L.forEach(function(B){return S.markKeyForGC(B)}))}}};for(y.s();!(v=y.n()).done;)T()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=Oa(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Fn(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=Oa(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Fn(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),w9e=(function(){function t(e){cu(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return uu(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),E9e=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } `,S9e=` float rectangleSD(vec2 p, vec2 b) { vec2 d = abs(p)-b; return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); } `,k9e=` float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; cr.x = (p.y > 0.0) ? cr.x : cr.y; vec2 q = abs(p) - b + cr.x; return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; } `,_9e=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry // find root with Newton solver vec2 q = ab*(p-ab); float w = (q.x1.0) ? d : -d; } `,rx={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},cE={IGNORE:1,USE_BB:2},qL=0,$V=1,PV=2,UL=3,nf=4,o2=5,Qv=6,Jv=7,A9e=(function(){function t(e,r,n){cu(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=s9e,this.atlasManager=new C9e(e,n),this.batchManager=new w9e(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(rx.SCREEN),this.pickingProgram=this._createShaderProgram(rx.PICKING),this.vao=this._createVAO()}return uu(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; uniform int uAtlasSize; // instanced in vec2 aPosition; // a vertex from the unit square in mat3 aTransform; // used to transform verticies, eg into a bounding box in int aVertType; // the type of thing we are rendering // the z-index that is output when using picking mode in vec4 aIndex; // For textures in int aAtlasId; // which shader unit/atlas to use in vec4 aTex; // x/y/w/h of texture in atlas // for edges in vec4 aPointAPointB; in vec4 aPointCPointD; in vec2 aLineWidth; // also used for node border width // simple shapes in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left] in vec4 aColor; // also used for edges in vec4 aBorderColor; // aLineWidth is used for border width // output values passed to the fragment shader out vec2 vTexCoord; out vec4 vColor; out vec2 vPosition; // flat values are not interpolated flat out int vAtlasId; flat out int vVertType; flat out vec2 vTopRight; flat out vec2 vBotLeft; flat out vec4 vCornerRadius; flat out vec4 vBorderColor; flat out vec2 vBorderWidth; flat out vec4 vIndex; void main(void) { int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below if(aVertType == `.concat(qL,`) { float texX = aTex.x; // texture coordinates float texY = aTex.y; float texW = aTex.z; float texH = aTex.w; if(vid == 1 || vid == 2 || vid == 4) { texX += texW; } if(vid == 2 || vid == 4 || vid == 5) { texY += texH; } float d = float(uAtlasSize); vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } else if(aVertType == `).concat(nf," || aVertType == ").concat(Jv,` || aVertType == `).concat(o2," || aVertType == ").concat(Qv,`) { // simple shapes // the bounding box is needed by the fragment shader vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated // calculations are done in the fragment shader, just pass these along vColor = aColor; vCornerRadius = aCornerRadius; vBorderColor = aBorderColor; vBorderWidth = aLineWidth; gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } else if(aVertType == `).concat($V,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; // adjust the geometry so that the line is centered on the edge position.y = position.y - 0.5; // stretch the unit square into a long skinny rectangle vec2 xBasis = target - source; vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y; gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; } else if(aVertType == `).concat(PV,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; vec2 pointD = aPointCPointD.zw; // adjust the geometry so that the line is centered on the edge position.y = position.y - 0.5; vec2 p0, p1, p2, pos; if(position.x == 0.0) { // The left side of the unit square p0 = pointA; p1 = pointB; p2 = pointC; pos = position; } else { // The right side of the unit square, use same approach but flip the geometry upside down p0 = pointD; p1 = pointC; p2 = pointB; pos = vec2(0.0, -position.y); } vec2 p01 = p1 - p0; vec2 p12 = p2 - p1; vec2 p21 = p1 - p2; // Find the normal vector. vec2 tangent = normalize(normalize(p12) + normalize(p01)); vec2 normal = vec2(-tangent.y, tangent.x); // Find the vector perpendicular to p0 -> p1. vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); // Determine the bend direction. float sigma = sign(dot(p01 + p21, normal)); float width = aLineWidth[0]; if(sign(pos.y) == -sigma) { // This is an intersecting vertex. Adjust the position so that there's no overlap. vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); } else { // This is a non-intersecting vertex. Treat it like a mitre join. vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); } vColor = aColor; } else if(aVertType == `).concat(UL,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); if(vid == 1) position = vec2( 0.0, 0.0); if(vid == 2) position = vec2( 0.15, -0.3); gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); vColor = aColor; } else { gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space } vAtlasId = aAtlasId; vVertType = aVertType; vIndex = aIndex; } `),a=this.batchManager.getIndexArray(),s=`#version 300 es precision highp float; // declare texture unit for each texture atlas in the batch `.concat(a.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(` `),` uniform vec4 uBGColor; uniform float uZoom; in vec2 vTexCoord; in vec4 vColor; in vec2 vPosition; // model coordinates flat in int vAtlasId; flat in vec4 vIndex; flat in int vVertType; flat in vec2 vTopRight; flat in vec2 vBotLeft; flat in vec4 vCornerRadius; flat in vec4 vBorderColor; flat in vec2 vBorderWidth; out vec4 outColor; `).concat(E9e,` `).concat(S9e,` `).concat(k9e,` `).concat(_9e,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( top.rgb + (bot.rgb * (1.0 - top.a)), top.a + (bot.a * (1.0 - top.a)) ); } vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance // scale to the zoom level so that borders don't look blurry when zoomed in // note 1.5 is an aribitrary value chosen because it looks good return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); } void main(void) { if(vVertType == `).concat(qL,`) { // look up the texel from the texture unit `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` } else if(vVertType == `).concat(UL,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); outColor.a = 1.0; // make opaque, masks out line under arrow } else if(vVertType == `).concat(nf,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } else if(vVertType == `).concat(nf," || vVertType == ").concat(Jv,` || vVertType == `).concat(o2," || vVertType == ").concat(Qv,`) { // use SDF float outerBorder = vBorderWidth[0]; float innerBorder = vBorderWidth[1]; float borderPadding = outerBorder * 2.0; float w = vTopRight.x - vBotLeft.x - borderPadding; float h = vTopRight.y - vBotLeft.y - borderPadding; vec2 b = vec2(w/2.0, h/2.0); // half width, half height vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center float d; // signed distance if(vVertType == `).concat(nf,`) { d = rectangleSD(p, b); } else if(vVertType == `).concat(Jv,` && w == h) { d = circleSD(p, b.x); // faster than ellipse } else if(vVertType == `).concat(Jv,`) { d = ellipseSD(p, b); } else { d = roundRectangleSD(p, b, vCornerRadius.wzyx); } // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box if(d > 0.0) { if(d > outerBorder) { discard; } else { outColor = distInterp(vBorderColor, vec4(0), d - outerBorder); } } else { if(d > innerBorder) { vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; vec4 innerBorderColor = blend(vBorderColor, vColor); outColor = distInterp(innerBorderColor, outerColor, d); } else { vec4 outerColor; if(innerBorder == 0.0 && outerBorder == 0.0) { outerColor = vec4(0); } else if(innerBorder == 0.0) { outerColor = vBorderColor; } else { outerColor = blend(vBorderColor, vColor); } outColor = distInterp(vColor, outerColor, d - innerBorder); } } } else { outColor = vColor; } `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } `),o=a9e(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:rx.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===cE.IGNORE)return;if(l==cE.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=Oa(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,T=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(L){h.e(L)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;NV(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;cC(r,r,[h,d]),OV(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;cC(r,r,[s,o]),P5(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=nf;var o=this.indexBuffer.getView(s);rf(n,o);var l=this.colorBuffer.getView(s);Iu([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===o2||o===Qv){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===Qv&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);rf(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);Iu(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var T=r.pstyle("border-width").value;if(T>0){var b=r.pstyle("border-color").value,C=p*r.pstyle("border-opacity").value,w=this.borderColorBuffer.getView(l);Iu(b,C,w);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-T;else if(S==="outside")v[0]=T,v[1]=0;else{var E=T/2;v[0]=E,v[1]=-E}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,_,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return nf;case"ellipse":return Jv;case"roundrectangle":case"round-rectangle":return o2;case"bottom-round-rectangle":return Qv;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return jc(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,T=this.transformBuffer.getMatrixView(v);NV(T),cC(T,T,[s,o]),P5(T,T,[y,y]),OV(T,T,l),this.vertTypeBuffer.getView(v)[0]=UL;var b=this.indexBuffer.getView(v);rf(n,b);var C=this.colorBuffer.getView(v);Iu(h,p,C),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=$V;var d=this.indexBuffer.getView(h);rf(n,d);var f=this.colorBuffer.getView(h);Iu(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?cE.USE_BB:cE.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:c9e,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:HL(e.getLabelKey,null),getBoundingBox:YL(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:HL(e.getSourceLabelKey,"source"),getBoundingBox:YL(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:HL(e.getTargetLabelKey,"target"),getBoundingBox:YL(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=Yb(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),L9e(r)};function R9e(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return Lte(r)}function ane(t,e){var r=t._private.rscratch;return ta(r,"labelWrapCachedLines",e)||[]}var HL=function(e,r){return function(n){var i=e(n),a=ane(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},YL=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=ane(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function L9e(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>Zre?(I9e(t),e.call(t,a)):(D9e(t),one(t,a,rx.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return B9e(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function I9e(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function D9e(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function M9e(t){var e=t.canvasWidth,r=t.canvasHeight,n=L$(t),i=n.pan,a=n.zoom,s=WL();cC(s,s,[i.x,i.y]),P5(s,s,[a,a]);var o=WL();v9e(o,e,r);var l=WL();return y9e(l,o,s),l}function sne(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=L$(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function N9e(t,e){t.drawSelectionRectangle(e,function(r){return sne(t,r)})}function O9e(t){var e=t.data.contexts[t.NODE];e.save(),sne(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function $9e(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&C.add(E)}return C}function B9e(t,e,r){var n=P9e(t,e,r),i=t.getCachedZSortedEles(),a,s,o=Oa(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function XL(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function one(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&N9e(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=M9e(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function F9e(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":ti(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r};[Jre,Zo,nc,R$,bd,du,ya,ine,fu,Jb,une].forEach(function(t){Ut(fr,t)});var V9e=[{name:"null",impl:Bre},{name:"base",impl:jre},{name:"canvas",impl:z9e}],W9e=[{type:"layout",extensions:d7e},{type:"renderer",extensions:V9e}],dne={},fne={};function pne(t,e,r){var n=r,i=function(_){Gr("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Kx.prototype[e])return i(e);Kx.prototype[e]=r}else if(t==="collection"){if(Li.prototype[e])return i(e);Li.prototype[e]=r}else if(t==="layout"){for(var a=function(_){this.options=_,r.call(this,_),Ir(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var C=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(C.source=v,C.target=T,C.isInterGraph=!1,this.getEdges().push(C),v.edges.push(C),T!=v&&T.edges.push(C),C)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,C=T.length,w=0;w-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(E,1),b.target!=b.source&&b.target.edges.splice(_,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,C,w=this.getNodes(),S=w.length,E=0;ET&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(w[0].getParent().paddingLeft!=null?C=w[0].getParent().paddingLeft:C=this.margin,this.left=v-C,this.top=y-C,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,C=-s.MAX_VALUE,w,S,E,_,R,D=this.nodes,L=D.length,B=0;Bw&&(v=w),TE&&(b=E),C<_&&(C=_)}var A=new d(v,b,T-v,C-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),D[0].getParent().paddingLeft!=null?R=D[0].getParent().paddingLeft:R=this.margin,this.left=A.x-R,this.right=A.x+A.width+R,this.top=A.y-R,this.bottom=A.y+A.height+R},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,C=-s.MAX_VALUE,w,S,E,_,R=y.length,D=0;Dw&&(v=w),TE&&(b=E),C<_&&(C=_)}var B=new d(v,b,T-v,C-b);return B},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,T=v.length,b=0;b=this.nodes.length){var L=0;T.forEach(function(B){B.owner==y&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=D,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,A=!0):(u[0]=y,u[1]=m,A=!0):O===M&&(h>f?(u[0]=g,u[1]=m,A=!0):(u[0]=b,u[1]=T,A=!0)),-N===M?f>h?(u[2]=R,u[3]=D,I=!0):(u[2]=_,u[3]=E,I=!0):N===M&&(f>h?(u[2]=S,u[3]=E,I=!0):(u[2]=L,u[3]=D,I=!0)),A&&I)return!1;if(h>f?d>p?(P=this.getCardinalDirection(O,M,4),F=this.getCardinalDirection(N,M,2)):(P=this.getCardinalDirection(-O,M,3),F=this.getCardinalDirection(-N,M,1)):d>p?(P=this.getCardinalDirection(-O,M,1),F=this.getCardinalDirection(-N,M,3)):(P=this.getCardinalDirection(O,M,2),F=this.getCardinalDirection(N,M,4)),!A)switch(P){case 1:z=m,V=h+-w/M,u[0]=V,u[1]=z;break;case 2:V=b,z=d+C*M,u[0]=V,u[1]=z;break;case 3:z=T,V=h+w/M,u[0]=V,u[1]=z;break;case 4:V=v,z=d+-C*M,u[0]=V,u[1]=z;break}if(!I)switch(F){case 1:X=E,W=f+-$/M,u[2]=W,u[3]=X;break;case 2:W=L,X=p+B*M,u[2]=W,u[3]=X;break;case 3:X=D,W=f+$/M,u[2]=W,u[3]=X;break;case 4:W=R,X=p+-B*M,u[2]=W,u[3]=X;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,C=void 0,w=void 0,S=void 0,E=void 0,_=void 0,R=void 0,D=void 0,L=void 0;return w=g-f,E=d-p,R=p*f-d*g,S=T-y,_=m-v,D=v*y-m*T,L=w*_-S*E,L===0?null:(b=(E*D-_*R)/L,C=(S*R-w*D)/L,new a(b,C))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(w.push(E[0]);w.length>0&&y;){var _=w[0];w.splice(0,1),C.add(_);for(var R=_.getEdges(),b=0;b-1&&E.splice($,1)}C=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(D,1);var L=S.getNeighborsList();L.forEach(function(A){if(v.indexOf(A)<0){var I=T.get(A),O=I-1;O==1&&_.push(A),T.set(A,O)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,C=y[0])}return C},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),C;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),C=new Set,m=0;mw||C>w)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(w=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>w||C>w)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||w>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(E);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var _=new Set(this.getAllNodes()),R=this.nodesWithGravity.filter(function(D){return _.has(D)});this.graphManager.setAllNodesToApplyGravitation(R),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(L){return E.has(L)});this.graphManager.setAllNodesToApplyGravitation(_),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var R=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(R,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var E=this.graphManager.getAllNodes(),_={},R=0;R1){var A;for(A=0;A<$.length;A++){var I=$[A];I.getBendpoints().push(new m),this.createDummyNodesForBendpoints(I)}}$.forEach(function(O){_.add(O)})}}}if(_.size==E.length)break}},w.prototype.positionNodesRadially=function(E){for(var _=new g(0,0),R=Math.ceil(Math.sqrt(E.length)),D=0,L=0,B=0,$=new m(0,0),A=0;AD&&(D=Math.floor($.y)),B=Math.floor($.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-$.x/2,p.WORLD_CENTER_Y-$.y/2))},w.radialLayout=function(E,_,R){var D=Math.max(this.maxDiagonalInTree(E),d.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(_,null,0,359,0,D);var L=b.calculateBounds(E),B=new C;B.setDeviceOrgX(L.getMinX()),B.setDeviceOrgY(L.getMinY()),B.setWorldOrgX(R.x),B.setWorldOrgY(R.y);for(var $=0;$1;){var X=W[0];W.splice(0,1);var j=M.indexOf(X);j>=0&&M.splice(j,1),V--,P--}_!=null?z=(M.indexOf(W[0])+1)%V:z=0;for(var re=Math.abs(D-R)/P,Q=z;F!=P;Q=++Q%V){var oe=M[Q].getOtherEnd(E);if(oe!=_){var ee=(R+F*re)%360,ne=(ee+re)%360;w.branchRadialLayout(oe,E,ee,ne,L+B,B),F++}}},w.maxDiagonalInTree=function(E){for(var _=v.MIN_VALUE,R=0;R_&&(_=L)}return _},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var E=this,_={};this.memberGroups={},this.idToDummyNode={};for(var R=[],D=this.graphManager.getAllNodes(),L=0;L"u"&&(_[A]=[]),_[A]=_[A].concat(B)}Object.keys(_).forEach(function(I){if(_[I].length>1){var O="DummyCompound_"+I;E.memberGroups[O]=_[I];var N=_[I][0].getParent(),M=new u(E.graphManager);M.id=O,M.paddingLeft=N.paddingLeft||0,M.paddingRight=N.paddingRight||0,M.paddingBottom=N.paddingBottom||0,M.paddingTop=N.paddingTop||0,E.idToDummyNode[O]=M;var P=E.getGraphManager().add(E.newGraph(),M),F=N.getChild();F.add(M);for(var V=0;V<_[I].length;V++){var z=_[I][V];F.remove(z),P.add(z)}}})},w.prototype.clearCompounds=function(){var E={},_={};this.performDFSOnCompounds();for(var R=0;R=0;E--){var _=this.compoundOrder[E],R=_.id,D=_.paddingLeft,L=_.paddingTop;this.adjustLocations(this.tiledMemberPack[R],_.rect.x,_.rect.y,D,L)}},w.prototype.repopulateZeroDegreeMembers=function(){var E=this,_=this.tiledZeroDegreePack;Object.keys(_).forEach(function(R){var D=E.idToDummyNode[R],L=D.paddingLeft,B=D.paddingTop;E.adjustLocations(_[R],D.rect.x,D.rect.y,L,B)})},w.prototype.getToBeTiled=function(E){var _=E.id;if(this.toBeTiled[_]!=null)return this.toBeTiled[_];var R=E.getChild();if(R==null)return this.toBeTiled[_]=!1,!1;for(var D=R.getNodes(),L=0;L0)return this.toBeTiled[_]=!1,!1;if(B.getChild()==null){this.toBeTiled[B.id]=!1;continue}if(!this.getToBeTiled(B))return this.toBeTiled[_]=!1,!1}return this.toBeTiled[_]=!0,!0},w.prototype.getNodeDegree=function(E){E.id;for(var _=E.getEdges(),R=0,D=0;D<_.length;D++){var L=_[D];L.getSource().id!==L.getTarget().id&&(R=R+1)}return R},w.prototype.getNodeDegreeWithChildren=function(E){var _=this.getNodeDegree(E);if(E.getChild()==null)return _;for(var R=E.getChild().getNodes(),D=0;DI&&(I=N.rect.height)}R+=I+E.verticalPadding}},w.prototype.tileCompoundMembers=function(E,_){var R=this;this.tiledMemberPack=[],Object.keys(E).forEach(function(D){var L=_[D];R.tiledMemberPack[D]=R.tileNodes(E[D],L.paddingLeft+L.paddingRight),L.rect.width=R.tiledMemberPack[D].width,L.rect.height=R.tiledMemberPack[D].height})},w.prototype.tileNodes=function(E,_){var R=d.TILING_PADDING_VERTICAL,D=d.TILING_PADDING_HORIZONTAL,L={rows:[],rowWidth:[],rowHeight:[],width:0,height:_,verticalPadding:R,horizontalPadding:D};E.sort(function(A,I){return A.rect.width*A.rect.height>I.rect.width*I.rect.height?-1:A.rect.width*A.rect.height0&&($+=E.horizontalPadding),E.rowWidth[R]=$,E.width<$&&(E.width=$);var A=_.rect.height;R>0&&(A+=E.verticalPadding);var I=0;A>E.rowHeight[R]&&(I=E.rowHeight[R],E.rowHeight[R]=A,I=E.rowHeight[R]-I),E.height+=I,E.rows[R].push(_)},w.prototype.getShortestRowIndex=function(E){for(var _=-1,R=Number.MAX_VALUE,D=0;DR&&(_=D,R=E.rowWidth[D]);return _},w.prototype.canAddHorizontal=function(E,_,R){var D=this.getShortestRowIndex(E);if(D<0)return!0;var L=E.rowWidth[D];if(L+E.horizontalPadding+_<=E.width)return!0;var B=0;E.rowHeight[D]0&&(B=R+E.verticalPadding-E.rowHeight[D]);var $;E.width-L>=_+E.horizontalPadding?$=(E.height+B)/(L+_+E.horizontalPadding):$=(E.height+B)/E.width,B=R+E.verticalPadding;var A;return E.width<_?A=(E.height+B)/_:A=(E.height+B)/E.width,A<1&&(A=1/A),$<1&&($=1/$),$B&&_!=R){D.splice(-1,1),E.rows[R].push(L),E.rowWidth[_]=E.rowWidth[_]-B,E.rowWidth[R]=E.rowWidth[R]+B,E.width=E.rowWidth[instance.getLongestRowIndex(E)];for(var $=Number.MIN_VALUE,A=0;A$&&($=D[A].height);_>0&&($+=E.verticalPadding);var I=E.rowHeight[_]+E.rowHeight[R];E.rowHeight[_]=$,E.rowHeight[R]0)for(var F=L;F<=B;F++)P[0]+=this.grid[F][$-1].length+this.grid[F][$].length-1;if(B0)for(var F=$;F<=A;F++)P[3]+=this.grid[L-1][F].length+this.grid[L][F].length-1;for(var V=v.MAX_VALUE,z,W,X=0;X0){var A;A=C.getGraphManager().add(C.newGraph(),R),this.processChildrenList(A,_,C)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(uC)),uC.exports}var J9e=Q9e();const eze=jl(J9e);Go.use(eze);function mne(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}x(mne,"addNodes");function yne(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}x(yne,"addEdges");function vne(t){return new Promise(e=>{const r=ft("body").append("div").attr("id","cy").attr("style","display:none"),n=Go({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),mne(t.nodes,n),yne(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{he.info("Cytoscape ready",a),e(n)})})}x(vne,"createCytoscapeInstance");function xne(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}x(xne,"extractPositionedNodes");function bne(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}x(bne,"extractPositionedEdges");async function Tne(t,e){he.debug("Starting cose-bilkent layout algorithm");try{Cne(t);const r=await vne(t),n=xne(r),i=bne(r);return he.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw he.error("Error in cose-bilkent layout algorithm:",r),r}}x(Tne,"executeCoseBilkentLayout");function Cne(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}x(Cne,"validateLayoutData");var tze=x(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const C={...b};d[b.id]=C,h[b.id]=C,await r(p,b)}else{const C={...b};h[b.id]=C;const w=await s(y,b,{config:t.config,dir:t.direction||"TB"}),S=w.node().getBBox();C.width=S.width,C.height=S.height,C.domId=w,o.debug(`Node ${b.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const C=h[b.id];return{...b,width:C.width,height:C.height}})},T=await Tne(v,t.config);o.debug("Positioning nodes based on layout results"),T.nodes.forEach(b=>{const C=h[b.id];C!=null&&C.domId&&(C.domId.attr("transform",`translate(${b.x}, ${b.y})`),C.x=b.x,C.y=b.y,o.debug(`Positioned node ${C.id} at center (${b.x}, ${b.y})`))}),T.edges.forEach(b=>{const C=t.edges.find(w=>w.id===b.id);C&&(C.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const C=h[b.start??""],w=h[b.end??""];if(C&&w){const S=T.edges.find(E=>E.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const E={...b},_=n(g,E,d,t.type,C,w,t.diagramId);l(E,_)}else{const E={...b,points:[{x:C.x||0,y:C.y||0},{x:w.x||0,y:w.y||0}]},_=n(g,E,d,t.type,C,w,t.diagramId);l(E,_)}}})),o.debug("Cose-bilkent rendering completed")},"render"),rze=tze;const nze=Object.freeze(Object.defineProperty({__proto__:null,render:rze},Symbol.toStringTag,{value:"Module"}));var Rk=x((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),wne=x((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};Rk(t,r).lower()},"drawBackgroundRect"),ize=x((t,e)=>{const r=e.text.replace(ev," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),I$=x((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=nv.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),D$=x((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=nv.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),ks=x(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),M$=x(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),N$=x(()=>{let t=ft(".mermaidTooltip");return t.empty()&&(t=ft("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),hE=(function(){var t=x(function(Ae,be,ke,se){for(ke=ke||{},se=Ae.length;se--;ke[Ae[se]]=be);return ke},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],T=[1,34],b=[1,35],C=[1,36],w=[1,37],S=[1,38],E=[1,39],_=[1,40],R=[1,41],D=[1,42],L=[1,43],B=[1,44],$=[1,45],A=[1,46],I=[1,47],O=[1,48],N=[1,50],M=[1,51],P=[1,52],F=[1,53],V=[1,54],z=[1,55],W=[1,56],X=[1,57],j=[1,58],re=[1,59],Q=[1,60],oe=[14,42],ee=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ne=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ie=[1,82],ae=[1,83],de=[1,84],le=[1,85],ye=[12,14,42],$e=[12,14,33,42],Fe=[12,14,33,42,76,77,79,80],ce=[12,33],ve=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ce={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:x(function(be,ke,se,J,G,q,H){var Z=q.length-1;switch(G){case 3:J.setDirection("TB");break;case 4:J.setDirection("BT");break;case 5:J.setDirection("RL");break;case 6:J.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:J.setC4Type(q[Z-3]);break;case 19:J.setTitle(q[Z].substring(6)),this.$=q[Z].substring(6);break;case 20:J.setAccDescription(q[Z].substring(15)),this.$=q[Z].substring(15);break;case 21:this.$=q[Z].trim(),J.setTitle(this.$);break;case 22:case 23:this.$=q[Z].trim(),J.setAccDescription(this.$);break;case 28:q[Z].splice(2,0,"ENTERPRISE"),J.addPersonOrSystemBoundary(...q[Z]),this.$=q[Z];break;case 29:q[Z].splice(2,0,"SYSTEM"),J.addPersonOrSystemBoundary(...q[Z]),this.$=q[Z];break;case 30:J.addPersonOrSystemBoundary(...q[Z]),this.$=q[Z];break;case 31:q[Z].splice(2,0,"CONTAINER"),J.addContainerBoundary(...q[Z]),this.$=q[Z];break;case 32:J.addDeploymentNode("node",...q[Z]),this.$=q[Z];break;case 33:J.addDeploymentNode("nodeL",...q[Z]),this.$=q[Z];break;case 34:J.addDeploymentNode("nodeR",...q[Z]),this.$=q[Z];break;case 35:J.popBoundaryParseStack();break;case 39:J.addPersonOrSystem("person",...q[Z]),this.$=q[Z];break;case 40:J.addPersonOrSystem("external_person",...q[Z]),this.$=q[Z];break;case 41:J.addPersonOrSystem("system",...q[Z]),this.$=q[Z];break;case 42:J.addPersonOrSystem("system_db",...q[Z]),this.$=q[Z];break;case 43:J.addPersonOrSystem("system_queue",...q[Z]),this.$=q[Z];break;case 44:J.addPersonOrSystem("external_system",...q[Z]),this.$=q[Z];break;case 45:J.addPersonOrSystem("external_system_db",...q[Z]),this.$=q[Z];break;case 46:J.addPersonOrSystem("external_system_queue",...q[Z]),this.$=q[Z];break;case 47:J.addContainer("container",...q[Z]),this.$=q[Z];break;case 48:J.addContainer("container_db",...q[Z]),this.$=q[Z];break;case 49:J.addContainer("container_queue",...q[Z]),this.$=q[Z];break;case 50:J.addContainer("external_container",...q[Z]),this.$=q[Z];break;case 51:J.addContainer("external_container_db",...q[Z]),this.$=q[Z];break;case 52:J.addContainer("external_container_queue",...q[Z]),this.$=q[Z];break;case 53:J.addComponent("component",...q[Z]),this.$=q[Z];break;case 54:J.addComponent("component_db",...q[Z]),this.$=q[Z];break;case 55:J.addComponent("component_queue",...q[Z]),this.$=q[Z];break;case 56:J.addComponent("external_component",...q[Z]),this.$=q[Z];break;case 57:J.addComponent("external_component_db",...q[Z]),this.$=q[Z];break;case 58:J.addComponent("external_component_queue",...q[Z]),this.$=q[Z];break;case 60:J.addRel("rel",...q[Z]),this.$=q[Z];break;case 61:J.addRel("birel",...q[Z]),this.$=q[Z];break;case 62:J.addRel("rel_u",...q[Z]),this.$=q[Z];break;case 63:J.addRel("rel_d",...q[Z]),this.$=q[Z];break;case 64:J.addRel("rel_l",...q[Z]),this.$=q[Z];break;case 65:J.addRel("rel_r",...q[Z]),this.$=q[Z];break;case 66:J.addRel("rel_b",...q[Z]),this.$=q[Z];break;case 67:q[Z].splice(0,1),J.addRel("rel",...q[Z]),this.$=q[Z];break;case 68:J.updateElStyle("update_el_style",...q[Z]),this.$=q[Z];break;case 69:J.updateRelStyle("update_rel_style",...q[Z]),this.$=q[Z];break;case 70:J.updateLayoutConfig("update_layout_config",...q[Z]),this.$=q[Z];break;case 71:this.$=[q[Z]];break;case 72:q[Z].unshift(q[Z-1]),this.$=q[Z];break;case 73:case 75:this.$=q[Z].trim();break;case 74:let te={};te[q[Z-1].trim()]=q[Z].trim(),this.$=te;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:C,52:w,53:S,54:E,55:_,56:R,57:D,58:L,59:B,60:$,61:A,62:I,63:O,64:N,65:M,66:P,67:F,68:V,69:z,70:W,71:X,72:j,73:re,74:Q},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:C,52:w,53:S,54:E,55:_,56:R,57:D,58:L,59:B,60:$,61:A,62:I,63:O,64:N,65:M,66:P,67:F,68:V,69:z,70:W,71:X,72:j,73:re,74:Q},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:C,52:w,53:S,54:E,55:_,56:R,57:D,58:L,59:B,60:$,61:A,62:I,63:O,64:N,65:M,66:P,67:F,68:V,69:z,70:W,71:X,72:j,73:re,74:Q},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:C,52:w,53:S,54:E,55:_,56:R,57:D,58:L,59:B,60:$,61:A,62:I,63:O,64:N,65:M,66:P,67:F,68:V,69:z,70:W,71:X,72:j,73:re,74:Q},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:C,52:w,53:S,54:E,55:_,56:R,57:D,58:L,59:B,60:$,61:A,62:I,63:O,64:N,65:M,66:P,67:F,68:V,69:z,70:W,71:X,72:j,73:re,74:Q},{14:[1,74]},t(oe,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:C,52:w,53:S,54:E,55:_,56:R,57:D,58:L,59:B,60:$,61:A,62:I,63:O,64:N,65:M,66:P,67:F,68:V,69:z,70:W,71:X,72:j,73:re,74:Q}),t(oe,[2,14]),t(ee,[2,16],{12:[1,76]}),t(oe,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:ie,77:ae,79:de,80:le},{35:86,75:81,76:ie,77:ae,79:de,80:le},{35:87,75:81,76:ie,77:ae,79:de,80:le},{35:88,75:81,76:ie,77:ae,79:de,80:le},{35:89,75:81,76:ie,77:ae,79:de,80:le},{35:90,75:81,76:ie,77:ae,79:de,80:le},{35:91,75:81,76:ie,77:ae,79:de,80:le},{35:92,75:81,76:ie,77:ae,79:de,80:le},{35:93,75:81,76:ie,77:ae,79:de,80:le},{35:94,75:81,76:ie,77:ae,79:de,80:le},{35:95,75:81,76:ie,77:ae,79:de,80:le},{35:96,75:81,76:ie,77:ae,79:de,80:le},{35:97,75:81,76:ie,77:ae,79:de,80:le},{35:98,75:81,76:ie,77:ae,79:de,80:le},{35:99,75:81,76:ie,77:ae,79:de,80:le},{35:100,75:81,76:ie,77:ae,79:de,80:le},{35:101,75:81,76:ie,77:ae,79:de,80:le},{35:102,75:81,76:ie,77:ae,79:de,80:le},{35:103,75:81,76:ie,77:ae,79:de,80:le},{35:104,75:81,76:ie,77:ae,79:de,80:le},t(ye,[2,59]),{35:105,75:81,76:ie,77:ae,79:de,80:le},{35:106,75:81,76:ie,77:ae,79:de,80:le},{35:107,75:81,76:ie,77:ae,79:de,80:le},{35:108,75:81,76:ie,77:ae,79:de,80:le},{35:109,75:81,76:ie,77:ae,79:de,80:le},{35:110,75:81,76:ie,77:ae,79:de,80:le},{35:111,75:81,76:ie,77:ae,79:de,80:le},{35:112,75:81,76:ie,77:ae,79:de,80:le},{35:113,75:81,76:ie,77:ae,79:de,80:le},{35:114,75:81,76:ie,77:ae,79:de,80:le},{35:115,75:81,76:ie,77:ae,79:de,80:le},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:C,52:w,53:S,54:E,55:_,56:R,57:D,58:L,59:B,60:$,61:A,62:I,63:O,64:N,65:M,66:P,67:F,68:V,69:z,70:W,71:X,72:j,73:re,74:Q},{12:[1,118],33:[1,117]},{35:119,75:81,76:ie,77:ae,79:de,80:le},{35:120,75:81,76:ie,77:ae,79:de,80:le},{35:121,75:81,76:ie,77:ae,79:de,80:le},{35:122,75:81,76:ie,77:ae,79:de,80:le},{35:123,75:81,76:ie,77:ae,79:de,80:le},{35:124,75:81,76:ie,77:ae,79:de,80:le},{35:125,75:81,76:ie,77:ae,79:de,80:le},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(oe,[2,15]),t(ee,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(oe,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:C,52:w,53:S,54:E,55:_,56:R,57:D,58:L,59:B,60:$,61:A,62:I,63:O,64:N,65:M,66:P,67:F,68:V,69:z,70:W,71:X,72:j,73:re,74:Q}),t(ne,[2,21]),t(ne,[2,22]),t(ye,[2,39]),t($e,[2,71],{75:81,35:132,76:ie,77:ae,79:de,80:le}),t(Fe,[2,73]),{78:[1,133]},t(Fe,[2,75]),t(Fe,[2,76]),t(ye,[2,40]),t(ye,[2,41]),t(ye,[2,42]),t(ye,[2,43]),t(ye,[2,44]),t(ye,[2,45]),t(ye,[2,46]),t(ye,[2,47]),t(ye,[2,48]),t(ye,[2,49]),t(ye,[2,50]),t(ye,[2,51]),t(ye,[2,52]),t(ye,[2,53]),t(ye,[2,54]),t(ye,[2,55]),t(ye,[2,56]),t(ye,[2,57]),t(ye,[2,58]),t(ye,[2,60]),t(ye,[2,61]),t(ye,[2,62]),t(ye,[2,63]),t(ye,[2,64]),t(ye,[2,65]),t(ye,[2,66]),t(ye,[2,67]),t(ye,[2,68]),t(ye,[2,69]),t(ye,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(ee,[2,18]),t(oe,[2,38]),t($e,[2,72]),t(Fe,[2,74]),t(ye,[2,24]),t(ye,[2,35]),t(ve,[2,25]),t(ve,[2,26],{12:[1,138]}),t(ve,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:x(function(be,ke){if(ke.recoverable)this.trace(be);else{var se=new Error(be);throw se.hash=ke,se}},"parseError"),parse:x(function(be){var ke=this,se=[0],J=[],G=[null],q=[],H=this.table,Z="",te=0,K=0,U=2,Y=1,fe=q.slice.call(arguments,1),ue=Object.create(this.lexer),Te={yy:{}};for(var ge in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ge)&&(Te.yy[ge]=this.yy[ge]);ue.setInput(be,Te.yy),Te.yy.lexer=ue,Te.yy.parser=this,typeof ue.yylloc>"u"&&(ue.yylloc={});var we=ue.yylloc;q.push(we);var xe=ue.options&&ue.options.ranges;typeof Te.yy.parseError=="function"?this.parseError=Te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Le(me){se.length=se.length-2*me,G.length=G.length-me,q.length=q.length-me}x(Le,"popStack");function _e(){var me;return me=J.pop()||ue.lex()||Y,typeof me!="number"&&(me instanceof Array&&(J=me,me=J.pop()),me=ke.symbols_[me]||me),me}x(_e,"lex");for(var Be,Ee,Xe,Re,Qe={},it,Ue,mt,ot;;){if(Ee=se[se.length-1],this.defaultActions[Ee]?Xe=this.defaultActions[Ee]:((Be===null||typeof Be>"u")&&(Be=_e()),Xe=H[Ee]&&H[Ee][Be]),typeof Xe>"u"||!Xe.length||!Xe[0]){var Ke="";ot=[];for(it in H[Ee])this.terminals_[it]&&it>U&&ot.push("'"+this.terminals_[it]+"'");ue.showPosition?Ke="Parse error on line "+(te+1)+`: `+ue.showPosition()+` Expecting `+ot.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":Ke="Parse error on line "+(te+1)+": Unexpected "+(Be==Y?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(Ke,{text:ue.match,token:this.terminals_[Be]||Be,line:ue.yylineno,loc:we,expected:ot})}if(Xe[0]instanceof Array&&Xe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ee+", token: "+Be);switch(Xe[0]){case 1:se.push(Be),G.push(ue.yytext),q.push(ue.yylloc),se.push(Xe[1]),Be=null,K=ue.yyleng,Z=ue.yytext,te=ue.yylineno,we=ue.yylloc;break;case 2:if(Ue=this.productions_[Xe[1]][1],Qe.$=G[G.length-Ue],Qe._$={first_line:q[q.length-(Ue||1)].first_line,last_line:q[q.length-1].last_line,first_column:q[q.length-(Ue||1)].first_column,last_column:q[q.length-1].last_column},xe&&(Qe._$.range=[q[q.length-(Ue||1)].range[0],q[q.length-1].range[1]]),Re=this.performAction.apply(Qe,[Z,K,te,Te.yy,Xe[1],G,q].concat(fe)),typeof Re<"u")return Re;Ue&&(se=se.slice(0,-1*Ue*2),G=G.slice(0,-1*Ue),q=q.slice(0,-1*Ue)),se.push(this.productions_[Xe[1]][0]),G.push(Qe.$),q.push(Qe._$),mt=H[se[se.length-2]][se[se.length-1]],se.push(mt);break;case 3:return!0}}return!0},"parse")},Ne=(function(){var Ae={EOF:1,parseError:x(function(ke,se){if(this.yy.parser)this.yy.parser.parseError(ke,se);else throw new Error(ke)},"parseError"),setInput:x(function(be,ke){return this.yy=ke||this.yy||{},this._input=be,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var be=this._input[0];this.yytext+=be,this.yyleng++,this.offset++,this.match+=be,this.matched+=be;var ke=be.match(/(?:\r\n?|\n).*/g);return ke?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),be},"input"),unput:x(function(be){var ke=be.length,se=be.split(/(?:\r\n?|\n)/g);this._input=be+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ke),this.offset-=ke;var J=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),se.length-1&&(this.yylineno-=se.length-1);var G=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:se?(se.length===J.length?this.yylloc.first_column:0)+J[J.length-se.length].length-se[0].length:this.yylloc.first_column-ke},this.options.ranges&&(this.yylloc.range=[G[0],G[0]+this.yyleng-ke]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(be){this.unput(this.match.slice(be))},"less"),pastInput:x(function(){var be=this.matched.substr(0,this.matched.length-this.match.length);return(be.length>20?"...":"")+be.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var be=this.match;return be.length<20&&(be+=this._input.substr(0,20-be.length)),(be.substr(0,20)+(be.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var be=this.pastInput(),ke=new Array(be.length+1).join("-");return be+this.upcomingInput()+` `+ke+"^"},"showPosition"),test_match:x(function(be,ke){var se,J,G;if(this.options.backtrack_lexer&&(G={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(G.yylloc.range=this.yylloc.range.slice(0))),J=be[0].match(/(?:\r\n?|\n).*/g),J&&(this.yylineno+=J.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:J?J[J.length-1].length-J[J.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+be[0].length},this.yytext+=be[0],this.match+=be[0],this.matches=be,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(be[0].length),this.matched+=be[0],se=this.performAction.call(this,this.yy,this,ke,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),se)return se;if(this._backtrack){for(var q in G)this[q]=G[q];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var be,ke,se,J;this._more||(this.yytext="",this.match="");for(var G=this._currentRules(),q=0;qke[0].length)){if(ke=se,J=q,this.options.backtrack_lexer){if(be=this.test_match(se,G[q]),be!==!1)return be;if(this._backtrack){ke=!1;continue}else return!1}else if(!this.options.flex)break}return ke?(be=this.test_match(ke,G[J]),be!==!1?be:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var ke=this.next();return ke||this.lex()},"lex"),begin:x(function(ke){this.conditionStack.push(ke)},"begin"),popState:x(function(){var ke=this.conditionStack.length-1;return ke>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(ke){return ke=this.conditionStack.length-1-Math.abs(ke||0),ke>=0?this.conditionStack[ke]:"INITIAL"},"topState"),pushState:x(function(ke){this.begin(ke)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(ke,se,J,G){switch(J){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return Ae})();Ce.lexer=Ne;function Ie(){this.yy={}}return x(Ie,"Parser"),Ie.prototype=Ce,Ce.Parser=Ie,new Ie})();hE.parser=hE;var aze=hE,Ene=x(t=>Pe()[t],"getRequiredConfig"),Td=x((t,e)=>{for(const[r,n]of Object.entries(e))if(n!==void 0)if(typeof n=="object"){const[i,a]=Object.entries(n)[0];t[i]=a}else t[r]=n},"assignAttributes"),Sne=x(()=>({alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}),"createGlobalBoundary"),io=[],Bc=[""],oa="global",Ks="",Vo=[Sne()],Qx=[],O$="",$$=!1,dE=4,fE=2,kne,sze=x(function(){return kne},"getC4Type"),oze=x(function(t){kne=xr(t,Pe())},"setC4Type"),lze=x(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=Qx.find(d=>d.from===e&&d.to===r);if(h?u=h:Qx.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){const[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){const[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};Td(u,{sprite:s,tags:o,link:l}),u.wrap=pu()},"addRel"),cze=x(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=io.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,io.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){const[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};Td(o,{sprite:i,tags:a,link:s}),o.typeC4Shape={text:t},o.parentBoundary=oa,o.wrap=pu()},"addPersonOrSystem"),uze=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=io.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,io.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){const[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){const[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};Td(l,{sprite:a,tags:s,link:o}),l.wrap=pu(),l.typeC4Shape={text:t},l.parentBoundary=oa},"addContainer"),hze=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=io.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,io.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){const[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){const[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};Td(l,{sprite:a,tags:s,link:o}),l.wrap=pu(),l.typeC4Shape={text:t},l.parentBoundary=oa},"addComponent"),dze=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Vo.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Vo.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){const[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};Td(a,{tags:n,link:i}),a.parentBoundary=oa,a.wrap=pu(),Ks=oa,oa=t,Bc.push(Ks)},"addPersonOrSystemBoundary"),fze=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Vo.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Vo.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){const[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};Td(a,{tags:n,link:i}),a.parentBoundary=oa,a.wrap=pu(),Ks=oa,oa=t,Bc.push(Ks)},"addContainerBoundary"),pze=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Vo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Vo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){const[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){const[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};Td(l,{tags:s,link:o}),l.nodeType=t,l.parentBoundary=oa,l.wrap=pu(),Ks=oa,oa=e,Bc.push(Ks)},"addDeploymentNode"),gze=x(function(){oa=Ks,Bc.pop(),Ks=Bc.pop(),Bc.push(Ks)},"popBoundaryParseStack"),mze=x(function(t,e,r,n,i,a,s,o,l,u,h){let d=io.find(f=>f.alias===e);if(!(d===void 0&&(d=Vo.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){const[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){const[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){const[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){const[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){const[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){const[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){const[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){const[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){const[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),yze=x(function(t,e,r,n,i,a,s){const o=Qx.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){const[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){const[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){const[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){const[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),vze=x(function(t,e,r){let n=dE,i=fE;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(dE=n),i>=1&&(fE=i)},"updateLayoutConfig"),xze=x(function(){return dE},"getC4ShapeInRow"),bze=x(function(){return fE},"getC4BoundaryInRow"),Tze=x(function(){return oa},"getCurrentBoundaryParse"),Cze=x(function(){return Ks},"getParentBoundaryParse"),_ne=x(function(t){return t==null?io:io.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),wze=x(function(t){return io.find(e=>e.alias===t)},"getC4Shape"),Eze=x(function(t){return Object.keys(_ne(t))},"getC4ShapeKeys"),Ane=x(function(t){return t==null?Vo:Vo.filter(e=>e.parentBoundary===t)},"getBoundaries"),Sze=Ane,kze=x(function(){return Qx},"getRels"),_ze=x(function(){return O$},"getTitle"),Aze=x(function(t){$$=t},"setWrap"),pu=x(function(){return $$},"autoWrap"),Rze=x(function(){io=[],Vo=[Sne()],Ks="",oa="global",Bc=[""],Qx=[],Bc=[""],O$="",$$=!1,dE=4,fE=2},"clear"),Lze={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},Ize={FILLED:0,OPEN:1},Dze={LEFTOF:0,RIGHTOF:1,OVER:2},Mze=x(function(t){O$=xr(t,Pe())},"setTitle"),G5={addPersonOrSystem:cze,addPersonOrSystemBoundary:dze,addContainer:uze,addContainerBoundary:fze,addComponent:hze,addDeploymentNode:pze,popBoundaryParseStack:gze,addRel:lze,updateElStyle:mze,updateRelStyle:yze,updateLayoutConfig:vze,autoWrap:pu,setWrap:Aze,getC4ShapeArray:_ne,getC4Shape:wze,getC4ShapeKeys:Eze,getBoundaries:Ane,getBoundarys:Sze,getCurrentBoundaryParse:Tze,getParentBoundaryParse:Cze,getRels:kze,getTitle:_ze,getC4Type:sze,getC4ShapeInRow:xze,getC4BoundaryInRow:bze,setAccTitle:rn,getAccTitle:pn,getAccDescription:mn,setAccDescription:gn,getConfig:x(()=>Ene("c4"),"getConfig"),clear:Rze,LINETYPE:Lze,ARROWTYPE:Ize,PLACEMENT:Dze,setTitle:Mze,setC4Type:oze},Rne=x(function(t,e){return Rk(t,e)},"drawRect"),Nze=x((t,e,r,n)=>{const i=t.append("g");let a=0;for(const s of e){const o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(String(s.offsetX)):0,h=s.offsetY?parseInt(String(s.offsetY)):0,d="";if(a===0){const g=i.append("line");g.attr("x1",s.startPoint.x),g.attr("y1",s.startPoint.y),g.attr("x2",s.endPoint.x),g.attr("y2",s.endPoint.y),g.attr("stroke-width","1"),g.attr("stroke",l),g.style("fill","none"),s.type!=="rel_b"&&g.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&g.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{const g=i.append("path");g.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&g.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&g.attr("marker-start","url("+d+"#"+n+"-arrowend)")}const f=s.label.width;let p=r.messageFont();nx(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,f,s.label.height,{fill:o},p),s.techn&&s.techn.text!==""&&(p=r.messageFont(),nx(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(f,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},p))}},"drawRels"),Oze=x(function(t,e,r){const n=t.append("g"),i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black";let o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});const l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};Rne(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,nx(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,nx(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,nx(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),$ze=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Pze=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Bze=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Fze=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),zze=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),Gze=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).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")},"insertArrowFilledHead"),Vze=x(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),nx=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(yt.lineBreakRegex);for(let y=0;y{var r;if(e==="sandbox"){const i=(r=ft("#i"+t).node())==null?void 0:r.contentDocument;if(!i)throw new Error(`Sandbox iframe #i${t} is missing its content document`);return{root:ft(i.body),doc:i}}return{root:ft("body"),doc:document}},"getDiagramRoot"),qze=new Set(["system_queue","external_system_queue","container_queue","external_container_queue","component_queue","external_component_queue"]),Uze=new Set(["system_db","external_system_db","container_db","external_container_db","component_db","external_component_db"]),Hze={person:"person",box:"rounded",rounded:"rounded",cylinder:"cylinder",database:"cylinder",db:"cylinder",queue:"h-cyl",pipe:"h-cyl",component:"fr-rect"},jL=x(t=>t?Hze[t.toLowerCase()]:void 0,"keywordShape"),Yze=x(t=>{const e=jL(t.shape)??jL(t.sprite);if(e)return e;if(t.tags)for(const n of t.tags.split(",")){const i=jL(n.trim());if(i)return i}const r=t.typeC4Shape.text;return r==="person"||r==="external_person"?"person":Uze.has(r)?"cylinder":qze.has(r)?"h-cyl":"rounded"},"resolveNodeShape"),Xze={person:"Person",system:"Software System",container:"Container",component:"Component"},jze=x(t=>{const e=t.replace(/^external_/,"").replace(/_(db|queue)$/,"");return Xze[e]??e.replace(/_/g," ")},"stereotypeLabel"),Kze=x(t=>t.startsWith("external_"),"isExternal"),Zze=x(t=>{var r;const e=jze(t.typeC4Shape.text);return(r=t.techn)!=null&&r.text?`[${e}: ${t.techn.text}]`:`[${e}]`},"stereotypeText"),Lne=["person","system","system_db","system_queue","container","container_db","container_queue","component","component_db","component_queue"].flatMap(t=>[t,`external_${t}`]),Qze=new Set(Lne),qV=x(t=>Qze.has(t),"isC4ElementType"),Jze=x((t,e)=>{const r=t.typeC4Shape.text,n=t.bgColor??(qV(r)&&e[`${r}_bg_color`]),i=t.borderColor??(qV(r)&&e[`${r}_border_color`]),a=[];return n&&a.push(`fill:${n}`),i&&a.push(`stroke:${i}`),a.push(`color:${t.fontColor??"#FFFFFF"}`),a},"elementCssStyles"),UV=x((t,e,r,n,i)=>{var u;const a=t.typeC4Shape.text,s=["c4-shape",`c4-${a}`];Kze(a)&&s.push("c4-external");const o=Yze(t),l=Jze(t,e);return(o==="rounded"||o==="fr-rect")&&l.push("rx:12px","ry:12px"),{id:t.alias,label:t.label.text,stereotype:Zze(t),description:(u=t.descr)!=null&&u.text?[t.descr.text]:void 0,labelType:"string",isGroup:!1,shape:o,cssClasses:s.join(" "),cssStyles:l,padding:r,look:n,useHtmlLabels:!1,width:i}},"buildC4Node"),ix=0,ax=0,Ine=4,V5=2;hE.yy=G5;var qt={},zp,Dne=(zp=class{constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,W5(e.db.getConfig())}setData(e,r,n,i){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(e,r,n,i){e[r]===void 0?e[r]=n:e[r]=i(n,e[r])}insert(e){this.nextData.cnt=this.nextData.cnt+1;const r=this.nextData.stopx,n=this.data.widthLimit;let i=this.nextData.startx===this.nextData.stopx?r+e.margin:r+e.margin*2,a=i+e.width,s=this.nextData.starty+e.margin*2,o=s+e.height;(i>=n||a>=n||this.nextData.cnt>Ine)&&(i=this.nextData.startx+e.margin+qt.nextLinePaddingX,s=this.nextData.stopy+e.margin*2,this.nextData.stopx=a=i+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=o=s+e.height,this.nextData.cnt=1),e.x=i,e.y=s,this.updateVal(this.data,"startx",i,Math.min),this.updateVal(this.data,"starty",s,Math.min),this.updateVal(this.data,"stopx",a,Math.max),this.updateVal(this.data,"stopy",o,Math.max),this.updateVal(this.nextData,"startx",i,Math.min),this.updateVal(this.nextData,"starty",s,Math.min),this.updateVal(this.nextData,"stopx",a,Math.max),this.updateVal(this.nextData,"stopy",o,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},W5(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},x(zp,"Bounds"),zp),W5=x(function(t){Gn(qt,t),t!=null&&t.fontFamily&&(qt.personFontFamily=qt.systemFontFamily=qt.messageFontFamily=t.fontFamily),t!=null&&t.fontSize&&(qt.personFontSize=qt.systemFontSize=qt.messageFontSize=t.fontSize),t!=null&&t.fontWeight&&(qt.personFontWeight=qt.systemFontWeight=qt.messageFontWeight=t.fontWeight)},"setConf"),fC=x(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),eGe=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function Fc(t,e,r,n,i){const a=e[t];if(!a.width)if(r)a.text=K1(a.text,i,n),a.textLines=a.text.split(yt.lineBreakRegex).length,a.width=i,a.height=_w(a.text,n);else{const s=a.text.split(yt.lineBreakRegex);a.textLines=s.length;let o=0;a.height=0,a.width=0;for(const l of s)a.width=Math.max($a(l,n),a.width),o=_w(l,n),a.height=a.height+o}return a}x(Fc,"calcC4ShapeTextWH");var Mne=x(function(t,e,r){const n=r.data.startx,i=r.data.starty;e.x=n,e.y=i,e.width=r.data.stopx-n,e.height=r.data.stopy-i,e.label.y=qt.c4ShapeMargin-35;const a=e.wrap&&qt.wrap,s=fC(qt);s.fontSize=s.fontSize+2,s.fontWeight="bold";const o=$a(e.label.text,s);Fc("label",e,a,s,o),gl.drawBoundary(t,e,qt)},"drawBoundary"),Nne=x(async function(t,e,r,n){const i=Pe(),a=i.look??"classic",s={config:i},o=e.attr("id")??"",l=n.map(h=>r[Number(h)]),u=x(h=>{const d=h.shape?qN[h.shape]:void 0;if(!d)throw new Error(`C4: no shape handler for "${h.shape}"`);return d},"shapeHandlerFor");await Promise.all(l.map(async h=>{const d=UV(h,qt,qt.c4ShapePadding,a,qt.width);d.domId=`${o}-${d.id}`;const f=await u(d)(e,d,s);h.width=d.width??qt.width,h.height=d.height??qt.height,h.margin=qt.c4ShapeMargin,f.remove()}));for(const h of l)t.insert(h);await Promise.all(l.map(async h=>{const d=UV(h,qt,qt.c4ShapePadding,a,qt.width);d.domId=`${o}-${d.id}`,d.x=h.x+h.width/2,d.y=h.y+h.height/2;const f=e.append("g").attr("transform",`translate(${h.x+h.width/2}, ${h.y+h.height/2})`);await u(d)(f,d,s),h.intersect=d.intersect})),t.bumpLastMargin(qt.c4ShapeMargin)},"drawC4ShapeArray"),Gp,tGe=(Gp=class{constructor(e,r){this.x=e,this.y=r}},x(Gp,"Point"),Gp),HV=x(function(t,e){if(!t.intersect)throw new Error(`C4 shape "${t.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`);const{x:r,y:n}=t.intersect(e);return new tGe(r,n)},"getIntersectPoint"),rGe=x(function(t,e){const r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;const n=HV(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;const i=HV(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),nGe=x(function(t,e,r,n,i){const a=n.db.getC4Type();let s=0;for(const o of e){s=s+1;const l=o.wrap&&qt.wrap,u=eGe(qt);a==="C4Dynamic"&&(o.label.text=s+": "+o.label.text);let h=$a(o.label.text,u);Fc("label",o,l,u,h),o.techn&&o.techn.text!==""&&(h=$a(o.techn.text,u),Fc("techn",o,l,u,h)),o.descr&&o.descr.text!==""&&(h=$a(o.descr.text,u),Fc("descr",o,l,u,h));const d=r(o.from),f=r(o.to);if(!d||!f)throw new Error(`C4 rel "${o.from}" -> "${o.to}" references an unknown shape`);const p=rGe(d,f);if(!p.startPoint||!p.endPoint)throw new Error(`Could not calculate intersection points for rel "${o.from}" -> "${o.to}"`);o.startPoint=p.startPoint,o.endPoint=p.endPoint}gl.drawRels(t,e,qt,i)},"drawRels");async function P$(t,e,r,n,i){const a=i.db,s=new Dne(i);s.data.widthLimit=r.data.widthLimit/Math.min(V5,n.length);for(const[o,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);const h=l.wrap&&qt.wrap,d=fC(qt);d.fontSize=d.fontSize+2,d.fontWeight="bold";const f=Fc("label",l,h,d,s.data.widthLimit);if(f.Y=u+8,u=f.Y+f.height,l.type&&l.type.text!==""){l.type.text="["+l.type.text+"]";const y=fC(qt),v=Fc("type",l,h,y,s.data.widthLimit);v.Y=u+5,u=v.Y+v.height}if(l.descr&&l.descr.text!==""){const y=fC(qt);y.fontSize=y.fontSize-2;const v=Fc("descr",l,h,y,s.data.widthLimit);v.Y=u+20,u=v.Y+v.height}if(o==0||o%V5===0){const y=r.data.startx+qt.diagramMarginX,v=r.data.stopy+qt.diagramMarginY+u;s.setData(y,y,v,v)}else{const y=s.data.stopx!==s.data.startx?s.data.stopx+qt.diagramMarginX:s.data.startx,v=s.data.starty;s.setData(y,y,v,v)}s.name=l.alias;const p=a.getC4ShapeArray(l.alias),g=a.getC4ShapeKeys(l.alias);g.length>0&&await Nne(s,t,p,g),e=l.alias;const m=a.getBoundaries(e);m.length>0&&await P$(t,e,s,m,i),l.alias!=="global"&&Mne(t,l,s),r.data.stopy=Math.max(s.data.stopy+qt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(s.data.stopx+qt.c4ShapeMargin,r.data.stopx),ix=Math.max(ix,r.data.stopx),ax=Math.max(ax,r.data.stopy)}}x(P$,"drawInsideBoundary");var iGe=x(async function(t,e,r,n){qt=Ene("c4");const i=Pe().securityLevel,{root:a}=Wze(e,i),s=n.db;s.setWrap(qt.wrap),Ine=s.getC4ShapeInRow(),V5=s.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(qt,null,2)}`);const o=a.select(`[id="${e}"]`);gl.insertComputerIcon(o,e),gl.insertDatabaseIcon(o,e),gl.insertClockIcon(o,e);const l=new Dne(n);l.setData(qt.diagramMarginX,qt.diagramMarginX,qt.diagramMarginY,qt.diagramMarginY),l.data.widthLimit=screen.availWidth,ix=qt.diagramMarginX,ax=qt.diagramMarginY;const u=s.getTitle(),h=s.getBoundaries("");await P$(o,"",l,h,n),gl.insertArrowHead(o,e),gl.insertArrowEnd(o,e),gl.insertArrowCrossHead(o,e),gl.insertArrowFilledHead(o,e),nGe(o,s.getRels(),s.getC4Shape,n,e),l.data.stopx=ix,l.data.stopy=ax;const d=l.data,f=d.startx,p=d.starty,m=ax-p+2*qt.diagramMarginY,y=ix-f,v=y+2*qt.diagramMarginX;u&&o.append("text").text(u).attr("x",y/2-4*qt.diagramMarginX).attr("y",p+qt.diagramMarginY),Rn(o,m,v,qt.useMaxWidth);const T=u?60:0;o.attr("viewBox",f-qt.diagramMarginX+" -"+(qt.diagramMarginY+T)+" "+v+" "+(m+T)),he.debug("models:",d)},"draw"),YV={drawPersonOrSystemArray:Nne,drawBoundary:Mne,setConf:W5,draw:iGe},aGe=x(()=>{const t=Pe().c4??{},e=new CSSStyleSheet;for(const r of Lne){const n=e.cssRules[e.insertRule(`.c4-shape.c4-${r} .label {}`,e.cssRules.length)],i=t[`${r}FontFamily`],a=t[`${r}FontSize`],s=t[`${r}FontWeight`];i&&n.style.setProperty("font-family",i),a&&n.style.setProperty("font-size",typeof a=="number"?`${a}px`:a),s&&n.style.setProperty("font-weight",String(s))}return[...e.cssRules].filter(r=>r.style.length>0).map(r=>` ${r.cssText}`).join(` `)},"elementFontStyles"),sGe=x(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } ${aGe()} /* The element font colour is set inline per element (default white); the label text takes it via currentColor. */ .c4-shape .label, .c4-shape .label text { color: inherit; fill: currentColor; } /* Structurizr typography: bold name, smaller stereotype/type and description lines. */ .c4-shape .label .c4-name { font-weight: bold; } .c4-shape .label .c4-type { font-size: 0.75em; } .c4-shape .label .c4-descr { font-size: 0.82em; } .c4-shape .basic, .c4-shape rect, .c4-shape path, .c4-shape circle, .c4-shape ellipse, .c4-shape line { stroke-width: 2px; } `,"getStyles"),oGe=sGe,lGe={parser:aze,db:G5,renderer:YV,styles:oGe,init:x(({c4:t,wrap:e})=>{YV.setConf(t),G5.setWrap(e)},"init")};const cGe=Object.freeze(Object.defineProperty({__proto__:null,diagram:lGe},Symbol.toStringTag,{value:"Module"}));var eT=x(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; height: 1em; overflow: visible; vertical-align: -0.125em; } .node .label-icon path { fill: currentColor; stroke: revert; stroke-width: revert; } `,"getIconStyles"),xv=x((t,e)=>{let r;return e==="sandbox"&&(r=ft("#i"+t)),ft(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Cd=x((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=uGe(t,e);Rn(t,a,i,n);const l=hGe(s,o,i,a,e);t.attr("viewBox",l),he.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),uGe=x((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),hGe=x((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),dGe="flowchart-",Vp,fGe=(Vp=class{constructor(){this.vertexCounter=0,this.config=Pe(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=rn,this.setAccDescription=gn,this.setDiagramTitle=dn,this.getAccTitle=pn,this.getAccDescription=mn,this.getDiagramTitle=an,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return yt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var g,m;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let y;l.includes(` `)?y=l+` `:y=`{ `+l+` }`,u=rk(y,{schema:tk})}const h=this.subGraphLookup.get(e);if(h&&u){h.metadata={...h.metadata,...u};return}const d=this.edges.find(y=>y.id===e);if(d){const y=u;(y==null?void 0:y.animate)!==void 0&&(d.animate=y.animate),(y==null?void 0:y.animation)!==void 0&&(d.animation=y.animation),(y==null?void 0:y.curve)!==void 0&&(d.interpolate=y.curve);return}let f,p=this.vertices.get(e);if(p===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&he.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),p={id:e,labelType:"text",domId:dGe+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,r!==void 0?(this.config=Pe(),f=this.sanitizeText(r.text.trim()),p.labelType=r.type,f.startsWith('"')&&f.endsWith('"')&&(f=f.substring(1,f.length-1)),p.text=f):p.text===void 0&&(p.text=e),n!==void 0&&(p.type=n),i!=null&&i.forEach(y=>{p.styles.push(y)}),a!=null&&a.forEach(y=>{p.classes.push(y)}),s!==void 0&&(p.dir=s),p.props===void 0?p.props=o:o!==void 0&&Object.assign(p.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!iZ(u.shape))throw new Error(`No such shape: ${u.shape}.`);p.type=u==null?void 0:u.shape}u!=null&&u.label&&(p.text=u==null?void 0:u.label,p.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(p.icon=u==null?void 0:u.icon,!((g=u.label)!=null&&g.trim())&&p.text===e&&(p.text="")),u!=null&&u.form&&(p.form=u==null?void 0:u.form),u!=null&&u.pos&&(p.pos=u==null?void 0:u.pos),u!=null&&u.img&&(p.img=u==null?void 0:u.img,!((m=u.label)!=null&&m.trim())&&p.text===e&&(p.text="")),u!=null&&u.constraint&&(p.constraint=u.constraint),u.w&&(p.assetWidth=Number(u.w)),u.h&&(p.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};he.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=op(o.start,o.end,{counter:0,prefix:"L"}):o.id=op(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))he.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;he.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Pe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{sr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=sr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=N$();ft(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=ft(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(Dl.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ft(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Pe(),Xr()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=x(f=>{const p={boolean:{},number:{},string:{}},g=[];let m;return{nodeList:f.filter(function(v){const T=typeof v;return v.stmt&&v.stmt==="dir"?(m=v.value,!1):v.trim()===""?!1:T in p?p[T].hasOwnProperty(v)?!1:p[T][v]=!0:g.includes(v)?!1:g.push(v)}),dir:m}},"uniq")(r.flat()),l=o.nodeList;let u=o.dir;const h=Pe().flowchart??{};if(u=u??(h.inheritDir?this.getDirection()??Pe().direction??void 0:void 0),this.version==="gen-1")for(let f=0;f2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){var g;const e=Pe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map,o=new Map;for(const m of i)for(const y of m.nodes)this.subGraphLookup.has(y)&&o.set(y,m.id);const l=x(m=>{var y,v;return((v=(y=this.subGraphLookup.get(m))==null?void 0:y.metadata)==null?void 0:v.view)==="collapsed"},"isCollapsed"),u=x(m=>{let y;const v=new Set;let T=m;for(;T!==void 0&&!v.has(T);)v.add(T),l(T)&&(y=T),T=o.get(T);return y},"outermostCollapsed"),h=new Set,d=new Map;for(const m of i){const y=u(m.id);if(y!==void 0){m.id!==y&&(h.add(m.id),d.set(m.id,y));for(const v of m.nodes)v!==y&&(h.add(v),d.set(v,y))}}for(let m=i.length-1;m>=0;m--){const y=i[m];if(!h.has(y.id)){y.nodes.length>0&&s.set(y.id,!0);for(const v of y.nodes)a.set(v,y.id)}}for(let m=i.length-1;m>=0;m--){const y=i[m];h.has(y.id)||(((g=y.metadata)==null?void 0:g.view)==="collapsed"?r.push({id:y.id,label:y.title,labelStyle:"",labelType:y.labelType,parentId:a.get(y.id),padding:8,cssCompiledStyles:this.getCompiledStyles(y.classes),cssClasses:y.classes.join(" "),shape:"collapsedGroup",dir:y.dir,isGroup:!1,look:e.look}):r.push({id:y.id,label:y.title,labelStyle:"",labelType:y.labelType,parentId:a.get(y.id),padding:8,cssCompiledStyles:this.getCompiledStyles(y.classes),cssClasses:y.classes.join(" "),shape:"rect",dir:y.dir,isGroup:!0,look:e.look}))}this.getVertices().forEach(m=>{h.has(m.id)||this.addNodeFromVertex(m,r,a,s,e,e.look||"classic")});const p=this.getEdges();return p.forEach((m,y)=>{var E;const{arrowTypeStart:v,arrowTypeEnd:T}=this.destructEdgeType(m.type),b=[...p.defaultStyle??[]],C=d.get(m.start)??m.start,w=d.get(m.end)??m.end;if(C===w&&(d.has(m.start)||d.has(m.end)))return;m.style&&b.push(...m.style);const S={id:op(C,w,{counter:y,prefix:"L"},m.id),isUserDefinedId:m.isUserDefinedId,start:C,end:w,type:m.type??"normal",label:m.text,labelType:m.labelType,labelpos:"c",thickness:m.stroke,minlen:m.length,classes:(m==null?void 0:m.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(m==null?void 0:m.stroke)==="invisible"||(m==null?void 0:m.type)==="arrow_open"?"none":v,arrowTypeEnd:(m==null?void 0:m.stroke)==="invisible"||(m==null?void 0:m.type)==="arrow_open"?"none":T,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(m.classes),labelStyle:b,style:b,pattern:m.stroke,look:e.look,animate:m.animate,animation:m.animation,curve:m.interpolate||this.edges.defaultInterpolate||((E=e.flowchart)==null?void 0:E.curve)};n.push(S)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return rY.flowchart}},x(Vp,"FlowDB"),Vp),pGe=x(function(t,e){return e.db.getClasses()},"getClasses"),gGe=x(async function(t,e,r,n){var d;he.info("REF0:"),he.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Pe();n.db.setDiagramId(e),he.debug("Before getData: ");const o=n.db.getData();he.debug("Data: ",o);const l=xv(e,i),u=n.db.getDirection();o.type=n.type,o.layoutAlgorithm=zb(s),o.layoutAlgorithm==="dagre"&&s==="elk"&&he.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),o.direction=u,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["point","circle","cross"],o.diagramId=e,he.debug("REF1:",o),await uv(o,l);const h=((d=o.config.flowchart)==null?void 0:d.diagramPadding)??8;sr.insertTitle(l,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),Cd(l,h,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),mGe={getClasses:pGe,draw:gGe},q5=(function(){var t=x(function(ir,st,rt,pt){for(rt=rt||{},pt=ir.length;pt--;rt[ir[pt]]=st);return rt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],T=[1,31],b=[1,32],C=[1,33],w=[1,45],S=[1,47],E=[1,43],_=[1,48],R=[1,44],D=[1,51],L=[1,46],B=[1,52],$=[1,53],A=[1,34],I=[1,35],O=[1,36],N=[1,37],M=[1,38],P=[1,58],F=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],z=[1,61],W=[1,63],X=[8,9,11,75,77,78],j=[1,79],re=[1,92],Q=[1,97],oe=[1,96],ee=[1,93],ne=[1,89],ie=[1,95],ae=[1,91],de=[1,98],le=[1,94],ye=[1,99],$e=[1,90],Fe=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],ve=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Ce=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Ne=[44,60,89,102,105,106,109,111,114,115,116],Ie=[1,122],Ae=[1,123],be=[1,125],ke=[1,124],se=[44,60,62,74,89,102,105,106,109,111,114,115,116],J=[1,134],G=[1,148],q=[1,149],H=[1,150],Z=[1,151],te=[1,136],K=[1,138],U=[1,142],Y=[1,143],fe=[1,144],ue=[1,145],Te=[1,146],ge=[1,147],we=[1,152],xe=[1,153],Le=[1,132],_e=[1,133],Be=[1,140],Ee=[1,135],Xe=[1,139],Re=[1,137],Qe=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],it=[1,155],Ue=[1,157],mt=[8,9,11],ot=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Ke=[1,177],me=[1,173],dt=[1,174],at=[1,178],et=[1,175],ct=[1,176],Gt=[77,116,119],Se=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],We=[10,106],Je=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],nt=[1,248],wt=[1,246],Vt=[1,250],Mt=[1,244],Yt=[1,245],$t=[1,247],tr=[1,249],Dt=[1,251],Xt=[1,269],hr=[8,9,11,106],je=[8,9,10,11,60,84,105,106,109,110,111,112],tt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:x(function(st,rt,pt,Ze,At,De,Pr){var Oe=De.length-1;switch(At){case 2:this.$=[];break;case 3:(!Array.isArray(De[Oe])||De[Oe].length>0)&&De[Oe-1].push(De[Oe]),this.$=De[Oe-1];break;case 4:case 183:this.$=De[Oe];break;case 11:Ze.setDirection("TB"),this.$="TB";break;case 12:Ze.setDirection(De[Oe-1]),this.$=De[Oe-1];break;case 27:this.$=De[Oe-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=Ze.addSubGraph(De[Oe-6],De[Oe-1],De[Oe-4]);break;case 34:this.$=Ze.addSubGraph(De[Oe-3],De[Oe-1],De[Oe-3]);break;case 35:this.$=Ze.addSubGraph(void 0,De[Oe-1],void 0);break;case 37:this.$=De[Oe].trim(),Ze.setAccTitle(this.$);break;case 38:case 39:this.$=De[Oe].trim(),Ze.setAccDescription(this.$);break;case 43:this.$=De[Oe-1]+De[Oe];break;case 44:this.$=De[Oe];break;case 45:Ze.addVertex(De[Oe-1][De[Oe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,De[Oe]),Ze.addLink(De[Oe-3].stmt,De[Oe-1],De[Oe-2]),this.$={stmt:De[Oe-1],nodes:De[Oe-1].concat(De[Oe-3].nodes)};break;case 46:Ze.addLink(De[Oe-2].stmt,De[Oe],De[Oe-1]),this.$={stmt:De[Oe],nodes:De[Oe].concat(De[Oe-2].nodes)};break;case 47:Ze.addLink(De[Oe-3].stmt,De[Oe-1],De[Oe-2]),this.$={stmt:De[Oe-1],nodes:De[Oe-1].concat(De[Oe-3].nodes)};break;case 48:this.$={stmt:De[Oe-1],nodes:De[Oe-1]};break;case 49:Ze.addVertex(De[Oe-1][De[Oe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,De[Oe]),this.$={stmt:De[Oe-1],nodes:De[Oe-1],shapeData:De[Oe]};break;case 50:this.$={stmt:De[Oe],nodes:De[Oe]};break;case 51:this.$=[De[Oe]];break;case 52:Ze.addVertex(De[Oe-5][De[Oe-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,De[Oe-4]),this.$=De[Oe-5].concat(De[Oe]);break;case 53:this.$=De[Oe-4].concat(De[Oe]);break;case 54:this.$=De[Oe];break;case 55:this.$=De[Oe-2],Ze.setClass(De[Oe-2],De[Oe]);break;case 56:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"square");break;case 57:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"doublecircle");break;case 58:this.$=De[Oe-5],Ze.addVertex(De[Oe-5],De[Oe-2],"circle");break;case 59:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"ellipse");break;case 60:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"stadium");break;case 61:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"subroutine");break;case 62:this.$=De[Oe-7],Ze.addVertex(De[Oe-7],De[Oe-1],"rect",void 0,void 0,void 0,Object.fromEntries([[De[Oe-5],De[Oe-3]]]));break;case 63:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"cylinder");break;case 64:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"round");break;case 65:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"diamond");break;case 66:this.$=De[Oe-5],Ze.addVertex(De[Oe-5],De[Oe-2],"hexagon");break;case 67:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"odd");break;case 68:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"trapezoid");break;case 69:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"inv_trapezoid");break;case 70:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"lean_right");break;case 71:this.$=De[Oe-3],Ze.addVertex(De[Oe-3],De[Oe-1],"lean_left");break;case 72:this.$=De[Oe],Ze.addVertex(De[Oe]);break;case 73:De[Oe-1].text=De[Oe],this.$=De[Oe-1];break;case 74:case 75:De[Oe-2].text=De[Oe-1],this.$=De[Oe-2];break;case 76:this.$=De[Oe];break;case 77:var ar=Ze.destructLink(De[Oe],De[Oe-2]);this.$={type:ar.type,stroke:ar.stroke,length:ar.length,text:De[Oe-1]};break;case 78:var ar=Ze.destructLink(De[Oe],De[Oe-2]);this.$={type:ar.type,stroke:ar.stroke,length:ar.length,text:De[Oe-1],id:De[Oe-3]};break;case 79:this.$={text:De[Oe],type:"text"};break;case 80:this.$={text:De[Oe-1].text+""+De[Oe],type:De[Oe-1].type};break;case 81:this.$={text:De[Oe],type:"string"};break;case 82:this.$={text:De[Oe],type:"markdown"};break;case 83:var ar=Ze.destructLink(De[Oe]);this.$={type:ar.type,stroke:ar.stroke,length:ar.length};break;case 84:var ar=Ze.destructLink(De[Oe]);this.$={type:ar.type,stroke:ar.stroke,length:ar.length,id:De[Oe-1]};break;case 85:this.$=De[Oe-1];break;case 86:this.$={text:De[Oe],type:"text"};break;case 87:this.$={text:De[Oe-1].text+""+De[Oe],type:De[Oe-1].type};break;case 88:this.$={text:De[Oe],type:"string"};break;case 89:case 104:this.$={text:De[Oe],type:"markdown"};break;case 101:this.$={text:De[Oe],type:"text"};break;case 102:this.$={text:De[Oe-1].text+""+De[Oe],type:De[Oe-1].type};break;case 103:this.$={text:De[Oe],type:"text"};break;case 105:this.$=De[Oe-4],Ze.addClass(De[Oe-2],De[Oe]);break;case 106:this.$=De[Oe-4],Ze.setClass(De[Oe-2],De[Oe]);break;case 107:case 115:this.$=De[Oe-1],Ze.setClickEvent(De[Oe-1],De[Oe]);break;case 108:case 116:this.$=De[Oe-3],Ze.setClickEvent(De[Oe-3],De[Oe-2]),Ze.setTooltip(De[Oe-3],De[Oe]);break;case 109:this.$=De[Oe-2],Ze.setClickEvent(De[Oe-2],De[Oe-1],De[Oe]);break;case 110:this.$=De[Oe-4],Ze.setClickEvent(De[Oe-4],De[Oe-3],De[Oe-2]),Ze.setTooltip(De[Oe-4],De[Oe]);break;case 111:this.$=De[Oe-2],Ze.setLink(De[Oe-2],De[Oe]);break;case 112:this.$=De[Oe-4],Ze.setLink(De[Oe-4],De[Oe-2]),Ze.setTooltip(De[Oe-4],De[Oe]);break;case 113:this.$=De[Oe-4],Ze.setLink(De[Oe-4],De[Oe-2],De[Oe]);break;case 114:this.$=De[Oe-6],Ze.setLink(De[Oe-6],De[Oe-4],De[Oe]),Ze.setTooltip(De[Oe-6],De[Oe-2]);break;case 117:this.$=De[Oe-1],Ze.setLink(De[Oe-1],De[Oe]);break;case 118:this.$=De[Oe-3],Ze.setLink(De[Oe-3],De[Oe-2]),Ze.setTooltip(De[Oe-3],De[Oe]);break;case 119:this.$=De[Oe-3],Ze.setLink(De[Oe-3],De[Oe-2],De[Oe]);break;case 120:this.$=De[Oe-5],Ze.setLink(De[Oe-5],De[Oe-4],De[Oe]),Ze.setTooltip(De[Oe-5],De[Oe-2]);break;case 121:this.$=De[Oe-4],Ze.addVertex(De[Oe-2],void 0,void 0,De[Oe]);break;case 122:this.$=De[Oe-4],Ze.updateLink([De[Oe-2]],De[Oe]);break;case 123:this.$=De[Oe-4],Ze.updateLink(De[Oe-2],De[Oe]);break;case 124:this.$=De[Oe-8],Ze.updateLinkInterpolate([De[Oe-6]],De[Oe-2]),Ze.updateLink([De[Oe-6]],De[Oe]);break;case 125:this.$=De[Oe-8],Ze.updateLinkInterpolate(De[Oe-6],De[Oe-2]),Ze.updateLink(De[Oe-6],De[Oe]);break;case 126:this.$=De[Oe-6],Ze.updateLinkInterpolate([De[Oe-4]],De[Oe]);break;case 127:this.$=De[Oe-6],Ze.updateLinkInterpolate(De[Oe-4],De[Oe]);break;case 128:case 130:this.$=[De[Oe]];break;case 129:case 131:De[Oe-2].push(De[Oe]),this.$=De[Oe-2];break;case 133:this.$=De[Oe-1]+De[Oe];break;case 181:this.$=De[Oe];break;case 182:this.$=De[Oe-1]+""+De[Oe];break;case 184:this.$=De[Oe-1]+""+De[Oe];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:C,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$,121:A,122:I,123:O,124:N,125:M},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:P,15:54,18:57},t(F,[2,3]),t(F,[2,4]),t(F,[2,5]),t(F,[2,6]),t(F,[2,7]),t(F,[2,8]),{8:V,9:z,11:W,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:z,11:W,21:68},{8:V,9:z,11:W,21:69},{8:V,9:z,11:W,21:70},{8:V,9:z,11:W,21:71},{8:V,9:z,11:W,21:72},{8:V,9:z,10:[1,73],11:W,21:74},t(F,[2,36]),{35:[1,75]},{37:[1,76]},t(F,[2,39]),t(X,[2,50],{18:77,39:78,10:P,40:j}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:re,44:Q,60:oe,80:[1,87],89:ee,95:[1,84],97:[1,85],101:86,105:ne,106:ie,109:ae,111:de,114:le,115:ye,116:$e,120:88},t(F,[2,185]),t(F,[2,186]),t(F,[2,187]),t(F,[2,188]),t(F,[2,189]),t(Fe,[2,51]),t(Fe,[2,54],{46:[1,100]}),t(ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:w,102:S,105:E,106:_,109:R,111:D,114:L,115:B,116:$}),t(ve,[2,181]),t(ve,[2,142]),t(ve,[2,143]),t(ve,[2,144]),t(ve,[2,145]),t(ve,[2,146]),t(ve,[2,147]),t(ve,[2,148]),t(ve,[2,149]),t(ve,[2,150]),t(ve,[2,151]),t(ve,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Ce,[2,26],{18:115,10:P}),t(F,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$},t(F,[2,40]),t(F,[2,41]),t(F,[2,42]),t(Ne,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ie,81:Ae,116:be,119:ke},{75:[1,126],77:[1,127]},t(se,[2,83]),t(F,[2,28]),t(F,[2,29]),t(F,[2,30]),t(F,[2,31]),t(F,[2,32]),{10:J,12:G,14:q,27:H,28:128,32:Z,44:te,60:K,75:U,80:[1,130],81:[1,131],83:141,84:Y,85:fe,86:ue,87:Te,88:ge,89:we,90:xe,91:129,105:Le,109:_e,111:Be,114:Ee,115:Xe,116:Re},t(Qe,a,{5:154}),t(F,[2,37]),t(F,[2,38]),t(X,[2,48],{44:it}),t(X,[2,49],{18:156,10:P,40:Ue}),t(Fe,[2,44]),{44:g,47:158,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$},{44:g,47:163,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$},t(mt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(mt,[2,115],{120:168,10:[1,167],14:re,44:Q,60:oe,89:ee,105:ne,106:ie,109:ae,111:de,114:le,115:ye,116:$e}),t(mt,[2,117],{10:[1,169]}),t(ot,[2,183]),t(ot,[2,170]),t(ot,[2,171]),t(ot,[2,172]),t(ot,[2,173]),t(ot,[2,174]),t(ot,[2,175]),t(ot,[2,176]),t(ot,[2,177]),t(ot,[2,178]),t(ot,[2,179]),t(ot,[2,180]),{44:g,47:170,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$},{30:171,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:179,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:181,50:[1,180],67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:182,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:183,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:184,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{109:[1,185]},{30:186,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:187,65:[1,188],67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:189,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:190,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{30:191,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},t(ve,[2,182]),t(i,[2,20]),t(Ce,[2,25]),t(X,[2,46],{39:192,18:193,10:P,40:j}),t(Ne,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{77:[1,197],79:198,116:be,119:ke},t(Gt,[2,79]),t(Gt,[2,81]),t(Gt,[2,82]),t(Gt,[2,168]),t(Gt,[2,169]),{76:199,79:121,80:Ie,81:Ae,116:be,119:ke},t(se,[2,84]),{8:V,9:z,10:J,11:W,12:G,14:q,21:201,27:H,29:[1,200],32:Z,44:te,60:K,75:U,83:141,84:Y,85:fe,86:ue,87:Te,88:ge,89:we,90:xe,91:202,105:Le,109:_e,111:Be,114:Ee,115:Xe,116:Re},t(Se,[2,101]),t(Se,[2,103]),t(Se,[2,104]),t(Se,[2,157]),t(Se,[2,158]),t(Se,[2,159]),t(Se,[2,160]),t(Se,[2,161]),t(Se,[2,162]),t(Se,[2,163]),t(Se,[2,164]),t(Se,[2,165]),t(Se,[2,166]),t(Se,[2,167]),t(Se,[2,90]),t(Se,[2,91]),t(Se,[2,92]),t(Se,[2,93]),t(Se,[2,94]),t(Se,[2,95]),t(Se,[2,96]),t(Se,[2,97]),t(Se,[2,98]),t(Se,[2,99]),t(Se,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:C,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$,121:A,122:I,123:O,124:N,125:M},{10:P,18:204},{44:[1,205]},t(Fe,[2,43]),{10:[1,206],44:g,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:113,114:L,115:B,116:$},{10:[1,207]},{10:[1,208],106:[1,209]},t(We,[2,128]),{10:[1,210],44:g,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:113,114:L,115:B,116:$},{10:[1,211],44:g,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:113,114:L,115:B,116:$},{80:[1,212]},t(mt,[2,109],{10:[1,213]}),t(mt,[2,111],{10:[1,214]}),{80:[1,215]},t(ot,[2,184]),{80:[1,216],98:[1,217]},t(Fe,[2,55],{113:113,44:g,60:m,89:w,102:S,105:E,106:_,109:R,111:D,114:L,115:B,116:$}),{31:[1,218],67:Ke,82:219,116:at,117:et,118:ct},t(Je,[2,86]),t(Je,[2,88]),t(Je,[2,89]),t(Je,[2,153]),t(Je,[2,154]),t(Je,[2,155]),t(Je,[2,156]),{49:[1,220],67:Ke,82:219,116:at,117:et,118:ct},{30:221,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{51:[1,222],67:Ke,82:219,116:at,117:et,118:ct},{53:[1,223],67:Ke,82:219,116:at,117:et,118:ct},{55:[1,224],67:Ke,82:219,116:at,117:et,118:ct},{57:[1,225],67:Ke,82:219,116:at,117:et,118:ct},{60:[1,226]},{64:[1,227],67:Ke,82:219,116:at,117:et,118:ct},{66:[1,228],67:Ke,82:219,116:at,117:et,118:ct},{30:229,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},{31:[1,230],67:Ke,82:219,116:at,117:et,118:ct},{67:Ke,69:[1,231],71:[1,232],82:219,116:at,117:et,118:ct},{67:Ke,69:[1,234],71:[1,233],82:219,116:at,117:et,118:ct},t(X,[2,45],{18:156,10:P,40:Ue}),t(X,[2,47],{44:it}),t(Ne,[2,75]),t(Ne,[2,74]),{62:[1,235],67:Ke,82:219,116:at,117:et,118:ct},t(Ne,[2,77]),t(Gt,[2,80]),{77:[1,236],79:198,116:be,119:ke},{30:237,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},t(Qe,a,{5:238}),t(Se,[2,102]),t(F,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$},{10:P,18:240},{10:nt,60:wt,84:Vt,92:241,105:Mt,107:242,108:243,109:Yt,110:$t,111:tr,112:Dt},{10:nt,60:wt,84:Vt,92:252,104:[1,253],105:Mt,107:242,108:243,109:Yt,110:$t,111:tr,112:Dt},{10:nt,60:wt,84:Vt,92:254,104:[1,255],105:Mt,107:242,108:243,109:Yt,110:$t,111:tr,112:Dt},{105:[1,256]},{10:nt,60:wt,84:Vt,92:257,105:Mt,107:242,108:243,109:Yt,110:$t,111:tr,112:Dt},{44:g,47:258,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$},t(mt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(mt,[2,116]),t(mt,[2,118],{10:[1,262]}),t(mt,[2,119]),t(ce,[2,56]),t(Je,[2,87]),t(ce,[2,57]),{51:[1,263],67:Ke,82:219,116:at,117:et,118:ct},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,264]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,265],67:Ke,82:219,116:at,117:et,118:ct},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(Ne,[2,78]),{31:[1,266],67:Ke,82:219,116:at,117:et,118:ct},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:C,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$,121:A,122:I,123:O,124:N,125:M},t(Fe,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$},t(mt,[2,121],{106:Xt}),t(hr,[2,130],{108:270,10:nt,60:wt,84:Vt,105:Mt,109:Yt,110:$t,111:tr,112:Dt}),t(je,[2,132]),t(je,[2,134]),t(je,[2,135]),t(je,[2,136]),t(je,[2,137]),t(je,[2,138]),t(je,[2,139]),t(je,[2,140]),t(je,[2,141]),t(mt,[2,122],{106:Xt}),{10:[1,271]},t(mt,[2,123],{106:Xt}),{10:[1,272]},t(We,[2,129]),t(mt,[2,105],{106:Xt}),t(mt,[2,106],{113:113,44:g,60:m,89:w,102:S,105:E,106:_,109:R,111:D,114:L,115:B,116:$}),t(mt,[2,110]),t(mt,[2,112],{10:[1,273]}),t(mt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:z,11:W,21:278},t(F,[2,34]),t(Fe,[2,52]),{10:nt,60:wt,84:Vt,105:Mt,107:279,108:243,109:Yt,110:$t,111:tr,112:Dt},t(je,[2,133]),{14:re,44:Q,60:oe,89:ee,101:280,105:ne,106:ie,109:ae,111:de,114:le,115:ye,116:$e,120:88},{14:re,44:Q,60:oe,89:ee,101:281,105:ne,106:ie,109:ae,111:de,114:le,115:ye,116:$e,120:88},{98:[1,282]},t(mt,[2,120]),t(ce,[2,58]),{30:283,67:Ke,80:me,81:dt,82:172,116:at,117:et,118:ct},t(ce,[2,66]),t(Qe,a,{5:284}),t(hr,[2,131],{108:270,10:nt,60:wt,84:Vt,105:Mt,109:Yt,110:$t,111:tr,112:Dt}),t(mt,[2,126],{120:168,10:[1,285],14:re,44:Q,60:oe,89:ee,105:ne,106:ie,109:ae,111:de,114:le,115:ye,116:$e}),t(mt,[2,127],{120:168,10:[1,286],14:re,44:Q,60:oe,89:ee,105:ne,106:ie,109:ae,111:de,114:le,115:ye,116:$e}),t(mt,[2,114]),{31:[1,287],67:Ke,82:219,116:at,117:et,118:ct},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:C,89:w,102:S,105:E,106:_,109:R,111:D,113:42,114:L,115:B,116:$,121:A,122:I,123:O,124:N,125:M},{10:nt,60:wt,84:Vt,92:289,105:Mt,107:242,108:243,109:Yt,110:$t,111:tr,112:Dt},{10:nt,60:wt,84:Vt,92:290,105:Mt,107:242,108:243,109:Yt,110:$t,111:tr,112:Dt},t(ce,[2,62]),t(F,[2,33]),t(mt,[2,124],{106:Xt}),t(mt,[2,125],{106:Xt})],defaultActions:{},parseError:x(function(st,rt){if(rt.recoverable)this.trace(st);else{var pt=new Error(st);throw pt.hash=rt,pt}},"parseError"),parse:x(function(st){var rt=this,pt=[0],Ze=[],At=[null],De=[],Pr=this.table,Oe="",ar=0,gr=0,xn=2,cr=1,Vr=De.slice.call(arguments,1),mr=Object.create(this.lexer),$i={yy:{}};for(var Ls in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ls)&&($i.yy[Ls]=this.yy[Ls]);mr.setInput(st,$i.yy),$i.yy.lexer=mr,$i.yy.parser=this,typeof mr.yylloc>"u"&&(mr.yylloc={});var co=mr.yylloc;De.push(co);var Cu=mr.options&&mr.options.ranges;typeof $i.yy.parseError=="function"?this.parseError=$i.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function wu(vt){pt.length=pt.length-2*vt,At.length=At.length-vt,De.length=De.length-vt}x(wu,"popStack");function Eu(){var vt;return vt=Ze.pop()||mr.lex()||cr,typeof vt!="number"&&(vt instanceof Array&&(Ze=vt,vt=Ze.pop()),vt=rt.symbols_[vt]||vt),vt}x(Eu,"lex");for(var Hn,Ca,xi,Pn,Ua={},uc,gt,Me,Ve;;){if(Ca=pt[pt.length-1],this.defaultActions[Ca]?xi=this.defaultActions[Ca]:((Hn===null||typeof Hn>"u")&&(Hn=Eu()),xi=Pr[Ca]&&Pr[Ca][Hn]),typeof xi>"u"||!xi.length||!xi[0]){var ut="";Ve=[];for(uc in Pr[Ca])this.terminals_[uc]&&uc>xn&&Ve.push("'"+this.terminals_[uc]+"'");mr.showPosition?ut="Parse error on line "+(ar+1)+`: `+mr.showPosition()+` Expecting `+Ve.join(", ")+", got '"+(this.terminals_[Hn]||Hn)+"'":ut="Parse error on line "+(ar+1)+": Unexpected "+(Hn==cr?"end of input":"'"+(this.terminals_[Hn]||Hn)+"'"),this.parseError(ut,{text:mr.match,token:this.terminals_[Hn]||Hn,line:mr.yylineno,loc:co,expected:Ve})}if(xi[0]instanceof Array&&xi.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ca+", token: "+Hn);switch(xi[0]){case 1:pt.push(Hn),At.push(mr.yytext),De.push(mr.yylloc),pt.push(xi[1]),Hn=null,gr=mr.yyleng,Oe=mr.yytext,ar=mr.yylineno,co=mr.yylloc;break;case 2:if(gt=this.productions_[xi[1]][1],Ua.$=At[At.length-gt],Ua._$={first_line:De[De.length-(gt||1)].first_line,last_line:De[De.length-1].last_line,first_column:De[De.length-(gt||1)].first_column,last_column:De[De.length-1].last_column},Cu&&(Ua._$.range=[De[De.length-(gt||1)].range[0],De[De.length-1].range[1]]),Pn=this.performAction.apply(Ua,[Oe,gr,ar,$i.yy,xi[1],At,De].concat(Vr)),typeof Pn<"u")return Pn;gt&&(pt=pt.slice(0,-1*gt*2),At=At.slice(0,-1*gt),De=De.slice(0,-1*gt)),pt.push(this.productions_[xi[1]][0]),At.push(Ua.$),De.push(Ua._$),Me=Pr[pt[pt.length-2]][pt[pt.length-1]],pt.push(Me);break;case 3:return!0}}return!0},"parse")},xt=(function(){var ir={EOF:1,parseError:x(function(rt,pt){if(this.yy.parser)this.yy.parser.parseError(rt,pt);else throw new Error(rt)},"parseError"),setInput:x(function(st,rt){return this.yy=rt||this.yy||{},this._input=st,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var st=this._input[0];this.yytext+=st,this.yyleng++,this.offset++,this.match+=st,this.matched+=st;var rt=st.match(/(?:\r\n?|\n).*/g);return rt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),st},"input"),unput:x(function(st){var rt=st.length,pt=st.split(/(?:\r\n?|\n)/g);this._input=st+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-rt),this.offset-=rt;var Ze=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),pt.length-1&&(this.yylineno-=pt.length-1);var At=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:pt?(pt.length===Ze.length?this.yylloc.first_column:0)+Ze[Ze.length-pt.length].length-pt[0].length:this.yylloc.first_column-rt},this.options.ranges&&(this.yylloc.range=[At[0],At[0]+this.yyleng-rt]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(st){this.unput(this.match.slice(st))},"less"),pastInput:x(function(){var st=this.matched.substr(0,this.matched.length-this.match.length);return(st.length>20?"...":"")+st.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var st=this.match;return st.length<20&&(st+=this._input.substr(0,20-st.length)),(st.substr(0,20)+(st.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var st=this.pastInput(),rt=new Array(st.length+1).join("-");return st+this.upcomingInput()+` `+rt+"^"},"showPosition"),test_match:x(function(st,rt){var pt,Ze,At;if(this.options.backtrack_lexer&&(At={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(At.yylloc.range=this.yylloc.range.slice(0))),Ze=st[0].match(/(?:\r\n?|\n).*/g),Ze&&(this.yylineno+=Ze.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ze?Ze[Ze.length-1].length-Ze[Ze.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+st[0].length},this.yytext+=st[0],this.match+=st[0],this.matches=st,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(st[0].length),this.matched+=st[0],pt=this.performAction.call(this,this.yy,this,rt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),pt)return pt;if(this._backtrack){for(var De in At)this[De]=At[De];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var st,rt,pt,Ze;this._more||(this.yytext="",this.match="");for(var At=this._currentRules(),De=0;Dert[0].length)){if(rt=pt,Ze=De,this.options.backtrack_lexer){if(st=this.test_match(pt,At[De]),st!==!1)return st;if(this._backtrack){rt=!1;continue}else return!1}else if(!this.options.flex)break}return rt?(st=this.test_match(rt,At[Ze]),st!==!1?st:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var rt=this.next();return rt||this.lex()},"lex"),begin:x(function(rt){this.conditionStack.push(rt)},"begin"),popState:x(function(){var rt=this.conditionStack.length-1;return rt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(rt){return rt=this.conditionStack.length-1-Math.abs(rt||0),rt>=0?this.conditionStack[rt]:"INITIAL"},"topState"),pushState:x(function(rt){this.begin(rt)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(rt,pt,Ze,At){switch(Ze){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),pt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const De=/\n\s*/g;return pt.yytext=pt.yytext.replace(De,"
    "),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return rt.lex.firstGraph()&&this.begin("dir"),12;case 36:return rt.lex.firstGraph()&&this.begin("dir"),12;case 37:return rt.lex.firstGraph()&&this.begin("dir"),12;case 38:return rt.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return ir})();tt.lexer=xt;function Wt(){this.yy={}}return x(Wt,"Parser"),Wt.prototype=tt,tt.Parser=Wt,new Wt})();q5.parser=q5;var One=q5,$ne=Object.assign({},One);$ne.parse=t=>{const e=t.replace(/}\s*\n/g,`} `);return One.parse(e)};var yGe=$ne,vGe=x((t,e)=>{const r=VM,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Hs(n,i,a,e)},"fade"),xGe=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } .cluster-label text { fill: ${t.titleColor}; } .cluster-label span { color: ${t.titleColor}; } .cluster-label span p { background-color: transparent; } .label text,span { fill: ${t.nodeTextColor||t.textColor}; color: ${t.nodeTextColor||t.textColor}; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth??1}px; } .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { text-anchor: middle; } .node .katex path { fill: #000; stroke: #000; stroke-width: 1px; } .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { text-align: center; } .node.clickable { cursor: pointer; } .root .anchor path { fill: ${t.lineColor} !important; stroke-width: 0; stroke: ${t.lineColor}; } .arrowheadPath { fill: ${t.arrowheadColor}; } .edgePaths .path { stroke: ${t.lineColor}; stroke-width: ${t.strokeWidth??2}px; } .flowchart-link { stroke: ${t.lineColor}; fill: none; } .edgeLabel { background-color: ${t.edgeLabelBackground}; p { background-color: ${t.edgeLabelBackground}; } rect { opacity: 0.5; background-color: ${t.edgeLabelBackground}; fill: ${t.edgeLabelBackground}; } text-align: center; } /* For html labels only */ .labelBkg { background-color: ${vGe(t.edgeLabelBackground,.5)}; // background-color: } .cluster rect { fill: ${t.clusterBkg}; stroke: ${t.clusterBorder}; stroke-width: 1px; } .cluster text { fill: ${t.titleColor}; } .cluster span { color: ${t.titleColor}; } /* .cluster div { color: ${t.titleColor}; } */ /* Collapsed subgraph node (@{ view: collapsed }) */ .node .collapsed-indicator { fill: ${t.clusterBorder}; stroke: none; opacity: 0.6; } .node .collapsed-separator { stroke: ${t.clusterBorder}; stroke-width: 0.75px; } div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${t.fontFamily}; font-size: 12px; background: ${t.tertiaryColor}; border: 1px solid ${t.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } .flowchartTitleText { text-anchor: middle; font-size: 18px; fill: ${t.textColor}; } rect.text { fill: none; stroke-width: 0; } .icon-shape, .image-shape { background-color: ${t.edgeLabelBackground}; p { background-color: ${t.edgeLabelBackground}; padding: 2px; } .label rect { opacity: 0.5; background-color: ${t.edgeLabelBackground}; fill: ${t.edgeLabelBackground}; } text-align: center; } ${eT()} `,"getStyles"),Pne=xGe,B$=x(({defaultLayout:t,styles:e=Pne}={})=>({parser:yGe,get db(){return new fGe},renderer:mGe,styles:e,init:x(r=>{r.flowchart||(r.flowchart={});const n=jH().layout??t??r.layout;n&&XI({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,XI({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),bGe=B$();const F$=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:B$,diagram:bGe},Symbol.toStringTag,{value:"Module"}));var TGe=x(t=>`${Pne(t)} .swimlane.cluster rect { stroke: ${t.clusterBorder} !important; } [data-look="neo"].cluster rect { filter: none; } `,"getStyles"),CGe=TGe,wGe=B$({defaultLayout:"swimlane",styles:CGe});const EGe=Object.freeze(Object.defineProperty({__proto__:null,diagram:wGe},Symbol.toStringTag,{value:"Module"}));var U5=(function(){var t=x(function(Ne,Ie,Ae,be){for(Ae=Ae||{},be=Ne.length;be--;Ae[Ne[be]]=Ie);return Ae},"o"),e=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],r=[2,2],n=[1,7],i=[1,9],a=[1,10],s=[1,11],o=[1,12],l=[1,30],u=[1,23],h=[1,24],d=[1,25],f=[1,26],p=[1,27],g=[1,19],m=[1,28],y=[1,29],v=[1,20],T=[1,18],b=[1,21],C=[1,22],w=[2,6],S=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],E=[1,36],_=[1,37],R=[1,38],D=[1,39],L=[1,40],B=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],$=[1,46],A=[1,47],I=[1,57],O=[43,51,53,54,55,74,75],N=[1,70],M=[1,68],P=[1,65],F=[1,69],V=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],W=[1,78],X=[1,77],j=[1,76],re=[69,70,71,72,73],Q=[1,91],oe=[6,9,45,50],ee=[6,9,12,44,45,50,51,52],ne=[1,101],ie=[1,100],ae=[1,99],de=[18,61],le=[1,110],ye=[1,109],$e=[20,43,51,53,54,55],Fe=[18,61,64,66],ce={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:x(function(Ie,Ae,be,ke,se,J,G){var q=J.length-1;switch(se){case 1:break;case 2:this.$=[];break;case 3:this.$=J[q-1].concat(J[q]);break;case 4:this.$=J[q];break;case 5:case 6:this.$=[];break;case 7:ke.addEntity(J[q-4]),ke.addEntity(J[q-2]),ke.addRelationship(J[q-4],J[q],J[q-2],J[q-3]),this.$=[J[q-4],J[q-2]];break;case 8:ke.addEntity(J[q-8]),ke.addEntity(J[q-4]),ke.addRelationship(J[q-8],J[q],J[q-4],J[q-5]),ke.setClass([J[q-8]],J[q-6]),ke.setClass([J[q-4]],J[q-2]),this.$=[J[q-8],J[q-4]];break;case 9:ke.addEntity(J[q-6]),ke.addEntity(J[q-2]),ke.addRelationship(J[q-6],J[q],J[q-2],J[q-3]),ke.setClass([J[q-6]],J[q-4]),this.$=[J[q-6],J[q-2]];break;case 10:ke.addEntity(J[q-6]),ke.addEntity(J[q-4]),ke.addRelationship(J[q-6],J[q],J[q-4],J[q-5]),ke.setClass([J[q-4]],J[q-2]),this.$=[J[q-6],J[q-4]];break;case 11:ke.addEntity(J[q-3]),ke.addAttributes(J[q-3],J[q-1]),this.$=[J[q-3]];break;case 12:ke.addEntity(J[q-5]),ke.addAttributes(J[q-5],J[q-1]),ke.setClass([J[q-5]],J[q-3]),this.$=[J[q-5]];break;case 13:ke.addEntity(J[q-2]),this.$=[J[q-2]];break;case 14:ke.addEntity(J[q-4]),ke.setClass([J[q-4]],J[q-2]),this.$=[J[q-4]];break;case 15:ke.addEntity(J[q]),this.$=[J[q]];break;case 16:ke.addEntity(J[q-2]),ke.setClass([J[q-2]],J[q]),this.$=[J[q-2]];break;case 17:ke.addEntity(J[q-6],J[q-4]),ke.addAttributes(J[q-6],J[q-1]),this.$=[J[q-6]];break;case 18:ke.addEntity(J[q-8],J[q-6]),ke.addAttributes(J[q-8],J[q-1]),ke.setClass([J[q-8]],J[q-3]),this.$=[J[q-8]];break;case 19:ke.addEntity(J[q-5],J[q-3]),this.$=[J[q-5]];break;case 20:ke.addEntity(J[q-7],J[q-5]),ke.setClass([J[q-7]],J[q-2]),this.$=[J[q-7]];break;case 21:ke.addEntity(J[q-3],J[q-1]);break;case 22:ke.addEntity(J[q-5],J[q-3]),ke.setClass([J[q-5]],J[q]);break;case 23:case 24:this.$=J[q].trim(),ke.setAccTitle(this.$);break;case 25:case 26:this.$=J[q].trim(),ke.setAccDescription(this.$);break;case 27:ke.subgraphDepth?this.$=J[q]:(ke.setDirection(J[q].value),this.$=[]);break;case 31:ke.subgraphDepth=(ke.subgraphDepth||1)-1,this.$=ke.addSubGraph({text:J[q-2].id},J[q-1],{text:J[q-2].text});break;case 32:ke.subgraphDepth=(ke.subgraphDepth||0)+1,this.$={id:J[q-1],text:J[q-1]};break;case 33:ke.subgraphDepth=(ke.subgraphDepth||0)+1,this.$={id:J[q-4],text:J[q-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=J[q];break;case 35:this.$=J[q-1]+" "+J[q];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=J[q-3],ke.addClass(J[q-2],J[q-1]);break;case 41:case 42:case 63:case 72:this.$=[J[q]];break;case 43:case 44:this.$=J[q-2].concat([J[q]]);break;case 45:this.$=J[q-2],ke.setClass(J[q-1],J[q]);break;case 46:this.$=J[q-3],ke.addCssStyles(J[q-2],J[q-1]);break;case 47:this.$=[J[q]];break;case 48:J[q-2].push(J[q]),this.$=J[q-2];break;case 50:this.$=J[q-1]+J[q];break;case 58:case 84:case 85:this.$=J[q].replace(/"/g,"");break;case 64:J[q].push(J[q-1]),this.$=J[q];break;case 65:this.$={type:J[q-1],name:J[q]};break;case 66:this.$={type:J[q-2],name:J[q-1],keys:J[q]};break;case 67:this.$={type:J[q-2],name:J[q-1],comment:J[q]};break;case 68:this.$={type:J[q-3],name:J[q-2],keys:J[q-1],comment:J[q]};break;case 69:case 71:case 74:this.$=J[q];break;case 70:this.$=J[q-1]+J[q];break;case 73:J[q-2].push(J[q]),this.$=J[q-2];break;case 75:this.$=J[q].replace(/"/g,"");break;case 76:this.$={cardA:J[q],relType:J[q-1],cardB:J[q-2]};break;case 77:this.$=ke.Cardinality.ZERO_OR_ONE;break;case 78:this.$=ke.Cardinality.ZERO_OR_MORE;break;case 79:this.$=ke.Cardinality.ONE_OR_MORE;break;case 80:this.$=ke.Cardinality.ONLY_ONE;break;case 81:this.$=ke.Cardinality.MD_PARENT;break;case 82:this.$=ke.Identification.NON_IDENTIFYING;break;case 83:this.$=ke.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,r,{5:3}),{6:[1,4],7:5,8:6,9:n,10:8,21:i,23:a,25:s,27:o,28:13,29:14,30:15,31:16,32:17,34:l,37:u,38:h,39:d,40:f,41:p,43:g,46:m,47:y,51:v,53:T,54:b,55:C},t(e,w,{1:[2,1]}),t(S,[2,3]),t(S,[2,4]),t(S,[2,5]),t(S,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:E,70:_,71:R,72:D,73:L}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t(S,[2,26]),t(S,[2,27]),t(S,[2,28]),t(S,[2,29]),t(S,[2,30]),t(S,r,{5:44}),t(B,[2,58]),t(B,[2,59]),t(B,[2,60]),t(B,[2,61]),t(B,[2,62]),t(S,[2,36]),t(S,[2,37]),t(S,[2,38]),t(S,[2,39]),{15:45,43:$,44:A},{15:48,43:$,44:A},{15:49,43:$,44:A},{10:50,43:g,51:v,53:T,54:b,55:C},{10:51,43:g,51:v,53:T,54:b,55:C},{15:52,43:$,44:A},{17:53,18:[1,54],56:55,57:56,61:I},{10:58,43:g,51:v,53:T,54:b,55:C},{68:59,74:[1,60],75:[1,61]},t(O,[2,77]),t(O,[2,78]),t(O,[2,79]),t(O,[2,80]),t(O,[2,81]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{6:[1,63],7:5,8:6,9:n,10:8,21:i,23:a,25:s,27:o,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:l,37:u,38:h,39:d,40:f,41:p,43:g,46:m,47:y,51:v,53:T,54:b,55:C},{12:N,42:64,44:M,45:P,48:66,49:67,51:F,52:V},t(z,[2,41]),t(z,[2,42]),{15:72,43:$,44:A,45:P},{12:N,42:73,44:M,45:P,48:66,49:67,51:F,52:V},{6:W,9:X,19:[1,75],35:74,50:j},{12:[1,79],14:[1,80]},t(S,[2,16],{67:35,11:81,16:[1,82],45:P,69:E,70:_,71:R,72:D,73:L}),{18:[1,83]},t(S,[2,13]),{17:84,18:[2,63],56:55,57:56,61:I},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:E,70:_,71:R,72:D,73:L},t(re,[2,82]),t(re,[2,83]),t(S,[2,31]),t(S,w),{6:W,9:X,35:90,45:Q,50:j},{43:[1,92],44:[1,93]},t(oe,[2,47],{49:94,12:N,44:M,51:F,52:V}),t(ee,[2,49]),t(ee,[2,54]),t(ee,[2,55]),t(ee,[2,56]),t(ee,[2,57]),t(S,[2,45],{45:P}),{6:W,9:X,35:95,45:Q,50:j},t(S,[2,32]),{10:97,36:96,43:g,51:v,53:T,54:b,55:C},t(S,[2,51]),t(S,[2,52]),t(S,[2,53]),{13:98,43:ne,53:ie,76:ae},{15:102,43:$,44:A},{10:103,43:g,51:v,53:T,54:b,55:C},{17:104,18:[1,105],56:55,57:56,61:I},t(S,[2,11]),{18:[2,64]},t(de,[2,65],{59:106,60:107,63:108,65:le,66:ye}),t([18,61,65,66],[2,71]),{61:[2,70]},t(S,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t(S,[2,40]),{12:N,44:M,48:113,49:67,51:F,52:V},t(z,[2,43]),t(z,[2,44]),t(ee,[2,50]),t(S,[2,46]),{10:115,20:[1,114],43:g,51:v,53:T,54:b,55:C},t($e,[2,34]),t(S,[2,7]),t(S,[2,84]),t(S,[2,85]),t(S,[2,86]),{12:[1,116],45:P},{12:[1,118],14:[1,117]},{18:[1,119]},t(S,[2,14]),t(de,[2,66],{60:120,64:[1,121],66:ye}),t(de,[2,67]),t(Fe,[2,72]),t(de,[2,75]),t(Fe,[2,74]),{17:122,18:[1,123],56:55,57:56,61:I},{15:124,43:$,44:A},t(oe,[2,48],{49:94,12:N,44:M,51:F,52:V}),{6:W,9:X,35:125,50:j},t($e,[2,35]),{13:126,43:ne,53:ie,76:ae},{15:127,43:$,44:A},{13:128,43:ne,53:ie,76:ae},t(S,[2,12]),t(de,[2,68]),{63:129,65:le},{18:[1,130]},t(S,[2,19]),t(S,[2,22],{16:[1,131],45:P}),t(S,[2,33]),t(S,[2,10]),{12:[1,132],45:P},t(S,[2,9]),t(Fe,[2,73]),t(S,[2,17]),{17:133,18:[1,134],56:55,57:56,61:I},{13:135,43:ne,53:ie,76:ae},{18:[1,136]},t(S,[2,20]),t(S,[2,8]),t(S,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:x(function(Ie,Ae){if(Ae.recoverable)this.trace(Ie);else{var be=new Error(Ie);throw be.hash=Ae,be}},"parseError"),parse:x(function(Ie){var Ae=this,be=[0],ke=[],se=[null],J=[],G=this.table,q="",H=0,Z=0,te=2,K=1,U=J.slice.call(arguments,1),Y=Object.create(this.lexer),fe={yy:{}};for(var ue in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ue)&&(fe.yy[ue]=this.yy[ue]);Y.setInput(Ie,fe.yy),fe.yy.lexer=Y,fe.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Te=Y.yylloc;J.push(Te);var ge=Y.options&&Y.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function we(ot){be.length=be.length-2*ot,se.length=se.length-ot,J.length=J.length-ot}x(we,"popStack");function xe(){var ot;return ot=ke.pop()||Y.lex()||K,typeof ot!="number"&&(ot instanceof Array&&(ke=ot,ot=ke.pop()),ot=Ae.symbols_[ot]||ot),ot}x(xe,"lex");for(var Le,_e,Be,Ee,Xe={},Re,Qe,it,Ue;;){if(_e=be[be.length-1],this.defaultActions[_e]?Be=this.defaultActions[_e]:((Le===null||typeof Le>"u")&&(Le=xe()),Be=G[_e]&&G[_e][Le]),typeof Be>"u"||!Be.length||!Be[0]){var mt="";Ue=[];for(Re in G[_e])this.terminals_[Re]&&Re>te&&Ue.push("'"+this.terminals_[Re]+"'");Y.showPosition?mt="Parse error on line "+(H+1)+`: `+Y.showPosition()+` Expecting `+Ue.join(", ")+", got '"+(this.terminals_[Le]||Le)+"'":mt="Parse error on line "+(H+1)+": Unexpected "+(Le==K?"end of input":"'"+(this.terminals_[Le]||Le)+"'"),this.parseError(mt,{text:Y.match,token:this.terminals_[Le]||Le,line:Y.yylineno,loc:Te,expected:Ue})}if(Be[0]instanceof Array&&Be.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_e+", token: "+Le);switch(Be[0]){case 1:be.push(Le),se.push(Y.yytext),J.push(Y.yylloc),be.push(Be[1]),Le=null,Z=Y.yyleng,q=Y.yytext,H=Y.yylineno,Te=Y.yylloc;break;case 2:if(Qe=this.productions_[Be[1]][1],Xe.$=se[se.length-Qe],Xe._$={first_line:J[J.length-(Qe||1)].first_line,last_line:J[J.length-1].last_line,first_column:J[J.length-(Qe||1)].first_column,last_column:J[J.length-1].last_column},ge&&(Xe._$.range=[J[J.length-(Qe||1)].range[0],J[J.length-1].range[1]]),Ee=this.performAction.apply(Xe,[q,Z,H,fe.yy,Be[1],se,J].concat(U)),typeof Ee<"u")return Ee;Qe&&(be=be.slice(0,-1*Qe*2),se=se.slice(0,-1*Qe),J=J.slice(0,-1*Qe)),be.push(this.productions_[Be[1]][0]),se.push(Xe.$),J.push(Xe._$),it=G[be[be.length-2]][be[be.length-1]],be.push(it);break;case 3:return!0}}return!0},"parse")},ve=(function(){var Ne={EOF:1,parseError:x(function(Ae,be){if(this.yy.parser)this.yy.parser.parseError(Ae,be);else throw new Error(Ae)},"parseError"),setInput:x(function(Ie,Ae){return this.yy=Ae||this.yy||{},this._input=Ie,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ie=this._input[0];this.yytext+=Ie,this.yyleng++,this.offset++,this.match+=Ie,this.matched+=Ie;var Ae=Ie.match(/(?:\r\n?|\n).*/g);return Ae?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ie},"input"),unput:x(function(Ie){var Ae=Ie.length,be=Ie.split(/(?:\r\n?|\n)/g);this._input=Ie+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ae),this.offset-=Ae;var ke=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),be.length-1&&(this.yylineno-=be.length-1);var se=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:be?(be.length===ke.length?this.yylloc.first_column:0)+ke[ke.length-be.length].length-be[0].length:this.yylloc.first_column-Ae},this.options.ranges&&(this.yylloc.range=[se[0],se[0]+this.yyleng-Ae]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ie){this.unput(this.match.slice(Ie))},"less"),pastInput:x(function(){var Ie=this.matched.substr(0,this.matched.length-this.match.length);return(Ie.length>20?"...":"")+Ie.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ie=this.match;return Ie.length<20&&(Ie+=this._input.substr(0,20-Ie.length)),(Ie.substr(0,20)+(Ie.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ie=this.pastInput(),Ae=new Array(Ie.length+1).join("-");return Ie+this.upcomingInput()+` `+Ae+"^"},"showPosition"),test_match:x(function(Ie,Ae){var be,ke,se;if(this.options.backtrack_lexer&&(se={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(se.yylloc.range=this.yylloc.range.slice(0))),ke=Ie[0].match(/(?:\r\n?|\n).*/g),ke&&(this.yylineno+=ke.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ke?ke[ke.length-1].length-ke[ke.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ie[0].length},this.yytext+=Ie[0],this.match+=Ie[0],this.matches=Ie,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ie[0].length),this.matched+=Ie[0],be=this.performAction.call(this,this.yy,this,Ae,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),be)return be;if(this._backtrack){for(var J in se)this[J]=se[J];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ie,Ae,be,ke;this._more||(this.yytext="",this.match="");for(var se=this._currentRules(),J=0;JAe[0].length)){if(Ae=be,ke=J,this.options.backtrack_lexer){if(Ie=this.test_match(be,se[J]),Ie!==!1)return Ie;if(this._backtrack){Ae=!1;continue}else return!1}else if(!this.options.flex)break}return Ae?(Ie=this.test_match(Ae,se[ke]),Ie!==!1?Ie:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ae=this.next();return Ae||this.lex()},"lex"),begin:x(function(Ae){this.conditionStack.push(Ae)},"begin"),popState:x(function(){var Ae=this.conditionStack.length-1;return Ae>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ae){return Ae=this.conditionStack.length-1-Math.abs(Ae||0),Ae>=0?this.conditionStack[Ae]:"INITIAL"},"topState"),pushState:x(function(Ae){this.begin(Ae)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Ae,be,ke,se){switch(ke){case 0:return this.begin("acc_title"),23;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),25;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return be.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return be.yytext[0];case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}};return Ne})();ce.lexer=ve;function Ce(){this.yy={}}return x(Ce,"Parser"),Ce.prototype=ce,ce.Parser=Ce,new Ce})();U5.parser=U5;var SGe=U5,Wp,kGe=(Wp=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=rn,this.getAccTitle=pn,this.setAccDescription=gn,this.getAccDescription=mn,this.setDiagramTitle=dn,this.getDiagramTitle=an,this.getConfig=x(()=>Pe().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,he.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Pe().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),he.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),he.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){let a;if(this.subGraphLookup.has(e))a=e;else{const l=this.addEntity(e);if(!l)return;a=l.id}let s;if(this.subGraphLookup.has(n))s=n;else{const l=this.addEntity(n);if(!l)return;s=l.id}const o={entityA:a,roleA:r,entityB:s,relSpec:i};this.relationships.push(o),he.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n),a=this.subGraphLookup.get(n);if(r){if(i)for(const s of r)i.cssStyles.push(s);if(a){a.cssStyles||(a.cssStyles=[]);for(const s of r)a.cssStyles.push(s)}}}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;const o=x(d=>{const f=new Set;let p;return{nodeList:d.filter(m=>{if(m!=null&&m.stmt)return m.stmt==="dir"&&(p=m.value),!1;if(typeof m!="string")return!1;const y=m.trim();return!y||f.has(y)?!1:(f.add(y),!0)}),dir:p}},"uniq")(r.flat()),l=o.nodeList,u=o.dir;i=i??"subGraph"+this.subCount,a=a||"",a=this.sanitizeText(a),this.subCount=this.subCount+1;const h={id:i,nodes:l,title:a.trim(),classes:[],cssStyles:[],dir:u,labelType:this.sanitizeNodeLabelType(n==null?void 0:n.type)};return he.info("Adding",h.id,h.nodes,h.dir),h.nodes=this.makeUniq(h,this.subGraphs).nodes,this.subGraphs.push(h),this.subGraphLookup.set(i,h),i}getSubGraphs(){return this.subGraphs}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const s of r)i.cssClasses+=" "+s;const a=this.subGraphLookup.get(n);if(a)for(const s of r)a.classes.push(s)}}subgraphNodeCache(e){const r=new Set;for(const n of e)for(const i of n.nodes)r.add(i);return r}makeUniq(e,r){const n=this.subgraphNodeCache(r),i=[];return e.nodes.forEach((a,s)=>{n.has(a)?he.warn(`Entity '${a}' already belongs to another subgraph and will be ignored`):i.push(e.nodes[s])}),{nodes:i}}sanitizeText(e){return yt.sanitizeText(e,Pe())}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,Xr()}getData(){const e=[],r=[],n=Pe(),i=this.getSubGraphs(),a=new Map,s=new Map;for(let h=i.length-1;h>=0;h--){const d=i[h];d.nodes.length>0&&s.set(d.id,!0);for(const f of d.nodes)a.set(f,d.id)}for(let h=i.length-1;h>=0;h--){const d=i[h];e.push({id:d.id,label:d.title,labelStyle:"",labelType:d.labelType,parentId:a.get(d.id),padding:8,cssCompiledStyles:this.getCompiledStyles(d.classes),cssStyles:d.cssStyles,cssClasses:d.classes.join(" "),shape:"rect",dir:d.dir,isGroup:!0,look:n.look})}const o=new Set(i.map(h=>h.id));let l=0;for(const h of this.entities.keys()){if(o.has(h))continue;const d=this.entities.get(h);d&&(d.cssCompiledStyles=this.getCompiledStyles(d.cssClasses.split(" ")),d.colorIndex=l++,e.push({...d,parentId:a.get(h),isGroup:!1}))}let u=0;for(const h of this.relationships){const d={id:op(h.entityA,h.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:h.entityA,end:h.entityB,label:h.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:h.relSpec.cardB.toLowerCase(),arrowTypeEnd:h.relSpec.cardA.toLowerCase(),pattern:h.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(d)}return{nodes:e,edges:r,other:{},config:n,direction:this.direction}}},x(Wp,"ErDB"),Wp),Bne={};vS(Bne,{draw:()=>_Ge});var _Ge=x(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Pe(),o=n.db.getData(),l=xv(e,i);o.type=n.type,o.layoutAlgorithm=zb(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await uv(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=ft(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;sr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Cd(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),XV=x((t,e)=>{const r=VM,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Hs(n,i,a,e)},"fade"),pC=new Set(["redux-color","redux-dark-color"]),AGe=x(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!pC.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` ${AGe(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; } .relationshipLabelBox { fill: ${t.tertiaryColor}; opacity: 0.7; background-color: ${t.tertiaryColor}; rect { opacity: 0.5; } } .labelBkg { background-color: ${pC.has(r)&&n?n:XV(t.tertiaryColor,.5)}; } .edgeLabel { background-color: ${pC.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label rect { fill: ${pC.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.textColor}; } .edgeLabel .label { fill: ${t.nodeBorder}; font-size: 14px; } .label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } .edge-pattern-dashed { stroke-dasharray: 8,8; } .node rect, .node circle, .node ellipse, .node polygon { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${e==="neo"?i:"1px"}; } .relationshipLine { stroke: ${t.lineColor}; stroke-width: ${e==="neo"?i:"1px"}; fill: none; } .marker { fill: none !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [data-look=neo].labelBkg { background-color: ${XV(t.tertiaryColor,.5)}; } .cluster rect { fill: ${t.clusterBkg??t.mainBkg}; stroke: ${t.clusterBorder??t.nodeBorder}; stroke-width: 1px; } .cluster text { fill: ${t.titleColor??t.textColor}; } .cluster-label text { fill: ${t.titleColor??t.textColor}; } `},"getStyles"),LGe=RGe,IGe={parser:SGe,get db(){return new kGe},renderer:Bne,styles:LGe};const DGe=Object.freeze(Object.defineProperty({__proto__:null,diagram:IGe},Symbol.toStringTag,{value:"Module"}));var qp,z$=(qp=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},x(qp,"ImperativeState"),qp);function va(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}x(va,"populateCommonDb");var MGe=Object.create,tT=Object.defineProperty,NGe=Object.getOwnPropertyDescriptor,G$=Object.getOwnPropertyNames,OGe=Object.getPrototypeOf,$Ge=Object.prototype.hasOwnProperty,k=(t,e)=>tT(t,"name",{value:e,configurable:!0}),PGe=(t,e)=>function(){return t&&(e=(0,t[G$(t)[0]])(t=0)),e},or=(t,e)=>function(){return e||(0,t[G$(t)[0]])((e={exports:{}}).exports,e),e.exports},gu=(t,e)=>{for(var r in e)tT(t,r,{get:e[r],enumerable:!0})},V$=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of G$(e))!$Ge.call(t,i)&&i!==r&&tT(t,i,{get:()=>e[i],enumerable:!(n=NGe(e,i))||n.enumerable});return t},Lk=(t,e,r)=>(V$(t,e,"default"),r),W$=(t,e,r)=>(r=t!=null?MGe(OGe(t)):{},V$(tT(r,"default",{value:t,enumerable:!0}),t)),q$=t=>V$(tT({},"__esModule",{value:!0}),t),Ik={};gu(Ik,{AnnotatedTextEdit:()=>fl,ChangeAnnotation:()=>Yu,ChangeAnnotationIdentifier:()=>wi,CodeAction:()=>S4,CodeActionContext:()=>E4,CodeActionKind:()=>w4,CodeActionTriggerKind:()=>D1,CodeDescription:()=>t4,CodeLens:()=>k4,Color:()=>mC,ColorInformation:()=>j5,ColorPresentation:()=>K5,Command:()=>Hu,CompletionItem:()=>h4,CompletionItemKind:()=>a4,CompletionItemLabelDetails:()=>u4,CompletionItemTag:()=>o4,CompletionList:()=>d4,CreateFile:()=>bf,DeleteFile:()=>Cf,Diagnostic:()=>A1,DiagnosticRelatedInformation:()=>yC,DiagnosticSeverity:()=>J5,DiagnosticTag:()=>e4,DocumentHighlight:()=>y4,DocumentHighlightKind:()=>m4,DocumentLink:()=>A4,DocumentSymbol:()=>C4,DocumentUri:()=>H5,EOL:()=>zne,FoldingRange:()=>Q5,FoldingRangeKind:()=>Z5,FormattingOptions:()=>_4,Hover:()=>f4,InlayHint:()=>P4,InlayHintKind:()=>bC,InlayHintLabelPart:()=>TC,InlineCompletionContext:()=>W4,InlineCompletionItem:()=>F4,InlineCompletionList:()=>z4,InlineCompletionTriggerKind:()=>G4,InlineValueContext:()=>$4,InlineValueEvaluatableExpression:()=>O4,InlineValueText:()=>M4,InlineValueVariableLookup:()=>N4,InsertReplaceEdit:()=>l4,InsertTextFormat:()=>s4,InsertTextMode:()=>c4,Location:()=>_1,LocationLink:()=>X5,MarkedString:()=>I1,MarkupContent:()=>wf,MarkupKind:()=>xC,OptionalVersionedTextDocumentIdentifier:()=>L1,ParameterInformation:()=>p4,Position:()=>Br,Range:()=>wr,RenameFile:()=>Tf,SelectedCompletionInfo:()=>V4,SelectionRange:()=>R4,SemanticTokenModifiers:()=>I4,SemanticTokenTypes:()=>L4,SemanticTokens:()=>D4,SignatureInformation:()=>g4,StringValue:()=>B4,SymbolInformation:()=>b4,SymbolKind:()=>v4,SymbolTag:()=>x4,TextDocument:()=>U4,TextDocumentEdit:()=>R1,TextDocumentIdentifier:()=>r4,TextDocumentItem:()=>i4,TextEdit:()=>vo,URI:()=>gC,VersionedTextDocumentIdentifier:()=>n4,WorkspaceChange:()=>Fne,WorkspaceEdit:()=>vC,WorkspaceFolder:()=>q4,WorkspaceSymbol:()=>T4,integer:()=>Y5,uinteger:()=>k1});var H5,gC,Y5,k1,Br,wr,_1,X5,mC,j5,K5,Z5,Q5,yC,J5,e4,t4,A1,Hu,vo,Yu,wi,fl,R1,bf,Tf,Cf,vC,e1,KL,Fne,r4,n4,L1,i4,xC,wf,a4,s4,o4,l4,c4,u4,h4,d4,I1,f4,p4,g4,m4,y4,v4,x4,b4,T4,C4,w4,D1,E4,S4,k4,_4,A4,R4,L4,I4,D4,M4,N4,O4,$4,bC,TC,P4,B4,F4,z4,G4,V4,W4,q4,zne,U4,jV,qe,rT=PGe({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}k(a,"is"),i.is=a})(H5||(H5={})),(function(i){function a(s){return typeof s=="string"}k(a,"is"),i.is=a})(gC||(gC={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}k(a,"is"),i.is=a})(Y5||(Y5={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}k(a,"is"),i.is=a})(k1||(k1={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=k1.MAX_VALUE),l===Number.MAX_VALUE&&(l=k1.MAX_VALUE),{line:o,character:l}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.objectLiteral(l)&&qe.uinteger(l.line)&&qe.uinteger(l.character)}k(s,"is"),i.is=s})(Br||(Br={})),(function(i){function a(o,l,u,h){if(qe.uinteger(o)&&qe.uinteger(l)&&qe.uinteger(u)&&qe.uinteger(h))return{start:Br.create(o,l),end:Br.create(u,h)};if(Br.is(o)&&Br.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}k(a,"create"),i.create=a;function s(o){let l=o;return qe.objectLiteral(l)&&Br.is(l.start)&&Br.is(l.end)}k(s,"is"),i.is=s})(wr||(wr={})),(function(i){function a(o,l){return{uri:o,range:l}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.objectLiteral(l)&&wr.is(l.range)&&(qe.string(l.uri)||qe.undefined(l.uri))}k(s,"is"),i.is=s})(_1||(_1={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.objectLiteral(l)&&wr.is(l.targetRange)&&qe.string(l.targetUri)&&wr.is(l.targetSelectionRange)&&(wr.is(l.originSelectionRange)||qe.undefined(l.originSelectionRange))}k(s,"is"),i.is=s})(X5||(X5={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}k(a,"create"),i.create=a;function s(o){const l=o;return qe.objectLiteral(l)&&qe.numberRange(l.red,0,1)&&qe.numberRange(l.green,0,1)&&qe.numberRange(l.blue,0,1)&&qe.numberRange(l.alpha,0,1)}k(s,"is"),i.is=s})(mC||(mC={})),(function(i){function a(o,l){return{range:o,color:l}}k(a,"create"),i.create=a;function s(o){const l=o;return qe.objectLiteral(l)&&wr.is(l.range)&&mC.is(l.color)}k(s,"is"),i.is=s})(j5||(j5={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}k(a,"create"),i.create=a;function s(o){const l=o;return qe.objectLiteral(l)&&qe.string(l.label)&&(qe.undefined(l.textEdit)||vo.is(l))&&(qe.undefined(l.additionalTextEdits)||qe.typedArray(l.additionalTextEdits,vo.is))}k(s,"is"),i.is=s})(K5||(K5={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(Z5||(Z5={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return qe.defined(u)&&(p.startCharacter=u),qe.defined(h)&&(p.endCharacter=h),qe.defined(d)&&(p.kind=d),qe.defined(f)&&(p.collapsedText=f),p}k(a,"create"),i.create=a;function s(o){const l=o;return qe.objectLiteral(l)&&qe.uinteger(l.startLine)&&qe.uinteger(l.startLine)&&(qe.undefined(l.startCharacter)||qe.uinteger(l.startCharacter))&&(qe.undefined(l.endCharacter)||qe.uinteger(l.endCharacter))&&(qe.undefined(l.kind)||qe.string(l.kind))}k(s,"is"),i.is=s})(Q5||(Q5={})),(function(i){function a(o,l){return{location:o,message:l}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&_1.is(l.location)&&qe.string(l.message)}k(s,"is"),i.is=s})(yC||(yC={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(J5||(J5={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(e4||(e4={})),(function(i){function a(s){const o=s;return qe.objectLiteral(o)&&qe.string(o.href)}k(a,"is"),i.is=a})(t4||(t4={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return qe.defined(u)&&(p.severity=u),qe.defined(h)&&(p.code=h),qe.defined(d)&&(p.source=d),qe.defined(f)&&(p.relatedInformation=f),p}k(a,"create"),i.create=a;function s(o){var l;let u=o;return qe.defined(u)&&wr.is(u.range)&&qe.string(u.message)&&(qe.number(u.severity)||qe.undefined(u.severity))&&(qe.integer(u.code)||qe.string(u.code)||qe.undefined(u.code))&&(qe.undefined(u.codeDescription)||qe.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(qe.string(u.source)||qe.undefined(u.source))&&(qe.undefined(u.relatedInformation)||qe.typedArray(u.relatedInformation,yC.is))}k(s,"is"),i.is=s})(A1||(A1={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return qe.defined(u)&&u.length>0&&(h.arguments=u),h}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&qe.string(l.title)&&qe.string(l.command)}k(s,"is"),i.is=s})(Hu||(Hu={})),(function(i){function a(u,h){return{range:u,newText:h}}k(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}k(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}k(o,"del"),i.del=o;function l(u){const h=u;return qe.objectLiteral(h)&&qe.string(h.newText)&&wr.is(h.range)}k(l,"is"),i.is=l})(vo||(vo={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}k(a,"create"),i.create=a;function s(o){const l=o;return qe.objectLiteral(l)&&qe.string(l.label)&&(qe.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(qe.string(l.description)||l.description===void 0)}k(s,"is"),i.is=s})(Yu||(Yu={})),(function(i){function a(s){const o=s;return qe.string(o)}k(a,"is"),i.is=a})(wi||(wi={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}k(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}k(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}k(o,"del"),i.del=o;function l(u){const h=u;return vo.is(h)&&(Yu.is(h.annotationId)||wi.is(h.annotationId))}k(l,"is"),i.is=l})(fl||(fl={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&L1.is(l.textDocument)&&Array.isArray(l.edits)}k(s,"is"),i.is=s})(R1||(R1={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}k(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&qe.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||qe.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||qe.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||wi.is(l.annotationId))}k(s,"is"),i.is=s})(bf||(bf={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}k(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&qe.string(l.oldUri)&&qe.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||qe.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||qe.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||wi.is(l.annotationId))}k(s,"is"),i.is=s})(Tf||(Tf={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}k(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&qe.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||qe.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||qe.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||wi.is(l.annotationId))}k(s,"is"),i.is=s})(Cf||(Cf={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>qe.string(l.kind)?bf.is(l)||Tf.is(l)||Cf.is(l):R1.is(l)))}k(a,"is"),i.is=a})(vC||(vC={})),e1=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=vo.insert(a,s):wi.is(o)?(u=o,l=fl.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=fl.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=vo.replace(a,s):wi.is(o)?(u=o,l=fl.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=fl.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=vo.del(a):wi.is(s)?(l=s,o=fl.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=fl.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},k(t,"TextEditChangeImpl"),t),KL=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(wi.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},k(e,"ChangeAnnotations"),e),Fne=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new KL(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(R1.is(s)){const o=new e1(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new e1(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(L1.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new e1(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new e1(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new KL,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Yu.is(s)||wi.is(s)?l=s:o=s;let u,h;if(l===void 0?u=bf.create(a,o):(h=wi.is(l)?l:this._changeAnnotations.manage(l),u=bf.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;Yu.is(o)||wi.is(o)?u=o:l=o;let h,d;if(u===void 0?h=Tf.create(a,s,l):(d=wi.is(u)?u:this._changeAnnotations.manage(u),h=Tf.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Yu.is(s)||wi.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Cf.create(a,o):(h=wi.is(l)?l:this._changeAnnotations.manage(l),u=Cf.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},k(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&qe.string(l.uri)}k(s,"is"),i.is=s})(r4||(r4={})),(function(i){function a(o,l){return{uri:o,version:l}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&qe.string(l.uri)&&qe.integer(l.version)}k(s,"is"),i.is=s})(n4||(n4={})),(function(i){function a(o,l){return{uri:o,version:l}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&qe.string(l.uri)&&(l.version===null||qe.integer(l.version))}k(s,"is"),i.is=s})(L1||(L1={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&qe.string(l.uri)&&qe.string(l.languageId)&&qe.integer(l.version)&&qe.string(l.text)}k(s,"is"),i.is=s})(i4||(i4={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}k(a,"is"),i.is=a})(xC||(xC={})),(function(i){function a(s){const o=s;return qe.objectLiteral(s)&&xC.is(o.kind)&&qe.string(o.value)}k(a,"is"),i.is=a})(wf||(wf={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(a4||(a4={})),(function(i){i.PlainText=1,i.Snippet=2})(s4||(s4={})),(function(i){i.Deprecated=1})(o4||(o4={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}k(a,"create"),i.create=a;function s(o){const l=o;return l&&qe.string(l.newText)&&wr.is(l.insert)&&wr.is(l.replace)}k(s,"is"),i.is=s})(l4||(l4={})),(function(i){i.asIs=1,i.adjustIndentation=2})(c4||(c4={})),(function(i){function a(s){const o=s;return o&&(qe.string(o.detail)||o.detail===void 0)&&(qe.string(o.description)||o.description===void 0)}k(a,"is"),i.is=a})(u4||(u4={})),(function(i){function a(s){return{label:s}}k(a,"create"),i.create=a})(h4||(h4={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}k(a,"create"),i.create=a})(d4||(d4={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}k(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return qe.string(l)||qe.objectLiteral(l)&&qe.string(l.language)&&qe.string(l.value)}k(s,"is"),i.is=s})(I1||(I1={})),(function(i){function a(s){let o=s;return!!o&&qe.objectLiteral(o)&&(wf.is(o.contents)||I1.is(o.contents)||qe.typedArray(o.contents,I1.is))&&(s.range===void 0||wr.is(s.range))}k(a,"is"),i.is=a})(f4||(f4={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}k(a,"create"),i.create=a})(p4||(p4={})),(function(i){function a(s,o,...l){let u={label:s};return qe.defined(o)&&(u.documentation=o),qe.defined(l)?u.parameters=l:u.parameters=[],u}k(a,"create"),i.create=a})(g4||(g4={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(m4||(m4={})),(function(i){function a(s,o){let l={range:s};return qe.number(o)&&(l.kind=o),l}k(a,"create"),i.create=a})(y4||(y4={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(v4||(v4={})),(function(i){i.Deprecated=1})(x4||(x4={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}k(a,"create"),i.create=a})(b4||(b4={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}k(a,"create"),i.create=a})(T4||(T4={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}k(a,"create"),i.create=a;function s(o){let l=o;return l&&qe.string(l.name)&&qe.number(l.kind)&&wr.is(l.range)&&wr.is(l.selectionRange)&&(l.detail===void 0||qe.string(l.detail))&&(l.deprecated===void 0||qe.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}k(s,"is"),i.is=s})(C4||(C4={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(w4||(w4={})),(function(i){i.Invoked=1,i.Automatic=2})(D1||(D1={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&qe.typedArray(l.diagnostics,A1.is)&&(l.only===void 0||qe.typedArray(l.only,qe.string))&&(l.triggerKind===void 0||l.triggerKind===D1.Invoked||l.triggerKind===D1.Automatic)}k(s,"is"),i.is=s})(E4||(E4={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Hu.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}k(a,"create"),i.create=a;function s(o){let l=o;return l&&qe.string(l.title)&&(l.diagnostics===void 0||qe.typedArray(l.diagnostics,A1.is))&&(l.kind===void 0||qe.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Hu.is(l.command))&&(l.isPreferred===void 0||qe.boolean(l.isPreferred))&&(l.edit===void 0||vC.is(l.edit))}k(s,"is"),i.is=s})(S4||(S4={})),(function(i){function a(o,l){let u={range:o};return qe.defined(l)&&(u.data=l),u}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&wr.is(l.range)&&(qe.undefined(l.command)||Hu.is(l.command))}k(s,"is"),i.is=s})(k4||(k4={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&qe.uinteger(l.tabSize)&&qe.boolean(l.insertSpaces)}k(s,"is"),i.is=s})(_4||(_4={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.defined(l)&&wr.is(l.range)&&(qe.undefined(l.target)||qe.string(l.target))}k(s,"is"),i.is=s})(A4||(A4={})),(function(i){function a(o,l){return{range:o,parent:l}}k(a,"create"),i.create=a;function s(o){let l=o;return qe.objectLiteral(l)&&wr.is(l.range)&&(l.parent===void 0||i.is(l.parent))}k(s,"is"),i.is=s})(R4||(R4={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(L4||(L4={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(I4||(I4={})),(function(i){function a(s){const o=s;return qe.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}k(a,"is"),i.is=a})(D4||(D4={})),(function(i){function a(o,l){return{range:o,text:l}}k(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&wr.is(l.range)&&qe.string(l.text)}k(s,"is"),i.is=s})(M4||(M4={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}k(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&wr.is(l.range)&&qe.boolean(l.caseSensitiveLookup)&&(qe.string(l.variableName)||l.variableName===void 0)}k(s,"is"),i.is=s})(N4||(N4={})),(function(i){function a(o,l){return{range:o,expression:l}}k(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&wr.is(l.range)&&(qe.string(l.expression)||l.expression===void 0)}k(s,"is"),i.is=s})(O4||(O4={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}k(a,"create"),i.create=a;function s(o){const l=o;return qe.defined(l)&&wr.is(o.stoppedLocation)}k(s,"is"),i.is=s})($4||($4={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}k(a,"is"),i.is=a})(bC||(bC={})),(function(i){function a(o){return{value:o}}k(a,"create"),i.create=a;function s(o){const l=o;return qe.objectLiteral(l)&&(l.tooltip===void 0||qe.string(l.tooltip)||wf.is(l.tooltip))&&(l.location===void 0||_1.is(l.location))&&(l.command===void 0||Hu.is(l.command))}k(s,"is"),i.is=s})(TC||(TC={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}k(a,"create"),i.create=a;function s(o){const l=o;return qe.objectLiteral(l)&&Br.is(l.position)&&(qe.string(l.label)||qe.typedArray(l.label,TC.is))&&(l.kind===void 0||bC.is(l.kind))&&l.textEdits===void 0||qe.typedArray(l.textEdits,vo.is)&&(l.tooltip===void 0||qe.string(l.tooltip)||wf.is(l.tooltip))&&(l.paddingLeft===void 0||qe.boolean(l.paddingLeft))&&(l.paddingRight===void 0||qe.boolean(l.paddingRight))}k(s,"is"),i.is=s})(P4||(P4={})),(function(i){function a(s){return{kind:"snippet",value:s}}k(a,"createSnippet"),i.createSnippet=a})(B4||(B4={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}k(a,"create"),i.create=a})(F4||(F4={})),(function(i){function a(s){return{items:s}}k(a,"create"),i.create=a})(z4||(z4={})),(function(i){i.Invoked=0,i.Automatic=1})(G4||(G4={})),(function(i){function a(s,o){return{range:s,text:o}}k(a,"create"),i.create=a})(V4||(V4={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}k(a,"create"),i.create=a})(W4||(W4={})),(function(i){function a(s){const o=s;return qe.objectLiteral(o)&&gC.is(o.uri)&&qe.string(o.name)}k(a,"is"),i.is=a})(q4||(q4={})),zne=[` `,`\r `,"\r"],(function(i){function a(u,h,d,f){return new jV(u,h,d,f)}k(a,"create"),i.create=a;function s(u){let h=u;return!!(qe.defined(h)&&qe.string(h.uri)&&(qe.undefined(h.languageId)||qe.string(h.languageId))&&qe.uinteger(h.lineCount)&&qe.func(h.getText)&&qe.func(h.positionAt)&&qe.func(h.offsetAt))}k(s,"is"),i.is=s;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}k(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return Br.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return Br.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}k(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}k(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}k(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}k(h,"number"),i.number=h;function d(v,T,b){return a.call(v)==="[object Number]"&&T<=v&&v<=b}k(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}k(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}k(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}k(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}k(m,"objectLiteral"),i.objectLiteral=m;function y(v,T){return Array.isArray(v)&&v.every(T)}k(y,"typedArray"),i.typedArray=y})(qe||(qe={}))}}),wd=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}k(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}k(i,"install"),n.install=i})(r||(r={})),t.default=r}}),nT=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}k(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}k(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}k(n,"number"),t.number=n;function i(l){return l instanceof Error}k(i,"error"),t.error=i;function a(l){return typeof l=="function"}k(a,"func"),t.func=a;function s(l){return Array.isArray(l)}k(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}k(o,"stringArray"),t.stringArray=o}}),bv=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=wd(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:k(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:k(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},k(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),Dk=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=wd(),r=nT(),n=bv(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}k(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},k(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},k(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),Gne=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var $,A,I,O,N,M,P,F,V,z,W,X,j,re,Q,oe,ee,ne,ie,ae,de,le,ye,$e,Fe;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=nT(),r;(function(ce){ce.ParseError=-32700,ce.InvalidRequest=-32600,ce.MethodNotFound=-32601,ce.InvalidParams=-32602,ce.InternalError=-32603,ce.jsonrpcReservedErrorRangeStart=-32099,ce.serverErrorStart=-32099,ce.MessageWriteError=-32099,ce.MessageReadError=-32098,ce.PendingResponseRejected=-32097,ce.ConnectionInactive=-32096,ce.ServerNotInitialized=-32002,ce.UnknownErrorCode=-32001,ce.jsonrpcReservedErrorRangeEnd=-32e3,ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=($=class extends Error{constructor(ve,Ce,Ne){super(Ce),this.code=e.number(ve)?ve:r.UnknownErrorCode,this.data=Ne,Object.setPrototypeOf(this,$.prototype)}toJson(){const ve={code:this.code,message:this.message};return this.data!==void 0&&(ve.data=this.data),ve}},k($,"ResponseError"),$);t.ResponseError=n;var i=(A=class{constructor(ve){this.kind=ve}static is(ve){return ve===A.auto||ve===A.byName||ve===A.byPosition}toString(){return this.kind}},k(A,"ParameterStructures"),A);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(I=class{constructor(ve,Ce){this.method=ve,this.numberOfParams=Ce}get parameterStructures(){return i.auto}},k(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=a;var s=(O=class extends a{constructor(ve){super(ve,0)}},k(O,"RequestType0"),O);t.RequestType0=s;var o=(N=class extends a{constructor(ve,Ce=i.auto){super(ve,1),this._parameterStructures=Ce}get parameterStructures(){return this._parameterStructures}},k(N,"RequestType"),N);t.RequestType=o;var l=(M=class extends a{constructor(ve,Ce=i.auto){super(ve,1),this._parameterStructures=Ce}get parameterStructures(){return this._parameterStructures}},k(M,"RequestType1"),M);t.RequestType1=l;var u=(P=class extends a{constructor(ve){super(ve,2)}},k(P,"RequestType2"),P);t.RequestType2=u;var h=(F=class extends a{constructor(ve){super(ve,3)}},k(F,"RequestType3"),F);t.RequestType3=h;var d=(V=class extends a{constructor(ve){super(ve,4)}},k(V,"RequestType4"),V);t.RequestType4=d;var f=(z=class extends a{constructor(ve){super(ve,5)}},k(z,"RequestType5"),z);t.RequestType5=f;var p=(W=class extends a{constructor(ve){super(ve,6)}},k(W,"RequestType6"),W);t.RequestType6=p;var g=(X=class extends a{constructor(ve){super(ve,7)}},k(X,"RequestType7"),X);t.RequestType7=g;var m=(j=class extends a{constructor(ve){super(ve,8)}},k(j,"RequestType8"),j);t.RequestType8=m;var y=(re=class extends a{constructor(ve){super(ve,9)}},k(re,"RequestType9"),re);t.RequestType9=y;var v=(Q=class extends a{constructor(ve,Ce=i.auto){super(ve,1),this._parameterStructures=Ce}get parameterStructures(){return this._parameterStructures}},k(Q,"NotificationType"),Q);t.NotificationType=v;var T=(oe=class extends a{constructor(ve){super(ve,0)}},k(oe,"NotificationType0"),oe);t.NotificationType0=T;var b=(ee=class extends a{constructor(ve,Ce=i.auto){super(ve,1),this._parameterStructures=Ce}get parameterStructures(){return this._parameterStructures}},k(ee,"NotificationType1"),ee);t.NotificationType1=b;var C=(ne=class extends a{constructor(ve){super(ve,2)}},k(ne,"NotificationType2"),ne);t.NotificationType2=C;var w=(ie=class extends a{constructor(ve){super(ve,3)}},k(ie,"NotificationType3"),ie);t.NotificationType3=w;var S=(ae=class extends a{constructor(ve){super(ve,4)}},k(ae,"NotificationType4"),ae);t.NotificationType4=S;var E=(de=class extends a{constructor(ve){super(ve,5)}},k(de,"NotificationType5"),de);t.NotificationType5=E;var _=(le=class extends a{constructor(ve){super(ve,6)}},k(le,"NotificationType6"),le);t.NotificationType6=_;var R=(ye=class extends a{constructor(ve){super(ve,7)}},k(ye,"NotificationType7"),ye);t.NotificationType7=R;var D=($e=class extends a{constructor(ve){super(ve,8)}},k($e,"NotificationType8"),$e);t.NotificationType8=D;var L=(Fe=class extends a{constructor(ve){super(ve,9)}},k(Fe,"NotificationType9"),Fe);t.NotificationType9=L;var B;(function(ce){function ve(Ie){const Ae=Ie;return Ae&&e.string(Ae.method)&&(e.string(Ae.id)||e.number(Ae.id))}k(ve,"isRequest"),ce.isRequest=ve;function Ce(Ie){const Ae=Ie;return Ae&&e.string(Ae.method)&&Ie.id===void 0}k(Ce,"isNotification"),ce.isNotification=Ce;function Ne(Ie){const Ae=Ie;return Ae&&(Ae.result!==void 0||!!Ae.error)&&(e.string(Ae.id)||e.number(Ae.id)||Ae.id===null)}k(Ne,"isResponse"),ce.isResponse=Ne})(B||(t.Message=B={}))}}),Vne=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:k(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:k(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:k(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},k(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},k(s,"LRUCache"),s);t.LRUCache=i}}),BGe=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}k(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),FGe=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=Dk(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},k(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},k(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},k(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},k(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),Wne=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=wd(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},k(n,"Semaphore"),n);t.Semaphore=r}}),zGe=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=wd(),r=nT(),n=bv(),i=Wne(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}k(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},k(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const T=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,T.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)T.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,T.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:T}}k(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. ${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},k(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),GGe=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=wd(),r=nT(),n=Wne(),i=bv(),a="Content-Length: ",s=`\r `,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}k(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},k(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}k(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},k(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),VGe=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r `,i=(a=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;uthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},k(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),WGe=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var $,A;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=wd(),r=nT(),n=Gne(),i=Vne(),a=bv(),s=Dk(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function O(N){return typeof N=="string"||typeof N=="number"}k(O,"is"),I.is=O})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=($=class{constructor(){}},k($,"ProgressType"),$);t.ProgressType=h;var d;(function(I){function O(N){return r.func(N)}k(O,"is"),I.is=O})(d||(d={})),t.NullLogger=Object.freeze({error:k(()=>{},"error"),warn:k(()=>{},"warn"),info:k(()=>{},"info"),log:k(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function O(M){if(!r.string(M))return I.Off;switch(M=M.toLowerCase(),M){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}k(O,"fromString"),I.fromString=O;function N(M){switch(M){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}k(N,"toString"),I.toString=N})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function O(N){return r.string(N)?(N=N.toLowerCase(),N==="json"?I.JSON:I.Text):I.Text}k(O,"fromString"),I.fromString=O})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var T=(A=class extends Error{constructor(O,N){super(N),this.code=O,Object.setPrototypeOf(this,A.prototype)}},k(A,"ConnectionError"),A);t.ConnectionError=T;var b;(function(I){function O(N){const M=N;return M&&r.func(M.cancelUndispatched)}k(O,"is"),I.is=O})(b||(t.ConnectionStrategy=b={}));var C;(function(I){function O(N){const M=N;return M&&(M.kind===void 0||M.kind==="id")&&r.func(M.createCancellationTokenSource)&&(M.dispose===void 0||r.func(M.dispose))}k(O,"is"),I.is=O})(C||(t.IdCancellationReceiverStrategy=C={}));var w;(function(I){function O(N){const M=N;return M&&M.kind==="request"&&r.func(M.createCancellationTokenSource)&&(M.dispose===void 0||r.func(M.dispose))}k(O,"is"),I.is=O})(w||(t.RequestCancellationReceiverStrategy=w={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(N){return new s.CancellationTokenSource}});function O(N){return C.is(N)||w.is(N)}k(O,"is"),I.is=O})(S||(t.CancellationReceiverStrategy=S={}));var E;(function(I){I.Message=Object.freeze({sendCancellation(N,M){return N.sendNotification(o.type,{id:M})},cleanup(N){}});function O(N){const M=N;return M&&r.func(M.sendCancellation)&&r.func(M.cleanup)}k(O,"is"),I.is=O})(E||(t.CancellationSenderStrategy=E={}));var _;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:E.Message});function O(N){const M=N;return M&&S.is(M.receiver)&&E.is(M.sender)}k(O,"is"),I.is=O})(_||(t.CancellationStrategy=_={}));var R;(function(I){function O(N){const M=N;return M&&r.func(M.handleMessage)}k(O,"is"),I.is=O})(R||(t.MessageStrategy=R={}));var D;(function(I){function O(N){const M=N;return M&&(_.is(M.cancellationStrategy)||b.is(M.connectionStrategy)||R.is(M.messageStrategy))}k(O,"is"),I.is=O})(D||(t.ConnectionOptions=D={}));var L;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(L||(L={}));function B(I,O,N,M){const P=N!==void 0?N:t.NullLogger;let F=0,V=0,z=0;const W="2.0";let X;const j=new Map;let re;const Q=new Map,oe=new Map;let ee,ne=new i.LinkedMap,ie=new Map,ae=new Set,de=new Map,le=f.Off,ye=g.Text,$e,Fe=L.New;const ce=new a.Emitter,ve=new a.Emitter,Ce=new a.Emitter,Ne=new a.Emitter,Ie=new a.Emitter,Ae=M&&M.cancellationStrategy?M.cancellationStrategy:_.Message;function be(Se){if(Se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Se.toString()}k(be,"createRequestQueueKey");function ke(Se){return Se===null?"res-unknown-"+(++z).toString():"res-"+Se.toString()}k(ke,"createResponseQueueKey");function se(){return"not-"+(++V).toString()}k(se,"createNotificationQueueKey");function J(Se,We){n.Message.isRequest(We)?Se.set(be(We.id),We):n.Message.isResponse(We)?Se.set(ke(We.id),We):Se.set(se(),We)}k(J,"addMessageToQueue");function G(Se){}k(G,"cancelUndispatched");function q(){return Fe===L.Listening}k(q,"isListening");function H(){return Fe===L.Closed}k(H,"isClosed");function Z(){return Fe===L.Disposed}k(Z,"isDisposed");function te(){(Fe===L.New||Fe===L.Listening)&&(Fe=L.Closed,ve.fire(void 0))}k(te,"closeHandler");function K(Se){ce.fire([Se,void 0,void 0])}k(K,"readErrorHandler");function U(Se){ce.fire(Se)}k(U,"writeErrorHandler"),I.onClose(te),I.onError(K),O.onClose(te),O.onError(U);function Y(){ee||ne.size===0||(ee=(0,e.default)().timer.setImmediate(()=>{ee=void 0,ue()}))}k(Y,"triggerMessageQueue");function fe(Se){n.Message.isRequest(Se)?ge(Se):n.Message.isNotification(Se)?xe(Se):n.Message.isResponse(Se)?we(Se):Le(Se)}k(fe,"handleMessage");function ue(){if(ne.size===0)return;const Se=ne.shift();try{const We=M==null?void 0:M.messageStrategy;R.is(We)?We.handleMessage(Se,fe):fe(Se)}finally{Y()}}k(ue,"processMessageQueue");const Te=k(Se=>{try{if(n.Message.isNotification(Se)&&Se.method===o.type.method){const We=Se.params.id,Je=be(We),nt=ne.get(Je);if(n.Message.isRequest(nt)){const Vt=M==null?void 0:M.connectionStrategy,Mt=Vt&&Vt.cancelUndispatched?Vt.cancelUndispatched(nt,G):void 0;if(Mt&&(Mt.error!==void 0||Mt.result!==void 0)){ne.delete(Je),de.delete(We),Mt.id=nt.id,Xe(Mt,Se.method,Date.now()),O.write(Mt).catch(()=>P.error("Sending response for canceled message failed."));return}}const wt=de.get(We);if(wt!==void 0){wt.cancel(),Qe(Se);return}else ae.add(We)}J(ne,Se)}finally{Y()}},"callback");function ge(Se){if(Z())return;function We($t,tr,Dt){const Xt={jsonrpc:W,id:Se.id};$t instanceof n.ResponseError?Xt.error=$t.toJson():Xt.result=$t===void 0?null:$t,Xe(Xt,tr,Dt),O.write(Xt).catch(()=>P.error("Sending response failed."))}k(We,"reply");function Je($t,tr,Dt){const Xt={jsonrpc:W,id:Se.id,error:$t.toJson()};Xe(Xt,tr,Dt),O.write(Xt).catch(()=>P.error("Sending response failed."))}k(Je,"replyError");function nt($t,tr,Dt){$t===void 0&&($t=null);const Xt={jsonrpc:W,id:Se.id,result:$t};Xe(Xt,tr,Dt),O.write(Xt).catch(()=>P.error("Sending response failed."))}k(nt,"replySuccess"),Re(Se);const wt=j.get(Se.method);let Vt,Mt;wt&&(Vt=wt.type,Mt=wt.handler);const Yt=Date.now();if(Mt||X){const $t=Se.id??String(Date.now()),tr=C.is(Ae.receiver)?Ae.receiver.createCancellationTokenSource($t):Ae.receiver.createCancellationTokenSource(Se);Se.id!==null&&ae.has(Se.id)&&tr.cancel(),Se.id!==null&&de.set($t,tr);try{let Dt;if(Mt)if(Se.params===void 0){if(Vt!==void 0&&Vt.numberOfParams!==0){Je(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines ${Vt.numberOfParams} params but received none.`),Se.method,Yt);return}Dt=Mt(tr.token)}else if(Array.isArray(Se.params)){if(Vt!==void 0&&Vt.parameterStructures===n.ParameterStructures.byName){Je(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by name but received parameters by position`),Se.method,Yt);return}Dt=Mt(...Se.params,tr.token)}else{if(Vt!==void 0&&Vt.parameterStructures===n.ParameterStructures.byPosition){Je(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by position but received parameters by name`),Se.method,Yt);return}Dt=Mt(Se.params,tr.token)}else X&&(Dt=X(Se.method,Se.params,tr.token));const Xt=Dt;Dt?Xt.then?Xt.then(hr=>{de.delete($t),We(hr,Se.method,Yt)},hr=>{de.delete($t),hr instanceof n.ResponseError?Je(hr,Se.method,Yt):hr&&r.string(hr.message)?Je(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${hr.message}`),Se.method,Yt):Je(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,Yt)}):(de.delete($t),We(Dt,Se.method,Yt)):(de.delete($t),nt(Dt,Se.method,Yt))}catch(Dt){de.delete($t),Dt instanceof n.ResponseError?We(Dt,Se.method,Yt):Dt&&r.string(Dt.message)?Je(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Dt.message}`),Se.method,Yt):Je(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,Yt)}}else Je(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,Yt)}k(ge,"handleRequest");function we(Se){if(!Z())if(Se.id===null)Se.error?P.error(`Received response message without id: Error is: ${JSON.stringify(Se.error,void 0,4)}`):P.error("Received response message without id. No further error information provided.");else{const We=Se.id,Je=ie.get(We);if(it(Se,Je),Je!==void 0){ie.delete(We);try{if(Se.error){const nt=Se.error;Je.reject(new n.ResponseError(nt.code,nt.message,nt.data))}else if(Se.result!==void 0)Je.resolve(Se.result);else throw new Error("Should never happen.")}catch(nt){nt.message?P.error(`Response handler '${Je.method}' failed with message: ${nt.message}`):P.error(`Response handler '${Je.method}' failed unexpectedly.`)}}}}k(we,"handleResponse");function xe(Se){if(Z())return;let We,Je;if(Se.method===o.type.method){const nt=Se.params.id;ae.delete(nt),Qe(Se);return}else{const nt=Q.get(Se.method);nt&&(Je=nt.handler,We=nt.type)}if(Je||re)try{if(Qe(Se),Je)if(Se.params===void 0)We!==void 0&&We.numberOfParams!==0&&We.parameterStructures!==n.ParameterStructures.byName&&P.error(`Notification ${Se.method} defines ${We.numberOfParams} params but received none.`),Je();else if(Array.isArray(Se.params)){const nt=Se.params;Se.method===u.type.method&&nt.length===2&&l.is(nt[0])?Je({token:nt[0],value:nt[1]}):(We!==void 0&&(We.parameterStructures===n.ParameterStructures.byName&&P.error(`Notification ${Se.method} defines parameters by name but received parameters by position`),We.numberOfParams!==Se.params.length&&P.error(`Notification ${Se.method} defines ${We.numberOfParams} params but received ${nt.length} arguments`)),Je(...nt))}else We!==void 0&&We.parameterStructures===n.ParameterStructures.byPosition&&P.error(`Notification ${Se.method} defines parameters by position but received parameters by name`),Je(Se.params);else re&&re(Se.method,Se.params)}catch(nt){nt.message?P.error(`Notification handler '${Se.method}' failed with message: ${nt.message}`):P.error(`Notification handler '${Se.method}' failed unexpectedly.`)}else Ce.fire(Se)}k(xe,"handleNotification");function Le(Se){if(!Se){P.error("Received empty message.");return}P.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(Se,null,4)}`);const We=Se;if(r.string(We.id)||r.number(We.id)){const Je=We.id,nt=ie.get(Je);nt&&nt.reject(new Error("The received response has neither a result nor an error property."))}}k(Le,"handleInvalidMessage");function _e(Se){if(Se!=null)switch(le){case f.Verbose:return JSON.stringify(Se,null,4);case f.Compact:return JSON.stringify(Se);default:return}}k(_e,"stringifyTrace");function Be(Se){if(!(le===f.Off||!$e))if(ye===g.Text){let We;(le===f.Verbose||le===f.Compact)&&Se.params&&(We=`Params: ${_e(Se.params)} `),$e.log(`Sending request '${Se.method} - (${Se.id})'.`,We)}else Ue("send-request",Se)}k(Be,"traceSendingRequest");function Ee(Se){if(!(le===f.Off||!$e))if(ye===g.Text){let We;(le===f.Verbose||le===f.Compact)&&(Se.params?We=`Params: ${_e(Se.params)} `:We=`No parameters provided. `),$e.log(`Sending notification '${Se.method}'.`,We)}else Ue("send-notification",Se)}k(Ee,"traceSendingNotification");function Xe(Se,We,Je){if(!(le===f.Off||!$e))if(ye===g.Text){let nt;(le===f.Verbose||le===f.Compact)&&(Se.error&&Se.error.data?nt=`Error data: ${_e(Se.error.data)} `:Se.result?nt=`Result: ${_e(Se.result)} `:Se.error===void 0&&(nt=`No result returned. `)),$e.log(`Sending response '${We} - (${Se.id})'. Processing request took ${Date.now()-Je}ms`,nt)}else Ue("send-response",Se)}k(Xe,"traceSendingResponse");function Re(Se){if(!(le===f.Off||!$e))if(ye===g.Text){let We;(le===f.Verbose||le===f.Compact)&&Se.params&&(We=`Params: ${_e(Se.params)} `),$e.log(`Received request '${Se.method} - (${Se.id})'.`,We)}else Ue("receive-request",Se)}k(Re,"traceReceivedRequest");function Qe(Se){if(!(le===f.Off||!$e||Se.method===y.type.method))if(ye===g.Text){let We;(le===f.Verbose||le===f.Compact)&&(Se.params?We=`Params: ${_e(Se.params)} `:We=`No parameters provided. `),$e.log(`Received notification '${Se.method}'.`,We)}else Ue("receive-notification",Se)}k(Qe,"traceReceivedNotification");function it(Se,We){if(!(le===f.Off||!$e))if(ye===g.Text){let Je;if((le===f.Verbose||le===f.Compact)&&(Se.error&&Se.error.data?Je=`Error data: ${_e(Se.error.data)} `:Se.result?Je=`Result: ${_e(Se.result)} `:Se.error===void 0&&(Je=`No result returned. `)),We){const nt=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";$e.log(`Received response '${We.method} - (${Se.id})' in ${Date.now()-We.timerStart}ms.${nt}`,Je)}else $e.log(`Received response ${Se.id} without active response promise.`,Je)}else Ue("receive-response",Se)}k(it,"traceReceivedResponse");function Ue(Se,We){if(!$e||le===f.Off)return;const Je={isLSPMessage:!0,type:Se,message:We,timestamp:Date.now()};$e.log(Je)}k(Ue,"logLSPMessage");function mt(){if(H())throw new T(v.Closed,"Connection is closed.");if(Z())throw new T(v.Disposed,"Connection is disposed.")}k(mt,"throwIfClosedOrDisposed");function ot(){if(q())throw new T(v.AlreadyListening,"Connection is already listening")}k(ot,"throwIfListening");function Ke(){if(!q())throw new Error("Call listen() first.")}k(Ke,"throwIfNotListening");function me(Se){return Se===void 0?null:Se}k(me,"undefinedToNull");function dt(Se){if(Se!==null)return Se}k(dt,"nullToUndefined");function at(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}k(at,"isNamedParam");function et(Se,We){switch(Se){case n.ParameterStructures.auto:return at(We)?dt(We):[me(We)];case n.ParameterStructures.byName:if(!at(We))throw new Error("Received parameters by name but param is not an object literal.");return dt(We);case n.ParameterStructures.byPosition:return[me(We)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}k(et,"computeSingleParam");function ct(Se,We){let Je;const nt=Se.numberOfParams;switch(nt){case 0:Je=void 0;break;case 1:Je=et(Se.parameterStructures,We[0]);break;default:Je=[];for(let wt=0;wt{mt();let Je,nt;if(r.string(Se)){Je=Se;const Vt=We[0];let Mt=0,Yt=n.ParameterStructures.auto;n.ParameterStructures.is(Vt)&&(Mt=1,Yt=Vt);let $t=We.length;const tr=$t-Mt;switch(tr){case 0:nt=void 0;break;case 1:nt=et(Yt,We[Mt]);break;default:if(Yt===n.ParameterStructures.byName)throw new Error(`Received ${tr} parameters for 'by Name' notification parameter structure.`);nt=We.slice(Mt,$t).map(Dt=>me(Dt));break}}else{const Vt=We;Je=Se.method,nt=ct(Se,Vt)}const wt={jsonrpc:W,method:Je,params:nt};return Ee(wt),O.write(wt).catch(Vt=>{throw P.error("Sending notification failed."),Vt})},"sendNotification"),onNotification:k((Se,We)=>{mt();let Je;return r.func(Se)?re=Se:We&&(r.string(Se)?(Je=Se,Q.set(Se,{type:void 0,handler:We})):(Je=Se.method,Q.set(Se.method,{type:Se,handler:We}))),{dispose:k(()=>{Je!==void 0?Q.delete(Je):re=void 0},"dispose")}},"onNotification"),onProgress:k((Se,We,Je)=>{if(oe.has(We))throw new Error(`Progress handler for token ${We} already registered`);return oe.set(We,Je),{dispose:k(()=>{oe.delete(We)},"dispose")}},"onProgress"),sendProgress:k((Se,We,Je)=>Gt.sendNotification(u.type,{token:We,value:Je}),"sendProgress"),onUnhandledProgress:Ne.event,sendRequest:k((Se,...We)=>{mt(),Ke();let Je,nt,wt;if(r.string(Se)){Je=Se;const $t=We[0],tr=We[We.length-1];let Dt=0,Xt=n.ParameterStructures.auto;n.ParameterStructures.is($t)&&(Dt=1,Xt=$t);let hr=We.length;s.CancellationToken.is(tr)&&(hr=hr-1,wt=tr);const je=hr-Dt;switch(je){case 0:nt=void 0;break;case 1:nt=et(Xt,We[Dt]);break;default:if(Xt===n.ParameterStructures.byName)throw new Error(`Received ${je} parameters for 'by Name' request parameter structure.`);nt=We.slice(Dt,hr).map(tt=>me(tt));break}}else{const $t=We;Je=Se.method,nt=ct(Se,$t);const tr=Se.numberOfParams;wt=s.CancellationToken.is($t[tr])?$t[tr]:void 0}const Vt=F++;let Mt;wt&&(Mt=wt.onCancellationRequested(()=>{const $t=Ae.sender.sendCancellation(Gt,Vt);return $t===void 0?(P.log(`Received no promise from cancellation strategy when cancelling id ${Vt}`),Promise.resolve()):$t.catch(()=>{P.log(`Sending cancellation messages for id ${Vt} failed`)})}));const Yt={jsonrpc:W,id:Vt,method:Je,params:nt};return Be(Yt),typeof Ae.sender.enableCancellation=="function"&&Ae.sender.enableCancellation(Yt),new Promise(async($t,tr)=>{const Dt=k(je=>{$t(je),Ae.sender.cleanup(Vt),Mt==null||Mt.dispose()},"resolveWithCleanup"),Xt=k(je=>{tr(je),Ae.sender.cleanup(Vt),Mt==null||Mt.dispose()},"rejectWithCleanup"),hr={method:Je,timerStart:Date.now(),resolve:Dt,reject:Xt};try{await O.write(Yt),ie.set(Vt,hr)}catch(je){throw P.error("Sending request failed."),hr.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,je.message?je.message:"Unknown reason")),je}})},"sendRequest"),onRequest:k((Se,We)=>{mt();let Je=null;return d.is(Se)?(Je=void 0,X=Se):r.string(Se)?(Je=null,We!==void 0&&(Je=Se,j.set(Se,{handler:We,type:void 0}))):We!==void 0&&(Je=Se.method,j.set(Se.method,{type:Se,handler:We})),{dispose:k(()=>{Je!==null&&(Je!==void 0?j.delete(Je):X=void 0)},"dispose")}},"onRequest"),hasPendingResponse:k(()=>ie.size>0,"hasPendingResponse"),trace:k(async(Se,We,Je)=>{let nt=!1,wt=g.Text;Je!==void 0&&(r.boolean(Je)?nt=Je:(nt=Je.sendNotification||!1,wt=Je.traceFormat||g.Text)),le=Se,ye=wt,le===f.Off?$e=void 0:$e=We,nt&&!H()&&!Z()&&await Gt.sendNotification(m.type,{value:f.toString(Se)})},"trace"),onError:ce.event,onClose:ve.event,onUnhandledNotification:Ce.event,onDispose:Ie.event,end:k(()=>{O.end()},"end"),dispose:k(()=>{if(Z())return;Fe=L.Disposed,Ie.fire(void 0);const Se=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const We of ie.values())We.reject(Se);ie=new Map,de=new Map,ae=new Set,ne=new i.LinkedMap,r.func(O.dispose)&&O.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:k(()=>{mt(),ot(),Fe=L.Listening,I.listen(Te)},"listen"),inspect:k(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Gt.onNotification(y.type,Se=>{if(le===f.Off||!$e)return;const We=le===f.Verbose||le===f.Compact;$e.log(Se.message,We?Se.verbose:void 0)}),Gt.onNotification(u.type,Se=>{const We=oe.get(Se.token);We?We(Se.value):Ne.fire(Se)}),Gt}k(B,"createMessageConnection"),t.createMessageConnection=B}}),H4=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=Gne();Object.defineProperty(t,"Message",{enumerable:!0,get:k(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:k(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:k(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:k(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:k(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:k(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:k(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:k(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:k(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:k(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:k(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:k(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:k(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:k(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:k(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:k(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:k(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:k(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:k(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:k(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:k(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:k(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:k(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:k(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:k(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:k(function(){return e.ParameterStructures},"get")});var r=Vne();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:k(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:k(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:k(function(){return r.Touch},"get")});var n=BGe();Object.defineProperty(t,"Disposable",{enumerable:!0,get:k(function(){return n.Disposable},"get")});var i=bv();Object.defineProperty(t,"Event",{enumerable:!0,get:k(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:k(function(){return i.Emitter},"get")});var a=Dk();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:k(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:k(function(){return a.CancellationToken},"get")});var s=FGe();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:k(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:k(function(){return s.SharedArrayReceiverStrategy},"get")});var o=zGe();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:k(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:k(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:k(function(){return o.ReadableStreamMessageReader},"get")});var l=GGe();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:k(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:k(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:k(function(){return l.WriteableStreamMessageWriter},"get")});var u=VGe();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:k(function(){return u.AbstractMessageBuffer},"get")});var h=WGe();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:k(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:k(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:k(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:k(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:k(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:k(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:k(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:k(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:k(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:k(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:k(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:k(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:k(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:k(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:k(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:k(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:k(function(){return h.MessageStrategy},"get")});var d=wd();t.RAL=d.default}}),qGe=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=H4(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},k(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},k(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},k(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:k(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:k((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:k((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:k(d=>new n(d),"asReadableStream"),asWritableStream:k(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:k(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:k(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:k(()=>clearInterval(g),"dispose")}}})});function o(){return s}k(o,"RIL"),(function(d){function f(){e.RAL.install(s)}k(f,"install"),d.install=f})(o||(o={})),t.default=o}}),Tv=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:k(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=qGe();n.default.install();var i=H4();r(H4(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},k(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},k(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}k(o,"createMessageConnection"),t.createMessageConnection=o}}),KV=or({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=Tv()}}),wn=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=Tv(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},k(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},k(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},k(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},k(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},k(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),U$=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}k(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}k(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}k(n,"number"),t.number=n;function i(h){return h instanceof Error}k(i,"error"),t.error=i;function a(h){return typeof h=="function"}k(a,"func"),t.func=a;function s(h){return Array.isArray(h)}k(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}k(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}k(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}k(u,"objectLiteral"),t.objectLiteral=u}}),UGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=wn(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),HGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=wn(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),YGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=wn(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),XGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=wn(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),jGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=wn(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),KGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=wn(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),ZGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=wn(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),QGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=wn(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),JGe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=Tv(),r=wn(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}k(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),eVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=wn(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),tVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=wn(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),rVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=wn(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),nVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=wn(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),iVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=wn(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),aVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=wn(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),sVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=wn(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),oVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=wn(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),lVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=wn(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),cVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=Tv(),r=U$(),n=wn(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}k(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),uVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(rT(),q$(Ik)),r=U$(),n=wn(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}k(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(T,b){const C={executionOrder:T};return(b===!0||b===!1)&&(C.success=b),C}k(m,"create"),g.create=m;function y(T){const b=T;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}k(y,"is"),g.is=y;function v(T,b){return T===b?!0:T==null||b===null||b===void 0?!1:T.executionOrder===b.executionOrder&&T.success===b.success}k(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,C){return{kind:b,document:C}}k(m,"create"),g.create=m;function y(b){const C=b;return r.objectLiteral(C)&&i.is(C.kind)&&e.DocumentUri.is(C.document)&&(C.metadata===void 0||r.objectLiteral(C.metadata))}k(y,"is"),g.is=y;function v(b,C){const w=new Set;return b.document!==C.document&&w.add("document"),b.kind!==C.kind&&w.add("kind"),b.executionSummary!==C.executionSummary&&w.add("executionSummary"),(b.metadata!==void 0||C.metadata!==void 0)&&!T(b.metadata,C.metadata)&&w.add("metadata"),(b.executionSummary!==void 0||C.executionSummary!==void 0)&&!a.equals(b.executionSummary,C.executionSummary)&&w.add("executionSummary"),w}k(v,"diff"),g.diff=v;function T(b,C){if(b===C)return!0;if(b==null||C===null||C===void 0||typeof b!=typeof C||typeof b!="object")return!1;const w=Array.isArray(b),S=Array.isArray(C);if(w!==S)return!1;if(w&&S){if(b.length!==C.length)return!1;for(let E=0;E0}k(dt,"hasId"),me.hasId=dt})(M||(t.StaticRegistrationOptions=M={}));var P;(function(me){function dt(at){const et=at;return et&&(et.documentSelector===null||B.is(et.documentSelector))}k(dt,"is"),me.is=dt})(P||(t.TextDocumentRegistrationOptions=P={}));var F;(function(me){function dt(et){const ct=et;return n.objectLiteral(ct)&&(ct.workDoneProgress===void 0||n.boolean(ct.workDoneProgress))}k(dt,"is"),me.is=dt;function at(et){const ct=et;return ct&&n.boolean(ct.workDoneProgress)}k(at,"hasWorkDoneProgress"),me.hasWorkDoneProgress=at})(F||(t.WorkDoneProgressOptions=F={}));var V;(function(me){me.method="initialize",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(V||(t.InitializeRequest=V={}));var z;(function(me){me.unknownProtocolVersion=1})(z||(t.InitializeErrorCodes=z={}));var W;(function(me){me.method="initialized",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType(me.method)})(W||(t.InitializedNotification=W={}));var X;(function(me){me.method="shutdown",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType0(me.method)})(X||(t.ShutdownRequest=X={}));var j;(function(me){me.method="exit",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType0(me.method)})(j||(t.ExitNotification=j={}));var re;(function(me){me.method="workspace/didChangeConfiguration",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType(me.method)})(re||(t.DidChangeConfigurationNotification=re={}));var Q;(function(me){me.Error=1,me.Warning=2,me.Info=3,me.Log=4,me.Debug=5})(Q||(t.MessageType=Q={}));var oe;(function(me){me.method="window/showMessage",me.messageDirection=e.MessageDirection.serverToClient,me.type=new e.ProtocolNotificationType(me.method)})(oe||(t.ShowMessageNotification=oe={}));var ee;(function(me){me.method="window/showMessageRequest",me.messageDirection=e.MessageDirection.serverToClient,me.type=new e.ProtocolRequestType(me.method)})(ee||(t.ShowMessageRequest=ee={}));var ne;(function(me){me.method="window/logMessage",me.messageDirection=e.MessageDirection.serverToClient,me.type=new e.ProtocolNotificationType(me.method)})(ne||(t.LogMessageNotification=ne={}));var ie;(function(me){me.method="telemetry/event",me.messageDirection=e.MessageDirection.serverToClient,me.type=new e.ProtocolNotificationType(me.method)})(ie||(t.TelemetryEventNotification=ie={}));var ae;(function(me){me.None=0,me.Full=1,me.Incremental=2})(ae||(t.TextDocumentSyncKind=ae={}));var de;(function(me){me.method="textDocument/didOpen",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType(me.method)})(de||(t.DidOpenTextDocumentNotification=de={}));var le;(function(me){function dt(et){let ct=et;return ct!=null&&typeof ct.text=="string"&&ct.range!==void 0&&(ct.rangeLength===void 0||typeof ct.rangeLength=="number")}k(dt,"isIncremental"),me.isIncremental=dt;function at(et){let ct=et;return ct!=null&&typeof ct.text=="string"&&ct.range===void 0&&ct.rangeLength===void 0}k(at,"isFull"),me.isFull=at})(le||(t.TextDocumentContentChangeEvent=le={}));var ye;(function(me){me.method="textDocument/didChange",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType(me.method)})(ye||(t.DidChangeTextDocumentNotification=ye={}));var $e;(function(me){me.method="textDocument/didClose",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType(me.method)})($e||(t.DidCloseTextDocumentNotification=$e={}));var Fe;(function(me){me.method="textDocument/didSave",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType(me.method)})(Fe||(t.DidSaveTextDocumentNotification=Fe={}));var ce;(function(me){me.Manual=1,me.AfterDelay=2,me.FocusOut=3})(ce||(t.TextDocumentSaveReason=ce={}));var ve;(function(me){me.method="textDocument/willSave",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType(me.method)})(ve||(t.WillSaveTextDocumentNotification=ve={}));var Ce;(function(me){me.method="textDocument/willSaveWaitUntil",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Ce||(t.WillSaveTextDocumentWaitUntilRequest=Ce={}));var Ne;(function(me){me.method="workspace/didChangeWatchedFiles",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolNotificationType(me.method)})(Ne||(t.DidChangeWatchedFilesNotification=Ne={}));var Ie;(function(me){me.Created=1,me.Changed=2,me.Deleted=3})(Ie||(t.FileChangeType=Ie={}));var Ae;(function(me){function dt(at){const et=at;return n.objectLiteral(et)&&(r.URI.is(et.baseUri)||r.WorkspaceFolder.is(et.baseUri))&&n.string(et.pattern)}k(dt,"is"),me.is=dt})(Ae||(t.RelativePattern=Ae={}));var be;(function(me){me.Create=1,me.Change=2,me.Delete=4})(be||(t.WatchKind=be={}));var ke;(function(me){me.method="textDocument/publishDiagnostics",me.messageDirection=e.MessageDirection.serverToClient,me.type=new e.ProtocolNotificationType(me.method)})(ke||(t.PublishDiagnosticsNotification=ke={}));var se;(function(me){me.Invoked=1,me.TriggerCharacter=2,me.TriggerForIncompleteCompletions=3})(se||(t.CompletionTriggerKind=se={}));var J;(function(me){me.method="textDocument/completion",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(J||(t.CompletionRequest=J={}));var G;(function(me){me.method="completionItem/resolve",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(G||(t.CompletionResolveRequest=G={}));var q;(function(me){me.method="textDocument/hover",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(q||(t.HoverRequest=q={}));var H;(function(me){me.Invoked=1,me.TriggerCharacter=2,me.ContentChange=3})(H||(t.SignatureHelpTriggerKind=H={}));var Z;(function(me){me.method="textDocument/signatureHelp",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Z||(t.SignatureHelpRequest=Z={}));var te;(function(me){me.method="textDocument/definition",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(te||(t.DefinitionRequest=te={}));var K;(function(me){me.method="textDocument/references",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(K||(t.ReferencesRequest=K={}));var U;(function(me){me.method="textDocument/documentHighlight",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(U||(t.DocumentHighlightRequest=U={}));var Y;(function(me){me.method="textDocument/documentSymbol",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Y||(t.DocumentSymbolRequest=Y={}));var fe;(function(me){me.method="textDocument/codeAction",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(fe||(t.CodeActionRequest=fe={}));var ue;(function(me){me.method="codeAction/resolve",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(ue||(t.CodeActionResolveRequest=ue={}));var Te;(function(me){me.method="workspace/symbol",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Te||(t.WorkspaceSymbolRequest=Te={}));var ge;(function(me){me.method="workspaceSymbol/resolve",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(ge||(t.WorkspaceSymbolResolveRequest=ge={}));var we;(function(me){me.method="textDocument/codeLens",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(we||(t.CodeLensRequest=we={}));var xe;(function(me){me.method="codeLens/resolve",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(xe||(t.CodeLensResolveRequest=xe={}));var Le;(function(me){me.method="workspace/codeLens/refresh",me.messageDirection=e.MessageDirection.serverToClient,me.type=new e.ProtocolRequestType0(me.method)})(Le||(t.CodeLensRefreshRequest=Le={}));var _e;(function(me){me.method="textDocument/documentLink",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(_e||(t.DocumentLinkRequest=_e={}));var Be;(function(me){me.method="documentLink/resolve",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Be||(t.DocumentLinkResolveRequest=Be={}));var Ee;(function(me){me.method="textDocument/formatting",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Ee||(t.DocumentFormattingRequest=Ee={}));var Xe;(function(me){me.method="textDocument/rangeFormatting",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Xe||(t.DocumentRangeFormattingRequest=Xe={}));var Re;(function(me){me.method="textDocument/rangesFormatting",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Re||(t.DocumentRangesFormattingRequest=Re={}));var Qe;(function(me){me.method="textDocument/onTypeFormatting",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Qe||(t.DocumentOnTypeFormattingRequest=Qe={}));var it;(function(me){me.Identifier=1})(it||(t.PrepareSupportDefaultBehavior=it={}));var Ue;(function(me){me.method="textDocument/rename",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(Ue||(t.RenameRequest=Ue={}));var mt;(function(me){me.method="textDocument/prepareRename",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(mt||(t.PrepareRenameRequest=mt={}));var ot;(function(me){me.method="workspace/executeCommand",me.messageDirection=e.MessageDirection.clientToServer,me.type=new e.ProtocolRequestType(me.method)})(ot||(t.ExecuteCommandRequest=ot={}));var Ke;(function(me){me.method="workspace/applyEdit",me.messageDirection=e.MessageDirection.serverToClient,me.type=new e.ProtocolRequestType("workspace/applyEdit")})(Ke||(t.ApplyWorkspaceEditRequest=Ke={}))}}),fVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=Tv();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}k(r,"createProtocolConnection"),t.createProtocolConnection=r}}),pVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:k(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(Tv(),t),r((rT(),q$(Ik)),t),r(wn(),t),r(dVe(),t);var n=fVe();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:k(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),gVe=or({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:k(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=KV();r(KV(),t),r(pVe(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}k(i,"createProtocolConnection"),t.createProtocolConnection=i}}),qne={};gu(qne,{AbstractAstReflection:()=>X$,AbstractCstNode:()=>K6,AbstractLangiumParser:()=>Q6,AbstractParserErrorMessageProvider:()=>Ife,AbstractThreadedAsyncParser:()=>FJe,AstUtils:()=>j$,BiMap:()=>ZE,Cancellation:()=>en,CompositeCstNodeImpl:()=>A_,ContextCache:()=>O_,CstNodeBuilder:()=>Afe,CstUtils:()=>H$,DEFAULT_TOKENIZE_OPTIONS:()=>mB,DONE_RESULT:()=>ra,DatatypeSymbol:()=>YE,DefaultAstNodeDescriptionProvider:()=>ope,DefaultAstNodeLocator:()=>cpe,DefaultAsyncParser:()=>_pe,DefaultCommentProvider:()=>kpe,DefaultConfigurationProvider:()=>upe,DefaultDocumentBuilder:()=>hpe,DefaultDocumentValidator:()=>spe,DefaultHydrator:()=>Rpe,DefaultIndexManager:()=>dpe,DefaultJsonSerializer:()=>rpe,DefaultLangiumDocumentFactory:()=>Yfe,DefaultLangiumDocuments:()=>Xfe,DefaultLangiumProfiler:()=>qJe,DefaultLexer:()=>yB,DefaultLexerErrorMessageProvider:()=>ppe,DefaultLinker:()=>jfe,DefaultNameProvider:()=>Kfe,DefaultReferenceDescriptionProvider:()=>lpe,DefaultReferences:()=>Zfe,DefaultScopeComputation:()=>Qfe,DefaultScopeProvider:()=>tpe,DefaultServiceRegistry:()=>npe,DefaultTokenBuilder:()=>I_,DefaultValueConverter:()=>aB,DefaultWorkspaceLock:()=>Ape,DefaultWorkspaceManager:()=>fpe,Deferred:()=>Yl,Disposable:()=>Mh,DisposableCache:()=>N_,DocumentCache:()=>epe,DocumentState:()=>yr,DocumentValidator:()=>ms,EMPTY_SCOPE:()=>OJe,EMPTY_STREAM:()=>O0,EmptyFileSystem:()=>Oi,EmptyFileSystemProvider:()=>Dpe,ErrorWithLocation:()=>Gk,GrammarAST:()=>Yne,GrammarUtils:()=>SP,IndentationAwareLexer:()=>GJe,IndentationAwareTokenBuilder:()=>Ipe,JSDocDocumentationProvider:()=>Spe,LangiumCompletionParser:()=>Dfe,LangiumParser:()=>Lfe,LangiumParserErrorMessageProvider:()=>J6,LeafCstNodeImpl:()=>HE,LexingMode:()=>Ah,MapScope:()=>NJe,Module:()=>kD,MultiMap:()=>Xl,MultiMapScope:()=>Jfe,OperationCancelled:()=>Lo,ParserWorker:()=>zJe,ProfilingTask:()=>Npe,Reduction:()=>eb,RefResolving:()=>Zu,RegExpUtils:()=>_P,RootCstNodeImpl:()=>Z6,SimpleCache:()=>hB,StreamImpl:()=>Ro,StreamScope:()=>CD,TextDocument:()=>jE,TreeStreamImpl:()=>$0,URI:()=>es,UriTrie:()=>cB,UriUtils:()=>sa,VALIDATE_EACH_NODE:()=>ape,ValidationCategory:()=>QE,ValidationRegistry:()=>ipe,ValueConverter:()=>Eo,WorkspaceCache:()=>dB,assertCondition:()=>kP,assertUnreachable:()=>mu,createCompletionParser:()=>rB,createDefaultCoreModule:()=>mi,createDefaultSharedCoreModule:()=>yi,createGrammarConfig:()=>UP,createLangiumParser:()=>nB,createParser:()=>R_,delayNextTick:()=>D_,diagnosticData:()=>_h,eagerLoad:()=>EB,getDiagnosticRange:()=>pB,indentationBuilderDefaultOptions:()=>AD,inject:()=>kr,interruptAndCheck:()=>oi,isAstNode:()=>Vn,isAstNodeDescription:()=>Y$,isAstNodeWithComment:()=>fB,isCompositeCstNode:()=>Fl,isIMultiModeLexerDefinition:()=>B_,isJSDoc:()=>xB,isLeafCstNode:()=>Ed,isLinkingError:()=>ah,isMultiReference:()=>$o,isNamed:()=>uB,isOperationCancelled:()=>Wd,isReference:()=>aa,isRootCstNode:()=>Mk,isTokenTypeArray:()=>P_,isTokenTypeDictionary:()=>JE,loadGrammarFromJson:()=>vi,parseJSDoc:()=>vB,prepareLangiumParser:()=>iB,setInterruptionPeriod:()=>sB,startCancelableOperation:()=>M_,stream:()=>Wr,toDiagnosticData:()=>gB,toDiagnosticSeverity:()=>bx});var H$={};gu(H$,{DefaultNameRegexp:()=>bP,RangeComparison:()=>ko,compareRange:()=>vP,findCommentNode:()=>TP,findDeclarationNodeAtOffset:()=>die,findLeafNodeAtOffset:()=>zk,findLeafNodeBeforeOffset:()=>CP,flattenCst:()=>hie,getDatatypeNode:()=>uie,getInteriorNodes:()=>gie,getNextNode:()=>fie,getPreviousNode:()=>EP,getStartlineNode:()=>pie,inRange:()=>xP,isChildNode:()=>yP,isCommentNode:()=>LE,streamCst:()=>z0,toDocumentSegment:()=>G0,tokenToRange:()=>tb});function Vn(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}k(Vn,"isAstNode");function aa(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}k(aa,"isReference");function $o(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}k($o,"isMultiReference");function Y$(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}k(Y$,"isAstNodeDescription");function ah(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}k(ah,"isLinkingError");var Up,X$=(Up=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Vn(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},k(Up,"AbstractAstReflection"),Up);function Fl(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}k(Fl,"isCompositeCstNode");function Ed(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}k(Ed,"isLeafCstNode");function Mk(t){return Fl(t)&&typeof t.fullText=="string"}k(Mk,"isRootCstNode");var La,Ro=(La=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:k(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new La(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return ra})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Une(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new La(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ra:{done:!1,value:e(i)}})}filter(e){return new La(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ra})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new La(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Jx(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ra})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new La(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Jx(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ra})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new La(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ra:this.nextFn(r.state)))}distinct(e){return new La(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return ra})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},k(La,"StreamImpl"),La);function Une(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}k(Une,"toString");function Jx(t){return!!t&&typeof t[Symbol.iterator]=="function"}k(Jx,"isIterable");var O0=new Ro(()=>{},()=>ra),ra=Object.freeze({done:!0,value:void 0});function Wr(...t){if(t.length===1){const e=t[0];if(e instanceof Ro)return e;if(Jx(e))return new Ro(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Ro(()=>({index:0}),r=>r.index1?new Ro(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return ra})}iterator(){const e={state:this.startFn(),next:k(()=>this.nextFn(e.state),"next"),prune:k(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},k(Hp,"TreeStreamImpl"),Hp),eb;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}k(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}k(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}k(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}k(i,"max"),t.max=i})(eb||(eb={}));var j$={};gu(j$,{assignMandatoryProperties:()=>K$,copyAstNode:()=>mE,findRootNode:()=>yp,getContainerOfType:()=>Sd,getDocument:()=>Zs,getReferenceNodes:()=>pE,hasContainerOfType:()=>Hne,linkContentToContainer:()=>P0,streamAllContents:()=>ic,streamAst:()=>Qs,streamContents:()=>iT,streamReferences:()=>B0});function P0(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Vn(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&P0(i,e))}):Vn(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&P0(n,e)))}k(P0,"linkContentToContainer");function Sd(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}k(Sd,"getContainerOfType");function Hne(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}k(Hne,"hasContainerOfType");function Zs(t){const r=yp(t).$document;if(!r)throw new Error("AST node has no document.");return r}k(Zs,"getDocument");function yp(t){for(;t.$container;)t=t.$container;return t}k(yp,"findRootNode");function pE(t){return aa(t)?t.ref?[t.ref]:[]:$o(t)?t.items.map(e=>e.ref):[]}k(pE,"getReferenceNodes");function iT(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Ro(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexiT(r,e))}k(ic,"streamAllContents");function Qs(t,e){if(t){if(e!=null&&e.range&&!gE(t,e.range))return new $0(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new $0(t,r=>iT(r,e),{includeRoot:!0})}k(Qs,"streamAst");function gE(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?xP(r,e):!1}k(gE,"isAstNodeInRange");function B0(t){return new Ro(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexka,AbstractParserRule:()=>sx,AbstractRule:()=>Yf,AbstractType:()=>Xa,Action:()=>bc,Alternatives:()=>ox,ArrayLiteral:()=>yE,ArrayType:()=>vE,Assignment:()=>Tc,BooleanLiteral:()=>xE,CharacterRange:()=>Cc,Condition:()=>wc,Conjunction:()=>lx,CrossReference:()=>Ec,Disjunction:()=>cx,EndOfFile:()=>bE,Grammar:()=>ml,GrammarImport:()=>TE,Group:()=>sh,InferredType:()=>CE,InfixRule:()=>bo,InfixRuleOperatorList:()=>ux,InfixRuleOperators:()=>wE,Interface:()=>Xf,Keyword:()=>jf,LangiumGrammarAstReflection:()=>mP,LangiumGrammarTerminals:()=>mVe,NamedArgument:()=>Kf,NegatedToken:()=>oh,Negation:()=>EE,NumberLiteral:()=>SE,Parameter:()=>Zf,ParameterReference:()=>kE,ParserRule:()=>Ns,ReferenceType:()=>hx,RegexToken:()=>lh,ReturnType:()=>_E,RuleCall:()=>ch,SimpleType:()=>Qf,StringLiteral:()=>AE,TerminalAlternatives:()=>uh,TerminalElement:()=>_a,TerminalGroup:()=>hh,TerminalRule:()=>yl,TerminalRuleCall:()=>dh,Type:()=>dx,TypeAttribute:()=>fh,TypeDefinition:()=>ph,UnionType:()=>RE,UnorderedGroup:()=>fx,UntilToken:()=>gh,ValueLiteral:()=>mh,Wildcard:()=>Jf,isAbstractElement:()=>Nk,isAbstractParserRule:()=>kd,isAbstractRule:()=>Xne,isAbstractType:()=>jne,isAction:()=>Jc,isAlternatives:()=>Ok,isArrayLiteral:()=>Kne,isArrayType:()=>Q$,isAssignment:()=>zl,isBooleanLiteral:()=>J$,isCharacterRange:()=>eP,isCondition:()=>Zne,isConjunction:()=>tP,isCrossReference:()=>_d,isDisjunction:()=>rP,isEndOfFile:()=>nP,isGrammar:()=>Qne,isGrammarImport:()=>Jne,isGroup:()=>Ad,isInferredType:()=>aT,isInfixRule:()=>F0,isInfixRuleOperatorList:()=>eie,isInfixRuleOperators:()=>tie,isInterface:()=>iP,isKeyword:()=>Gl,isNamedArgument:()=>rie,isNegatedToken:()=>aP,isNegation:()=>sP,isNumberLiteral:()=>nie,isParameter:()=>iie,isParameterReference:()=>oP,isParserRule:()=>ha,isReferenceType:()=>lP,isRegexToken:()=>cP,isReturnType:()=>uP,isRuleCall:()=>Vl,isSimpleType:()=>$k,isStringLiteral:()=>aie,isTerminalAlternatives:()=>hP,isTerminalElement:()=>sie,isTerminalGroup:()=>dP,isTerminalRule:()=>_s,isTerminalRuleCall:()=>Pk,isType:()=>Bk,isTypeAttribute:()=>oie,isTypeDefinition:()=>lie,isUnionType:()=>fP,isUnorderedGroup:()=>Fk,isUntilToken:()=>pP,isValueLiteral:()=>cie,isWildcard:()=>gP,reflection:()=>Ht});var mVe={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ka={$type:"AbstractElement",cardinality:"cardinality"};function Nk(t){return Ht.isInstance(t,ka.$type)}k(Nk,"isAbstractElement");var sx={$type:"AbstractParserRule"};function kd(t){return Ht.isInstance(t,sx.$type)}k(kd,"isAbstractParserRule");var Yf={$type:"AbstractRule"};function Xne(t){return Ht.isInstance(t,Yf.$type)}k(Xne,"isAbstractRule");var Xa={$type:"AbstractType"};function jne(t){return Ht.isInstance(t,Xa.$type)}k(jne,"isAbstractType");var bc={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Jc(t){return Ht.isInstance(t,bc.$type)}k(Jc,"isAction");var ox={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Ok(t){return Ht.isInstance(t,ox.$type)}k(Ok,"isAlternatives");var yE={$type:"ArrayLiteral",elements:"elements"};function Kne(t){return Ht.isInstance(t,yE.$type)}k(Kne,"isArrayLiteral");var vE={$type:"ArrayType",elementType:"elementType"};function Q$(t){return Ht.isInstance(t,vE.$type)}k(Q$,"isArrayType");var Tc={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function zl(t){return Ht.isInstance(t,Tc.$type)}k(zl,"isAssignment");var xE={$type:"BooleanLiteral",true:"true"};function J$(t){return Ht.isInstance(t,xE.$type)}k(J$,"isBooleanLiteral");var Cc={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function eP(t){return Ht.isInstance(t,Cc.$type)}k(eP,"isCharacterRange");var wc={$type:"Condition"};function Zne(t){return Ht.isInstance(t,wc.$type)}k(Zne,"isCondition");var lx={$type:"Conjunction",left:"left",right:"right"};function tP(t){return Ht.isInstance(t,lx.$type)}k(tP,"isConjunction");var Ec={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function _d(t){return Ht.isInstance(t,Ec.$type)}k(_d,"isCrossReference");var cx={$type:"Disjunction",left:"left",right:"right"};function rP(t){return Ht.isInstance(t,cx.$type)}k(rP,"isDisjunction");var bE={$type:"EndOfFile",cardinality:"cardinality"};function nP(t){return Ht.isInstance(t,bE.$type)}k(nP,"isEndOfFile");var ml={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function Qne(t){return Ht.isInstance(t,ml.$type)}k(Qne,"isGrammar");var TE={$type:"GrammarImport",path:"path"};function Jne(t){return Ht.isInstance(t,TE.$type)}k(Jne,"isGrammarImport");var sh={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Ad(t){return Ht.isInstance(t,sh.$type)}k(Ad,"isGroup");var CE={$type:"InferredType",name:"name"};function aT(t){return Ht.isInstance(t,CE.$type)}k(aT,"isInferredType");var bo={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function F0(t){return Ht.isInstance(t,bo.$type)}k(F0,"isInfixRule");var ux={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function eie(t){return Ht.isInstance(t,ux.$type)}k(eie,"isInfixRuleOperatorList");var wE={$type:"InfixRuleOperators",precedences:"precedences"};function tie(t){return Ht.isInstance(t,wE.$type)}k(tie,"isInfixRuleOperators");var Xf={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function iP(t){return Ht.isInstance(t,Xf.$type)}k(iP,"isInterface");var jf={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Gl(t){return Ht.isInstance(t,jf.$type)}k(Gl,"isKeyword");var Kf={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function rie(t){return Ht.isInstance(t,Kf.$type)}k(rie,"isNamedArgument");var oh={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function aP(t){return Ht.isInstance(t,oh.$type)}k(aP,"isNegatedToken");var EE={$type:"Negation",value:"value"};function sP(t){return Ht.isInstance(t,EE.$type)}k(sP,"isNegation");var SE={$type:"NumberLiteral",value:"value"};function nie(t){return Ht.isInstance(t,SE.$type)}k(nie,"isNumberLiteral");var Zf={$type:"Parameter",name:"name"};function iie(t){return Ht.isInstance(t,Zf.$type)}k(iie,"isParameter");var kE={$type:"ParameterReference",parameter:"parameter"};function oP(t){return Ht.isInstance(t,kE.$type)}k(oP,"isParameterReference");var Ns={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function ha(t){return Ht.isInstance(t,Ns.$type)}k(ha,"isParserRule");var hx={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function lP(t){return Ht.isInstance(t,hx.$type)}k(lP,"isReferenceType");var lh={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function cP(t){return Ht.isInstance(t,lh.$type)}k(cP,"isRegexToken");var _E={$type:"ReturnType",name:"name"};function uP(t){return Ht.isInstance(t,_E.$type)}k(uP,"isReturnType");var ch={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Vl(t){return Ht.isInstance(t,ch.$type)}k(Vl,"isRuleCall");var Qf={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function $k(t){return Ht.isInstance(t,Qf.$type)}k($k,"isSimpleType");var AE={$type:"StringLiteral",value:"value"};function aie(t){return Ht.isInstance(t,AE.$type)}k(aie,"isStringLiteral");var uh={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function hP(t){return Ht.isInstance(t,uh.$type)}k(hP,"isTerminalAlternatives");var _a={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function sie(t){return Ht.isInstance(t,_a.$type)}k(sie,"isTerminalElement");var hh={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function dP(t){return Ht.isInstance(t,hh.$type)}k(dP,"isTerminalGroup");var yl={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function _s(t){return Ht.isInstance(t,yl.$type)}k(_s,"isTerminalRule");var dh={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Pk(t){return Ht.isInstance(t,dh.$type)}k(Pk,"isTerminalRuleCall");var dx={$type:"Type",name:"name",type:"type"};function Bk(t){return Ht.isInstance(t,dx.$type)}k(Bk,"isType");var fh={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function oie(t){return Ht.isInstance(t,fh.$type)}k(oie,"isTypeAttribute");var ph={$type:"TypeDefinition"};function lie(t){return Ht.isInstance(t,ph.$type)}k(lie,"isTypeDefinition");var RE={$type:"UnionType",types:"types"};function fP(t){return Ht.isInstance(t,RE.$type)}k(fP,"isUnionType");var fx={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Fk(t){return Ht.isInstance(t,fx.$type)}k(Fk,"isUnorderedGroup");var gh={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function pP(t){return Ht.isInstance(t,gh.$type)}k(pP,"isUntilToken");var mh={$type:"ValueLiteral"};function cie(t){return Ht.isInstance(t,mh.$type)}k(cie,"isValueLiteral");var Jf={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function gP(t){return Ht.isInstance(t,Jf.$type)}k(gP,"isWildcard");var Yp,mP=(Yp=class extends X${constructor(){super(...arguments),this.types={AbstractElement:{name:ka.$type,properties:{cardinality:{name:ka.cardinality}},superTypes:[]},AbstractParserRule:{name:sx.$type,properties:{},superTypes:[Yf.$type,Xa.$type]},AbstractRule:{name:Yf.$type,properties:{},superTypes:[]},AbstractType:{name:Xa.$type,properties:{},superTypes:[]},Action:{name:bc.$type,properties:{cardinality:{name:bc.cardinality},feature:{name:bc.feature},inferredType:{name:bc.inferredType},operator:{name:bc.operator},type:{name:bc.type,referenceType:Xa.$type}},superTypes:[ka.$type]},Alternatives:{name:ox.$type,properties:{cardinality:{name:ox.cardinality},elements:{name:ox.elements,defaultValue:[]}},superTypes:[ka.$type]},ArrayLiteral:{name:yE.$type,properties:{elements:{name:yE.elements,defaultValue:[]}},superTypes:[mh.$type]},ArrayType:{name:vE.$type,properties:{elementType:{name:vE.elementType}},superTypes:[ph.$type]},Assignment:{name:Tc.$type,properties:{cardinality:{name:Tc.cardinality},feature:{name:Tc.feature},operator:{name:Tc.operator},predicate:{name:Tc.predicate},terminal:{name:Tc.terminal}},superTypes:[ka.$type]},BooleanLiteral:{name:xE.$type,properties:{true:{name:xE.true,defaultValue:!1}},superTypes:[wc.$type,mh.$type]},CharacterRange:{name:Cc.$type,properties:{cardinality:{name:Cc.cardinality},left:{name:Cc.left},lookahead:{name:Cc.lookahead},parenthesized:{name:Cc.parenthesized,defaultValue:!1},right:{name:Cc.right}},superTypes:[_a.$type]},Condition:{name:wc.$type,properties:{},superTypes:[]},Conjunction:{name:lx.$type,properties:{left:{name:lx.left},right:{name:lx.right}},superTypes:[wc.$type]},CrossReference:{name:Ec.$type,properties:{cardinality:{name:Ec.cardinality},deprecatedSyntax:{name:Ec.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ec.isMulti,defaultValue:!1},terminal:{name:Ec.terminal},type:{name:Ec.type,referenceType:Xa.$type}},superTypes:[ka.$type]},Disjunction:{name:cx.$type,properties:{left:{name:cx.left},right:{name:cx.right}},superTypes:[wc.$type]},EndOfFile:{name:bE.$type,properties:{cardinality:{name:bE.cardinality}},superTypes:[ka.$type]},Grammar:{name:ml.$type,properties:{imports:{name:ml.imports,defaultValue:[]},interfaces:{name:ml.interfaces,defaultValue:[]},isDeclared:{name:ml.isDeclared,defaultValue:!1},name:{name:ml.name},rules:{name:ml.rules,defaultValue:[]},types:{name:ml.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:TE.$type,properties:{path:{name:TE.path}},superTypes:[]},Group:{name:sh.$type,properties:{cardinality:{name:sh.cardinality},elements:{name:sh.elements,defaultValue:[]},guardCondition:{name:sh.guardCondition},predicate:{name:sh.predicate}},superTypes:[ka.$type]},InferredType:{name:CE.$type,properties:{name:{name:CE.name}},superTypes:[Xa.$type]},InfixRule:{name:bo.$type,properties:{call:{name:bo.call},dataType:{name:bo.dataType},inferredType:{name:bo.inferredType},name:{name:bo.name},operators:{name:bo.operators},parameters:{name:bo.parameters,defaultValue:[]},returnType:{name:bo.returnType,referenceType:Xa.$type}},superTypes:[sx.$type]},InfixRuleOperatorList:{name:ux.$type,properties:{associativity:{name:ux.associativity},operators:{name:ux.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:wE.$type,properties:{precedences:{name:wE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Xf.$type,properties:{attributes:{name:Xf.attributes,defaultValue:[]},name:{name:Xf.name},superTypes:{name:Xf.superTypes,defaultValue:[],referenceType:Xa.$type}},superTypes:[Xa.$type]},Keyword:{name:jf.$type,properties:{cardinality:{name:jf.cardinality},predicate:{name:jf.predicate},value:{name:jf.value}},superTypes:[ka.$type]},NamedArgument:{name:Kf.$type,properties:{calledByName:{name:Kf.calledByName,defaultValue:!1},parameter:{name:Kf.parameter,referenceType:Zf.$type},value:{name:Kf.value}},superTypes:[]},NegatedToken:{name:oh.$type,properties:{cardinality:{name:oh.cardinality},lookahead:{name:oh.lookahead},parenthesized:{name:oh.parenthesized,defaultValue:!1},terminal:{name:oh.terminal}},superTypes:[_a.$type]},Negation:{name:EE.$type,properties:{value:{name:EE.value}},superTypes:[wc.$type]},NumberLiteral:{name:SE.$type,properties:{value:{name:SE.value}},superTypes:[mh.$type]},Parameter:{name:Zf.$type,properties:{name:{name:Zf.name}},superTypes:[]},ParameterReference:{name:kE.$type,properties:{parameter:{name:kE.parameter,referenceType:Zf.$type}},superTypes:[wc.$type]},ParserRule:{name:Ns.$type,properties:{dataType:{name:Ns.dataType},definition:{name:Ns.definition},entry:{name:Ns.entry,defaultValue:!1},fragment:{name:Ns.fragment,defaultValue:!1},inferredType:{name:Ns.inferredType},name:{name:Ns.name},parameters:{name:Ns.parameters,defaultValue:[]},returnType:{name:Ns.returnType,referenceType:Xa.$type}},superTypes:[sx.$type]},ReferenceType:{name:hx.$type,properties:{isMulti:{name:hx.isMulti,defaultValue:!1},referenceType:{name:hx.referenceType}},superTypes:[ph.$type]},RegexToken:{name:lh.$type,properties:{cardinality:{name:lh.cardinality},lookahead:{name:lh.lookahead},parenthesized:{name:lh.parenthesized,defaultValue:!1},regex:{name:lh.regex}},superTypes:[_a.$type]},ReturnType:{name:_E.$type,properties:{name:{name:_E.name}},superTypes:[]},RuleCall:{name:ch.$type,properties:{arguments:{name:ch.arguments,defaultValue:[]},cardinality:{name:ch.cardinality},predicate:{name:ch.predicate},rule:{name:ch.rule,referenceType:Yf.$type}},superTypes:[ka.$type]},SimpleType:{name:Qf.$type,properties:{primitiveType:{name:Qf.primitiveType},stringType:{name:Qf.stringType},typeRef:{name:Qf.typeRef,referenceType:Xa.$type}},superTypes:[ph.$type]},StringLiteral:{name:AE.$type,properties:{value:{name:AE.value}},superTypes:[mh.$type]},TerminalAlternatives:{name:uh.$type,properties:{cardinality:{name:uh.cardinality},elements:{name:uh.elements,defaultValue:[]},lookahead:{name:uh.lookahead},parenthesized:{name:uh.parenthesized,defaultValue:!1}},superTypes:[_a.$type]},TerminalElement:{name:_a.$type,properties:{cardinality:{name:_a.cardinality},lookahead:{name:_a.lookahead},parenthesized:{name:_a.parenthesized,defaultValue:!1}},superTypes:[ka.$type]},TerminalGroup:{name:hh.$type,properties:{cardinality:{name:hh.cardinality},elements:{name:hh.elements,defaultValue:[]},lookahead:{name:hh.lookahead},parenthesized:{name:hh.parenthesized,defaultValue:!1}},superTypes:[_a.$type]},TerminalRule:{name:yl.$type,properties:{definition:{name:yl.definition},fragment:{name:yl.fragment,defaultValue:!1},hidden:{name:yl.hidden,defaultValue:!1},name:{name:yl.name},type:{name:yl.type}},superTypes:[Yf.$type]},TerminalRuleCall:{name:dh.$type,properties:{cardinality:{name:dh.cardinality},lookahead:{name:dh.lookahead},parenthesized:{name:dh.parenthesized,defaultValue:!1},rule:{name:dh.rule,referenceType:yl.$type}},superTypes:[_a.$type]},Type:{name:dx.$type,properties:{name:{name:dx.name},type:{name:dx.type}},superTypes:[Xa.$type]},TypeAttribute:{name:fh.$type,properties:{defaultValue:{name:fh.defaultValue},isOptional:{name:fh.isOptional,defaultValue:!1},name:{name:fh.name},type:{name:fh.type}},superTypes:[]},TypeDefinition:{name:ph.$type,properties:{},superTypes:[]},UnionType:{name:RE.$type,properties:{types:{name:RE.types,defaultValue:[]}},superTypes:[ph.$type]},UnorderedGroup:{name:fx.$type,properties:{cardinality:{name:fx.cardinality},elements:{name:fx.elements,defaultValue:[]}},superTypes:[ka.$type]},UntilToken:{name:gh.$type,properties:{cardinality:{name:gh.cardinality},lookahead:{name:gh.lookahead},parenthesized:{name:gh.parenthesized,defaultValue:!1},terminal:{name:gh.terminal}},superTypes:[_a.$type]},ValueLiteral:{name:mh.$type,properties:{},superTypes:[]},Wildcard:{name:Jf.$type,properties:{cardinality:{name:Jf.cardinality},lookahead:{name:Jf.lookahead},parenthesized:{name:Jf.parenthesized,defaultValue:!1}},superTypes:[_a.$type]}}}},k(Yp,"LangiumGrammarAstReflection"),Yp),Ht=new mP;function uie(t){let e=t,r=!1;for(;e;){const n=Sd(e.grammarSource,ha);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}k(uie,"getDatatypeNode");function z0(t){return new $0(t,e=>Fl(e)?e.content:[],{includeRoot:!0})}k(z0,"streamCst");function hie(t){return z0(t).filter(Ed)}k(hie,"flattenCst");function yP(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}k(yP,"isChildNode");function tb(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}k(tb,"tokenToRange");function G0(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}k(G0,"toDocumentSegment");var ko;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(ko||(ko={}));function vP(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return ko.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineko.After}k(xP,"inRange");var bP=/^[\w\p{L}]$/u;function die(t,e,r=bP){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return zk(t,e)}}k(die,"findDeclarationNodeAtOffset");function TP(t,e){if(t){const r=EP(t,!0);if(r&&LE(r,e))return r;if(Mk(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(LE(a,e))return a}}}}k(TP,"findCommentNode");function LE(t,e){return Ed(t)&&e.includes(t.tokenType.name)}k(LE,"isCommentNode");function zk(t,e){if(Ed(t))return t;if(Fl(t)){const r=wP(t,e,!1);if(r)return zk(r,e)}}k(zk,"findLeafNodeAtOffset");function CP(t,e){if(Ed(t))return t;if(Fl(t)){const r=wP(t,e,!0);if(r)return CP(r,e)}}k(CP,"findLeafNodeBeforeOffset");function wP(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}k(wP,"binarySearch");function EP(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}k(EP,"getPreviousNode");function fie(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nBP,findNameAssignment:()=>Xk,findNodeForKeyword:()=>PP,findNodeForProperty:()=>Uk,findNodesForKeyword:()=>Eie,findNodesForKeywordInternal:()=>Yk,findNodesForProperty:()=>$P,getActionAtElement:()=>zP,getActionType:()=>VP,getAllReachableRules:()=>qk,getAllRulesUsedForCrossReferences:()=>wie,getCrossReferenceTerminal:()=>NP,getEntryRule:()=>IP,getExplicitRuleType:()=>oT,getHiddenRules:()=>DP,getRuleType:()=>WP,getRuleTypeName:()=>Rie,getTypeName:()=>rd,isArrayCardinality:()=>kie,isArrayOperator:()=>_ie,isCommentTerminal:()=>OP,isDataType:()=>Aie,isDataTypeRule:()=>sT,isOptionalCardinality:()=>Sie,terminalRegex:()=>lT});var Xp,Gk=(Xp=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},k(Xp,"ErrorWithLocation"),Xp);function mu(t,e="Error: Got unexpected value."){throw new Error(e)}k(mu,"assertUnreachable");function kP(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}k(kP,"assertCondition");var _P={};gu(_P,{NEWLINE_REGEXP:()=>xie,escapeRegExp:()=>Cv,getTerminalParts:()=>Tie,isMultilineComment:()=>AP,isWhitespace:()=>Wk,partialMatches:()=>RP,partialRegExp:()=>LP,whitespaceCharacters:()=>Cie});function Zt(t){return t.charCodeAt(0)}k(Zt,"cc");function CC(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}k(CC,"insertToSet");function Ef(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}k(Ef,"addFlag");function Xu(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}k(Xu,"ASSERT_EXISTS");function yie(){throw Error("Internal Error - Should never get here!")}k(yie,"ASSERT_NEVER_REACH_HERE");function X4(t){return t.type==="Character"}k(X4,"isCharacter");var IE=[];for(let t=Zt("0");t<=Zt("9");t++)IE.push(t);var DE=[Zt("_")].concat(IE);for(let t=Zt("a");t<=Zt("z");t++)DE.push(t);for(let t=Zt("A");t<=Zt("Z");t++)DE.push(t);var ZV=[Zt(" "),Zt("\f"),Zt(` `),Zt("\r"),Zt(" "),Zt("\v"),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt(" "),Zt("\u2028"),Zt("\u2029"),Zt(" "),Zt(" "),Zt(" "),Zt("\uFEFF")],yVe=/[0-9a-fA-F]/,l2=/[0-9]/,vVe=/[1-9]/,jp,vie=(jp=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ef(n,"global");break;case"i":Ef(n,"ignoreCase");break;case"m":Ef(n,"multiLine");break;case"u":Ef(n,"unicode");break;case"y":Ef(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}Xu(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return yie()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Xu(r);break}if(!(e===!0&&r===void 0)&&Xu(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Xu(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Zt(` `),Zt("\r"),Zt("\u2028"),Zt("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=IE;break;case"D":e=IE,r=!0;break;case"s":e=ZV;break;case"S":e=ZV,r=!0;break;case"w":e=DE;break;case"W":e=DE,r=!0;break}if(Xu(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Zt("\f");break;case"n":e=Zt(` `);break;case"r":e=Zt("\r");break;case"t":e=Zt(" ");break;case"v":e=Zt("\v");break}if(Xu(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Zt("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Zt(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Zt(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,X4(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,X4(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},k(jp,"RegExpParser"),jp),Kp,Vk=(Kp=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},k(Kp,"BaseRegExpVisitor"),Kp),xie=/\r?\n/gm,bie=new vie,Zp,xVe=(Zp=class extends Vk{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=Cv(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},k(Zp,"TerminalRegExpVisitor"),Zp),Sh=new xVe;function Tie(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=bie.pattern(t),r=[];for(const n of e.value.value)Sh.reset(t),Sh.visit(n),r.push({start:Sh.startRegexp,end:Sh.endRegex});return r}catch{return[]}}k(Tie,"getTerminalParts");function AP(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Sh.reset(t),Sh.visit(bie.pattern(t)),Sh.multiline}catch{return!1}}k(AP,"isMultilineComment");var Cie=`\f \r \v              \u2028\u2029   \uFEFF`.split("");function Wk(t){const e=typeof t=="string"?new RegExp(t):t;return Cie.some(r=>e.test(r))}k(Wk,"isWhitespace");function Cv(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}k(Cv,"escapeRegExp");function RP(t,e){const r=LP(t),n=e.match(r);return!!n&&n[0].length>0}k(RP,"partialMatches");function LP(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}k(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(k(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return k(i,"process"),new RegExp(i(),t.flags)}k(LP,"partialRegExp");function IP(t){return t.rules.find(e=>ha(e)&&e.entry)}k(IP,"getEntryRule");function DP(t){return t.rules.filter(e=>_s(e)&&e.hidden)}k(DP,"getHiddenRules");function qk(t,e){const r=new Set,n=IP(t);if(!n)return new Set(t.rules);const i=[n].concat(DP(t));for(const s of i)MP(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||_s(s)&&s.hidden)&&a.add(s);return a}k(qk,"getAllReachableRules");function MP(t,e,r){e.add(t.name),ic(t).forEach(n=>{if(Vl(n)||r&&Pk(n)){const i=n.rule.ref;i&&!e.has(i.name)&&MP(i,e,r)}})}k(MP,"ruleDfs");function wie(t){const e=new Set;return ic(t).forEach(r=>{_d(r)&&(ha(r.type.ref)&&e.add(r.type.ref),aT(r.type.ref)&&ha(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}k(wie,"getAllRulesUsedForCrossReferences");function NP(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Xk(t.type.ref);return e==null?void 0:e.terminal}}k(NP,"getCrossReferenceTerminal");function OP(t){return t.hidden&&!Wk(lT(t))}k(OP,"isCommentTerminal");function $P(t,e){return!t||!e?[]:Hk(t,e,t.astNode,!0)}k($P,"findNodesForProperty");function Uk(t,e,r){if(!t||!e)return;const n=Hk(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}k(Uk,"findNodeForProperty");function Hk(t,e,r,n){if(!n){const i=Sd(t.grammarSource,zl);if(i&&i.feature===e)return[t]}return Fl(t)&&t.astNode===r?t.content.flatMap(i=>Hk(i,e,r,!1)):[]}k(Hk,"findNodesForPropertyInternal");function Eie(t,e){return t?Yk(t,e,t==null?void 0:t.astNode):[]}k(Eie,"findNodesForKeyword");function PP(t,e,r){if(!t)return;const n=Yk(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}k(PP,"findNodeForKeyword");function Yk(t,e,r){if(t.astNode!==r)return[];if(Gl(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=z0(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Gl(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}k(Yk,"findNodesForKeywordInternal");function BP(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=Sd(t.grammarSource,zl);if(n)return n;t=t.container}}k(BP,"findAssignment");function Xk(t){let e=t;return aT(e)&&(Jc(e.$container)?e=e.$container.$container:kd(e.$container)?e=e.$container:mu(e.$container)),FP(t,e,new Map)}k(Xk,"findNameAssignment");function FP(t,e,r){var i;function n(a,s){let o;return Sd(a,zl)||(o=FP(s,s,r)),r.set(t,o),o}if(k(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of ic(e)){if(zl(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Vl(a)&&ha(a.rule.ref))return n(a,a.rule.ref);if($k(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}k(FP,"findNameAssignmentInternal");function zP(t){const e=t.$container;if(Ad(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(Jc(a))return a;{const s=ic(r[i]).find(Jc);if(s)return s}}}if(Nk(e))return zP(e)}k(zP,"getActionAtElement");function Sie(t,e){return t==="?"||t==="*"||Ad(e)&&!!e.guardCondition}k(Sie,"isOptionalCardinality");function kie(t){return t==="*"||t==="+"}k(kie,"isArrayCardinality");function _ie(t){return t==="+="}k(_ie,"isArrayOperator");function sT(t){return GP(t,new Set)}k(sT,"isDataTypeRule");function GP(t,e){if(e.has(t))return!0;e.add(t);for(const r of ic(t))if(Vl(r)){if(!r.rule.ref||ha(r.rule.ref)&&!GP(r.rule.ref,e)||F0(r.rule.ref))return!1}else{if(zl(r))return!1;if(Jc(r))return!1}return!!t.definition}k(GP,"isDataTypeRuleInternal");function Aie(t){return ME(t.type,new Set)}k(Aie,"isDataType");function ME(t,e){if(e.has(t))return!0;if(e.add(t),Q$(t))return!1;if(lP(t))return!1;if(fP(t))return t.types.every(r=>ME(r,e));if($k(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return Bk(r)?ME(r.type,e):!1}else return!1}else return!1}k(ME,"isDataTypeInternal");function oT(t){if(!_s(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}k(oT,"getExplicitRuleType");function rd(t){if(kd(t))return ha(t)&&sT(t)?t.name:oT(t)??t.name;if(iP(t)||Bk(t)||uP(t))return t.name;if(Jc(t)){const e=VP(t);if(e)return e}else if(aT(t))return t.name;throw new Error("Cannot get name of Unknown Type")}k(rd,"getTypeName");function VP(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return rd(t.type.ref)}k(VP,"getActionType");function Rie(t){var e;return _s(t)?((e=t.type)==null?void 0:e.name)??"string":ha(t)&&sT(t)?t.name:oT(t)??t.name}k(Rie,"getRuleTypeName");function WP(t){var e;return _s(t)?((e=t.type)==null?void 0:e.name)??"string":oT(t)??t.name}k(WP,"getRuleType");function lT(t){const e={s:!1,i:!1,u:!1},r=Rd(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}k(lT,"terminalRegex");var qP=/[\s\S]/.source;function Rd(t,e){var r;if(hP(t))return Lie(t);if(dP(t))return Iie(t);if(eP(t))return Nie(t);if(Pk(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Po(Rd(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(aP(t))return Mie(t);if(pP(t))return Die(t);if(cP(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Po(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(gP(t))return Po(qP,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}k(Rd,"abstractElementToRegex");function Lie(t){return Po(t.elements.map(e=>Rd(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}k(Lie,"terminalAlternativesToRegex");function Iie(t){return Po(t.elements.map(e=>Rd(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}k(Iie,"terminalGroupToRegex");function Die(t){return Po(`${qP}*?${Rd(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}k(Die,"untilTokenToRegex");function Mie(t){return Po(`(?!${Rd(t.terminal)})${qP}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}k(Mie,"negateTokenToRegex");function Nie(t){return t.right?Po(`[${wC(t.left)}-${wC(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Po(wC(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}k(Nie,"characterRangeToRegex");function wC(t){return Cv(t.value)}k(wC,"keywordToRegex");function Po(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}k(Po,"withCardinality");function UP(t){const e=[],r=t.Grammar;for(const n of r.rules)_s(n)&&OP(n)&&AP(lT(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:bP}}k(UP,"createGrammarConfig");var bVe=typeof global=="object"&&global&&global.Object===Object&&global,Oie=bVe,TVe=typeof self=="object"&&self&&self.Object===Object&&self,CVe=Oie||TVe||Function("return this")(),Qo=CVe,wVe=Qo.Symbol,ws=wVe,$ie=Object.prototype,EVe=$ie.hasOwnProperty,SVe=$ie.toString,t1=ws?ws.toStringTag:void 0;function Pie(t){var e=EVe.call(t,t1),r=t[t1];try{t[t1]=void 0;var n=!0}catch{}var i=SVe.call(t);return n&&(e?t[t1]=r:delete t[t1]),i}k(Pie,"getRawTag");var kVe=Pie,_Ve=Object.prototype,AVe=_Ve.toString;function Bie(t){return AVe.call(t)}k(Bie,"objectToString");var RVe=Bie,LVe="[object Null]",IVe="[object Undefined]",QV=ws?ws.toStringTag:void 0;function Fie(t){return t==null?t===void 0?IVe:LVe:QV&&QV in Object(t)?kVe(t):RVe(t)}k(Fie,"baseGetTag");var yu=Fie;function zie(t){return t!=null&&typeof t=="object"}k(zie,"isObjectLike");var ao=zie,DVe="[object Symbol]";function Gie(t){return typeof t=="symbol"||ao(t)&&yu(t)==DVe}k(Gie,"isSymbol");var jk=Gie;function Vie(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=pWe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}k(aae,"shortOut");var yWe=aae;function sae(t){return function(){return t}}k(sae,"constant");var vWe=sae,xWe=(function(){try{var t=Id(Object,"defineProperty");return t({},"",{}),t}catch{}})(),NE=xWe,bWe=NE?function(t,e){return NE(t,"toString",{configurable:!0,enumerable:!1,value:vWe(e),writable:!0})}:hT,TWe=bWe,CWe=yWe(TWe),wWe=CWe;function oae(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}k(pae,"arrayIncludes");var gae=pae,kWe=9007199254740991,_We=/^(?:0|[1-9]\d*)$/;function mae(t,e){var r=typeof t;return e=e??kWe,!!e&&(r=="number"||r!="symbol"&&_We.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=IWe}k(wae,"isLength");var KP=wae;function Eae(t){return t!=null&&KP(t.length)&&!ac(t)}k(Eae,"isArrayLike");var Jo=Eae;function Sae(t,e,r){if(!Es(r))return!1;var n=typeof e;return(n=="number"?Jo(r)&&Kk(e,r.length):n=="string"&&e in r)?dT(r[e],t):!1}k(Sae,"isIterateeCall");var Qk=Sae;function kae(t){return jP(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&Qk(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}k(rse,"listCacheHas");var jqe=rse;function nse(t,e){var r=this.__data__,n=t_(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}k(nse,"listCacheSet");var Kqe=nse;function Md(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?t6(o,e-1,r,n,i):e6(i,o):n||(i[i.length]=o)}return i}k(t6,"baseFlatten");var r6=t6;function xse(t){var e=t==null?0:t.length;return e?r6(t,1):[]}k(xse,"flatten");var Js=xse,gUe=Fae(Object.getPrototypeOf,Object),bse=gUe;function Tse(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&aYe?new s6:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&Qk(e[0],e[1],i)&&(n=1);++r=QYe&&(a=o6,s=!1,e=new s6(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}k(rle,"createFind");var iXe=rle,aXe=Math.max;function nle(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:uT(r);return i<0&&(i=aXe(n+i,0)),uae(t,el(e),i)}k(nle,"findIndex");var sXe=nle,oXe=iXe(sXe),W0=oXe;function ile(t){return t&&t.length?t[0]:void 0}k(ile,"head");var so=ile;function ale(t,e){var r=-1,n=Jo(t)?Array(t.length):[];return $d(t,function(i,a,s){n[++r]=e(i,a,s)}),n}k(ale,"baseMap");var lXe=ale;function sle(t,e){var r=Dr(t)?cT:lXe;return r(t,el(e))}k(sle,"map");var Ft=sle;function ole(t,e){return r6(Ft(t,e),1)}k(ole,"flatMap");var xs=ole,cXe=Object.prototype,uXe=cXe.hasOwnProperty,hXe=jYe(function(t,e,r){uXe.call(t,r)?t[r].push(e):XP(t,r,[e])}),dXe=hXe,fXe=Object.prototype,pXe=fXe.hasOwnProperty;function lle(t,e){return t!=null&&pXe.call(t,e)}k(lle,"baseHas");var gXe=lle;function cle(t,e){return t!=null&&_oe(t,e,gXe)}k(cle,"has");var jt=cle,mXe="[object String]";function ule(t){return typeof t=="string"||!Dr(t)&&ao(t)&&yu(t)==mXe}k(ule,"isString");var za=ule;function hle(t,e){return cT(e,function(r){return t[r]})}k(hle,"baseValues");var yXe=hle;function dle(t){return t==null?[]:yXe(t,ns(t))}k(dle,"values");var Kn=dle,vXe=Math.max;function fle(t,e,r,n){t=Jo(t)?t:Kn(t),r=r&&!n?uT(r):0;var i=t.length;return r<0&&(r=vXe(i+r,0)),za(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&YP(t,e,r)>-1}k(fle,"includes");var xa=fle,xXe=Math.max;function ple(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:uT(r);return i<0&&(i=xXe(n+i,0)),YP(t,e,i)}k(ple,"indexOf");var LW=ple,bXe="[object Map]",TXe="[object Set]",CXe=Object.prototype,wXe=CXe.hasOwnProperty;function gle(t){if(t==null)return!0;if(Jo(t)&&(Dr(t)||typeof t=="string"||typeof t.splice=="function"||rb(t)||ZP(t)||Jk(t)))return!t.length;var e=V0(t);if(e==bXe||e==TXe)return!t.size;if(pT(t))return!Gae(t).length;for(var r in t)if(wXe.call(t,r))return!1;return!0}k(gle,"isEmpty");var tn=gle,EXe="[object RegExp]";function mle(t){return ao(t)&&yu(t)==EXe}k(mle,"baseIsRegExp");var SXe=mle,IW=eu&&eu.isRegExp,kXe=IW?gT(IW):SXe,Wl=kXe;function yle(t){return t===void 0}k(yle,"isUndefined");var ql=yle,_Xe="Expected a function";function vle(t){if(typeof t!="function")throw new TypeError(_Xe);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}k(vle,"negate");var AXe=vle;function xle(t,e,r,n){if(!Es(t))return t;e=s_(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=$Xe){var u=e?null:OXe(t);if(u)return l6(u);s=!1,i=o6,l=new s6}else l=e?[]:o;e:for(;++n{r.accept(e)})}},k(Qp,"AbstractProduction"),Qp),Jp,da=(Jp=class extends tl{constructor(e){super([]),this.idx=1,is(this,lo(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},k(Jp,"NonTerminal"),Jp),eg,wv=(eg=class extends tl{constructor(e){super(e.definition),this.orgText="",is(this,lo(e,r=>r!==void 0))}},k(eg,"Rule"),eg),tg,Ga=(tg=class extends tl{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,is(this,lo(e,r=>r!==void 0))}},k(tg,"Alternative"),tg),rg,Ii=(rg=class extends tl{constructor(e){super(e.definition),this.idx=1,is(this,lo(e,r=>r!==void 0))}},k(rg,"Option"),rg),ng,ss=(ng=class extends tl{constructor(e){super(e.definition),this.idx=1,is(this,lo(e,r=>r!==void 0))}},k(ng,"RepetitionMandatory"),ng),ig,os=(ig=class extends tl{constructor(e){super(e.definition),this.idx=1,is(this,lo(e,r=>r!==void 0))}},k(ig,"RepetitionMandatoryWithSeparator"),ig),ag,_n=(ag=class extends tl{constructor(e){super(e.definition),this.idx=1,is(this,lo(e,r=>r!==void 0))}},k(ag,"Repetition"),ag),sg,Wa=(sg=class extends tl{constructor(e){super(e.definition),this.idx=1,is(this,lo(e,r=>r!==void 0))}},k(sg,"RepetitionWithSeparator"),sg),og,qa=(og=class extends tl{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,is(this,lo(e,r=>r!==void 0))}},k(og,"Alternation"),og),lg,un=(lg=class{constructor(e){this.idx=1,is(this,lo(e,r=>r!==void 0))}accept(e){e.visit(this)}},k(lg,"Terminal"),lg);function Dle(t){return Ft(t,yx)}k(Dle,"serializeGrammar");function yx(t){function e(r){return Ft(r,yx)}if(k(e,"convertDefinition"),t instanceof da){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return za(t.label)&&(r.label=t.label),r}else{if(t instanceof Ga)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ii)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof ss)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof os)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:yx(new un({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Wa)return{type:"RepetitionWithSeparator",idx:t.idx,separator:yx(new un({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _n)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof qa)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof un){const r={type:"Terminal",name:t.terminalType.name,label:Lle(t.terminalType),idx:t.idx};za(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Wl(n)?n.source:n),r}else{if(t instanceof wv)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}k(yx,"serializeProduction");var cg,Ev=(cg=class{visit(e){const r=e;switch(r.constructor){case da:return this.visitNonTerminal(r);case Ga:return this.visitAlternative(r);case Ii:return this.visitOption(r);case ss:return this.visitRepetitionMandatory(r);case os:return this.visitRepetitionMandatoryWithSeparator(r);case Wa:return this.visitRepetitionWithSeparator(r);case _n:return this.visitRepetition(r);case qa:return this.visitAlternation(r);case un:return this.visitTerminal(r);case wv:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},k(cg,"GAstVisitor"),cg);function Mle(t){return t instanceof Ga||t instanceof Ii||t instanceof _n||t instanceof ss||t instanceof os||t instanceof Wa||t instanceof un||t instanceof wv}k(Mle,"isSequenceProd");function ob(t,e=[]){return t instanceof Ii||t instanceof _n||t instanceof Wa?!0:t instanceof qa?_le(t.definition,n=>ob(n,e)):t instanceof da&&xa(e,t)?!1:t instanceof tl?(t instanceof da&&e.push(t),eo(t.definition,n=>ob(n,e))):!1}k(ob,"isOptionalProd");function Nle(t){return t instanceof qa}k(Nle,"isBranchingProd");function Ws(t){if(t instanceof da)return"SUBRULE";if(t instanceof Ii)return"OPTION";if(t instanceof qa)return"OR";if(t instanceof ss)return"AT_LEAST_ONE";if(t instanceof os)return"AT_LEAST_ONE_SEP";if(t instanceof Wa)return"MANY_SEP";if(t instanceof _n)return"MANY";if(t instanceof un)return"CONSUME";throw Error("non exhaustive match")}k(Ws,"getProductionDslName");var ug,c_=(ug=class{walk(e,r=[]){Jt(e.definition,(n,i)=>{const a=_i(e.definition,i+1);if(n instanceof da)this.walkProdRef(n,a,r);else if(n instanceof un)this.walkTerminal(n,a,r);else if(n instanceof Ga)this.walkFlat(n,a,r);else if(n instanceof Ii)this.walkOption(n,a,r);else if(n instanceof ss)this.walkAtLeastOne(n,a,r);else if(n instanceof os)this.walkAtLeastOneSep(n,a,r);else if(n instanceof Wa)this.walkManySep(n,a,r);else if(n instanceof _n)this.walkMany(n,a,r);else if(n instanceof qa)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Ii({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=J4(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Ii({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=J4(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Jt(e.definition,a=>{const s=new Ga({definition:[a]});this.walk(s,i)})}},k(ug,"RestWalker"),ug);function J4(t,e,r){return[new Ii({definition:[new un({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}k(J4,"restForRepetitionWithSeparator");function Sv(t){if(t instanceof da)return Sv(t.referencedRule);if(t instanceof un)return Ple(t);if(Mle(t))return Ole(t);if(Nle(t))return $le(t);throw Error("non exhaustive match")}k(Sv,"first");function Ole(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=ob(a),e=e.concat(Sv(a)),n=n+1,i=r.length>n;return h6(e)}k(Ole,"firstForSequence");function $le(t){const e=Ft(t.definition,r=>Sv(r));return h6(Js(e))}k($le,"firstForBranching");function Ple(t){return[t.terminalType]}k(Ple,"firstForTerminal");var Ble="_~IN~_",hg,BXe=(hg=class extends c_{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=zle(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Ga({definition:a}),o=Sv(s);this.follows[i]=o}},k(hg,"ResyncFollowsWalker"),hg);function Fle(t){const e={};return Jt(t,r=>{const n=new BXe(r).startWalking();is(e,n)}),e}k(Fle,"computeAllProdsFollows");function zle(t,e){return t.name+e+Ble}k(zle,"buildBetweenProdsFollowPrefix");var EC={},FXe=new vie;function vT(t){const e=t.toString();if(EC.hasOwnProperty(e))return EC[e];{const r=FXe.pattern(e);return EC[e]=r,r}}k(vT,"getRegExpAst");function Gle(){EC={}}k(Gle,"clearRegExpParserCache");var Vle="Complement Sets are not supported for first char optimization",PE=`Unable to use "first char" lexer optimizations: `;function Wle(t,e=!1){try{const r=vT(t);return BE(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Vle)e&&d6(`${PE} Unable to optimize: < ${t.toString()} > Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=` This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),$E(`${PE} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}k(Wle,"getOptimizedStartCodesIndices");function BE(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")M1(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)M1(h,e,r);else{for(let h=u.from;h<=u.to&&h=O1){const h=u.from>=O1?u.from:O1,d=u.to,f=Ul(h),p=Ul(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":BE(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&FE(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Kn(e)}k(BE,"firstCharOptimizedIndices");function M1(t,e,r){const n=Ul(t);e[n]=n,r===!0&&qle(t,e)}k(M1,"addOptimizedIdxToResult");function qle(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Ul(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Ul(i.charCodeAt(0));e[a]=a}}}k(qle,"handleIgnoreCase");function eD(t,e){return W0(t.value,r=>{if(typeof r=="number")return xa(e,r);{const n=r;return W0(e,i=>n.from<=i&&i<=n.to)!==void 0}})}k(eD,"findCode");function FE(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Dr(t.value)?eo(t.value,FE):FE(t.value):!1}k(FE,"isWholeOptional");var dg,zXe=(dg=class extends Vk{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){xa(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?eD(e,this.targetCharCodes)===void 0&&(this.found=!0):eD(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},k(dg,"CharCodeFinder"),dg);function u_(t,e){if(e instanceof RegExp){const r=vT(e),n=new zXe(t);return n.visit(r),n.found}else return W0(e,r=>xa(t,r.charCodeAt(0)))!==void 0}k(u_,"canMatchCharCode");var id="PATTERN",N1="defaultMode",u2="modes";function Ule(t,e){e=u6(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` `],tracer:k((T,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{dce()});let n;r("Reject Lexer.NA",()=>{n=l_(t,T=>T[id]===la.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=Ft(n,T=>{const b=T[id];if(Wl(b)){const C=b.source;return C.length===1&&C!=="^"&&C!=="$"&&C!=="."&&!b.ignoreCase?C:C.length===2&&C[0]==="\\"&&!xa(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],C[1])?C[1]:tD(b)}else{if(ac(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const C=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),w=new RegExp(C);return tD(w)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=Ft(n,T=>T.tokenTypeIdx),o=Ft(n,T=>{const b=T.GROUP;if(b!==la.SKIPPED){if(za(b))return b;if(ql(b))return!1;throw Error("non exhaustive match")}}),l=Ft(n,T=>{const b=T.LONGER_ALT;if(b)return Dr(b)?Ft(b,w=>LW(n,w)):[LW(n,b)]}),u=Ft(n,T=>T.PUSH_MODE),h=Ft(n,T=>jt(T,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const T=y6(e.lineTerminatorCharacters);d=Ft(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=Ft(n,b=>jt(b,"LINE_BREAKS")?!!b.LINE_BREAKS:m6(b,T)===!1&&u_(T,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Ft(n,g6),p=Ft(a,uce),g=as(n,(T,b)=>{const C=b.GROUP;return za(C)&&C!==la.SKIPPED&&(T[C]=[]),T},{}),m=Ft(a,(T,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=as(n,(T,b,C)=>{if(typeof b.PATTERN=="string"){const w=b.PATTERN.charCodeAt(0),S=Ul(w);SC(T,S,m[C])}else if(Dr(b.START_CHARS_HINT)){let w;Jt(b.START_CHARS_HINT,S=>{const E=typeof S=="string"?S.charCodeAt(0):S,_=Ul(E);w!==_&&(w=_,SC(T,_,m[C]))})}else if(Wl(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&$E(`${PE} Unable to analyze < ${b.PATTERN.toString()} > pattern. The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const w=Wle(b.PATTERN,e.ensureOptimizations);tn(w)&&(y=!1),Jt(w,S=>{SC(T,S,m[C])})}else e.ensureOptimizations&&$E(`${PE} TokenType: <${b.name}> is using a custom token pattern without providing parameter. This will disable the lexer's first char optimizations. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return T},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}k(Ule,"analyzeTokenTypes");function Hle(t,e){let r=[];const n=Xle(t);r=r.concat(n.errors);const i=jle(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Yle(a)),r=r.concat(tce(a)),r=r.concat(rce(a,e)),r=r.concat(nce(a)),r}k(Hle,"validatePatterns");function Yle(t){let e=[];const r=As(t,n=>Wl(n[id]));return e=e.concat(Kle(r)),e=e.concat(Qle(r)),e=e.concat(Jle(r)),e=e.concat(ece(r)),e=e.concat(Zle(r)),e}k(Yle,"validateRegExpPattern");function Xle(t){const e=As(t,i=>!jt(i,id)),r=Ft(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:An.MISSING_PATTERN,tokenTypes:[i]})),n=o_(t,e);return{errors:r,valid:n}}k(Xle,"findMissingPatterns");function jle(t){const e=As(t,i=>{const a=i[id];return!Wl(a)&&!ac(a)&&!jt(a,"exec")&&!za(a)}),r=Ft(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:An.INVALID_PATTERN,tokenTypes:[i]})),n=o_(t,e);return{errors:r,valid:n}}k(jle,"findInvalidPatterns");var GXe=/[^\\][$]/;function Kle(t){const i=class i extends Vk{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};k(i,"EndAnchorFinder");let e=i;const r=As(t,a=>{const s=a.PATTERN;try{const o=vT(s),l=new e;return l.visit(o),l.found}catch{return GXe.test(s.source)}});return Ft(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:An.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}k(Kle,"findEndOfInputAnchor");function Zle(t){const e=As(t,n=>n.PATTERN.test(""));return Ft(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:An.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}k(Zle,"findEmptyMatchRegExps");var VXe=/[^\\[][\^]|^\^/;function Qle(t){const i=class i extends Vk{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};k(i,"StartAnchorFinder");let e=i;const r=As(t,a=>{const s=a.PATTERN;try{const o=vT(s),l=new e;return l.visit(o),l.found}catch{return VXe.test(s.source)}});return Ft(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:An.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}k(Qle,"findStartOfInputAnchor");function Jle(t){const e=As(t,n=>{const i=n[id];return i instanceof RegExp&&(i.multiline||i.global)});return Ft(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:An.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}k(Jle,"findUnsupportedFlags");function ece(t){const e=[];let r=Ft(t,a=>as(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!xa(e,o)&&o.PATTERN!==la.NA&&(e.push(o),s.push(o)),s),[]));r=yT(r);const n=As(r,a=>a.length>1);return Ft(n,a=>{const s=Ft(a,l=>l.name);return{message:`The same RegExp pattern ->${so(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:An.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}k(ece,"findDuplicatePatterns");function tce(t){const e=As(t,n=>{if(!jt(n,"GROUP"))return!1;const i=n.GROUP;return i!==la.SKIPPED&&i!==la.NA&&!za(i)});return Ft(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:An.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}k(tce,"findInvalidGroupType");function rce(t,e){const r=As(t,i=>i.PUSH_MODE!==void 0&&!xa(e,i.PUSH_MODE));return Ft(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:An.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}k(rce,"findModesThatDoNotExist");function nce(t){const e=[],r=as(t,(n,i,a)=>{const s=i.PATTERN;return s===la.NA||(za(s)?n.push({str:s,idx:a,tokenType:i}):Wl(s)&&ace(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return Jt(t,(n,i)=>{Jt(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:An.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}k(nce,"findUnreachablePatterns");function ice(t,e){if(Wl(e)){if(sce(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(ac(e))return e(t,0,[],{});if(jt(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}k(ice,"tryToMatchStrToPattern");function ace(t){return W0([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}k(ace,"noMetaChar");function sce(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition `,type:An.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),jt(t,u2)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+u2+`> property in its definition `,type:An.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),jt(t,u2)&&jt(t,N1)&&!jt(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${N1}: <${t.defaultMode}>which does not exist `,type:An.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),jt(t,u2)&&Jt(t.modes,(i,a)=>{Jt(i,(s,o)=>{if(ql(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> `,type:An.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(jt(s,"LONGER_ALT")){const l=Dr(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];Jt(l,u=>{!ql(u)&&!xa(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}> `,type:An.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}k(oce,"performRuntimeChecks");function lce(t,e,r){const n=[];let i=!1;const a=yT(Js(Kn(t.modes))),s=l_(a,l=>l[id]===la.NA),o=y6(r);return e&&Jt(s,l=>{const u=m6(l,o);if(u!==!1){const d={message:hce(l,u),type:u.issue,tokenType:l};n.push(d)}else jt(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):u_(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:An.NO_LINE_BREAKS_FLAGS}),n}k(lce,"performWarningRuntimeChecks");function cce(t){const e={},r=ns(t);return Jt(r,n=>{const i=t[n];if(Dr(i))e[n]=[];else throw Error("non exhaustive match")}),e}k(cce,"cloneEmptyGroups");function g6(t){const e=t.PATTERN;if(Wl(e))return!1;if(ac(e))return!0;if(jt(e,"exec"))return!0;if(za(e))return!1;throw Error("non exhaustive match")}k(g6,"isCustomPattern");function uce(t){return za(t)&&t.length===1?t.charCodeAt(0):!1}k(uce,"isShortPattern");var WXe={test:k(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===An.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. The problem is in the <${t.name}> Token Type For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}k(hce,"buildLineBreakIssueMessage");function y6(t){return Ft(t,r=>za(r)?r.charCodeAt(0):r)}k(y6,"getCharCodes");function SC(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}k(SC,"addToMapOfArrays");var O1=256,kC=[];function Ul(t){return t255?255+~~(t/255):t}}k(dce,"initCharCodeToOptimizedIndexMap");function kv(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}k(kv,"tokenStructuredMatcher");function lb(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}k(lb,"tokenStructuredMatcherNoCategories");var DW=1,fce={};function _v(t){const e=pce(t);gce(e),yce(e),mce(e),Jt(e,r=>{r.isParent=r.categoryMatches.length>0})}k(_v,"augmentTokenTypes");function pce(t){let e=Di(t),r=t,n=!0;for(;n;){r=yT(Js(Ft(r,a=>a.CATEGORIES)));const i=o_(r,e);e=e.concat(i),tn(i)?n=!1:r=i}return e}k(pce,"expandCategories");function gce(t){Jt(t,e=>{x6(e)||(fce[DW]=e,e.tokenTypeIdx=DW++),rD(e)&&!Dr(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),rD(e)||(e.CATEGORIES=[]),vce(e)||(e.categoryMatches=[]),xce(e)||(e.categoryMatchesMap={})})}k(gce,"assignTokenDefaultProps");function mce(t){Jt(t,e=>{e.categoryMatches=[],Jt(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(fce[n].tokenTypeIdx)})})}k(mce,"assignCategoriesTokensProp");function yce(t){Jt(t,e=>{v6([],e)})}k(yce,"assignCategoriesMapProp");function v6(t,e){Jt(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Jt(e.CATEGORIES,r=>{const n=t.concat(e);xa(n,r)||v6(n,r)})}k(v6,"singleAssignCategoriesToksMap");function x6(t){return jt(t,"tokenTypeIdx")}k(x6,"hasShortKeyProperty");function rD(t){return jt(t,"CATEGORIES")}k(rD,"hasCategoriesProperty");function vce(t){return jt(t,"categoryMatches")}k(vce,"hasExtendingTokensTypesProperty");function xce(t){return jt(t,"categoryMatchesMap")}k(xce,"hasExtendingTokensTypesMapProperty");function bce(t){return jt(t,"tokenTypeIdx")}k(bce,"isTokenType");var nD={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},An;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(An||(An={}));var $1={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:nD,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze($1);var fg,la=(fg=class{constructor(e,r=$1){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=f6(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. a boolean 2nd argument is no longer supported`);this.config=is({},$1,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===$1.lineTerminatorsPattern)this.config.lineTerminatorsPattern=WXe;else if(this.config.lineTerminatorCharacters===$1.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Dr(e)?i={modes:{defaultMode:Di(e)},defaultMode:N1}:(a=!1,i=Di(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(oce(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(lce(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Jt(i.modes,(o,l)=>{i.modes[l]=l_(o,u=>ql(u))});const s=ns(i.modes);if(Jt(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Hle(o,s))}),tn(this.lexerDefinitionErrors)){_v(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=Ule(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=is({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!tn(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=Ft(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: `+l)}Jt(this.lexerDefinitionWarning,o=>{d6(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ii),this.trackStartLines===!1&&(this.computeNewColumn=hT),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ii),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=as(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!tn(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Gle()}),this.TRACE_INIT("toFastProperties",()=>{p6(this)})})}tokenize(e,r=this.defaultMode){if(!tn(this.lexerDefinitionErrors)){const i=Ft(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const T=e,b=T.length;let C=0,w=0;const S=this.hasCustom?0:Math.floor(e.length/10),E=new Array(S),_=[];let R=this.trackStartLines?1:void 0,D=this.trackStartLines?1:void 0;const L=cce(this.emptyGroups),B=this.trackStartLines,$=this.config.lineTerminatorsPattern;let A=0,I=[],O=[];const N=[],M=[];Object.freeze(M);let P=!1;const F=k(X=>{if(N.length===1&&X.tokenType.PUSH_MODE===void 0){const j=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(X);_.push({offset:X.startOffset,line:X.startLine,column:X.startColumn,length:X.image.length,message:j})}else{N.pop();const j=nd(N);I=this.patternIdxToConfig[j],O=this.charCodeToPatternIdxToConfig[j],A=I.length;const re=this.canModeBeOptimized[j]&&this.config.safeMode===!1;O&&re?P=!0:P=!1}},"pop_mode");function V(X){N.push(X),O=this.charCodeToPatternIdxToConfig[X],I=this.patternIdxToConfig[X],A=I.length,A=I.length;const j=this.canModeBeOptimized[X]&&this.config.safeMode===!1;O&&j?P=!0:P=!1}k(V,"push_mode"),V.call(this,r);let z;const W=this.config.recoveryEnabled;for(;Cl.length){l=s,d=s.length,u=h,z=ne;break}}}break}}if(d!==-1){if(f=z.group,f!==void 0&&(l=l!==null?l:e.substring(C,C+d),p=z.tokenTypeIdx,g=this.createTokenInstance(l,C,p,z.tokenType,R,D,d),this.handlePayload(g,u),f===!1?w=this.addToken(E,w,g):L[f].push(g)),B===!0&&z.canLineTerminator===!0){let Q=0,oe,ee;$.lastIndex=0;do l=l!==null?l:e.substring(C,C+d),oe=$.test(l),oe===!0&&(ee=$.lastIndex-1,Q++);while(oe===!0);Q!==0?(R=R+Q,D=d-ee,this.updateTokenEndLineColumnLocation(g,f,ee,Q,R,D,d)):D=this.computeNewColumn(D,d)}else D=this.computeNewColumn(D,d);C=C+d,this.handleModes(z,F,V,g)}else{const Q=C,oe=R,ee=D;let ne=W===!1;for(;ne===!1&&C ${Dh(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` but found: '`+so(e).image+"'";if(n)return a+n+o;{const l=as(t,(f,p)=>f.concat(p),[]),u=Ft(l,f=>`[${Ft(f,p=>Dh(p)).join(", ")}]`),d=`one of these possible Token sequences: ${Ft(u,(f,p)=>` ${p+1}. ${f}`).join(` `)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=` but found: '`+so(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: <${Ft(t,u=>`[${Ft(u,h=>Dh(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(ep);var UXe={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},kh={buildDuplicateFoundError(t,e){function r(h){return h instanceof un?h.terminalType.name:h instanceof da?h.nonTerminalName:""}k(r,"getExtraProductionArgument");const n=t.name,i=so(e),a=i.idx,s=Ws(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""} appears more than once (${e.length} times) in the top level rule: ->${n}<-. For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar. The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. To resolve this make sure each Terminal and Non-Terminal names are unique This is easy to accomplish by using the convention that Terminal names start with an uppercase letter and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=Ft(t.prefixPath,i=>Dh(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix in inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule, `;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. Only the last alternative may be empty. `;else{const i=Ft(t.prefixPath,a=>Dh(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. `}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES For Further details.`,n},buildEmptyRepetitionError(t){let e=Ws(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule. Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives: inside <${t.topLevelRule.name}> Rule. has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=Ft(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. rule: <${e}> can be invoked from itself (directly or indirectly) without consuming any Tokens. The grammar path that causes this is: ${n} To fix this refactor your grammar to remove the left recursion. see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof wv?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Cce(t,e){const r=new HXe(t,e);return r.resolveRefs(),r.errors}k(Cce,"resolveGrammar");var pg,HXe=(pg=class extends Ev{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Jt(Kn(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:fa.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},k(pg,"GastRefResolverVisitor"),pg),gg,YXe=(gg=class extends c_{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Di(this.path.ruleStack).reverse(),this.occurrenceStack=Di(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){tn(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},k(gg,"AbstractNextPossibleTokensWalker"),gg),mg,XXe=(mg=class extends YXe{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new Ga({definition:i});this.possibleTokTypes=Sv(a),this.found=!0}}},k(mg,"NextAfterTokenWalker"),mg),yg,h_=(yg=class extends c_{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},k(yg,"AbstractNextTerminalAfterProductionWalker"),yg),vg,jXe=(vg=class extends h_{walkMany(e,r,n){if(e.idx===this.occurrence){const i=so(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof un&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},k(vg,"NextTerminalAfterManyWalker"),vg),xg,GW=(xg=class extends h_{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=so(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof un&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},k(xg,"NextTerminalAfterManySepWalker"),xg),bg,KXe=(bg=class extends h_{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=so(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof un&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},k(bg,"NextTerminalAfterAtLeastOneWalker"),bg),Tg,VW=(Tg=class extends h_{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=so(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof un&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},k(Tg,"NextTerminalAfterAtLeastOneSepWalker"),Tg);function zE(t,e,r=[]){r=Di(r);let n=[],i=0;function a(o){return o.concat(_i(t,i+1))}k(a,"remainingPathWith");function s(o){const l=zE(a(o),e,r);return n.concat(l)}for(k(s,"getAlternativesForProd");r.length{tn(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof un)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:_i(t,i)}),n}k(zE,"possiblePathsFrom");function C6(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!tn(d);){const f=d.pop();if(f===s){o&&nd(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(tn(p))continue;const v=p[0];if(v===i){const T={idx:g,def:_i(p),ruleStack:sb(m),occurrenceStack:sb(y)};d.push(T)}else if(v instanceof un)if(g=0;T--){const b=v.definition[T],C={idx:g,def:b.definition.concat(_i(p)),ruleStack:m,occurrenceStack:y};d.push(C),d.push(s)}else if(v instanceof Ga)d.push({idx:g,def:v.definition.concat(_i(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof wv)d.push(wce(v,g,m,y));else throw Error("non exhaustive match")}return h}k(C6,"nextPossibleTokensAfter");function wce(t,e,r,n){const i=Di(r);i.push(t.name);const a=Di(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}k(wce,"expandTopLevelRule");var Tn;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Tn||(Tn={}));function d_(t){if(t instanceof Ii||t==="Option")return Tn.OPTION;if(t instanceof _n||t==="Repetition")return Tn.REPETITION;if(t instanceof ss||t==="RepetitionMandatory")return Tn.REPETITION_MANDATORY;if(t instanceof os||t==="RepetitionMandatoryWithSeparator")return Tn.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Wa||t==="RepetitionWithSeparator")return Tn.REPETITION_WITH_SEPARATOR;if(t instanceof qa||t==="Alternation")return Tn.ALTERNATION;throw Error("non exhaustive match")}k(d_,"getProdType");function iD(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=d_(n);return a===Tn.ALTERNATION?bT(e,r,i):TT(e,r,a,i)}k(iD,"getLookaheadPaths");function Ece(t,e,r,n,i,a){const s=bT(t,e,r),o=E6(s)?lb:kv;return a(s,n,o,i)}k(Ece,"buildLookaheadFuncForOr");function Sce(t,e,r,n,i,a){const s=TT(t,e,i,r),o=E6(s)?lb:kv;return a(s[0],o,n)}k(Sce,"buildLookaheadFuncForOptionalProd");function kce(t,e,r,n){const i=t.length,a=eo(t,s=>eo(s,o=>o.length===1));if(e)return function(s){const o=Ft(s,l=>l.GATE);for(let l=0;lJs(l)),o=as(s,(l,u,h)=>(Jt(u,d=>{jt(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Jt(d.categoryMatches,f=>{jt(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=Js(t);if(a.length===1&&tn(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=as(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,Jt(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;azE([s],1)),n=aD(r.length),i=Ft(r,s=>{const o={};return Jt(s,l=>{const u=_C(l.partialPath);Jt(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=aD(o.length);for(let l=0;l{const v=_C(y.partialPath);Jt(v,T=>{i[l][T]=!0})})}}}}return n}k(w6,"lookAheadSequenceFromAlternatives");function bT(t,e,r,n){const i=new Ace(t,Tn.ALTERNATION,n);return e.accept(i),w6(i.result,r)}k(bT,"getLookaheadPathsForOr");function TT(t,e,r,n){const i=new Ace(t,r);e.accept(i);const a=i.result,o=new ZXe(e,t,r).startWalking(),l=new Ga({definition:a}),u=new Ga({definition:o});return w6([l,u],n)}k(TT,"getLookaheadPathsForOptionalProd");function GE(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}k(Lce,"isStrictPrefixOfPath");function E6(t){return eo(t,e=>eo(e,r=>eo(r,n=>tn(n.categoryMatches))))}k(E6,"areTokenCategoriesNotUsed");function Ice(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Ft(e,r=>Object.assign({type:fa.CUSTOM_LOOKAHEAD_VALIDATION},r))}k(Ice,"validateLookahead");function Dce(t,e,r,n){const i=xs(t,l=>Mce(l,r)),a=Wce(t,e,r),s=xs(t,l=>Fce(l,r)),o=xs(t,l=>Oce(l,t,n,r));return i.concat(a,s,o)}k(Dce,"validateGrammar");function Mce(t,e){const r=new QXe;t.accept(r);const n=r.allProductions,i=dXe(n,Nce),a=lo(i,o=>o.length>1);return Ft(Kn(a),o=>{const l=so(o),u=e.buildDuplicateFoundError(t,o),h=Ws(l),d={message:u,type:fa.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=S6(l);return f&&(d.parameter=f),d})}k(Mce,"validateDuplicateProductions");function Nce(t){return`${Ws(t)}_#_${t.idx}_#_${S6(t)}`}k(Nce,"identifyProductionForDuplicates");function S6(t){return t instanceof un?t.terminalType.name:t instanceof da?t.nonTerminalName:""}k(S6,"getExtraProductionArgument");var Eg,QXe=(Eg=class extends Ev{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},k(Eg,"OccurrenceValidationCollector"),Eg);function Oce(t,e,r,n){const i=[];if(as(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:fa.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}k(Oce,"validateRuleDoesNotAlreadyExist");function $ce(t,e,r){const n=[];let i;return xa(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:fa.INVALID_RULE_OVERRIDE,ruleName:t})),n}k($ce,"validateRuleIsOverridden");function k6(t,e,r,n=[]){const i=[],a=vx(e.definition);if(tn(a))return[];{const s=t.name;xa(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:fa.LEFT_RECURSION,ruleName:s});const l=o_(a,n.concat([t])),u=xs(l,h=>{const d=Di(n);return d.push(h),k6(t,h,r,d)});return i.concat(u)}}k(k6,"validateNoLeftRecursion");function vx(t){let e=[];if(tn(t))return e;const r=so(t);if(r instanceof da)e.push(r.referencedRule);else if(r instanceof Ga||r instanceof Ii||r instanceof ss||r instanceof os||r instanceof Wa||r instanceof _n)e=e.concat(vx(r.definition));else if(r instanceof qa)e=Js(Ft(r.definition,a=>vx(a.definition)));else if(!(r instanceof un))throw Error("non exhaustive match");const n=ob(r),i=t.length>1;if(n&&i){const a=_i(t);return e.concat(vx(a))}else return e}k(vx,"getFirstNoneTerminal");var Sg,_6=(Sg=class extends Ev{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},k(Sg,"OrCollector"),Sg);function Pce(t,e){const r=new _6;t.accept(r);const n=r.alternations;return xs(n,a=>{const s=sb(a.definition);return xs(s,(o,l)=>{const u=C6([o],[],kv,1);return tn(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:fa.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}k(Pce,"validateEmptyOrAlternative");function Bce(t,e,r){const n=new _6;t.accept(n);let i=n.alternations;return i=l_(i,s=>s.ignoreAmbiguities===!0),xs(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=bT(o,t,l,s),h=Gce(u,s,t,r),d=Vce(u,s,t,r);return h.concat(d)})}k(Bce,"validateAmbiguousAlternationAlternatives");var kg,JXe=(kg=class extends Ev{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},k(kg,"RepetitionCollector"),kg);function Fce(t,e){const r=new _6;t.accept(r);const n=r.alternations;return xs(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:fa.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}k(Fce,"validateTooManyAlts");function zce(t,e,r){const n=[];return Jt(t,i=>{const a=new JXe;i.accept(a);const s=a.allProductions;Jt(s,o=>{const l=d_(o),u=o.maxLookahead||e,h=o.idx,f=TT(h,i,l,u)[0];if(tn(Js(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:fa.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}k(zce,"validateSomeNonEmptyLookaheadPath");function Gce(t,e,r,n){const i=[],a=as(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Jt(l,h=>{const d=[u];Jt(t,(f,p)=>{u!==p&&GE(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!GE(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Ft(a,o=>{const l=Ft(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:fa.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}k(Gce,"checkAlternativesAmbiguities");function Vce(t,e,r,n){const i=as(t,(s,o,l)=>{const u=Ft(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return yT(xs(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=As(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:fa.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}k(Vce,"checkPrefixAlternativesAmbiguities");function Wce(t,e,r){const n=[],i=Ft(e,a=>a.name);return Jt(t,a=>{const s=a.name;if(xa(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:fa.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}k(Wce,"checkTerminalAndNoneTerminalsNameSpace");function qce(t){const e=u6(t,{errMsgProvider:UXe}),r={};return Jt(t.rules,n=>{r[n.name]=n}),Cce(r,e.errMsgProvider)}k(qce,"resolveGrammar");function Uce(t){return t=u6(t,{errMsgProvider:kh}),Dce(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}k(Uce,"validateGrammar");var Hce="MismatchedTokenException",Yce="NoViableAltException",Xce="EarlyExitException",jce="NotAllInputParsedException",Kce=[Hce,Yce,Xce,jce];Object.freeze(Kce);function cb(t){return xa(Kce,t.name)}k(cb,"isRecognitionException");var _g,f_=(_g=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},k(_g,"RecognitionException"),_g),Ag,Zce=(Ag=class extends f_{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Hce}},k(Ag,"MismatchedTokenException"),Ag),Rg,eje=(Rg=class extends f_{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Yce}},k(Rg,"NoViableAltException"),Rg),Lg,tje=(Lg=class extends f_{constructor(e,r){super(e,r),this.name=jce}},k(Lg,"NotAllInputParsedException"),Lg),Ig,rje=(Ig=class extends f_{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Xce}},k(Ig,"EarlyExitException"),Ig),eI={},Qce="InRuleRecoveryException",Dg,nje=(Dg=class extends Error{constructor(e){super(e),this.name=Qce}},k(Dg,"InRuleRecoveryException"),Dg),Mg,ije=(Mg=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=jt(e,"recoveryEnabled")?e.recoveryEnabled:Hl.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Jce)}getTokenToInsert(e){const r=xT(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=k(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new Zce(p,u,this.LA(0));g.resyncedTokens=sb(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new nje("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||tn(r))return!1;const n=this.LA(1);return W0(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return xa(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=W0(e,a=>T6(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return eI;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Ft(e,(n,i)=>i===0?eI:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Ft(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Js(e)}getFollowSetFromFollowKey(e){if(e===eI)return[tu];const r=e.ruleName+e.idxInCallingRule+Ble+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,tu)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return sb(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Di(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Ft(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},k(Mg,"Recoverable"),Mg);function Jce(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=tu,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}k(Jce,"attemptInRepetitionRecovery");var aje=4,vu=8,eue=1<k6(r,r,kh))}validateEmptyOrAlternatives(e){return xs(e,r=>Pce(r,kh))}validateAmbiguousAlternationAlternatives(e,r){return xs(e,n=>Bce(n,r,kh))}validateSomeNonEmptyLookaheadPath(e,r){return zce(e,r,kh)}buildLookaheadForAlternation(e){return Ece(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,kce)}buildLookaheadForOptional(e){return Sce(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,d_(e.prodType),_ce)}},k(Ng,"LLkLookaheadStrategy"),Ng),Og,sje=(Og=class{initLooksAhead(e){this.dynamicTokensEnabled=jt(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Hl.dynamicTokensEnabled,this.maxLookahead=jt(e,"maxLookahead")?e.maxLookahead:Hl.maxLookahead,this.lookaheadStrategy=jt(e,"lookaheadStrategy")?e.lookaheadStrategy:new A6({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Jt(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=rue(r);Jt(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Ws(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=RC(this.fullRuleNameToShort[r.name],eue,u.idx);this.setLaFuncCache(f,d)})}),Jt(i,u=>{this.computeLookaheadFunc(r,u.idx,sD,"Repetition",u.maxLookahead,Ws(u))}),Jt(a,u=>{this.computeLookaheadFunc(r,u.idx,tue,"Option",u.maxLookahead,Ws(u))}),Jt(s,u=>{this.computeLookaheadFunc(r,u.idx,oD,"RepetitionMandatory",u.maxLookahead,Ws(u))}),Jt(o,u=>{this.computeLookaheadFunc(r,u.idx,AC,"RepetitionMandatoryWithSeparator",u.maxLookahead,Ws(u))}),Jt(l,u=>{this.computeLookaheadFunc(r,u.idx,lD,"RepetitionWithSeparator",u.maxLookahead,Ws(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=RC(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return RC(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},k(Og,"LooksAhead"),Og),$g,oje=($g=class extends Ev{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},k($g,"DslMethodsCollectorVisitor"),$g),h2=new oje;function rue(t){h2.reset(),t.accept(h2);const e=h2.dslMethods;return h2.reset(),e}k(rue,"collectMethods");function cD(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: ${a.join(` `).replace(/\n/g,` `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}k(sue,"createBaseSemanticVisitorConstructor");function oue(t,e,r){const n=k(function(){},"derivedConstructor");R6(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Jt(e,a=>{i[a]=aue}),n.prototype=i,n.prototype.constructor=n,n}k(oue,"createBaseVisitorConstructorWithDefaults");var hD;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(hD||(hD={}));function lue(t,e){return cue(t,e)}k(lue,"validateVisitor");function cue(t,e){const r=As(e,i=>ac(t[i])===!1),n=Ft(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:hD.MISSING_METHOD,methodName:i}));return yT(n)}k(cue,"validateMissingCstMethods");var Pg,cje=(Pg=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=jt(e,"nodeLocationTracking")?e.nodeLocationTracking:Hl.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ii,this.cstFinallyStateUpdate=ii,this.cstPostTerminal=ii,this.cstPostNonTerminal=ii,this.cstPostRule=ii;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=uD,this.setNodeLocationFromNode=uD,this.cstPostRule=ii,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ii,this.setNodeLocationFromNode=ii,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=cD,this.setNodeLocationFromNode=cD,this.cstPostRule=ii,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ii,this.setNodeLocationFromNode=ii,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ii,this.setNodeLocationFromNode=ii,this.cstPostRule=ii,this.setInitialNodeLocation=ii;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];nue(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];iue(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(ql(this.baseCstVisitorConstructor)){const e=sue(this.className,ns(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ql(this.baseCstVisitorWithDefaultsConstructor)){const e=oue(this.className,ns(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},k(Pg,"TreeBuilder"),Pg),Bg,uje=(Bg=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):VE}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?VE:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},k(Bg,"LexerAdapter"),Bg),Fg,hje=(Fg=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=WE){if(xa(this.definedRulesNames,e)){const s={message:kh.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:fa.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=WE){const i=$ce(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(cb(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Dle(Kn(this.gastProductionsCache))}},k(Fg,"RecognizerApi"),Fg),zg,dje=(zg=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=lb,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},jt(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 For Further details.`);if(Dr(e)){if(tn(e))throw Error(`A Token Vocabulary cannot be empty. Note that the first argument for the parser constructor is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 For Further details.`)}if(Dr(e))this.tokensMap=as(e,(a,s)=>(a[s.name]=s,a),{});else if(jt(e,"modes")&&eo(Js(Kn(e.modes)),bce)){const a=Js(Kn(e.modes)),s=h6(a);this.tokensMap=as(s,(o,l)=>(o[l.name]=l,o),{})}else if(Es(e))this.tokensMap=Di(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=tu;const n=jt(e,"modes")?Js(Kn(e.modes)):Kn(e),i=eo(n,a=>tn(a.categoryMatches));this.tokenMatcher=i?lb:kv,_v(Kn(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=jt(n,"resyncEnabled")?n.resyncEnabled:WE.resyncEnabled,a=jt(n,"recoveryValueFunc")?n.recoveryValueFunc:WE.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(oD,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=k(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Tn.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,oD,e,KXe)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(AC,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=k(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,VW],o,AC,e,VW)}else throw this.raiseEarlyExitException(e,Tn.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(sD,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=k(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,sD,e,jXe,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(lD,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=k(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,GW],o,lD,e,GW)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,AC,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(eue,r),i=Dr(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new tje(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw cb(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Zce(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===Qce?n:a}}else throw n}saveRecogState(){const e=this.errors,r=Di(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),tu)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},k(zg,"RecognizerEngine"),zg),Gg,fje=(Gg=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=jt(e,"errorMessageProvider")?e.errorMessageProvider:Hl.errorMessageProvider}SAVE_ERROR(e){if(cb(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Di(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Di(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=TT(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new rje(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=bT(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new eje(l,this.LA(1),o))}},k(Gg,"ErrorHandler"),Gg),Vg,pje=(Vg=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(ql(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return C6([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=so(e.ruleStack),i=this.getGAstProductions()[r];return new XXe(i,e).startWalking()}},k(Vg,"ContentAssist"),Vg),p_={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(p_);var WW=!0,qW=Math.pow(2,vu)-1,uue=xp({name:"RECORDING_PHASE_TOKEN",pattern:la.NA});_v([uue]);var hue=xT(uue,`This IToken indicates the Parser is in Recording Phase See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(hue);var gje={name:`This CSTNode indicates the Parser is in Recording Phase See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Wg,mje=(Wg=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return VE}topLevelRuleRecord(e,r){try{const n=new wv({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` This error was thrown during the "grammar recording phase" For more info see: https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Sf.call(this,Ii,e,r)}atLeastOneInternalRecord(e,r){Sf.call(this,ss,r,e)}atLeastOneSepFirstInternalRecord(e,r){Sf.call(this,os,r,e,WW)}manyInternalRecord(e,r){Sf.call(this,_n,r,e)}manySepFirstInternalRecord(e,r){Sf.call(this,Wa,r,e,WW)}orInternalRecord(e,r){return due.call(this,e,r)}subruleInternalRecord(e,r,n){if(ub(r),!e||jt(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=nd(this.recordingProdStack),a=e.ruleName,s=new da({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?gje:p_}consumeInternalRecord(e,r,n){if(ub(r),!x6(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=nd(this.recordingProdStack),a=new un({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),hue}},k(Wg,"GastRecorder"),Wg);function Sf(t,e,r,n=!1){ub(r);const i=nd(this.recordingProdStack),a=ac(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),jt(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),p_}k(Sf,"recordProd");function due(t,e){ub(e);const r=nd(this.recordingProdStack),n=Dr(t)===!1,i=n===!1?t:t.DEF,a=new qa({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});jt(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=_le(i,o=>ac(o.GATE));return a.hasPredicates=s,r.definition.push(a),Jt(i,o=>{const l=new Ga({definition:[]});a.definition.push(l),jt(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:jt(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),p_}k(due,"recordOrProd");function dD(t){return t===0?"":`${t}`}k(dD,"getIdxSuffix");function ub(t){if(t<0||t>qW){const e=new Error(`Invalid DSL Method idx value: <${t}> Idx value must be a none negative value smaller than ${qW+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}k(ub,"assertMethodIdxIsValid");var qg,yje=(qg=class{initPerformanceTracer(e){if(jt(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Hl.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=f6(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},k(qg,"PerformanceTracer"),qg);function fue(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}k(fue,"applyMixins");var VE=xT(tu,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(VE);var Hl=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:ep,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),WE=Object.freeze({recoveryValueFunc:k(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),fa;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(fa||(fa={}));function fD(t=void 0){return function(){return t}}k(fD,"EMPTY_ALT");var Oh,L6=(Oh=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{p6(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Jt(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=qce({rules:Kn(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(tn(n)&&this.skipValidations===!1){const i=Uce({rules:Kn(this.gastProductionsCache),tokenTypes:Kn(this.tokensMap),errMsgProvider:kh,grammarName:r}),a=Ice({lookaheadStrategy:this.lookaheadStrategy,rules:Kn(this.gastProductionsCache),tokenTypes:Kn(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),tn(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Fle(Kn(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Kn(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Kn(this.gastProductionsCache))})),!Oh.DEFER_DEFINITION_ERRORS_HANDLING&&!tn(this.definitionErrors))throw e=Ft(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: ${e.join(` ------------------------------- `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),jt(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES For further details.`);this.skipValidations=jt(r,"skipValidations")?r.skipValidations:Hl.skipValidations}},k(Oh,"Parser"),Oh);L6.DEFER_DEFINITION_ERRORS_HANDLING=!1;fue(L6,[ije,sje,cje,uje,dje,hje,fje,pje,mje,yje]);var Ug,vje=(Ug=class extends L6{constructor(e,r=Hl){const n=Di(r);n.outputCst=!1,super(e,n)}},k(Ug,"EmbeddedActionsParser"),Ug);function pue(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}k(Cue,"listCacheHas");var Eje=Cue;function wue(t,e){var r=this.__data__,n=g_(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}k(wue,"listCacheSet");var Sje=wue;function Pd(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&IKe?new rhe:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=dZe}k(She,"isLength");var M6=She,fZe="[object Arguments]",pZe="[object Array]",gZe="[object Boolean]",mZe="[object Date]",yZe="[object Error]",vZe="[object Function]",xZe="[object Map]",bZe="[object Number]",TZe="[object Object]",CZe="[object RegExp]",wZe="[object Set]",EZe="[object String]",SZe="[object WeakMap]",kZe="[object ArrayBuffer]",_Ze="[object DataView]",AZe="[object Float32Array]",RZe="[object Float64Array]",LZe="[object Int8Array]",IZe="[object Int16Array]",DZe="[object Int32Array]",MZe="[object Uint8Array]",NZe="[object Uint8ClampedArray]",OZe="[object Uint16Array]",$Ze="[object Uint32Array]",ln={};ln[AZe]=ln[RZe]=ln[LZe]=ln[IZe]=ln[DZe]=ln[MZe]=ln[NZe]=ln[OZe]=ln[$Ze]=!0;ln[fZe]=ln[pZe]=ln[kZe]=ln[gZe]=ln[_Ze]=ln[mZe]=ln[yZe]=ln[vZe]=ln[xZe]=ln[bZe]=ln[TZe]=ln[CZe]=ln[wZe]=ln[EZe]=ln[SZe]=!1;function khe(t){return q0(t)&&M6(t.length)&&!!ln[Av(t)]}k(khe,"baseIsTypedArray");var PZe=khe;function _he(t){return function(e){return t(e)}}k(_he,"baseUnary");var BZe=_he,Ahe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xx=Ahe&&typeof module=="object"&&module&&!module.nodeType&&module,FZe=xx&&xx.exports===Ahe,nI=FZe&&Aue.process,zZe=(function(){try{var t=xx&&xx.require&&xx.require("util").types;return t||nI&&nI.binding&&nI.binding("util")}catch{}})(),eq=zZe,tq=eq&&eq.isTypedArray,GZe=tq?BZe(tq):PZe,N6=GZe,VZe=Object.prototype,WZe=VZe.hasOwnProperty;function Rhe(t,e){var r=pa(t),n=!r&&x_(t),i=!r&&!n&&qE(t),a=!r&&!n&&!i&&N6(t),s=r||n||i||a,o=s?tZe(t.length,String):[],l=o.length;for(var u in t)(e||WZe.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ehe(u,l)))&&o.push(u);return o}k(Rhe,"arrayLikeKeys");var qZe=Rhe,UZe=Object.prototype;function Lhe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||UZe;return t===r}k(Lhe,"isPrototype");var Ihe=Lhe;function Dhe(t,e){return function(r){return t(e(r))}}k(Dhe,"overArg");var HZe=Dhe,YZe=HZe(Object.keys,Object),XZe=YZe,jZe=Object.prototype,KZe=jZe.hasOwnProperty;function Mhe(t){if(!Ihe(t))return XZe(t);var e=[];for(var r in Object(t))KZe.call(t,r)&&r!="constructor"&&e.push(r);return e}k(Mhe,"baseKeys");var Nhe=Mhe;function Ohe(t){return t!=null&&M6(t.length)&&!Oue(t)}k(Ohe,"isArrayLike");var b_=Ohe;function $he(t){return b_(t)?qZe(t):Nhe(t)}k($he,"keys");var O6=$he;function Phe(t){return jKe(t,O6,eZe)}k(Phe,"getAllKeys");var rq=Phe,ZZe=1,QZe=Object.prototype,JZe=QZe.hasOwnProperty;function Bhe(t,e,r,n,i,a){var s=r&ZZe,o=rq(t),l=o.length,u=rq(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:JZe.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++dW6(t,e,s));return Vd(t,e,n,r,...i)}k(Lde,"alternation");function Ide(t,e,r){const n=ei(t,e,r,{type:ru});oc(t,n);const i=Vd(t,e,n,r,xu(t,e,r));return Dde(t,e,r,i)}k(Ide,"option");function xu(t,e,r){const n=KQe(_l(r.definition,i=>W6(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:Nde(t,n)}k(xu,"block");function q6(t,e,r,n,i){const a=n.left,s=n.right,o=ei(t,e,r,{type:tJe});oc(t,o);const l=ei(t,e,r,{type:Cde});return a.loopback=o,l.loopback=o,t.decisionMap[ad(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Mn(s,o),i===void 0?(Mn(o,a),Mn(o,l)):(Mn(o,l),Mn(o,i.left),Mn(i.right,a)),{left:a,right:l}}k(q6,"plus");function U6(t,e,r,n,i){const a=n.left,s=n.right,o=ei(t,e,r,{type:eJe});oc(t,o);const l=ei(t,e,r,{type:Cde}),u=ei(t,e,r,{type:JQe});return o.loopback=u,l.loopback=u,Mn(o,a),Mn(o,l),Mn(s,u),i!==void 0?(Mn(u,l),Mn(u,i.left),Mn(i.right,a)):Mn(u,o),t.decisionMap[ad(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}k(U6,"star");function Dde(t,e,r,n){const i=n.left,a=n.right;return Mn(i,a),t.decisionMap[ad(e,"Option",r.idx)]=i,n}k(Dde,"optional");function oc(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}k(oc,"defineDecisionState");function Vd(t,e,r,n,...i){const a=ei(t,e,n,{type:QQe,start:r});r.end=a;for(const o of i)o!==void 0?(Mn(r,o.left),Mn(o.right,a)):Mn(r,a);const s={left:r,right:a};return t.decisionMap[ad(e,Mde(n),n.idx)]=r,s}k(Vd,"makeAlts");function Mde(t){if(t instanceof qa)return"Alternation";if(t instanceof Ii)return"Option";if(t instanceof _n)return"Repetition";if(t instanceof Wa)return"RepetitionWithSeparator";if(t instanceof ss)return"RepetitionMandatory";if(t instanceof os)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}k(Mde,"getProdType");function Nde(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},k(Kg,"ATNConfigSet"),Kg);function H6(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}k(H6,"getATNConfigKey");function Bde(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Y6(o,e-1,r,n,i):dhe(i,o):n||(i[i.length]=o)}return i}k(Y6,"baseFlatten");var Vde=Y6;function Wde(t,e){return Vde(_l(t,e),1)}k(Wde,"flatMap");var sJe=Wde;function qde(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}k(Xde,"arrayIncludes");var hJe=Xde;function jde(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=yJe){var u=e?null:mJe(t);if(u)return D6(u);s=!1,i=ahe,l=new rhe}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}k(ofe,"createDFACache");var Zg,lfe=(Zg=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=Ede(e.rules),this.dfas=cfe(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=ad(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=_l(iD({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>_l(f,p=>p[0]));if(xD(d,!1)&&!a){const f=pq(d,(p,g,m)=>(iI(g,y=>{y&&(p[y.tokenTypeIdx]=m,iI(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new lfe,g=f===void 0?0:f.length;for(let y=0;y_l(f,p=>p[0]));if(xD(d)&&d[0][0]&&!a){const f=d[0],p=bJe(f);if(p.length===1&&_Je(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=pq(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,iI(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=IC.call(this,s,h,gq,o);return typeof f=="object"?!1:f===0}}},k(Qg,"LLStarLookaheadStrategy"),Qg);function xD(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}k(xD,"isLL1Sequence");function cfe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nDh(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${pfe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES For Further details.`,n}k(ffe,"buildAmbiguityError");function pfe(t){if(t instanceof da)return"SUBRULE";if(t instanceof Ii)return"OPTION";if(t instanceof qa)return"OR";if(t instanceof ss)return"AT_LEAST_ONE";if(t instanceof os)return"AT_LEAST_ONE_SEP";if(t instanceof Wa)return"MANY_SEP";if(t instanceof _n)return"MANY";if(t instanceof un)return"CONSUME";throw Error("non exhaustive match")}k(pfe,"getProductionDslName");function gfe(t,e,r){const n=sJe(e.configs.elements,a=>a.state.transitions),i=xJe(n.filter(a=>a instanceof G6).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}k(gfe,"buildAdaptivePredictError");function mfe(t,e){return t.edges[e.tokenTypeIdx]}k(mfe,"getExistingTargetState");function yfe(t,e,r){const n=new vD,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===CT){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!Cfe(a))for(const s of i)a.add(s);return a}k(yfe,"computeReachSet");function vfe(t,e){if(t instanceof G6&&T6(e,t.tokenType))return t.target}k(vfe,"getReachableTarget");function xfe(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}k(xfe,"getUniqueAlt");function X6(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}k(X6,"newDFAState");function bD(t,e,r,n){return n=j6(t,n),e.edges[r.tokenTypeIdx]=n,n}k(bD,"addDFAEdge");function j6(t,e){if(e===UE)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}k(j6,"addDFAState");function bfe(t){const e=new vD,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};pb(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}k(kfe,"hasConflictingAltSet");function _fe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}k(_fe,"hasStateAssociatedWithOneAlt");rT();var Jg,Afe=(Jg=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Z6(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new A_;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new HE(e.startOffset,e.image.length,tb(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new HE(a.startOffset,a.image.length,tb(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},k(Jg,"CstNodeBuilder"),Jg),em,K6=(em=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},k(em,"AbstractCstNode"),em),tm,HE=(tm=class extends K6{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},k(tm,"LeafCstNodeImpl"),tm),rm,A_=(rm=class extends K6{constructor(){super(...arguments),this.content=new IJe(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},k(rm,"CompositeCstNodeImpl"),rm),$h,IJe=($h=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,$h.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},k($h,"CstNodeContainer"),$h),nm,Z6=(nm=class extends A_{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},k(nm,"RootCstNodeImpl"),nm),YE=Symbol("Datatype");function DC(t){return t.$type===YE}k(DC,"isDataTypeNode");var mq="​",Rfe=k(t=>t.endsWith(mq)?t:t+mq,"withRuleSuffix"),im,Q6=(im=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new MJe(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Mfe(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},k(im,"AbstractLangiumParser"),im),am,Lfe=(am=class extends Q6{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Afe,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;F0(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(Rfe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),ha(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===YE?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Gl(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(DC(u)){let h=i.image;Gl(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(DC(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):DC(e)?this.converter.convert(e.value,e.$cstNode):(K$(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=Sd(e,zl);this.assignmentMap.set(e,{assignment:r,crossRef:r&&_d(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},k(am,"LangiumParser"),am),sm,Ife=(sm=class{buildMismatchTokenMessage(e){return ep.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return ep.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return ep.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return ep.buildEarlyExitMessage(e)}},k(sm,"AbstractParserErrorMessageProvider"),sm),om,J6=(om=class extends Ife{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},k(om,"LangiumParserErrorMessageProvider"),om),lm,Dfe=(lm=class extends Q6{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(Rfe(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},k(lm,"LangiumCompletionParser"),lm),DJe={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new J6},cm,Mfe=(cm=class extends vje{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...DJe,lookaheadStrategy:n?new A6({maxLookahead:r.maxLookahead}):new LJe({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},k(cm,"ChevrotainWrapper"),cm),um,MJe=(um=class extends Mfe{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},k(um,"ProfilerWrapper"),um);function R_(t,e,r){return Nfe({parser:e,tokens:r,ruleNames:new Map},t),e}k(R_,"createParser");function Nfe(t,e){const r=qk(e,!1),n=Wr(e.rules).filter(ha).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,nu(s,a.definition))}const i=Wr(e.rules).filter(F0).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,Ofe(t,a))}k(Nfe,"buildRules");function Ofe(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(_s(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:k(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=L_(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:k(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}k(Ofe,"buildInfixRule");function nu(t,e,r=!1){let n;if(Gl(e))n=Vfe(t,e);else if(Jc(e))n=$fe(t,e);else if(zl(e))n=nu(t,e.terminal);else if(_d(e))n=eB(t,e);else if(Vl(e))n=Pfe(t,e);else if(Ok(e))n=Ffe(t,e);else if(Fk(e))n=zfe(t,e);else if(Ad(e))n=Gfe(t,e);else if(nP(e)){const i=t.consume++;n=k(()=>t.parser.consume(i,tu,e),"method")}else throw new Gk(e.$cstNode,`Unexpected element type: ${e.$type}`);return tB(t,r?void 0:gb(e),n,e.cardinality)}k(nu,"buildElement");function $fe(t,e){const r=rd(e);return()=>t.parser.action(r,e)}k($fe,"buildAction");function Pfe(t,e){const r=e.rule.ref;if(kd(r)){const n=t.subrule++,i=ha(r)&&r.fragment,a=e.arguments.length>0?Bfe(r,e.arguments):()=>({});let s;return o=>{s??(s=L_(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(_s(r)){const n=t.consume++,i=XE(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)mu();else throw new Gk(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}k(Pfe,"buildRuleCall");function Bfe(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Us(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Us(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(tP(t)){const e=Us(t.left),r=Us(t.right);return n=>e(n)&&r(n)}else if(sP(t)){const e=Us(t.value);return r=>!e(r)}else if(oP(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(J$(t)){const e=!!t.true;return()=>e}mu()}k(Us,"buildPredicate");function Ffe(t,e){if(e.elements.length===1)return nu(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:nu(t,i,!0)},s=gb(i);s&&(a.GATE=Us(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:k(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}k(Ffe,"buildAlternatives");function zfe(t,e){if(e.elements.length===1)return nu(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:nu(t,o,!0)},u=gb(o);u&&(l.GATE=Us(u)),r.push(l)}const n=t.or++,i=k((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=k(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:k(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=tB(t,gb(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}k(zfe,"buildUnorderedGroup");function Gfe(t,e){const r=e.elements.map(n=>nu(t,n));return n=>r.forEach(i=>i(n))}k(Gfe,"buildGroup");function gb(t){if(Ad(t))return t.guardCondition}k(gb,"getGuardCondition");function eB(t,e,r=e.terminal){if(r)if(Vl(r)&&ha(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=L_(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Vl(r)&&_s(r.rule.ref)){const n=t.consume++,i=XE(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Gl(r)){const n=t.consume++,i=XE(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=Xk(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+rd(e.type.ref));return eB(t,e,i)}}k(eB,"buildCrossReference");function Vfe(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}k(Vfe,"buildKeyword");function tB(t,e,r,n){const i=e&&Us(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:k(()=>r(s),"ALT"),GATE:k(()=>i(s),"GATE")},{ALT:fD(),GATE:k(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:k(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:k(()=>t.parser.atLeastOne(a,{DEF:k(()=>r(o),"DEF")}),"ALT"),GATE:k(()=>i(o),"GATE")},{ALT:fD(),GATE:k(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:k(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:k(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else mu()}k(tB,"wrap");function L_(t,e){const r=Wfe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}k(L_,"getRule");function Wfe(t,e){if(kd(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!ha(n);)(Ad(n)||Ok(n)||Fk(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}k(Wfe,"getRuleName");function XE(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}k(XE,"getToken");function rB(t){const e=t.Grammar,r=t.parser.Lexer,n=new Dfe(t);return R_(e,n,r.definition),n.finalize(),n}k(rB,"createCompletionParser");function nB(t){const e=iB(t);return e.finalize(),e}k(nB,"createLangiumParser");function iB(t){const e=t.Grammar,r=t.parser.Lexer,n=new Lfe(t);return R_(e,n,r.definition)}k(iB,"prepareLangiumParser");var hm,I_=(hm=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=Wr(qk(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(_s).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=lT(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Wk(r)?la.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(kd).flatMap(i=>ic(i).filter(Gl)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Cv(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&RP("^"+a.source+"$",e.value)&&n.push(i),n},[])}},k(hm,"DefaultTokenBuilder"),hm),dm,aB=(dm=class{convert(e,r){let n=r.grammarSource;if(_d(n)&&(n=NP(n)),Vl(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Eo.convertInt(r);case"STRING":return Eo.convertString(r);case"ID":return Eo.convertID(r)}switch((i=WP(e))==null?void 0:i.toLowerCase()){case"number":return Eo.convertNumber(r);case"boolean":return Eo.convertBoolean(r);case"bigint":return Eo.convertBigint(r);case"date":return Eo.convertDate(r);default:return r}}},k(dm,"DefaultValueConverter"),dm),Eo;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}k(D_,"delayNextTick");var MC=0,qfe=10;function M_(){return MC=performance.now(),new en.CancellationTokenSource}k(M_,"startCancelableOperation");function sB(t){qfe=t}k(sB,"setInterruptionPeriod");var Lo=Symbol("OperationCancelled");function Wd(t){return t===Lo}k(Wd,"isOperationCancelled");async function oi(t){if(t===en.CancellationToken.None)return;const e=performance.now();if(e-MC>=qfe&&(MC=e,await D_(),MC=performance.now()),t.isCancellationRequested)throw Lo}k(oi,"interruptAndCheck");var fm,Yl=(fm=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},k(fm,"Deferred"),fm),Gc,yq=(Gc=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Gc.isIncremental(n)){const i=lB(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=TD(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&oB(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},k(Gc,"FullTextDocument"),Gc),jE;(function(t){function e(i,a,s,o){return new yq(i,a,s,o)}k(e,"create"),t.create=e;function r(i,a,s){if(i instanceof yq)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}k(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=KE(a.map(Ufe),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}k(n,"applyEdits"),t.applyEdits=n})(jE||(jE={}));function KE(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);KE(n,e),KE(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}k(lB,"getWellformedRange");function Ufe(t){const e=lB(t.range);return e!==t.range?{newText:t.newText,range:e}:t}k(Ufe,"getWellformedEdit");var Hfe;(()=>{var t={975:$=>{function A(N){if(typeof N!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(N))}k(A,"e");function I(N,M){for(var P,F="",V=0,z=-1,W=0,X=0;X<=N.length;++X){if(X2){var j=F.lastIndexOf("/");if(j!==F.length-1){j===-1?(F="",V=0):V=(F=F.slice(0,j)).length-1-F.lastIndexOf("/"),z=X,W=0;continue}}else if(F.length===2||F.length===1){F="",V=0,z=X,W=0;continue}}M&&(F.length>0?F+="/..":F="..",V=2)}else F.length>0?F+="/"+N.slice(z+1,X):F=N.slice(z+1,X),V=X-z-1;z=X,W=0}else P===46&&W!==-1?++W:W=-1}return F}k(I,"r");var O={resolve:k(function(){for(var N,M="",P=!1,F=arguments.length-1;F>=-1&&!P;F--){var V;F>=0?V=arguments[F]:(N===void 0&&(N=process.cwd()),V=N),A(V),V.length!==0&&(M=V+"/"+M,P=V.charCodeAt(0)===47)}return M=I(M,!P),P?M.length>0?"/"+M:"/":M.length>0?M:"."},"resolve"),normalize:k(function(N){if(A(N),N.length===0)return".";var M=N.charCodeAt(0)===47,P=N.charCodeAt(N.length-1)===47;return(N=I(N,!M)).length!==0||M||(N="."),N.length>0&&P&&(N+="/"),M?"/"+N:N},"normalize"),isAbsolute:k(function(N){return A(N),N.length>0&&N.charCodeAt(0)===47},"isAbsolute"),join:k(function(){if(arguments.length===0)return".";for(var N,M=0;M0&&(N===void 0?N=P:N+="/"+P)}return N===void 0?".":O.normalize(N)},"join"),relative:k(function(N,M){if(A(N),A(M),N===M||(N=O.resolve(N))===(M=O.resolve(M)))return"";for(var P=1;PX){if(M.charCodeAt(z+re)===47)return M.slice(z+re+1);if(re===0)return M.slice(z+re)}else V>X&&(N.charCodeAt(P+re)===47?j=re:re===0&&(j=0));break}var Q=N.charCodeAt(P+re);if(Q!==M.charCodeAt(z+re))break;Q===47&&(j=re)}var oe="";for(re=P+j+1;re<=F;++re)re!==F&&N.charCodeAt(re)!==47||(oe.length===0?oe+="..":oe+="/..");return oe.length>0?oe+M.slice(z+j):(z+=j,M.charCodeAt(z)===47&&++z,M.slice(z))},"relative"),_makeLong:k(function(N){return N},"_makeLong"),dirname:k(function(N){if(A(N),N.length===0)return".";for(var M=N.charCodeAt(0),P=M===47,F=-1,V=!0,z=N.length-1;z>=1;--z)if((M=N.charCodeAt(z))===47){if(!V){F=z;break}}else V=!1;return F===-1?P?"/":".":P&&F===1?"//":N.slice(0,F)},"dirname"),basename:k(function(N,M){if(M!==void 0&&typeof M!="string")throw new TypeError('"ext" argument must be a string');A(N);var P,F=0,V=-1,z=!0;if(M!==void 0&&M.length>0&&M.length<=N.length){if(M.length===N.length&&M===N)return"";var W=M.length-1,X=-1;for(P=N.length-1;P>=0;--P){var j=N.charCodeAt(P);if(j===47){if(!z){F=P+1;break}}else X===-1&&(z=!1,X=P+1),W>=0&&(j===M.charCodeAt(W)?--W==-1&&(V=P):(W=-1,V=X))}return F===V?V=X:V===-1&&(V=N.length),N.slice(F,V)}for(P=N.length-1;P>=0;--P)if(N.charCodeAt(P)===47){if(!z){F=P+1;break}}else V===-1&&(z=!1,V=P+1);return V===-1?"":N.slice(F,V)},"basename"),extname:k(function(N){A(N);for(var M=-1,P=0,F=-1,V=!0,z=0,W=N.length-1;W>=0;--W){var X=N.charCodeAt(W);if(X!==47)F===-1&&(V=!1,F=W+1),X===46?M===-1?M=W:z!==1&&(z=1):M!==-1&&(z=-1);else if(!V){P=W+1;break}}return M===-1||F===-1||z===0||z===1&&M===F-1&&M===P+1?"":N.slice(M,F)},"extname"),format:k(function(N){if(N===null||typeof N!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof N);return(function(M,P){var F=P.dir||P.root,V=P.base||(P.name||"")+(P.ext||"");return F?F===P.root?F+V:F+"/"+V:V})(0,N)},"format"),parse:k(function(N){A(N);var M={root:"",dir:"",base:"",ext:"",name:""};if(N.length===0)return M;var P,F=N.charCodeAt(0),V=F===47;V?(M.root="/",P=1):P=0;for(var z=-1,W=0,X=-1,j=!0,re=N.length-1,Q=0;re>=P;--re)if((F=N.charCodeAt(re))!==47)X===-1&&(j=!1,X=re+1),F===46?z===-1?z=re:Q!==1&&(Q=1):z!==-1&&(Q=-1);else if(!j){W=re+1;break}return z===-1||X===-1||Q===0||Q===1&&z===X-1&&z===W+1?X!==-1&&(M.base=M.name=W===0&&V?N.slice(1,X):N.slice(W,X)):(W===0&&V?(M.name=N.slice(1,z),M.base=N.slice(1,X)):(M.name=N.slice(W,z),M.base=N.slice(W,X)),M.ext=N.slice(z,X)),W>0?M.dir=N.slice(0,W-1):V&&(M.dir="/"),M},"parse"),sep:"/",delimiter:":",win32:null,posix:null};O.posix=O,$.exports=O}},e={};function r($){var A=e[$];if(A!==void 0)return A.exports;var I=e[$]={exports:{}};return t[$](I,I.exports,r),I.exports}k(r,"r"),r.d=($,A)=>{for(var I in A)r.o(A,I)&&!r.o($,I)&&Object.defineProperty($,I,{enumerable:!0,get:A[I]})},r.o=($,A)=>Object.prototype.hasOwnProperty.call($,A),r.r=$=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),Object.defineProperty($,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:k(()=>f,"URI"),Utils:k(()=>D,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l($,A){if(!$.scheme&&A)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${$.authority}", path: "${$.path}", query: "${$.query}", fragment: "${$.fragment}"}`);if($.scheme&&!a.test($.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if($.path){if($.authority){if(!s.test($.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test($.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}k(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,L=class L{constructor(A,I,O,N,M,P=!1){Cr(this,"scheme");Cr(this,"authority");Cr(this,"path");Cr(this,"query");Cr(this,"fragment");typeof A=="object"?(this.scheme=A.scheme||u,this.authority=A.authority||u,this.path=A.path||u,this.query=A.query||u,this.fragment=A.fragment||u):(this.scheme=(function(F,V){return F||V?F:"file"})(A,P),this.authority=I||u,this.path=(function(F,V){switch(F){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V})(this.scheme,O||u),this.query=N||u,this.fragment=M||u,l(this,P))}static isUri(A){return A instanceof L||!!A&&typeof A.authority=="string"&&typeof A.fragment=="string"&&typeof A.path=="string"&&typeof A.query=="string"&&typeof A.scheme=="string"&&typeof A.fsPath=="string"&&typeof A.with=="function"&&typeof A.toString=="function"}get fsPath(){return T(this,!1)}with(A){if(!A)return this;let{scheme:I,authority:O,path:N,query:M,fragment:P}=A;return I===void 0?I=this.scheme:I===null&&(I=u),O===void 0?O=this.authority:O===null&&(O=u),N===void 0?N=this.path:N===null&&(N=u),M===void 0?M=this.query:M===null&&(M=u),P===void 0?P=this.fragment:P===null&&(P=u),I===this.scheme&&O===this.authority&&N===this.path&&M===this.query&&P===this.fragment?this:new g(I,O,N,M,P)}static parse(A,I=!1){const O=d.exec(A);return O?new g(O[2]||u,S(O[4]||u),S(O[5]||u),S(O[7]||u),S(O[9]||u),I):new g(u,u,u,u,u)}static file(A){let I=u;if(i&&(A=A.replace(/\\/g,h)),A[0]===h&&A[1]===h){const O=A.indexOf(h,2);O===-1?(I=A.substring(2),A=h):(I=A.substring(2,O),A=A.substring(O)||h)}return new g("file",I,A,u,u)}static from(A){const I=new g(A.scheme,A.authority,A.path,A.query,A.fragment);return l(I,!0),I}toString(A=!1){return b(this,A)}toJSON(){return this}static revive(A){if(A){if(A instanceof L)return A;{const I=new g(A);return I._formatted=A.external,I._fsPath=A._sep===p?A.fsPath:null,I}}return A}};k(L,"l");let f=L;const p=i?1:void 0,B=class B extends f{constructor(){super(...arguments);Cr(this,"_formatted",null);Cr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=T(this,!1)),this._fsPath}toString(I=!1){return I?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const I={$mid:1};return this._fsPath&&(I.fsPath=this._fsPath,I._sep=p),this._formatted&&(I.external=this._formatted),this.path&&(I.path=this.path),this.scheme&&(I.scheme=this.scheme),this.authority&&(I.authority=this.authority),this.query&&(I.query=this.query),this.fragment&&(I.fragment=this.fragment),I}};k(B,"d");let g=B;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y($,A,I){let O,N=-1;for(let M=0;M<$.length;M++){const P=$.charCodeAt(M);if(P>=97&&P<=122||P>=65&&P<=90||P>=48&&P<=57||P===45||P===46||P===95||P===126||A&&P===47||I&&P===91||I&&P===93||I&&P===58)N!==-1&&(O+=encodeURIComponent($.substring(N,M)),N=-1),O!==void 0&&(O+=$.charAt(M));else{O===void 0&&(O=$.substr(0,M));const F=m[P];F!==void 0?(N!==-1&&(O+=encodeURIComponent($.substring(N,M)),N=-1),O+=F):N===-1&&(N=M)}}return N!==-1&&(O+=encodeURIComponent($.substring(N))),O!==void 0?O:$}k(y,"m");function v($){let A;for(let I=0;I<$.length;I++){const O=$.charCodeAt(I);O===35||O===63?(A===void 0&&(A=$.substr(0,I)),A+=m[O]):A!==void 0&&(A+=$[I])}return A!==void 0?A:$}k(v,"y");function T($,A){let I;return I=$.authority&&$.path.length>1&&$.scheme==="file"?`//${$.authority}${$.path}`:$.path.charCodeAt(0)===47&&($.path.charCodeAt(1)>=65&&$.path.charCodeAt(1)<=90||$.path.charCodeAt(1)>=97&&$.path.charCodeAt(1)<=122)&&$.path.charCodeAt(2)===58?A?$.path.substr(1):$.path[1].toLowerCase()+$.path.substr(2):$.path,i&&(I=I.replace(/\//g,"\\")),I}k(T,"v");function b($,A){const I=A?v:y;let O="",{scheme:N,authority:M,path:P,query:F,fragment:V}=$;if(N&&(O+=N,O+=":"),(M||N==="file")&&(O+=h,O+=h),M){let z=M.indexOf("@");if(z!==-1){const W=M.substr(0,z);M=M.substr(z+1),z=W.lastIndexOf(":"),z===-1?O+=I(W,!1,!1):(O+=I(W.substr(0,z),!1,!1),O+=":",O+=I(W.substr(z+1),!1,!0)),O+="@"}M=M.toLowerCase(),z=M.lastIndexOf(":"),z===-1?O+=I(M,!1,!0):(O+=I(M.substr(0,z),!1,!0),O+=M.substr(z))}if(P){if(P.length>=3&&P.charCodeAt(0)===47&&P.charCodeAt(2)===58){const z=P.charCodeAt(1);z>=65&&z<=90&&(P=`/${String.fromCharCode(z+32)}:${P.substr(3)}`)}else if(P.length>=2&&P.charCodeAt(1)===58){const z=P.charCodeAt(0);z>=65&&z<=90&&(P=`${String.fromCharCode(z+32)}:${P.substr(2)}`)}O+=I(P,!0,!1)}return F&&(O+="?",O+=I(F,!1,!1)),V&&(O+="#",O+=A?V:y(V,!1,!1)),O}k(b,"b");function C($){try{return decodeURIComponent($)}catch{return $.length>3?$.substr(0,3)+C($.substr(3)):$}}k(C,"C");const w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S($){return $.match(w)?$.replace(w,(A=>C(A))):$}k(S,"w");var E=r(975);const _=E.posix||E,R="/";var D;(function($){$.joinPath=function(A,...I){return A.with({path:_.join(A.path,...I)})},$.resolvePath=function(A,...I){let O=A.path,N=!1;O[0]!==R&&(O=R+O,N=!0);let M=_.resolve(O,...I);return N&&M[0]===R&&!A.authority&&(M=M.substring(1)),A.with({path:M})},$.dirname=function(A){if(A.path.length===0||A.path===R)return A;let I=_.dirname(A.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),A.with({path:I})},$.basename=function(A){return _.basename(A.path)},$.extname=function(A){return _.extname(A.path)}})(D||(D={})),Hfe=n})();var{URI:es,Utils:n1}=Hfe,sa;(function(t){t.basename=n1.basename,t.dirname=n1.dirname,t.extname=n1.extname,t.joinPath=n1.joinPath,t.resolvePath=n1.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}k(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?es.parse(s).path:s.path,u=typeof o=="string"?es.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:sa.joinPath(es.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(sa.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},k(pm,"UriTrie"),pm),yr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(yr||(yr={}));var gm,Yfe=(gm=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=en.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??es.parse(e.uri),en.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return en.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:yr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:yr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=yr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=jE.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},k(gm,"DefaultLangiumDocumentFactory"),gm),mm,Xfe=(mm=class{constructor(e){this.documentTrie=new cB,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Wr(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,yr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=yr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=yr.Changed;return this.documentTrie.delete(r),n}},k(mm,"DefaultLangiumDocuments"),mm),Zu=Symbol("RefResolving"),ym,jfe=(ym=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=en.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Qs(e.parseResult.value))await oi(r),B0(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Qs(e.parseResult.value))await oi(r),B0(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Zu;try{const i=this.getCandidate(e);if(ah(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Zu;try{const i=this.getCandidates(e),a=[];if(ah(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Vn(this._ref))return this._ref;if(Y$(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Zu;const o=yp(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(ah(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=yp(e.container).$document;n&&n.state_d(r)&&r.isMulti)}findDeclarations(e){if(e){const r=BP(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(aa(i)||$o(i))return pE(i);if(Array.isArray(i)){for(const a of i)if((aa(a)||$o(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return pE(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||yP(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of B0(n))if($o(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>sa.equals(a.sourceUri,r.documentUri))),n.push(...i),Wr(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=Zs(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:G0(a),local:!0})}}return n}},k(xm,"DefaultReferences"),xm),bm,Xl=(bm=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return eb.sum(Wr(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?Wr(r):O0}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Wr(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Wr(this.map.keys())}values(){return Wr(this.map.values()).flat()}entriesGroupedByKey(){return Wr(this.map.entries())}},k(bm,"MultiMap"),bm),Tm,ZE=(Tm=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},k(Tm,"BiMap"),Tm),Cm,Qfe=(Cm=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=en.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=iT,i=en.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await oi(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=en.CancellationToken.None){const n=e.parseResult.value,i=new Xl;for(const a of ic(n))await oi(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},k(Cm,"DefaultScopeComputation"),Cm),wm,CD=(wm=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},k(wm,"StreamScope"),wm),Em,NJe=(Em=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?Wr(i).concat(this.outerScope.getElements(e)):Wr(i)}getAllElements(){let e=Wr(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},k(Em,"MapScope"),Em),Sm,Jfe=(Sm=class{constructor(e,r,n){this.elements=new Xl,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?Wr(n).concat(this.outerScope.getElements(e)):Wr(n)}getAllElements(){let e=Wr(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},k(Sm,"MultiMapScope"),Sm),OJe={getElement(){},getElements(){return O0},getAllElements(){return O0}},km,N_=(km=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},k(km,"DisposableCache"),km),_m,hB=(_m=class extends N_{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},k(_m,"SimpleCache"),_m),Am,O_=(Am=class extends N_{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},k(Am,"ContextCache"),Am),Rm,epe=(Rm=class extends O_{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},k(Rm,"DocumentCache"),Rm),Lm,dB=(Lm=class extends hB{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},k(Lm,"WorkspaceCache"),Lm),Im,tpe=(Im=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new dB(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Zs(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new CD(Wr(e),r,n)}createScopeForNodes(e,r,n){const i=Wr(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new CD(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Jfe(this.indexManager.allElements(e)))}},k(Im,"DefaultScopeProvider"),Im);function fB(t){return typeof t.$comment=="string"}k(fB,"isAstNodeWithComment");function wD(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}k(wD,"isIntermediateReference");var Dm,rpe=(Dm=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=k((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Zs(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(aa(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Zs(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if($o(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Zs(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Vn(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=k(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=$P(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Wd(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Wr(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},k(Nm,"ValidationRegistry"),Nm),ape=Object.freeze({validateNode:!0,validateChildren:!0}),Om,spe=(Om=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=en.CancellationToken.None){const i=e.parseResult,a=[];if(await oi(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ms.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ms.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ms.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Wd(s))throw s;console.error("An error occurred during validation:",s)}return await oi(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:bx(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:gB(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=tb(i.token);if(a){const s={severity:bx("error"),range:a,message:i.message,data:_h(ms.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:ms.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=en.CancellationToken.None){const i=[],a=k((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=en.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await oi(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=en.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Qs(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Qs(e).iterator();for(const o of s){await oi(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return ape}async validateAstAfter(e,r,n,i=en.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await oi(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:pB(n),severity:bx(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},k(Om,"DefaultDocumentValidator"),Om);function pB(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Uk(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=PP(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}k(pB,"getDiagnosticRange");function bx(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}k(bx,"toDiagnosticSeverity");function gB(t){switch(t){case"error":return _h(ms.LexingError);case"warning":return _h(ms.LexingWarning);case"info":return _h(ms.LexingInfo);case"hint":return _h(ms.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}k(gB,"toDiagnosticData");var ms;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(ms||(ms={}));var $m,ope=($m=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Zs(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=k(()=>s??(s=G0(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:G0(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},k($m,"DefaultAstNodeDescriptionProvider"),$m),Pm,lpe=(Pm=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=en.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Qs(i))await oi(r),B0(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];aa(r)&&r.$nodeDescription?n=[r.$nodeDescription]:$o(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Zs(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=G0(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:sa.equals(l.documentUri,i)});return s}},k(Pm,"DefaultReferenceDescriptionProvider"),Pm),Bm,cpe=(Bm=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},k(Bm,"DefaultAstNodeLocator"),Bm),$_={};Lk($_,W$(bv()));var Fm,upe=(Fm=class{constructor(e){this._ready=new Yl,this.onConfigurationSectionUpdateEmitter=new $_.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},k(Fm,"DefaultConfigurationProvider"),Fm),f2=W$(gVe()),Mh;(function(t){function e(r){return{dispose:k(async()=>await r(),"dispose")}}k(e,"create"),t.create=e})(Mh||(Mh={}));var zm,hpe=(zm=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Xl,this.documentPhaseListeners=new Xl,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=yr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=en.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===yr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,yr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=yr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=yr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=en.CancellationToken.None){this.currentState=yr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=yr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,yr.Changed)}const s=Wr(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,yr.ComputedScopes)),await this.emitUpdate(a,i),await oi(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return Wr(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Mh.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case yr.Changed:case yr.Parsed:this.indexManager.removeContent(e.uri);case yr.IndexedContent:e.localSymbols=void 0;case yr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case yr.Linked:this.indexManager.removeReferences(e.uri);case yr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case yr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=yr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,yr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,yr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,yr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,yr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,yr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,yr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Mh.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Mh.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=en.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Lo);if(this.currentState>=e&&e>i.state)return Promise.reject(new f2.ResponseError(f2.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${yr[i.state]}, requiring ${yr[e]}, but workspace state is already ${yr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new f2.ResponseError(f2.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{sa.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Lo)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Lo):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Lo)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await oi(n),await s(e,n)}catch(o){if(!Wd(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await oi(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=Wr(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},k(zm,"DefaultDocumentBuilder"),zm),Gm,dpe=(Gm=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new O_,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Zs(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{sa.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Wr(i)}allElements(e,r){let n=Wr(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=en.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=en.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},k(Gm,"DefaultIndexManager"),Gm),Vm,fpe=(Vm=class{constructor(e){this.initialBuildOptions={},this._ready=new Yl,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=en.CancellationToken.None){const n=await this.performStartup(e);await oi(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=k(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=Wr(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return es.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=sa.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},k(Vm,"DefaultWorkspaceManager"),Vm),Wm,ppe=(Wm=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return nD.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return nD.buildUnableToPopLexerModeMessage(e)}},k(Wm,"DefaultLexerErrorMessageProvider"),Wm),mB={mode:"full"},qm,yB=(qm=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=JE(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new la(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=mB){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(JE(e))return e;const r=B_(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},k(qm,"DefaultLexer"),qm);function P_(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}k(P_,"isTokenTypeArray");function B_(t){return t&&"modes"in t&&"defaultMode"in t}k(B_,"isIMultiModeLexerDefinition");function JE(t){return!P_(t)&&!B_(t)}k(JE,"isTokenTypeDictionary");rT();function vB(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Br.create(0,0));const a=bB(t),s=F_(n),o=gpe({lines:a,position:i,options:s});return vpe({index:0,tokens:o,position:i})}k(vB,"parseJSDoc");function xB(t,e){const r=F_(e),n=bB(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}k(xB,"isJSDoc");function bB(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(xie)}k(bB,"getLines");var vq=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,$Je=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function gpe(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=Br.create(r,n);e.push({type:"break",content:"",range:wr.create(p,p)})}}else{vq.lastIndex=d;const p=vq.exec(h);if(p){const g=p[0],m=p[1],y=Br.create(r,n+d),v=Br.create(r,n+d+g.length);e.push({type:"tag",content:m,range:wr.create(y,v)}),d+=g.length,d=eS(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}k(gpe,"tokenize");function mpe(t,e,r,n){const i=[];if(t.length===0){const a=Br.create(r,n),s=Br.create(r,n+e.length);i.push({type:"text",content:e,range:wr.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:wr.create(Br.create(r,a+n),Br.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:wr.create(Br.create(r,a+h+n),Br.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:wr.create(Br.create(r,a+h+n),Br.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:wr.create(Br.create(r,a+h+n),Br.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:wr.create(Br.create(r,a+n),Br.create(r,a+n+s.length))})}return i}k(mpe,"buildInlineTokens");var PJe=/\S/,BJe=/\s*$/;function eS(t,e){const r=t.substring(e).match(PJe);return r?e+r.index:t.length}k(eS,"skipWhitespace");function ype(t){const e=t.match(BJe);if(e&&typeof e.index=="number")return e.index}k(ype,"lastCharacter");function vpe(t){var a,s;const e=Br.create(t.position.line,t.position.character);if(t.tokens.length===0)return new xq([],wr.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=SD(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=SD(r)+i}return r.trim()}},k(Um,"JSDocCommentImpl"),Um),Hm,aI=(Hm=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=Cpe(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} ${r}`),this.inline?`{${i}}`:i}},k(Hm,"JSDocTagImpl"),Hm);function Cpe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=eS(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??wpe(e,a)}}k(Cpe,"renderInlineTag");function wpe(t,e){try{return es.parse(t,!0),`[${e}](${t})`}catch{return t}}k(wpe,"renderLinkDefault");var Ym,ED=(Ym=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` `)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` `)}return r}},k(Ym,"JSDocTextImpl"),Ym),Xm,Epe=(Xm=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},k(Xm,"JSDocLineImpl"),Xm);function SD(t){return t.endsWith(` `)?` `:` `}k(SD,"fillNewlines");var jm,Spe=(jm=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&xB(r))return vB(r).toMarkdown({renderLink:k((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:k(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=Zs(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},k(jm,"JSDocDocumentationProvider"),jm),Km,kpe=(Km=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return fB(e)?e.$comment:(r=TP(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},k(Km,"DefaultCommentProvider"),Km),Zm,_pe=(Zm=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},k(Zm,"DefaultAsyncParser"),Zm),Qm,FJe=(Qm=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new Yl;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new Yl;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Lo)}),this.queue.push(r),r.promise}},k(Qm,"AbstractThreadedAsyncParser"),Qm),Jm,zJe=(Jm=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new $_.Emitter,this.deferred=new Yl,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Lo),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Yl,this.sendMessage(e),this.deferred.promise}},k(Jm,"ParserWorker"),Jm),ey,Ape=(ey=class{constructor(){this.previousTokenSource=new en.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=M_();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=en.CancellationToken.None){const i=new Yl,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Wd(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},k(ey,"DefaultWorkspaceLock"),ey),ty,Rpe=(ty=class{constructor(e){this.grammarElementIdMap=new ZE,this.tokenTypeIdMap=new ZE,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Qs(e))r.set(i,{});if(e.$cstNode)for(const i of z0(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Vn(o)?s.push(this.dehydrateAstNode(o,r)):aa(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Vn(a)?n[i]=this.dehydrateAstNode(a,r):aa(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return Mk(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Fl(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Ed(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Qs(e))r.set(a,{});let i;if(e.$cstNode)for(const a of z0(e.$cstNode)){let s;"fullText"in a?(s=new Z6(a.fullText),i=s):"content"in a?s=new A_:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Vn(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):aa(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Vn(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):aa(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Fl(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new HE(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Qs(this.grammar))Nk(r)&&this.grammarElementIdMap.set(r,e++)}},k(ty,"DefaultHydrator"),ty);function mi(t){return{documentation:{CommentProvider:k(e=>new kpe(e),"CommentProvider"),DocumentationProvider:k(e=>new Spe(e),"DocumentationProvider")},parser:{AsyncParser:k(e=>new _pe(e),"AsyncParser"),GrammarConfig:k(e=>UP(e),"GrammarConfig"),LangiumParser:k(e=>nB(e),"LangiumParser"),CompletionParser:k(e=>rB(e),"CompletionParser"),ValueConverter:k(()=>new aB,"ValueConverter"),TokenBuilder:k(()=>new I_,"TokenBuilder"),Lexer:k(e=>new yB(e),"Lexer"),ParserErrorMessageProvider:k(()=>new J6,"ParserErrorMessageProvider"),LexerErrorMessageProvider:k(()=>new ppe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:k(()=>new cpe,"AstNodeLocator"),AstNodeDescriptionProvider:k(e=>new ope(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:k(e=>new lpe(e),"ReferenceDescriptionProvider")},references:{Linker:k(e=>new jfe(e),"Linker"),NameProvider:k(()=>new Kfe,"NameProvider"),ScopeProvider:k(e=>new tpe(e),"ScopeProvider"),ScopeComputation:k(e=>new Qfe(e),"ScopeComputation"),References:k(e=>new Zfe(e),"References")},serializer:{Hydrator:k(e=>new Rpe(e),"Hydrator"),JsonSerializer:k(e=>new rpe(e),"JsonSerializer")},validation:{DocumentValidator:k(e=>new spe(e),"DocumentValidator"),ValidationRegistry:k(e=>new ipe(e),"ValidationRegistry")},shared:k(()=>t.shared,"shared")}}k(mi,"createDefaultCoreModule");function yi(t){return{ServiceRegistry:k(e=>new npe(e),"ServiceRegistry"),workspace:{LangiumDocuments:k(e=>new Xfe(e),"LangiumDocuments"),LangiumDocumentFactory:k(e=>new Yfe(e),"LangiumDocumentFactory"),DocumentBuilder:k(e=>new hpe(e),"DocumentBuilder"),IndexManager:k(e=>new dpe(e),"IndexManager"),WorkspaceManager:k(e=>new fpe(e),"WorkspaceManager"),FileSystemProvider:k(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:k(()=>new Ape,"WorkspaceLock"),ConfigurationProvider:k(e=>new upe(e),"ConfigurationProvider")},profilers:{}}}k(yi,"createDefaultSharedCoreModule");var kD;(function(t){t.merge=(e,r)=>U0(U0({},e),r)})(kD||(kD={}));function kr(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(U0,{});return SB(u)}k(kr,"inject");var Lpe=Symbol("isProxy");function EB(t){if(t&&t[Lpe])for(const e of Object.values(t))EB(e);return t}k(EB,"eagerLoad");function SB(t,e){const r=new Proxy({},{deleteProperty:k(()=>!1,"deleteProperty"),set:k(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:k((n,i)=>i===Lpe?!0:_D(n,i,t,e||r),"get"),getOwnPropertyDescriptor:k((n,i)=>(_D(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:k((n,i)=>i in t,"has"),ownKeys:k(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}k(SB,"_inject");var bq=Symbol();function _D(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===bq)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=bq;try{t[e]=typeof i=="function"?i(n):SB(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}k(_D,"_resolve");function U0(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=U0(i,n):t[r]=U0({},n)}else t[r]=n}return t}k(U0,"_merge");var AD={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Ah;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(Ah||(Ah={}));var ry,Ipe=(ry=class extends I_{constructor(e=AD){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...AD,...e},this.indentTokenType=xp({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=xp({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!P_(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=Ah.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[Ah.REGULAR]:[l,u,...d,h],[Ah.IGNORE_INDENTATION]:[...d,h]},defaultMode:Ah.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r `.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return xT(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},k(ry,"IndentationAwareTokenBuilder"),ry),ny,GJe=(ny=class extends yB{constructor(e){if(super(e),e.parser.TokenBuilder instanceof Ipe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=mB){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},k(ny,"IndentationAwareLexer"),ny),kB={};gu(kB,{AstUtils:()=>j$,BiMap:()=>ZE,Cancellation:()=>en,ContextCache:()=>O_,CstUtils:()=>H$,DONE_RESULT:()=>ra,Deferred:()=>Yl,Disposable:()=>Mh,DisposableCache:()=>N_,DocumentCache:()=>epe,EMPTY_STREAM:()=>O0,ErrorWithLocation:()=>Gk,GrammarUtils:()=>SP,MultiMap:()=>Xl,OperationCancelled:()=>Lo,Reduction:()=>eb,RegExpUtils:()=>_P,SimpleCache:()=>hB,StreamImpl:()=>Ro,TreeStreamImpl:()=>$0,URI:()=>es,UriTrie:()=>cB,UriUtils:()=>sa,WorkspaceCache:()=>dB,assertCondition:()=>kP,assertUnreachable:()=>mu,delayNextTick:()=>D_,interruptAndCheck:()=>oi,isOperationCancelled:()=>Wd,loadGrammarFromJson:()=>vi,setInterruptionPeriod:()=>sB,startCancelableOperation:()=>M_,stream:()=>Wr});Lk(kB,$_);var iy,Dpe=(iy=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},k(iy,"EmptyFileSystemProvider"),iy),Oi={fileSystemProvider:k(()=>new Dpe,"fileSystemProvider")},VJe={Grammar:k(()=>{},"Grammar"),LanguageMetaData:k(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},WJe={AstReflection:k(()=>new mP,"AstReflection")};function Mpe(){const t=kr(yi(Oi),WJe),e=kr(mi({shared:t}),VJe);return t.ServiceRegistry.register(e),e}k(Mpe,"createMinimalGrammarServices");function vi(t){const e=Mpe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,es.parse(`memory:/${r.name??"grammar"}.langium`)),r}k(vi,"loadGrammarFromJson");Lk(qne,kB);var ay,qJe=(ay=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Xl}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new Npe(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return k(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},k(ay,"DefaultLangiumProfiler"),ay),sy,Npe=(sy=class{constructor(e,r){this.stack=[],this.entries=new Xl,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},k(sy,"ProfilingTask"),sy),RD;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(RD||(RD={}));var LD;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(LD||(LD={}));var ID;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(ID||(ID={}));var DD;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(DD||(DD={}));var MD;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(MD||(MD={}));var ND;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(ND||(ND={}));var OD;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(OD||(OD={}));var $D;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})($D||($D={}));var PD;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(PD||(PD={}));var BD;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(BD||(BD={}));var FD;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(FD||(FD={}));var zD;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(zD||(zD={}));var GD;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(GD||(GD={}));var VD;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(VD||(VD={}));var WD;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(WD||(WD={}));({...RD.Terminals,...LD.Terminals,...ID.Terminals,...DD.Terminals,...MD.Terminals,...ND.Terminals,...OD.Terminals,...$D.Terminals,...PD.Terminals,...BD.Terminals,...FD.Terminals,...zD.Terminals,...VD.Terminals,...GD.Terminals,...WD.Terminals});var Tq={$type:"AbnfAlternation",alternatives:"alternatives"},Cq={$type:"AbnfConcatenation",elements:"elements"},sI={$type:"AbnfElement",primary:"primary",repeat:"repeat"},wq={$type:"AbnfGroup",element:"element"},Eq={$type:"AbnfNumVal",value:"value"},Sq={$type:"AbnfOptionalGroup",element:"element"},sf={$type:"AbnfPrimary"},oI={$type:"AbnfRule",definition:"definition",name:"name"},kq={$type:"AbnfRuleName",name:"name"},_q={$type:"AbnfStringLiteral",value:"value"},p2={$type:"Accelerator",name:"name",x:"x",y:"y"},lI={$type:"Alignment",direction:"direction",members:"members"},g2={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},i1={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},cI={$type:"Annotations",x:"x",y:"y"},xo={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function UJe(t){return $n.isInstance(t,xo.$type)}k(UJe,"isArchitecture");var m2={$type:"Axis",label:"label",name:"name"},OC={$type:"Branch",name:"name",order:"order"};function HJe(t){return $n.isInstance(t,OC.$type)}k(HJe,"isBranch");var Aq={$type:"Checkout",branch:"branch"},y2={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},uI={$type:"ClassDefStatement",className:"className",styleText:"styleText"},kf={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function YJe(t){return $n.isInstance(t,kf.$type)}k(YJe,"isCommit");var v2={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Du={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},x2={$type:"Curve",entries:"entries",label:"label",name:"name"},Qu={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function XJe(t){return $n.isInstance(t,Qu.$type)}k(XJe,"isCynefin");var b2={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Rq={$type:"Decorator",strategy:"strategy"},of={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},$C={$type:"DomainBlock",domain:"domain",items:"items"};function jJe(t){return $n.isInstance(t,$C.$type)}k(jJe,"isDomainBlock");var qD={$type:"DomainItem",label:"label"};function KJe(t){return $n.isInstance(t,qD.$type)}k(KJe,"isDomainItem");var Lq={$type:"EbnfChoice",alternatives:"alternatives"},Iq={$type:"EbnfExceptionPostfix",except:"except"},Dq={$type:"EbnfGroup",element:"element"},Mq={$type:"EbnfNonTerminal",name:"name"},Nq={$type:"EbnfOneOrMorePostfix",operator:"operator"},Oq={$type:"EbnfOptional",element:"element"},$q={$type:"EbnfOptionalPostfix",operator:"operator"},a1={$type:"EbnfPostfix"},Mu={$type:"EbnfPrimary"},Pq={$type:"EbnfRepetition",element:"element"},hI={$type:"EbnfRule",definition:"definition",name:"name"},Bq={$type:"EbnfSequence",elements:"elements"},Fq={$type:"EbnfSpecial",text:"text"},dI={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},zq={$type:"EbnfTerminal",value:"value"},Gq={$type:"EbnfZeroOrMorePostfix",operator:"operator"},po={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},lf={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Nu={$type:"EmFrame"},s1={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Vq={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},fI={$type:"EmModelEntity",name:"name"};function ZJe(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}k(ZJe,"isEmModelEntityType");var T2={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},pl={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function Ope(t){return $n.isInstance(t,pl.$type)}k(Ope,"isEmResetFrame");var mc={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},pI={$type:"Entry",axis:"axis",value:"value"},ol={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Wq={$type:"Evolution",stages:"stages"},C2={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},gI={$type:"Evolve",component:"component",target:"target"},Ju={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function QJe(t){return $n.isInstance(t,Ju.$type)}k(QJe,"isGitGraph");var o1={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},P1={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function JJe(t){return $n.isInstance(t,P1.$type)}k(JJe,"isInfo");var l1={$type:"Item",classSelector:"classSelector",name:"name"},mI={$type:"Junction",id:"id",in:"in"},c1={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},w2={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Ou={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},_f={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function eet(t){return $n.isInstance(t,_f.$type)}k(eet,"isMerge");var E2={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},yI={$type:"Option",name:"name",value:"value"},Af={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function tet(t){return $n.isInstance(t,Af.$type)}k(tet,"isPacket");var Rf={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function ret(t){return $n.isInstance(t,Rf.$type)}k(ret,"isPacketBlock");var qq={$type:"PegAny",dot:"dot"},Uq={$type:"PegGroup",element:"element"},Hq={$type:"PegIdentifier",name:"name"},Yq={$type:"PegLiteral",value:"value"},Xq={$type:"PegOrderedChoice",alternatives:"alternatives"},vI={$type:"PegPrefix",operator:"operator",suffix:"suffix"},u1={$type:"PegPrimary"},xI={$type:"PegRule",definition:"definition",name:"name"},jq={$type:"PegSequence",elements:"elements"},bI={$type:"PegSuffix",operator:"operator",primary:"primary"},eh={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function net(t){return $n.isInstance(t,eh.$type)}k(net,"isPie");var PC={$type:"PieSection",label:"label",value:"value"};function iet(t){return $n.isInstance(t,PC.$type)}k(iet,"isPieSection");var TI={$type:"Pipeline",components:"components",parent:"parent"},S2={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},$u={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Lf={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function aet(t){return $n.isInstance(t,Lf.$type)}k(aet,"isRailroad");var If={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function set(t){return $n.isInstance(t,If.$type)}k(set,"isRailroadAbnf");var Kq={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Df={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function oet(t){return $n.isInstance(t,Df.$type)}k(oet,"isRailroadEbnf");var ll={$type:"RailroadExpression"},Zq={$type:"RailroadNonTerminalExpr",name:"name"},Qq={$type:"RailroadOneOrMoreExpr",element:"element"},Jq={$type:"RailroadOptionalExpr",element:"element"},Mf={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function cet(t){return $n.isInstance(t,Mf.$type)}k(cet,"isRailroadPeg");var CI={$type:"RailroadRule",definition:"definition",name:"name"},eU={$type:"RailroadSequenceExpr",elements:"elements"},tU={$type:"RailroadSpecialExpr",text:"text"},rU={$type:"RailroadTerminalExpr",value:"value"},nU={$type:"RailroadZeroOrMoreExpr",element:"element"},wI={$type:"Section",classSelector:"classSelector",name:"name"},cf={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},EI={$type:"Size",height:"height",width:"width"},uf={$type:"Statement"},B1={$type:"Transition",from:"from",label:"label",to:"to"};function uet(t){return $n.isInstance(t,B1.$type)}k(uet,"isTransition");var Nf={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function het(t){return $n.isInstance(t,Nf.$type)}k(het,"isTreemap");var SI={$type:"TreemapRow",indent:"indent",item:"item"},hf={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},h1={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Ei={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function det(t){return $n.isInstance(t,Ei.$type)}k(det,"isWardley");var oy,$pe=(oy=class extends X${constructor(){super(...arguments),this.types={AbnfAlternation:{name:Tq.$type,properties:{alternatives:{name:Tq.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Cq.$type,properties:{elements:{name:Cq.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:sI.$type,properties:{primary:{name:sI.primary},repeat:{name:sI.repeat}},superTypes:[]},AbnfGroup:{name:wq.$type,properties:{element:{name:wq.element}},superTypes:[sf.$type]},AbnfNumVal:{name:Eq.$type,properties:{value:{name:Eq.value}},superTypes:[sf.$type]},AbnfOptionalGroup:{name:Sq.$type,properties:{element:{name:Sq.element}},superTypes:[sf.$type]},AbnfPrimary:{name:sf.$type,properties:{},superTypes:[]},AbnfRule:{name:oI.$type,properties:{definition:{name:oI.definition},name:{name:oI.name}},superTypes:[]},AbnfRuleName:{name:kq.$type,properties:{name:{name:kq.name}},superTypes:[sf.$type]},AbnfStringLiteral:{name:_q.$type,properties:{value:{name:_q.value}},superTypes:[sf.$type]},Accelerator:{name:p2.$type,properties:{name:{name:p2.name},x:{name:p2.x},y:{name:p2.y}},superTypes:[]},Alignment:{name:lI.$type,properties:{direction:{name:lI.direction},members:{name:lI.members,defaultValue:[]}},superTypes:[]},Anchor:{name:g2.$type,properties:{evolution:{name:g2.evolution},name:{name:g2.name},visibility:{name:g2.visibility}},superTypes:[]},Annotation:{name:i1.$type,properties:{number:{name:i1.number},text:{name:i1.text},x:{name:i1.x},y:{name:i1.y}},superTypes:[]},Annotations:{name:cI.$type,properties:{x:{name:cI.x},y:{name:cI.y}},superTypes:[]},Architecture:{name:xo.$type,properties:{accDescr:{name:xo.accDescr},accTitle:{name:xo.accTitle},alignments:{name:xo.alignments,defaultValue:[]},edges:{name:xo.edges,defaultValue:[]},groups:{name:xo.groups,defaultValue:[]},junctions:{name:xo.junctions,defaultValue:[]},services:{name:xo.services,defaultValue:[]},title:{name:xo.title}},superTypes:[]},Axis:{name:m2.$type,properties:{label:{name:m2.label},name:{name:m2.name}},superTypes:[]},Branch:{name:OC.$type,properties:{name:{name:OC.name},order:{name:OC.order}},superTypes:[uf.$type]},Checkout:{name:Aq.$type,properties:{branch:{name:Aq.branch}},superTypes:[uf.$type]},CherryPicking:{name:y2.$type,properties:{id:{name:y2.id},parent:{name:y2.parent},tags:{name:y2.tags,defaultValue:[]}},superTypes:[uf.$type]},ClassDefStatement:{name:uI.$type,properties:{className:{name:uI.className},styleText:{name:uI.styleText}},superTypes:[]},Commit:{name:kf.$type,properties:{id:{name:kf.id},message:{name:kf.message},tags:{name:kf.tags,defaultValue:[]},type:{name:kf.type}},superTypes:[uf.$type]},Common:{name:v2.$type,properties:{accDescr:{name:v2.accDescr},accTitle:{name:v2.accTitle},title:{name:v2.title}},superTypes:[]},Component:{name:Du.$type,properties:{decorator:{name:Du.decorator},evolution:{name:Du.evolution},inertia:{name:Du.inertia,defaultValue:!1},label:{name:Du.label},name:{name:Du.name},visibility:{name:Du.visibility}},superTypes:[]},Curve:{name:x2.$type,properties:{entries:{name:x2.entries,defaultValue:[]},label:{name:x2.label},name:{name:x2.name}},superTypes:[]},Cynefin:{name:Qu.$type,properties:{accDescr:{name:Qu.accDescr},accTitle:{name:Qu.accTitle},domains:{name:Qu.domains,defaultValue:[]},title:{name:Qu.title},transitions:{name:Qu.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:b2.$type,properties:{name:{name:b2.name},x:{name:b2.x},y:{name:b2.y}},superTypes:[]},Decorator:{name:Rq.$type,properties:{strategy:{name:Rq.strategy}},superTypes:[]},Direction:{name:of.$type,properties:{accDescr:{name:of.accDescr},accTitle:{name:of.accTitle},dir:{name:of.dir},statements:{name:of.statements,defaultValue:[]},title:{name:of.title}},superTypes:[Ju.$type]},DomainBlock:{name:$C.$type,properties:{domain:{name:$C.domain},items:{name:$C.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:qD.$type,properties:{label:{name:qD.label}},superTypes:[]},EbnfChoice:{name:Lq.$type,properties:{alternatives:{name:Lq.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Iq.$type,properties:{except:{name:Iq.except}},superTypes:[a1.$type]},EbnfGroup:{name:Dq.$type,properties:{element:{name:Dq.element}},superTypes:[Mu.$type]},EbnfNonTerminal:{name:Mq.$type,properties:{name:{name:Mq.name}},superTypes:[Mu.$type]},EbnfOneOrMorePostfix:{name:Nq.$type,properties:{operator:{name:Nq.operator}},superTypes:[a1.$type]},EbnfOptional:{name:Oq.$type,properties:{element:{name:Oq.element}},superTypes:[Mu.$type]},EbnfOptionalPostfix:{name:$q.$type,properties:{operator:{name:$q.operator}},superTypes:[a1.$type]},EbnfPostfix:{name:a1.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Mu.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Pq.$type,properties:{element:{name:Pq.element}},superTypes:[Mu.$type]},EbnfRule:{name:hI.$type,properties:{definition:{name:hI.definition},name:{name:hI.name}},superTypes:[]},EbnfSequence:{name:Bq.$type,properties:{elements:{name:Bq.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Fq.$type,properties:{text:{name:Fq.text}},superTypes:[Mu.$type]},EbnfTerm:{name:dI.$type,properties:{base:{name:dI.base},postfixes:{name:dI.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:zq.$type,properties:{value:{name:zq.value}},superTypes:[Mu.$type]},EbnfZeroOrMorePostfix:{name:Gq.$type,properties:{operator:{name:Gq.operator}},superTypes:[a1.$type]},Edge:{name:po.$type,properties:{lhsDir:{name:po.lhsDir},lhsGroup:{name:po.lhsGroup,defaultValue:!1},lhsId:{name:po.lhsId},lhsInto:{name:po.lhsInto,defaultValue:!1},rhsDir:{name:po.rhsDir},rhsGroup:{name:po.rhsGroup,defaultValue:!1},rhsId:{name:po.rhsId},rhsInto:{name:po.rhsInto,defaultValue:!1},title:{name:po.title}},superTypes:[]},EmDataEntity:{name:lf.$type,properties:{dataBlockValue:{name:lf.dataBlockValue},dataType:{name:lf.dataType},name:{name:lf.name}},superTypes:[]},EmFrame:{name:Nu.$type,properties:{},superTypes:[]},EmGwt:{name:s1.$type,properties:{givenStatements:{name:s1.givenStatements,defaultValue:[]},sourceFrame:{name:s1.sourceFrame,referenceType:Nu.$type},thenStatements:{name:s1.thenStatements,defaultValue:[]},whenStatements:{name:s1.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Vq.$type,properties:{entityIdentifier:{name:Vq.entityIdentifier,referenceType:fI.$type}},superTypes:[]},EmModelEntity:{name:fI.$type,properties:{name:{name:fI.name}},superTypes:[]},EmNoteEntity:{name:T2.$type,properties:{dataBlockValue:{name:T2.dataBlockValue},dataType:{name:T2.dataType},sourceFrame:{name:T2.sourceFrame,referenceType:Nu.$type}},superTypes:[]},EmResetFrame:{name:pl.$type,properties:{dataInlineValue:{name:pl.dataInlineValue},dataReference:{name:pl.dataReference,referenceType:lf.$type},dataType:{name:pl.dataType},entityIdentifier:{name:pl.entityIdentifier},modelEntityType:{name:pl.modelEntityType},name:{name:pl.name},sourceFrames:{name:pl.sourceFrames,defaultValue:[],referenceType:Nu.$type}},superTypes:[Nu.$type]},EmTimeFrame:{name:mc.$type,properties:{dataInlineValue:{name:mc.dataInlineValue},dataReference:{name:mc.dataReference,referenceType:lf.$type},dataType:{name:mc.dataType},entityIdentifier:{name:mc.entityIdentifier},modelEntityType:{name:mc.modelEntityType},name:{name:mc.name},sourceFrames:{name:mc.sourceFrames,defaultValue:[],referenceType:Nu.$type}},superTypes:[Nu.$type]},Entry:{name:pI.$type,properties:{axis:{name:pI.axis,referenceType:m2.$type},value:{name:pI.value}},superTypes:[]},EventModel:{name:ol.$type,properties:{accDescr:{name:ol.accDescr},accTitle:{name:ol.accTitle},dataEntities:{name:ol.dataEntities,defaultValue:[]},frames:{name:ol.frames,defaultValue:[]},gwtEntities:{name:ol.gwtEntities,defaultValue:[]},modelEntities:{name:ol.modelEntities,defaultValue:[]},noteEntities:{name:ol.noteEntities,defaultValue:[]},title:{name:ol.title}},superTypes:[]},Evolution:{name:Wq.$type,properties:{stages:{name:Wq.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:C2.$type,properties:{boundary:{name:C2.boundary},name:{name:C2.name},secondName:{name:C2.secondName}},superTypes:[]},Evolve:{name:gI.$type,properties:{component:{name:gI.component},target:{name:gI.target}},superTypes:[]},GitGraph:{name:Ju.$type,properties:{accDescr:{name:Ju.accDescr},accTitle:{name:Ju.accTitle},statements:{name:Ju.statements,defaultValue:[]},title:{name:Ju.title}},superTypes:[]},Group:{name:o1.$type,properties:{icon:{name:o1.icon},id:{name:o1.id},in:{name:o1.in},title:{name:o1.title}},superTypes:[]},Info:{name:P1.$type,properties:{accDescr:{name:P1.accDescr},accTitle:{name:P1.accTitle},title:{name:P1.title}},superTypes:[]},Item:{name:l1.$type,properties:{classSelector:{name:l1.classSelector},name:{name:l1.name}},superTypes:[]},Junction:{name:mI.$type,properties:{id:{name:mI.id},in:{name:mI.in}},superTypes:[]},Label:{name:c1.$type,properties:{negX:{name:c1.negX,defaultValue:!1},negY:{name:c1.negY,defaultValue:!1},offsetX:{name:c1.offsetX},offsetY:{name:c1.offsetY}},superTypes:[]},Leaf:{name:w2.$type,properties:{classSelector:{name:w2.classSelector},name:{name:w2.name},value:{name:w2.value}},superTypes:[l1.$type]},Link:{name:Ou.$type,properties:{arrow:{name:Ou.arrow},from:{name:Ou.from},fromPort:{name:Ou.fromPort},linkLabel:{name:Ou.linkLabel},to:{name:Ou.to},toPort:{name:Ou.toPort}},superTypes:[]},Merge:{name:_f.$type,properties:{branch:{name:_f.branch},id:{name:_f.id},tags:{name:_f.tags,defaultValue:[]},type:{name:_f.type}},superTypes:[uf.$type]},Note:{name:E2.$type,properties:{evolution:{name:E2.evolution},text:{name:E2.text},visibility:{name:E2.visibility}},superTypes:[]},Option:{name:yI.$type,properties:{name:{name:yI.name},value:{name:yI.value,defaultValue:!1}},superTypes:[]},Packet:{name:Af.$type,properties:{accDescr:{name:Af.accDescr},accTitle:{name:Af.accTitle},blocks:{name:Af.blocks,defaultValue:[]},title:{name:Af.title}},superTypes:[]},PacketBlock:{name:Rf.$type,properties:{bits:{name:Rf.bits},end:{name:Rf.end},label:{name:Rf.label},start:{name:Rf.start}},superTypes:[]},PegAny:{name:qq.$type,properties:{dot:{name:qq.dot}},superTypes:[u1.$type]},PegGroup:{name:Uq.$type,properties:{element:{name:Uq.element}},superTypes:[u1.$type]},PegIdentifier:{name:Hq.$type,properties:{name:{name:Hq.name}},superTypes:[u1.$type]},PegLiteral:{name:Yq.$type,properties:{value:{name:Yq.value}},superTypes:[u1.$type]},PegOrderedChoice:{name:Xq.$type,properties:{alternatives:{name:Xq.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:vI.$type,properties:{operator:{name:vI.operator},suffix:{name:vI.suffix}},superTypes:[]},PegPrimary:{name:u1.$type,properties:{},superTypes:[]},PegRule:{name:xI.$type,properties:{definition:{name:xI.definition},name:{name:xI.name}},superTypes:[]},PegSequence:{name:jq.$type,properties:{elements:{name:jq.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:bI.$type,properties:{operator:{name:bI.operator},primary:{name:bI.primary}},superTypes:[]},Pie:{name:eh.$type,properties:{accDescr:{name:eh.accDescr},accTitle:{name:eh.accTitle},sections:{name:eh.sections,defaultValue:[]},showData:{name:eh.showData,defaultValue:!1},title:{name:eh.title}},superTypes:[]},PieSection:{name:PC.$type,properties:{label:{name:PC.label},value:{name:PC.value}},superTypes:[]},Pipeline:{name:TI.$type,properties:{components:{name:TI.components,defaultValue:[]},parent:{name:TI.parent}},superTypes:[]},PipelineComponent:{name:S2.$type,properties:{evolution:{name:S2.evolution},label:{name:S2.label},name:{name:S2.name}},superTypes:[]},Radar:{name:$u.$type,properties:{accDescr:{name:$u.accDescr},accTitle:{name:$u.accTitle},axes:{name:$u.axes,defaultValue:[]},curves:{name:$u.curves,defaultValue:[]},options:{name:$u.options,defaultValue:[]},title:{name:$u.title}},superTypes:[]},Railroad:{name:Lf.$type,properties:{accDescr:{name:Lf.accDescr},accTitle:{name:Lf.accTitle},rules:{name:Lf.rules,defaultValue:[]},title:{name:Lf.title}},superTypes:[]},RailroadAbnf:{name:If.$type,properties:{accDescr:{name:If.accDescr},accTitle:{name:If.accTitle},rules:{name:If.rules,defaultValue:[]},title:{name:If.title}},superTypes:[]},RailroadChoiceExpr:{name:Kq.$type,properties:{alternatives:{name:Kq.alternatives,defaultValue:[]}},superTypes:[ll.$type]},RailroadEbnf:{name:Df.$type,properties:{accDescr:{name:Df.accDescr},accTitle:{name:Df.accTitle},rules:{name:Df.rules,defaultValue:[]},title:{name:Df.title}},superTypes:[]},RailroadExpression:{name:ll.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Zq.$type,properties:{name:{name:Zq.name}},superTypes:[ll.$type]},RailroadOneOrMoreExpr:{name:Qq.$type,properties:{element:{name:Qq.element}},superTypes:[ll.$type]},RailroadOptionalExpr:{name:Jq.$type,properties:{element:{name:Jq.element}},superTypes:[ll.$type]},RailroadPeg:{name:Mf.$type,properties:{accDescr:{name:Mf.accDescr},accTitle:{name:Mf.accTitle},rules:{name:Mf.rules,defaultValue:[]},title:{name:Mf.title}},superTypes:[]},RailroadRule:{name:CI.$type,properties:{definition:{name:CI.definition},name:{name:CI.name}},superTypes:[]},RailroadSequenceExpr:{name:eU.$type,properties:{elements:{name:eU.elements,defaultValue:[]}},superTypes:[ll.$type]},RailroadSpecialExpr:{name:tU.$type,properties:{text:{name:tU.text}},superTypes:[ll.$type]},RailroadTerminalExpr:{name:rU.$type,properties:{value:{name:rU.value}},superTypes:[ll.$type]},RailroadZeroOrMoreExpr:{name:nU.$type,properties:{element:{name:nU.element}},superTypes:[ll.$type]},Section:{name:wI.$type,properties:{classSelector:{name:wI.classSelector},name:{name:wI.name}},superTypes:[l1.$type]},Service:{name:cf.$type,properties:{icon:{name:cf.icon},iconText:{name:cf.iconText},id:{name:cf.id},in:{name:cf.in},title:{name:cf.title}},superTypes:[]},Size:{name:EI.$type,properties:{height:{name:EI.height},width:{name:EI.width}},superTypes:[]},Statement:{name:uf.$type,properties:{},superTypes:[]},Transition:{name:B1.$type,properties:{from:{name:B1.from},label:{name:B1.label},to:{name:B1.to}},superTypes:[]},TreeNode:{name:hf.$type,properties:{classAnnotation:{name:hf.classAnnotation},descAnnotation:{name:hf.descAnnotation},iconAnnotation:{name:hf.iconAnnotation},indent:{name:hf.indent},name:{name:hf.name}},superTypes:[]},TreeView:{name:h1.$type,properties:{accDescr:{name:h1.accDescr},accTitle:{name:h1.accTitle},nodes:{name:h1.nodes,defaultValue:[]},title:{name:h1.title}},superTypes:[]},Treemap:{name:Nf.$type,properties:{accDescr:{name:Nf.accDescr},accTitle:{name:Nf.accTitle},title:{name:Nf.title},TreemapRows:{name:Nf.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:SI.$type,properties:{indent:{name:SI.indent},item:{name:SI.item}},superTypes:[]},Wardley:{name:Ei.$type,properties:{accDescr:{name:Ei.accDescr},accelerators:{name:Ei.accelerators,defaultValue:[]},accTitle:{name:Ei.accTitle},anchors:{name:Ei.anchors,defaultValue:[]},annotation:{name:Ei.annotation,defaultValue:[]},annotations:{name:Ei.annotations,defaultValue:[]},components:{name:Ei.components,defaultValue:[]},deaccelerators:{name:Ei.deaccelerators,defaultValue:[]},evolution:{name:Ei.evolution},evolves:{name:Ei.evolves,defaultValue:[]},links:{name:Ei.links,defaultValue:[]},notes:{name:Ei.notes,defaultValue:[]},pipelines:{name:Ei.pipelines,defaultValue:[]},size:{name:Ei.size},title:{name:Ei.title}},superTypes:[]}}}},k(oy,"MermaidAstReflection"),oy),$n=new $pe,iU,fet=k(()=>iU??(iU=vi(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),aU,pet=k(()=>aU??(aU=vi(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),sU,get=k(()=>sU??(sU=vi('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),oU,met=k(()=>oU??(oU=vi(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),lU,yet=k(()=>lU??(lU=vi(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),cU,vet=k(()=>cU??(cU=vi(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),uU,xet=k(()=>uU??(uU=vi(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),hU,bet=k(()=>hU??(hU=vi(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),dU,Tet=k(()=>dU??(dU=vi('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),fU,Cet=k(()=>fU??(fU=vi(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),pU,wet=k(()=>pU??(pU=vi(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),gU,Eet=k(()=>gU??(gU=vi(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),mU,ket=k(()=>mU??(mU=vi(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),yU,_et=k(()=>yU??(yU=vi(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),vU,Aet=k(()=>vU??(vU=vi(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),Ret={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Let={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Iet={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Det={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Met={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Net={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Oet={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$et={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Pet={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Bet={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Fet={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zet={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Get={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Vet={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wet={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ba={AstReflection:k(()=>new $pe,"AstReflection")},qet={Grammar:k(()=>fet(),"Grammar"),LanguageMetaData:k(()=>Ret,"LanguageMetaData"),parser:{}},Uet={Grammar:k(()=>pet(),"Grammar"),LanguageMetaData:k(()=>Let,"LanguageMetaData"),parser:{}},Het={Grammar:k(()=>get(),"Grammar"),LanguageMetaData:k(()=>Iet,"LanguageMetaData"),parser:{}},Yet={Grammar:k(()=>met(),"Grammar"),LanguageMetaData:k(()=>Det,"LanguageMetaData"),parser:{}},Xet={Grammar:k(()=>yet(),"Grammar"),LanguageMetaData:k(()=>Met,"LanguageMetaData"),parser:{}},jet={Grammar:k(()=>vet(),"Grammar"),LanguageMetaData:k(()=>Net,"LanguageMetaData"),parser:{}},Ket={Grammar:k(()=>xet(),"Grammar"),LanguageMetaData:k(()=>Oet,"LanguageMetaData"),parser:{}},Zet={Grammar:k(()=>bet(),"Grammar"),LanguageMetaData:k(()=>$et,"LanguageMetaData"),parser:{}},Qet={Grammar:k(()=>Tet(),"Grammar"),LanguageMetaData:k(()=>Pet,"LanguageMetaData"),parser:{}},Jet={Grammar:k(()=>Cet(),"Grammar"),LanguageMetaData:k(()=>Bet,"LanguageMetaData"),parser:{}},ett={Grammar:k(()=>wet(),"Grammar"),LanguageMetaData:k(()=>Fet,"LanguageMetaData"),parser:{}},ttt={Grammar:k(()=>Eet(),"Grammar"),LanguageMetaData:k(()=>zet,"LanguageMetaData"),parser:{}},rtt={Grammar:k(()=>ket(),"Grammar"),LanguageMetaData:k(()=>Get,"LanguageMetaData"),parser:{}},ntt={Grammar:k(()=>_et(),"Grammar"),LanguageMetaData:k(()=>Vet,"LanguageMetaData"),parser:{}},itt={Grammar:k(()=>Aet(),"Grammar"),LanguageMetaData:k(()=>Wet,"LanguageMetaData"),parser:{}},att=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,stt=/accTitle[\t ]*:([^\n\r]*)/,ott=/title([\t ][^\n\r]*|)/,ltt={ACC_DESCR:att,ACC_TITLE:stt,TITLE:ott},ly,rl=(ly=class extends aB{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=ltt[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` `)}}},k(ly,"AbstractMermaidValueConverter"),ly),cy,Lv=(cy=class extends rl{runCustomConverter(e,r,n){}},k(cy,"CommonValueConverter"),cy),uy,Ta=(uy=class extends I_{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},k(uy,"AbstractMermaidTokenBuilder"),uy),hy;hy=class extends Ta{},k(hy,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: (** * @license * Lodash (Custom Build) * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) */var dy,ctt=(dy=class extends Ta{constructor(){super(["radar-beta"])}},k(dy,"RadarTokenBuilder"),dy),Ppe={parser:{TokenBuilder:k(()=>new ctt,"TokenBuilder"),ValueConverter:k(()=>new Lv,"ValueConverter")}};function Bpe(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),Zet,Ppe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}k(Bpe,"createRadarServices");var fy,utt=(fy=class extends Ta{constructor(){super(["railroad-beta"])}},k(fy,"RailroadTokenBuilder"),fy),xU=k(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew utt,"TokenBuilder"),ValueConverter:k(()=>new htt,"ValueConverter")}};function _B(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),ett,Fpe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}k(_B,"createRailroadServices");var gy,dtt=(gy=class extends Ta{constructor(){super(["railroad-ebnf-beta"])}},k(gy,"RailroadEbnfTokenBuilder"),gy),bU=k(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew dtt,"TokenBuilder"),ValueConverter:k(()=>new ftt,"ValueConverter")}};function AB(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),Jet,zpe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}k(AB,"createRailroadEbnfServices");var yy,ptt=(yy=class extends Ta{constructor(){super(["railroad-abnf-beta"])}},k(yy,"RailroadAbnfTokenBuilder"),yy),vy,gtt=(vy=class extends rl{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},k(vy,"RailroadAbnfValueConverter"),vy),Gpe={parser:{TokenBuilder:k(()=>new ptt,"TokenBuilder"),ValueConverter:k(()=>new gtt,"ValueConverter")}};function RB(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),Qet,Gpe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}k(RB,"createRailroadAbnfServices");var xy,mtt=(xy=class extends Ta{constructor(){super(["railroad-peg-beta"])}},k(xy,"RailroadPegTokenBuilder"),xy),TU=k(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew mtt,"TokenBuilder"),ValueConverter:k(()=>new ytt,"ValueConverter")}};function LB(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),ttt,Vpe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}k(LB,"createRailroadPegServices");var Ty,vtt=(Ty=class extends Ta{constructor(){super(["treemap"])}},k(Ty,"TreemapTokenBuilder"),Ty),xtt=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Cy,btt=(Cy=class extends rl{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=xtt.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},k(Cy,"TreemapValueConverter"),Cy);function Wpe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}k(Wpe,"registerValidationChecks");var wy,Ttt=(wy=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},k(wy,"TreemapValidator"),wy),qpe={parser:{TokenBuilder:k(()=>new vtt,"TokenBuilder"),ValueConverter:k(()=>new btt,"ValueConverter")},validation:{TreemapValidator:k(()=>new Ttt,"TreemapValidator")}};function Upe(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),rtt,qpe);return e.ServiceRegistry.register(r),Wpe(r),{shared:e,Treemap:r}}k(Upe,"createTreemapServices");var Ey,Ctt=(Ey=class extends rl{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},k(Ey,"WardleyValueConverter"),Ey),Hpe={parser:{ValueConverter:k(()=>new Ctt,"ValueConverter")}};function Ype(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),itt,Hpe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}k(Ype,"createWardleyServices");var Sy,wtt=(Sy=class extends Ta{constructor(){super(["cynefin-beta"])}},k(Sy,"CynefinTokenBuilder"),Sy),Xpe={parser:{TokenBuilder:k(()=>new wtt,"TokenBuilder"),ValueConverter:k(()=>new Lv,"ValueConverter")}};function jpe(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),Uet,Xpe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}k(jpe,"createCynefinServices");var ky,Ett=(ky=class extends Ta{constructor(){super(["gitGraph"])}},k(ky,"GitGraphTokenBuilder"),ky),Kpe={parser:{TokenBuilder:k(()=>new Ett,"TokenBuilder"),ValueConverter:k(()=>new Lv,"ValueConverter")}};function Zpe(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),Yet,Kpe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}k(Zpe,"createGitGraphServices");var _y,Stt=(_y=class extends Ta{constructor(){super(["info","showInfo"])}},k(_y,"InfoTokenBuilder"),_y),Qpe={parser:{TokenBuilder:k(()=>new Stt,"TokenBuilder"),ValueConverter:k(()=>new Lv,"ValueConverter")}};function Jpe(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),Xet,Qpe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}k(Jpe,"createInfoServices");var Ay,ktt=(Ay=class extends Ta{constructor(){super(["packet"])}},k(Ay,"PacketTokenBuilder"),Ay),ege={parser:{TokenBuilder:k(()=>new ktt,"TokenBuilder"),ValueConverter:k(()=>new Lv,"ValueConverter")}};function tge(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),jet,ege);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}k(tge,"createPacketServices");var Ry,_tt=(Ry=class extends Ta{constructor(){super(["pie","showData"])}},k(Ry,"PieTokenBuilder"),Ry),Ly,Att=(Ly=class extends rl{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},k(Ly,"PieValueConverter"),Ly),rge={parser:{TokenBuilder:k(()=>new _tt,"TokenBuilder"),ValueConverter:k(()=>new Att,"ValueConverter")}};function nge(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),Ket,rge);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}k(nge,"createPieServices");var Iy,Rtt=(Iy=class extends rl{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},k(Iy,"TreeViewValueConverter"),Iy),Dy,Ltt=(Dy=class extends Ta{constructor(){super(["treeView-beta"])}},k(Dy,"TreeViewTokenBuilder"),Dy),ige={parser:{TokenBuilder:k(()=>new Ltt,"TokenBuilder"),ValueConverter:k(()=>new Rtt,"ValueConverter")}};function age(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),ntt,ige);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}k(age,"createTreeViewServices");var My,Itt=(My=class extends Ta{constructor(){super(["architecture"])}},k(My,"ArchitectureTokenBuilder"),My),Ny,Dtt=(Ny=class extends rl{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},k(Ny,"ArchitectureValueConverter"),Ny),sge={parser:{TokenBuilder:k(()=>new Itt,"TokenBuilder"),ValueConverter:k(()=>new Dtt,"ValueConverter")}};function oge(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),qet,sge);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}k(oge,"createArchitectureServices");var Oy,Mtt=(Oy=class extends Ta{constructor(){super(["eventmodeling"])}},k(Oy,"EventModelingTokenBuilder"),Oy),CU=new Set(["cmd","command"]),wU=new Set(["evt","event"]),kI=new Set(["rmo","readmodel"]),EU=new Set(["pcr","processor"]),SU=new Set(["ui"]);function lge(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}k(lge,"registerValidationChecks");var $y,Ntt=($y=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(CU.has(e.modelEntityType)?this.validateSources(e,new Set([...SU,...EU]),"command","ui or processor",r):wU.has(e.modelEntityType)?this.validateSources(e,CU,"event","command",r):kI.has(e.modelEntityType)?this.validateSources(e,wU,"read model","event",r):EU.has(e.modelEntityType)?this.validateSources(e,kI,"processor","read model",r):SU.has(e.modelEntityType)&&this.validateSources(e,kI,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},k($y,"EventModelingValidator"),$y),cge={parser:{TokenBuilder:k(()=>new Mtt,"TokenBuilder"),ValueConverter:k(()=>new Lv,"ValueConverter")},validation:{EventModelingValidator:k(()=>new Ntt,"EventModelingValidator")}};function uge(t=Oi){const e=kr(yi(t),ba),r=kr(mi({shared:e}),Het,cge);return e.ServiceRegistry.register(r),lge(r),{shared:e,EventModel:r}}k(uge,"createEventModelingServices");var ki={},Ott={info:k(async()=>{const{createInfoServices:t}=await Bt(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>xpt);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;ki.info=e},"info"),packet:k(async()=>{const{createPacketServices:t}=await Bt(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>bpt);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;ki.packet=e},"packet"),pie:k(async()=>{const{createPieServices:t}=await Bt(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>Tpt);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;ki.pie=e},"pie"),treeView:k(async()=>{const{createTreeViewServices:t}=await Bt(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>Cpt);return{createTreeViewServices:r}},void 0),e=t().TreeView.parser.LangiumParser;ki.treeView=e},"treeView"),architecture:k(async()=>{const{createArchitectureServices:t}=await Bt(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>wpt);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;ki.architecture=e},"architecture"),gitGraph:k(async()=>{const{createGitGraphServices:t}=await Bt(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>Ept);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;ki.gitGraph=e},"gitGraph"),eventmodeling:k(async()=>{const{createEventModelingServices:t}=await Bt(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>Spt);return{createEventModelingServices:r}},void 0),e=t().EventModel.parser.LangiumParser;ki.eventmodeling=e},"eventmodeling"),radar:k(async()=>{const{createRadarServices:t}=await Bt(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>kpt);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;ki.radar=e},"radar"),railroad:k(async()=>{const{createRailroadServices:t}=await Bt(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>_pt);return{createRailroadServices:r}},void 0),e=t().Railroad.parser.LangiumParser;ki.railroad=e},"railroad"),railroadEbnf:k(async()=>{const{createRailroadEbnfServices:t}=await Bt(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>Apt);return{createRailroadEbnfServices:r}},void 0),e=t().RailroadEbnf.parser.LangiumParser;ki.railroadEbnf=e},"railroadEbnf"),railroadAbnf:k(async()=>{const{createRailroadAbnfServices:t}=await Bt(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>Rpt);return{createRailroadAbnfServices:r}},void 0),e=t().RailroadAbnf.parser.LangiumParser;ki.railroadAbnf=e},"railroadAbnf"),railroadPeg:k(async()=>{const{createRailroadPegServices:t}=await Bt(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>Lpt);return{createRailroadPegServices:r}},void 0),e=t().RailroadPeg.parser.LangiumParser;ki.railroadPeg=e},"railroadPeg"),treemap:k(async()=>{const{createTreemapServices:t}=await Bt(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Ipt);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;ki.treemap=e},"treemap"),wardley:k(async()=>{const{createWardleyServices:t}=await Bt(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>Dpt);return{createWardleyServices:r}},void 0),e=t().Wardley.parser.LangiumParser;ki.wardley=e},"wardley"),cynefin:k(async()=>{const{createCynefinServices:t}=await Bt(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>Mpt);return{createCynefinServices:r}},void 0),e=t().Cynefin.parser.LangiumParser;ki.cynefin=e},"cynefin")};async function Rs(t,e){const r=Ott[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);ki[t]||await r();const i=ki[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new wT(i);return i.value}k(Rs,"parse");var Py,wT=(Py=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(` `);super(`Parsing failed: ${r} ${n}`),this.result=e}},k(Py,"MermaidParseError"),Py),Hr={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},$tt=pr.gitGraph,qd=x(()=>fn({...$tt,...It().gitGraph}),"getConfig"),Tt=new z$(()=>{const t=qd(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function z_(){return JX({length:7})}x(z_,"getID");function hge(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}x(hge,"uniqBy");var Ptt=x(function(t){Tt.records.direction=t},"setDirection"),Btt=x(function(t){he.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Tt.records.options=JSON.parse(t)}catch(e){he.error("error while parsing gitGraph options",e.message)}},"setOptions"),Ftt=x(function(){return Tt.records.options},"getOptions"),ztt=x(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;he.info("commit",e,r,n,i),he.debug("Entering commit:",e,r,n,i);const a=qd();r=yt.sanitizeText(r,a),e=yt.sanitizeText(e,a),i=i==null?void 0:i.map(o=>yt.sanitizeText(o,a));const s={id:r||Tt.records.seq+"-"+z_(),message:e,seq:Tt.records.seq++,type:n??Hr.NORMAL,tags:i??[],parents:Tt.records.head==null?[]:[Tt.records.head.id],branch:Tt.records.currBranch};Tt.records.head=s,he.info("main branch",a.mainBranchName),Tt.records.commits.has(s.id)&&he.warn(`Commit ID ${s.id} already exists`),Tt.records.commits.set(s.id,s),Tt.records.branches.set(Tt.records.currBranch,s.id),he.debug("in pushCommit "+s.id)},"commit"),Gtt=x(function(t){let e=t.name;const r=t.order;if(e=yt.sanitizeText(e,qd()),Tt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Tt.records.branches.set(e,Tt.records.head!=null?Tt.records.head.id:null),Tt.records.branchConfig.set(e,{name:e,order:r}),dge(e),he.debug("in createBranch")},"branch"),Vtt=x(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=qd();e=yt.sanitizeText(e,a),r&&(r=yt.sanitizeText(r,a));const s=Tt.records.branches.get(Tt.records.currBranch),o=Tt.records.branches.get(e),l=s?Tt.records.commits.get(s):void 0,u=o?Tt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Tt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Tt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Tt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Tt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Tt.records.seq}-${z_()}`,message:`merged branch ${e} into ${Tt.records.currBranch}`,seq:Tt.records.seq++,parents:Tt.records.head==null?[]:[Tt.records.head.id,h],branch:Tt.records.currBranch,type:Hr.MERGE,customType:n,customId:!!r,tags:i??[]};Tt.records.head=d,Tt.records.commits.set(d.id,d),Tt.records.branches.set(Tt.records.currBranch,d.id),he.debug(Tt.records.branches),he.debug("in mergeBranch")},"merge"),Wtt=x(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;he.debug("Entering cherryPick:",e,r,n);const a=qd();if(e=yt.sanitizeText(e,a),r=yt.sanitizeText(r,a),n=n==null?void 0:n.map(l=>yt.sanitizeText(l,a)),i=yt.sanitizeText(i,a),!e||!Tt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=Tt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===Hr.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Tt.records.commits.has(r)){if(o===Tt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Tt.records.branches.get(Tt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Tt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Tt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Tt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Tt.records.seq+"-"+z_(),message:`cherry-picked ${s==null?void 0:s.message} into ${Tt.records.currBranch}`,seq:Tt.records.seq++,parents:Tt.records.head==null?[]:[Tt.records.head.id,s.id],branch:Tt.records.currBranch,type:Hr.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Hr.MERGE?`|parent:${i}`:""}`]};Tt.records.head=h,Tt.records.commits.set(h.id,h),Tt.records.branches.set(Tt.records.currBranch,h.id),he.debug(Tt.records.branches),he.debug("in cherryPick")}},"cherryPick"),dge=x(function(t){if(t=yt.sanitizeText(t,qd()),Tt.records.branches.has(t)){Tt.records.currBranch=t;const e=Tt.records.branches.get(Tt.records.currBranch);e===void 0||!e?Tt.records.head=null:Tt.records.head=Tt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function UD(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}x(UD,"upsert");function IB(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Tt.records.branches)Tt.records.branches.get(i)===e.id&&n.push(i);if(he.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Tt.records.commits.get(e.parents[0]);UD(t,e,i),e.parents[1]&&t.push(Tt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Tt.records.commits.get(e.parents[0]);UD(t,e,i)}}t=hge(t,i=>i.id),IB(t)}x(IB,"prettyPrintCommitHistory");var qtt=x(function(){he.debug(Tt.records.commits);const t=fge()[0];IB([t])},"prettyPrint"),Utt=x(function(){Tt.reset(),Xr()},"clear"),Htt=x(function(){return[...Tt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Ytt=x(function(){return Tt.records.branches},"getBranches"),Xtt=x(function(){return Tt.records.commits},"getCommits"),fge=x(function(){const t=[...Tt.records.commits.values()];return t.forEach(function(e){he.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),jtt=x(function(){return Tt.records.currBranch},"getCurrentBranch"),Ktt=x(function(){return Tt.records.direction},"getDirection"),Ztt=x(function(){return Tt.records.head},"getHead"),pge={commitType:Hr,getConfig:qd,setDirection:Ptt,setOptions:Btt,getOptions:Ftt,commit:ztt,branch:Gtt,merge:Vtt,cherryPick:Wtt,checkout:dge,prettyPrint:qtt,clear:Utt,getBranchesAsObjArray:Htt,getBranches:Ytt,getCommits:Xtt,getCommitsArray:fge,getCurrentBranch:jtt,getDirection:Ktt,getHead:Ztt,setAccTitle:rn,getAccTitle:pn,getAccDescription:mn,setAccDescription:gn,setDiagramTitle:dn,getDiagramTitle:an},Qtt=x((t,e)=>{va(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)Jtt(r,e)},"populate"),Jtt=x((t,e)=>{const n={Commit:x(i=>e.commit(ert(i)),"Commit"),Branch:x(i=>e.branch(trt(i)),"Branch"),Merge:x(i=>e.merge(rrt(i)),"Merge"),Checkout:x(i=>e.checkout(nrt(i)),"Checkout"),CherryPicking:x(i=>e.cherryPick(irt(i)),"CherryPicking")}[t.$type];n?n(t):he.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),ert=x(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Hr[t.type]:Hr.NORMAL,tags:t.tags??void 0}),"parseCommit"),trt=x(t=>({name:t.name,order:t.order??0}),"parseBranch"),rrt=x(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Hr[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),nrt=x(t=>t.branch,"parseCheckout"),irt=x(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),art={parse:x(async t=>{const e=await Rs("gitGraph",t);he.debug(e),Qtt(e,pge)},"parse")},Nc=10,Oc=40,To=4,vl=2,yh=8,G_=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),HD=12,DB=new Set(["redux-color","redux-dark-color"]),srt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),vh=x((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Ma=new Map,Pa=new Map,tS=30,F1=new Map,rS=[],xl=0,vr="LR",ort=x(()=>{Ma.clear(),Pa.clear(),F1.clear(),xl=0,rS=[],vr="LR"},"clear"),gge=x(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),mge=x(t=>{let e,r,n;return vr==="BT"?(r=x((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=x((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=vr==="TB"||vr=="BT"?(s=Pa.get(i))==null?void 0:s.y:(o=Pa.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),lrt=x(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Pa.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),crt=x((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=hrt(o),i=Math.max(n,i)):a.push(o),drt(o,n)}),n=i,a.forEach(s=>{frt(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=lrt(o.parents);n=Pa.get(l).y-Oc,n<=i&&(i=n);const u=Ma.get(o.branch).pos,h=n-Nc;Pa.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),urt=x(t=>{var n;const e=mge(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Pa.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),hrt=x(t=>urt(t)+Oc,"calculateCommitPosition"),drt=x((t,e)=>{const r=Ma.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Nc;return Pa.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),frt=x((t,e,r)=>{const n=Ma.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Pa.set(t.id,{x:a,y:i})},"setRootPosition"),prt=x((t,e,r,n,i,a)=>{const{theme:s}=Pe(),o=G_.has(s??""),l=DB.has(s??""),u=srt.has(s??"");if(a===Hr.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${vh(i,yh,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${vh(i,yh,l)} ${n}-inner`);else if(a===Hr.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${vh(i,yh,l)}`),a===Hr.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${vh(i,yh,l)}`)}if(a===Hr.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${vh(i,yh,l)}`)}}},"drawCommitBullet"),grt=x((t,e,r,n,i)=>{var a;if(e.type!==Hr.CHERRY_PICK&&(e.customId&&e.type===Hr.MERGE||e.type!==Hr.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-vl).attr("y",r.y+13.5).attr("width",u.width+2*vl).attr("height",u.height+2*vl),vr==="TB"||vr==="BT"?(o.attr("x",r.x-(u.width+4*To+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*To)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(vr==="TB"||vr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),mrt=x((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` ${n-s/2-To/2},${g+vl} ${n-s/2-To/2},${g-vl} ${r.posWithOffset-s/2-To},${g-p-vl} ${r.posWithOffset+s/2+To},${g-p-vl} ${r.posWithOffset+s/2+To},${g+p+vl} ${r.posWithOffset-s/2-To},${g+p+vl}`),h.attr("cy",g).attr("cx",n-s/2+To/2).attr("r",1.5).attr("class","tag-hole"),vr==="TB"||vr==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` ${r.x},${m+2} ${r.x},${m-2} ${r.x+Nc},${m-p-2} ${r.x+Nc+s+4},${m-p-2} ${r.x+Nc+s+4},${m+p+2} ${r.x+Nc},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+To/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),yrt=x(t=>{switch(t.customType??t.type){case Hr.NORMAL:return"commit-normal";case Hr.REVERSE:return"commit-reverse";case Hr.HIGHLIGHT:return"commit-highlight";case Hr.MERGE:return"commit-merge";case Hr.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),vrt=x((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=mge(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Oc:e==="BT"?(n.get(t.id)??i).y-Oc:s.x+Oc}}else return e==="TB"?tS:e==="BT"?(n.get(t.id)??i).y-Oc:0;return 0},"calculatePosition"),xrt=x((t,e,r)=>{var l,u;const n=vr==="BT"&&r?e:e+Nc,i=(l=Ma.get(t.branch))==null?void 0:l.pos,a=vr==="TB"||vr==="BT"?(u=Ma.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=G_.has(Pe().theme??""),o=vr==="TB"||vr==="BT"?n:i+(s?HD/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),kU=x((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=vr==="TB"||vr==="BT"?tS:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=x((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);vr==="BT"&&(l&&crt(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=vrt(f,vr,s,Pa));const p=xrt(f,s,l);if(r){const m=yrt(f),y=f.customType??f.type,v=((g=Ma.get(f.branch))==null?void 0:g.index)??0;prt(i,f,p,m,v,y),grt(a,f,p,s,n),mrt(a,f,p,s)}vr==="TB"||vr==="BT"?Pa.set(f.id,{x:p.x,y:p.posWithOffset}):Pa.set(f.id,{x:p.posWithOffset,y:p.y}),s=vr==="BT"&&l?s+Oc:s+Oc+Nc,s>xl&&(xl=s)})},"drawCommits"),brt=x((t,e,r,n,i)=>{const s=(vr==="TB"||vr==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=x(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),z1=x((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(rS.every(s=>Math.abs(s-n)>=10))return rS.push(n),n;const a=Math.abs(t-e);return z1(t,e-a/5,r+1)},"findLane"),Trt=x((t,e,r,n)=>{var m,y,v,T,b;const{theme:i}=Pe(),a=DB.has(i??""),s=Pa.get(e.id),o=Pa.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=brt(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Ma.get(r.branch))==null?void 0:m.index;r.type===Hr.MERGE&&e.id!==r.parents[0]&&(p=(y=Ma.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const C=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Hr.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):vr==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Hr.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===Hr.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+vh(p,yh,a))},"drawArrow"),Crt=x((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{Trt(r,e.get(a),i,e)})})},"drawArrows"),wrt=x((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Pe(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=G_.has(a??""),h=DB.has(a??""),d=t.append("g");e.forEach((f,p)=>{var L;const g=vh(p,u?l:yh,h),m=(L=Ma.get(f.name))==null?void 0:L.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=vr==="TB"||vr==="BT"?m:u?m+HD/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",xl),v.attr("y2",y),v.attr("class","branch branch"+g),vr==="TB"?(v.attr("y1",tS),v.attr("x1",m),v.attr("y2",xl),v.attr("x2",m)):vr==="BT"&&(v.attr("y1",xl),v.attr("x1",m),v.attr("y2",tS),v.attr("x2",m)),rS.push(y);const T=f.name,b=gge(T),C=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const E=b.getBBox(),_=u?0:4,R=u?16:0,D=u?HD:0;i==="neo"&&C.attr("data-look","neo"),C.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",_).attr("ry",_).attr("x",-E.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-E.height/2+10).attr("width",E.width+18+R).attr("height",E.height+4+D),S.attr("transform","translate("+(-E.width-14-(r.rotateCommitLabel===!0?30:0)+R/2)+", "+(y-E.height/2-2)+")"),vr==="TB"?(C.attr("x",m-E.width/2-10).attr("y",0),S.attr("transform","translate("+(m-E.width/2-5)+", 0)"),u&&(C.attr("transform",`translate(${-R/2-3}, ${-D-10})`),S.attr("transform","translate("+(m-E.width/2-5)+", "+(-D*2+7)+")"))):vr==="BT"?(C.attr("x",m-E.width/2-10).attr("y",xl),S.attr("transform","translate("+(m-E.width/2-5)+", "+xl+")"),u&&(C.attr("transform",`translate(${-R/2-3}, ${D+10})`),S.attr("transform","translate("+(m-E.width/2-5)+", "+(xl+D*2+4)+")"))):C.attr("transform","translate(-19, "+(y-12-D/2)+")")})},"drawBranches"),Ert=x(function(t,e,r,n,i){return Ma.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(vr==="TB"||vr==="BT"?n.width/2:0),e},"setBranchPosition"),Srt=x(function(t,e,r,n){ort(),he.debug("in gitgraph renderer",t+` `,"id:",e,r);const i=n.db;if(!i.getConfig){he.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;F1=i.getCommits();const o=i.getBranchesAsObjArray();vr=i.getDirection();const l=ft(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Pe(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&G_.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,T)=>{var _;const b=gge(v.name),C=l.append("g"),w=C.insert("g").attr("class","branchLabel"),S=w.insert("g").attr("class","label branch-label");(_=S.node())==null||_.appendChild(b);const E=b.getBBox();y=Ert(v.name,y,T,E,s),S.remove(),w.remove(),C.remove()}),kU(l,F1,!1,a),a.showBranches&&wrt(l,o,a,e),Crt(l,F1),kU(l,F1,!0,a),sr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),QM(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),krt={draw:Srt},yge=8,vge=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),_rt=new Set(["redux-color","redux-dark-color"]),Art=new Set(["neo","neo-dark"]),Rrt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Lrt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Irt=x(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=It(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=vge.has(r);if(Art.has(r)){let s="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%yge;return` .branch-label${e} { fill: ${t["gitBranchLabel"+r]}; } .commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } .commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } .label${e} { fill: ${t["git"+r]}; } .arrow${e} { stroke: ${t["git"+r]}; } `}).join(` `)}`,"normalTheme"),Nrt=x(t=>{const e=It(),{theme:r}=e,n=Lrt.has(r);return` .commit-id, .commit-msg, .branch-label { fill: lightgrey; color: lightgrey; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } ${n?Drt(t):Mrt(t)} .branch { stroke-width: ${t.strokeWidth}; stroke: ${t.commitLineColor??t.lineColor}; stroke-dasharray: ${n?"4 2":"2"}; } .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${n?t.nodeBorder:t.commitLabelColor}; ${n?`font-weight:${t.noteFontWeight};`:""}} .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${n?"transparent":t.commitLabelBackground}; opacity: ${n?"":.5}; } .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};} .tag-label-bkg { fill: ${n?t.mainBkg:t.tagLabelBackground}; stroke: ${n?t.nodeBorder:t.tagLabelBorder}; ${n?`filter:${t.dropShadow}`:""} } .tag-hole { fill: ${t.textColor}; } .commit-merge { stroke: ${n?t.mainBkg:t.primaryColor}; fill: ${n?t.mainBkg:t.primaryColor}; } .commit-reverse { stroke: ${n?t.mainBkg:t.primaryColor}; fill: ${n?t.mainBkg:t.primaryColor}; stroke-width: ${n?t.strokeWidth:3}; } .commit-highlight-outer { } .commit-highlight-inner { stroke: ${n?t.mainBkg:t.primaryColor}; fill: ${n?t.mainBkg:t.primaryColor}; } .arrow { /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ stroke-width: ${vge.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } .gitTitleText { text-anchor: middle; font-size: 18px; fill: ${t.textColor}; } `},"getStyles"),Ort=Nrt,$rt={parser:art,db:pge,renderer:krt,styles:Ort};const Prt=Object.freeze(Object.defineProperty({__proto__:null,diagram:$rt},Symbol.toStringTag,{value:"Module"}));var BC={exports:{}},Brt=BC.exports,_U;function Frt(){return _U||(_U=1,(function(t,e){(function(r,n){t.exports=n()})(Brt,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(BC)),BC.exports}var zrt=Frt();const Grt=jl(zrt);var FC={exports:{}},Vrt=FC.exports,AU;function Wrt(){return AU||(AU=1,(function(t,e){(function(r,n){t.exports=n()})(Vrt,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var T=v.match(/([+-]|\d\d)/g),b=60*T[1]+(+T[2]||0);return b===0?0:T[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var T,b=l.meridiem;if(b){for(var C=1;C<=24;C+=1)if(y.indexOf(b(C,0,v))>-1){T=C>12;break}}else T=y===(v?"pm":"PM");return T},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,T=y.match(/\d+/);if(this.day=T[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),T=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,T;v=y,T=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,L,B){var $=B&&B.toUpperCase();return L||T[B]||r[B]||T[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(A,I,O){return I||O.slice(1)}))}))).match(n),C=b.length,w=0;w-1)return new Date((M==="X"?1e3:1)*N);var V=m(M)(N),z=V.year,W=V.month,X=V.day,j=V.hours,re=V.minutes,Q=V.seconds,oe=V.milliseconds,ee=V.zone,ne=V.week,ie=new Date,ae=X||(z||W?1:ie.getDate()),de=z||ie.getFullYear(),le=0;z&&!W||(le=W>0?W-1:ie.getMonth());var ye,$e=j||0,Fe=re||0,ce=Q||0,ve=oe||0;return ee?new Date(Date.UTC(de,le,ae,$e,Fe,ce,ve+60*ee.offset*1e3)):P?new Date(Date.UTC(de,le,ae,$e,Fe,ce,ve)):(ye=new Date(de,le,ae,$e,Fe,ce,ve),ne&&(ye=F(ye).week(ne).toDate()),ye)}catch{return new Date("")}})(S,R,E,T),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),B&&S!=this.format(R)&&(this.$d=new Date("")),l={}}else if(R instanceof Array)for(var A=R.length,I=1;I<=A;I+=1){_[1]=R[I-1];var O=T.apply(this,_);if(O.isValid()){this.$d=O.$d,this.$L=O.$L,this.init();break}I===A&&(this.$d=new Date(""))}else C.call(this,w)}}}))})(FC)),FC.exports}var qrt=Wrt();const Urt=jl(qrt);var zC={exports:{}},Hrt=zC.exports,RU;function Yrt(){return RU||(RU=1,(function(t,e){(function(r,n){t.exports=n()})(Hrt,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(zC)),zC.exports}var Xrt=Yrt();const jrt=jl(Xrt);var GC={exports:{}},Krt=GC.exports,LU;function Zrt(){return LU||(LU=1,(function(t,e){(function(r,n){t.exports=n()})(Krt,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof C},g=function(S,E,_){return new C(S,_,E.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},T=function(S){return Math.abs(S)},b=function(S,E){return S?y(S)?{negative:!0,format:""+T(S)+E}:{negative:!1,format:""+S+E}:{negative:!1,format:""}},C=(function(){function S(_,R,D){var L=this;if(this.$d={},this.$l=D,_===void 0&&(this.$ms=0,this.parseFromMilliseconds()),R)return g(_*f[m(R)],this);if(typeof _=="number")return this.$ms=_,this.parseFromMilliseconds(),this;if(typeof _=="object")return Object.keys(_).forEach((function(A){L.$d[m(A)]=_[A]})),this.calMilliseconds(),this;if(typeof _=="string"){var B=_.match(h);if(B){var $=B.slice(2).map((function(A){return A!=null?Number(A):0}));return this.$d.years=$[0],this.$d.months=$[1],this.$d.weeks=$[2],this.$d.days=$[3],this.$d.hours=$[4],this.$d.minutes=$[5],this.$d.seconds=$[6],this.calMilliseconds(),this}}return this}var E=S.prototype;return E.calMilliseconds=function(){var _=this;this.$ms=Object.keys(this.$d).reduce((function(R,D){return R+(_.$d[D]||0)*f[D]}),0)},E.parseFromMilliseconds=function(){var _=this.$ms;this.$d.years=v(_/l),_%=l,this.$d.months=v(_/u),_%=u,this.$d.days=v(_/o),_%=o,this.$d.hours=v(_/s),_%=s,this.$d.minutes=v(_/a),_%=a,this.$d.seconds=v(_/i),_%=i,this.$d.milliseconds=_},E.toISOString=function(){var _=b(this.$d.years,"Y"),R=b(this.$d.months,"M"),D=+this.$d.days||0;this.$d.weeks&&(D+=7*this.$d.weeks);var L=b(D,"D"),B=b(this.$d.hours,"H"),$=b(this.$d.minutes,"M"),A=this.$d.seconds||0;this.$d.milliseconds&&(A+=this.$d.milliseconds/1e3,A=Math.round(1e3*A)/1e3);var I=b(A,"S"),O=_.negative||R.negative||L.negative||B.negative||$.negative||I.negative,N=B.format||$.format||I.format?"T":"",M=(O?"-":"")+"P"+_.format+R.format+L.format+N+B.format+$.format+I.format;return M==="P"||M==="-P"?"P0D":M},E.toJSON=function(){return this.toISOString()},E.format=function(_){var R=_||"YYYY-MM-DDTHH:mm:ss",D={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return R.replace(d,(function(L,B){return B||String(D[L])}))},E.as=function(_){return this.$ms/f[m(_)]},E.get=function(_){var R=this.$ms,D=m(_);return D==="milliseconds"?R%=1e3:R=D==="weeks"?v(R/f[D]):this.$d[D],R||0},E.add=function(_,R,D){var L;return L=R?_*f[m(R)]:p(_)?_.$ms:g(_,this).$ms,g(this.$ms+L*(D?-1:1),this)},E.subtract=function(_,R){return this.add(_,R,!0)},E.locale=function(_){var R=this.clone();return R.$l=_,R},E.clone=function(){return g(this.$ms,this)},E.humanize=function(_){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!_)},E.valueOf=function(){return this.asMilliseconds()},E.milliseconds=function(){return this.get("milliseconds")},E.asMilliseconds=function(){return this.as("milliseconds")},E.seconds=function(){return this.get("seconds")},E.asSeconds=function(){return this.as("seconds")},E.minutes=function(){return this.get("minutes")},E.asMinutes=function(){return this.as("minutes")},E.hours=function(){return this.get("hours")},E.asHours=function(){return this.as("hours")},E.days=function(){return this.get("days")},E.asDays=function(){return this.as("days")},E.weeks=function(){return this.get("weeks")},E.asWeeks=function(){return this.as("weeks")},E.months=function(){return this.get("months")},E.asMonths=function(){return this.as("months")},E.years=function(){return this.get("years")},E.asYears=function(){return this.as("years")},S})(),w=function(S,E,_){return S.add(E.years()*_,"y").add(E.months()*_,"M").add(E.days()*_,"d").add(E.hours()*_,"h").add(E.minutes()*_,"m").add(E.seconds()*_,"s").add(E.milliseconds()*_,"ms")};return function(S,E,_){r=_,n=_().$utils(),_.duration=function(L,B){var $=_.locale();return g(L,{$l:$},B)},_.isDuration=p;var R=E.prototype.add,D=E.prototype.subtract;E.prototype.add=function(L,B){return p(L)?w(this,L,1):R.bind(this)(L,B)},E.prototype.subtract=function(L,B){return p(L)?w(this,L,-1):D.bind(this)(L,B)}}}))})(GC)),GC.exports}var Qrt=Zrt();const Jrt=jl(Qrt);var YD=(function(){var t=x(function($,A,I,O){for(I=I||{},O=$.length;O--;I[$[O]]=A);return I},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],T=[1,16],b=[1,19],C=[1,20],w=[1,21],S=[1,22],E=[1,23],_=[1,25],R=[1,35],D={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:x(function(A,I,O,N,M,P,F){var V=P.length-1;switch(M){case 1:return P[V-1];case 2:this.$=[];break;case 3:P[V-1].push(P[V]),this.$=P[V-1];break;case 4:case 5:this.$=P[V];break;case 6:case 7:this.$=[];break;case 8:N.setWeekday("monday");break;case 9:N.setWeekday("tuesday");break;case 10:N.setWeekday("wednesday");break;case 11:N.setWeekday("thursday");break;case 12:N.setWeekday("friday");break;case 13:N.setWeekday("saturday");break;case 14:N.setWeekday("sunday");break;case 15:N.setWeekend("friday");break;case 16:N.setWeekend("saturday");break;case 17:N.setDateFormat(P[V].substr(11)),this.$=P[V].substr(11);break;case 18:N.enableInclusiveEndDates(),this.$=P[V].substr(18);break;case 19:N.TopAxis(),this.$=P[V].substr(8);break;case 20:N.setAxisFormat(P[V].substr(11)),this.$=P[V].substr(11);break;case 21:N.setTickInterval(P[V].substr(13)),this.$=P[V].substr(13);break;case 22:N.setExcludes(P[V].substr(9)),this.$=P[V].substr(9);break;case 23:N.setIncludes(P[V].substr(9)),this.$=P[V].substr(9);break;case 24:N.setTodayMarker(P[V].substr(12)),this.$=P[V].substr(12);break;case 27:N.setDiagramTitle(P[V].substr(6)),this.$=P[V].substr(6);break;case 28:this.$=P[V].trim(),N.setAccTitle(this.$);break;case 29:case 30:this.$=P[V].trim(),N.setAccDescription(this.$);break;case 31:N.addSection(P[V].substr(8)),this.$=P[V].substr(8);break;case 33:N.addTask(P[V-1],P[V]),this.$="task";break;case 34:this.$=P[V-1],N.setClickEvent(P[V-1],P[V],null);break;case 35:this.$=P[V-2],N.setClickEvent(P[V-2],P[V-1],P[V]);break;case 36:this.$=P[V-2],N.setClickEvent(P[V-2],P[V-1],null),N.setLink(P[V-2],P[V]);break;case 37:this.$=P[V-3],N.setClickEvent(P[V-3],P[V-2],P[V-1]),N.setLink(P[V-3],P[V]);break;case 38:this.$=P[V-2],N.setClickEvent(P[V-2],P[V],null),N.setLink(P[V-2],P[V-1]);break;case 39:this.$=P[V-3],N.setClickEvent(P[V-3],P[V-1],P[V]),N.setLink(P[V-3],P[V-2]);break;case 40:this.$=P[V-1],N.setLink(P[V-1],P[V]);break;case 41:case 47:this.$=P[V-1]+" "+P[V];break;case 42:case 43:case 45:this.$=P[V-2]+" "+P[V-1]+" "+P[V];break;case 44:case 46:this.$=P[V-3]+" "+P[V-2]+" "+P[V-1]+" "+P[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:C,33:w,35:S,36:E,37:24,38:_,40:R},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:C,33:w,35:S,36:E,37:24,38:_,40:R},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:x(function(A,I){if(I.recoverable)this.trace(A);else{var O=new Error(A);throw O.hash=I,O}},"parseError"),parse:x(function(A){var I=this,O=[0],N=[],M=[null],P=[],F=this.table,V="",z=0,W=0,X=2,j=1,re=P.slice.call(arguments,1),Q=Object.create(this.lexer),oe={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(oe.yy[ee]=this.yy[ee]);Q.setInput(A,oe.yy),oe.yy.lexer=Q,oe.yy.parser=this,typeof Q.yylloc>"u"&&(Q.yylloc={});var ne=Q.yylloc;P.push(ne);var ie=Q.options&&Q.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(be){O.length=O.length-2*be,M.length=M.length-be,P.length=P.length-be}x(ae,"popStack");function de(){var be;return be=N.pop()||Q.lex()||j,typeof be!="number"&&(be instanceof Array&&(N=be,be=N.pop()),be=I.symbols_[be]||be),be}x(de,"lex");for(var le,ye,$e,Fe,ce={},ve,Ce,Ne,Ie;;){if(ye=O[O.length-1],this.defaultActions[ye]?$e=this.defaultActions[ye]:((le===null||typeof le>"u")&&(le=de()),$e=F[ye]&&F[ye][le]),typeof $e>"u"||!$e.length||!$e[0]){var Ae="";Ie=[];for(ve in F[ye])this.terminals_[ve]&&ve>X&&Ie.push("'"+this.terminals_[ve]+"'");Q.showPosition?Ae="Parse error on line "+(z+1)+`: `+Q.showPosition()+` Expecting `+Ie.join(", ")+", got '"+(this.terminals_[le]||le)+"'":Ae="Parse error on line "+(z+1)+": Unexpected "+(le==j?"end of input":"'"+(this.terminals_[le]||le)+"'"),this.parseError(Ae,{text:Q.match,token:this.terminals_[le]||le,line:Q.yylineno,loc:ne,expected:Ie})}if($e[0]instanceof Array&&$e.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ye+", token: "+le);switch($e[0]){case 1:O.push(le),M.push(Q.yytext),P.push(Q.yylloc),O.push($e[1]),le=null,W=Q.yyleng,V=Q.yytext,z=Q.yylineno,ne=Q.yylloc;break;case 2:if(Ce=this.productions_[$e[1]][1],ce.$=M[M.length-Ce],ce._$={first_line:P[P.length-(Ce||1)].first_line,last_line:P[P.length-1].last_line,first_column:P[P.length-(Ce||1)].first_column,last_column:P[P.length-1].last_column},ie&&(ce._$.range=[P[P.length-(Ce||1)].range[0],P[P.length-1].range[1]]),Fe=this.performAction.apply(ce,[V,W,z,oe.yy,$e[1],M,P].concat(re)),typeof Fe<"u")return Fe;Ce&&(O=O.slice(0,-1*Ce*2),M=M.slice(0,-1*Ce),P=P.slice(0,-1*Ce)),O.push(this.productions_[$e[1]][0]),M.push(ce.$),P.push(ce._$),Ne=F[O[O.length-2]][O[O.length-1]],O.push(Ne);break;case 3:return!0}}return!0},"parse")},L=(function(){var $={EOF:1,parseError:x(function(I,O){if(this.yy.parser)this.yy.parser.parseError(I,O);else throw new Error(I)},"parseError"),setInput:x(function(A,I){return this.yy=I||this.yy||{},this._input=A,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var I=A.match(/(?:\r\n?|\n).*/g);return I?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},"input"),unput:x(function(A){var I=A.length,O=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-I),this.offset-=I;var N=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),O.length-1&&(this.yylineno-=O.length-1);var M=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:O?(O.length===N.length?this.yylloc.first_column:0)+N[N.length-O.length].length-O[0].length:this.yylloc.first_column-I},this.options.ranges&&(this.yylloc.range=[M[0],M[0]+this.yyleng-I]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(A){this.unput(this.match.slice(A))},"less"),pastInput:x(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var A=this.pastInput(),I=new Array(A.length+1).join("-");return A+this.upcomingInput()+` `+I+"^"},"showPosition"),test_match:x(function(A,I){var O,N,M;if(this.options.backtrack_lexer&&(M={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(M.yylloc.range=this.yylloc.range.slice(0))),N=A[0].match(/(?:\r\n?|\n).*/g),N&&(this.yylineno+=N.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:N?N[N.length-1].length-N[N.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(A[0].length),this.matched+=A[0],O=this.performAction.call(this,this.yy,this,I,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),O)return O;if(this._backtrack){for(var P in M)this[P]=M[P];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,I,O,N;this._more||(this.yytext="",this.match="");for(var M=this._currentRules(),P=0;PI[0].length)){if(I=O,N=P,this.options.backtrack_lexer){if(A=this.test_match(O,M[P]),A!==!1)return A;if(this._backtrack){I=!1;continue}else return!1}else if(!this.options.flex)break}return I?(A=this.test_match(I,M[N]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var I=this.next();return I||this.lex()},"lex"),begin:x(function(I){this.conditionStack.push(I)},"begin"),popState:x(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:x(function(I){this.begin(I)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(I,O,N,M){switch(N){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return $})();D.lexer=L;function B(){this.yy={}}return x(B,"Parser"),B.prototype=D,D.Parser=B,new B})();YD.parser=YD;var ent=YD;li.extend(Grt);li.extend(Urt);li.extend(jrt);var IU={friday:5,saturday:6},Io="",MB="",NB=void 0,OB="",H0=[],Y0=[],$B=new Map,PB=[],nS=[],X0="",BB="",xge=["active","done","crit","milestone","vert"],FB=[],tp="",ET=!1,zB=!1,GB="sunday",iS="saturday",XD=0,tnt=x(function(){PB=[],nS=[],X0="",FB=[],VC=0,KD=void 0,WC=void 0,Xn=[],Io="",MB="",BB="",NB=void 0,OB="",H0=[],Y0=[],ET=!1,zB=!1,XD=0,$B=new Map,tp="",Xr(),GB="sunday",iS="saturday"},"clear"),rnt=x(function(t){tp=t},"setDiagramId"),nnt=x(function(t){MB=t},"setAxisFormat"),int=x(function(){return MB},"getAxisFormat"),ant=x(function(t){NB=t},"setTickInterval"),snt=x(function(){return NB},"getTickInterval"),ont=x(function(t){OB=t},"setTodayMarker"),lnt=x(function(){return OB},"getTodayMarker"),cnt=x(function(t){Io=t},"setDateFormat"),unt=x(function(){ET=!0},"enableInclusiveEndDates"),hnt=x(function(){return ET},"endDatesAreInclusive"),dnt=x(function(){zB=!0},"enableTopAxis"),fnt=x(function(){return zB},"topAxisEnabled"),pnt=x(function(t){BB=t},"setDisplayMode"),gnt=x(function(){return BB},"getDisplayMode"),mnt=x(function(){return Io},"getDateFormat"),bge=x((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),ynt=x(function(t){H0=bge(H0,t)},"setIncludes"),vnt=x(function(){return H0},"getIncludes"),xnt=x(function(t){Y0=bge(Y0,t)},"setExcludes"),bnt=x(function(){return Y0},"getExcludes"),Tnt=x(function(){return $B},"getLinks"),Cnt=x(function(t){X0=t,PB.push(t)},"addSection"),wnt=x(function(){return PB},"getSections"),Ent=x(function(){let t=DU();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),jD=x(function(t,e,r){if(r=r.trim(),x(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Ud(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=li(r,e.trim(),!0);if(s.isValid())return s.toDate();{he.debug("Invalid date:"+r),he.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),wge=x(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),Ege=x(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Ud(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),$B.set(n,r))}),kge(t,"clickable")},"setLink"),kge=x(function(t,e){t.split(",").forEach(function(r){let n=Ud(r);n!==void 0&&n.classes.push(e)})},"setClass"),Nnt=x(function(t,e,r){if(Pe().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{sr.runFunc(e,...n)})},"setClickFun"),_ge=x(function(t,e){FB.push(function(){const r=tp?`${tp}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=tp?`${tp}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),Ont=x(function(t,e,r){t.split(",").forEach(function(n){Nnt(n,e,r)}),kge(t,"clickable")},"setClickEvent"),$nt=x(function(t){FB.forEach(function(e){e(t)})},"bindFunctions"),Pnt={getConfig:x(()=>Pe().gantt,"getConfig"),clear:tnt,setDateFormat:cnt,getDateFormat:mnt,enableInclusiveEndDates:unt,endDatesAreInclusive:hnt,enableTopAxis:dnt,topAxisEnabled:fnt,setAxisFormat:nnt,getAxisFormat:int,setTickInterval:ant,getTickInterval:snt,setTodayMarker:ont,getTodayMarker:lnt,setAccTitle:rn,getAccTitle:pn,setDiagramTitle:dn,getDiagramTitle:an,setDiagramId:rnt,setDisplayMode:pnt,getDisplayMode:gnt,setAccDescription:gn,getAccDescription:mn,addSection:Cnt,getSections:wnt,getTasks:Ent,addTask:Int,findTaskById:Ud,addTaskOrg:Dnt,setIncludes:ynt,getIncludes:vnt,setExcludes:xnt,getExcludes:bnt,setClickEvent:Ont,setLink:Mnt,getLinks:Tnt,bindFunctions:$nt,parseDuration:wge,isInvalidDate:Tge,setWeekday:Snt,getWeekday:knt,setWeekend:_nt};function VB(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}x(VB,"getTaskTags");li.extend(Jrt);var Bnt=x(function(){he.debug("Something is calling, setConf, remove the call")},"setConf"),MU={monday:Ax,tuesday:GY,wednesday:VY,thursday:Wh,friday:WY,saturday:qY,sunday:Ib},Fnt=x((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),cl,_I=1e4,znt=x(function(t,e,r,n){const i=Pe().gantt;n.db.setDiagramId(e);const a=Pe().securityLevel;let s;a==="sandbox"&&(s=ft("#i"+e));const o=ft(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);cl=u.parentElement.offsetWidth,cl===void 0&&(cl=1200),i.useWidth!==void 0&&(cl=i.useWidth);const h=n.db.getTasks(),d=h.filter(D=>!D.vert);let f=[];for(const D of d)f.push(D.type);f=R(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const D={};for(const B of d)D[B.section]===void 0?D[B.section]=[B]:D[B.section].push(B);let L=0;for(const B of Object.keys(D)){const $=Fnt(D[B],L)+1;L+=$,g+=$*(i.barHeight+i.barGap),p[B]=$}}else{g+=d.length*(i.barHeight+i.barGap);for(const D of f)p[D]=d.filter(L=>L.type===D).length}u.setAttribute("viewBox","0 0 "+cl+" "+g);const m=o.select(`[id="${e}"]`),y=EEe().domain([Ixe(h,function(D){return D.startTime}),Lxe(h,function(D){return D.endTime})]).rangeRound([0,cl-i.leftPadding-i.rightPadding]);function v(D,L){const B=D.startTime,$=L.startTime;let A=0;return B>$?A=1:B<$&&(A=-1),A}x(v,"taskCompare"),h.sort(v),T(h,cl,g),Rn(m,g,cl,i.useMaxWidth),m.append("text").text(n.db.getDiagramTitle()).attr("x",cl/2).attr("y",i.titleTopMargin).attr("class","titleText");function T(D,L,B){const $=i.barHeight,A=$+i.barGap,I=i.topPadding,O=i.leftPadding,N=p0().domain([0,f.length]).range(["#00B9FA","#F95002"]).interpolate(e2e);C(A,I,O,L,B,D,n.db.getExcludes(),n.db.getIncludes()),S(O,I,L,B),b(D,A,I,O,$,N,L),E(A,I),_(O,I,L,B)}x(T,"makeGantt");function b(D,L,B,$,A,I,O){D.sort((W,X)=>W.vert===X.vert?0:W.vert?1:-1);const N=D.filter(W=>!W.vert),P=[...new Set(N.map(W=>W.order))].map(W=>N.find(X=>X.order===W));m.append("g").selectAll("rect").data(P).enter().append("rect").attr("x",0).attr("y",function(W,X){return X=W.order,X*L+B-2}).attr("width",function(){return O-i.rightPadding/2}).attr("height",L).attr("class",function(W){for(const[X,j]of f.entries())if(W.type===j)return"section section"+X%i.numberSectionStyles;return"section section0"}).enter();const F=m.append("g").selectAll("rect").data(D).enter(),V=n.db.getLinks();if(F.append("rect").attr("id",function(W){return e+"-"+W.id}).attr("rx",3).attr("ry",3).attr("x",function(W){return W.milestone?y(W.startTime)+$+.5*(y(W.endTime)-y(W.startTime))-.5*A:y(W.startTime)+$}).attr("y",function(W,X){return X=W.order,W.vert?i.gridLineStartPadding:X*L+B}).attr("width",function(W){return W.milestone?A:W.vert?.08*A:y(W.renderEndTime||W.endTime)-y(W.startTime)}).attr("height",function(W){return W.vert?N.length*(i.barHeight+i.barGap)+i.barHeight*2:A}).attr("transform-origin",function(W,X){return X=W.order,(y(W.startTime)+$+.5*(y(W.endTime)-y(W.startTime))).toString()+"px "+(X*L+B+.5*A).toString()+"px"}).attr("class",function(W){const X="task";let j="";W.classes.length>0&&(j=W.classes.join(" "));let re=0;for(const[oe,ee]of f.entries())W.type===ee&&(re=oe%i.numberSectionStyles);let Q="";return W.active?W.crit?Q+=" activeCrit":Q=" active":W.done?W.crit?Q=" doneCrit":Q=" done":W.crit&&(Q+=" crit"),Q.length===0&&(Q=" task"),W.milestone&&(Q=" milestone "+Q),W.vert&&(Q=" vert "+Q),Q+=re,Q+=" "+j,X+Q}),F.append("text").attr("id",function(W){return e+"-"+W.id+"-text"}).text(function(W){return W.task}).attr("font-size",i.fontSize).attr("x",function(W){let X=y(W.startTime),j=y(W.renderEndTime||W.endTime);if(W.milestone&&(X+=.5*(y(W.endTime)-y(W.startTime))-.5*A,j=X+A),W.vert)return y(W.startTime)+$;const re=this.getBBox().width;return re>j-X?j+re+1.5*i.leftPadding>O?X+$-5:j+$+5:(j-X)/2+X+$}).attr("y",function(W,X){return W.vert?i.gridLineStartPadding+N.length*(i.barHeight+i.barGap)+60:(X=W.order,X*L+i.barHeight/2+(i.fontSize/2-2)+B)}).attr("text-height",A).attr("class",function(W){const X=y(W.startTime);let j=y(W.endTime);W.milestone&&(j=X+A);const re=this.getBBox().width;let Q="";W.classes.length>0&&(Q=W.classes.join(" "));let oe=0;for(const[ne,ie]of f.entries())W.type===ie&&(oe=ne%i.numberSectionStyles);let ee="";return W.active&&(W.crit?ee="activeCritText"+oe:ee="activeText"+oe),W.done?W.crit?ee=ee+" doneCritText"+oe:ee=ee+" doneText"+oe:W.crit&&(ee=ee+" critText"+oe),W.milestone&&(ee+=" milestoneText"),W.vert&&(ee+=" vertText"),re>j-X?j+re+1.5*i.leftPadding>O?Q+" taskTextOutsideLeft taskTextOutside"+oe+" "+ee:Q+" taskTextOutsideRight taskTextOutside"+oe+" "+ee+" width-"+re:Q+" taskText taskText"+oe+" "+ee+" width-"+re}),Pe().securityLevel==="sandbox"){let W;W=ft("#i"+e);const X=W.nodes()[0].contentDocument;F.filter(function(j){return V.has(j.id)}).each(function(j){var re=X.querySelector("#"+CSS.escape(e+"-"+j.id)),Q=X.querySelector("#"+CSS.escape(e+"-"+j.id+"-text"));const oe=re.parentNode;var ee=X.createElement("a");ee.setAttribute("xlink:href",V.get(j.id)),ee.setAttribute("target","_top"),oe.appendChild(ee),ee.appendChild(re),ee.appendChild(Q)})}}x(b,"drawRects");function C(D,L,B,$,A,I,O,N){if(O.length===0&&N.length===0)return;let M,P;for(const{startTime:j,endTime:re}of I)(M===void 0||jP)&&(P=re);if(!M||!P)return;if(li(P).diff(li(M),"year")>5){he.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const F=n.db.getDateFormat(),V=[];let z=null,W=li(M);for(;W.valueOf()<=P;)n.db.isInvalidDate(W,F,O,N)?z?z.end=W:z={start:W,end:W}:z&&(V.push(z),z=null),W=W.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",j=>e+"-exclude-"+j.start.format("YYYY-MM-DD")).attr("x",j=>y(j.start.startOf("day"))+B).attr("y",i.gridLineStartPadding).attr("width",j=>y(j.end.endOf("day"))-y(j.start.startOf("day"))).attr("height",A-L-i.gridLineStartPadding).attr("transform-origin",function(j,re){return(y(j.start)+B+.5*(y(j.end)-y(j.start))).toString()+"px "+(re*D+.5*A).toString()+"px"}).attr("class","exclude-range")}x(C,"drawExcludeDays");function w(D,L,B,$){if(B<=0||D>L)return 1/0;const A=L-D,I=li.duration({[$??"day"]:B}).asMilliseconds();return I<=0?1/0:Math.ceil(A/I)}x(w,"getEstimatedTickCount");function S(D,L,B,$){const A=n.db.getDateFormat(),I=n.db.getAxisFormat();let O;I?O=I:A==="D"?O="%d":O=i.axisFormat??"%Y-%m-%d";let N=zxe(y).tickSize(-$+L+i.gridLineStartPadding).tickFormat(xw(O));const P=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(P!==null){const F=parseInt(P[1],10);if(isNaN(F)||F<=0)he.warn(`Invalid tick interval value: "${P[1]}". Skipping custom tick interval.`);else{const V=P[2],z=n.db.getWeekday()||i.weekday,W=y.domain(),X=W[0],j=W[1],re=w(X,j,F,V);if(re>_I)he.warn(`The tick interval "${F}${V}" would generate ${re} ticks, which exceeds the maximum allowed (${_I}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":N.ticks(g0.every(F));break;case"second":N.ticks(Ac.every(F));break;case"minute":N.ticks(kx.every(F));break;case"hour":N.ticks(_x.every(F));break;case"day":N.ticks(Vh.every(F));break;case"week":N.ticks(MU[z].every(F));break;case"month":N.ticks(Rx.every(F));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+D+", "+($-50)+")").call(N).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let F=Fxe(y).tickSize(-$+L+i.gridLineStartPadding).tickFormat(xw(O));if(P!==null){const V=parseInt(P[1],10);if(isNaN(V)||V<=0)he.warn(`Invalid tick interval value: "${P[1]}". Skipping custom tick interval.`);else{const z=P[2],W=n.db.getWeekday()||i.weekday,X=y.domain(),j=X[0],re=X[1];if(w(j,re,V,z)<=_I)switch(z){case"millisecond":F.ticks(g0.every(V));break;case"second":F.ticks(Ac.every(V));break;case"minute":F.ticks(kx.every(V));break;case"hour":F.ticks(_x.every(V));break;case"day":F.ticks(Vh.every(V));break;case"week":F.ticks(MU[W].every(V));break;case"month":F.ticks(Rx.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+D+", "+L+")").call(F).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}x(S,"makeGrid");function E(D,L){let B=0;const $=Object.keys(p).map(A=>[A,p[A]]);m.append("g").selectAll("text").data($).enter().append(function(A){const I=A[0].split(yt.lineBreakRegex),O=-(I.length-1)/2,N=l.createElementNS("http://www.w3.org/2000/svg","text");N.setAttribute("dy",O+"em");for(const[M,P]of I.entries()){const F=l.createElementNS("http://www.w3.org/2000/svg","tspan");F.setAttribute("alignment-baseline","central"),F.setAttribute("x","10"),M>0&&F.setAttribute("dy","1em"),F.textContent=P,N.appendChild(F)}return N}).attr("x",10).attr("y",function(A,I){if(I>0)for(let O=0;O` .mermaid-main-font { font-family: ${t.fontFamily}; } .exclude-range { fill: ${t.excludeBkgColor}; } .section { stroke: none; opacity: 0.2; } .section0 { fill: ${t.sectionBkgColor}; } .section2 { fill: ${t.sectionBkgColor2}; } .section1, .section3 { fill: ${t.altSectionBkgColor}; opacity: 0.2; } .sectionTitle0 { fill: ${t.titleColor}; } .sectionTitle1 { fill: ${t.titleColor}; } .sectionTitle2 { fill: ${t.titleColor}; } .sectionTitle3 { fill: ${t.titleColor}; } .sectionTitle { text-anchor: start; font-family: ${t.fontFamily}; } /* Grid and axis */ .grid .tick { stroke: ${t.gridColor}; opacity: 0.8; shape-rendering: crispEdges; } .grid .tick text { font-family: ${t.fontFamily}; fill: ${t.textColor}; } .grid path { stroke-width: 0; } /* Today line */ .today { fill: none; stroke: ${t.todayLineColor}; stroke-width: 2px; } /* Task styling */ /* Default task */ .task { stroke-width: 2; } .taskText { text-anchor: middle; font-family: ${t.fontFamily}; } .taskTextOutsideRight { fill: ${t.taskTextDarkColor}; text-anchor: start; font-family: ${t.fontFamily}; } .taskTextOutsideLeft { fill: ${t.taskTextDarkColor}; text-anchor: end; } /* Special case clickable */ .task.clickable { cursor: pointer; } .taskText.clickable { cursor: pointer; fill: ${t.taskTextClickableColor} !important; font-weight: bold; } .taskTextOutsideLeft.clickable { cursor: pointer; fill: ${t.taskTextClickableColor} !important; font-weight: bold; } .taskTextOutsideRight.clickable { cursor: pointer; fill: ${t.taskTextClickableColor} !important; font-weight: bold; } /* Specific task settings for the sections*/ .taskText0, .taskText1, .taskText2, .taskText3 { fill: ${t.taskTextColor}; } .task0, .task1, .task2, .task3 { fill: ${t.taskBkgColor}; stroke: ${t.taskBorderColor}; } .taskTextOutside0, .taskTextOutside2 { fill: ${t.taskTextOutsideColor}; } .taskTextOutside1, .taskTextOutside3 { fill: ${t.taskTextOutsideColor}; } /* Active task */ .active0, .active1, .active2, .active3 { fill: ${t.activeTaskBkgColor}; stroke: ${t.activeTaskBorderColor}; } .activeText0, .activeText1, .activeText2, .activeText3 { fill: ${t.taskTextDarkColor} !important; } /* Completed task */ .done0, .done1, .done2, .done3 { stroke: ${t.doneTaskBorderColor}; fill: ${t.doneTaskBkgColor}; stroke-width: 2; } .doneText0, .doneText1, .doneText2, .doneText3 { fill: ${t.taskTextDarkColor} !important; } /* Done task text displayed outside the bar sits against the diagram background, not against the done-task bar, so it must use the outside/contrast color. */ .doneText0.taskTextOutsideLeft, .doneText0.taskTextOutsideRight, .doneText1.taskTextOutsideLeft, .doneText1.taskTextOutsideRight, .doneText2.taskTextOutsideLeft, .doneText2.taskTextOutsideRight, .doneText3.taskTextOutsideLeft, .doneText3.taskTextOutsideRight { fill: ${t.taskTextOutsideColor} !important; } /* Tasks on the critical line */ .crit0, .crit1, .crit2, .crit3 { stroke: ${t.critBorderColor}; fill: ${t.critBkgColor}; stroke-width: 2; } .activeCrit0, .activeCrit1, .activeCrit2, .activeCrit3 { stroke: ${t.critBorderColor}; fill: ${t.activeTaskBkgColor}; stroke-width: 2; } .doneCrit0, .doneCrit1, .doneCrit2, .doneCrit3 { stroke: ${t.critBorderColor}; fill: ${t.doneTaskBkgColor}; stroke-width: 2; cursor: pointer; shape-rendering: crispEdges; } .milestone { transform: rotate(45deg) scale(0.8,0.8); } .milestoneText { font-style: italic; } .doneCritText0, .doneCritText1, .doneCritText2, .doneCritText3 { fill: ${t.taskTextDarkColor} !important; } /* Done-crit task text outside the bar — same reasoning as doneText above. */ .doneCritText0.taskTextOutsideLeft, .doneCritText0.taskTextOutsideRight, .doneCritText1.taskTextOutsideLeft, .doneCritText1.taskTextOutsideRight, .doneCritText2.taskTextOutsideLeft, .doneCritText2.taskTextOutsideRight, .doneCritText3.taskTextOutsideLeft, .doneCritText3.taskTextOutsideRight { fill: ${t.taskTextOutsideColor} !important; } .vert { stroke: ${t.vertLineColor}; } .vertText { font-size: 15px; text-anchor: middle; fill: ${t.vertLineColor} !important; } .activeCritText0, .activeCritText1, .activeCritText2, .activeCritText3 { fill: ${t.taskTextDarkColor} !important; } .titleText { text-anchor: middle; font-size: 18px; fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } `,"getStyles"),Wnt=Vnt,qnt={parser:ent,db:Pnt,renderer:Gnt,styles:Wnt};const Unt=Object.freeze(Object.defineProperty({__proto__:null,diagram:qnt},Symbol.toStringTag,{value:"Module"}));var Hnt={parse:x(async t=>{const e=await Rs("info",t);he.debug(e)},"parse")},Ynt={version:"11.17.2"},Xnt=x(()=>Ynt.version,"getVersion"),jnt={getVersion:Xnt},Knt=x((t,e,r)=>{he.debug(`rendering info diagram `+t);const n=Yi(e);Rn(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),Znt={draw:Knt},Qnt={parser:Hnt,db:jnt,renderer:Znt};const Jnt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Qnt},Symbol.toStringTag,{value:"Module"}));var eit=pr.pie,WB={sections:new Map,showData:!1},aS=WB.sections,qB=WB.showData,tit=structuredClone(eit),rit=x(()=>structuredClone(tit),"getConfig"),nit=x(()=>{aS=new Map,qB=WB.showData,Xr()},"clear"),iit=x(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);aS.has(t)||(aS.set(t,e),he.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),ait=x(()=>aS,"getSections"),sit=x(t=>{qB=t},"setShowData"),oit=x(()=>qB,"getShowData"),Age={getConfig:rit,clear:nit,setDiagramTitle:dn,getDiagramTitle:an,setAccTitle:rn,getAccTitle:pn,setAccDescription:gn,getAccDescription:mn,addSection:iit,getSections:ait,setShowData:sit,getShowData:oit},lit=x((t,e)=>{va(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),cit={parse:x(async t=>{const e=await Rs("pie",t);he.debug(e),lit(e,Age)},"parse")},uit=x(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; opacity : ${t.pieOpacity}; } .pieCircle.highlighted{ scale: 1.05; opacity: 1; } .pieCircle.highlightedOnHover:hover{ transition-duration: 250ms; scale: 1.05; opacity: 1; } .pieOuterCircle{ stroke: ${t.pieOuterStrokeColor}; stroke-width: ${t.pieOuterStrokeWidth}; fill: none; } .pieTitleText { text-anchor: middle; font-size: ${t.pieTitleTextSize}; fill: ${t.pieTitleTextColor}; font-family: ${t.fontFamily}; } .slice { font-family: ${t.fontFamily}; fill: ${t.pieSectionTextColor}; font-size:${t.pieSectionTextSize}; // fill: white; } .legend text { fill: ${t.pieLegendTextColor}; font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } `,"getStyles"),hit=uit,dit=x(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return FEe().value(i=>i.value).sort(null)(r)},"createPieArcs"),fit=x((t,e,r,n)=>{var Q;he.debug(`rendering pie chart `+t);const i=n.db,a=Pe(),s=fn(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=Yi(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=Zl(g.pieOuterStrokeWidth);m??(m=2);const y=s.legendPosition,v=s.textPosition,T=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,b=Math.min(d,h)/2-o,C=y0().innerRadius(T*b).outerRadius(b),w=y0().innerRadius(b*v).outerRadius(b*v),S=p.append("g");S.append("circle").attr("cx",0).attr("cy",0).attr("r",b+m/2).attr("class","pieOuterCircle");const E=i.getSections(),_=dit(E),R=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let D=0;E.forEach(oe=>{D+=oe});const L=_.filter(oe=>(oe.data.value/D*100).toFixed(0)!=="0"),B=Ih(R).domain([...E.keys()]);S.selectAll("mySlices").data(L).enter().append("path").attr("d",C).attr("fill",oe=>B(oe.data.label)).attr("class",oe=>{let ee="pieCircle";return s.highlightSlice==="hover"?ee+=" highlightedOnHover":s.highlightSlice===oe.data.label&&(ee+=" highlighted"),ee}),S.selectAll("mySlices").data(L).enter().append("text").text(oe=>(oe.data.value/D*100).toFixed(0)+"%").attr("transform",oe=>"translate("+w.centroid(oe)+")").style("text-anchor","middle").attr("class","slice");const $=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),A=[...E.entries()].map(([oe,ee])=>({label:oe,value:ee})),I=p.selectAll(".legend").data(A).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",oe=>B(oe.label)).style("stroke",oe=>B(oe.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(oe=>i.getShowData()?`${oe.label} [${oe.value}]`:oe.label);const O=Math.max(...I.selectAll("text").nodes().map(oe=>(oe==null?void 0:oe.getBoundingClientRect().width)??0));let N=h,M=d+o;const P=l+u,F=A.length*P;switch(y){case"center":I.attr("transform",(oe,ee)=>{const ne=P*A.length/2,ie=-O/2-(l+u),ae=ee*P-ne;return"translate("+ie+","+ae+")"});break;case"top":N+=F,I.attr("transform",(oe,ee)=>{const ne=b,ie=-O/2-(l+u),ae=ee*P-ne;return`translate(${ie}, ${ae})`}),S.attr("transform",()=>`translate(0, ${F+P})`);break;case"bottom":N+=F,I.attr("transform",(oe,ee)=>{const ne=-b-P,ie=-O/2-(l+u),ae=ee*P-ne;return"translate("+ie+","+ae+")"});break;case"left":M+=l+u+O,I.attr("transform",(oe,ee)=>{const ne=P*A.length/2,ie=-b-(l+u),ae=ee*P-ne;return"translate("+ie+","+ae+")"}),S.attr("transform",()=>`translate(${O+l+u}, 0)`);break;case"right":default:M+=l+u+O,I.attr("transform",(oe,ee)=>{const ne=P*A.length/2,ie=12*l,ae=ee*P-ne;return"translate("+ie+","+ae+")"});break}const V=((Q=$.node())==null?void 0:Q.getBoundingClientRect().width)??0,z=d/2-V/2,W=d/2+V/2,X=Math.min(0,z),re=Math.max(M,W)-X;f.attr("viewBox",`${X} 0 ${re} ${N}`),Rn(f,N,re,s.useMaxWidth)},"draw"),pit={draw:fit},git={parser:cit,db:Age,renderer:pit,styles:hit};const mit=Object.freeze(Object.defineProperty({__proto__:null,diagram:git},Symbol.toStringTag,{value:"Module"}));var ZD=(function(){var t=x(function(K,U,Y,fe){for(Y=Y||{},fe=K.length;fe--;Y[K[fe]]=U);return Y},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],T=[1,23],b=[1,18],C=[1,19],w=[1,20],S=[1,21],E=[1,22],_=[1,24],R=[1,25],D=[1,26],L=[1,27],B=[1,28],$=[1,29],A=[1,32],I=[1,33],O=[1,34],N=[1,39],M=[1,40],P=[1,42],F=[1,44],V=[1,63],z=[1,62],W=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],X=[1,66],j=[1,67],re=[1,68],Q=[1,69],oe=[1,70],ee=[1,71],ne=[1,72],ie=[1,73],ae=[1,74],de=[1,75],le=[1,76],ye=[1,77],$e=[4,5,6,7,8,9,10,11,12,13,14,15,18],Fe=[1,91],ce=[1,92],ve=[1,93],Ce=[1,100],Ne=[1,94],Ie=[1,97],Ae=[1,95],be=[1,96],ke=[1,98],se=[1,99],J=[1,103],G=[10,55,56,57],q=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],H={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:x(function(U,Y,fe,ue,Te,ge,we){var xe=ge.length-1;switch(Te){case 23:this.$=ge[xe];break;case 24:this.$=ge[xe-1]+""+ge[xe];break;case 26:this.$=ge[xe-1]+ge[xe];break;case 27:this.$=[ge[xe].trim()];break;case 28:ge[xe-2].push(ge[xe].trim()),this.$=ge[xe-2];break;case 29:this.$=ge[xe-4],ue.addClass(ge[xe-2],ge[xe]);break;case 37:this.$=[];break;case 42:this.$=ge[xe].trim(),ue.setDiagramTitle(this.$);break;case 43:this.$=ge[xe].trim(),ue.setAccTitle(this.$);break;case 44:case 45:this.$=ge[xe].trim(),ue.setAccDescription(this.$);break;case 46:ue.addSection(ge[xe].substr(8)),this.$=ge[xe].substr(8);break;case 47:ue.addPoint(ge[xe-3],"",ge[xe-1],ge[xe],[]);break;case 48:ue.addPoint(ge[xe-4],ge[xe-3],ge[xe-1],ge[xe],[]);break;case 49:ue.addPoint(ge[xe-4],"",ge[xe-2],ge[xe-1],ge[xe]);break;case 50:ue.addPoint(ge[xe-5],ge[xe-4],ge[xe-2],ge[xe-1],ge[xe]);break;case 51:ue.setXAxisLeftText(ge[xe-2]),ue.setXAxisRightText(ge[xe]);break;case 52:ge[xe-1].text+=" ⟶ ",ue.setXAxisLeftText(ge[xe-1]);break;case 53:ue.setXAxisLeftText(ge[xe]);break;case 54:ue.setYAxisBottomText(ge[xe-2]),ue.setYAxisTopText(ge[xe]);break;case 55:ge[xe-1].text+=" ⟶ ",ue.setYAxisBottomText(ge[xe-1]);break;case 56:ue.setYAxisBottomText(ge[xe]);break;case 57:ue.setQuadrant1Text(ge[xe]);break;case 58:ue.setQuadrant2Text(ge[xe]);break;case 59:ue.setQuadrant3Text(ge[xe]);break;case 60:ue.setQuadrant4Text(ge[xe]);break;case 64:this.$={text:ge[xe],type:"text"};break;case 65:this.$={text:ge[xe-1].text+""+ge[xe],type:ge[xe-1].type};break;case 66:this.$={text:ge[xe],type:"text"};break;case 67:this.$={text:ge[xe],type:"markdown"};break;case 68:this.$=ge[xe];break;case 69:this.$=ge[xe-1]+""+ge[xe];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:C,39:w,41:S,42:E,48:_,50:R,51:D,52:L,53:B,54:$,60:A,61:I,63:O,64:N,65:M,66:P,67:F}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:C,39:w,41:S,42:E,48:_,50:R,51:D,52:L,53:B,54:$,60:A,61:I,63:O,64:N,65:M,66:P,67:F}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:A,61:I,63:O,64:N,65:M,66:P,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:A,61:I,63:O,64:N,65:M,66:P,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:A,61:I,63:O,64:N,65:M,66:P,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:A,61:I,63:O,64:N,65:M,66:P,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:A,61:I,63:O,64:N,65:M,66:P,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:A,61:I,63:O,64:N,65:M,66:P,67:F},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,44:[1,58],47:[1,59],58:61,59:60,63:O,64:N,65:M,66:P,67:F},t(W,[2,64]),t(W,[2,66]),t(W,[2,67]),t(W,[2,70]),t(W,[2,71]),t(W,[2,72]),t(W,[2,73]),t(W,[2,74]),t(W,[2,75]),t(W,[2,76]),t(W,[2,77]),t(W,[2,78]),t(W,[2,79]),t(W,[2,80]),t(W,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:X,5:j,6:re,7:Q,8:oe,9:ee,10:ne,11:ie,12:ae,13:de,14:le,15:ye,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,49:[1,78],63:O,64:N,65:M,66:P,67:F}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,49:[1,79],63:O,64:N,65:M,66:P,67:F}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:N,65:M,66:P,67:F}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:N,65:M,66:P,67:F}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:N,65:M,66:P,67:F}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:N,65:M,66:P,67:F}),{45:[1,80]},{44:[1,81]},t(W,[2,65]),t(W,[2,82]),t(W,[2,83]),t(W,[2,84]),{3:83,4:X,5:j,6:re,7:Q,8:oe,9:ee,10:ne,11:ie,12:ae,13:de,14:le,15:ye,18:[1,82]},t($e,[2,23]),t($e,[2,1]),t($e,[2,2]),t($e,[2,3]),t($e,[2,4]),t($e,[2,5]),t($e,[2,6]),t($e,[2,7]),t($e,[2,8]),t($e,[2,9]),t($e,[2,10]),t($e,[2,11]),t($e,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:A,61:I,63:O,64:N,65:M,66:P,67:F}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:A,61:I,63:O,64:N,65:M,66:P,67:F}),{46:[1,86]},{45:[1,87]},{4:Fe,5:ce,6:ve,8:Ce,11:Ne,13:Ie,16:90,17:Ae,18:be,19:ke,20:se,22:89,23:88},t($e,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:N,65:M,66:P,67:F}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:z,63:O,64:N,65:M,66:P,67:F}),t(l,[2,47],{22:89,16:90,23:101,4:Fe,5:ce,6:ve,8:Ce,11:Ne,13:Ie,17:Ae,18:be,19:ke,20:se}),{46:[1,102]},t(l,[2,29],{10:J}),t(G,[2,27],{16:104,4:Fe,5:ce,6:ve,8:Ce,11:Ne,13:Ie,17:Ae,18:be,19:ke,20:se}),t(q,[2,25]),t(q,[2,13]),t(q,[2,14]),t(q,[2,15]),t(q,[2,16]),t(q,[2,17]),t(q,[2,18]),t(q,[2,19]),t(q,[2,20]),t(q,[2,21]),t(q,[2,22]),t(l,[2,49],{10:J}),t(l,[2,48],{22:89,16:90,23:105,4:Fe,5:ce,6:ve,8:Ce,11:Ne,13:Ie,17:Ae,18:be,19:ke,20:se}),{4:Fe,5:ce,6:ve,8:Ce,11:Ne,13:Ie,16:90,17:Ae,18:be,19:ke,20:se,22:106},t(q,[2,26]),t(l,[2,50],{10:J}),t(G,[2,28],{16:104,4:Fe,5:ce,6:ve,8:Ce,11:Ne,13:Ie,17:Ae,18:be,19:ke,20:se})],defaultActions:{8:[2,30],9:[2,31]},parseError:x(function(U,Y){if(Y.recoverable)this.trace(U);else{var fe=new Error(U);throw fe.hash=Y,fe}},"parseError"),parse:x(function(U){var Y=this,fe=[0],ue=[],Te=[null],ge=[],we=this.table,xe="",Le=0,_e=0,Be=2,Ee=1,Xe=ge.slice.call(arguments,1),Re=Object.create(this.lexer),Qe={yy:{}};for(var it in this.yy)Object.prototype.hasOwnProperty.call(this.yy,it)&&(Qe.yy[it]=this.yy[it]);Re.setInput(U,Qe.yy),Qe.yy.lexer=Re,Qe.yy.parser=this,typeof Re.yylloc>"u"&&(Re.yylloc={});var Ue=Re.yylloc;ge.push(Ue);var mt=Re.options&&Re.options.ranges;typeof Qe.yy.parseError=="function"?this.parseError=Qe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ot(wt){fe.length=fe.length-2*wt,Te.length=Te.length-wt,ge.length=ge.length-wt}x(ot,"popStack");function Ke(){var wt;return wt=ue.pop()||Re.lex()||Ee,typeof wt!="number"&&(wt instanceof Array&&(ue=wt,wt=ue.pop()),wt=Y.symbols_[wt]||wt),wt}x(Ke,"lex");for(var me,dt,at,et,ct={},Gt,Se,We,Je;;){if(dt=fe[fe.length-1],this.defaultActions[dt]?at=this.defaultActions[dt]:((me===null||typeof me>"u")&&(me=Ke()),at=we[dt]&&we[dt][me]),typeof at>"u"||!at.length||!at[0]){var nt="";Je=[];for(Gt in we[dt])this.terminals_[Gt]&&Gt>Be&&Je.push("'"+this.terminals_[Gt]+"'");Re.showPosition?nt="Parse error on line "+(Le+1)+`: `+Re.showPosition()+` Expecting `+Je.join(", ")+", got '"+(this.terminals_[me]||me)+"'":nt="Parse error on line "+(Le+1)+": Unexpected "+(me==Ee?"end of input":"'"+(this.terminals_[me]||me)+"'"),this.parseError(nt,{text:Re.match,token:this.terminals_[me]||me,line:Re.yylineno,loc:Ue,expected:Je})}if(at[0]instanceof Array&&at.length>1)throw new Error("Parse Error: multiple actions possible at state: "+dt+", token: "+me);switch(at[0]){case 1:fe.push(me),Te.push(Re.yytext),ge.push(Re.yylloc),fe.push(at[1]),me=null,_e=Re.yyleng,xe=Re.yytext,Le=Re.yylineno,Ue=Re.yylloc;break;case 2:if(Se=this.productions_[at[1]][1],ct.$=Te[Te.length-Se],ct._$={first_line:ge[ge.length-(Se||1)].first_line,last_line:ge[ge.length-1].last_line,first_column:ge[ge.length-(Se||1)].first_column,last_column:ge[ge.length-1].last_column},mt&&(ct._$.range=[ge[ge.length-(Se||1)].range[0],ge[ge.length-1].range[1]]),et=this.performAction.apply(ct,[xe,_e,Le,Qe.yy,at[1],Te,ge].concat(Xe)),typeof et<"u")return et;Se&&(fe=fe.slice(0,-1*Se*2),Te=Te.slice(0,-1*Se),ge=ge.slice(0,-1*Se)),fe.push(this.productions_[at[1]][0]),Te.push(ct.$),ge.push(ct._$),We=we[fe[fe.length-2]][fe[fe.length-1]],fe.push(We);break;case 3:return!0}}return!0},"parse")},Z=(function(){var K={EOF:1,parseError:x(function(Y,fe){if(this.yy.parser)this.yy.parser.parseError(Y,fe);else throw new Error(Y)},"parseError"),setInput:x(function(U,Y){return this.yy=Y||this.yy||{},this._input=U,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var U=this._input[0];this.yytext+=U,this.yyleng++,this.offset++,this.match+=U,this.matched+=U;var Y=U.match(/(?:\r\n?|\n).*/g);return Y?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),U},"input"),unput:x(function(U){var Y=U.length,fe=U.split(/(?:\r\n?|\n)/g);this._input=U+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Y),this.offset-=Y;var ue=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),fe.length-1&&(this.yylineno-=fe.length-1);var Te=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:fe?(fe.length===ue.length?this.yylloc.first_column:0)+ue[ue.length-fe.length].length-fe[0].length:this.yylloc.first_column-Y},this.options.ranges&&(this.yylloc.range=[Te[0],Te[0]+this.yyleng-Y]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(U){this.unput(this.match.slice(U))},"less"),pastInput:x(function(){var U=this.matched.substr(0,this.matched.length-this.match.length);return(U.length>20?"...":"")+U.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var U=this.match;return U.length<20&&(U+=this._input.substr(0,20-U.length)),(U.substr(0,20)+(U.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var U=this.pastInput(),Y=new Array(U.length+1).join("-");return U+this.upcomingInput()+` `+Y+"^"},"showPosition"),test_match:x(function(U,Y){var fe,ue,Te;if(this.options.backtrack_lexer&&(Te={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Te.yylloc.range=this.yylloc.range.slice(0))),ue=U[0].match(/(?:\r\n?|\n).*/g),ue&&(this.yylineno+=ue.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ue?ue[ue.length-1].length-ue[ue.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+U[0].length},this.yytext+=U[0],this.match+=U[0],this.matches=U,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(U[0].length),this.matched+=U[0],fe=this.performAction.call(this,this.yy,this,Y,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),fe)return fe;if(this._backtrack){for(var ge in Te)this[ge]=Te[ge];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var U,Y,fe,ue;this._more||(this.yytext="",this.match="");for(var Te=this._currentRules(),ge=0;geY[0].length)){if(Y=fe,ue=ge,this.options.backtrack_lexer){if(U=this.test_match(fe,Te[ge]),U!==!1)return U;if(this._backtrack){Y=!1;continue}else return!1}else if(!this.options.flex)break}return Y?(U=this.test_match(Y,Te[ue]),U!==!1?U:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Y=this.next();return Y||this.lex()},"lex"),begin:x(function(Y){this.conditionStack.push(Y)},"begin"),popState:x(function(){var Y=this.conditionStack.length-1;return Y>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Y){return Y=this.conditionStack.length-1-Math.abs(Y||0),Y>=0?this.conditionStack[Y]:"INITIAL"},"topState"),pushState:x(function(Y){this.begin(Y)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Y,fe,ue,Te){switch(ue){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return K})();H.lexer=Z;function te(){this.yy={}}return x(te,"Parser"),te.prototype=H,H.Parser=te,new te})();ZD.parser=ZD;var yit=ZD,Qi=Kl(),By,vit=(By=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=pr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=pr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=pr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=pr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=pr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=pr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=pr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=pr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=pr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=pr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=pr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=pr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=pr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=pr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=pr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=pr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=pr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((T=pr.quadrantChart)==null?void 0:T.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:Qi.quadrant1Fill,quadrant2Fill:Qi.quadrant2Fill,quadrant3Fill:Qi.quadrant3Fill,quadrant4Fill:Qi.quadrant4Fill,quadrant1TextFill:Qi.quadrant1TextFill,quadrant2TextFill:Qi.quadrant2TextFill,quadrant3TextFill:Qi.quadrant3TextFill,quadrant4TextFill:Qi.quadrant4TextFill,quadrantPointFill:Qi.quadrantPointFill,quadrantPointTextFill:Qi.quadrantPointTextFill,quadrantXAxisTextFill:Qi.quadrantXAxisTextFill,quadrantYAxisTextFill:Qi.quadrantYAxisTextFill,quadrantTitleFill:Qi.quadrantTitleFill,quadrantInternalBorderStrokeFill:Qi.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:Qi.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,he.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){he.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){he.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=p0().domain([0,1]).range([i,s+i]),l=p0().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},x(By,"QuadrantBuilder"),By),Fy,k2=(Fy=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},x(Fy,"InvalidStyleError"),Fy);function QD(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}x(QD,"validateHexCode");function Rge(t){return!/^\d+$/.test(t)}x(Rge,"validateNumber");function Lge(t){return!/^\d+px$/.test(t)}x(Lge,"validateSizeInPixels");function nl(t){return xr(t.trim(),Pe())}x(nl,"textSanitizer");var Ai=new vit;function Ige(t){Ai.setData({quadrant1Text:nl(t.text)})}x(Ige,"setQuadrant1Text");function Dge(t){Ai.setData({quadrant2Text:nl(t.text)})}x(Dge,"setQuadrant2Text");function Mge(t){Ai.setData({quadrant3Text:nl(t.text)})}x(Mge,"setQuadrant3Text");function Nge(t){Ai.setData({quadrant4Text:nl(t.text)})}x(Nge,"setQuadrant4Text");function Oge(t){Ai.setData({xAxisLeftText:nl(t.text)})}x(Oge,"setXAxisLeftText");function $ge(t){Ai.setData({xAxisRightText:nl(t.text)})}x($ge,"setXAxisRightText");function Pge(t){Ai.setData({yAxisTopText:nl(t.text)})}x(Pge,"setYAxisTopText");function Bge(t){Ai.setData({yAxisBottomText:nl(t.text)})}x(Bge,"setYAxisBottomText");function V_(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Rge(i))throw new k2(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(QD(i))throw new k2(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(QD(i))throw new k2(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(Lge(i))throw new k2(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}x(V_,"parseStyles");function Fge(t,e,r,n,i){const a=V_(i);Ai.addPoints([{x:r,y:n,text:nl(t.text),className:e,...a}])}x(Fge,"addPoint");function zge(t,e){Ai.addClass(t,V_(e))}x(zge,"addClass");function Gge(t){Ai.setConfig({chartWidth:t})}x(Gge,"setWidth");function Vge(t){Ai.setConfig({chartHeight:t})}x(Vge,"setHeight");function Wge(){const t=Pe(),{themeVariables:e,quadrantChart:r}=t;return r&&Ai.setConfig(r),Ai.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),Ai.setData({titleText:an()}),Ai.build()}x(Wge,"getQuadrantData");var xit=x(function(){Ai.clear(),Xr()},"clear"),bit={setWidth:Gge,setHeight:Vge,setQuadrant1Text:Ige,setQuadrant2Text:Dge,setQuadrant3Text:Mge,setQuadrant4Text:Nge,setXAxisLeftText:Oge,setXAxisRightText:$ge,setYAxisTopText:Pge,setYAxisBottomText:Bge,parseStyles:V_,addPoint:Fge,addClass:zge,getQuadrantData:Wge,clear:xit,setAccTitle:rn,getAccTitle:pn,setDiagramTitle:dn,getDiagramTitle:an,getAccDescription:mn,setAccDescription:gn},Tit=x((t,e,r,n)=>{var _,R,D;function i(L){return L==="top"?"hanging":"middle"}x(i,"getDominantBaseLine");function a(L){return L==="left"?"start":"middle"}x(a,"getTextAnchor");function s(L){return`translate(${L.x}, ${L.y}) rotate(${L.rotation||0})`}x(s,"getTransformation");const o=Pe();he.debug(`Rendering quadrant chart `+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=ft("#i"+e));const d=ft(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((_=o.quadrantChart)==null?void 0:_.chartWidth)??500,g=((R=o.quadrantChart)==null?void 0:R.chartHeight)??500;Rn(d,g,p,((D=o.quadrantChart)==null?void 0:D.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),T=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),C=f.append("g").attr("class","title");m.title&&C.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",L=>L.x1).attr("y1",L=>L.y1).attr("x2",L=>L.x2).attr("y2",L=>L.y2).style("stroke",L=>L.strokeFill).style("stroke-width",L=>L.strokeWidth);const w=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");w.append("rect").attr("x",L=>L.x).attr("y",L=>L.y).attr("width",L=>L.width).attr("height",L=>L.height).attr("fill",L=>L.fill),w.append("text").attr("x",0).attr("y",0).attr("fill",L=>L.text.fill).attr("font-size",L=>L.text.fontSize).attr("dominant-baseline",L=>i(L.text.horizontalPos)).attr("text-anchor",L=>a(L.text.verticalPos)).attr("transform",L=>s(L.text)).text(L=>L.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(L=>L.text).attr("fill",L=>L.fill).attr("font-size",L=>L.fontSize).attr("dominant-baseline",L=>i(L.horizontalPos)).attr("text-anchor",L=>a(L.verticalPos)).attr("transform",L=>s(L));const E=T.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");E.append("circle").attr("cx",L=>L.x).attr("cy",L=>L.y).attr("r",L=>L.radius).attr("fill",L=>L.fill).attr("stroke",L=>L.strokeColor).attr("stroke-width",L=>L.strokeWidth),E.append("text").attr("x",0).attr("y",0).text(L=>L.text.text).attr("fill",L=>L.text.fill).attr("font-size",L=>L.text.fontSize).attr("dominant-baseline",L=>i(L.text.horizontalPos)).attr("text-anchor",L=>a(L.text.verticalPos)).attr("transform",L=>s(L.text))},"draw"),Cit={draw:Tit},wit={parser:yit,db:bit,renderer:Cit,styles:x(()=>"","styles")};const Eit=Object.freeze(Object.defineProperty({__proto__:null,diagram:wit},Symbol.toStringTag,{value:"Module"}));var JD=(function(){var t=x(function(O,N,M,P){for(M=M||{},P=O.length;P--;M[O[P]]=N);return M},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],T=[1,36],b=[1,37],C=[1,43],w=[1,42],S=[1,47],E=[1,50],_=[1,10,12,14,16,18,19,21,23,36,37,38],R=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],L=[1,65],B=[26,28],$={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:x(function(N,M,P,F,V,z,W){var X=z.length-1;switch(V){case 5:F.setOrientation(z[X]);break;case 9:F.setDiagramTitle(z[X].text.trim());break;case 12:F.setLineData({text:"",type:"text"},z[X]);break;case 13:F.setLineData(z[X-1],z[X]);break;case 14:F.setBarData({text:"",type:"text"},z[X]);break;case 15:F.setBarData(z[X-1],z[X]);break;case 16:this.$=z[X].trim(),F.setAccTitle(this.$);break;case 17:case 18:this.$=z[X].trim(),F.setAccDescription(this.$);break;case 19:this.$=z[X-1];break;case 20:case 30:this.$=[z[X-2],...z[X]];break;case 21:case 31:this.$=[z[X]];break;case 22:this.$={value:Number(z[X-1]),label:z[X]};break;case 23:this.$={value:Number(z[X]),label:""};break;case 24:F.setXAxisTitle(z[X]);break;case 25:F.setXAxisTitle(z[X-1]);break;case 26:F.setXAxisTitle({type:"text",text:""});break;case 27:F.setXAxisBand(z[X]);break;case 28:F.setXAxisRangeData(Number(z[X-2]),Number(z[X]));break;case 29:this.$=z[X-1];break;case 32:F.setYAxisTitle(z[X]);break;case 33:F.setYAxisTitle(z[X-1]);break;case 34:F.setYAxisTitle({type:"text",text:""});break;case 35:F.setYAxisRangeData(Number(z[X-2]),Number(z[X]));break;case 39:this.$={text:z[X],type:"text"};break;case 40:this.$={text:z[X],type:"text"};break;case 41:this.$={text:z[X],type:"markdown"};break;case 42:this.$=z[X];break;case 43:this.$=z[X-1]+""+z[X];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:39,13:38,24:C,29:w,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:45,15:44,29:S,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:49,17:48,24:E,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:52,17:51,24:E,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(R,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b}),t(R,[2,40]),t(R,[2,41]),t(D,[2,42]),t(D,[2,44]),t(D,[2,45]),t(D,[2,46]),t(D,[2,47]),t(D,[2,48]),t(D,[2,49]),t(D,[2,50]),t(D,[2,51]),t(D,[2,52]),t(D,[2,53]),t(_,[2,10]),t(_,[2,24],{32:41,31:56,24:C,29:w}),t(_,[2,26]),t(_,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},t(_,[2,11]),t(_,[2,32],{35:60,29:S}),t(_,[2,34]),{33:[1,61]},t(_,[2,12]),{17:62,24:E},{25:63,27:64,29:L},t(_,[2,14]),{17:66,24:E},t(_,[2,16]),t(_,[2,17]),t(D,[2,43]),t(_,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(_,[2,33]),{29:[1,70]},t(_,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(B,[2,23],{30:[1,73]}),t(_,[2,15]),t(_,[2,28]),t(_,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},t(_,[2,35]),t(_,[2,19]),{25:75,27:64,29:L},t(B,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:x(function(N,M){if(M.recoverable)this.trace(N);else{var P=new Error(N);throw P.hash=M,P}},"parseError"),parse:x(function(N){var M=this,P=[0],F=[],V=[null],z=[],W=this.table,X="",j=0,re=0,Q=2,oe=1,ee=z.slice.call(arguments,1),ne=Object.create(this.lexer),ie={yy:{}};for(var ae in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ae)&&(ie.yy[ae]=this.yy[ae]);ne.setInput(N,ie.yy),ie.yy.lexer=ne,ie.yy.parser=this,typeof ne.yylloc>"u"&&(ne.yylloc={});var de=ne.yylloc;z.push(de);var le=ne.options&&ne.options.ranges;typeof ie.yy.parseError=="function"?this.parseError=ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ye(J){P.length=P.length-2*J,V.length=V.length-J,z.length=z.length-J}x(ye,"popStack");function $e(){var J;return J=F.pop()||ne.lex()||oe,typeof J!="number"&&(J instanceof Array&&(F=J,J=F.pop()),J=M.symbols_[J]||J),J}x($e,"lex");for(var Fe,ce,ve,Ce,Ne={},Ie,Ae,be,ke;;){if(ce=P[P.length-1],this.defaultActions[ce]?ve=this.defaultActions[ce]:((Fe===null||typeof Fe>"u")&&(Fe=$e()),ve=W[ce]&&W[ce][Fe]),typeof ve>"u"||!ve.length||!ve[0]){var se="";ke=[];for(Ie in W[ce])this.terminals_[Ie]&&Ie>Q&&ke.push("'"+this.terminals_[Ie]+"'");ne.showPosition?se="Parse error on line "+(j+1)+`: `+ne.showPosition()+` Expecting `+ke.join(", ")+", got '"+(this.terminals_[Fe]||Fe)+"'":se="Parse error on line "+(j+1)+": Unexpected "+(Fe==oe?"end of input":"'"+(this.terminals_[Fe]||Fe)+"'"),this.parseError(se,{text:ne.match,token:this.terminals_[Fe]||Fe,line:ne.yylineno,loc:de,expected:ke})}if(ve[0]instanceof Array&&ve.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ce+", token: "+Fe);switch(ve[0]){case 1:P.push(Fe),V.push(ne.yytext),z.push(ne.yylloc),P.push(ve[1]),Fe=null,re=ne.yyleng,X=ne.yytext,j=ne.yylineno,de=ne.yylloc;break;case 2:if(Ae=this.productions_[ve[1]][1],Ne.$=V[V.length-Ae],Ne._$={first_line:z[z.length-(Ae||1)].first_line,last_line:z[z.length-1].last_line,first_column:z[z.length-(Ae||1)].first_column,last_column:z[z.length-1].last_column},le&&(Ne._$.range=[z[z.length-(Ae||1)].range[0],z[z.length-1].range[1]]),Ce=this.performAction.apply(Ne,[X,re,j,ie.yy,ve[1],V,z].concat(ee)),typeof Ce<"u")return Ce;Ae&&(P=P.slice(0,-1*Ae*2),V=V.slice(0,-1*Ae),z=z.slice(0,-1*Ae)),P.push(this.productions_[ve[1]][0]),V.push(Ne.$),z.push(Ne._$),be=W[P[P.length-2]][P[P.length-1]],P.push(be);break;case 3:return!0}}return!0},"parse")},A=(function(){var O={EOF:1,parseError:x(function(M,P){if(this.yy.parser)this.yy.parser.parseError(M,P);else throw new Error(M)},"parseError"),setInput:x(function(N,M){return this.yy=M||this.yy||{},this._input=N,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var M=N.match(/(?:\r\n?|\n).*/g);return M?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:x(function(N){var M=N.length,P=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-M),this.offset-=M;var F=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),P.length-1&&(this.yylineno-=P.length-1);var V=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:P?(P.length===F.length?this.yylloc.first_column:0)+F[F.length-P.length].length-P[0].length:this.yylloc.first_column-M},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-M]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(N){this.unput(this.match.slice(N))},"less"),pastInput:x(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var N=this.pastInput(),M=new Array(N.length+1).join("-");return N+this.upcomingInput()+` `+M+"^"},"showPosition"),test_match:x(function(N,M){var P,F,V;if(this.options.backtrack_lexer&&(V={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(V.yylloc.range=this.yylloc.range.slice(0))),F=N[0].match(/(?:\r\n?|\n).*/g),F&&(this.yylineno+=F.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:F?F[F.length-1].length-F[F.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+N[0].length},this.yytext+=N[0],this.match+=N[0],this.matches=N,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(N[0].length),this.matched+=N[0],P=this.performAction.call(this,this.yy,this,M,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var z in V)this[z]=V[z];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var N,M,P,F;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),z=0;zM[0].length)){if(M=P,F=z,this.options.backtrack_lexer){if(N=this.test_match(P,V[z]),N!==!1)return N;if(this._backtrack){M=!1;continue}else return!1}else if(!this.options.flex)break}return M?(N=this.test_match(M,V[F]),N!==!1?N:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var M=this.next();return M||this.lex()},"lex"),begin:x(function(M){this.conditionStack.push(M)},"begin"),popState:x(function(){var M=this.conditionStack.length-1;return M>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(M){return M=this.conditionStack.length-1-Math.abs(M||0),M>=0?this.conditionStack[M]:"INITIAL"},"topState"),pushState:x(function(M){this.begin(M)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(M,P,F,V){switch(F){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return O})();$.lexer=A;function I(){this.yy={}}return x(I,"Parser"),I.prototype=$,$.Parser=I,new I})();JD.parser=JD;var Sit=JD;function sS(t){return t.type==="bar"}x(sS,"isBarPlot");function oS(t){return t.type==="band"}x(oS,"isBandAxisData");function Cp(t){return t.type==="linear"}x(Cp,"isLinearAxisData");var zy,UB=(zy=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=wj(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},x(zy,"TextDimensionCalculatorWithFont"),zy),NU=.7,OU=.2,Gy,qge=(Gy=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){NU*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(NU*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=OU*e.width;this.outerPadding=Math.min(n.width/2,i);let a=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),a+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=OU*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},x(Gy,"BaseAxis"),Gy),Vy,kit=(Vy=class extends qge{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=c3().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=c3().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),he.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},x(Vy,"BandAxis"),Vy),Wy,_it=(Wy=class extends qge{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=p0().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=p0().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},x(Wy,"LinearAxis"),Wy);function eM(t,e,r,n){const i=new UB(n);return oS(t)?new kit(e,r,t.categories,t.title,i):new _it(e,r,[t.min,t.max],t.title,i)}x(eM,"getAxis");var qy,Ait=(qy=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},x(qy,"ChartTitle"),qy);function Uge(t,e,r,n){const i=new UB(n);return new Ait(i,t,e,r)}x(Uge,"getChartTitleComponent");var Rit=.75,Lit=.5,Iit=.35;function tM(t){return{fontSize:t,markerSize:t*Rit,markerSpacing:t*Iit,itemSpacing:t*Lit}}x(tM,"getLegendLayout");var Uy,Dit=(Uy=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(u=>u.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};const{fontSize:r,markerSize:n,markerSpacing:i,itemSpacing:a}=tM(this.chartConfig.legendFontSize),s=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(u=>u.title),r),o=this.chartConfig.legendPadding*2+n+i+s.width,l=this.chartConfig.legendPadding*2+this.visiblePlots.length*r+(this.visiblePlots.length-1)*a;return o<=e.width&&l<=e.height?(this.boundingRect.width=o,this.boundingRect.height=l):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];const{fontSize:e,markerSize:r,markerSpacing:n,itemSpacing:i}=tM(this.chartConfig.legendFontSize),a=e+i,s=this.boundingRect.x+this.chartConfig.legendPadding,o=this.boundingRect.y+this.chartConfig.legendPadding,l=[],u=[];for(const[h,d]of this.visiblePlots.entries())if(sS(d))l.push({x:s,y:o+h*a,width:r,height:r,fill:d.fill,strokeFill:d.fill,strokeWidth:0});else{const f=o+h*a+r/2;u.push({path:`M ${s},${f} L ${s+r},${f}`,strokeFill:d.strokeFill,strokeWidth:d.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:l},{groupTexts:["legend","markers"],type:"path",data:u},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((h,d)=>({text:h.title,x:s+r+n,y:o+d*a+r/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}},x(Uy,"ChartLegend"),Uy);function Hge(t,e,r,n){const i=new UB(n);return new Dit(i,t,e,r)}x(Hge,"getChartLegendComponent");var Hy,Mit=(Hy=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=Tw().y(i=>i[0]).x(i=>i[1])(e):r=Tw().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const s=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?s.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):s.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}s.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:s})}return n}},x(Hy,"LinePlot"),Hy),Yy,Nit=(Yy=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},x(Yy,"BarPlot"),Yy),Xy,Oit=(Xy=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new Mit(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new Nit(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},x(Xy,"BasePlot"),Xy);function Yge(t,e,r){return new Oit(t,e,r)}x(Yge,"getPlotComponent");var jy,$it=(jy=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Uge(e,r,n,i),plot:Yge(e,r,n),legend:Hge(e,r,n,i),xAxis:eM(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:eM(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a={width:0,height:0},s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("bottom"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=l.height,this.componentStore.yAxis.setAxisPosition("left"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=l.width,e-=l.width,a=this.componentStore.legend.calculateSpace({width:e,height:o}),e-=a.width,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.legend.setBoundingBoxXY({x:n+s,y:i+Math.max((o-a.height)/2,0)}),this.componentStore.xAxis.setRange([n,n+s]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+o}),this.componentStore.yAxis.setRange([i,i+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(u=>sS(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s={width:0,height:0},o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),u=this.componentStore.plot.calculateSpace({width:o,height:l});e-=u.width,r-=u.height,u=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=u.height,r-=u.height,this.componentStore.xAxis.setAxisPosition("left"),u=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=u.width,i=u.width,this.componentStore.yAxis.setAxisPosition("top"),u=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=u.height,a=n+u.height,s=this.componentStore.legend.calculateSpace({width:e,height:l}),e-=s.width,e>0&&(o+=e,e=0),r>0&&(l+=r,r=0),this.componentStore.plot.calculateSpace({width:o,height:l}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.legend.setBoundingBoxXY({x:i+o,y:a+Math.max((l-s.height)/2,0)}),this.componentStore.yAxis.setRange([i,i+o]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+l]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(h=>sS(h))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},x(jy,"Orchestrator"),jy),Ky,Pit=(Ky=class{static build(e,r,n,i){return new $it(e,r,n,i).getDrawableElement()}},x(Ky,"XYChartBuilder"),Ky),mb=0,Xge,yb=XB(),vb=YB(),Rr=jB(),rM=vb.plotColorPalette.split(",").map(t=>t.trim()),W_=!1,HB=!1;function YB(){const t=Kl(),e=It();return fn(t.xyChart,e.themeVariables.xyChart)}x(YB,"getChartDefaultThemeConfig");function XB(){const t=It();return fn(pr.xyChart,t.xyChart)}x(XB,"getChartDefaultConfig");function jB(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}x(jB,"getChartDefaultData");function sd(t){const e=It();return xr(t.trim(),e)}x(sd,"textSanitizer");function jge(t){Xge=t}x(jge,"setTmpSVGG");function Kge(t){t==="horizontal"?yb.chartOrientation="horizontal":yb.chartOrientation="vertical"}x(Kge,"setOrientation");function Zge(t){Rr.xAxis.title=sd(t.text)}x(Zge,"setXAxisTitle");function KB(t,e){Rr.xAxis={type:"linear",title:Rr.xAxis.title,min:t,max:e},W_=!0}x(KB,"setXAxisRangeData");function Qge(t){Rr.xAxis={type:"band",title:Rr.xAxis.title,categories:t.map(e=>sd(e.text))},W_=!0}x(Qge,"setXAxisBand");function Jge(t){Rr.yAxis.title=sd(t.text)}x(Jge,"setYAxisTitle");function eme(t,e){Rr.yAxis={type:"linear",title:Rr.yAxis.title,min:t,max:e},HB=!0}x(eme,"setYAxisRangeData");function tme(t){const e=Math.min(...t),r=Math.max(...t),n=Cp(Rr.yAxis)?Rr.yAxis.min:1/0,i=Cp(Rr.yAxis)?Rr.yAxis.max:-1/0;Rr.yAxis={type:"linear",title:Rr.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}x(tme,"setYAxisRangeFromPlotData");function ZB(t){let e=[];if(t.length===0)return e;if(!W_){const r=Cp(Rr.xAxis)?Rr.xAxis.min:1/0,n=Cp(Rr.xAxis)?Rr.xAxis.max:-1/0;KB(Math.min(r,1),Math.max(n,t.length))}if(oS(Rr.xAxis)&&t.length>Rr.xAxis.categories.length&&(t=t.slice(0,Rr.xAxis.categories.length)),HB||tme(t),oS(Rr.xAxis)&&(e=Rr.xAxis.categories.map((r,n)=>[r,t[n]])),Cp(Rr.xAxis)){const r=Rr.xAxis.min,n=Rr.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,s)=>[`${r+s*i}`,a])}}return e}x(ZB,"transformDataWithoutCategory");function QB(t){return rM[t===0?0:t%rM.length]}x(QB,"getPlotColorFromPalette");function rme(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?sd(s.label):""),i=ZB(r),a=n.some(s=>s!=="");Rr.plots.push({type:"line",title:sd(t.text),strokeFill:QB(mb),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),mb++}x(rme,"setLineData");function nme(t,e){const r=e.map(i=>i.value),n=ZB(r);Rr.plots.push({type:"bar",title:sd(t.text),fill:QB(mb),data:n}),mb++}x(nme,"setBarData");function ime(){if(Rr.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Rr.title=an(),Pit.build(yb,Rr,vb,Xge)}x(ime,"getDrawableElem");function ame(){return vb}x(ame,"getChartThemeConfig");function sme(){return yb}x(sme,"getChartConfig");function ome(){return Rr}x(ome,"getXYChartData");var Bit=x(function(){Xr(),mb=0,yb=XB(),Rr=jB(),vb=YB(),rM=vb.plotColorPalette.split(",").map(t=>t.trim()),W_=!1,HB=!1},"clear"),Fit={getDrawableElem:ime,clear:Bit,setAccTitle:rn,getAccTitle:pn,setDiagramTitle:dn,getDiagramTitle:an,getAccDescription:mn,setAccDescription:gn,setOrientation:Kge,setXAxisTitle:Zge,setXAxisRangeData:KB,setXAxisBand:Qge,setYAxisTitle:Jge,setYAxisRangeData:eme,setLineData:rme,setBarData:nme,setTmpSVGG:jge,getChartThemeConfig:ame,getChartConfig:sme,getXYChartData:ome},zit=x((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}x(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}x(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}x(h,"getTextTransformation"),he.debug(`Rendering xychart chart `+t);const d=Yi(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Rn(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let T=f,b="";for(const[C]of v.entries()){let w=f;C>0&&m[b]&&(w=m[b]),b+=v[C],T=m[b],T||(T=m[b]=w.append("g").attr("class",v[C]))}return T}x(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const T=y(v.groupTexts);switch(v.type){case"rect":if(T.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let C=function(L,B){const{data:$,label:A}=L;return B*A.length*w<=$.width-S};x(C,"fitsHorizontally");const w=.7,S=10,E=v.data.map((L,B)=>({data:L,label:o[B].toString()})).filter(L=>L.data.width>0&&L.data.height>0),_=E.map(L=>{const{data:B}=L;let $=B.height*.7;for(;!C(L,$)&&$>0;)$-=1;return $}),R=Math.floor(Math.min(..._)),D=x(L=>b?L.data.x+L.data.width+S:L.data.x+L.data.width-S,"determineLabelXPosition");T.selectAll("text").data(E).enter().append("text").attr("x",D).attr("y",L=>L.data.y+L.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${R}px`).text(L=>L.label)}else{let C=function(D,L,B){const{data:$,label:A}=D,O=L*A.length*.7,N=$.x+$.width/2,M=N-O/2,P=N+O/2,F=M>=$.x&&P<=$.x+$.width,V=$.y+B+L<=$.y+$.height;return F&&V};x(C,"fitsInBar");const w=10,S=v.data.map((D,L)=>({data:D,label:o[L].toString()})).filter(D=>D.data.width>0&&D.data.height>0),E=S.map(D=>{const{data:L,label:B}=D;let $=L.width/(B.length*.7);for(;!C(D,$,w)&&$>0;)$-=1;return $}),_=Math.floor(Math.min(...E)),R=x(D=>b?D.data.y-w:D.data.y+w,"determineLabelYPosition");T.selectAll("text").data(S).enter().append("text").attr("x",D=>D.data.x+D.data.width/2).attr("y",R).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${_}px`).text(D=>D.label)}}break;case"text":T.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":T.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),Git={draw:zit},Vit={parser:Sit,db:Fit,renderer:Git};const Wit=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vit},Symbol.toStringTag,{value:"Module"}));var nM=(function(){var t=x(function(q,H,Z,te){for(Z=Z||{},te=q.length;te--;Z[q[te]]=H);return Z},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],T=[1,24],b=[1,31],C=[1,32],w=[1,30],S=[1,39],E=[1,40],_=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],R=[1,61],D=[89,90],L=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[27,29],$=[1,70],A=[1,71],I=[1,72],O=[1,73],N=[1,74],M=[1,75],P=[1,76],F=[1,83],V=[1,80],z=[1,84],W=[1,85],X=[1,86],j=[1,87],re=[1,88],Q=[1,89],oe=[1,90],ee=[1,91],ne=[1,92],ie=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],ae=[63,64],de=[1,101],le=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],ye=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],$e=[1,110],Fe=[1,106],ce=[1,107],ve=[1,108],Ce=[1,109],Ne=[1,111],Ie=[1,116],Ae=[1,117],be=[1,114],ke=[1,115],se={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:x(function(H,Z,te,K,U,Y,fe){var ue=Y.length-1;switch(U){case 4:this.$=Y[ue].trim(),K.setAccTitle(this.$);break;case 5:case 6:this.$=Y[ue].trim(),K.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:K.setDirection("TB");break;case 18:K.setDirection("BT");break;case 19:K.setDirection("RL");break;case 20:K.setDirection("LR");break;case 21:K.addRequirement(Y[ue-3],Y[ue-4]);break;case 22:K.addRequirement(Y[ue-5],Y[ue-6]),K.setClass([Y[ue-5]],Y[ue-3]);break;case 23:K.setNewReqId(Y[ue-2]);break;case 24:K.setNewReqText(Y[ue-2]);break;case 25:K.setNewReqRisk(Y[ue-2]);break;case 26:K.setNewReqVerifyMethod(Y[ue-2]);break;case 29:this.$=K.RequirementType.REQUIREMENT;break;case 30:this.$=K.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=K.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=K.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=K.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=K.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=K.RiskLevel.LOW_RISK;break;case 36:this.$=K.RiskLevel.MED_RISK;break;case 37:this.$=K.RiskLevel.HIGH_RISK;break;case 38:this.$=K.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=K.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=K.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=K.VerifyType.VERIFY_TEST;break;case 42:K.addElement(Y[ue-3]);break;case 43:K.addElement(Y[ue-5]),K.setClass([Y[ue-5]],Y[ue-3]);break;case 44:K.setNewElementType(Y[ue-2]);break;case 45:K.setNewElementDocRef(Y[ue-2]);break;case 48:K.addRelationship(Y[ue-2],Y[ue],Y[ue-4]);break;case 49:K.addRelationship(Y[ue-2],Y[ue-4],Y[ue]);break;case 50:this.$=K.Relationships.CONTAINS;break;case 51:this.$=K.Relationships.COPIES;break;case 52:this.$=K.Relationships.DERIVES;break;case 53:this.$=K.Relationships.SATISFIES;break;case 54:this.$=K.Relationships.VERIFIES;break;case 55:this.$=K.Relationships.REFINES;break;case 56:this.$=K.Relationships.TRACES;break;case 57:this.$=Y[ue-2],K.defineClass(Y[ue-1],Y[ue]);break;case 58:K.setClass(Y[ue-1],Y[ue]);break;case 59:K.setClass([Y[ue-2]],Y[ue]);break;case 60:case 62:this.$=[Y[ue]];break;case 61:case 63:this.$=Y[ue-2].concat([Y[ue]]);break;case 64:this.$=Y[ue-2],K.setCssStyle(Y[ue-1],Y[ue]);break;case 65:this.$=[Y[ue]];break;case 66:Y[ue-2].push(Y[ue]),this.$=Y[ue-2];break;case 68:this.$=Y[ue-1]+Y[ue];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:C,77:w,89:S,90:E},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(_,[2,17]),t(_,[2,18]),t(_,[2,19]),t(_,[2,20]),{30:60,33:62,75:R,89:S,90:E},{30:63,33:62,75:R,89:S,90:E},{30:64,33:62,75:R,89:S,90:E},t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),t(L,[2,81]),t(L,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(B,[2,79]),t(B,[2,80]),{27:[1,67],29:[1,68]},t(B,[2,85]),t(B,[2,86]),{62:69,65:$,66:A,67:I,68:O,69:N,70:M,71:P},{62:77,65:$,66:A,67:I,68:O,69:N,70:M,71:P},{30:78,33:62,75:R,89:S,90:E},{73:79,75:F,76:V,78:81,79:82,80:z,81:W,82:X,83:j,84:re,85:Q,86:oe,87:ee,88:ne},t(ie,[2,60]),t(ie,[2,62]),{73:93,75:F,76:V,78:81,79:82,80:z,81:W,82:X,83:j,84:re,85:Q,86:oe,87:ee,88:ne},{30:94,33:62,75:R,76:V,89:S,90:E},{5:[1,95]},{30:96,33:62,75:R,89:S,90:E},{5:[1,97]},{30:98,33:62,75:R,89:S,90:E},{63:[1,99]},t(ae,[2,50]),t(ae,[2,51]),t(ae,[2,52]),t(ae,[2,53]),t(ae,[2,54]),t(ae,[2,55]),t(ae,[2,56]),{64:[1,100]},t(_,[2,59],{76:V}),t(_,[2,64],{76:de}),{33:103,75:[1,102],89:S,90:E},t(le,[2,65],{79:104,75:F,80:z,81:W,82:X,83:j,84:re,85:Q,86:oe,87:ee,88:ne}),t(ye,[2,67]),t(ye,[2,69]),t(ye,[2,70]),t(ye,[2,71]),t(ye,[2,72]),t(ye,[2,73]),t(ye,[2,74]),t(ye,[2,75]),t(ye,[2,76]),t(ye,[2,77]),t(ye,[2,78]),t(_,[2,57],{76:de}),t(_,[2,58],{76:V}),{5:$e,28:105,31:Fe,34:ce,36:ve,38:Ce,40:Ne},{27:[1,112],76:V},{5:Ie,40:Ae,56:113,57:be,59:ke},{27:[1,118],76:V},{33:119,89:S,90:E},{33:120,89:S,90:E},{75:F,78:121,79:82,80:z,81:W,82:X,83:j,84:re,85:Q,86:oe,87:ee,88:ne},t(ie,[2,61]),t(ie,[2,63]),t(ye,[2,68]),t(_,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:$e,28:126,31:Fe,34:ce,36:ve,38:Ce,40:Ne},t(_,[2,28]),{5:[1,127]},t(_,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ie,40:Ae,56:130,57:be,59:ke},t(_,[2,47]),{5:[1,131]},t(_,[2,48]),t(_,[2,49]),t(le,[2,66],{79:104,75:F,80:z,81:W,82:X,83:j,84:re,85:Q,86:oe,87:ee,88:ne}),{33:132,89:S,90:E},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(_,[2,27]),{5:$e,28:145,31:Fe,34:ce,36:ve,38:Ce,40:Ne},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(_,[2,46]),{5:Ie,40:Ae,56:152,57:be,59:ke},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(_,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(_,[2,43]),{5:$e,28:159,31:Fe,34:ce,36:ve,38:Ce,40:Ne},{5:$e,28:160,31:Fe,34:ce,36:ve,38:Ce,40:Ne},{5:$e,28:161,31:Fe,34:ce,36:ve,38:Ce,40:Ne},{5:$e,28:162,31:Fe,34:ce,36:ve,38:Ce,40:Ne},{5:Ie,40:Ae,56:163,57:be,59:ke},{5:Ie,40:Ae,56:164,57:be,59:ke},t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,44]),t(_,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:x(function(H,Z){if(Z.recoverable)this.trace(H);else{var te=new Error(H);throw te.hash=Z,te}},"parseError"),parse:x(function(H){var Z=this,te=[0],K=[],U=[null],Y=[],fe=this.table,ue="",Te=0,ge=0,we=2,xe=1,Le=Y.slice.call(arguments,1),_e=Object.create(this.lexer),Be={yy:{}};for(var Ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ee)&&(Be.yy[Ee]=this.yy[Ee]);_e.setInput(H,Be.yy),Be.yy.lexer=_e,Be.yy.parser=this,typeof _e.yylloc>"u"&&(_e.yylloc={});var Xe=_e.yylloc;Y.push(Xe);var Re=_e.options&&_e.options.ranges;typeof Be.yy.parseError=="function"?this.parseError=Be.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Qe(Se){te.length=te.length-2*Se,U.length=U.length-Se,Y.length=Y.length-Se}x(Qe,"popStack");function it(){var Se;return Se=K.pop()||_e.lex()||xe,typeof Se!="number"&&(Se instanceof Array&&(K=Se,Se=K.pop()),Se=Z.symbols_[Se]||Se),Se}x(it,"lex");for(var Ue,mt,ot,Ke,me={},dt,at,et,ct;;){if(mt=te[te.length-1],this.defaultActions[mt]?ot=this.defaultActions[mt]:((Ue===null||typeof Ue>"u")&&(Ue=it()),ot=fe[mt]&&fe[mt][Ue]),typeof ot>"u"||!ot.length||!ot[0]){var Gt="";ct=[];for(dt in fe[mt])this.terminals_[dt]&&dt>we&&ct.push("'"+this.terminals_[dt]+"'");_e.showPosition?Gt="Parse error on line "+(Te+1)+`: `+_e.showPosition()+` Expecting `+ct.join(", ")+", got '"+(this.terminals_[Ue]||Ue)+"'":Gt="Parse error on line "+(Te+1)+": Unexpected "+(Ue==xe?"end of input":"'"+(this.terminals_[Ue]||Ue)+"'"),this.parseError(Gt,{text:_e.match,token:this.terminals_[Ue]||Ue,line:_e.yylineno,loc:Xe,expected:ct})}if(ot[0]instanceof Array&&ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+mt+", token: "+Ue);switch(ot[0]){case 1:te.push(Ue),U.push(_e.yytext),Y.push(_e.yylloc),te.push(ot[1]),Ue=null,ge=_e.yyleng,ue=_e.yytext,Te=_e.yylineno,Xe=_e.yylloc;break;case 2:if(at=this.productions_[ot[1]][1],me.$=U[U.length-at],me._$={first_line:Y[Y.length-(at||1)].first_line,last_line:Y[Y.length-1].last_line,first_column:Y[Y.length-(at||1)].first_column,last_column:Y[Y.length-1].last_column},Re&&(me._$.range=[Y[Y.length-(at||1)].range[0],Y[Y.length-1].range[1]]),Ke=this.performAction.apply(me,[ue,ge,Te,Be.yy,ot[1],U,Y].concat(Le)),typeof Ke<"u")return Ke;at&&(te=te.slice(0,-1*at*2),U=U.slice(0,-1*at),Y=Y.slice(0,-1*at)),te.push(this.productions_[ot[1]][0]),U.push(me.$),Y.push(me._$),et=fe[te[te.length-2]][te[te.length-1]],te.push(et);break;case 3:return!0}}return!0},"parse")},J=(function(){var q={EOF:1,parseError:x(function(Z,te){if(this.yy.parser)this.yy.parser.parseError(Z,te);else throw new Error(Z)},"parseError"),setInput:x(function(H,Z){return this.yy=Z||this.yy||{},this._input=H,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var H=this._input[0];this.yytext+=H,this.yyleng++,this.offset++,this.match+=H,this.matched+=H;var Z=H.match(/(?:\r\n?|\n).*/g);return Z?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),H},"input"),unput:x(function(H){var Z=H.length,te=H.split(/(?:\r\n?|\n)/g);this._input=H+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Z),this.offset-=Z;var K=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),te.length-1&&(this.yylineno-=te.length-1);var U=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:te?(te.length===K.length?this.yylloc.first_column:0)+K[K.length-te.length].length-te[0].length:this.yylloc.first_column-Z},this.options.ranges&&(this.yylloc.range=[U[0],U[0]+this.yyleng-Z]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(H){this.unput(this.match.slice(H))},"less"),pastInput:x(function(){var H=this.matched.substr(0,this.matched.length-this.match.length);return(H.length>20?"...":"")+H.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var H=this.match;return H.length<20&&(H+=this._input.substr(0,20-H.length)),(H.substr(0,20)+(H.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var H=this.pastInput(),Z=new Array(H.length+1).join("-");return H+this.upcomingInput()+` `+Z+"^"},"showPosition"),test_match:x(function(H,Z){var te,K,U;if(this.options.backtrack_lexer&&(U={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(U.yylloc.range=this.yylloc.range.slice(0))),K=H[0].match(/(?:\r\n?|\n).*/g),K&&(this.yylineno+=K.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:K?K[K.length-1].length-K[K.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+H[0].length},this.yytext+=H[0],this.match+=H[0],this.matches=H,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(H[0].length),this.matched+=H[0],te=this.performAction.call(this,this.yy,this,Z,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),te)return te;if(this._backtrack){for(var Y in U)this[Y]=U[Y];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var H,Z,te,K;this._more||(this.yytext="",this.match="");for(var U=this._currentRules(),Y=0;YZ[0].length)){if(Z=te,K=Y,this.options.backtrack_lexer){if(H=this.test_match(te,U[Y]),H!==!1)return H;if(this._backtrack){Z=!1;continue}else return!1}else if(!this.options.flex)break}return Z?(H=this.test_match(Z,U[K]),H!==!1?H:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Z=this.next();return Z||this.lex()},"lex"),begin:x(function(Z){this.conditionStack.push(Z)},"begin"),popState:x(function(){var Z=this.conditionStack.length-1;return Z>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Z){return Z=this.conditionStack.length-1-Math.abs(Z||0),Z>=0?this.conditionStack[Z]:"INITIAL"},"topState"),pushState:x(function(Z){this.begin(Z)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Z,te,K,U){switch(K){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return te.yytext=te.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return q})();se.lexer=J;function G(){this.yy={}}return x(G,"Parser"),G.prototype=se,se.Parser=G,new G})();nM.parser=nM;var qit=nM,Zy,Uit=(Zy=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=rn,this.getAccTitle=pn,this.setAccDescription=gn,this.getAccDescription=mn,this.setDiagramTitle=dn,this.getDiagramTitle=an,this.getConfig=x(()=>Pe().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),he.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,Xr()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var a,s,o,l;const e=Pe(),r=[],n=[];for(const u of this.requirements.values()){const h=u;h.id=u.name,h.cssStyles=u.cssStyles,h.cssClasses=u.classes.join(" "),h.shape="requirementBox",h.look=e.look,h.colorIndex=r.length,r.push(h)}for(const u of this.elements.values()){const h=u;h.shape="requirementBox",h.look=e.look,h.id=u.name,h.cssStyles=u.cssStyles,h.cssClasses=u.classes.join(" "),h.colorIndex=r.length,r.push(h)}let i=0;for(const u of this.relations){const h=u.type===this.Relationships.CONTAINS,d={id:`${u.src}-${u.dst}-${i++}`,start:((a=this.requirements.get(u.src))==null?void 0:a.name)??((s=this.elements.get(u.src))==null?void 0:s.name),end:((o=this.requirements.get(u.dst))==null?void 0:o.name)??((l=this.elements.get(u.dst))==null?void 0:l.name),label:`<<${u.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d)}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},x(Zy,"RequirementDB"),Zy),Hit=x(t=>{const e=It(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o{const e=It(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` ${Hit(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; } marker.cross { stroke: ${t.lineColor}; } svg { font-family: ${t.fontFamily}; font-size: ${t.fontSize}; } .reqBox { fill: ${t.requirementBackground}; fill-opacity: 1.0; stroke: ${t.requirementBorderColor}; stroke-width: ${t.requirementBorderSize}; } .reqTitle, .reqLabel{ fill: ${t.requirementTextColor}; } .reqLabelBox { fill: ${t.relationLabelBackground}; fill-opacity: 1.0; } .req-title-line { stroke: ${t.requirementBorderColor}; stroke-width: ${t.requirementBorderSize}; } .relationshipLine { stroke: ${t.relationColor}; stroke-width: ${r==="neo"?t.strokeWidth:"1px"}; } .relationshipLabel { fill: ${t.relationLabelColor}; } .edgeLabel { background-color: ${t.edgeLabelBackground}; } .edgeLabel .label rect { fill: ${t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.relationLabelColor}; } .divider { stroke: ${t.nodeBorder}; stroke-width: 1; } .label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } .label text,span { fill: ${t.nodeTextColor||t.textColor}; color: ${t.nodeTextColor||t.textColor}; } .labelBkg { background-color: ${i??t.edgeLabelBackground}; } `},"getStyles"),Xit=Yit,lme={};vS(lme,{draw:()=>jit});var jit=x(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Pe(),l=n.db.getData(),u=xv(e,i);l.type=n.type,l.layoutAlgorithm=zb(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await uv(l,u);const h=8;sr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Cd(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Kit={parser:qit,get db(){return new Uit},renderer:lme,styles:Xit};const Zit=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kit},Symbol.toStringTag,{value:"Module"}));var iM=(function(){var t=x(function(ge,we,xe,Le){for(xe=xe||{},Le=ge.length;Le--;xe[ge[Le]]=we);return xe},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],T=[1,30],b=[1,31],C=[1,32],w=[1,33],S=[1,34],E=[1,35],_=[1,36],R=[1,37],D=[1,38],L=[1,39],B=[1,40],$=[1,42],A=[1,43],I=[1,44],O=[1,45],N=[1,46],M=[1,47],P=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],F=[1,74],V=[1,80],z=[1,81],W=[1,82],X=[1,83],j=[1,84],re=[1,85],Q=[1,86],oe=[1,87],ee=[1,88],ne=[1,89],ie=[1,90],ae=[1,91],de=[1,92],le=[1,93],ye=[1,94],$e=[1,95],Fe=[1,96],ce=[1,97],ve=[1,98],Ce=[1,99],Ne=[1,100],Ie=[1,101],Ae=[1,102],be=[1,103],ke=[1,104],se=[1,105],J=[2,78],G=[4,5,17,51,53,54],q=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],H=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Z=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],te=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],K=[5,52],U=[70,71,72,73],Y=[1,151],fe={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(we,xe,Le,_e,Be,Ee,Xe){var Re=Ee.length-1;switch(Be){case 3:return _e.apply(Ee[Re]),Ee[Re];case 4:case 10:this.$=[];break;case 5:case 11:Ee[Re-1].push(Ee[Re]),this.$=Ee[Re-1];break;case 6:case 7:case 12:case 13:this.$=Ee[Re];break;case 8:case 9:case 14:this.$=[];break;case 16:Ee[Re].type="createParticipant",this.$=Ee[Re];break;case 17:Ee[Re-1].unshift({type:"boxStart",boxData:_e.parseBoxData(Ee[Re-2])}),Ee[Re-1].push({type:"boxEnd",boxText:Ee[Re-2]}),this.$=Ee[Re-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Ee[Re-2]),sequenceIndexStep:Number(Ee[Re-1]),sequenceVisible:!0,signalType:_e.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Ee[Re-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:_e.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:_e.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:_e.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:_e.LINETYPE.ACTIVE_START,actor:Ee[Re-1].actor};break;case 24:this.$={type:"activeEnd",signalType:_e.LINETYPE.ACTIVE_END,actor:Ee[Re-1].actor};break;case 30:_e.setDiagramTitle(Ee[Re].substring(6)),this.$=Ee[Re].substring(6);break;case 31:_e.setDiagramTitle(Ee[Re].substring(7)),this.$=Ee[Re].substring(7);break;case 32:this.$=Ee[Re].trim(),_e.setAccTitle(this.$);break;case 33:case 34:this.$=Ee[Re].trim(),_e.setAccDescription(this.$);break;case 35:Ee[Re-1].unshift({type:"loopStart",loopText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.LOOP_START}),Ee[Re-1].push({type:"loopEnd",loopText:Ee[Re-2],signalType:_e.LINETYPE.LOOP_END}),this.$=Ee[Re-1];break;case 36:Ee[Re-1].unshift({type:"rectStart",color:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.RECT_START}),Ee[Re-1].push({type:"rectEnd",color:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.RECT_END}),this.$=Ee[Re-1];break;case 37:Ee[Re-1].unshift({type:"optStart",optText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.OPT_START}),Ee[Re-1].push({type:"optEnd",optText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.OPT_END}),this.$=Ee[Re-1];break;case 38:Ee[Re-1].unshift({type:"altStart",altText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.ALT_START}),Ee[Re-1].push({type:"altEnd",signalType:_e.LINETYPE.ALT_END}),this.$=Ee[Re-1];break;case 39:Ee[Re-1].unshift({type:"parStart",parText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.PAR_START}),Ee[Re-1].push({type:"parEnd",signalType:_e.LINETYPE.PAR_END}),this.$=Ee[Re-1];break;case 40:Ee[Re-1].unshift({type:"parStart",parText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.PAR_OVER_START}),Ee[Re-1].push({type:"parEnd",signalType:_e.LINETYPE.PAR_END}),this.$=Ee[Re-1];break;case 41:Ee[Re-1].unshift({type:"criticalStart",criticalText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.CRITICAL_START}),Ee[Re-1].push({type:"criticalEnd",signalType:_e.LINETYPE.CRITICAL_END}),this.$=Ee[Re-1];break;case 42:Ee[Re-1].unshift({type:"breakStart",breakText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.BREAK_START}),Ee[Re-1].push({type:"breakEnd",optText:_e.parseMessage(Ee[Re-2]),signalType:_e.LINETYPE.BREAK_END}),this.$=Ee[Re-1];break;case 44:this.$=Ee[Re-3].concat([{type:"option",optionText:_e.parseMessage(Ee[Re-1]),signalType:_e.LINETYPE.CRITICAL_OPTION},Ee[Re]]);break;case 46:this.$=Ee[Re-3].concat([{type:"and",parText:_e.parseMessage(Ee[Re-1]),signalType:_e.LINETYPE.PAR_AND},Ee[Re]]);break;case 48:this.$=Ee[Re-3].concat([{type:"else",altText:_e.parseMessage(Ee[Re-1]),signalType:_e.LINETYPE.ALT_ELSE},Ee[Re]]);break;case 49:Ee[Re-3].draw="participant",Ee[Re-3].type="addParticipant",Ee[Re-3].description=_e.parseMessage(Ee[Re-1]),this.$=Ee[Re-3];break;case 50:Ee[Re-1].draw="participant",Ee[Re-1].type="addParticipant",this.$=Ee[Re-1];break;case 51:Ee[Re-3].draw="actor",Ee[Re-3].type="addParticipant",Ee[Re-3].description=_e.parseMessage(Ee[Re-1]),this.$=Ee[Re-3];break;case 52:case 57:Ee[Re-1].draw="actor",Ee[Re-1].type="addParticipant",this.$=Ee[Re-1];break;case 53:Ee[Re-1].type="destroyParticipant",this.$=Ee[Re-1];break;case 54:Ee[Re-3].draw="participant",Ee[Re-3].type="addParticipant",Ee[Re-3].description=_e.parseMessage(Ee[Re-1]),this.$=Ee[Re-3];break;case 55:Ee[Re-1].draw="participant",Ee[Re-1].type="addParticipant",this.$=Ee[Re-1];break;case 56:Ee[Re-3].draw="actor",Ee[Re-3].type="addParticipant",Ee[Re-3].description=_e.parseMessage(Ee[Re-1]),this.$=Ee[Re-3];break;case 58:this.$=[Ee[Re-1],{type:"addNote",placement:Ee[Re-2],actor:Ee[Re-1].actor,text:Ee[Re]}];break;case 59:Ee[Re-2]=[].concat(Ee[Re-1],Ee[Re-1]).slice(0,2),Ee[Re-2][0]=Ee[Re-2][0].actor,Ee[Re-2][1]=Ee[Re-2][1].actor,this.$=[Ee[Re-1],{type:"addNote",placement:_e.PLACEMENT.OVER,actor:Ee[Re-2].slice(0,2),text:Ee[Re]}];break;case 60:this.$=[Ee[Re-1],{type:"addLinks",actor:Ee[Re-1].actor,text:Ee[Re]}];break;case 61:this.$=[Ee[Re-1],{type:"addALink",actor:Ee[Re-1].actor,text:Ee[Re]}];break;case 62:this.$=[Ee[Re-1],{type:"addProperties",actor:Ee[Re-1].actor,text:Ee[Re]}];break;case 63:this.$=[Ee[Re-1],{type:"addDetails",actor:Ee[Re-1].actor,text:Ee[Re]}];break;case 66:this.$=[Ee[Re-2],Ee[Re]];break;case 67:this.$=Ee[Re];break;case 68:this.$=_e.PLACEMENT.LEFTOF;break;case 69:this.$=_e.PLACEMENT.RIGHTOF;break;case 70:this.$=[Ee[Re-4],Ee[Re-1],{type:"addMessage",from:Ee[Re-4].actor,to:Ee[Re-1].actor,signalType:Ee[Re-3],msg:Ee[Re],activate:!0},{type:"activeStart",signalType:_e.LINETYPE.ACTIVE_START,actor:Ee[Re-1].actor}];break;case 71:this.$=[Ee[Re-4],Ee[Re-1],{type:"addMessage",from:Ee[Re-4].actor,to:Ee[Re-1].actor,signalType:Ee[Re-3],msg:Ee[Re]},{type:"activeEnd",signalType:_e.LINETYPE.ACTIVE_END,actor:Ee[Re-4].actor}];break;case 72:this.$=[Ee[Re-4],Ee[Re-1],{type:"addMessage",from:Ee[Re-4].actor,to:Ee[Re-1].actor,signalType:Ee[Re-3],msg:Ee[Re],activate:!0,centralConnection:_e.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:_e.LINETYPE.CENTRAL_CONNECTION,actor:Ee[Re-1].actor}];break;case 73:this.$=[Ee[Re-4],Ee[Re-1],{type:"addMessage",from:Ee[Re-4].actor,to:Ee[Re-1].actor,signalType:Ee[Re-2],msg:Ee[Re],activate:!1,centralConnection:_e.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:_e.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ee[Re-4].actor}];break;case 74:this.$=[Ee[Re-5],Ee[Re-1],{type:"addMessage",from:Ee[Re-5].actor,to:Ee[Re-1].actor,signalType:Ee[Re-3],msg:Ee[Re],activate:!0,centralConnection:_e.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:_e.LINETYPE.CENTRAL_CONNECTION,actor:Ee[Re-1].actor},{type:"centralConnectionReverse",signalType:_e.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ee[Re-5].actor}];break;case 75:this.$=[Ee[Re-3],Ee[Re-1],{type:"addMessage",from:Ee[Re-3].actor,to:Ee[Re-1].actor,signalType:Ee[Re-2],msg:Ee[Re]}];break;case 76:this.$={type:"addParticipant",actor:Ee[Re-1],config:Ee[Re]};break;case 77:this.$=Ee[Re-1].trim();break;case 78:this.$={type:"addParticipant",actor:Ee[Re]};break;case 79:this.$=_e.LINETYPE.SOLID_OPEN;break;case 80:this.$=_e.LINETYPE.DOTTED_OPEN;break;case 81:this.$=_e.LINETYPE.SOLID;break;case 82:this.$=_e.LINETYPE.SOLID_TOP;break;case 83:this.$=_e.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=_e.LINETYPE.STICK_TOP;break;case 85:this.$=_e.LINETYPE.STICK_BOTTOM;break;case 86:this.$=_e.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=_e.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=_e.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=_e.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=_e.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=_e.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=_e.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=_e.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=_e.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=_e.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=_e.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=_e.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=_e.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=_e.LINETYPE.DOTTED;break;case 100:this.$=_e.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=_e.LINETYPE.SOLID_CROSS;break;case 102:this.$=_e.LINETYPE.DOTTED_CROSS;break;case 103:this.$=_e.LINETYPE.SOLID_POINT;break;case 104:this.$=_e.LINETYPE.DOTTED_POINT;break;case 105:this.$=_e.parseMessage(Ee[Re].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},t(P,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},t(P,[2,7]),t(P,[2,8]),t(P,[2,9]),t(P,[2,15]),{13:49,51:D,53:L,54:B},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:M},{23:56,73:M},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(P,[2,30]),t(P,[2,31]),{33:[1,62]},{35:[1,63]},t(P,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:F},{23:75,55:76,73:F},{23:77,73:M},{69:78,72:[1,79],78:V,79:z,80:W,81:X,82:j,83:re,84:Q,85:oe,86:ee,87:ne,88:ie,89:ae,90:de,91:le,92:ye,93:$e,94:Fe,95:ce,96:ve,97:Ce,98:Ne,99:Ie,100:Ae,101:be,102:ke,103:se},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:M},{23:111,73:M},{23:112,73:M},{23:113,73:M},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],J),t(P,[2,6]),t(P,[2,16]),t(G,[2,10],{11:114}),t(P,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(P,[2,22]),{5:[1,118]},{5:[1,119]},t(P,[2,25]),t(P,[2,26]),t(P,[2,27]),t(P,[2,28]),t(P,[2,29]),t(P,[2,32]),t(P,[2,33]),t(q,i,{7:120}),t(q,i,{7:121}),t(q,i,{7:122}),t(H,i,{41:123,7:124}),t(Z,i,{43:125,7:126}),t(Z,i,{7:126,43:127}),t(te,i,{46:128,7:129}),t(q,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(K,J,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:M},{69:146,78:V,79:z,80:W,81:X,82:j,83:re,84:Q,85:oe,86:ee,87:ne,88:ie,89:ae,90:de,91:le,92:ye,93:$e,94:Fe,95:ce,96:ve,97:Ce,98:Ne,99:Ie,100:Ae,101:be,102:ke,103:se},t(U,[2,79]),t(U,[2,80]),t(U,[2,81]),t(U,[2,82]),t(U,[2,83]),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(U,[2,89]),t(U,[2,90]),t(U,[2,91]),t(U,[2,92]),t(U,[2,93]),t(U,[2,94]),t(U,[2,95]),t(U,[2,96]),t(U,[2,97]),t(U,[2,98]),t(U,[2,99]),t(U,[2,100]),t(U,[2,101]),t(U,[2,102]),t(U,[2,103]),t(U,[2,104]),{23:147,73:M},{23:149,60:148,73:M},{73:[2,68]},{73:[2,69]},{58:150,104:Y},{58:152,104:Y},{58:153,104:Y},{58:154,104:Y},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:L,54:B},{5:[1,160]},t(P,[2,20]),t(P,[2,21]),t(P,[2,23]),t(P,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,50:[1,165],51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,49:[1,167],51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,48:[1,170],51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:C,40:w,42:S,44:E,45:_,47:R,51:D,53:L,54:B,56:$,61:A,62:I,63:O,64:N,73:M},{16:[1,172]},t(P,[2,50]),{16:[1,173]},t(P,[2,55]),t(K,[2,76]),{76:[1,174]},{16:[1,175]},t(P,[2,52]),{16:[1,176]},t(P,[2,57]),t(P,[2,53]),{23:177,73:M},{23:178,73:M},{23:179,73:M},{58:180,104:Y},{23:181,72:[1,182],73:M},{58:183,104:Y},{58:184,104:Y},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(P,[2,17]),t(G,[2,11]),{13:186,51:D,53:L,54:B},t(G,[2,13]),t(G,[2,14]),t(P,[2,19]),t(P,[2,35]),t(P,[2,36]),t(P,[2,37]),t(P,[2,38]),{16:[1,187]},t(P,[2,39]),{16:[1,188]},t(P,[2,40]),t(P,[2,41]),{16:[1,189]},t(P,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:Y},{58:196,104:Y},{58:197,104:Y},{5:[2,75]},{58:198,104:Y},{23:199,73:M},{5:[2,58]},{5:[2,59]},{23:200,73:M},t(G,[2,12]),t(H,i,{7:124,41:201}),t(Z,i,{7:126,43:202}),t(te,i,{7:129,46:203}),t(P,[2,49]),t(P,[2,54]),t(K,[2,77]),t(P,[2,51]),t(P,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:Y},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(we,xe){if(xe.recoverable)this.trace(we);else{var Le=new Error(we);throw Le.hash=xe,Le}},"parseError"),parse:x(function(we){var xe=this,Le=[0],_e=[],Be=[null],Ee=[],Xe=this.table,Re="",Qe=0,it=0,Ue=2,mt=1,ot=Ee.slice.call(arguments,1),Ke=Object.create(this.lexer),me={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(me.yy[dt]=this.yy[dt]);Ke.setInput(we,me.yy),me.yy.lexer=Ke,me.yy.parser=this,typeof Ke.yylloc>"u"&&(Ke.yylloc={});var at=Ke.yylloc;Ee.push(at);var et=Ke.options&&Ke.options.ranges;typeof me.yy.parseError=="function"?this.parseError=me.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ct(Dt){Le.length=Le.length-2*Dt,Be.length=Be.length-Dt,Ee.length=Ee.length-Dt}x(ct,"popStack");function Gt(){var Dt;return Dt=_e.pop()||Ke.lex()||mt,typeof Dt!="number"&&(Dt instanceof Array&&(_e=Dt,Dt=_e.pop()),Dt=xe.symbols_[Dt]||Dt),Dt}x(Gt,"lex");for(var Se,We,Je,nt,wt={},Vt,Mt,Yt,$t;;){if(We=Le[Le.length-1],this.defaultActions[We]?Je=this.defaultActions[We]:((Se===null||typeof Se>"u")&&(Se=Gt()),Je=Xe[We]&&Xe[We][Se]),typeof Je>"u"||!Je.length||!Je[0]){var tr="";$t=[];for(Vt in Xe[We])this.terminals_[Vt]&&Vt>Ue&&$t.push("'"+this.terminals_[Vt]+"'");Ke.showPosition?tr="Parse error on line "+(Qe+1)+`: `+Ke.showPosition()+` Expecting `+$t.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":tr="Parse error on line "+(Qe+1)+": Unexpected "+(Se==mt?"end of input":"'"+(this.terminals_[Se]||Se)+"'"),this.parseError(tr,{text:Ke.match,token:this.terminals_[Se]||Se,line:Ke.yylineno,loc:at,expected:$t})}if(Je[0]instanceof Array&&Je.length>1)throw new Error("Parse Error: multiple actions possible at state: "+We+", token: "+Se);switch(Je[0]){case 1:Le.push(Se),Be.push(Ke.yytext),Ee.push(Ke.yylloc),Le.push(Je[1]),Se=null,it=Ke.yyleng,Re=Ke.yytext,Qe=Ke.yylineno,at=Ke.yylloc;break;case 2:if(Mt=this.productions_[Je[1]][1],wt.$=Be[Be.length-Mt],wt._$={first_line:Ee[Ee.length-(Mt||1)].first_line,last_line:Ee[Ee.length-1].last_line,first_column:Ee[Ee.length-(Mt||1)].first_column,last_column:Ee[Ee.length-1].last_column},et&&(wt._$.range=[Ee[Ee.length-(Mt||1)].range[0],Ee[Ee.length-1].range[1]]),nt=this.performAction.apply(wt,[Re,it,Qe,me.yy,Je[1],Be,Ee].concat(ot)),typeof nt<"u")return nt;Mt&&(Le=Le.slice(0,-1*Mt*2),Be=Be.slice(0,-1*Mt),Ee=Ee.slice(0,-1*Mt)),Le.push(this.productions_[Je[1]][0]),Be.push(wt.$),Ee.push(wt._$),Yt=Xe[Le[Le.length-2]][Le[Le.length-1]],Le.push(Yt);break;case 3:return!0}}return!0},"parse")},ue=(function(){var ge={EOF:1,parseError:x(function(xe,Le){if(this.yy.parser)this.yy.parser.parseError(xe,Le);else throw new Error(xe)},"parseError"),setInput:x(function(we,xe){return this.yy=xe||this.yy||{},this._input=we,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var we=this._input[0];this.yytext+=we,this.yyleng++,this.offset++,this.match+=we,this.matched+=we;var xe=we.match(/(?:\r\n?|\n).*/g);return xe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),we},"input"),unput:x(function(we){var xe=we.length,Le=we.split(/(?:\r\n?|\n)/g);this._input=we+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-xe),this.offset-=xe;var _e=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Le.length-1&&(this.yylineno-=Le.length-1);var Be=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Le?(Le.length===_e.length?this.yylloc.first_column:0)+_e[_e.length-Le.length].length-Le[0].length:this.yylloc.first_column-xe},this.options.ranges&&(this.yylloc.range=[Be[0],Be[0]+this.yyleng-xe]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(we){this.unput(this.match.slice(we))},"less"),pastInput:x(function(){var we=this.matched.substr(0,this.matched.length-this.match.length);return(we.length>20?"...":"")+we.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var we=this.match;return we.length<20&&(we+=this._input.substr(0,20-we.length)),(we.substr(0,20)+(we.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var we=this.pastInput(),xe=new Array(we.length+1).join("-");return we+this.upcomingInput()+` `+xe+"^"},"showPosition"),test_match:x(function(we,xe){var Le,_e,Be;if(this.options.backtrack_lexer&&(Be={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Be.yylloc.range=this.yylloc.range.slice(0))),_e=we[0].match(/(?:\r\n?|\n).*/g),_e&&(this.yylineno+=_e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_e?_e[_e.length-1].length-_e[_e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+we[0].length},this.yytext+=we[0],this.match+=we[0],this.matches=we,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(we[0].length),this.matched+=we[0],Le=this.performAction.call(this,this.yy,this,xe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Le)return Le;if(this._backtrack){for(var Ee in Be)this[Ee]=Be[Ee];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var we,xe,Le,_e;this._more||(this.yytext="",this.match="");for(var Be=this._currentRules(),Ee=0;Eexe[0].length)){if(xe=Le,_e=Ee,this.options.backtrack_lexer){if(we=this.test_match(Le,Be[Ee]),we!==!1)return we;if(this._backtrack){xe=!1;continue}else return!1}else if(!this.options.flex)break}return xe?(we=this.test_match(xe,Be[_e]),we!==!1?we:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var xe=this.next();return xe||this.lex()},"lex"),begin:x(function(xe){this.conditionStack.push(xe)},"begin"),popState:x(function(){var xe=this.conditionStack.length-1;return xe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(xe){return xe=this.conditionStack.length-1-Math.abs(xe||0),xe>=0?this.conditionStack[xe]:"INITIAL"},"topState"),pushState:x(function(xe){this.begin(xe)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(xe,Le,_e,Be){switch(_e){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Le.yytext=Le.yytext.trim(),73;case 12:return Le.yytext=Le.yytext.trim(),this.begin("ALIAS"),73;case 13:return Le.yytext=Le.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Le.yytext=Le.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Le.yytext=Le.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return ge})();fe.lexer=ue;function Te(){this.yy={}}return x(Te,"Parser"),Te.prototype=fe,fe.Parser=Te,new Te})();iM.parser=iM;var Qit=iM,Jit={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},eat={FILLED:0,OPEN:1},tat={LEFTOF:0,RIGHTOF:1,OVER:2},_2={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Qy,rat=(Qy=class{constructor(){this.state=new z$(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=rn,this.setAccDescription=gn,this.setDiagramTitle=dn,this.getAccTitle=pn,this.getAccDescription=mn,this.getDiagramTitle=an,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Pe().wrap),this.LINETYPE=Jit,this.ARROWTYPE=eat,this.PLACEMENT=tat}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` `)?u=a+` `:u=`{ `+a+` }`,o=rk(u,{schema:tk})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Pe().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),Xr()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return he.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?xr(s,Pe()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=xr(r.text,Pe());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){he.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=xr(r.text,Pe());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){he.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=xr(r.text,Pe()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){he.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){he.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":rn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Pe().sequence}},x(Qy,"SequenceDB"),Qy),nat=x(t=>{const e=t.dropShadow??"none",{look:r}=Pe();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; } rect.actor.outer-path[data-look="neo"] { filter: ${e}; } rect.note[data-look="neo"] { stroke:${t.noteBorderColor}; fill:${t.noteBkgColor}; filter: ${e}; } text.actor > tspan { fill: ${t.actorTextColor}; stroke: none; } .actor-line { stroke: ${t.actorLineColor}; } .innerArc { stroke-width: 1.5; stroke-dasharray: none; } .messageLine0 { stroke-width: 1.5; stroke-dasharray: none; stroke: ${t.signalColor}; } .messageLine1 { stroke-width: 1.5; stroke-dasharray: 2, 2; stroke: ${t.signalColor}; } [id$="-arrowhead"] path { fill: ${t.signalColor}; stroke: ${t.signalColor}; } .sequenceNumber { fill: ${t.sequenceNumberColor}; } [id$="-sequencenumber"] { fill: ${t.signalColor}; } [id$="-crosshead"] path { fill: ${t.signalColor}; stroke: ${t.signalColor}; } .messageText { fill: ${t.signalTextColor}; stroke: none; } .labelBox { stroke: ${t.labelBoxBorderColor}; fill: ${t.labelBoxBkgColor}; filter: ${r==="neo"?e:"none"}; } .labelText, .labelText > tspan { fill: ${t.labelTextColor}; stroke: none; } .loopText, .loopText > tspan { fill: ${t.loopTextColor}; stroke: none; } .sectionTitle, .sectionTitle > tspan { fill: ${t.loopTextColor}; stroke: none; } .loopLine { stroke-width: 2px; stroke-dasharray: 2, 2; stroke: ${t.labelBoxBorderColor}; fill: ${t.labelBoxBorderColor}; } .note { //stroke: #decc93; stroke: ${t.noteBorderColor}; fill: ${t.noteBkgColor}; } .noteText, .noteText > tspan { fill: ${t.noteTextColor}; stroke: none; ${t.noteFontWeight?`font-weight: ${t.noteFontWeight};`:""} } .activation0 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .activation1 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .activation2 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .actorPopupMenu { position: absolute; } .actorPopupMenuPanel { position: absolute; fill: ${t.actorBkg}; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); } .actor-man circle, line { fill: ${t.actorBkg}; stroke-width: 2px; } g rect.rect { filter: ${e}; stroke: ${t.nodeBorder}; } `},"getStyles"),iat=nat,Rh=36,bu="actor-top",Tu="actor-bottom",q_="actor-box",od="actor-man",lc=new Set(["redux-color","redux-dark-color"]),xb=x(function(t,e){const r=Rk(t,e);return It().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),aat=x(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=nv.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),Aat(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),U_=x(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),lS=x(async function(t,e,r=null){let n=t.append("foreignObject");const i=await bS(e.text,It()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),j0=x(function(t,e){let r=0,n=0;const i=e.text.split(yt.lineBreakRegex),[a,s]=Zl(e.fontSize);let o=[],l=0,u=x(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=x(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=x(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=x(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||UX;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),cme=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,j0(t,e),n},"drawLabel"),Tr=-1,ume=x((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),sat=x(function(t,e,r,n,i){var C,w;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Tr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",U_(`actor${Tr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Tr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Tr,e.links!=null&&g.attr("id","root-"+Tr),l==="neo"&&g.attr("data-look","neo"));const m=ks();var y="actor";(C=e.properties)!=null&&C.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Tu}`:y+=` ${bu}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=xb(g,m),T=i.get(e.name)??0;if(lc.has(u)&&(v.style("stroke",f[T%f.length]),v.style("fill",d[T%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(w=e.properties)!=null&&w.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?D$(g,m.x+m.width-20,m.y+10,S.substr(1)):I$(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),cc(r,On(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${q_}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),oat=x(function(t,e,r,n,i){var E,_;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Tr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",U_(`actor${Tr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Tr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Tr,e.links!=null&&g.attr("id","root-"+Tr),l==="neo"&&g.attr("data-look","neo"));const m=ks();var y="actor";(E=e.properties)!=null&&E.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Tu}`:y+=` ${bu}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,T={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=xb(g,m),C=xb(g,T);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;if(lc.has(u)&&(b.style("stroke",f[w%f.length]),b.style("fill",d[w%f.length]),C.style("stroke",f[w%f.length]),C.style("fill",d[w%f.length])),(_=e.properties)!=null&&_.icon){const R=e.properties.icon.trim();R.charAt(0)==="@"?D$(g,m.x+m.width-20,m.y+10,R.substr(1)):I$(g,m.x+m.width-20,m.y+10,R)}cc(r,On(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${q_}`},r);let S=e.height;if(b.node){const R=b.node().getBBox();e.height=R.height,S=R.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),lat=x(function(t,e,r,n,i){var R,D;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Tr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",U_(`actor${Tr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Tr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Tr,e.links!=null&&g.attr("id","root-"+Tr),l==="neo"&&g.attr("data-look","neo"));const m=ks();let y="actor";(R=e.properties)!=null&&R.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Tu}`:y+=` ${bu}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,T=v/(2.5+m.height/50),b=g.append("g"),C=g.append("g"),w=`M ${m.x},${m.y+v} a ${T},${v} 0 0 0 0,${m.height} h ${m.width-2*T} a ${T},${v} 0 0 0 0,-${m.height} Z `;b.append("path").attr("d",w),C.append("path").attr("d",`M ${m.x},${m.y+v} a ${T},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${T}, ${-(m.height/2)})`),C.attr("transform",`translate(${m.width-T}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(lc.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),C.style("stroke",f[S%f.length]),C.style("fill",d[S%f.length])),(D=e.properties)!=null&&D.icon){const L=e.properties.icon.trim(),B=m.x+m.width-20,$=m.y+10;L.charAt(0)==="@"?D$(g,B,$,L.substr(1)):I$(g,B,$,L)}cc(r,On(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${q_}`},r);let E=e.height;const _=b.select("path:last-child");if(_.node()){const L=_.node().getBBox();e.height=L.height,E=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),E},"drawActorTypeQueue"),cat=x(function(t,e,r,n,i,a){var R;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Tr++,y.append("line").attr("id","actor"+Tr).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Tr);const v=t.append("g");let T=od;n?T+=` ${Tu}`:T+=` ${bu}`,v.attr("class",T),v.attr("name",e.name);const b=ks();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const C=e.x+e.width/2,w=s+32,S=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",C).attr("cy",w).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${C}, ${w-S})`);const E=a.get(e.name)??0;lc.has(h)?(v.style("stroke",p[E%p.length]),v.style("fill",f[E%p.length])):(v.style("stroke",g),v.style("fill",m));const _=v.node().getBBox();return e.height=_.height+2*(((R=r==null?void 0:r.sequence)==null?void 0:R.labelBoxHeight)??0),cc(r,On(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${od}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),uat=x(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${Tu}`:m+=` ${bu}`,g.attr("class",m),g.attr("name",e.name);const y=ks();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,T=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",T).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",T+b).attr("y2",T+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;lc.has(u)&&(g.style("stroke",f[C%f.length]),g.style("fill",d[C%f.length]));const w=g.node().getBBox();return e.height=w.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Tr++,p.append("line").attr("id","actor"+Tr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Tr),cc(r,On(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${od}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),hat=x(function(t,e,r,n,i){var D;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Tr++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",U_(`actor${Tr}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Tr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Tr,e.links!=null&&m.attr("id","root-"+Tr),h==="neo"&&m.attr("data-look","neo"));const y=ks();let v="actor";(D=e.properties)!=null&&D.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Tu}`:v+=` ${bu}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const T=y.width/3,b=y.width/3,C=T/2,w=C/(2.5+T/50),S=m.append("g");S.attr("class",v);const E=` M ${y.x},${y.y+w} a ${C},${w} 0 0 0 ${T},0 a ${C},${w} 0 0 0 -${T},0 l 0,${b-2*w} a ${C},${w} 0 0 0 ${T},0 l 0,-${b-2*w} `;S.append("path").attr("d",E),h==="neo"&&S.attr("filter","url(#drop-shadow)");const _=i.get(e.name)??0;lc.has(l)?(S.style("stroke",f[_%f.length]),S.style("fill",d[_%f.length])):S.style("stroke",p),S.attr("transform",`translate(${T}, ${w})`),e.rectData=y,cc(r,On(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${q_}`},r);const R=S.select("path:last-child");if(R.node()){const L=R.node().getBBox();e.height=L.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),dat=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Tr++,u.append("line").attr("id","actor"+Tr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Tr);const y=t.append("g");let v=od;n?v+=` ${Tu}`:v+=` ${bu}`,y.attr("class",v),y.attr("name",e.name);const T=ks();T.x=e.x,T.y=a,T.fill="#eaeaea",T.width=e.width,T.height=e.height,T.class="actor",y.append("line").attr("id","actor-man-torso"+Tr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Tr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;lc.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const C=y.node().getBBox();return e.height=C.height+(r.sequence.labelBoxHeight??0),cc(r,On(e.description))(e.description,y,T.x,T.y+15,T.width,T.height,{class:`actor ${od}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),fat=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Tr++,g.append("line").attr("id","actor"+Tr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Tr);const m=t.append("g");let y=od;n?y+=` ${Tu}`:y+=` ${bu}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,T=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Tr).attr("x1",s).attr("y1",T+25*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("id","actor-man-arms"+Tr).attr("x1",s-Rh/2*v).attr("y1",T+33*v).attr("x2",s+Rh/2*v).attr("y2",T+33*v),m.append("line").attr("x1",s-Rh/2*v).attr("y1",T+60*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("x1",s).attr("y1",T+45*v).attr("x2",s+(Rh/2-2)*v).attr("y2",T+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",T+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const C=m.node().getBBox();e.height=C.height;const w=ks();w.x=e.x,w.y=T,w.fill="#eaeaea",w.width=e.width,w.height=e.height/v,w.class="actor",w.rx=3,w.ry=3;const S=i.get(e.name)??0;return lc.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),cc(r,On(e.description))(e.description,m,w.x,T+35*v-(l==="neo"?10:0),w.width,w.height,{class:`actor ${od}`},r),e.height},"drawActorTypeActor"),pat=x(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await fat(t,e,r,n,o);case"participant":return await sat(t,e,r,n,o);case"boundary":return await dat(t,e,r,n,o);case"control":return await cat(t,e,r,n,i,o);case"entity":return await uat(t,e,r,n,o);case"database":return await hat(t,e,r,n,o);case"collections":return await oat(t,e,r,n,o);case"queue":return await lat(t,e,r,n,o)}},"drawActor"),gat=x(function(t,e,r){const i=t.append("g");hme(i,e),e.name&&cc(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),mat=x(function(t){return t.append("g")},"anchorElement"),yat=x(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=ks(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=xb(p,f),v=(s??new Map([...a.db.getActors().values()].map((T,b)=>[T.name,b]))).get(g)??0;lc.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),vat=x(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=x(function(y,v,T,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",T).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=M$();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",cme(f,g),g=dme(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=On(g.text)?await lS(f,g,e):j0(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,On(g.text)?(e.starty=e.sections[y].y,await lS(f,g,e)):j0(f,g);let T=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,C)=>b+C));e.sections[y].height+=T-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),hme=x(function(t,e){wne(t,e)},"drawBackgroundRect"),xat=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),bat=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Tat=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Cat=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),wat=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).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")},"insertArrowFilledHead"),Eat=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),Sat=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),kat=x(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),dme=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),_at=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),cc=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}x(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=Zl(p),T=a.split(yt.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(t){this.boxes.push(t)},"addBox"),addActor:x(function(t){this.actors.push(t)},"addActor"),addLoop:x(function(t){this.loops.push(t)},"addLoop"),addMessage:x(function(t){this.messages.push(t)},"addMessage"),addNote:x(function(t){this.notes.push(t)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,gme(Pe())},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=this;let a=0;function s(o){return x(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*ze.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*ze.boxMargin,Math.max),i.updateVal(ht.data,"startx",t-h*ze.boxMargin,Math.min),i.updateVal(ht.data,"stopx",r+h*ze.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*ze.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*ze.boxMargin,Math.max),i.updateVal(ht.data,"starty",e-h*ze.boxMargin,Math.min),i.updateVal(ht.data,"stopy",n+h*ze.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(t,e,r,n){const i=yt.getMin(t,r),a=yt.getMax(t,r),s=yt.getMin(e,n),o=yt.getMax(e,n);this.updateVal(ht.data,"startx",i,Math.min),this.updateVal(ht.data,"starty",s,Math.min),this.updateVal(ht.data,"stopx",a,Math.max),this.updateVal(ht.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:x(function(t,e,r){const n=r.get(t.from),i=H_(t.from).length||0,a=n.x+n.width/2+(i-1)*ze.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+ze.activationWidth,stopy:void 0,actor:t.from,anchored:Jr.anchorElement(e)})},"newActivation"),endActivation:x(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:ht.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=yt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},Mat=x(async function(t,e,r){ht.bumpVerticalPos(ze.boxMargin),e.height=ze.boxMargin,e.starty=ht.getVerticalPos();const n=ks();n.x=e.startx,n.y=e.starty,n.width=e.width||ze.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Jr.drawRect(i,n),s=M$();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=ze.noteFontFamily,s.fontSize=ze.noteFontSize,s.fontWeight=ze.noteFontWeight,s.anchor=ze.noteAlign,s.textMargin=ze.noteMargin,s.valign="center";const o=On(s.text)?await lS(i,s):j0(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*ze.noteMargin),e.height+=l+2*ze.noteMargin,ht.bumpVerticalPos(l+2*ze.noteMargin),e.stopy=e.starty+l+2*ze.noteMargin,e.stopx=e.startx+n.width,ht.insert(e.startx,e.starty,e.stopx,e.stopy),ht.models.addNote(e)},"drawNote"),$U=x(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=xme(e,n),m=t.append("g"),y=16.5,v=x((S,E)=>{const _=S?y:-y;return E?-_:_},"getCircleOffset"),T=x(S=>{m.append("circle").attr("cx",S).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:C,CENTRAL_CONNECTION_DUAL:w}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case C:g||(d+=v(p,!1));break;case w:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:T(f);break;case C:T(d);break;case w:T(d),T(f);break}},"drawCentralConnection"),ld=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Of=x(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),aM=x(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function fme(t,e){ht.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=yt.splitBreaks(i).length,s=On(i),o=s?await Ab(i,Pe()):sr.calculateTextDimensions(i,ld(ze));if(!s){const d=o.height/a;e.height+=d,ht.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=ht.getVerticalPos()+u,ze.rightAngles||(u+=ze.boxMargin,l=ht.getVerticalPos()+u),u+=30;const d=yt.getMax(h/2,ze.width/2);ht.insert(r-d,ht.getVerticalPos()-10+u,n+d,ht.getVerticalPos()+30+u)}else u+=ze.boxMargin,l=ht.getVerticalPos()+u,ht.insert(r,l-10,n,l);return ht.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,ht.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}x(fme,"boundMessage");var Nat=x(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=sr.calculateTextDimensions(u,ld(ze)),g=M$();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=ze.messageFontFamily,g.fontSize=ze.messageFontSize,g.fontWeight=ze.messageFontWeight,g.anchor=ze.messageAlign,g.valign="center",g.textMargin=ze.wrapPadding,g.tspan=!1,On(g.text)?await lS(t,g,{startx:s,stopx:o,starty:r}):j0(t,g);const m=p.width;let y;if(s===o){const T=f||ze.showSequenceNumbers,b=xme(i,n),C=Gat(i,n),w=s+(T&&(b||C)?10:0);ze.rightAngles?y=t.append("path").attr("d",`M ${w},${r} H ${s+yt.getMax(ze.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+w+","+r+" C "+(w+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),AI(i,n)&&$U(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),AI(i,n)&&$U(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(ze.arrowMarkerAbsolute&&(v=UM(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||ze.showSequenceNumbers){const T=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,C=6,w=AI(i,n);let S=s,E=o;T?(ss?E=o-2*C:(E=o-C,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),E+=w?15:0,y.attr("x2",E),y.attr("x1",S)):y.attr("x1",s+C);let _=0;const R=s===o,D=s<=o;R?_=e.fromBounds+1:b?_=D?e.toBounds-1:e.fromBounds+1:_=D?e.fromBounds+1:e.toBounds-1;let L="12px";const B=d.toString().length;B>5?L="7px":B>3&&(L="9px"),t.append("line").attr("x1",_).attr("y1",r).attr("x2",_).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",_).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",L).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),Oat=x(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||ht.models.addBox(u),l+=ze.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=yt.getMax(f.width||ze.width,ze.width),f.height=yt.getMax(f.height||ze.height,ze.height),f.margin=f.margin||ze.actorMargin,h=yt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=ht.getVerticalPos(),ht.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,ht.models.addActor(f)}u&&!s&&ht.models.addBox(u),ht.bumpVerticalPos(h)},"addActorRenderingData"),sM=x(async function(t,e,r,n,i,a,s){if(n){let o=0;ht.bumpVerticalPos(ze.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=ht.getVerticalPos());const h=await Jr.drawActor(t,u,ze,!0,i,a,s);o=yt.getMax(o,h)}ht.bumpVerticalPos(o+ze.boxMargin)}else for(const o of r){const l=e.get(o);await Jr.drawActor(t,l,ze,!1,i,a,s)}},"drawActors"),pme=x(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=Pat(o),u=Jr.drawPopup(t,o,l,ze,ze.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),gme=x(function(t){Gn(ze,t),t.fontFamily&&(ze.actorFontFamily=ze.noteFontFamily=ze.messageFontFamily=t.fontFamily),t.fontSize&&(ze.actorFontSize=ze.noteFontSize=ze.messageFontSize=t.fontSize),t.fontWeight&&(ze.actorFontWeight=ze.noteFontWeight=ze.messageFontWeight=t.fontWeight)},"setConf"),H_=x(function(t){return ht.activations.filter(function(e){return e.actor===t})},"actorActivations"),PU=x(function(t,e){const r=e.get(t),n=H_(t),i=n.reduce(function(s,o){return yt.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return yt.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Ms(t,e,r,n,i){ht.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=ld(ze);e.message=sr.wrapLabel(`[${e.message}]`,s-2*ze.wrapPadding,o),e.width=s,e.wrap=!0;const l=sr.calculateTextDimensions(e.message,o),u=yt.getMax(l.height,ze.labelBoxHeight);a=n+u,he.debug(`${u} - ${e.message}`)}i(e),ht.bumpVerticalPos(a)}x(Ms,"adjustLoopHeightForWrap");function mme(t,e,r,n,i,a,s){function o(h,d){h.x{z.add(W.from),z.add(W.to)}),y=y.filter(W=>z.has(W))}const S=new Map(y.map((z,W)=>{var X;return[((X=f.get(z))==null?void 0:X.name)??z,W]}));Oat(d,f,p,y,0,v,!1);const E=await Wat(v,f,w,n);Jr.insertArrowHead(d,e),Jr.insertArrowCrossHead(d,e),Jr.insertArrowFilledHead(d,e),Jr.insertSequenceNumber(d,e),Jr.insertSolidTopArrowHead(d,e),Jr.insertSolidBottomArrowHead(d,e),Jr.insertStickTopArrowHead(d,e),Jr.insertStickBottomArrowHead(d,e),s==="neo"&&Jr.insertDropShadow(d,ze);function _(z,W){const X=ht.endActivation(z);X.starty+18>W&&(X.starty=W-6,W+=12),Jr.drawActivation(d,X,W,ze,H_(z.from).length,n,S),ht.insert(X.startx,W-10,X.stopx,W)}x(_,"activeEnd");let R=1,D=1;const L=[],B=[];let $=0;for(const z of v){let W,X,j;switch(z.type){case n.db.LINETYPE.NOTE:ht.resetVerticalPos(),X=z.noteModel,await Mat(d,X,z.id);break;case n.db.LINETYPE.ACTIVE_START:ht.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:ht.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:ht.newActivation(z,d,f);break;case n.db.LINETYPE.ACTIVE_END:_(z,ht.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Ms(E,z,ze.boxMargin,ze.boxMargin+ze.boxTextMargin,re=>ht.newLoop(re));break;case n.db.LINETYPE.LOOP_END:W=ht.endLoop(),await Jr.drawLoop(d,W,"loop",ze,z),ht.bumpVerticalPos(W.stopy-ht.getVerticalPos()),ht.models.addLoop(W);break;case n.db.LINETYPE.RECT_START:Ms(E,z,ze.boxMargin,ze.boxMargin,re=>{let Q=re.message;Q||(Q=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),ht.newLoop(void 0,Q)});break;case n.db.LINETYPE.RECT_END:W=ht.endLoop(),B.push(W),ht.models.addLoop(W),ht.bumpVerticalPos(W.stopy-ht.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Ms(E,z,ze.boxMargin,ze.boxMargin+ze.boxTextMargin,re=>ht.newLoop(re));break;case n.db.LINETYPE.OPT_END:W=ht.endLoop(),await Jr.drawLoop(d,W,"opt",ze,z),ht.bumpVerticalPos(W.stopy-ht.getVerticalPos()),ht.models.addLoop(W);break;case n.db.LINETYPE.ALT_START:Ms(E,z,ze.boxMargin,ze.boxMargin+ze.boxTextMargin,re=>ht.newLoop(re));break;case n.db.LINETYPE.ALT_ELSE:Ms(E,z,ze.boxMargin+ze.boxTextMargin,ze.boxMargin,re=>ht.addSectionToLoop(re));break;case n.db.LINETYPE.ALT_END:W=ht.endLoop(),await Jr.drawLoop(d,W,"alt",ze,z),ht.bumpVerticalPos(W.stopy-ht.getVerticalPos()),ht.models.addLoop(W);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Ms(E,z,ze.boxMargin,ze.boxMargin+ze.boxTextMargin,re=>ht.newLoop(re)),ht.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Ms(E,z,ze.boxMargin+ze.boxTextMargin,ze.boxMargin,re=>ht.addSectionToLoop(re));break;case n.db.LINETYPE.PAR_END:W=ht.endLoop(),await Jr.drawLoop(d,W,"par",ze,z),ht.bumpVerticalPos(W.stopy-ht.getVerticalPos()),ht.models.addLoop(W);break;case n.db.LINETYPE.AUTONUMBER:R=z.message.start||R,D=z.message.step||D,z.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Ms(E,z,ze.boxMargin,ze.boxMargin+ze.boxTextMargin,re=>ht.newLoop(re));break;case n.db.LINETYPE.CRITICAL_OPTION:Ms(E,z,ze.boxMargin+ze.boxTextMargin,ze.boxMargin,re=>ht.addSectionToLoop(re));break;case n.db.LINETYPE.CRITICAL_END:W=ht.endLoop(),await Jr.drawLoop(d,W,"critical",ze,z),ht.bumpVerticalPos(W.stopy-ht.getVerticalPos()),ht.models.addLoop(W);break;case n.db.LINETYPE.BREAK_START:Ms(E,z,ze.boxMargin,ze.boxMargin+ze.boxTextMargin,re=>ht.newLoop(re));break;case n.db.LINETYPE.BREAK_END:W=ht.endLoop(),await Jr.drawLoop(d,W,"break",ze,z),ht.bumpVerticalPos(W.stopy-ht.getVerticalPos()),ht.models.addLoop(W);break;default:try{j=z.msgModel,j.starty=ht.getVerticalPos(),j.sequenceIndex=R,j.sequenceVisible=n.db.showSequenceNumbers(),j.id=z.id,j.from=z.from,j.to=z.to;const re=await fme(d,j);mme(z,j,re,$,f,p,g),L.push({messageModel:j,lineStartY:re,msg:z}),ht.models.addMessage(j)}catch(re){he.error("error while drawing message",re)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(z.type)&&(R=Math.round((R+D)*100)/100),$++}he.debug("createdActors",p),he.debug("destroyedActors",g),await sM(d,f,y,!1,e,n,S);for(const z of L)await Nat(d,z.messageModel,z.lineStartY,n,z.msg,e);ze.mirrorActors&&await sM(d,f,y,!0,e,n,S),B.forEach(z=>Jr.drawBackgroundRect(d,z)),ume(d,f,y,ze);for(const z of ht.models.boxes){z.height=ht.getVerticalPos()-z.y,ht.insert(z.x,z.y,z.x+z.width,z.height);const W=ze.boxMargin*2;z.startx=z.x-W,z.starty=z.y-W*.25,z.stopx=z.startx+z.width+2*W,z.stopy=z.starty+z.height+W*.75,z.stroke="rgb(0,0,0, 0.5)",Jr.drawBox(d,z,ze)}b&&ht.bumpVerticalPos(ze.boxMargin);const A=pme(d,f,y,h),{bounds:I}=ht.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let O=I.stopy-I.starty;O{const s=ld(ze);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=ze.boxMargin*8;o+=l,o-=2*ze.boxTextMargin,a.wrap&&(a.name=sr.wrapLabel(a.name,o-2*ze.wrapPadding,s));const u=sr.calculateTextDimensions(a.name,s);i=yt.getMax(u.height,i);const h=yt.getMax(o,u.width+2*ze.wrapPadding);if(a.margin=ze.boxTextMargin,oa.textMaxHeight=i),yt.getMax(n,ze.height)}x(vme,"calculateActorMargins");var Bat=x(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=On(t.message)?await Ab(t.message,Pe()):sr.calculateTextDimensions(o?sr.wrapLabel(t.message,ze.width,Of(ze)):t.message,Of(ze));const u={width:o?ze.width:yt.getMax(ze.width,l.width+2*ze.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?yt.getMax(ze.width,l.width):yt.getMax(n.width/2+i.width/2,l.width+2*ze.noteMargin),u.startx=a+(n.width+ze.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?yt.getMax(ze.width,l.width+2*ze.noteMargin):yt.getMax(n.width/2+i.width/2,l.width+2*ze.noteMargin),u.startx=a-u.width+(n.width-ze.actorMargin)/2):t.to===t.from?(l=sr.calculateTextDimensions(o?sr.wrapLabel(t.message,yt.getMax(ze.width,n.width),Of(ze)):t.message,Of(ze)),u.width=o?yt.getMax(ze.width,n.width):yt.getMax(n.width,ze.width,l.width+2*ze.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+ze.actorMargin,u.startx=a2,f=x(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(ze.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=sr.wrapLabel(t.message,yt.getMax(g+2*ze.wrapPadding,ze.width),ld(ze)));const m=sr.calculateTextDimensions(t.message,ld(ze));return{width:yt.getMax(t.wrap?0:m.width+2*ze.wrapPadding,g+2*ze.wrapPadding,ze.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),Wat=x(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=H_(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*ze.activationWidth/2,g={startx:p,stopx:p+ze.activationWidth,actor:u.from,enabled:!0};ht.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=ht.activations.map(f=>f.actor).lastIndexOf(u.from);ht.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await Bat(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=yt.getMin(s.from,o.startx),s.to=yt.getMax(s.to,o.startx+o.width),s.width=yt.getMax(s.width,Math.abs(s.from-s.to))-ze.labelBoxWidth})):(l=Vat(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=yt.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=yt.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=yt.getMax(s.width,Math.abs(s.to-s.from))-ze.labelBoxWidth}else s.from=yt.getMin(l.startx,s.from),s.to=yt.getMax(l.stopx,s.to),s.width=yt.getMax(s.width,l.width)-ze.labelBoxWidth}))}return ht.activations=[],he.debug("Loop type widths:",i),i},"calculateLoopBounds"),qat={bounds:ht,drawActors:sM,drawActorsPopup:pme,setConf:gme,draw:$at},Uat={parser:Qit,get db(){return new rat},renderer:qat,styles:iat,init:x(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,XI({sequence:{wrap:t.wrap}}))},"init")};const Hat=Object.freeze(Object.defineProperty({__proto__:null,diagram:Uat},Symbol.toStringTag,{value:"Module"}));var oM=(function(){var t=x(function(J,G,q,H){for(q=q||{},H=J.length;H--;q[J[H]]=G);return q},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],T=[1,28],b=[1,29],C=[1,30],w=[1,31],S=[1,44],E=[1,46],_=[1,43],R=[1,47],D=[1,9],L=[1,8,9],B=[1,58],$=[1,59],A=[1,60],I=[1,61],O=[1,62],N=[1,63],M=[1,64],P=[1,8,9,41],F=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],z=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],W=[13,60,86,100,102,103],X=[13,60,73,74,86,100,102,103],j=[13,60,68,69,70,71,72,86,100,102,103],re=[1,103],Q=[1,121],oe=[1,117],ee=[1,113],ne=[1,119],ie=[1,114],ae=[1,115],de=[1,116],le=[1,118],ye=[1,120],$e=[22,50,60,61,82,86,87,88,89,90],Fe=[1,128],ce=[12,39],ve=[1,8,9,39,41,44,46],Ce=[1,8,9,22],Ne=[1,153],Ie=[1,8,9,61],Ae=[1,8,9,22,50,60,61,82,86,87,88,89,90],be={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:x(function(G,q,H,Z,te,K,U){var Y=K.length-1;switch(te){case 8:this.$=K[Y-1];break;case 9:case 10:case 13:case 15:this.$=K[Y];break;case 11:case 14:this.$=K[Y-2]+"."+K[Y];break;case 12:case 16:this.$=K[Y-1]+K[Y];break;case 17:case 18:this.$=K[Y-1]+"~"+K[Y]+"~";break;case 19:Z.addRelation(K[Y]);break;case 20:K[Y-1].title=Z.cleanupLabel(K[Y]),Z.addRelation(K[Y-1]);break;case 31:this.$=K[Y].trim(),Z.setAccTitle(this.$);break;case 32:case 33:this.$=K[Y].trim(),Z.setAccDescription(this.$);break;case 34:Z.addClassesToNamespace(K[Y-3],K[Y-1][0],K[Y-1][1]),Z.popNamespace();break;case 35:Z.addClassesToNamespace(K[Y-4],K[Y-1][0],K[Y-1][1]),Z.popNamespace();break;case 36:this.$=Z.addNamespace(K[Y]);break;case 37:this.$=Z.addNamespace(K[Y-1],K[Y]);break;case 38:this.$=[[K[Y]],[]];break;case 39:this.$=[[K[Y-1]],[]];break;case 40:K[Y][0].unshift(K[Y-2]),this.$=K[Y];break;case 41:this.$=[[],[K[Y]]];break;case 42:this.$=[[],[K[Y-1]]];break;case 43:K[Y][1].unshift(K[Y-2]),this.$=K[Y];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=K[Y];break;case 48:Z.setCssClass(K[Y-2],K[Y]);break;case 49:Z.addMembers(K[Y-3],K[Y-1]);break;case 51:Z.setCssClass(K[Y-5],K[Y-3]),Z.addMembers(K[Y-5],K[Y-1]);break;case 52:Z.addAnnotation(K[Y-3],K[Y-1]);break;case 53:Z.addAnnotation(K[Y-6],K[Y-4]),Z.addMembers(K[Y-6],K[Y-1]);break;case 54:Z.addAnnotation(K[Y-5],K[Y-3]);break;case 55:this.$=K[Y],Z.addClass(K[Y]);break;case 56:this.$=K[Y-1],Z.addClass(K[Y-1]),Z.setClassLabel(K[Y-1],K[Y]);break;case 60:Z.addAnnotation(K[Y],K[Y-2]);break;case 61:case 74:this.$=[K[Y]];break;case 62:K[Y].push(K[Y-1]),this.$=K[Y];break;case 63:break;case 64:Z.addMember(K[Y-1],Z.cleanupLabel(K[Y]));break;case 65:break;case 66:break;case 67:this.$={id1:K[Y-2],id2:K[Y],relation:K[Y-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:K[Y-3],id2:K[Y],relation:K[Y-1],relationTitle1:K[Y-2],relationTitle2:"none"};break;case 69:this.$={id1:K[Y-3],id2:K[Y],relation:K[Y-2],relationTitle1:"none",relationTitle2:K[Y-1]};break;case 70:this.$={id1:K[Y-4],id2:K[Y],relation:K[Y-2],relationTitle1:K[Y-3],relationTitle2:K[Y-1]};break;case 71:this.$=Z.addNote(K[Y],K[Y-1]);break;case 72:this.$=Z.addNote(K[Y]);break;case 73:this.$=K[Y-2],Z.defineClass(K[Y-1],K[Y]);break;case 75:this.$=K[Y-2].concat([K[Y]]);break;case 76:Z.setDirection("TB");break;case 77:Z.setDirection("BT");break;case 78:Z.setDirection("RL");break;case 79:Z.setDirection("LR");break;case 80:this.$={type1:K[Y-2],type2:K[Y],lineType:K[Y-1]};break;case 81:this.$={type1:"none",type2:K[Y],lineType:K[Y-1]};break;case 82:this.$={type1:K[Y-1],type2:"none",lineType:K[Y]};break;case 83:this.$={type1:"none",type2:"none",lineType:K[Y]};break;case 84:this.$=Z.relationType.AGGREGATION;break;case 85:this.$=Z.relationType.EXTENSION;break;case 86:this.$=Z.relationType.COMPOSITION;break;case 87:this.$=Z.relationType.DEPENDENCY;break;case 88:this.$=Z.relationType.LOLLIPOP;break;case 89:this.$=Z.lineType.LINE;break;case 90:this.$=Z.lineType.DOTTED_LINE;break;case 91:case 97:this.$=K[Y-2],Z.setClickEvent(K[Y-1],K[Y]);break;case 92:case 98:this.$=K[Y-3],Z.setClickEvent(K[Y-2],K[Y-1]),Z.setTooltip(K[Y-2],K[Y]);break;case 93:this.$=K[Y-2],Z.setLink(K[Y-1],K[Y]);break;case 94:this.$=K[Y-3],Z.setLink(K[Y-2],K[Y-1],K[Y]);break;case 95:this.$=K[Y-3],Z.setLink(K[Y-2],K[Y-1]),Z.setTooltip(K[Y-2],K[Y]);break;case 96:this.$=K[Y-4],Z.setLink(K[Y-3],K[Y-2],K[Y]),Z.setTooltip(K[Y-3],K[Y-1]);break;case 99:this.$=K[Y-3],Z.setClickEvent(K[Y-2],K[Y-1],K[Y]);break;case 100:this.$=K[Y-4],Z.setClickEvent(K[Y-3],K[Y-2],K[Y-1]),Z.setTooltip(K[Y-3],K[Y]);break;case 101:this.$=K[Y-3],Z.setLink(K[Y-2],K[Y]);break;case 102:this.$=K[Y-4],Z.setLink(K[Y-3],K[Y-1],K[Y]);break;case 103:this.$=K[Y-4],Z.setLink(K[Y-3],K[Y-1]),Z.setTooltip(K[Y-3],K[Y]);break;case 104:this.$=K[Y-5],Z.setLink(K[Y-4],K[Y-2],K[Y]),Z.setTooltip(K[Y-4],K[Y-1]);break;case 105:this.$=K[Y-2],Z.setCssStyle(K[Y-1],K[Y]);break;case 106:Z.setCssClass(K[Y-1],K[Y]);break;case 107:this.$=[K[Y]];break;case 108:K[Y-2].push(K[Y]),this.$=K[Y-2];break;case 110:this.$=K[Y-1]+K[Y];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:C,83:w,86:S,100:E,102:_,103:R},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(D,[2,5],{8:[1,48]}),{8:[1,49]},t(L,[2,19],{22:[1,50]}),t(L,[2,21]),t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),t(L,[2,26]),t(L,[2,27]),t(L,[2,28]),t(L,[2,29]),t(L,[2,30]),{34:[1,51]},{36:[1,52]},t(L,[2,33]),t(L,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:B,69:$,70:A,71:I,72:O,73:N,74:M}),{39:[1,65]},t(P,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(L,[2,65]),t(L,[2,66]),{16:69,60:f,86:S,100:E,102:_},{16:39,17:40,19:70,60:f,86:S,100:E,102:_,103:R},{16:39,17:40,19:71,60:f,86:S,100:E,102:_,103:R},{16:39,17:40,19:72,60:f,86:S,100:E,102:_,103:R},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:E,102:_,103:R},{13:F,55:76},{58:78,60:[1,79]},t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:E,102:_,103:R}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:E,102:_,103:R},{16:39,17:40,19:87,60:f,86:S,100:E,102:_,103:R},t(z,[2,133]),t(z,[2,134]),t(z,[2,135]),t(z,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(D,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:C,83:w,86:S,100:E,102:_,103:R}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:C,83:w,86:S,100:E,102:_,103:R},t(L,[2,20]),t(L,[2,31]),t(L,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:E,102:_,103:R},{53:92,66:56,67:57,68:B,69:$,70:A,71:I,72:O,73:N,74:M},t(L,[2,64]),{67:93,73:N,74:M},t(W,[2,83],{66:94,68:B,69:$,70:A,71:I,72:O}),t(X,[2,84]),t(X,[2,85]),t(X,[2,86]),t(X,[2,87]),t(X,[2,88]),t(j,[2,89]),t(j,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:S,100:E,102:_},{41:[1,102],45:101,51:re},{16:104,60:f,86:S,100:E,102:_},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Q,50:oe,59:110,60:ee,82:ne,84:111,85:112,86:ie,87:ae,88:de,89:le,90:ye},{60:[1,122]},{13:F,55:123},t(P,[2,72]),t(P,[2,138]),{22:Q,50:oe,59:124,60:ee,61:[1,125],82:ne,84:111,85:112,86:ie,87:ae,88:de,89:le,90:ye},t($e,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:E,102:_,103:R},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Fe,39:[2,36]},t(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:E,102:_,103:R}),t(ce,[2,10]),t(ve,[2,55],{11:131,12:Fe}),t(D,[2,7]),{9:[1,132]},t(Ce,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:E,102:_,103:R},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:E,102:_,103:R},t(W,[2,82],{66:136,68:B,69:$,70:A,71:I,72:O}),t(W,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(P,[2,48],{39:[1,142]}),{41:[1,143]},t(P,[2,50]),{41:[2,61],45:144,51:re},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:E,102:_,103:R},t(L,[2,91],{13:[1,147]}),t(L,[2,93],{13:[1,149],77:[1,148]}),t(L,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(L,[2,105],{61:Ne}),t(Ie,[2,107],{85:154,22:Q,50:oe,60:ee,82:ne,86:ie,87:ae,88:de,89:le,90:ye}),t(Ae,[2,109]),t(Ae,[2,111]),t(Ae,[2,112]),t(Ae,[2,113]),t(Ae,[2,114]),t(Ae,[2,115]),t(Ae,[2,116]),t(Ae,[2,117]),t(Ae,[2,118]),t(Ae,[2,119]),t(L,[2,106]),t(P,[2,71]),t(L,[2,73],{61:Ne}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:E,102:_,103:R},t(ce,[2,12]),t(ve,[2,56]),{1:[2,4]},t(Ce,[2,69]),t(Ce,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:E,102:_,103:R},t(W,[2,80]),t(P,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:re},t(P,[2,49]),{41:[2,62]},t(P,[2,52],{39:[1,164]}),t(L,[2,60]),t(L,[2,92]),t(L,[2,94]),t(L,[2,95],{77:[1,165]}),t(L,[2,98]),t(L,[2,99],{13:[1,166]}),t(L,[2,101],{13:[1,168],77:[1,167]}),{22:Q,50:oe,60:ee,82:ne,84:169,85:112,86:ie,87:ae,88:de,89:le,90:ye},t(Ae,[2,110]),t($e,[2,75]),{14:[1,170]},t(ce,[2,11]),t(Ce,[2,70]),t(P,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:re},t(L,[2,96]),t(L,[2,100]),t(L,[2,102]),t(L,[2,103],{77:[1,174]}),t(Ie,[2,108],{85:154,22:Q,50:oe,60:ee,82:ne,86:ie,87:ae,88:de,89:le,90:ye}),t(ve,[2,8]),t(P,[2,51]),{41:[1,175]},t(P,[2,54]),t(L,[2,104]),t(P,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:x(function(G,q){if(q.recoverable)this.trace(G);else{var H=new Error(G);throw H.hash=q,H}},"parseError"),parse:x(function(G){var q=this,H=[0],Z=[],te=[null],K=[],U=this.table,Y="",fe=0,ue=0,Te=2,ge=1,we=K.slice.call(arguments,1),xe=Object.create(this.lexer),Le={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(Le.yy[_e]=this.yy[_e]);xe.setInput(G,Le.yy),Le.yy.lexer=xe,Le.yy.parser=this,typeof xe.yylloc>"u"&&(xe.yylloc={});var Be=xe.yylloc;K.push(Be);var Ee=xe.options&&xe.options.ranges;typeof Le.yy.parseError=="function"?this.parseError=Le.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Xe(ct){H.length=H.length-2*ct,te.length=te.length-ct,K.length=K.length-ct}x(Xe,"popStack");function Re(){var ct;return ct=Z.pop()||xe.lex()||ge,typeof ct!="number"&&(ct instanceof Array&&(Z=ct,ct=Z.pop()),ct=q.symbols_[ct]||ct),ct}x(Re,"lex");for(var Qe,it,Ue,mt,ot={},Ke,me,dt,at;;){if(it=H[H.length-1],this.defaultActions[it]?Ue=this.defaultActions[it]:((Qe===null||typeof Qe>"u")&&(Qe=Re()),Ue=U[it]&&U[it][Qe]),typeof Ue>"u"||!Ue.length||!Ue[0]){var et="";at=[];for(Ke in U[it])this.terminals_[Ke]&&Ke>Te&&at.push("'"+this.terminals_[Ke]+"'");xe.showPosition?et="Parse error on line "+(fe+1)+`: `+xe.showPosition()+` Expecting `+at.join(", ")+", got '"+(this.terminals_[Qe]||Qe)+"'":et="Parse error on line "+(fe+1)+": Unexpected "+(Qe==ge?"end of input":"'"+(this.terminals_[Qe]||Qe)+"'"),this.parseError(et,{text:xe.match,token:this.terminals_[Qe]||Qe,line:xe.yylineno,loc:Be,expected:at})}if(Ue[0]instanceof Array&&Ue.length>1)throw new Error("Parse Error: multiple actions possible at state: "+it+", token: "+Qe);switch(Ue[0]){case 1:H.push(Qe),te.push(xe.yytext),K.push(xe.yylloc),H.push(Ue[1]),Qe=null,ue=xe.yyleng,Y=xe.yytext,fe=xe.yylineno,Be=xe.yylloc;break;case 2:if(me=this.productions_[Ue[1]][1],ot.$=te[te.length-me],ot._$={first_line:K[K.length-(me||1)].first_line,last_line:K[K.length-1].last_line,first_column:K[K.length-(me||1)].first_column,last_column:K[K.length-1].last_column},Ee&&(ot._$.range=[K[K.length-(me||1)].range[0],K[K.length-1].range[1]]),mt=this.performAction.apply(ot,[Y,ue,fe,Le.yy,Ue[1],te,K].concat(we)),typeof mt<"u")return mt;me&&(H=H.slice(0,-1*me*2),te=te.slice(0,-1*me),K=K.slice(0,-1*me)),H.push(this.productions_[Ue[1]][0]),te.push(ot.$),K.push(ot._$),dt=U[H[H.length-2]][H[H.length-1]],H.push(dt);break;case 3:return!0}}return!0},"parse")},ke=(function(){var J={EOF:1,parseError:x(function(q,H){if(this.yy.parser)this.yy.parser.parseError(q,H);else throw new Error(q)},"parseError"),setInput:x(function(G,q){return this.yy=q||this.yy||{},this._input=G,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var G=this._input[0];this.yytext+=G,this.yyleng++,this.offset++,this.match+=G,this.matched+=G;var q=G.match(/(?:\r\n?|\n).*/g);return q?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),G},"input"),unput:x(function(G){var q=G.length,H=G.split(/(?:\r\n?|\n)/g);this._input=G+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-q),this.offset-=q;var Z=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),H.length-1&&(this.yylineno-=H.length-1);var te=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:H?(H.length===Z.length?this.yylloc.first_column:0)+Z[Z.length-H.length].length-H[0].length:this.yylloc.first_column-q},this.options.ranges&&(this.yylloc.range=[te[0],te[0]+this.yyleng-q]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(G){this.unput(this.match.slice(G))},"less"),pastInput:x(function(){var G=this.matched.substr(0,this.matched.length-this.match.length);return(G.length>20?"...":"")+G.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var G=this.match;return G.length<20&&(G+=this._input.substr(0,20-G.length)),(G.substr(0,20)+(G.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var G=this.pastInput(),q=new Array(G.length+1).join("-");return G+this.upcomingInput()+` `+q+"^"},"showPosition"),test_match:x(function(G,q){var H,Z,te;if(this.options.backtrack_lexer&&(te={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(te.yylloc.range=this.yylloc.range.slice(0))),Z=G[0].match(/(?:\r\n?|\n).*/g),Z&&(this.yylineno+=Z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Z?Z[Z.length-1].length-Z[Z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+G[0].length},this.yytext+=G[0],this.match+=G[0],this.matches=G,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(G[0].length),this.matched+=G[0],H=this.performAction.call(this,this.yy,this,q,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),H)return H;if(this._backtrack){for(var K in te)this[K]=te[K];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var G,q,H,Z;this._more||(this.yytext="",this.match="");for(var te=this._currentRules(),K=0;Kq[0].length)){if(q=H,Z=K,this.options.backtrack_lexer){if(G=this.test_match(H,te[K]),G!==!1)return G;if(this._backtrack){q=!1;continue}else return!1}else if(!this.options.flex)break}return q?(G=this.test_match(q,te[Z]),G!==!1?G:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var q=this.next();return q||this.lex()},"lex"),begin:x(function(q){this.conditionStack.push(q)},"begin"),popState:x(function(){var q=this.conditionStack.length-1;return q>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(q){return q=this.conditionStack.length-1-Math.abs(q||0),q>=0?this.conditionStack[q]:"INITIAL"},"topState"),pushState:x(function(q){this.begin(q)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(q,H,Z,te){switch(Z){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return J})();be.lexer=ke;function se(){this.yy={}}return x(se,"Parser"),se.prototype=be,be.Parser=se,new se})();oM.parser=oM;var bme=oM,BU=["#","+","~","-",""],Jy,FU=(Jy=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=xr(e,Pe());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+vc(this.id);this.memberType==="method"&&(e+=`(${vc(this.parameters.trim())})`,this.returnType&&(e+=" : "+vc(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(BU.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);BU.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${vc(this.id)}${this.memberType==="method"?`(${vc(this.parameters)})${this.returnType?" : "+vc(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},x(Jy,"ClassMember"),Jy),A2="classId-",zU=0,Pu=x(t=>yt.sanitizeText(t,Pe()),"sanitizeText"),Vc,Tme=(Vc=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=x(e=>{const r=N$();ft(e).select("svg").selectAll("g").filter(function(){return ft(this).attr("title")!==null}).on("mouseover",a=>{const s=ft(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(Dl.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ft(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=rn,this.getAccTitle=pn,this.setAccDescription=gn,this.getAccDescription=mn,this.setDiagramTitle=dn,this.getDiagramTitle=an,this.getConfig=x(()=>Pe().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=yt.sanitizeText(e,Pe());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=Pu(a[0]),n=Pu(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=yt.sanitizeText(e,Pe());r&&(r=Pu(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=yt.sanitizeText(e,Pe()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=yt.sanitizeText(n,Pe());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:A2+a+"-"+zU}),zU++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=yt.sanitizeText(e,Pe());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",Xr()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){he.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=yt.sanitizeText(e.relationTitle1.trim(),Pe()),e.relationTitle2=yt.sanitizeText(e.relationTitle2.trim(),Pe()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(Pu(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new FU(a,"method")):a&&i.members.push(new FU(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),Pu(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=A2+i),i=this.splitClassNameAndType(i).className;const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,a=this.classes.get(i);a&&(a.tooltip=Pu(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Pe();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=A2+s),s=this.splitClassNameAndType(s).className;const o=this.classes.get(s);o&&(o.link=sr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=Pu(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const a=this.splitClassNameAndType(i).className,s=this.classes.get(a);s&&(s.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=yt.sanitizeText(e,Pe());if(Pe().securityLevel!=="loose"||r===void 0)return;const s=this.splitClassNameAndType(i).className;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{sr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Pe(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:op(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},x(Vc,"ClassDB"),Vc),Yat=x(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; font-size: 10px; .title { font-weight: bolder; } } .cluster-label text { fill: ${t.titleColor}; } .cluster-label span { color: ${t.titleColor}; } .cluster-label span p { background-color: transparent; } .cluster rect { fill: ${t.clusterBkg}; stroke: ${t.clusterBorder}; stroke-width: 1px; } .cluster text { fill: ${t.titleColor}; } .cluster span { color: ${t.titleColor}; } .nodeLabel, .edgeLabel { color: ${t.classText}; } .noteLabel .nodeLabel, .noteLabel .edgeLabel { color: ${t.noteTextColor}; } .edgeLabel .label rect { fill: ${t.mainBkg}; } .label text { fill: ${t.classText}; } .labelBkg { background: ${t.mainBkg}; } .edgeLabel .label span { background: ${t.mainBkg}; } .classTitle { font-weight: bolder; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; } .divider { stroke: ${t.nodeBorder}; stroke-width: 1; } g.clickable { cursor: pointer; } g.classGroup rect { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; } g.classGroup line { stroke: ${t.nodeBorder}; stroke-width: 1; } .classLabel .box { stroke: none; stroke-width: 0; fill: ${t.mainBkg}; opacity: 0.5; } .classLabel .label { fill: ${t.nodeBorder}; font-size: 10px; } .relation { stroke: ${t.lineColor}; stroke-width: ${t.strokeWidth}; fill: none; } .dashed-line{ stroke-dasharray: 3; } .dotted-line{ stroke-dasharray: 1 2; } [id$="-compositionStart"], .composition { fill: ${t.lineColor} !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-compositionEnd"], .composition { fill: ${t.lineColor} !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-dependencyStart"], .dependency { fill: ${t.lineColor} !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-dependencyEnd"], .dependency { fill: ${t.lineColor} !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-extensionStart"], .extension { fill: transparent !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-extensionEnd"], .extension { fill: transparent !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-aggregationStart"], .aggregation { fill: transparent !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-aggregationEnd"], .aggregation { fill: transparent !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-lollipopStart"], .lollipop { fill: ${t.mainBkg} !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [id$="-lollipopEnd"], .lollipop { fill: ${t.mainBkg} !important; stroke: ${t.lineColor} !important; stroke-width: 1; } .edgeTerminals { font-size: 11px; line-height: initial; } .classTitleText { text-anchor: middle; font-size: 18px; fill: ${t.textColor}; } .edgeLabel[data-look="neo"] { background-color: ${t.edgeLabelBackground}; p { background-color: ${t.edgeLabelBackground}; } rect { opacity: 0.5; background-color: ${t.edgeLabelBackground}; fill: ${t.edgeLabelBackground}; } text-align: center; } ${eT()} `,"getStyles"),Cme=Yat,Xat=x((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),jat=x(function(t,e){return e.db.getClasses()},"getClasses"),Kat=x(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.setDiagramId(e);const o=n.db.getData(),l=xv(e,i);o.type=n.type,o.layoutAlgorithm=zb(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await uv(o,l);const u=8;sr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Cd(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),wme={getClasses:jat,draw:Kat,getDir:Xat},Zat={parser:bme,get db(){return new Tme},renderer:wme,styles:Cme,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Qat=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zat},Symbol.toStringTag,{value:"Module"}));var Jat={parser:bme,get db(){return new Tme},renderer:wme,styles:Cme,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const est=Object.freeze(Object.defineProperty({__proto__:null,diagram:Jat},Symbol.toStringTag,{value:"Module"}));var lM=(function(){var t=x(function(P,F,V,z){for(V=V||{},z=P.length;z--;V[P[z]]=F);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],T=[1,27],b=[1,28],C=[1,29],w=[1,30],S=[1,31],E=[1,32],_=[1,35],R=[1,36],D=[1,37],L=[1,38],B=[1,34],$=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],O={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:x(function(F,V,z,W,X,j,re){var Q=j.length-1;switch(X){case 3:return W.setRootDoc(j[Q]),j[Q];case 4:this.$=[];break;case 5:j[Q]!="nl"&&(j[Q-1].push(j[Q]),this.$=j[Q-1]);break;case 6:case 7:this.$=j[Q];break;case 8:this.$="nl";break;case 12:this.$=j[Q];break;case 13:const ie=j[Q-1];ie.description=W.trimColon(j[Q]),this.$=ie;break;case 14:this.$={stmt:"relation",state1:j[Q-2],state2:j[Q]};break;case 15:const ae=W.trimColon(j[Q]);this.$={stmt:"relation",state1:j[Q-3],state2:j[Q-1],description:ae};break;case 19:this.$={stmt:"state",id:j[Q-3],type:"default",description:"",doc:j[Q-1]};break;case 20:var oe=j[Q],ee=j[Q-2].trim();if(j[Q].match(":")){var ne=j[Q].split(":");oe=ne[0],ee=[ee,ne[1]]}this.$={stmt:"state",id:oe,type:"default",description:ee};break;case 21:this.$={stmt:"state",id:j[Q-3],type:"default",description:j[Q-5],doc:j[Q-1]};break;case 22:this.$={stmt:"state",id:j[Q],type:"fork"};break;case 23:this.$={stmt:"state",id:j[Q],type:"join"};break;case 24:this.$={stmt:"state",id:j[Q],type:"choice"};break;case 25:this.$={stmt:"state",id:W.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:j[Q-1].trim(),note:{position:j[Q-2].trim(),text:j[Q].trim()}};break;case 29:this.$=j[Q].trim(),W.setAccTitle(this.$);break;case 30:case 31:this.$=j[Q].trim(),W.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:j[Q-3],url:j[Q-2],tooltip:j[Q-1]};break;case 33:this.$={stmt:"click",id:j[Q-3],url:j[Q-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:j[Q-1].trim(),classes:j[Q].trim()};break;case 36:this.$={stmt:"style",id:j[Q-1].trim(),styleClass:j[Q].trim()};break;case 37:this.$={stmt:"applyClass",id:j[Q-1].trim(),styleClass:j[Q].trim()};break;case 38:W.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:W.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:W.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:W.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:j[Q].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:j[Q-2].trim(),classes:[j[Q].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:j[Q-2].trim(),classes:[j[Q].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:C,41:w,45:S,48:E,51:_,52:R,53:D,54:L,57:B},t($,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:C,41:w,45:S,48:E,51:_,52:R,53:D,54:L,57:B},t($,[2,7]),t($,[2,8]),t($,[2,9]),t($,[2,10]),t($,[2,11]),t($,[2,12],{14:[1,40],15:[1,41]}),t($,[2,16]),{18:[1,42]},t($,[2,18],{20:[1,43]}),{23:[1,44]},t($,[2,22]),t($,[2,23]),t($,[2,24]),t($,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t($,[2,28]),{34:[1,49]},{36:[1,50]},t($,[2,31]),{13:51,24:d,57:B},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t($,[2,38]),t($,[2,39]),t($,[2,40]),t($,[2,41]),t($,[2,6]),t($,[2,13]),{13:58,24:d,57:B},t($,[2,17]),t(I,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t($,[2,29]),t($,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t($,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:C,41:w,45:S,48:E,51:_,52:R,53:D,54:L,57:B},t($,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t($,[2,34]),t($,[2,35]),t($,[2,36]),t($,[2,37]),t(A,[2,46]),t(A,[2,47]),t($,[2,15]),t($,[2,19]),t(I,i,{7:78}),t($,[2,26]),t($,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:C,41:w,45:S,48:E,51:_,52:R,53:D,54:L,57:B},t($,[2,32]),t($,[2,33]),t($,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:x(function(F,V){if(V.recoverable)this.trace(F);else{var z=new Error(F);throw z.hash=V,z}},"parseError"),parse:x(function(F){var V=this,z=[0],W=[],X=[null],j=[],re=this.table,Q="",oe=0,ee=0,ne=2,ie=1,ae=j.slice.call(arguments,1),de=Object.create(this.lexer),le={yy:{}};for(var ye in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ye)&&(le.yy[ye]=this.yy[ye]);de.setInput(F,le.yy),le.yy.lexer=de,le.yy.parser=this,typeof de.yylloc>"u"&&(de.yylloc={});var $e=de.yylloc;j.push($e);var Fe=de.options&&de.options.ranges;typeof le.yy.parseError=="function"?this.parseError=le.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(H){z.length=z.length-2*H,X.length=X.length-H,j.length=j.length-H}x(ce,"popStack");function ve(){var H;return H=W.pop()||de.lex()||ie,typeof H!="number"&&(H instanceof Array&&(W=H,H=W.pop()),H=V.symbols_[H]||H),H}x(ve,"lex");for(var Ce,Ne,Ie,Ae,be={},ke,se,J,G;;){if(Ne=z[z.length-1],this.defaultActions[Ne]?Ie=this.defaultActions[Ne]:((Ce===null||typeof Ce>"u")&&(Ce=ve()),Ie=re[Ne]&&re[Ne][Ce]),typeof Ie>"u"||!Ie.length||!Ie[0]){var q="";G=[];for(ke in re[Ne])this.terminals_[ke]&&ke>ne&&G.push("'"+this.terminals_[ke]+"'");de.showPosition?q="Parse error on line "+(oe+1)+`: `+de.showPosition()+` Expecting `+G.join(", ")+", got '"+(this.terminals_[Ce]||Ce)+"'":q="Parse error on line "+(oe+1)+": Unexpected "+(Ce==ie?"end of input":"'"+(this.terminals_[Ce]||Ce)+"'"),this.parseError(q,{text:de.match,token:this.terminals_[Ce]||Ce,line:de.yylineno,loc:$e,expected:G})}if(Ie[0]instanceof Array&&Ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ne+", token: "+Ce);switch(Ie[0]){case 1:z.push(Ce),X.push(de.yytext),j.push(de.yylloc),z.push(Ie[1]),Ce=null,ee=de.yyleng,Q=de.yytext,oe=de.yylineno,$e=de.yylloc;break;case 2:if(se=this.productions_[Ie[1]][1],be.$=X[X.length-se],be._$={first_line:j[j.length-(se||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(se||1)].first_column,last_column:j[j.length-1].last_column},Fe&&(be._$.range=[j[j.length-(se||1)].range[0],j[j.length-1].range[1]]),Ae=this.performAction.apply(be,[Q,ee,oe,le.yy,Ie[1],X,j].concat(ae)),typeof Ae<"u")return Ae;se&&(z=z.slice(0,-1*se*2),X=X.slice(0,-1*se),j=j.slice(0,-1*se)),z.push(this.productions_[Ie[1]][0]),X.push(be.$),j.push(be._$),J=re[z[z.length-2]][z[z.length-1]],z.push(J);break;case 3:return!0}}return!0},"parse")},N=(function(){var P={EOF:1,parseError:x(function(V,z){if(this.yy.parser)this.yy.parser.parseError(V,z);else throw new Error(V)},"parseError"),setInput:x(function(F,V){return this.yy=V||this.yy||{},this._input=F,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var F=this._input[0];this.yytext+=F,this.yyleng++,this.offset++,this.match+=F,this.matched+=F;var V=F.match(/(?:\r\n?|\n).*/g);return V?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),F},"input"),unput:x(function(F){var V=F.length,z=F.split(/(?:\r\n?|\n)/g);this._input=F+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-V),this.offset-=V;var W=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),z.length-1&&(this.yylineno-=z.length-1);var X=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z?(z.length===W.length?this.yylloc.first_column:0)+W[W.length-z.length].length-z[0].length:this.yylloc.first_column-V},this.options.ranges&&(this.yylloc.range=[X[0],X[0]+this.yyleng-V]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(F){this.unput(this.match.slice(F))},"less"),pastInput:x(function(){var F=this.matched.substr(0,this.matched.length-this.match.length);return(F.length>20?"...":"")+F.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var F=this.match;return F.length<20&&(F+=this._input.substr(0,20-F.length)),(F.substr(0,20)+(F.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var F=this.pastInput(),V=new Array(F.length+1).join("-");return F+this.upcomingInput()+` `+V+"^"},"showPosition"),test_match:x(function(F,V){var z,W,X;if(this.options.backtrack_lexer&&(X={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(X.yylloc.range=this.yylloc.range.slice(0))),W=F[0].match(/(?:\r\n?|\n).*/g),W&&(this.yylineno+=W.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+F[0].length},this.yytext+=F[0],this.match+=F[0],this.matches=F,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(F[0].length),this.matched+=F[0],z=this.performAction.call(this,this.yy,this,V,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),z)return z;if(this._backtrack){for(var j in X)this[j]=X[j];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var F,V,z,W;this._more||(this.yytext="",this.match="");for(var X=this._currentRules(),j=0;jV[0].length)){if(V=z,W=j,this.options.backtrack_lexer){if(F=this.test_match(z,X[j]),F!==!1)return F;if(this._backtrack){V=!1;continue}else return!1}else if(!this.options.flex)break}return V?(F=this.test_match(V,X[W]),F!==!1?F:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var V=this.next();return V||this.lex()},"lex"),begin:x(function(V){this.conditionStack.push(V)},"begin"),popState:x(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:x(function(V){this.begin(V)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(V,z,W,X){function j(){const re=z.yytext.indexOf("%%");if(re===0)return!1;if(re>0){const Q=z.yytext.slice(0,re),oe=z.yytext.slice(re);oe&&V.lexer.unput(oe),z.yytext=Q}return!0}switch(x(j,"processId"),W){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return j()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+z.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return j()?(this.popState(),"ID"):void 0;case 66:return j()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),z.yytext=z.yytext.substr(2).trim(),31;case 68:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return j()?24:void 0;case 74:return z.yytext=z.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return P})();O.lexer=N;function M(){this.yy={}}return x(M,"Parser"),M.prototype=O,O.Parser=M,new M})();lM.parser=lM;var Eme=lM,tst="TB",Sme="TB",GU="dir",$f="state",df="root",cM="relation",rst="classDef",nst="style",ist="applyClass",Tx="default",kme="divider",_me="fill:none",Ame="fill: #333",Rme="c",Lme="markdown",Ime="normal",RI="rect",LI="rectWithTitle",ast="stateStart",sst="stateEnd",VU="divider",WU="roundedWithTitle",ost="note",lst="noteGroup",ST="statediagram",cst="state",ust=`${ST}-${cst}`,Dme="transition",hst="note",dst="note-edge",fst=`${Dme} ${dst}`,pst=`${ST}-${hst}`,gst="cluster",mst=`${ST}-${gst}`,yst="cluster-alt",vst=`${ST}-${yst}`,Mme="parent",Nme="note",xst="state",JB="----",bst=`${JB}${Nme}`,qU=`${JB}${Mme}`,Ome=x((t,e=Sme)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Tst=x(function(t,e){return e.db.getClasses()},"getClasses"),Cst=x(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=xv(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Pe().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await uv(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var w;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(S=>S.id===g);if(!g){he.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(w=l.node())==null?void 0:w.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var _;const E=(_=S.textContent)==null?void 0:_.trim();(S.id===(m==null?void 0:m.domId)||E===g)&&(v=S)}),!v){he.warn("⚠️ Could not find node matching text:",g);return}const T=v.parentNode;if(!T){he.warn("⚠️ Node has no parent, cannot wrap:",g);return}const b=document.createElementNS("http://www.w3.org/2000/svg","a"),C=f.url.replace(/^"+|"+$/g,"");if(b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",C),b.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");b.setAttribute("title",S),v.setAttribute("title",S)}T.replaceChild(b,v),b.appendChild(v),he.info("🔗 Wrapped node in
    tag for:",g,f.url)})}catch(d){he.error("❌ Error injecting clickable links:",d)}sr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Cd(l,h,ST,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),wst={getClasses:Tst,draw:Cst,getDir:Ome},qC=new Map,_c=0;function UC(t="",e=0,r="",n=JB){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${xst}-${t}${i}-${e}`}x(UC,"stateDomId");var Est=x((t,e,r,n,i,a,s,o)=>{he.trace("items",e),e.forEach(l=>{switch(l.stmt){case $f:V1(t,l,r,n,i,a,s,o);break;case Tx:V1(t,l,r,n,i,a,s,o);break;case cM:{V1(t,l.state1,r,n,i,a,s,o),V1(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+_c,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:_me,labelStyle:"",label:yt.sanitizeText(l.description??"",Pe()),arrowheadStyle:Ame,labelpos:Rme,labelType:Lme,thickness:Ime,classes:Dme,look:s};i.push(h),_c++}break}})},"setupDoc"),UU=x((t,e=Sme)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function G1(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(G1,"insertOrUpdateNode");function $me(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x($me,"getClassesFromDbInfo");function Pme(t){return(t==null?void 0:t.styles)??[]}x(Pme,"getStylesFromDbInfo");var V1=x((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=$me(u),d=Pme(u),f=Pe();if(he.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=RI;e.start===!0?y=ast:e.start===!1&&(y=sst),e.type!==Tx&&(y=e.type),qC.get(l)||qC.set(l,{id:l,shape:y,description:yt.sanitizeText(l,f),cssClasses:`${h} ${ust}`,cssStyles:d});const v=qC.get(l);e.description&&(Array.isArray(v.description)?(v.shape=LI,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=LI,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=RI,v.description=e.description),v.description=yt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===LI&&(v.type==="group"?v.shape=WU:v.shape=RI),!v.type&&e.doc&&(he.info("Setting cluster for XCX",l,UU(e)),v.type="group",v.isGroup=!0,v.dir=UU(e),v.shape=e.type===kme?VU:WU,v.cssClasses=`${v.cssClasses} ${mst} ${a?vst:""}`);const T={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:UC(l,_c),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(T.shape===VU&&(T.label=""),t&&t.id!=="root"&&(he.trace("Setting node ",l," to be child of its parent ",t.id),T.parentId=t.id),T.centerLabel=!0,e.note){const b={labelStyle:"",shape:ost,label:e.note.text,labelType:"markdown",cssClasses:pst,cssStyles:[],cssCompiledStyles:[],id:l+bst+"-"+_c,domId:UC(l,_c,Nme),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},C=l+qU,w={labelStyle:"",shape:lst,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+qU,domId:UC(l,_c,Mme),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};_c++,w.id=C,b.parentId=C,G1(n,w,o),G1(n,b,o),G1(n,T,o);let S=l,E=b.id;e.note.position==="left of"&&(S=b.id,E=l),i.push({id:S+"-"+E,start:S,end:E,arrowhead:"none",arrowTypeEnd:"",style:_me,labelStyle:"",classes:fst,arrowheadStyle:Ame,labelpos:Rme,labelType:Lme,thickness:Ime,look:s})}else G1(n,T,o)}e.doc&&(he.trace("Adding nodes children "),Est(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),Sst=x(()=>{qC.clear(),_c=0},"reset"),Ji={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},HU=x(()=>new Map,"newClassesList"),YU=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),R2=x(t=>JSON.parse(JSON.stringify(t)),"clone"),Ph,xh=(Ph=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=HU(),this.documents={root:YU()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=pn,this.setAccTitle=rn,this.getAccDescription=mn,this.setAccDescription=gn,this.setDiagramTitle=dn,this.getDiagramTitle=an,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case $f:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case cM:this.addRelation(i.state1,i.state2,i.description);break;case rst:this.addStyleClass(i.id.trim(),i.classes);break;case nst:this.handleStyleDef(i);break;case ist:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Pe();Sst(),V1(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){he.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===cM){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===$f&&(r.id===Ji.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==df&&r.stmt!==$f||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===kme){const o=R2(s);o.doc=R2(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:$f,id:ZX(),type:"divider",doc:R2(a)};i.push(R2(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:df,stmt:df},{id:df,stmt:df,doc:this.rootDoc},!0),{id:df,doc:this.rootDoc}}addState(e,r=Tx,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))he.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:$f,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(he.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=yt.sanitizeText(h.note.text,Pe())}s&&(he.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(he.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(he.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:YU()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=HU(),e||(this.links=new Map,Xr())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){he.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),he.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===Ji.START_NODE?(this.startEndCount++,`${Ji.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=Tx){return e===Ji.START_NODE?Ji.START_TYPE:r}endIdIfNeeded(e=""){return e===Ji.END_NODE?(this.startEndCount++,`${Ji.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=Tx){return e===Ji.END_NODE?Ji.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:yt.sanitizeText(n,Pe())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?yt.sanitizeText(n,Pe()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(yt.sanitizeText(i,Pe()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(Ji.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Ji.COLOR_KEYWORD).exec(i)){const o=a.replace(Ji.FILL_KEYWORD,Ji.BG_FILL).replace(Ji.COLOR_KEYWORD,Ji.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=N$();ft(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=ft(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(Dl.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ft(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===GU)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??tst}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:GU,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Pe();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Ome(this.getRootDocV2())}}getConfig(){return Pe().state}},x(Ph,"StateDB"),Ph.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},Ph),kst=x(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; } g.stateGroup text { fill: ${t.nodeBorder}; stroke: none; font-size: 10px; } g.stateGroup text { fill: ${t.textColor}; stroke: none; font-size: 10px; } g.stateGroup .state-title { font-weight: bolder; fill: ${t.stateLabelColor}; } g.stateGroup rect { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; } g.stateGroup line { stroke: ${t.lineColor}; stroke-width: ${t.strokeWidth||1}; } .transition { stroke: ${t.transitionColor}; stroke-width: ${t.strokeWidth||1}; fill: none; } .stateGroup .composit { fill: ${t.background}; border-bottom: 1px } .stateGroup .alt-composit { fill: #e0e0e0; border-bottom: 1px } .state-note { stroke: ${t.noteBorderColor}; fill: ${t.noteBkgColor}; text { fill: ${t.noteTextColor}; stroke: none; font-size: 10px; } } .stateLabel .box { stroke: none; stroke-width: 0; fill: ${t.mainBkg}; opacity: 0.5; } .edgeLabel .label rect { fill: ${t.labelBackgroundColor}; opacity: 0.5; } .edgeLabel { background-color: ${t.edgeLabelBackground}; p { background-color: ${t.edgeLabelBackground}; } rect { opacity: 0.5; background-color: ${t.edgeLabelBackground}; fill: ${t.edgeLabelBackground}; } text-align: center; } .edgeLabel .label text { fill: ${t.transitionLabelColor||t.tertiaryTextColor}; } .label div .edgeLabel { color: ${t.transitionLabelColor||t.tertiaryTextColor}; } .stateLabel text { fill: ${t.stateLabelColor}; font-size: 10px; font-weight: bold; } .node circle.state-start { fill: ${t.specialStateColor}; stroke: ${t.specialStateColor}; } .node .fork-join { fill: ${t.specialStateColor}; stroke: ${t.specialStateColor}; } .node circle.state-end { fill: ${t.innerEndBackground}; stroke: ${t.background}; stroke-width: 1.5 } .end-state-inner { fill: ${t.compositeBackground||t.background}; // stroke: ${t.background}; stroke-width: 1.5 } .node rect { fill: ${t.stateBkg||t.mainBkg}; stroke: ${t.stateBorder||t.nodeBorder}; stroke-width: ${t.strokeWidth||1}px; } .node polygon { fill: ${t.mainBkg}; stroke: ${t.stateBorder||t.nodeBorder};; stroke-width: ${t.strokeWidth||1}px; } [id$="-barbEnd"] { fill: ${t.lineColor}; } .statediagram-cluster rect { fill: ${t.compositeTitleBackground}; stroke: ${t.stateBorder||t.nodeBorder}; stroke-width: ${t.strokeWidth||1}px; } .cluster-label, .nodeLabel { color: ${t.stateLabelColor}; // line-height: 1; } .statediagram-cluster rect.outer { rx: 5px; ry: 5px; } .statediagram-state .divider { stroke: ${t.stateBorder||t.nodeBorder}; } .statediagram-state .title-state { rx: 5px; ry: 5px; } .statediagram-cluster.statediagram-cluster .inner { fill: ${t.compositeBackground||t.background}; } .statediagram-cluster.statediagram-cluster-alt .inner { fill: ${t.altBackground?t.altBackground:"#efefef"}; } .statediagram-cluster .inner { rx:0; ry:0; } .statediagram-state rect.basic { rx: 5px; ry: 5px; } .statediagram-state rect.divider { stroke-dasharray: 10,10; fill: ${t.altBackground?t.altBackground:"#efefef"}; } .note-edge { stroke-dasharray: 5; } .statediagram-note rect { fill: ${t.noteBkgColor}; stroke: ${t.noteBorderColor}; stroke-width: 1px; rx: 0; ry: 0; } .statediagram-note rect { fill: ${t.noteBkgColor}; stroke: ${t.noteBorderColor}; stroke-width: 1px; rx: 0; ry: 0; } .statediagram-note text { fill: ${t.noteTextColor}; } .statediagram-note .nodeLabel { color: ${t.noteTextColor}; } .statediagram .edgeLabel { color: red; // ${t.noteTextColor}; } [id$="-dependencyStart"], [id$="-dependencyEnd"] { fill: ${t.lineColor}; stroke: ${t.lineColor}; stroke-width: ${t.strokeWidth||1}; } .statediagramTitleText { text-anchor: middle; font-size: 18px; fill: ${t.textColor}; } [data-look="neo"].statediagram-cluster rect { fill: ${t.mainBkg}; stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; stroke-width: ${t.strokeWidth??1}; } [data-look="neo"].statediagram-cluster rect.outer { rx: ${t.radius}px; ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } `,"getStyles"),Bme=kst,_st=x(t=>t.append("circle").attr("class","start-state").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit).attr("cy",Pe().state.padding+Pe().state.sizeUnit),"drawStartState"),Ast=x(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Pe().state.textHeight).attr("class","divider").attr("x2",Pe().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Rst=x((t,e)=>{const r=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+2*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",n.width+2*Pe().state.padding).attr("height",n.height+2*Pe().state.padding).attr("rx",Pe().state.radius),r},"drawSimpleState"),Lst=x((t,e)=>{const r=x(function(f,p,g){const m=f.append("tspan").attr("x",2*Pe().state.padding).text(p);g||m.attr("dy",Pe().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+1.3*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Pe().state.padding).attr("y",a+Pe().state.padding*.4+Pe().state.dividerMargin+Pe().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Pe().state.padding).attr("y1",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("y2",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Pe().state.padding),t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",d+2*Pe().state.padding).attr("height",h.height+a+2*Pe().state.padding).attr("rx",Pe().state.radius),t},"drawDescrState"),Ist=x((t,e,r)=>{const n=Pe().state.padding,i=2*Pe().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Pe().state.titleShift).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-Pe().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Pe().state.textHeight+Pe().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",Pe().state.textHeight*3).attr("rx",Pe().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",p.height+3+2*Pe().state.textHeight).attr("rx",Pe().state.radius),t},"addTitleAndBox"),Dst=x(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Pe().state.sizeUnit+Pe().state.miniPadding).attr("cx",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding).attr("cy",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit+2).attr("cy",Pe().state.padding+Pe().state.sizeUnit+2)),"drawEndState"),Mst=x((t,e)=>{let r=Pe().state.forkWidth,n=Pe().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Pe().state.padding).attr("y",Pe().state.padding)},"drawForkJoinState"),Nst=x((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
    ");s=s.replace(/\n/g,"
    ");const o=s.split(yt.lineBreakRegex);let l=1.25*Pe().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Pe().state.noteMargin),d.attr("y",r+i+1.25*Pe().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),Ost=x((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Pe().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=Nst(t,0,0,n);return r.attr("height",a+2*Pe().state.noteMargin),r.attr("width",i+Pe().state.noteMargin*2),r},"drawNote"),XU=x(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&_st(i),e.type==="end"&&Dst(i),(e.type==="fork"||e.type==="join")&&Mst(i,e),e.type==="note"&&Ost(e.note.text,i),e.type==="divider"&&Ast(i),e.type==="default"&&e.descriptions.length===0&&Rst(i,e),e.type==="default"&&e.descriptions.length>0&&Lst(i,e);const a=i.node().getBBox();return n.width=a.width+2*Pe().state.padding,n.height=a.height+2*Pe().state.padding,n},"drawState"),jU=0,$st=x(function(t,e,r){const n=x(function(l){switch(l){case xh.relationType.AGGREGATION:return"aggregation";case xh.relationType.EXTENSION:return"extension";case xh.relationType.COMPOSITION:return"composition";case xh.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=Tw().x(function(l){return l.x}).y(function(l){return l.y}).curve(ww),s=t.append("path").attr("d",a(i)).attr("id","edge"+jU).attr("class","transition");let o="";if(Pe().state.arrowMarkerAbsolute&&(o=UM(!0)),s.attr("marker-end","url("+o+"#"+n(xh.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=sr.calcLabelPosition(e.points),d=yt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let T=0;T<=d.length;T++){const b=l.append("text").attr("text-anchor","middle").text(d[T]).attr("x",u).attr("y",h+f),C=b.node().getBBox();g=Math.max(g,C.width),m=Math.min(m,C.x),he.info(C.x,u,h+f),f===0&&(f=b.node().getBBox().height,he.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const T=(d.length-1)*f*.5;p.forEach((b,C)=>b.attr("y",h+C*f-T)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Pe().state.padding/2).attr("y",h-y/2-Pe().state.padding/2-3.5).attr("width",g+Pe().state.padding).attr("height",y+Pe().state.padding),he.info(v)}jU++},"drawEdge"),Ka,II={},Pst=x(function(){},"setConf"),Bst=x(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),Fst=x(function(t,e,r,n){Ka=Pe().state;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=ft("#i"+e));const s=ft(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;he.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);Bst(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Fme(u,h,void 0,!1,s,o,n);const d=Ka.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Rn(l,g,m,Ka.useMaxWidth),l.attr("viewBox",`${f.x-Ka.padding} ${f.y-Ka.padding} `+p+" "+g)},"draw"),zst=x(t=>t?t.length*Ka.fontSizeFactor:1,"getLabelWidth"),Fme=x((t,e,r,n,i,a,s)=>{const o=new ma({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const C=b.parentElement;let w=0,S=0;C&&(C.parentElement&&(w=C.parentElement.getBBox().width),S=parseInt(C.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",w-S-8)})):he.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(he.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),$st(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*Ka.padding,y.height=m.height+2*Ka.padding,he.debug("Doc rendered",y,o),y},"renderDoc"),Gst={setConf:Pst,draw:Fst},Vst={parser:Eme,get db(){return new xh(1)},renderer:Gst,styles:Bme,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Wst=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vst},Symbol.toStringTag,{value:"Module"}));var qst={parser:Eme,get db(){return new xh(2)},renderer:wst,styles:Bme,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Ust=Object.freeze(Object.defineProperty({__proto__:null,diagram:qst},Symbol.toStringTag,{value:"Module"}));var uM=(function(){var t=x(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:x(function(f,p,g,m,y,v,T){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:x(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:x(function(f){var p=this,g=[0],m=[],y=[null],v=[],T=this.table,b="",C=0,w=0,S=2,E=1,_=v.slice.call(arguments,1),R=Object.create(this.lexer),D={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(D.yy[L]=this.yy[L]);R.setInput(f,D.yy),D.yy.lexer=R,D.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var B=R.yylloc;v.push(B);var $=R.options&&R.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function A(re){g.length=g.length-2*re,y.length=y.length-re,v.length=v.length-re}x(A,"popStack");function I(){var re;return re=m.pop()||R.lex()||E,typeof re!="number"&&(re instanceof Array&&(m=re,re=m.pop()),re=p.symbols_[re]||re),re}x(I,"lex");for(var O,N,M,P,F={},V,z,W,X;;){if(N=g[g.length-1],this.defaultActions[N]?M=this.defaultActions[N]:((O===null||typeof O>"u")&&(O=I()),M=T[N]&&T[N][O]),typeof M>"u"||!M.length||!M[0]){var j="";X=[];for(V in T[N])this.terminals_[V]&&V>S&&X.push("'"+this.terminals_[V]+"'");R.showPosition?j="Parse error on line "+(C+1)+`: `+R.showPosition()+` Expecting `+X.join(", ")+", got '"+(this.terminals_[O]||O)+"'":j="Parse error on line "+(C+1)+": Unexpected "+(O==E?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(j,{text:R.match,token:this.terminals_[O]||O,line:R.yylineno,loc:B,expected:X})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+O);switch(M[0]){case 1:g.push(O),y.push(R.yytext),v.push(R.yylloc),g.push(M[1]),O=null,w=R.yyleng,b=R.yytext,C=R.yylineno,B=R.yylloc;break;case 2:if(z=this.productions_[M[1]][1],F.$=y[y.length-z],F._$={first_line:v[v.length-(z||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(z||1)].first_column,last_column:v[v.length-1].last_column},$&&(F._$.range=[v[v.length-(z||1)].range[0],v[v.length-1].range[1]]),P=this.performAction.apply(F,[b,w,C,D.yy,M[1],y,v].concat(_)),typeof P<"u")return P;z&&(g=g.slice(0,-1*z*2),y=y.slice(0,-1*z),v=v.slice(0,-1*z)),g.push(this.productions_[M[1]][0]),y.push(F.$),v.push(F._$),W=T[g[g.length-2]][g[g.length-1]],g.push(W);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:x(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:x(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:x(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(f){this.unput(this.match.slice(f))},"less"),pastInput:x(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` `+p+"^"},"showPosition"),test_match:x(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var p=this.next();return p||this.lex()},"lex"),begin:x(function(p){this.conditionStack.push(p)},"begin"),popState:x(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:x(function(p){this.begin(p)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return x(h,"Parser"),h.prototype=l,l.Parser=h,new h})();uM.parser=uM;var Hst=uM,K0="",eF=[],bb=[],Tb=[],Yst=x(function(){eF.length=0,bb.length=0,K0="",Tb.length=0,Xr()},"clear"),Xst=x(function(t){K0=t,eF.push(t)},"addSection"),jst=x(function(){return eF},"getSections"),Kst=x(function(){let t=KU();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Qst=x(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:K0,type:K0,people:a,task:t,score:n};Tb.push(s)},"addTask"),Jst=x(function(t){const e={section:K0,type:K0,description:t,task:t,classes:[]};bb.push(e)},"addTaskOrg"),KU=x(function(){const t=x(function(r){return Tb[r].processed},"compileTask");let e=!0;for(const[r,n]of Tb.entries())t(r),e=e&&n.processed;return e},"compileTasks"),eot=x(function(){return Zst()},"getActors"),ZU={getConfig:x(()=>Pe().journey,"getConfig"),clear:Yst,setDiagramTitle:dn,getDiagramTitle:an,setAccTitle:rn,getAccTitle:pn,setAccDescription:gn,getAccDescription:mn,addSection:Xst,getSections:jst,getTasks:Kst,addTask:Qst,addTaskOrg:Jst,getActors:eot},tot=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } .mouth { stroke: #666; } line { stroke: ${t.textColor} } .legend { fill: ${t.textColor}; font-family: ${t.fontFamily}; } .label text { fill: #333; } .label { color: ${t.textColor} } .face { ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"}; stroke: #999; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: 1px; } .node .label { text-align: center; } .node.clickable { cursor: pointer; } .arrowheadPath { fill: ${t.arrowheadColor}; } .edgePaths .path { stroke: ${t.lineColor}; stroke-width: 1.5px; } .flowchart-link { stroke: ${t.lineColor}; fill: none; } .edgeLabel { background-color: ${t.edgeLabelBackground}; rect { opacity: 0.5; } text-align: center; } .cluster rect { } .cluster text { fill: ${t.titleColor}; } div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${t.fontFamily}; font-size: 12px; background: ${t.tertiaryColor}; border: 1px solid ${t.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } .task-type-0, .section-type-0 { ${t.fillType0?`fill: ${t.fillType0}`:""}; } .task-type-1, .section-type-1 { ${t.fillType0?`fill: ${t.fillType1}`:""}; } .task-type-2, .section-type-2 { ${t.fillType0?`fill: ${t.fillType2}`:""}; } .task-type-3, .section-type-3 { ${t.fillType0?`fill: ${t.fillType3}`:""}; } .task-type-4, .section-type-4 { ${t.fillType0?`fill: ${t.fillType4}`:""}; } .task-type-5, .section-type-5 { ${t.fillType0?`fill: ${t.fillType5}`:""}; } .task-type-6, .section-type-6 { ${t.fillType0?`fill: ${t.fillType6}`:""}; } .task-type-7, .section-type-7 { ${t.fillType0?`fill: ${t.fillType7}`:""}; } .actor-0 { ${t.actor0?`fill: ${t.actor0}`:""}; } .actor-1 { ${t.actor1?`fill: ${t.actor1}`:""}; } .actor-2 { ${t.actor2?`fill: ${t.actor2}`:""}; } .actor-3 { ${t.actor3?`fill: ${t.actor3}`:""}; } .actor-4 { ${t.actor4?`fill: ${t.actor4}`:""}; } .actor-5 { ${t.actor5?`fill: ${t.actor5}`:""}; } ${eT()} `,"getStyles"),rot=tot,tF=x(function(t,e){return Rk(t,e)},"drawRect"),not=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=y0().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=y0().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),zme=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Gme=x(function(t,e){return ize(t,e)},"drawText"),iot=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Gme(t,e)},"drawLabel"),aot=x(function(t,e,r){const n=t.append("g"),i=ks();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,tF(n,i),Vme(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),hM=-1,sot=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");hM++,a.append("line").attr("id",n+"-task"+hM).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),not(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=ks();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,tF(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};zme(a,d),l+=10}),Vme(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),oot=x(function(t,e){wne(t,e)},"drawBackgroundRect"),Vme=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=Al[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Al[i].position};Cb.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=Cb.drawText(t,f).node().getBoundingClientRect().width;g>HC&&g>e.leftMargin-g&&(HC=g)}),n+=Math.max(20,u.length*20)})}x(Wme,"drawActorLegend");var $s=Pe().journey,Sc=0,uot=x(function(t,e,r,n){const i=Pe(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=ft("#i"+e));const h=ft(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");ds.init();const d=h.select("#"+e);Cb.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const C in Al)delete Al[C];let m=0;g.forEach(C=>{Al[C]={color:$s.actorColours[m%$s.actorColours.length],position:m},m++}),Wme(d),Sc=$s.leftMargin+HC,ds.insert(0,0,Sc,Object.keys(Al).length*50),hot(d,f,0,e);const y=ds.getBounds();p&&d.append("text").text(p).attr("x",Sc).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*$s.diagramMarginY,T=Sc+y.stopx+2*$s.diagramMarginX;Rn(d,v,T,$s.useMaxWidth),d.append("line").attr("x1",Sc).attr("y1",$s.height*4).attr("x2",T-Sc-4).attr("y2",$s.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${T} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),ds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:x(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=Pe().journey,a=this;let s=0;function o(l){return x(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(ds.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(ds.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(ds.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(ds.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}x(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:x(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(ds.data,"startx",i,Math.min),this.updateVal(ds.data,"starty",s,Math.min),this.updateVal(ds.data,"stopx",a,Math.max),this.updateVal(ds.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return this.data},"getBounds")},DI=$s.sectionFills,QU=$s.sectionColours,hot=x(function(t,e,r,n){const i=Pe().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=DI[l%DI.length],d=l%DI.length,h=QU[l%QU.length];let m=0;const y=p.section;for(let T=f;T(Al[y]&&(m[y]=Al[y]),m),{});p.x=f*i.taskMargin+f*i.width+Sc,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,Cb.drawTask(t,p,i,n),ds.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),JU={setConf:cot,draw:uot},dot={parser:Hst,db:ZU,renderer:JU,styles:rot,init:x(t=>{JU.setConf(t.journey),ZU.clear()},"init")};const fot=Object.freeze(Object.defineProperty({__proto__:null,diagram:dot},Symbol.toStringTag,{value:"Module"}));var dM=(function(){var t=x(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:x(function(p,g,m,y,v,T,b){var C=T.length-1;switch(v){case 1:return T[C-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:T[C-1].push(T[C]),this.$=T[C-1];break;case 7:case 8:this.$=T[C];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(T[C].substr(6)),this.$=T[C].substr(6);break;case 12:this.$=T[C].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=T[C].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(T[C].substr(8)),this.$=T[C].substr(8);break;case 18:y.addTask(T[C],0,""),this.$=T[C];break;case 19:y.addEvent(T[C].substr(2)),this.$=T[C];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:x(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:x(function(p){var g=this,m=[0],y=[],v=[null],T=[],b=this.table,C="",w=0,S=0,E=2,_=1,R=T.slice.call(arguments,1),D=Object.create(this.lexer),L={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(L.yy[B]=this.yy[B]);D.setInput(p,L.yy),L.yy.lexer=D,L.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;T.push($);var A=D.options&&D.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(Q){m.length=m.length-2*Q,v.length=v.length-Q,T.length=T.length-Q}x(I,"popStack");function O(){var Q;return Q=y.pop()||D.lex()||_,typeof Q!="number"&&(Q instanceof Array&&(y=Q,Q=y.pop()),Q=g.symbols_[Q]||Q),Q}x(O,"lex");for(var N,M,P,F,V={},z,W,X,j;;){if(M=m[m.length-1],this.defaultActions[M]?P=this.defaultActions[M]:((N===null||typeof N>"u")&&(N=O()),P=b[M]&&b[M][N]),typeof P>"u"||!P.length||!P[0]){var re="";j=[];for(z in b[M])this.terminals_[z]&&z>E&&j.push("'"+this.terminals_[z]+"'");D.showPosition?re="Parse error on line "+(w+1)+`: `+D.showPosition()+` Expecting `+j.join(", ")+", got '"+(this.terminals_[N]||N)+"'":re="Parse error on line "+(w+1)+": Unexpected "+(N==_?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(re,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:j})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+N);switch(P[0]){case 1:m.push(N),v.push(D.yytext),T.push(D.yylloc),m.push(P[1]),N=null,S=D.yyleng,C=D.yytext,w=D.yylineno,$=D.yylloc;break;case 2:if(W=this.productions_[P[1]][1],V.$=v[v.length-W],V._$={first_line:T[T.length-(W||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(W||1)].first_column,last_column:T[T.length-1].last_column},A&&(V._$.range=[T[T.length-(W||1)].range[0],T[T.length-1].range[1]]),F=this.performAction.apply(V,[C,S,w,L.yy,P[1],v,T].concat(R)),typeof F<"u")return F;W&&(m=m.slice(0,-1*W*2),v=v.slice(0,-1*W),T=T.slice(0,-1*W)),m.push(this.productions_[P[1]][0]),v.push(V.$),T.push(V._$),X=b[m[m.length-2]][m[m.length-1]],m.push(X);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:x(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:x(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:x(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(p){this.unput(this.match.slice(p))},"less"),pastInput:x(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` `+g+"^"},"showPosition"),test_match:x(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var T in v)this[T]=v[T];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),T=0;Tg[0].length)){if(g=m,y=T,this.options.backtrack_lexer){if(p=this.test_match(m,v[T]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var g=this.next();return g||this.lex()},"lex"),begin:x(function(g){this.conditionStack.push(g)},"begin"),popState:x(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:x(function(g){this.begin(g)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return x(d,"Parser"),d.prototype=u,u.Parser=d,new d})();dM.parser=dM;var pot=dM,qme={};vS(qme,{addEvent:()=>eye,addSection:()=>Kme,addTask:()=>Jme,addTaskOrg:()=>tye,clear:()=>Yme,default:()=>got,getCommonDb:()=>Hme,getDirection:()=>jme,getSections:()=>Zme,getTasks:()=>Qme,setDirection:()=>Xme});var Z0="",Ume=0,rF="LR",nF=[],cS=[],Q0=[],Hme=x(()=>HM,"getCommonDb"),Yme=x(function(){nF.length=0,cS.length=0,Z0="",Q0.length=0,rF="LR",Xr()},"clear"),Xme=x(function(t){rF=t},"setDirection"),jme=x(function(){return rF},"getDirection"),Kme=x(function(t){Z0=t,nF.push(t)},"addSection"),Zme=x(function(){return nF},"getSections"),Qme=x(function(){let t=eH();const e=100;let r=0;for(;!t&&rr.id===Ume-1).events.push(t)},"addEvent"),tye=x(function(t){const e={section:Z0,type:Z0,description:t,task:t,classes:[]};cS.push(e)},"addTaskOrg"),eH=x(function(){const t=x(function(r){return Q0[r].processed},"compileTask");let e=!0;for(const[r,n]of Q0.entries())t(r),e=e&&n.processed;return e},"compileTasks"),got={clear:Yme,getCommonDb:Hme,getDirection:jme,setDirection:Xme,addSection:Kme,getSections:Zme,getTasks:Qme,addTask:Jme,addTaskOrg:tye,addEvent:eye},rye=0,Y_=x(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),mot=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=y0().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=y0().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),yot=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),nye=x(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),vot=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,nye(t,e)},"drawLabel"),xot=x(function(t,e,r){const n=t.append("g"),i=iF();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,Y_(n,i),iye(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),fM=-1,bot=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");fM++,a.append("line").attr("id",n+"-task"+fM).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),mot(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=iF();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,Y_(a,o),iye(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Tot=x(function(t,e){Y_(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Cot=x(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),iF=x(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),iye=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
    ")&&(a.pop(),u.text(a.join(" ").trim()),i==="
    "?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}x(aF,"wrap");var Eot=x(function(t,e,r,n,i,a=!1){var v,T,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(aF,e.width).node().getBBox(),y=(T=n.fontSize)!=null&&T.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),kot(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const C=s.includes("dark"),w=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=ft(w),E=S.attr("id")??"",_=E?`${E}-drop-shadow`:"drop-shadow";if(S.select(`#${_}`).empty()){const R=S.select("defs");(R.empty()?S.append("defs"):R).append("filter").attr("id",_).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",C?"0.2":"0.06").attr("flood-color",C?"#FFFFFF":"#000000")}}return e},"drawNode"),Sot=x(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(aF,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),kot=x(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+rye++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),Na={drawRect:Y_,drawCircle:yot,drawSection:xot,drawText:nye,drawLabel:vot,drawTask:bot,drawBackgroundRect:Tot,getTextObj:Cot,getNoteRect:iF,initGraphics:wot,drawNode:Eot,getVirtualNodeHeight:Sot},_ot=x(function(t,e,r,n){var I,O,N;const i=Pe(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;he.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=ft("#i"+e));const m=ft(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();he.debug("task",y),Na.initGraphics(m,e);const T=n.db.getSections();he.debug("sections",T);let b=0,C=0,w=0,S=0,E=50+d,_=50;S=50;let R=0,D=!0;T.forEach(function(M){const P={number:R,descr:M,section:R,width:150,padding:20,maxHeight:b},F=Na.getVirtualNodeHeight(m,P,i);he.debug("sectionHeight before draw",F),b=Math.max(b,F+20)});let L=0,B=0;he.debug("tasks.length",y.length);for(const[M,P]of y.entries()){const F={number:M,descr:P,section:P.section,width:150,padding:20,maxHeight:C},V=Na.getVirtualNodeHeight(m,F,i);he.debug("taskHeight before draw",V),C=Math.max(C,V+20),L=Math.max(L,P.events.length);let z=0;for(const W of P.events){const X={descr:W,section:P.section,number:P.section,width:150,padding:20,maxHeight:50};z+=Na.getVirtualNodeHeight(m,X,i)}P.events.length>0&&(z+=(P.events.length-1)*10),B=Math.max(B,z)}he.debug("maxSectionHeight before draw",b),he.debug("maxTaskHeight before draw",C),T&&T.length>0?T.forEach(M=>{const P=y.filter(W=>W.section===M),F={number:R,descr:M,section:R,width:200*Math.max(P.length,1)-50,padding:20,maxHeight:b};he.debug("sectionNode",F);const V=m.append("g"),z=Na.drawNode(V,F,R,i,e);he.debug("sectionNode output",z),V.attr("transform",`translate(${E}, ${S})`),_+=b+50,P.length>0&&tH(m,P,R,E,_,C,i,L,B,b,!1,e),E+=200*Math.max(P.length,1),_=S,R++}):(D=!1,tH(m,y,R,E,_,C,i,L,B,b,!0,e));const $=m.node().getBBox();if(he.debug("bounds",$),v&&m.append("text").text(v).attr("x",a==="neo"?$.x*2+d:$.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),w=D?b+C+150:C+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",w).attr("x2",$.width+3*d).attr("y2",w).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const M=m.select("defs"),F=(M.empty()?m.append("defs"):M).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");F.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),F.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}tv(void 0,m,((O=i.timeline)==null?void 0:O.padding)??50,((N=i.timeline)==null?void 0:N.useMaxWidth)??!1)},"draw"),tH=x(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};he.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=Na.drawNode(m,g,r,s,d).height;if(he.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const T=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+Aot(t,p.events,r,n,i,s,d),i-=100,T.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),Aot=x(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};he.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=Na.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),Rot={setConf:x(()=>{},"setConf"),draw:_ot},X_=200,bl=5,Lot=X_+bl*2,sF=X_+100,Iot=sF+bl*2,aye=10,Dot=0,rH=20,sye=20,nH=30,oye=50,Mot=x(function(t,e,r,n){var I,O,N,M,P;const i=Pe(),a=((I=i.timeline)==null?void 0:I.leftMargin)??50;he.debug("timeline",n.db);const s=Yi(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();he.debug("task",o),Na.initGraphics(s);const u=n.db.getSections();he.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=Lot+sye,v=Iot+oye,T=m+y;let b=0;const C=u&&u.length>0,w=C?T:f+y,S=Math.max(50,y+v-bl*2);u.forEach(function(F){const V={number:b,descr:F,section:b,width:S,padding:bl,maxHeight:h},z=Na.getVirtualNodeHeight(s,V,i);he.debug("sectionHeight before draw",z),h=Math.max(h,z)});let E=0;he.debug("tasks.length",o.length);for(const[F,V]of o.entries()){const z={number:F,descr:V,section:V.section,width:X_,padding:bl,maxHeight:d},W=Na.getVirtualNodeHeight(s,z,i);he.debug("taskHeight before draw",W),d=Math.max(d,W);let X=0;for(const j of V.events){const re={descr:j,section:V.section,number:V.section,width:sF,padding:bl,maxHeight:50};X+=Na.getVirtualNodeHeight(s,re,i)}V.events.length>0&&(X+=(V.events.length-1)*aye),E=Math.max(E,X)+Dot}he.debug("maxSectionHeight before draw",h),he.debug("maxTaskHeight before draw",d);const R=Math.max(d,E)+nH;C?u.forEach(F=>{const V=o.filter(ee=>ee.section===F),z={number:b,descr:F,section:b,width:S,padding:bl,maxHeight:h};he.debug("sectionNode",z);const W=s.append("g"),X=Na.drawNode(W,z,b,i);he.debug("sectionNode output",X);const j=w-y;W.attr("transform",`translate(${j}, ${p})`);const re=p+X.height+rH;V.length>0&&iH(s,V,b,w,re,d,i,R,!1);const Q=V.length,oe=X.height+rH+R*Math.max(Q,1)-(Q>0?nH*2:0);p+=oe,b++}):iH(s,o,b,w,p,d,i,R,!0);let D=(O=s.node())==null?void 0:O.getBBox();if(!D)throw new Error("bbox not found");if(he.debug("bounds",D),l){if(s.append("text").text(l).attr("x",D.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),D=(N=s.node())==null?void 0:N.getBBox(),!D)throw new Error("bbox not found");he.debug("bounds after title",D)}const[L]=Zl(i.fontSize),B=(L??16)*2,$=(L??16)*.5+20,A=s.append("g").attr("class","lineWrapper");A.append("line").attr("x1",w).attr("y1",g-B).attr("x2",w).attr("y2",D.y+D.height+$).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),A.lower(),tv(void 0,s,((M=i.timeline)==null?void 0:M.padding)??50,((P=i.timeline)==null?void 0:P.useMaxWidth)??!1)},"draw"),iH=x(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:X_,padding:bl,maxHeight:a};he.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=Na.drawNode(f,d,r,s),g=p.height;he.debug("taskHeight after draw",g);const m=n-sye-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+oye;Not(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),Not=x(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:sF,padding:bl,maxHeight:0};he.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=Na.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+aye}return o-a},"drawEvents"),Oot={setConf:x(()=>{},"setConf"),draw:Mot},$ot=x(t=>{var o;const{theme:e}=It(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l{let e="";for(let r=0;r{var s;const{theme:e}=It(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{},"setConf"),draw:x((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?Oot.draw(t,e,r,n):Rot.draw(t,e,r,n)},"draw")},Got={db:qme,renderer:zot,parser:pot,styles:Fot};const Vot=Object.freeze(Object.defineProperty({__proto__:null,diagram:Got},Symbol.toStringTag,{value:"Module"})),Si=[];for(let t=0;t<256;++t)Si.push((t+256).toString(16).slice(1));function Wot(t,e=0){return(Si[t[e+0]]+Si[t[e+1]]+Si[t[e+2]]+Si[t[e+3]]+"-"+Si[t[e+4]]+Si[t[e+5]]+"-"+Si[t[e+6]]+Si[t[e+7]]+"-"+Si[t[e+8]]+Si[t[e+9]]+"-"+Si[t[e+10]]+Si[t[e+11]]+Si[t[e+12]]+Si[t[e+13]]+Si[t[e+14]]+Si[t[e+15]]).toLowerCase()}const qot=new Uint8Array(16);function Uot(){return crypto.getRandomValues(qot)}function Hot(t,e,r){return crypto.randomUUID?crypto.randomUUID():Yot(t)}function Yot(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Uot();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Wot(n)}var pM=(function(){var t=x(function(C,w,S,E){for(S=S||{},E=C.length;E--;S[C[E]]=w);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:x(function(w,S,E,_,R,D,L){var B=D.length-1;switch(R){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",D[B].id),_.addNode(D[B-1].length,D[B].id,D[B].descr,D[B].type);break;case 16:_.getLogger().trace("Icon: ",D[B]),_.decorateNode({icon:D[B]});break;case 17:case 21:_.decorateNode({class:D[B]});break;case 18:_.getLogger().trace("SPACELIST");break;case 19:_.getLogger().trace("Node: ",D[B].id),_.addNode(0,D[B].id,D[B].descr,D[B].type);break;case 20:_.decorateNode({icon:D[B]});break;case 25:_.getLogger().trace("node found ..",D[B-2]),this.$={id:D[B-1],descr:D[B-1],type:_.getType(D[B-2],D[B])};break;case 26:this.$={id:D[B],descr:D[B],type:_.nodeType.DEFAULT};break;case 27:_.getLogger().trace("node found ..",D[B-3]),this.$={id:D[B-3],descr:D[B-1],type:_.getType(D[B-2],D[B])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(w,S){if(S.recoverable)this.trace(w);else{var E=new Error(w);throw E.hash=S,E}},"parseError"),parse:x(function(w){var S=this,E=[0],_=[],R=[null],D=[],L=this.table,B="",$=0,A=0,I=2,O=1,N=D.slice.call(arguments,1),M=Object.create(this.lexer),P={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(P.yy[F]=this.yy[F]);M.setInput(w,P.yy),P.yy.lexer=M,P.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var V=M.yylloc;D.push(V);var z=M.options&&M.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function W(ye){E.length=E.length-2*ye,R.length=R.length-ye,D.length=D.length-ye}x(W,"popStack");function X(){var ye;return ye=_.pop()||M.lex()||O,typeof ye!="number"&&(ye instanceof Array&&(_=ye,ye=_.pop()),ye=S.symbols_[ye]||ye),ye}x(X,"lex");for(var j,re,Q,oe,ee={},ne,ie,ae,de;;){if(re=E[E.length-1],this.defaultActions[re]?Q=this.defaultActions[re]:((j===null||typeof j>"u")&&(j=X()),Q=L[re]&&L[re][j]),typeof Q>"u"||!Q.length||!Q[0]){var le="";de=[];for(ne in L[re])this.terminals_[ne]&&ne>I&&de.push("'"+this.terminals_[ne]+"'");M.showPosition?le="Parse error on line "+($+1)+`: `+M.showPosition()+` Expecting `+de.join(", ")+", got '"+(this.terminals_[j]||j)+"'":le="Parse error on line "+($+1)+": Unexpected "+(j==O?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(le,{text:M.match,token:this.terminals_[j]||j,line:M.yylineno,loc:V,expected:de})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+re+", token: "+j);switch(Q[0]){case 1:E.push(j),R.push(M.yytext),D.push(M.yylloc),E.push(Q[1]),j=null,A=M.yyleng,B=M.yytext,$=M.yylineno,V=M.yylloc;break;case 2:if(ie=this.productions_[Q[1]][1],ee.$=R[R.length-ie],ee._$={first_line:D[D.length-(ie||1)].first_line,last_line:D[D.length-1].last_line,first_column:D[D.length-(ie||1)].first_column,last_column:D[D.length-1].last_column},z&&(ee._$.range=[D[D.length-(ie||1)].range[0],D[D.length-1].range[1]]),oe=this.performAction.apply(ee,[B,A,$,P.yy,Q[1],R,D].concat(N)),typeof oe<"u")return oe;ie&&(E=E.slice(0,-1*ie*2),R=R.slice(0,-1*ie),D=D.slice(0,-1*ie)),E.push(this.productions_[Q[1]][0]),R.push(ee.$),D.push(ee._$),ae=L[E[E.length-2]][E[E.length-1]],E.push(ae);break;case 3:return!0}}return!0},"parse")},T=(function(){var C={EOF:1,parseError:x(function(S,E){if(this.yy.parser)this.yy.parser.parseError(S,E);else throw new Error(S)},"parseError"),setInput:x(function(w,S){return this.yy=S||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var S=w.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:x(function(w){var S=w.length,E=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(w){this.unput(this.match.slice(w))},"less"),pastInput:x(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var w=this.pastInput(),S=new Array(w.length+1).join("-");return w+this.upcomingInput()+` `+S+"^"},"showPosition"),test_match:x(function(w,S){var E,_,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),_=w[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],E=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var D in R)this[D]=R[D];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,S,E,_;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),D=0;DS[0].length)){if(S=E,_=D,this.options.backtrack_lexer){if(w=this.test_match(E,R[D]),w!==!1)return w;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(w=this.test_match(S,R[_]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var S=this.next();return S||this.lex()},"lex"),begin:x(function(S){this.conditionStack.push(S)},"begin"),popState:x(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:x(function(S){this.begin(S)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(S,E,_,R){switch(_){case 0:return S.getLogger().trace("Found comment",E.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",E.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",E.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",E.yytext),20;case 36:return S.getLogger().trace("Long description:",E.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return C})();v.lexer=T;function b(){this.yy={}}return x(b,"Parser"),b.prototype=v,v.Parser=b,new b})();pM.parser=pM;var Xot=pM,jot=12,ul={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},e0,Kot=(e0=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=ul,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;he.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Pe();let o=((h=s.mindmap)==null?void 0:h.padding)??pr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:xr(r,s),level:e,descr:xr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??pr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(he.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Pe(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=xr(e.icon,r)),e.class&&(n.class=xr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(jot-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Pe(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=x(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case ul.CIRCLE:return"mindmapCircle";case ul.RECT:return"rect";case ul.ROUNDED_RECT:return"rounded";case ul.CLOUD:return"cloud";case ul.BANG:return"bang";case ul.HEXAGON:return"hexagon";case ul.DEFAULT:return h?"rounded":"defaultMindmapNode";case ul.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Pe();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Pe(),i=jH().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};he.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),he.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Hot()}}getLogger(){return he}},x(e0,"MindmapDB"),e0),Zot=x(async(t,e,r,n)=>{var f,p;he.debug(`Rendering mindmap diagram `+t);const i=n.db,a=i.getData(),s=xv(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=zb(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await uv(a,s);const{themeVariables:l}=It(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}Cd(s,((f=a.config.mindmap)==null?void 0:f.padding)??pr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??pr.mindmap.useMaxWidth)},"draw"),Qot={draw:Zot},Jot=x(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{let n="";for(let i=0;i{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } ${Jot(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } .section-root text { fill: ${t.gitBranchLabel0}; } .section-root span { color: ${e!=null&&e.includes("redux")?t.nodeBorder:t.gitBranchLabel0}; } .icon-container { height:100%; display: flex; justify-content: center; align-items: center; } .edge { fill: none; } .mindmap-node-label { dy: 1em; alignment-baseline: middle; text-anchor: middle; dominant-baseline: middle; text-align: center; } [data-look="neo"].mindmap-node { filter: ${n}; } [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon { fill: ${e!=null&&e.includes("redux")?t.mainBkg:t.git0}; } [data-look="neo"].mindmap-node.section-root .text-inner-tspan { fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]}; } ${t.useGradient&&r&&t.mainBkg?elt(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} `},"getStyles"),rlt=tlt,nlt={get db(){return new Kot},renderer:Qot,parser:Xot,styles:rlt};const ilt=Object.freeze(Object.defineProperty({__proto__:null,diagram:nlt},Symbol.toStringTag,{value:"Module"}));var gM=(function(){var t=x(function(E,_,R,D){for(R=R||{},D=E.length;D--;R[E[D]]=_);return R},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],T=[1,6,7,11,13,16,17,20,23],b=[1,38],C={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:x(function(_,R,D,L,B,$,A){var I=$.length-1;switch(B){case 6:case 7:return L;case 8:L.getLogger().trace("Stop NL ");break;case 9:L.getLogger().trace("Stop EOF ");break;case 11:L.getLogger().trace("Stop NL2 ");break;case 12:L.getLogger().trace("Stop EOF2 ");break;case 15:L.getLogger().info("Node: ",$[I-1].id),L.addNode($[I-2].length,$[I-1].id,$[I-1].descr,$[I-1].type,$[I]);break;case 16:L.getLogger().info("Node: ",$[I].id),L.addNode($[I-1].length,$[I].id,$[I].descr,$[I].type);break;case 17:L.getLogger().trace("Icon: ",$[I]),L.decorateNode({icon:$[I]});break;case 18:case 23:L.decorateNode({class:$[I]});break;case 19:L.getLogger().trace("SPACELIST");break;case 20:L.getLogger().trace("Node: ",$[I-1].id),L.addNode(0,$[I-1].id,$[I-1].descr,$[I-1].type,$[I]);break;case 21:L.getLogger().trace("Node: ",$[I].id),L.addNode(0,$[I].id,$[I].descr,$[I].type);break;case 22:L.decorateNode({icon:$[I]});break;case 27:L.getLogger().trace("node found ..",$[I-2]),this.$={id:$[I-1],descr:$[I-1],type:L.getType($[I-2],$[I])};break;case 28:this.$={id:$[I],descr:$[I],type:0};break;case 29:L.getLogger().trace("node found ..",$[I-3]),this.$={id:$[I-3],descr:$[I-1],type:L.getType($[I-2],$[I])};break;case 30:this.$=$[I-1]+$[I];break;case 31:this.$=$[I];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(T,[2,8]),t(T,[2,9]),t(T,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(T,[2,11]),t(T,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(_,R){if(R.recoverable)this.trace(_);else{var D=new Error(_);throw D.hash=R,D}},"parseError"),parse:x(function(_){var R=this,D=[0],L=[],B=[null],$=[],A=this.table,I="",O=0,N=0,M=2,P=1,F=$.slice.call(arguments,1),V=Object.create(this.lexer),z={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(z.yy[W]=this.yy[W]);V.setInput(_,z.yy),z.yy.lexer=V,z.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var X=V.yylloc;$.push(X);var j=V.options&&V.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(ce){D.length=D.length-2*ce,B.length=B.length-ce,$.length=$.length-ce}x(re,"popStack");function Q(){var ce;return ce=L.pop()||V.lex()||P,typeof ce!="number"&&(ce instanceof Array&&(L=ce,ce=L.pop()),ce=R.symbols_[ce]||ce),ce}x(Q,"lex");for(var oe,ee,ne,ie,ae={},de,le,ye,$e;;){if(ee=D[D.length-1],this.defaultActions[ee]?ne=this.defaultActions[ee]:((oe===null||typeof oe>"u")&&(oe=Q()),ne=A[ee]&&A[ee][oe]),typeof ne>"u"||!ne.length||!ne[0]){var Fe="";$e=[];for(de in A[ee])this.terminals_[de]&&de>M&&$e.push("'"+this.terminals_[de]+"'");V.showPosition?Fe="Parse error on line "+(O+1)+`: `+V.showPosition()+` Expecting `+$e.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":Fe="Parse error on line "+(O+1)+": Unexpected "+(oe==P?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(Fe,{text:V.match,token:this.terminals_[oe]||oe,line:V.yylineno,loc:X,expected:$e})}if(ne[0]instanceof Array&&ne.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ee+", token: "+oe);switch(ne[0]){case 1:D.push(oe),B.push(V.yytext),$.push(V.yylloc),D.push(ne[1]),oe=null,N=V.yyleng,I=V.yytext,O=V.yylineno,X=V.yylloc;break;case 2:if(le=this.productions_[ne[1]][1],ae.$=B[B.length-le],ae._$={first_line:$[$.length-(le||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(le||1)].first_column,last_column:$[$.length-1].last_column},j&&(ae._$.range=[$[$.length-(le||1)].range[0],$[$.length-1].range[1]]),ie=this.performAction.apply(ae,[I,N,O,z.yy,ne[1],B,$].concat(F)),typeof ie<"u")return ie;le&&(D=D.slice(0,-1*le*2),B=B.slice(0,-1*le),$=$.slice(0,-1*le)),D.push(this.productions_[ne[1]][0]),B.push(ae.$),$.push(ae._$),ye=A[D[D.length-2]][D[D.length-1]],D.push(ye);break;case 3:return!0}}return!0},"parse")},w=(function(){var E={EOF:1,parseError:x(function(R,D){if(this.yy.parser)this.yy.parser.parseError(R,D);else throw new Error(R)},"parseError"),setInput:x(function(_,R){return this.yy=R||this.yy||{},this._input=_,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var _=this._input[0];this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_;var R=_.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_},"input"),unput:x(function(_){var R=_.length,D=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),D.length-1&&(this.yylineno-=D.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:D?(D.length===L.length?this.yylloc.first_column:0)+L[L.length-D.length].length-D[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(_){this.unput(this.match.slice(_))},"less"),pastInput:x(function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var _=this.pastInput(),R=new Array(_.length+1).join("-");return _+this.upcomingInput()+` `+R+"^"},"showPosition"),test_match:x(function(_,R){var D,L,B;if(this.options.backtrack_lexer&&(B={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(B.yylloc.range=this.yylloc.range.slice(0))),L=_[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_[0].length),this.matched+=_[0],D=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),D)return D;if(this._backtrack){for(var $ in B)this[$]=B[$];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _,R,D,L;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),$=0;$R[0].length)){if(R=D,L=$,this.options.backtrack_lexer){if(_=this.test_match(D,B[$]),_!==!1)return _;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(_=this.test_match(R,B[L]),_!==!1?_:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var R=this.next();return R||this.lex()},"lex"),begin:x(function(R){this.conditionStack.push(R)},"begin"),popState:x(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:x(function(R){this.begin(R)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(R,D,L,B){switch(L){case 0:return this.pushState("shapeData"),D.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const $=/\n\s*/g;return D.yytext=D.yytext.replace($,"
    "),24;case 4:return 24;case 5:this.popState();break;case 6:return R.getLogger().trace("Found comment",D.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:R.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return R.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:R.getLogger().trace("end icon"),this.popState();break;case 16:return R.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return R.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return R.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return R.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:R.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return R.getLogger().trace("description:",D.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),R.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),R.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),R.getLogger().trace("node end ...",D.yytext),"NODE_DEND";case 36:return this.popState(),R.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),R.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),R.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),R.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),R.getLogger().trace("node end (("),"NODE_DEND";case 41:return R.getLogger().trace("Long description:",D.yytext),21;case 42:return R.getLogger().trace("Long description:",D.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return E})();C.lexer=w;function S(){this.yy={}}return x(S,"Parser"),S.prototype=C,C.Parser=S,new S})();gM.parser=gM;var alt=gM,fs=[],oF=[],mM=0,lF={},slt=x(()=>{fs=[],oF=[],mM=0,lF={}},"clear"),olt=x(t=>{if(fs.length===0)return null;const e=fs[0].level;let r=null;for(let n=fs.length-1;n>=0;n--)if(fs[n].level===e&&!r&&(r=fs[n]),fs[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:xr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Pe()}},"getData"),clt=x((t,e,r,n,i)=>{var u,h;const a=Pe();let s=((u=a.mindmap)==null?void 0:u.padding)??pr.mindmap.padding;switch(n){case Zn.ROUNDED_RECT:case Zn.RECT:case Zn.HEXAGON:s*=2}const o={id:xr(e,a)||"kbn"+mM++,level:t,label:xr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??pr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` }`;const f=rk(d,{schema:tk});if(f.shape&&(f.shape!==f.shape.toLowerCase()||f.shape.includes("_")))throw new Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);f!=null&&f.shape&&f.shape==="kanbanItem"&&(o.shape=f==null?void 0:f.shape),f!=null&&f.label&&(o.label=f==null?void 0:f.label),f!=null&&f.icon&&(o.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(o.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(o.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(o.priority=f==null?void 0:f.priority)}const l=olt(t);l?o.parentId=l.id||"kbn"+mM++:oF.push(o),fs.push(o)},"addNode"),Zn={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ult=x((t,e)=>{switch(he.debug("In get type",t,e),t){case"[":return Zn.RECT;case"(":return e===")"?Zn.ROUNDED_RECT:Zn.CLOUD;case"((":return Zn.CIRCLE;case")":return Zn.CLOUD;case"))":return Zn.BANG;case"{{":return Zn.HEXAGON;default:return Zn.DEFAULT}},"getType"),hlt=x((t,e)=>{lF[t]=e},"setElementForId"),dlt=x(t=>{if(!t)return;const e=Pe(),r=fs[fs.length-1];t.icon&&(r.icon=xr(t.icon,e)),t.class&&(r.cssClasses=xr(t.class,e))},"decorateNode"),flt=x(t=>{switch(t){case Zn.DEFAULT:return"no-border";case Zn.RECT:return"rect";case Zn.ROUNDED_RECT:return"rounded-rect";case Zn.CIRCLE:return"circle";case Zn.CLOUD:return"cloud";case Zn.BANG:return"bang";case Zn.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),plt=x(()=>he,"getLogger"),glt=x(t=>lF[t],"getElementById"),mlt={clear:slt,addNode:clt,getSections:lye,getData:llt,nodeType:Zn,getType:ult,setElementForId:hlt,decorateNode:dlt,type2Str:flt,getLogger:plt,getElementById:glt},ylt=mlt,vlt=x(async(t,e,r,n)=>{var y,v,T,b,C;he.debug(`Rendering kanban diagram `+t);const a=n.db.getData(),s=Pe();s.htmlLabels=!1;const o=Yi(e);for(const w of a.nodes)w.domId=`${e}-${w.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(w=>w.isGroup);let d=0;const f=10,p=[];let g=25;for(const w of h){const S=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,w.x=S*d+(d-1)*f/2,w.width=S,w.y=0,w.height=S*3,w.rx=5,w.ry=5,w.cssClasses=w.cssClasses+" section-"+d;const E=await PS(l,w);g=Math.max(g,(v=E==null?void 0:E.labelBBox)==null?void 0:v.height),p.push(E)}let m=0;for(const w of h){const S=p[m];m=m+1;const E=((T=s==null?void 0:s.kanban)==null?void 0:T.sectionWidth)||200,_=-E*3/2+g;let R=_;const D=a.nodes.filter($=>$.parentId===w.id);for(const $ of D){if($.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");$.x=w.x,$.width=E-1.5*f;const I=(await av(u,$,{config:s})).node().getBBox();$.y=R+I.height/2,await v0($),R=$.y+I.height/2+f/2}const L=S.cluster.select("rect"),B=Math.max(R-_+3*f,50)+(g-25);L.attr("height",B)}tv(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??pr.kanban.padding,((C=s.mindmap)==null?void 0:C.useMaxWidth)??pr.kanban.useMaxWidth)},"draw"),xlt={draw:vlt},blt=x(t=>{let e="";for(let n=0;nt.darkMode?Ye(n,i):He(n,i),"adjuster");for(let n=0;n` .edge { stroke-width: 3; } ${blt(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } .section-root text { fill: ${t.gitBranchLabel0}; } .icon-container { height:100%; display: flex; justify-content: center; align-items: center; } .edge { fill: none; } .cluster-label, .label { color: ${t.textColor}; fill: ${t.textColor}; } .kanban-label { dy: 1em; alignment-baseline: middle; text-anchor: middle; dominant-baseline: middle; text-align: center; } ${eT()} `,"getStyles"),Clt=Tlt,wlt={db:ylt,renderer:xlt,parser:alt,styles:Clt};const Elt=Object.freeze(Object.defineProperty({__proto__:null,diagram:wlt},Symbol.toStringTag,{value:"Module"}));function aH(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function cye(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function MI(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function Slt(t){return t.target.depth}function klt(t){return t.depth}function _lt(t,e){return e-1-t.height}function uye(t,e){return t.sourceLinks.length?t.depth:e-1}function Alt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?cye(t.sourceLinks,Slt)-1:0}function L2(t){return function(){return t}}function sH(t,e){return uS(t.source,e.source)||t.index-e.index}function oH(t,e){return uS(t.target,e.target)||t.index-e.index}function uS(t,e){return t.y0-e.y0}function NI(t){return t.value}function Rlt(t){return t.index}function Llt(t){return t.nodes}function Ilt(t){return t.links}function lH(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function cH({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function Dlt(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=Rlt,l=uye,u,h,d=Llt,f=Ilt,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),T(I),w(I),cH(I),I}g.update=function(I){return cH(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:L2(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:L2(I),g):l},g.nodeSort=function(I){return arguments.length?(u=I,g):u},g.nodeWidth=function(I){return arguments.length?(i=+I,g):i},g.nodePadding=function(I){return arguments.length?(a=s=+I,g):a},g.nodes=function(I){return arguments.length?(d=typeof I=="function"?I:L2(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:L2(I),g):f},g.linkSort=function(I){return arguments.length?(h=I,g):h},g.size=function(I){return arguments.length?(t=e=0,r=+I[0],n=+I[1],g):[r-t,n-e]},g.extent=function(I){return arguments.length?(t=+I[0][0],r=+I[1][0],e=+I[0][1],n=+I[1][1],g):[[t,e],[r,n]]},g.iterations=function(I){return arguments.length?(p=+I,g):p};function m({nodes:I,links:O}){for(const[M,P]of I.entries())P.index=M,P.sourceLinks=[],P.targetLinks=[];const N=new Map(I.map((M,P)=>[o(M,P,I),M]));for(const[M,P]of O.entries()){P.index=M;let{source:F,target:V}=P;typeof F!="object"&&(F=P.source=lH(N,F)),typeof V!="object"&&(V=P.target=lH(N,V)),F.sourceLinks.push(P),V.targetLinks.push(P)}if(h!=null)for(const{sourceLinks:M,targetLinks:P}of I)M.sort(h),P.sort(h)}function y({nodes:I}){for(const O of I)O.value=O.fixedValue===void 0?Math.max(MI(O.sourceLinks,NI),MI(O.targetLinks,NI)):O.fixedValue}function v({nodes:I}){const O=I.length;let N=new Set(I),M=new Set,P=0;for(;N.size;){for(const F of N){F.depth=P;for(const{target:V}of F.sourceLinks)M.add(V)}if(++P>O)throw new Error("circular link");N=M,M=new Set}}function T({nodes:I}){const O=I.length;let N=new Set(I),M=new Set,P=0;for(;N.size;){for(const F of N){F.height=P;for(const{source:V}of F.targetLinks)M.add(V)}if(++P>O)throw new Error("circular link");N=M,M=new Set}}function b({nodes:I}){const O=aH(I,P=>P.depth)+1,N=(r-t-i)/(O-1),M=new Array(O);for(const P of I){const F=Math.max(0,Math.min(O-1,Math.floor(l.call(null,P,O))));P.layer=F,P.x0=t+F*N,P.x1=P.x0+i,M[F]?M[F].push(P):M[F]=[P]}if(u)for(const P of M)P.sort(u);return M}function C(I){const O=cye(I,N=>(n-e-(N.length-1)*s)/MI(N,NI));for(const N of I){let M=e;for(const P of N){P.y0=M,P.y1=M+P.value*O,M=P.y1+s;for(const F of P.sourceLinks)F.width=F.value*O}M=(n-M+s)/(N.length+1);for(let P=0;PN.length)-1)),C(O);for(let N=0;N0))continue;let X=(z/W-V.y0)*O;V.y0+=X,V.y1+=X,L(V)}u===void 0&&F.sort(uS),_(F,N)}}function E(I,O,N){for(let M=I.length,P=M-2;P>=0;--P){const F=I[P];for(const V of F){let z=0,W=0;for(const{target:j,value:re}of V.sourceLinks){let Q=re*(j.layer-V.layer);z+=A(V,j)*Q,W+=Q}if(!(W>0))continue;let X=(z/W-V.y0)*O;V.y0+=X,V.y1+=X,L(V)}u===void 0&&F.sort(uS),_(F,N)}}function _(I,O){const N=I.length>>1,M=I[N];D(I,M.y0-s,N-1,O),R(I,M.y1+s,N+1,O),D(I,n,I.length-1,O),R(I,e,0,O)}function R(I,O,N,M){for(;N1e-6&&(P.y0+=F,P.y1+=F),O=P.y1+s}}function D(I,O,N,M){for(;N>=0;--N){const P=I[N],F=(P.y1-O)*M;F>1e-6&&(P.y0-=F,P.y1-=F),O=P.y0-s}}function L({sourceLinks:I,targetLinks:O}){if(h===void 0){for(const{source:{sourceLinks:N}}of O)N.sort(oH);for(const{target:{targetLinks:N}}of I)N.sort(sH)}}function B(I){if(h===void 0)for(const{sourceLinks:O,targetLinks:N}of I)O.sort(oH),N.sort(sH)}function $(I,O){let N=I.y0-(I.sourceLinks.length-1)*s/2;for(const{target:M,width:P}of I.sourceLinks){if(M===O)break;N+=P+s}for(const{source:M,width:P}of O.targetLinks){if(M===I)break;N-=P}return N}function A(I,O){let N=O.y0-(O.targetLinks.length-1)*s/2;for(const{source:M,width:P}of O.targetLinks){if(M===I)break;N+=P+s}for(const{target:M,width:P}of I.sourceLinks){if(M===O)break;N-=P}return N}return g}var yM=Math.PI,vM=2*yM,th=1e-6,Mlt=vM-th;function xM(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function hye(){return new xM}xM.prototype=hye.prototype={constructor:xM,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>th)if(!(Math.abs(h*o-l*u)>th)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),T=i*Math.tan((yM-Math.acos((g+d-m)/(2*y*v)))/2),b=T/v,C=T/y;Math.abs(b-1)>th&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+C*o)+","+(this._y1=e+C*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>th||Math.abs(this._y1-u)>th)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%vM+vM),d>Mlt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>th&&(this._+="A"+r+","+r+",0,"+ +(d>=yM)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function uH(t){return function(){return t}}function Nlt(t){return t[0]}function Olt(t){return t[1]}var $lt=Array.prototype.slice;function Plt(t){return t.source}function Blt(t){return t.target}function Flt(t){var e=Plt,r=Blt,n=Nlt,i=Olt,a=null;function s(){var o,l=$lt.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=hye()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:uH(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:uH(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function zlt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function Glt(){return Flt(zlt)}function Vlt(t){return[t.source.x1,t.y0]}function Wlt(t){return[t.target.x0,t.y1]}function qlt(){return Glt().source(Vlt).target(Wlt)}var bM=(function(){var t=x(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:x(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),T=parseFloat(p[m].trim());d.addLink(y,v,T);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:x(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:x(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,T=2,b=1,C=p.slice.call(arguments,1),w=Object.create(this.lexer),S={yy:{}};for(var E in this.yy)Object.prototype.hasOwnProperty.call(this.yy,E)&&(S.yy[E]=this.yy[E]);w.setInput(l,S.yy),S.yy.lexer=w,S.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var _=w.yylloc;p.push(_);var R=w.options&&w.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function D(z){h.length=h.length-2*z,f.length=f.length-z,p.length=p.length-z}x(D,"popStack");function L(){var z;return z=d.pop()||w.lex()||b,typeof z!="number"&&(z instanceof Array&&(d=z,z=d.pop()),z=u.symbols_[z]||z),z}x(L,"lex");for(var B,$,A,I,O={},N,M,P,F;;){if($=h[h.length-1],this.defaultActions[$]?A=this.defaultActions[$]:((B===null||typeof B>"u")&&(B=L()),A=g[$]&&g[$][B]),typeof A>"u"||!A.length||!A[0]){var V="";F=[];for(N in g[$])this.terminals_[N]&&N>T&&F.push("'"+this.terminals_[N]+"'");w.showPosition?V="Parse error on line "+(y+1)+`: `+w.showPosition()+` Expecting `+F.join(", ")+", got '"+(this.terminals_[B]||B)+"'":V="Parse error on line "+(y+1)+": Unexpected "+(B==b?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(V,{text:w.match,token:this.terminals_[B]||B,line:w.yylineno,loc:_,expected:F})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+B);switch(A[0]){case 1:h.push(B),f.push(w.yytext),p.push(w.yylloc),h.push(A[1]),B=null,v=w.yyleng,m=w.yytext,y=w.yylineno,_=w.yylloc;break;case 2:if(M=this.productions_[A[1]][1],O.$=f[f.length-M],O._$={first_line:p[p.length-(M||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(M||1)].first_column,last_column:p[p.length-1].last_column},R&&(O._$.range=[p[p.length-(M||1)].range[0],p[p.length-1].range[1]]),I=this.performAction.apply(O,[m,v,y,S.yy,A[1],f,p].concat(C)),typeof I<"u")return I;M&&(h=h.slice(0,-1*M*2),f=f.slice(0,-1*M),p=p.slice(0,-1*M)),h.push(this.productions_[A[1]][0]),f.push(O.$),p.push(O._$),P=g[h[h.length-2]][h[h.length-1]],h.push(P);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:x(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:x(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:x(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(l){this.unput(this.match.slice(l))},"less"),pastInput:x(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` `+u+"^"},"showPosition"),test_match:x(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var u=this.next();return u||this.lex()},"lex"),begin:x(function(u){this.conditionStack.push(u)},"begin"),popState:x(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:x(function(u){this.begin(u)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return x(s,"Parser"),s.prototype=i,i.Parser=s,new s})();bM.parser=bM;var hS=bM,j_=[],K_=[],dS=new Map,Ult=x(()=>{j_=[],K_=[],dS=new Map,Xr()},"clear"),t0,Hlt=(t0=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},x(t0,"SankeyLink"),t0),Ylt=x((t,e,r)=>{j_.push(new Hlt(t,e,r))},"addLink"),r0,Xlt=(r0=class{constructor(e){this.ID=e}},x(r0,"SankeyNode"),r0),jlt=x(t=>{t=yt.sanitizeText(t,Pe());let e=dS.get(t);return e===void 0&&(e=new Xlt(t),dS.set(t,e),K_.push(e)),e},"findOrCreateNode"),Klt=x(()=>K_,"getNodes"),Zlt=x(()=>j_,"getLinks"),Qlt=x(()=>({nodes:K_.map(t=>({id:t.ID})),links:j_.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),Jlt={nodesMap:dS,getConfig:x(()=>Pe().sankey,"getConfig"),getNodes:Klt,getLinks:Zlt,getGraph:Qlt,addLink:Ylt,findOrCreateNode:jlt,getAccTitle:pn,setAccTitle:rn,getAccDescription:mn,setAccDescription:gn,getDiagramTitle:an,setDiagramTitle:dn,clear:Ult},Rl,hH=(Rl=class{static next(e){return new Rl(e+ ++Rl.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},x(Rl,"Uid"),Rl.count=0,Rl),ect={left:klt,right:_lt,center:Alt,justify:uye},tct=x(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),rct=x(function(t,e,r,n){const{securityLevel:i,sankey:a}=Pe(),s=rY.sankey;let o;i==="sandbox"&&(o=ft("#i"+e));const l=ft(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):ft(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,T=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",C=(a==null?void 0:a.nodeColors)??{},w=n.db.getGraph(),S=ect[p];Dlt().nodeId(M=>M.id).nodeWidth(v).nodePadding(T+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(w);const _=tct(w.nodes),R=Ih(kEe),D=x(M=>C[M]??R(M),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(w.nodes).join("g").attr("class","node").attr("id",M=>(M.uid=hH.next("node-")).id).attr("transform",function(M){return"translate("+M.x0+","+M.y0+")"}).attr("x",M=>M.x0).attr("y",M=>M.y0).append("rect").attr("height",M=>M.y1-M.y0).attr("width",M=>M.x1-M.x0).attr("fill",M=>D(M.id));const L=x(({id:M,value:P})=>y?`${M} ${g}${Math.round(P*100)/100}${m}`:M,"getText"),B=x(M=>b==="outlined"?(M.layer??0)<_?{x:M.x0-6,anchor:"end"}:{x:M.x1+6,anchor:"start"}:M.x0$.selectAll(M?`.${M}`:"text").data(w.nodes).join("text").attr("class",M??null).attr("x",P=>B(P).x).attr("y",P=>(P.y1+P.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",P=>B(P).anchor).text(L),"appendLabel");b==="outlined"?(A("sankey-label-bg"),A("sankey-label-fg")):A();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(w.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),O=(a==null?void 0:a.linkColor)??"gradient";if(O==="gradient"){const M=I.append("linearGradient").attr("id",P=>(P.uid=hH.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",P=>P.source.x1).attr("x2",P=>P.target.x0);M.append("stop").attr("offset","0%").attr("stop-color",P=>D(P.source.id)),M.append("stop").attr("offset","100%").attr("stop-color",P=>D(P.target.id))}let N;switch(O){case"gradient":N=x(M=>M.uid,"coloring");break;case"source":N=x(M=>D(M.source.id),"coloring");break;case"target":N=x(M=>D(M.target.id),"coloring");break;default:N=O}I.append("path").attr("d",qlt()).attr("stroke",N).attr("stroke-width",M=>Math.max(1,M.width)),tv(void 0,u,0,f)},"draw"),nct={draw:rct},ict=x(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` `).trim(),"prepareTextForParsing"),act=x(t=>`.label { font-family: ${t.fontFamily}; } .node-labels { font-family: ${t.fontFamily}; } /* Outlined label style - background stroke for better readability */ .sankey-label-bg { stroke: ${t.mainBkg||t.background||"#fff"}; stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; } /* Foreground label text */ .sankey-label-fg { fill: ${t.textColor}; } /* Node styling */ .node rect { shape-rendering: crispEdges; } /* Link styling */ .link { fill: none; stroke-opacity: 0.5; mix-blend-mode: multiply; } `,"getStyles"),sct=act,oct=hS.parse.bind(hS);hS.parse=t=>oct(ict(t));var lct={styles:sct,parser:hS,db:Jlt,renderer:nct};const cct=Object.freeze(Object.defineProperty({__proto__:null,diagram:lct},Symbol.toStringTag,{value:"Module"}));var uct=pr.packet,n0,dye=(n0=class{constructor(){this.packet=[],this.setAccTitle=rn,this.getAccTitle=pn,this.setDiagramTitle=dn,this.getDiagramTitle=an,this.getAccDescription=mn,this.setAccDescription=gn}getConfig(){const e=fn({...uct,...It().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){Xr(),this.packet=[]}},x(n0,"PacketDB"),n0),hct=1e4,dct=x((t,e)=>{va(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),fye={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Rs("packet",t),r=(n=fye.parser)==null?void 0:n.yy;if(!(r instanceof dye))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");he.debug(e),dct(e,r)},"parse")},pct=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=Yi(e);m.attr("viewBox",`0 0 ${g} ${p}`),Rn(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())gct(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),gct=x((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),mct={draw:pct},yct={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},vct=x(({packet:t}={})=>{const e=fn(yct,t);return` .packetByte { font-size: ${e.byteFontSize}; } .packetByte.start { fill: ${e.startByteColor}; } .packetByte.end { fill: ${e.endByteColor}; } .packetLabel { fill: ${e.labelColor}; font-size: ${e.labelFontSize}; } .packetTitle { fill: ${e.titleColor}; font-size: ${e.titleFontSize}; } .packetBlock { stroke: ${e.blockStrokeColor}; stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } `},"styles"),xct={parser:fye,get db(){return new dye},renderer:mct,styles:vct};const bct=Object.freeze(Object.defineProperty({__proto__:null,diagram:xct},Symbol.toStringTag,{value:"Module"}));var Pf={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},I2=32,pye={axes:[],curves:[],options:Pf},Do=structuredClone(pye),Tct=pr.radar,Cct=x(()=>fn({...Tct,...It().radar}),"getConfig"),gye=x(()=>Do.axes,"getAxes"),wct=x(()=>Do.curves,"getCurves"),Ect=x(()=>Do.options,"getOptions"),Sct=x(t=>{Do.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),kct=x(t=>{Do.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:_ct(e.entries)}))},"setCurves"),_ct=x(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=gye();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),Act=x(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Do.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??Pf.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??Pf.ticks,max:((i=e.max)==null?void 0:i.value)??Pf.max,min:((a=e.min)==null?void 0:a.value)??Pf.min,graticule:((s=e.graticule)==null?void 0:s.value)??Pf.graticule},Do.options.ticks>I2&&(he.warn(`Radar diagram ticks (${Do.options.ticks}) exceeds maximum allowed (${I2}). Using ${I2} instead.`),Do.options.ticks=I2)},"setOptions"),Rct=x(()=>{Xr(),Do=structuredClone(pye)},"clear"),W1={getAxes:gye,getCurves:wct,getOptions:Ect,setAxes:Sct,setCurves:kct,setOptions:Act,getConfig:Cct,clear:Rct,setAccTitle:rn,getAccTitle:pn,setDiagramTitle:dn,getDiagramTitle:an,getAccDescription:mn,setAccDescription:gn},Lct=x(t=>{va(t,W1);const{axes:e,curves:r,options:n}=t;W1.setAxes(e),W1.setCurves(r),W1.setOptions(n)},"populate"),Ict={parse:x(async t=>{const e=await Rs("radar",t);he.debug(e),Lct(e)},"parse")},Dct=x((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=Yi(e),d=Mct(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;Nct(d,a,g,o.ticks,o.graticule),Oct(d,a,g,l),mye(d,a,s,p,f,o.graticule,l),xye(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),Mct=x((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return Rn(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),Nct=x((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),Oct=x((t,e,r,n)=>{const i=e.length;for(let a=0;a.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(s).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function mye(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=yye(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",vye(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}x(mye,"drawCurves");function yye(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}x(yye,"relativeRadius");function vye(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}x(xye,"drawLegend");var $ct={draw:Dct},Pct=x((t,e)=>{let r="";for(let n=0;n{const e=Kl(),r=It(),n=fn(e,r.themeVariables),i=fn(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),Fct=x(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=Bct(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; dominant-baseline: hanging; text-anchor: middle; } .radarAxisLine { stroke: ${r.axisColor}; stroke-width: ${r.axisStrokeWidth}; } .radarAxisLabel { font-size: ${r.axisLabelFontSize}px; color: ${r.axisColor}; } .radarGraticule { fill: ${r.graticuleColor}; fill-opacity: ${r.graticuleOpacity}; stroke: ${r.graticuleColor}; stroke-width: ${r.graticuleStrokeWidth}; } .radarLegendText { text-anchor: start; font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } ${Pct(e,r)} `},"styles"),zct={parser:Ict,db:W1,renderer:$ct,styles:Fct};const Gct=Object.freeze(Object.defineProperty({__proto__:null,diagram:zct},Symbol.toStringTag,{value:"Module"}));var TM=(function(){var t=x(function(b,C,w,S){for(w=w||{},S=b.length;S--;w[b[S]]=C);return w},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:x(function(C,w,S,E,_,R,D){var L=R.length-1;switch(_){case 4:E.getLogger().debug("Rule: separator (NL) ");break;case 5:E.getLogger().debug("Rule: separator (Space) ");break;case 6:E.getLogger().debug("Rule: separator (EOF) ");break;case 7:E.getLogger().debug("Rule: hierarchy: ",R[L-1]),E.setHierarchy(R[L-1]);break;case 8:E.getLogger().debug("Stop NL ");break;case 9:E.getLogger().debug("Stop EOF ");break;case 10:E.getLogger().debug("Stop NL2 ");break;case 11:E.getLogger().debug("Stop EOF2 ");break;case 12:E.getLogger().debug("Rule: statement: ",R[L]),typeof R[L].length=="number"?this.$=R[L]:this.$=[R[L]];break;case 13:E.getLogger().debug("Rule: statement #2: ",R[L-1]),this.$=[R[L-1]].concat(R[L]);break;case 14:E.getLogger().debug("Rule: link: ",R[L],C),this.$={edgeTypeStr:R[L],label:""};break;case 15:E.getLogger().debug("Rule: LABEL link: ",R[L-3],R[L-1],R[L]),this.$={edgeTypeStr:R[L],label:R[L-1]};break;case 18:const B=parseInt(R[L]),$=E.generateId();this.$={id:$,type:"space",label:"",width:B,children:[]};break;case 23:E.getLogger().debug("Rule: (nodeStatement link node) ",R[L-2],R[L-1],R[L]," typestr: ",R[L-1].edgeTypeStr);const A=E.edgeStrToEdgeData(R[L-1].edgeTypeStr),I=E.edgeStrToEdgeStartData(R[L-1].edgeTypeStr),O=E.edgeStrToThickness(R[L-1].edgeTypeStr),N=E.edgeStrToPattern(R[L-1].edgeTypeStr);this.$=[{id:R[L-2].id,label:R[L-2].label,type:R[L-2].type,directions:R[L-2].directions},{id:R[L-2].id+"-"+R[L].id,start:R[L-2].id,end:R[L].id,label:R[L-1].label,type:"edge",thickness:O,pattern:N,directions:R[L].directions,arrowTypeEnd:A,arrowTypeStart:I},{id:R[L].id,label:R[L].label,type:E.typeStr2Type(R[L].typeStr),directions:R[L].directions}];break;case 24:E.getLogger().debug("Rule: nodeStatement (abc88 node size) ",R[L-1],R[L]),this.$={id:R[L-1].id,label:R[L-1].label,type:E.typeStr2Type(R[L-1].typeStr),directions:R[L-1].directions,widthInColumns:parseInt(R[L],10)};break;case 25:E.getLogger().debug("Rule: nodeStatement (node) ",R[L]),this.$={id:R[L].id,label:R[L].label,type:E.typeStr2Type(R[L].typeStr),directions:R[L].directions,widthInColumns:1};break;case 26:E.getLogger().debug("APA123",this?this:"na"),E.getLogger().debug("COLUMNS: ",R[L]),this.$={type:"column-setting",columns:R[L]==="auto"?-1:parseInt(R[L])};break;case 27:E.getLogger().debug("Rule: id-block statement : ",R[L-2],R[L-1]),E.generateId(),this.$={...R[L-2],type:"composite",children:R[L-1]};break;case 28:E.getLogger().debug("Rule: blockStatement : ",R[L-2],R[L-1],R[L]);const M=E.generateId();this.$={id:M,type:"composite",label:"",children:R[L-1]};break;case 29:E.getLogger().debug("Rule: node (NODE_ID separator): ",R[L]),this.$={id:R[L]};break;case 30:E.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",R[L-1],R[L]),this.$={id:R[L-1],label:R[L].label,typeStr:R[L].typeStr,directions:R[L].directions};break;case 31:E.getLogger().debug("Rule: dirList: ",R[L]),this.$=[R[L]];break;case 32:E.getLogger().debug("Rule: dirList: ",R[L-1],R[L]),this.$=[R[L-1]].concat(R[L]);break;case 33:E.getLogger().debug("Rule: nodeShapeNLabel: ",R[L-2],R[L-1],R[L]),this.$={typeStr:R[L-2]+R[L],label:R[L-1]};break;case 34:E.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",R[L-3],R[L-2]," #3:",R[L-1],R[L]),this.$={typeStr:R[L-3]+R[L],label:R[L-2],directions:R[L-1]};break;case 35:case 36:this.$={type:"classDef",id:R[L-1].trim(),css:R[L].trim()};break;case 37:this.$={type:"applyClass",id:R[L-1].trim(),styleClass:R[L].trim()};break;case 38:this.$={type:"applyStyles",id:R[L-1].trim(),stylesStr:R[L].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:x(function(C,w){if(w.recoverable)this.trace(C);else{var S=new Error(C);throw S.hash=w,S}},"parseError"),parse:x(function(C){var w=this,S=[0],E=[],_=[null],R=[],D=this.table,L="",B=0,$=0,A=2,I=1,O=R.slice.call(arguments,1),N=Object.create(this.lexer),M={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(M.yy[P]=this.yy[P]);N.setInput(C,M.yy),M.yy.lexer=N,M.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var F=N.yylloc;R.push(F);var V=N.options&&N.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(le){S.length=S.length-2*le,_.length=_.length-le,R.length=R.length-le}x(z,"popStack");function W(){var le;return le=E.pop()||N.lex()||I,typeof le!="number"&&(le instanceof Array&&(E=le,le=E.pop()),le=w.symbols_[le]||le),le}x(W,"lex");for(var X,j,re,Q,oe={},ee,ne,ie,ae;;){if(j=S[S.length-1],this.defaultActions[j]?re=this.defaultActions[j]:((X===null||typeof X>"u")&&(X=W()),re=D[j]&&D[j][X]),typeof re>"u"||!re.length||!re[0]){var de="";ae=[];for(ee in D[j])this.terminals_[ee]&&ee>A&&ae.push("'"+this.terminals_[ee]+"'");N.showPosition?de="Parse error on line "+(B+1)+`: `+N.showPosition()+` Expecting `+ae.join(", ")+", got '"+(this.terminals_[X]||X)+"'":de="Parse error on line "+(B+1)+": Unexpected "+(X==I?"end of input":"'"+(this.terminals_[X]||X)+"'"),this.parseError(de,{text:N.match,token:this.terminals_[X]||X,line:N.yylineno,loc:F,expected:ae})}if(re[0]instanceof Array&&re.length>1)throw new Error("Parse Error: multiple actions possible at state: "+j+", token: "+X);switch(re[0]){case 1:S.push(X),_.push(N.yytext),R.push(N.yylloc),S.push(re[1]),X=null,$=N.yyleng,L=N.yytext,B=N.yylineno,F=N.yylloc;break;case 2:if(ne=this.productions_[re[1]][1],oe.$=_[_.length-ne],oe._$={first_line:R[R.length-(ne||1)].first_line,last_line:R[R.length-1].last_line,first_column:R[R.length-(ne||1)].first_column,last_column:R[R.length-1].last_column},V&&(oe._$.range=[R[R.length-(ne||1)].range[0],R[R.length-1].range[1]]),Q=this.performAction.apply(oe,[L,$,B,M.yy,re[1],_,R].concat(O)),typeof Q<"u")return Q;ne&&(S=S.slice(0,-1*ne*2),_=_.slice(0,-1*ne),R=R.slice(0,-1*ne)),S.push(this.productions_[re[1]][0]),_.push(oe.$),R.push(oe._$),ie=D[S[S.length-2]][S[S.length-1]],S.push(ie);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:x(function(w,S){if(this.yy.parser)this.yy.parser.parseError(w,S);else throw new Error(w)},"parseError"),setInput:x(function(C,w){return this.yy=w||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var w=C.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:x(function(C){var w=C.length,S=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var E=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===E.length?this.yylloc.first_column:0)+E[E.length-S.length].length-S[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(C){this.unput(this.match.slice(C))},"less"),pastInput:x(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var C=this.pastInput(),w=new Array(C.length+1).join("-");return C+this.upcomingInput()+` `+w+"^"},"showPosition"),test_match:x(function(C,w){var S,E,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),E=C[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],S=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var R in _)this[R]=_[R];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,w,S,E;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),R=0;R<_.length;R++)if(S=this._input.match(this.rules[_[R]]),S&&(!w||S[0].length>w[0].length)){if(w=S,E=R,this.options.backtrack_lexer){if(C=this.test_match(S,_[R]),C!==!1)return C;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(C=this.test_match(w,_[E]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var w=this.next();return w||this.lex()},"lex"),begin:x(function(w){this.conditionStack.push(w)},"begin"),popState:x(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:x(function(w){this.begin(w)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(w,S,E,_){switch(E){case 0:return w.getLogger().debug("Found block-beta"),10;case 1:return w.getLogger().debug("Found id-block"),29;case 2:return w.getLogger().debug("Found block"),10;case 3:w.getLogger().debug(".",S.yytext);break;case 4:w.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),w.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:w.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return w.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),w.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",w.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),w.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),w.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),w.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),w.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),w.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),w.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),w.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),w.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),w.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),w.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),w.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),w.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return w.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return w.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return w.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return w.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return w.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return w.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return w.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),w.getLogger().debug("LEX ARR START"),37;case 74:return w.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return w.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:w.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:w.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return w.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:w.getLogger().debug("LEX POPPING"),this.popState();break;case 84:w.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",w.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return w.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return w.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return w.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return w.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return w.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return w.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return w.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return w.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),w.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),w.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),w.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return w.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function T(){this.yy={}}return x(T,"Parser"),T.prototype=y,y.Parser=T,new T})();TM.parser=TM;var Vct=TM,to=new Map,cF=[],CM=new Map,dH="color",fH="fill",Wct="bgFill",bye=",",fS=new Map,uF="",qct=x(t=>yt.sanitizeText(t,Pe()),"sanitizeText"),Uct=x(function(t,e=""){let r=fS.get(t);r||(r={id:t,styles:[],textStyles:[]},fS.set(t,r)),e!=null&&e.split(bye).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(dH).exec(n)){const s=i.replace(fH,Wct).replace(dH,fH);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),Hct=x(function(t,e=""){const r=to.get(t);e!=null&&(r.styles=e.split(bye))},"addStyle2Node"),Yct=x(function(t,e){t.split(",").forEach(function(r){let n=to.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},to.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),Tye=x((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&he.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=qct(s.label)),s.type==="classDef"){Uct(s.id,s.css);continue}if(s.type==="applyClass"){Yct(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&Hct(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(CM.get(s.id)??0)+1;CM.set(s.id,o),s.id=o+"-"+s.id,cF.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=to.get(s.id);if(o===void 0?to.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&Tye(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{he.debug("Clear called"),Xr(),Cx={id:"root",type:"composite",children:[],columns:-1},to=new Map([["root",Cx]]),hF=[],fS=new Map,cF=[],CM=new Map,uF=""},"clear");function Cye(t){switch(he.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return he.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}x(Cye,"typeStr2Type");function wye(t){switch(he.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}x(wye,"edgeTypeStr2Type");function Eye(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}x(Eye,"edgeStrToEdgeData");function Sye(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}x(Sye,"edgeStrToEdgeStartData");function kye(t){return t.includes("==")?"thick":"normal"}x(kye,"edgeStrToThickness");function _ye(t){return t.includes(".-")?"dotted":"solid"}x(_ye,"edgeStrToPattern");var pH=0,jct=x(()=>(pH++,"id-"+Math.random().toString(36).substr(2,12)+"-"+pH),"generateId"),Kct=x(t=>{Cx.children=t,Tye(t,Cx),hF=Cx.children},"setHierarchy"),Zct=x(t=>{const e=to.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Qct=x(()=>[...to.values()],"getBlocksFlat"),Jct=x(()=>hF||[],"getBlocks"),eut=x(()=>cF,"getEdges"),tut=x(t=>to.get(t),"getBlock"),rut=x(t=>{to.set(t.id,t)},"setBlock"),nut=x(t=>{uF=t},"setDiagramId"),iut=x(()=>uF,"getDiagramId"),aut=x(()=>he,"getLogger"),sut=x(function(){return fS},"getClasses"),out={getConfig:x(()=>It().block,"getConfig"),typeStr2Type:Cye,edgeTypeStr2Type:wye,edgeStrToEdgeData:Eye,edgeStrToEdgeStartData:Sye,edgeStrToThickness:kye,edgeStrToPattern:_ye,getLogger:aut,getBlocksFlat:Qct,getBlocks:Jct,getEdges:eut,setHierarchy:Kct,getBlock:tut,setBlock:rut,getColumns:Zct,getClasses:sut,clear:Xct,generateId:jct,setDiagramId:nut,getDiagramId:iut},lut=out,OI=x((t,e)=>{const r=VM,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Hs(n,i,a,e)},"fade"),cut=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } .cluster-label text { fill: ${t.titleColor}; } .cluster-label span { color: ${t.titleColor}; } .label text,span { fill: ${t.nodeTextColor||t.textColor}; color: ${t.nodeTextColor||t.textColor}; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: 1px; } .flowchart-label text { text-anchor: middle; } // .flowchart-label .text-outer-tspan { // text-anchor: middle; // } // .flowchart-label .text-inner-tspan { // text-anchor: start; // } .node .label { text-align: center; } .node.clickable { cursor: pointer; } .arrowheadPath { fill: ${t.arrowheadColor}; } .edgePaths .path { stroke: ${t.lineColor}; stroke-width: 2.0px; } .flowchart-link { stroke: ${t.lineColor}; fill: none; } .edgeLabel { background-color: ${t.edgeLabelBackground}; /* * This is for backward compatibility with existing code that didn't * add a \`

    \` around edge labels. * * TODO: We should probably remove this in a future release. */ p { margin: 0; padding: 0; display: inline; } rect { opacity: 0.5; background-color: ${t.edgeLabelBackground}; fill: ${t.edgeLabelBackground}; } text-align: center; } /* For html labels only */ .labelBkg { background-color: ${t.edgeLabelBackground}; } .node .cluster { // fill: ${OI(t.mainBkg,.5)}; fill: ${OI(t.clusterBkg,.5)}; stroke: ${OI(t.clusterBorder,.2)}; box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; stroke-width: 1px; } .cluster text { fill: ${t.titleColor}; } .cluster span { color: ${t.titleColor}; } /* .cluster div { color: ${t.titleColor}; } */ div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${t.fontFamily}; font-size: 12px; background: ${t.tertiaryColor}; border: 1px solid ${t.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } .flowchartTitleText { text-anchor: middle; font-size: 18px; fill: ${t.textColor}; } ${eT()} `,"getStyles"),uut=cut;function wM(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(wM,"calculateBlockPosition");var hut=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(he.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function pS(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;he.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let a=0,s=0;if(((u=t.children)==null?void 0:u.length)>0){for(const R of t.children)pS(R,e,0,0,i);const T=hut(t);a=T.width,s=T.height,he.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const R of t.children)R.size&&(he.debug(`abc95 Setting size of children of ${t.id} id=${R.id} ${a} ${s} ${JSON.stringify(R.size)}`),R.size.width=a*(R.widthInColumns??1)+i*((R.widthInColumns??1)-1),R.size.height=s,R.size.x=0,R.size.y=0,he.debug(`abc95 updating size of ${t.id} children child:${R.id} maxWidth:${a} maxHeight:${s}`));for(const R of t.children)pS(R,e,a,s,i);const b=t.columns??-1;let C=0;for(const R of t.children)C+=R.widthInColumns??1;let w=t.children.length;b>0&&b0?Math.min(t.children.length,b):t.children.length;if(R>0){const D=(E-R*i-i)/R;he.debug("abc95 (growing to fit) width",t.id,E,(p=t.size)==null?void 0:p.width,D);for(const L of t.children)L.size&&(L.size.width=D)}}t.size={width:E,height:_,x:0,y:0}}he.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(y=t==null?void 0:t.size)==null?void 0:y.y,(v=t==null?void 0:t.size)==null?void 0:v.height)}x(pS,"setBlockSizes");function dF(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,C;he.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(a=t==null?void 0:t.size)==null?void 0:a.y} width: ${(s=t==null?void 0:t.size)==null?void 0:s.width}`);const n=t.columns??-1;if(he.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const w=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*w+(t.children.length-1)*r;he.debug("widthOfChildren 88",S,"posX");const E=new Map;{let B=0;for(const $ of t.children){if(!$.size)continue;const{py:A}=wM(n,B),I=E.get(A)??0;$.size.height>I&&E.set(A,$.size.height);let O=($==null?void 0:$.widthInColumns)??1;n>0&&(O=Math.min(O,n-B%n)),B+=O}}const _=new Map;{let B=0;const $=[...E.keys()].sort((A,I)=>A-I);for(const A of $)_.set(A,B),B+=(E.get(A)??0)+r}let R=0;he.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let D=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,L=0;for(const B of t.children){const $=t;if(!B.size)continue;const{width:A,height:I}=B.size,{px:O,py:N}=wM(n,R);if(N!=L&&(L=N,D=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,he.debug("New row in layout for block",t.id," and child ",B.id,L)),he.debug(`abc89 layout blocks (child) id: ${B.id} Pos: ${R} (px, py) ${O},${N} (${(y=$==null?void 0:$.size)==null?void 0:y.x},${(v=$==null?void 0:$.size)==null?void 0:v.y}) parent: ${$.id} width: ${A}${r}`),$.size){const P=A/2;B.size.x=D+r+P,he.debug(`abc91 layout blocks (calc) px, pyid:${B.id} startingPos=X${D} new startingPosX${B.size.x} ${P} padding=${r} width=${A} halfWidth=${P} => x:${B.size.x} y:${B.size.y} ${B.widthInColumns} (width * (child?.w || 1)) / 2 ${A*((B==null?void 0:B.widthInColumns)??1)/2}`),D=B.size.x+P;const F=_.get(N)??0,V=E.get(N)??I;B.size.y=$.size.y-$.size.height/2+F+V/2+r,he.debug(`abc88 layout blocks (calc) px, pyid:${B.id}startingPosX${D}${r}${P}=>x:${B.size.x}y:${B.size.y}${B.widthInColumns}(width * (child?.w || 1)) / 2${A*((B==null?void 0:B.widthInColumns)??1)/2}`)}B.children&&dF(B,e,r);let M=(B==null?void 0:B.widthInColumns)??1;n>0&&(M=Math.min(M,n-R%n)),R+=M,he.debug("abc88 columnsPos",B,R)}}he.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(T=t==null?void 0:t.size)==null?void 0:T.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(C=t==null?void 0:t.size)==null?void 0:C.width}`)}x(dF,"layoutBlocks");function fF(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=fF(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(fF,"findBounds");function Aye(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Pe())==null?void 0:u.block)==null?void 0:h.padding)??8;pS(e,t,0,0,r),dF(e,t,r),he.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=fF(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}x(Aye,"layout");function pF(t,e,r=!1){var g,m,y;const n=t;let i="default";(((g=n==null?void 0:n.classes)==null?void 0:g.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";const a=((n==null?void 0:n.classes)??[]).flatMap(v=>{var T;return((T=e.getClasses().get(v))==null?void 0:T.styles)??[]});let s=0,o="rect",l;switch(n.type){case"round":s=5,o="rect";break;case"composite":s=0,o="composite",l=0;break;case"square":o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"rect_left_inv_arrow":o="rect_left_inv_arrow";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"group":o="rect";break;case"doublecircle":o="doublecircle";break;default:o="rect"}const u=SN((n==null?void 0:n.styles)??[]),h=n.label,d=n.size??{width:0,height:0,x:0,y:0},f=e.getDiagramId();return{labelStyle:u.labelStyle,shape:o,label:h,labelText:h,rx:s,ry:s,class:i,cssClasses:i,cssStyles:(n==null?void 0:n.styles)??[],cssCompiledStyles:a,style:u.style,id:n.id,domId:f?`${f}-${n.id}`:n.id,isGroup:!1,directions:n.directions,width:d.width||void 0,height:d.height||void 0,wrappingWidth:d.width||Number.POSITIVE_INFINITY,x:d.x,y:d.y,positioned:r,intersect:void 0,padding:l??((y=(m=It())==null?void 0:m.block)==null?void 0:y.padding)??0,widthInColumns:n.widthInColumns??1}}x(pF,"getNodeFromBlock");async function Rye(t,e,r){var l;const n=pF(e,r,!1);if(e.type==="group")return;const i=It(),a=await av(t,n,{config:i}),s=((l=a.node())==null?void 0:l.getBBox())??{width:0,height:0},o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}x(Rye,"calculateBlockSize");async function Lye(t,e,r){const n=pF(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=It();await av(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,v0(n)}}x(Lye,"insertBlockPositioned");async function Z_(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await Z_(t,i.children,r,n)}x(Z_,"performOperations");async function Iye(t,e,r){await Z_(t,e,r,Rye)}x(Iye,"calculateBlockSizes");async function Dye(t,e,r){await Z_(t,e,r,Lye)}x(Dye,"insertBlocks");async function Mye(t,e,r,n,i){const a=new ma({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;BS(t,{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},{},"block",a.node(s.start),a.node(s.end),i),s.label&&(await b0(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),UN({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(Mye,"insertEdges");var dut=x(function(t,e){return e.db.getClasses()},"getClasses"),fut=x(async function(t,e,r,n){var T;const{securityLevel:i,block:a}=It(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=ft("#i"+e));const l=ft(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):ft(`[id="${e}"]`);HN(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await Iye(g,d,s);const m=Aye(s);await Dye(g,d,s),await Mye(g,p,f,s,e);const y=(T=g.node())==null?void 0:T.getBBox(),v=y&&Number.isFinite(y.width)&&Number.isFinite(y.height)?y:m;if(v){const b=Math.max(1,Math.round(.125*(v.width/v.height))),C=v.height+b+10,w=v.width+10,{useMaxWidth:S}=a;Rn(u,C,w,!!S),he.debug("Here Bounds",m,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),put={draw:fut,getClasses:dut},gut={parser:Vct,db:lut,renderer:put,styles:uut};const mut=Object.freeze(Object.defineProperty({__proto__:null,diagram:gut},Symbol.toStringTag,{value:"Module"}));var Nye=/[─━│┃└┗├┣]/,Oye=/[└┗├┣]/,yut=/[─━]/,gH=/^[\s│┃]+$/,mH=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,yH=/^\s*%%/,vut=" ";function $ye(t){return t.some(e=>Nye.test(e))}x($ye,"isBoxDrawingFormat");function Pye(t){for(const e of t){const r=Oye.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}x(Pye,"inferSegmentWidth");function Bye(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),a=e.get(i);return a?`line ${a}`:r})}x(Bye,"remapErrorLines");function Fye(t){const e=t.split(` `),r=new Map;let n=-1;for(const[l,u]of e.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:t,lineMap:r};const i=[];for(let l=n+1;l({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),xut=x(()=>{So.reset(),Xr()},"clear"),but=x(()=>So.records.stack[0],"getRoot"),Tut=x(()=>So.records.cnt,"getCount"),Cut=pr.treeView,wut=x(()=>fn(Cut,It().treeView),"getConfig"),Eut=x((t,e,r,n,i,a)=>{for(;t<=So.records.stack[So.records.stack.length-1].level;)So.records.stack.pop();const s={id:So.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};So.records.stack[So.records.stack.length-1].children.push(s),So.records.stack.push(s)},"addNode"),Sut={clear:xut,addNode:Eut,getRoot:but,getCount:Tut,getConfig:wut,getAccTitle:pn,getAccDescription:mn,getDiagramTitle:an,setAccDescription:gn,setAccTitle:rn,setDiagramTitle:dn},EM=Sut,kut=x(t=>{va(t,EM);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const a=i?"directory":"file",s=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?xr(u,It()):void 0;EM.addNode(r,n,a,s,l,h)}},"populate"),_ut={parse:x(async t=>{const{text:e,lineMap:r}=Fye(t);try{const n=await Rs("treeView",e);he.debug(n),kut(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=Bye(n.message,r)),n}},"parse")},wb={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function zye(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const a=t.substring(n).toLowerCase(),s=e==null?void 0:e.extensionIcons;return(s==null?void 0:s[a])??(s==null?void 0:s[a.slice(1)])}}x(zye,"detectIcon");function SM(t,e){return t.includes(":")?t:t in wb.icons||!e?`${wb.prefix}:${t}`:`${e}:${t}`}x(SM,"qualifyIcon");function gF(t,e){if(t.icon!=="none"){if(t.icon)return SM(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=zye(t.name,e);if(r==="none")return;if(r)return SM(r,e.defaultIconPack)}return`${wb.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}x(gF,"getNodeIcon");gN([{name:wb.prefix,icons:wb}]);var kM=14,Aut=4,Rut=16,Lut=x(async(t,e)=>{const r=[],n=x(a=>{const s=gF(a,e);s&&r.push({icon:s,node:a}),a.children.forEach(n)},"collect");n(t);const i=await Promise.all(r.map(async({icon:a,node:s})=>({id:s.id,svg:await $l(a,{height:kM,width:kM})})));return new Map(i.map(({id:a,svg:s})=>[a,s]))},"resolveNodeIcons"),Iut=x((t,e,r,n,i,a)=>{var T;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=kM+Aut,u=gF(r,i),h=u!==void 0;u&&s.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${t+i.paddingX}, ${e+i.paddingY})`).html(a.get(r.id)??"");const d=s.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const y=m+p,v=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:v,height:g},(T=r.cssClass)!=null&&T.split(/\s+/).includes("highlight")&&s.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:s,labelRightEdge:y,centerY:e+g/2}},"positionLabel"),vH=x((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),Dut=x((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=x((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=Iut(m,i,f,d,p,n);s.push(y);const{height:v,width:T}=f.BBox;vH(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),a=Math.max(a,m+T),i+=v},"drawNode"),l=x((d,f=0)=>{o(t,d,r,f),d.children.forEach(y=>{l(y,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y,height:v}=d.children[d.children.length-1].BBox;vH(t,p+r.paddingX,g+m,p+r.paddingX,y+v/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=s.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...s.map(p=>p.labelRightEdge))+Rut;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();a=Math.max(a,f+m.width+r.paddingX)}}for(const d of s)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=a-d.node.BBox.x+8;f.attr("width",p),a=Math.max(a,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),Mut=x(async(t,e,r,n)=>{he.debug(`Rendering treeView diagram `+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=Yi(e),l=o.append("g");l.attr("class","tree-view");const u=await Lut(a,s),{totalHeight:h,totalWidth:d}=Dut(l,a,s,u);o.attr("viewBox",`-${s.lineThickness/2} 0 ${d} ${h}`),Rn(o,h,d,s.useMaxWidth)},"draw"),Nut={draw:Mut},Out=Nut,$ut={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Put=x(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=fn($ut,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; white-space: pre; } .treeView-node-dir { font-weight: bold; } .treeView-node-line { stroke: ${n}; } .treeView-node-icon { color: ${i}; } .treeView-node-description { font-size: ${e}; fill: ${a}; font-style: italic; white-space: pre; } .treeView-highlight-bg { fill: ${s}; stroke: ${o}; stroke-width: 1; } `},"styles"),But=Put,Fut={db:EM,renderer:Out,parser:_ut,styles:But};const zut=Object.freeze(Object.defineProperty({__proto__:null,diagram:Fut},Symbol.toStringTag,{value:"Module"}));var YC={exports:{}},XC={exports:{}},jC={exports:{}},Gut=jC.exports,xH;function Vut(){return xH||(xH=1,(function(t,e){(function(n,i){t.exports=i()})(Gut,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var C=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(C.source=v,C.target=T,C.isInterGraph=!1,this.getEdges().push(C),v.edges.push(C),T!=v&&T.edges.push(C),C)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,C=T.length,w=0;w-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(E,1),b.target!=b.source&&b.target.edges.splice(_,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,C,w=this.getNodes(),S=w.length,E=0;ET&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(w[0].getParent().paddingLeft!=null?C=w[0].getParent().paddingLeft:C=this.margin,this.left=v-C,this.top=y-C,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,C=-s.MAX_VALUE,w,S,E,_,R,D=this.nodes,L=D.length,B=0;Bw&&(v=w),TE&&(b=E),C<_&&(C=_)}var A=new d(v,b,T-v,C-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),D[0].getParent().paddingLeft!=null?R=D[0].getParent().paddingLeft:R=this.margin,this.left=A.x-R,this.right=A.x+A.width+R,this.top=A.y-R,this.bottom=A.y+A.height+R},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,C=-s.MAX_VALUE,w,S,E,_,R=y.length,D=0;Dw&&(v=w),TE&&(b=E),C<_&&(C=_)}var B=new d(v,b,T-v,C-b);return B},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,T=v.length,b=0;b=this.nodes.length){var L=0;T.forEach(function(B){B.owner==y&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=D,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,A=!0):(u[0]=y,u[1]=m,A=!0):O===M&&(h>f?(u[0]=g,u[1]=m,A=!0):(u[0]=b,u[1]=T,A=!0)),-N===M?f>h?(u[2]=R,u[3]=D,I=!0):(u[2]=_,u[3]=E,I=!0):N===M&&(f>h?(u[2]=S,u[3]=E,I=!0):(u[2]=L,u[3]=D,I=!0)),A&&I)return!1;if(h>f?d>p?(P=this.getCardinalDirection(O,M,4),F=this.getCardinalDirection(N,M,2)):(P=this.getCardinalDirection(-O,M,3),F=this.getCardinalDirection(-N,M,1)):d>p?(P=this.getCardinalDirection(-O,M,1),F=this.getCardinalDirection(-N,M,3)):(P=this.getCardinalDirection(O,M,2),F=this.getCardinalDirection(N,M,4)),!A)switch(P){case 1:z=m,V=h+-w/M,u[0]=V,u[1]=z;break;case 2:V=b,z=d+C*M,u[0]=V,u[1]=z;break;case 3:z=T,V=h+w/M,u[0]=V,u[1]=z;break;case 4:V=v,z=d+-C*M,u[0]=V,u[1]=z;break}if(!I)switch(F){case 1:X=E,W=f+-$/M,u[2]=W,u[3]=X;break;case 2:W=L,X=p+B*M,u[2]=W,u[3]=X;break;case 3:X=D,W=f+$/M,u[2]=W,u[3]=X;break;case 4:W=R,X=p+-B*M,u[2]=W,u[3]=X;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,C=void 0,w=void 0,S=void 0,E=void 0,_=void 0,R=void 0,D=void 0,L=void 0;return w=g-f,E=d-p,R=p*f-d*g,S=T-y,_=m-v,D=v*y-m*T,L=w*_-S*E,L===0?null:(b=(E*D-_*R)/L,C=(S*R-w*D)/L,new a(b,C))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var T=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),C=null;return T>=0&&T<=1?[T]:b>=0&&b<=1?[b]:C}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(w.push(E[0]);w.length>0&&y;){var _=w[0];w.splice(0,1),C.add(_);for(var R=_.getEdges(),b=0;b-1&&E.splice($,1)}C=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(D,1);var L=S.getNeighborsList();L.forEach(function(A){if(v.indexOf(A)<0){var I=T.get(A),O=I-1;O==1&&_.push(A),T.set(A,O)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,C=y[0])}return C},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),C;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),C=new Set,m=0;mw||C>w)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(w=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>w||C>w)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||w>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(ot){for(var Ke=[];ot-- >0;)Ke.push(0);return Ke})(Math.min(this.m+1,this.n)),this.U=(function(ot){var Ke=function me(dt){if(dt.length==0)return 0;for(var at=[],et=0;et0;)Ke.push(0);return Ke})(this.n),u=(function(ot){for(var Ke=[];ot-- >0;)Ke.push(0);return Ke})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;N--)if(this.s[N]!==0){for(var M=N+1;M=0;j--){if((function(ot,Ke){return ot&&Ke})(j0;){var le=void 0,ye=void 0;for(le=A-2;le>=-1&&le!==-1;le--)if(Math.abs(l[le])<=de+ae*(Math.abs(this.s[le])+Math.abs(this.s[le+1]))){l[le]=0;break}if(le===A-2)ye=4;else{var $e=void 0;for($e=A-1;$e>=le&&$e!==le;$e--){var Fe=($e!==A?Math.abs(l[$e]):0)+($e!==le+1?Math.abs(l[$e-1]):0);if(Math.abs(this.s[$e])<=de+ae*Fe){this.s[$e]=0;break}}$e===le?ye=3:$e===A-1?ye=1:(ye=2,le=$e)}switch(le++,ye){case 1:{var ce=l[A-2];l[A-2]=0;for(var ve=A-2;ve>=le;ve--){var Ce=a.hypot(this.s[ve],ce),Ne=this.s[ve]/Ce,Ie=ce/Ce;this.s[ve]=Ce,ve!==le&&(ce=-Ie*l[ve-1],l[ve-1]=Ne*l[ve-1]);for(var Ae=0;Ae=this.s[le+1]);){var Qe=this.s[le];if(this.s[le]=this.s[le+1],this.s[le+1]=Qe,leMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,T=u(551).LayoutConstants,b=u(551).Point,C=u(551).PointD,w=u(551).DimensionD,S=u(551).Layout,E=u(551).Integer,_=u(551).IGeometry,R=u(551).LGraph,D=u(551).Transform,L=u(551).LinkedList;function B(){h.call(this),this.toBeTiled={},this.constraints={}}B.prototype=Object.create(h.prototype);for(var $ in h)B[$]=h[$];B.prototype.newGraphManager=function(){var A=new d(this);return this.graphManager=A,A},B.prototype.newGraph=function(A){return new f(null,this.graphManager,A)},B.prototype.newNode=function(A){return new p(this.graphManager,A)},B.prototype.newEdge=function(A){return new g(null,null,A)},B.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},B.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},B.prototype.layout=function(){var A=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return A&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},B.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(P){return I.has(P)});this.graphManager.setAllNodesToApplyGravitation(O)}}else{var A=this.getFlatForest();if(A.length>0)this.positionNodesRadially(A);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(N){return I.has(N)});this.graphManager.setAllNodesToApplyGravitation(O),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},B.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(M){return A.has(M)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var O=!this.isTreeGrowing&&!this.isGrowthFinished,N=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(O,N),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},B.prototype.getPositionsData=function(){for(var A=this.graphManager.getAllNodes(),I={},O=0;O0&&this.updateDisplacements();for(var O=0;O0&&(N.fixedNodeWeight=P)}}if(this.constraints.relativePlacementConstraint){var F=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(ee){A.fixedNodesOnHorizontal.add(ee),A.fixedNodesOnVertical.add(ee)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var z=this.constraints.alignmentConstraint.vertical,O=0;O=2*ee.length/3;ae--)ne=Math.floor(Math.random()*(ae+1)),ie=ee[ae],ee[ae]=ee[ne],ee[ne]=ie;return ee},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(ee){if(ee.left){var ne=F.has(ee.left)?F.get(ee.left):ee.left,ie=F.has(ee.right)?F.get(ee.right):ee.right;A.nodesInRelativeHorizontal.includes(ne)||(A.nodesInRelativeHorizontal.push(ne),A.nodeToRelativeConstraintMapHorizontal.set(ne,[]),A.dummyToNodeForVerticalAlignment.has(ne)?A.nodeToTempPositionMapHorizontal.set(ne,A.idToNodeMap.get(A.dummyToNodeForVerticalAlignment.get(ne)[0]).getCenterX()):A.nodeToTempPositionMapHorizontal.set(ne,A.idToNodeMap.get(ne).getCenterX())),A.nodesInRelativeHorizontal.includes(ie)||(A.nodesInRelativeHorizontal.push(ie),A.nodeToRelativeConstraintMapHorizontal.set(ie,[]),A.dummyToNodeForVerticalAlignment.has(ie)?A.nodeToTempPositionMapHorizontal.set(ie,A.idToNodeMap.get(A.dummyToNodeForVerticalAlignment.get(ie)[0]).getCenterX()):A.nodeToTempPositionMapHorizontal.set(ie,A.idToNodeMap.get(ie).getCenterX())),A.nodeToRelativeConstraintMapHorizontal.get(ne).push({right:ie,gap:ee.gap}),A.nodeToRelativeConstraintMapHorizontal.get(ie).push({left:ne,gap:ee.gap})}else{var ae=V.has(ee.top)?V.get(ee.top):ee.top,de=V.has(ee.bottom)?V.get(ee.bottom):ee.bottom;A.nodesInRelativeVertical.includes(ae)||(A.nodesInRelativeVertical.push(ae),A.nodeToRelativeConstraintMapVertical.set(ae,[]),A.dummyToNodeForHorizontalAlignment.has(ae)?A.nodeToTempPositionMapVertical.set(ae,A.idToNodeMap.get(A.dummyToNodeForHorizontalAlignment.get(ae)[0]).getCenterY()):A.nodeToTempPositionMapVertical.set(ae,A.idToNodeMap.get(ae).getCenterY())),A.nodesInRelativeVertical.includes(de)||(A.nodesInRelativeVertical.push(de),A.nodeToRelativeConstraintMapVertical.set(de,[]),A.dummyToNodeForHorizontalAlignment.has(de)?A.nodeToTempPositionMapVertical.set(de,A.idToNodeMap.get(A.dummyToNodeForHorizontalAlignment.get(de)[0]).getCenterY()):A.nodeToTempPositionMapVertical.set(de,A.idToNodeMap.get(de).getCenterY())),A.nodeToRelativeConstraintMapVertical.get(ae).push({bottom:de,gap:ee.gap}),A.nodeToRelativeConstraintMapVertical.get(de).push({top:ae,gap:ee.gap})}});else{var X=new Map,j=new Map;this.constraints.relativePlacementConstraint.forEach(function(ee){if(ee.left){var ne=F.has(ee.left)?F.get(ee.left):ee.left,ie=F.has(ee.right)?F.get(ee.right):ee.right;X.has(ne)?X.get(ne).push(ie):X.set(ne,[ie]),X.has(ie)?X.get(ie).push(ne):X.set(ie,[ne])}else{var ae=V.has(ee.top)?V.get(ee.top):ee.top,de=V.has(ee.bottom)?V.get(ee.bottom):ee.bottom;j.has(ae)?j.get(ae).push(de):j.set(ae,[de]),j.has(de)?j.get(de).push(ae):j.set(de,[ae])}});var re=function(ne,ie){var ae=[],de=[],le=new L,ye=new Set,$e=0;return ne.forEach(function(Fe,ce){if(!ye.has(ce)){ae[$e]=[],de[$e]=!1;var ve=ce;for(le.push(ve),ye.add(ve),ae[$e].push(ve);le.length!=0;){ve=le.shift(),ie.has(ve)&&(de[$e]=!0);var Ce=ne.get(ve);Ce.forEach(function(Ne){ye.has(Ne)||(le.push(Ne),ye.add(Ne),ae[$e].push(Ne))})}$e++}}),{components:ae,isFixed:de}},Q=re(X,A.fixedNodesOnHorizontal);this.componentsOnHorizontal=Q.components,this.fixedComponentsOnHorizontal=Q.isFixed;var oe=re(j,A.fixedNodesOnVertical);this.componentsOnVertical=oe.components,this.fixedComponentsOnVertical=oe.isFixed}}},B.prototype.updateDisplacements=function(){var A=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(oe){var ee=A.idToNodeMap.get(oe.nodeId);ee.displacementX=0,ee.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,O=0;O1){var V;for(V=0;VN&&(N=Math.floor(F.y)),P=Math.floor(F.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new C(T.WORLD_CENTER_X-F.x/2,T.WORLD_CENTER_Y-F.y/2))},B.radialLayout=function(A,I,O){var N=Math.max(this.maxDiagonalInTree(A),m.DEFAULT_RADIAL_SEPARATION);B.branchRadialLayout(I,null,0,359,0,N);var M=R.calculateBounds(A),P=new D;P.setDeviceOrgX(M.getMinX()),P.setDeviceOrgY(M.getMinY()),P.setWorldOrgX(O.x),P.setWorldOrgY(O.y);for(var F=0;F1;){var ie=ne[0];ne.splice(0,1);var ae=j.indexOf(ie);ae>=0&&j.splice(ae,1),oe--,re--}I!=null?ee=(j.indexOf(ne[0])+1)%oe:ee=0;for(var de=Math.abs(N-O)/re,le=ee;Q!=re;le=++le%oe){var ye=j[le].getOtherEnd(A);if(ye!=I){var $e=(O+Q*de)%360,Fe=($e+de)%360;B.branchRadialLayout(ye,A,$e,Fe,M+P,P),Q++}}},B.maxDiagonalInTree=function(A){for(var I=E.MIN_VALUE,O=0;OI&&(I=M)}return I},B.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},B.prototype.groupZeroDegreeMembers=function(){var A=this,I={};this.memberGroups={},this.idToDummyNode={};for(var O=[],N=this.graphManager.getAllNodes(),M=0;M"u"&&(I[V]=[]),I[V]=I[V].concat(P)}Object.keys(I).forEach(function(z){if(I[z].length>1){var W="DummyCompound_"+z;A.memberGroups[W]=I[z];var X=I[z][0].getParent(),j=new p(A.graphManager);j.id=W,j.paddingLeft=X.paddingLeft||0,j.paddingRight=X.paddingRight||0,j.paddingBottom=X.paddingBottom||0,j.paddingTop=X.paddingTop||0,A.idToDummyNode[W]=j;var re=A.getGraphManager().add(A.newGraph(),j),Q=X.getChild();Q.add(j);for(var oe=0;oeM?(N.rect.x-=(N.labelWidth-M)/2,N.setWidth(N.labelWidth),N.labelMarginLeft=(N.labelWidth-M)/2):N.labelPosHorizontal=="right"&&N.setWidth(M+N.labelWidth)),N.labelHeight&&(N.labelPosVertical=="top"?(N.rect.y-=N.labelHeight,N.setHeight(P+N.labelHeight),N.labelMarginTop=N.labelHeight):N.labelPosVertical=="center"&&N.labelHeight>P?(N.rect.y-=(N.labelHeight-P)/2,N.setHeight(N.labelHeight),N.labelMarginTop=(N.labelHeight-P)/2):N.labelPosVertical=="bottom"&&N.setHeight(P+N.labelHeight))}})},B.prototype.repopulateCompounds=function(){for(var A=this.compoundOrder.length-1;A>=0;A--){var I=this.compoundOrder[A],O=I.id,N=I.paddingLeft,M=I.paddingTop,P=I.labelMarginLeft,F=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[O],I.rect.x,I.rect.y,N,M,P,F)}},B.prototype.repopulateZeroDegreeMembers=function(){var A=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function(O){var N=A.idToDummyNode[O],M=N.paddingLeft,P=N.paddingTop,F=N.labelMarginLeft,V=N.labelMarginTop;A.adjustLocations(I[O],N.rect.x,N.rect.y,M,P,F,V)})},B.prototype.getToBeTiled=function(A){var I=A.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var O=A.getChild();if(O==null)return this.toBeTiled[I]=!1,!1;for(var N=O.getNodes(),M=0;M0)return this.toBeTiled[I]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},B.prototype.getNodeDegree=function(A){A.id;for(var I=A.getEdges(),O=0,N=0;NX&&(X=re.rect.height)}O+=X+A.verticalPadding}},B.prototype.tileCompoundMembers=function(A,I){var O=this;this.tiledMemberPack=[],Object.keys(A).forEach(function(N){var M=I[N];if(O.tiledMemberPack[N]=O.tileNodes(A[N],M.paddingLeft+M.paddingRight),M.rect.width=O.tiledMemberPack[N].width,M.rect.height=O.tiledMemberPack[N].height,M.setCenter(O.tiledMemberPack[N].centerX,O.tiledMemberPack[N].centerY),M.labelMarginLeft=0,M.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var P=M.rect.width,F=M.rect.height;M.labelWidth&&(M.labelPosHorizontal=="left"?(M.rect.x-=M.labelWidth,M.setWidth(P+M.labelWidth),M.labelMarginLeft=M.labelWidth):M.labelPosHorizontal=="center"&&M.labelWidth>P?(M.rect.x-=(M.labelWidth-P)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-P)/2):M.labelPosHorizontal=="right"&&M.setWidth(P+M.labelWidth)),M.labelHeight&&(M.labelPosVertical=="top"?(M.rect.y-=M.labelHeight,M.setHeight(F+M.labelHeight),M.labelMarginTop=M.labelHeight):M.labelPosVertical=="center"&&M.labelHeight>F?(M.rect.y-=(M.labelHeight-F)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-F)/2):M.labelPosVertical=="bottom"&&M.setHeight(F+M.labelHeight))}})},B.prototype.tileNodes=function(A,I){var O=this.tileNodesByFavoringDim(A,I,!0),N=this.tileNodesByFavoringDim(A,I,!1),M=this.getOrgRatio(O),P=this.getOrgRatio(N),F;return PV&&(V=oe.getWidth())});var z=P/M,W=F/M,X=Math.pow(O-N,2)+4*(z+N)*(W+O)*M,j=(N-O+Math.sqrt(X))/(2*(z+N)),re;I?(re=Math.ceil(j),re==j&&re++):re=Math.floor(j);var Q=re*(z+N)-N;return V>Q&&(Q=V),Q+=N*2,Q},B.prototype.tileNodesByFavoringDim=function(A,I,O){var N=m.TILING_PADDING_VERTICAL,M=m.TILING_PADDING_HORIZONTAL,P=m.TILING_COMPARE_BY,F={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:N,horizontalPadding:M,centerX:0,centerY:0};P&&(F.idealRowWidth=this.calcIdealRowWidth(A,O));var V=function(ee){return ee.rect.width*ee.rect.height},z=function(ee,ne){return V(ne)-V(ee)};A.sort(function(oe,ee){var ne=z;return F.idealRowWidth?(ne=P,ne(oe.id,ee.id)):ne(oe,ee)});for(var W=0,X=0,j=0;j0&&(F+=A.horizontalPadding),A.rowWidth[O]=F,A.width0&&(V+=A.verticalPadding);var z=0;V>A.rowHeight[O]&&(z=A.rowHeight[O],A.rowHeight[O]=V,z=A.rowHeight[O]-z),A.height+=z,A.rows[O].push(I)},B.prototype.getShortestRowIndex=function(A){for(var I=-1,O=Number.MAX_VALUE,N=0;NO&&(I=N,O=A.rowWidth[N]);return I},B.prototype.canAddHorizontal=function(A,I,O){if(A.idealRowWidth){var N=A.rows.length-1,M=A.rowWidth[N];return M+I+A.horizontalPadding<=A.idealRowWidth}var P=this.getShortestRowIndex(A);if(P<0)return!0;var F=A.rowWidth[P];if(F+A.horizontalPadding+I<=A.width)return!0;var V=0;A.rowHeight[P]0&&(V=O+A.verticalPadding-A.rowHeight[P]);var z;A.width-F>=I+A.horizontalPadding?z=(A.height+V)/(F+I+A.horizontalPadding):z=(A.height+V)/A.width,V=O+A.verticalPadding;var W;return A.widthP&&I!=O){N.splice(-1,1),A.rows[O].push(M),A.rowWidth[I]=A.rowWidth[I]-P,A.rowWidth[O]=A.rowWidth[O]+P,A.width=A.rowWidth[instance.getLongestRowIndex(A)];for(var F=Number.MIN_VALUE,V=0;VF&&(F=N[V].height);I>0&&(F+=A.verticalPadding);var z=A.rowHeight[I]+A.rowHeight[O];A.rowHeight[I]=F,A.rowHeight[O]0)for(var Q=M;Q<=P;Q++)re[0]+=this.grid[Q][F-1].length+this.grid[Q][F].length-1;if(P0)for(var Q=F;Q<=V;Q++)re[3]+=this.grid[M-1][Q].length+this.grid[M][Q].length-1;for(var oe=E.MAX_VALUE,ee,ne,ie=0;ie{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,T=0;T{function h(y){if(Array.isArray(y)){for(var v=0,T=Array(y.length);v0){var Qe=0;Re.forEach(function(Ue){U=="horizontal"?(we.set(Ue,b.has(Ue)?C[b.get(Ue)]:fe.get(Ue)),Qe+=we.get(Ue)):(we.set(Ue,b.has(Ue)?w[b.get(Ue)]:fe.get(Ue)),Qe+=we.get(Ue))}),Qe=Qe/Re.length,Xe.forEach(function(Ue){Y.has(Ue)||we.set(Ue,Qe)})}else{var it=0;Xe.forEach(function(Ue){U=="horizontal"?it+=b.has(Ue)?C[b.get(Ue)]:fe.get(Ue):it+=b.has(Ue)?w[b.get(Ue)]:fe.get(Ue)}),it=it/Xe.length,Xe.forEach(function(Ue){we.set(Ue,it)})}});for(var _e=function(){var Re=Le.shift(),Qe=K.get(Re);Qe.forEach(function(it){if(we.get(it.id)Ue&&(Ue=ct),Gtmt&&(mt=Gt)}}catch(Yt){Ke=!0,me=Yt}finally{try{!ot&&dt.return&&dt.return()}finally{if(Ke)throw me}}var Se=(Qe+Ue)/2-(it+mt)/2,We=!0,Je=!1,nt=void 0;try{for(var wt=Xe[Symbol.iterator](),Vt;!(We=(Vt=wt.next()).done);We=!0){var Mt=Vt.value;we.set(Mt,we.get(Mt)+Se)}}catch(Yt){Je=!0,nt=Yt}finally{try{!We&&wt.return&&wt.return()}finally{if(Je)throw nt}}})}return we},$=function(K){var U=0,Y=0,fe=0,ue=0;if(K.forEach(function(xe){xe.left?C[b.get(xe.left)]-C[b.get(xe.right)]>=0?U++:Y++:w[b.get(xe.top)]-w[b.get(xe.bottom)]>=0?fe++:ue++}),U>Y&&fe>ue)for(var Te=0;TeY)for(var ge=0;geue)for(var we=0;we1)v.fixedNodeConstraint.forEach(function(te,K){N[K]=[te.position.x,te.position.y],M[K]=[C[b.get(te.nodeId)],w[b.get(te.nodeId)]]}),P=!0;else if(v.alignmentConstraint)(function(){var te=0;if(v.alignmentConstraint.vertical){for(var K=v.alignmentConstraint.vertical,U=function(we){var xe=new Set;K[we].forEach(function(Be){xe.add(Be)});var Le=new Set([].concat(h(xe)).filter(function(Be){return V.has(Be)})),_e=void 0;Le.size>0?_e=C[b.get(Le.values().next().value)]:_e=L(xe).x,K[we].forEach(function(Be){N[te]=[_e,w[b.get(Be)]],M[te]=[C[b.get(Be)],w[b.get(Be)]],te++})},Y=0;Y0?_e=C[b.get(Le.values().next().value)]:_e=L(xe).y,fe[we].forEach(function(Be){N[te]=[C[b.get(Be)],_e],M[te]=[C[b.get(Be)],w[b.get(Be)]],te++})},Te=0;Tej&&(j=X[Q].length,re=Q);if(j0){var Ae={x:0,y:0};v.fixedNodeConstraint.forEach(function(te,K){var U={x:C[b.get(te.nodeId)],y:w[b.get(te.nodeId)]},Y=te.position,fe=D(Y,U);Ae.x+=fe.x,Ae.y+=fe.y}),Ae.x/=v.fixedNodeConstraint.length,Ae.y/=v.fixedNodeConstraint.length,C.forEach(function(te,K){C[K]+=Ae.x}),w.forEach(function(te,K){w[K]+=Ae.y}),v.fixedNodeConstraint.forEach(function(te){C[b.get(te.nodeId)]=te.position.x,w[b.get(te.nodeId)]=te.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var be=v.alignmentConstraint.vertical,ke=function(K){var U=new Set;be[K].forEach(function(ue){U.add(ue)});var Y=new Set([].concat(h(U)).filter(function(ue){return V.has(ue)})),fe=void 0;Y.size>0?fe=C[b.get(Y.values().next().value)]:fe=L(U).x,U.forEach(function(ue){V.has(ue)||(C[b.get(ue)]=fe)})},se=0;se0?fe=w[b.get(Y.values().next().value)]:fe=L(U).y,U.forEach(function(ue){V.has(ue)||(w[b.get(ue)]=fe)})},q=0;q{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(XC)),XC.exports}var Uut=YC.exports,TH;function Hut(){return TH||(TH=1,(function(t,e){(function(n,i){t.exports=i(qut())})(Uut,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,T=!1,b=void 0;try{for(var C=g[Symbol.iterator](),w;!(v=(w=C.next()).done)&&(y.push(w.value),!(m&&y.length===m));v=!0);}catch(S){T=!0,b=S}finally{try{!v&&C.return&&C.return()}finally{if(T)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&P.merge(W)});for(var F=0;F1){w=b[0],S=w.connectedEdges().length,b.forEach(function(M){M.connectedEdges().length0&&y.set("dummy"+(y.size+1),R),D},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var C=!0,w=!1,S=void 0;try{for(var E=g.nodeIndexes[Symbol.iterator](),_;!(C=(_=E.next()).done);C=!0){var R=_.value,D=h(R,2),L=D[0],B=D[1],$=m.cy.getElementById(L);if($){var A=$.boundingBox(),I=g.xCoords[B]-A.w/2,O=g.xCoords[B]+A.w/2,N=g.yCoords[B]-A.h/2,M=g.yCoords[B]+A.h/2;Iv&&(v=O),Nb&&(b=M)}}}catch(W){w=!0,S=W}finally{try{!C&&E.return&&E.return()}finally{if(w)throw S}}var P=p.x-(v+y)/2,F=p.y-(b+T)/2;g.xCoords=g.xCoords.map(function(W){return W+P}),g.yCoords=g.yCoords.map(function(W){return W+F})}else{Object.keys(g).forEach(function(W){var X=g[W],j=X.getRect().x,re=X.getRect().x+X.getRect().width,Q=X.getRect().y,oe=X.getRect().y+X.getRect().height;jv&&(v=re),Qb&&(b=oe)});var V=p.x-(v+y)/2,z=p.y-(b+T)/2;Object.keys(g).forEach(function(W){var X=g[W];X.setCenter(X.getCenterX()+V,X.getCenterY()+z)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,C=Number.MIN_SAFE_INTEGER,w=void 0,S=void 0,E=void 0,_=void 0,R=p.descendants().not(":parent"),D=R.length,L=0;Lw&&(v=w),TE&&(b=E),C<_&&(C=_)}var $={};return $.topLeftX=v,$.topLeftY=b,$.width=T-v,$.height=C-b,$},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(y){var v=!1;y.children().forEach(function(T){T.css("display")!="none"&&(v=!0)}),v||m.merge(y)}),m},o.exports=f}),816:((o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,T=function(C,w){var S=C.cy,E=C.eles,_=E.nodes(),R=E.edges(),D=void 0,L=void 0,B=void 0,$={};C.randomize&&(D=w.nodeIndexes,L=w.xCoords,B=w.yCoords);var A=function(W){return typeof W=="function"},I=function(W,X){return A(W)?W(X):W},O=h.calcParentsWithoutChildren(S,E),N=function z(W,X,j,re){for(var Q=X.length,oe=0;oe0){var le=void 0;le=j.getGraphManager().add(j.newGraph(),ie),z(le,ne,j,re)}}},M=function(W,X,j){for(var re=0,Q=0,oe=0;oe0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=re/Q:A(C.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=C.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},P=function(W,X){X.fixedNodeConstraint&&(W.constraints.fixedNodeConstraint=X.fixedNodeConstraint),X.alignmentConstraint&&(W.constraints.alignmentConstraint=X.alignmentConstraint),X.relativePlacementConstraint&&(W.constraints.relativePlacementConstraint=X.relativePlacementConstraint)};C.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=C.nestingFactor),C.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=C.gravity),C.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=C.numIter),C.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=C.gravityRange),C.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=C.gravityCompound),C.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=C.gravityRangeCompound),C.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=C.initialEnergyOnIncremental),C.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=C.tilingCompareBy),C.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=C.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!C.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=C.animate,v.TILE=C.tile,v.TILING_PADDING_VERTICAL=typeof C.tilingPaddingVertical=="function"?C.tilingPaddingVertical.call():C.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof C.tilingPaddingHorizontal=="function"?C.tilingPaddingHorizontal.call():C.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!C.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=C.uniformNodeDimensions,C.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),C.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),C.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),C.step=="all"&&(C.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),C.fixedNodeConstraint||C.alignmentConstraint||C.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var F=new d,V=F.newGraphManager();return N(V.addRoot(),h.getTopMostNodes(_),F,C),M(F,V,R),P(F,C),F.runLayout(),$};o.exports={coseLayout:T}}),212:((o,l,u)=>{var h=(function(){function C(w,S){for(var E=0;E0)if(O){var P=p.getTopMostNodes(E.eles.nodes());if(B=p.connectComponents(_,E.eles,P),B.forEach(function(Fe){var ce=Fe.boundingBox();$.push({x:ce.x1+ce.w/2,y:ce.y1+ce.h/2})}),E.randomize&&B.forEach(function(Fe){E.eles=Fe,D.push(m(E))}),E.quality=="default"||E.quality=="proof"){var F=_.collection();if(E.tile){var V=new Map,z=[],W=[],X=0,j={nodeIndexes:V,xCoords:z,yCoords:W},re=[];if(B.forEach(function(Fe,ce){Fe.edges().length==0&&(Fe.nodes().forEach(function(ve,Ce){F.merge(Fe.nodes()[Ce]),ve.isParent()||(j.nodeIndexes.set(Fe.nodes()[Ce].id(),X++),j.xCoords.push(Fe.nodes()[0].position().x),j.yCoords.push(Fe.nodes()[0].position().y))}),re.push(ce))}),F.length>1){var Q=F.boundingBox();$.push({x:Q.x1+Q.w/2,y:Q.y1+Q.h/2}),B.push(F),D.push(j);for(var oe=re.length-1;oe>=0;oe--)B.splice(re[oe],1),D.splice(re[oe],1),$.splice(re[oe],1)}}B.forEach(function(Fe,ce){E.eles=Fe,L.push(v(E,D[ce])),p.relocateComponent($[ce],L[ce],E)})}else B.forEach(function(Fe,ce){p.relocateComponent($[ce],D[ce],E)});var ee=new Set;if(B.length>1){var ne=[],ie=R.filter(function(Fe){return Fe.css("display")=="none"});B.forEach(function(Fe,ce){var ve=void 0;if(E.quality=="draft"&&(ve=D[ce].nodeIndexes),Fe.nodes().not(ie).length>0){var Ce={};Ce.edges=[],Ce.nodes=[];var Ne=void 0;Fe.nodes().not(ie).forEach(function(Ie){if(E.quality=="draft")if(!Ie.isParent())Ne=ve.get(Ie.id()),Ce.nodes.push({x:D[ce].xCoords[Ne]-Ie.boundingbox().w/2,y:D[ce].yCoords[Ne]-Ie.boundingbox().h/2,width:Ie.boundingbox().w,height:Ie.boundingbox().h});else{var Ae=p.calcBoundingBox(Ie,D[ce].xCoords,D[ce].yCoords,ve);Ce.nodes.push({x:Ae.topLeftX,y:Ae.topLeftY,width:Ae.width,height:Ae.height})}else L[ce][Ie.id()]&&Ce.nodes.push({x:L[ce][Ie.id()].getLeft(),y:L[ce][Ie.id()].getTop(),width:L[ce][Ie.id()].getWidth(),height:L[ce][Ie.id()].getHeight()})}),Fe.edges().forEach(function(Ie){var Ae=Ie.source(),be=Ie.target();if(Ae.css("display")!="none"&&be.css("display")!="none")if(E.quality=="draft"){var ke=ve.get(Ae.id()),se=ve.get(be.id()),J=[],G=[];if(Ae.isParent()){var q=p.calcBoundingBox(Ae,D[ce].xCoords,D[ce].yCoords,ve);J.push(q.topLeftX+q.width/2),J.push(q.topLeftY+q.height/2)}else J.push(D[ce].xCoords[ke]),J.push(D[ce].yCoords[ke]);if(be.isParent()){var H=p.calcBoundingBox(be,D[ce].xCoords,D[ce].yCoords,ve);G.push(H.topLeftX+H.width/2),G.push(H.topLeftY+H.height/2)}else G.push(D[ce].xCoords[se]),G.push(D[ce].yCoords[se]);Ce.edges.push({startX:J[0],startY:J[1],endX:G[0],endY:G[1]})}else L[ce][Ae.id()]&&L[ce][be.id()]&&Ce.edges.push({startX:L[ce][Ae.id()].getCenterX(),startY:L[ce][Ae.id()].getCenterY(),endX:L[ce][be.id()].getCenterX(),endY:L[ce][be.id()].getCenterY()})}),Ce.nodes.length>0&&(ne.push(Ce),ee.add(ce))}});var ae=I.packComponents(ne,E.randomize).shifts;if(E.quality=="draft")D.forEach(function(Fe,ce){var ve=Fe.xCoords.map(function(Ne){return Ne+ae[ce].dx}),Ce=Fe.yCoords.map(function(Ne){return Ne+ae[ce].dy});Fe.xCoords=ve,Fe.yCoords=Ce});else{var de=0;ee.forEach(function(Fe){Object.keys(L[Fe]).forEach(function(ce){var ve=L[Fe][ce];ve.setCenter(ve.getCenterX()+ae[de].dx,ve.getCenterY()+ae[de].dy)}),de++})}}}else{var N=E.eles.boundingBox();if($.push({x:N.x1+N.w/2,y:N.y1+N.h/2}),E.randomize){var M=m(E);D.push(M)}E.quality=="default"||E.quality=="proof"?(L.push(v(E,D[0])),p.relocateComponent($[0],L[0],E)):p.relocateComponent($[0],D[0],E)}var le=function(ce,ve){if(E.quality=="default"||E.quality=="proof"){typeof ce=="number"&&(ce=ve);var Ce=void 0,Ne=void 0,Ie=ce.data("id");return L.forEach(function(be){Ie in be&&(Ce={x:be[Ie].getRect().getCenterX(),y:be[Ie].getRect().getCenterY()},Ne=be[Ie])}),E.nodeDimensionsIncludeLabels&&(Ne.labelWidth&&(Ne.labelPosHorizontal=="left"?Ce.x+=Ne.labelWidth/2:Ne.labelPosHorizontal=="right"&&(Ce.x-=Ne.labelWidth/2)),Ne.labelHeight&&(Ne.labelPosVertical=="top"?Ce.y+=Ne.labelHeight/2:Ne.labelPosVertical=="bottom"&&(Ce.y-=Ne.labelHeight/2))),Ce==null&&(Ce={x:ce.position("x"),y:ce.position("y")}),{x:Ce.x,y:Ce.y}}else{var Ae=void 0;return D.forEach(function(be){var ke=be.nodeIndexes.get(ce.id());ke!=null&&(Ae={x:be.xCoords[ke],y:be.yCoords[ke]})}),Ae==null&&(Ae={x:ce.position("x"),y:ce.position("y")}),{x:Ae.x,y:Ae.y}}};if(E.quality=="default"||E.quality=="proof"||E.randomize){var ye=p.calcParentsWithoutChildren(_,R),$e=R.filter(function(Fe){return Fe.css("display")=="none"});E.eles=R.not($e),R.nodes().not(":parent").not($e).layoutPositions(S,E,le),ye.length>0&&ye.forEach(function(Fe){Fe.position(le(Fe))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),C})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,T=v.nodes(),b=v.nodes(":parent"),C=new Map,w=new Map,S=new Map,E=[],_=[],R=[],D=[],L=[],B=[],$=[],A=[],I=void 0,O=1e8,N=1e-9,M=m.piTol,P=m.samplingType,F=m.nodeSeparation,V=void 0,z=function(){for(var K=0,U=0,Y=!1;U=ue;){ge=fe[ue++];for(var Ee=E[ge],Xe=0;XeLe&&(Le=L[Qe],_e=Qe)}return _e},X=function(K){var U=void 0;if(K){U=Math.floor(Math.random()*I);for(var fe=0;fe=1)break;xe=we}for(var Be=0;Be=1)break;xe=we}for(var Xe=0;Xe0&&(U.isParent()?E[K].push(S.get(U.id())):E[K].push(U.id()))})});var $e=function(K){var U=w.get(K),Y=void 0;C.get(K).forEach(function(fe){y.getElementById(fe).isParent()?Y=S.get(fe):Y=fe,E[U].push(Y),E[w.get(Y)].push(K)})},Fe=!0,ce=!1,ve=void 0;try{for(var Ce=C.keys()[Symbol.iterator](),Ne;!(Fe=(Ne=Ce.next()).done);Fe=!0){var Ie=Ne.value;$e(Ie)}}catch(te){ce=!0,ve=te}finally{try{!Fe&&Ce.return&&Ce.return()}finally{if(ce)throw ve}}I=w.size;var Ae=void 0;if(I>2){V=I{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(YC)),YC.exports}var Yut=Hut();const Xut=jl(Yut);var CH={L:"left",R:"right",T:"top",B:"bottom"},wH={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},D2={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},jut=x(function(t){return na(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),EH=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),na=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),iu=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),mF=x(function(t,e){const r=na(t)&&iu(e),n=iu(t)&&na(e);return r||n},"isArchitectureDirectionXY"),Kut=x(function(t){const e=t[0],r=t[1],n=na(e)&&iu(r),i=iu(e)&&na(r);return n||i},"isArchitecturePairXY"),Zut=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),_M=x(function(t,e){const r=`${t}${e}`;return Zut(r)?r:void 0},"getArchitectureDirectionPair"),Qut=x(function([t,e],r){const n=r[0],i=r[1];return na(n)?iu(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:na(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Jut=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),eht=x(function(t,e){return mF(t,e)?"bend":na(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),tht=x(function(t){return t.type==="service"},"isArchitectureService"),rht=x(function(t){return t.type==="junction"},"isArchitectureJunction"),Gye=x((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),Vye=x(t=>t.data(),"edgeData"),rp=x(t=>t.data(),"nodeData"),nht=pr.architecture,i0,Wye=(i0=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=rn,this.getAccTitle=pn,this.setDiagramTitle=dn,this.getDiagramTitle=an,this.getAccDescription=mn,this.setAccDescription=gn,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",Xr()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(tht)}addJunction({id:e,in:r}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(r)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:r})}getJunctions(){return[...this.nodes.values()].filter(rht)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:r,in:n,title:i}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:r,title:i,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!EH(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!EH(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(r)&&!this.groups.has(r))throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes.get(e).in,d=this.nodes.get(r).in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f);const p=this.nodes.get(e),g=this.nodes.get(r);p&&g&&(p.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){var e,r;if(this.dataStructures===void 0){const n=new Map,i=new Map;for(const[u,h]of this.nodes.entries()){const d=new Map;for(const f of h.edges){const p=(e=this.getNode(f.lhsId))==null?void 0:e.in,g=(r=this.getNode(f.rhsId))==null?void 0:r.in;if(p&&g&&p!==g){const m=eht(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(Gye(p,g),m)}if(f.lhsId===u){const m=_M(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=_M(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=x(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),s.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,y]=g;p.forEach((v,T)=>{a.has(v)||(h.set(v,Qut([m,y],T)),d.push(v))})}}return h},"BFS"),l=[];for(;s.size>0;){const u=s.values().next().value;l.push(o(u))}this.dataStructures={adjList:i,spatialMaps:l,groupAlignments:n}}return this.dataStructures}setElementForId(e,r){this.elements.set(e,r)}getElementById(e){return this.elements.get(e)}getConfig(){return fn({...nht,...It().architecture})}getConfigField(e){return this.getConfig()[e]}},x(i0,"ArchitectureDB"),i0),iht=x((t,e)=>{var r;va(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),qye={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Rs("architecture",t);he.debug(e);const r=(n=qye.parser)==null?void 0:n.yy;if(!(r instanceof Wye))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");iht(e,r)},"parse")},aht=x(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; fill: none; } .arrow { fill: ${t.archEdgeArrowColor}; } .node-bkg { fill: none; stroke: ${t.archGroupBorderColor}; stroke-width: ${t.archGroupBorderWidth}; stroke-dasharray: 8; } .node-icon-text { display: flex; align-items: center; } .node-icon-text > div { color: #fff; margin: 1px; height: fit-content; text-align: center; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; } `,"getStyles"),sht=aht;function AM(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}x(AM,"withSeededRandom");var ff=x(t=>`${t}`,"wrapIcon"),Eb={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:ff('')},server:{body:ff('')},disk:{body:ff('')},internet:{body:ff('')},cloud:{body:ff('')},unknown:CX,blank:{body:ff("")}}},oht=x(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var D,L;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:T}=Vye(u);let{x:b,y:C}=u[0].sourceEndpoint();const{x:w,y:S}=u[0].midpoint();let{x:E,y:_}=u[0].targetEndpoint();const R=i+4;if(p&&(na(d)?b+=d==="L"?-R:R:C+=d==="T"?-R:R+18),v&&(na(m)?E+=m==="L"?-R:R:_+=m==="T"?-R:R+18),!p&&((D=r.getNode(h))==null?void 0:D.type)==="junction"&&(na(d)?b+=d==="L"?s:-s:C+=d==="T"?s:-s),!v&&((L=r.getNode(g))==null?void 0:L.type)==="junction"&&(na(m)?E+=m==="L"?s:-s:_+=m==="T"?s:-s),u[0]._private.rscratch){const B=t.insert("g");if(B.insert("path").attr("d",`M ${b},${C} L ${w},${S} L${E},${_} `).attr("class","edge").attr("id",`${n}-${op(h,g,{prefix:"L"})}`),f){const $=na(d)?D2[d](b,o):b-l,A=iu(d)?D2[d](C,o):C-l;B.insert("polygon").attr("points",wH[d](o)).attr("transform",`translate(${$},${A})`).attr("class","arrow")}if(y){const $=na(m)?D2[m](E,o):E-l,A=iu(m)?D2[m](_,o):_-l;B.insert("polygon").attr("points",wH[m](o)).attr("transform",`translate(${$},${A})`).attr("class","arrow")}if(T){const $=mF(d,m)?"XY":na(d)?"X":"Y";let A=0;$==="X"?A=Math.abs(b-E):$==="Y"?A=Math.abs(C-_)/1.5:A=Math.abs(b-E)/2;const I=B.append("g");if(await Va(I,T,{useHtmlLabels:!1,width:A,classes:"architecture-service-label"},Pe()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),$==="X")I.attr("transform","translate("+w+", "+S+")");else if($==="Y")I.attr("transform","translate("+w+", "+S+") rotate(-90)");else if($==="XY"){const O=_M(d,m);if(O&&Kut(O)){const N=I.node().getBoundingClientRect(),[M,P]=Jut(O);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*M*P*45})`);const F=I.node().getBoundingClientRect();I.attr("transform",` translate(${w}, ${S-N.height/2}) translate(${M*F.width/2}, ${P*F.height/2}) rotate(${-1*M*P*45}, 0, ${N.height/2}) `)}}}}}))},"drawEdges"),lht=x(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=rp(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,T=g;if(h.icon){const b=y.append("g");b.html(`${await $l(h.icon,{height:a,width:a,fallbackPrefix:Eb.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(T+l+1)+")"),v+=a,T+=s/2-1-2}if(h.label){const b=y.append("g");await Va(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Pe()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(T+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),cht=x(async function(t,e,r,n){const i=Pe();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Va(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await $l(a.icon,{height:o,width:o,fallbackPrefix:Eb.prefix})}`);else if(a.iconText){l.html(`${await $l("blank",{height:o,width:o,fallbackPrefix:Eb.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(xr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),uht=x(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");gN([{name:Eb.prefix,icons:Eb}]);Go.use(Xut);function Uye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}x(Uye,"addServices");function Hye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}x(Hye,"addJunctions");function Yye(t,e){e.nodes().map(r=>{const n=rp(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}x(Yye,"positionNodes");function Xye(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}x(Xye,"addGroups");function jye(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=mF(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}x(jye,"addEdges");function Kye(t,e,r,n=[]){const i=x((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let T=0;const b=[...y.entries()];if(b.length===1){g.set(v,b[0][1]);continue}for(let C=0;C{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var w;const T=((w=t.getNode(v))==null?void 0:w.in)??"default",b=p.get(y)??new Map;p.has(y)||p.set(y,b);const C=g.get(m)??new Map;g.has(m)||g.set(m,C);for(const S of[b,C]){const E=S.get(T)??[];S.has(T)||S.set(T,E),E.push(v)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[s,o]=a.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=x(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(s),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}x(Kye,"getAlignments");function Zye(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=x(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,y])=>[l(y),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const y=d.get(m);if(y){const v=u(m);Object.entries(g).forEach(([T,b])=>{const C=l([v[0]+b[0],v[1]+b[1]]),w=d.get(C);if(w&&!p[C]){if(f.push(C),o.has(`${y}|${w}`))return;n.push({[CH[T]]:w,[CH[jut(T)]]:y,gap:a*i})}})}}}}),n}x(Zye,"getRelativeConstraints");function Qye(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=ft("body").append("div").attr("id","cy").attr("style","display:none"),u=Go({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),Xye(r,u),Uye(t,u,i),Hye(e,u,i),jye(n,u);const h=i.getLayoutHints(),d=Kye(i,a,s,h),f=Zye(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),T=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(b){const[C,w]=b.connectedNodes(),{parent:S}=rp(C),{parent:E}=rp(w);return S===E?g:m},edgeElasticity(b){const[C,w]=b.connectedNodes(),{parent:S}=rp(C),{parent:E}=rp(w);return S===E?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});T.one("layoutstop",()=>{var C;function b(w,S,E,_){let R,D;const{x:L,y:B}=w,{x:$,y:A}=S;D=(_-B+(L-E)*(B-A)/(L-$))/Math.sqrt(1+Math.pow((B-A)/(L-$),2)),R=Math.sqrt(Math.pow(_-B,2)+Math.pow(E-L,2)-Math.pow(D,2));const I=Math.sqrt(Math.pow($-L,2)+Math.pow(A-B,2));R=R/I;let O=($-L)*(_-B)-(A-B)*(E-L);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}let N=($-L)*(E-L)+(A-B)*(_-B);switch(!0){case N>=0:N=1;break;case N<0:N=-1;break}return D=Math.abs(D)*O,R=R*N,{distances:D,weights:R}}x(b,"getSegmentWeights"),u.startBatch();for(const w of Object.values(u.edges()))if((C=w.data)!=null&&C.call(w)){const{x:S,y:E}=w.source().position(),{x:_,y:R}=w.target().position();if(S!==_&&E!==R){const D=w.sourceEndpoint(),L=w.targetEndpoint(),{sourceDir:B}=Vye(w),[$,A]=iu(B)?[D.x,L.y]:[L.x,D.y],{weights:I,distances:O}=b(D,L,$,A);w.style("segment-distances",O),w.style("segment-weights",I)}}u.endBatch(),AM(v,()=>T.run())});try{AM(v,()=>T.run())}catch(b){throw b instanceof RangeError&&b.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):b}u.ready(b=>{he.info("Ready",b),o(u)})})}x(Qye,"layoutArchitecture");var hht=x(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=Yi(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await cht(i,f,a,e),uht(i,f,s,e);const g=await Qye(a,s,o,l,i,u);await oht(d,g,i,e),await lht(p,g,i,e),Yye(i,g),tv(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),dht={draw:hht},fht={parser:qye,get db(){return new Wye},renderer:dht,styles:sht};const pht=Object.freeze(Object.defineProperty({__proto__:null,diagram:fht},Symbol.toStringTag,{value:"Module"}));var Jye="position frame",e0e="frame positioned",RM="position relation",t0e="relation positioned",ght=x(function(t){he.debug("options str",t)},"setOptions"),mht=x(function(){return{}},"getOptions"),yht=x(function(){r0e(),Xr()},"clear");function r0e(){yF={}}x(r0e,"reset");var vht=pr.eventmodeling,xht=x(()=>fn({...vht,...It().eventmodeling}),"getConfig"),yF={};function n0e(){let t=bht;const{ast:e}=yF,r=vF();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=u0e(n,e.dataEntities,r);t=ZC(t,{$kind:Jye,index:i,frame:n,textProps:a});let s;m0e(n)?(he.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=ZC(t,{$kind:RM,index:i,frame:n,sourceFrame:o})})):t=ZC(t,{$kind:RM,index:i,frame:n})}),t={...t,sortedSwimlanesArray:xF(t.swimlanes)},t}x(n0e,"getState");function i0e(t){yF.ast=t}x(i0e,"setAst");var Mr={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function vF(){return Mr}x(vF,"getDiagramProps");var bht={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function a0e(t){const e=t.split(".");if(e.length===2)return e[0]}x(a0e,"extractNamespace");function s0e(t){const e=t.split(".");return e.length===2?e[1]:t}x(s0e,"extractName");function o0e(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}x(o0e,"findSwimlaneByNamespace");function KC(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}x(KC,"findNextAvailableIndex");function l0e(t,e){const r=a0e(t.entityIdentifier),n=o0e(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Mr.labelUiAutomation}:r?{index:KC(e,0,100),label:Mr.labelUiAutomationPrefix+r}:{index:0,label:Mr.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Mr.labelCommandReadModel}:r?{index:KC(e,100,200),label:Mr.labelCommandReadModelPrefix+r}:{index:100,label:Mr.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Mr.labelEvents}:r?{index:KC(e,200,300),label:Mr.labelEventsPrefix+r}:{index:200,label:Mr.labelEvents}}}x(l0e,"calculateSwimlaneProps");function c0e(t){const{themeVariables:e}=It();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}x(c0e,"calculateEntityVisualProps");function u0e(t,e,r){const n=It(),i=xr(s0e(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${K1(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=xr(a,n),a=K1(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ `)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=xr(a,n),a=K1(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
    ")}const u=a!==void 0;u&&(l+=`

    ${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=LS(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return he.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}x(u0e,"calculateTextProps");function h0e(t,e){const r=e,n=c0e(r.frame),i={width:r.textProps.width+2*Mr.boxTextPadding,height:r.textProps.height+2*Mr.boxTextPadding};return[{$kind:e0e,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}x(h0e,"decidePositionFrame");function d0e(t,e,r){return e===void 0?Mr.contentStartX:e.index===t.index&&t.r?t.r+Mr.boxPadding:r===void 0?Mr.contentStartX:r.r-Mr.boxOverlap+Mr.boxPadding}x(d0e,"calculateX");function f0e(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}x(f0e,"calculateMaxRight");function xF(t){return Object.values(t).sort((e,r)=>e.index-r.index)}x(xF,"sortedSwimlanesArray");function p0e(t,e){const r=e,n=l0e(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*Mr.swimlaneMinHeight+Mr.swimlaneGap,height:Mr.swimlaneMinHeight,maxHeight:Mr.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(Mr.boxMinWidth,Math.min(Mr.boxMaxWidth,r.dimension.width))+2*Mr.boxPadding,height:Math.max(Mr.boxMinHeight,Math.min(Mr.boxMaxHeight,r.dimension.height))+2*Mr.boxPadding},l=d0e(i,s,a),u=l+o.width+Mr.boxPadding,h=f0e(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(Mr.swimlaneMinHeight,i.maxHeight)+2*Mr.swimlanePadding;const d={x:l,y:Mr.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=xF(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}x(m0e,"hasSourceFrame");function LM(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}x(LM,"findBoxByFrame");function y0e(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}x(y0e,"findBoxByLineIndex");function v0e(t,e){const r=e;if(Ope(r.frame)||g0e(r.index,r.frame))return[];const n=LM(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=LM(t.boxes,r.sourceFrame):i=y0e(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:t0e,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}x(v0e,"decidePositionRelation");function x0e(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}x(x0e,"evolveRelationPositioned");var Tht={[Jye]:h0e,[RM]:v0e},Cht={[e0e]:p0e,[t0e]:x0e};function b0e(t,e){const r=Tht[e.$kind];if(r==null)return[];const n=r(t,e);return he.debug("decided events",n),n}x(b0e,"decide");function T0e(t,e){const r=e.reduce((n,i)=>{const a=Cht[i.$kind];return a==null?n:a(n,i)},t);return he.debug("evolve events",{state:t,newState:r,events:e}),r}x(T0e,"evolve");function ZC(t,e){const r=b0e(t,e);return T0e(t,r)}x(ZC,"dispatch");var IM={getConfig:xht,setOptions:ght,getOptions:mht,clear:yht,setAccTitle:rn,getAccTitle:pn,getAccDescription:mn,setAccDescription:gn,setDiagramTitle:dn,getDiagramTitle:an,setAst:i0e,getDiagramProps:vF,getState:n0e},wht={parse:x(async t=>{const e=await Rs("eventmodeling",t);he.debug(e),IM.setAst(e),va(e,IM)},"parse")},$I=Pe(),Eht=$I==null?void 0:$I.eventmodeling;function C0e(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}x(C0e,"renderD3Box");function w0e(t,e){return t>e}x(w0e,"dirUpwards");function E0e(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=w0e(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;he.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}x(E0e,"renderD3Relation");function S0e(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}x(S0e,"renderD3Swimlane");var Sht=x(function(t,e,r,n){if(he.debug("in eventmodeling renderer",t+` `,"id:",e,r),!Eht)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Pe(),o=ft(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(S0e(o,u.maxR,l,a)),u.boxes.forEach(C0e(o,l)),u.relations.forEach(E0e(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),QM(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),kht={draw:Sht},_ht=x(t=>"","getStyles"),Aht=_ht,Rht={parser:wht,db:IM,renderer:kht,styles:Aht};const Lht=Object.freeze(Object.defineProperty({__proto__:null,diagram:Rht},Symbol.toStringTag,{value:"Module"}));var DM=(function(){var t=x(function(v,T,b,C){for(b=b||{},C=v.length;C--;b[v[C]]=T);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:x(function(T,b,C,w,S,E,_){var R=E.length-1;switch(S){case 6:case 7:return w;case 15:w.addNode(E[R-1].length,E[R].trim());break;case 16:w.addNode(0,E[R].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(T,b){if(b.recoverable)this.trace(T);else{var C=new Error(T);throw C.hash=b,C}},"parseError"),parse:x(function(T){var b=this,C=[0],w=[],S=[null],E=[],_=this.table,R="",D=0,L=0,B=2,$=1,A=E.slice.call(arguments,1),I=Object.create(this.lexer),O={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(O.yy[N]=this.yy[N]);I.setInput(T,O.yy),O.yy.lexer=I,O.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var M=I.yylloc;E.push(M);var P=I.options&&I.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(ae){C.length=C.length-2*ae,S.length=S.length-ae,E.length=E.length-ae}x(F,"popStack");function V(){var ae;return ae=w.pop()||I.lex()||$,typeof ae!="number"&&(ae instanceof Array&&(w=ae,ae=w.pop()),ae=b.symbols_[ae]||ae),ae}x(V,"lex");for(var z,W,X,j,re={},Q,oe,ee,ne;;){if(W=C[C.length-1],this.defaultActions[W]?X=this.defaultActions[W]:((z===null||typeof z>"u")&&(z=V()),X=_[W]&&_[W][z]),typeof X>"u"||!X.length||!X[0]){var ie="";ne=[];for(Q in _[W])this.terminals_[Q]&&Q>B&&ne.push("'"+this.terminals_[Q]+"'");I.showPosition?ie="Parse error on line "+(D+1)+`: `+I.showPosition()+` Expecting `+ne.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ie="Parse error on line "+(D+1)+": Unexpected "+(z==$?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(ie,{text:I.match,token:this.terminals_[z]||z,line:I.yylineno,loc:M,expected:ne})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+z);switch(X[0]){case 1:C.push(z),S.push(I.yytext),E.push(I.yylloc),C.push(X[1]),z=null,L=I.yyleng,R=I.yytext,D=I.yylineno,M=I.yylloc;break;case 2:if(oe=this.productions_[X[1]][1],re.$=S[S.length-oe],re._$={first_line:E[E.length-(oe||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(oe||1)].first_column,last_column:E[E.length-1].last_column},P&&(re._$.range=[E[E.length-(oe||1)].range[0],E[E.length-1].range[1]]),j=this.performAction.apply(re,[R,L,D,O.yy,X[1],S,E].concat(A)),typeof j<"u")return j;oe&&(C=C.slice(0,-1*oe*2),S=S.slice(0,-1*oe),E=E.slice(0,-1*oe)),C.push(this.productions_[X[1]][0]),S.push(re.$),E.push(re._$),ee=_[C[C.length-2]][C[C.length-1]],C.push(ee);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:x(function(b,C){if(this.yy.parser)this.yy.parser.parseError(b,C);else throw new Error(b)},"parseError"),setInput:x(function(T,b){return this.yy=b||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var b=T.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:x(function(T){var b=T.length,C=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var w=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===w.length?this.yylloc.first_column:0)+w[w.length-C.length].length-C[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(T){this.unput(this.match.slice(T))},"less"),pastInput:x(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var T=this.pastInput(),b=new Array(T.length+1).join("-");return T+this.upcomingInput()+` `+b+"^"},"showPosition"),test_match:x(function(T,b){var C,w,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),w=T[0].match(/(?:\r\n?|\n).*/g),w&&(this.yylineno+=w.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:w?w[w.length-1].length-w[w.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+T[0].length},this.yytext+=T[0],this.match+=T[0],this.matches=T,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(T[0].length),this.matched+=T[0],C=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var E in S)this[E]=S[E];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,b,C,w;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),E=0;Eb[0].length)){if(b=C,w=E,this.options.backtrack_lexer){if(T=this.test_match(C,S[E]),T!==!1)return T;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(T=this.test_match(b,S[w]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var b=this.next();return b||this.lex()},"lex"),begin:x(function(b){this.conditionStack.push(b)},"begin"),popState:x(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:x(function(b){this.begin(b)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(b,C,w,S){switch(w){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return x(y,"Parser"),y.prototype=g,g.Parser=y,new y})();DM.parser=DM;var Iht=DM,a0,Dht=(a0=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,Xr()}getRoot(){return this.root}addNode(e,r){const n=yt.sanitizeText(r,Pe());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],dn(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return pn()}setAccTitle(e){rn(e)}getAccDescription(){return mn()}setAccDescription(e){gn(e)}getDiagramTitle(){return an()}setDiagramTitle(e){dn(e)}},x(a0,"IshikawaDB"),a0),Mht=14,pf=250,Nht=30,Oht=60,$ht=5,k0e=82*Math.PI/180,SH=Math.cos(k0e),kH=Math.sin(k0e),_H=x((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;Rn(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),Pht=x((t,e,r,n)=>{var O,N;const a=n.db.getRoot();if(!a)return;const s=Pe(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=Zl(s.fontSize)[0]??Mht,d=o==="handDrawn",f=a.children??[],p=((O=s.ishikawa)==null?void 0:O.diagramPadding)??20,g=((N=s.ishikawa)==null?void 0:N.useMaxWidth)??!1,m=Yi(e),y=m.append("g").attr("class","ishikawa"),v=d?St.svg(m.node()):void 0,T=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let C=0,w=pf;const S=d?void 0:wp(y,C,w,C,w,"ishikawa-spine");if(Bht(y,C,w,a.text,h,T),!f.length){d&&wp(y,C,w,C,w,"ishikawa-spine",T),_H(m,p,g);return}C-=20;const E=f.filter((M,P)=>P%2===0),_=f.filter((M,P)=>P%2===1),R=AH(E),D=AH(_),L=R.total+D.total;let B=pf,$=pf;if(L>0){const M=pf*2,P=pf*.3;B=Math.max(P,M*(R.total/L)),$=Math.max(P,M*(D.total/L))}const A=h*2;B=Math.max(B,R.max*A),$=Math.max($,D.max*A),w=Math.max(B,pf),S&&S.attr("y1",w).attr("y2",w),y.select(".ishikawa-head-group").attr("transform",`translate(0,${w})`);const I=Math.ceil(f.length/2);for(let M=0;MMath.min(F,V.getBBox().x),1/0)}if(d)wp(y,C,w,0,w,"ishikawa-spine",T);else{S.attr("x1",C);const M=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",M)}_H(m,p,g)},"draw"),AH=x(t=>{const e=x(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),Bht=x((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=gS(o,_0e(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Fht=x((t,e)=>{const r=[],n=[],i=x((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:_0e(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),zht=x((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=gS(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),PI=x((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),Ght=x((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-SH*u,d=kH*u*i,f=r+h,p=n+d;if(wp(t,r,n,f,p,"ishikawa-branch",o),o&&PI(t,r,n,r-f,n-p,o),zht(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=Fht(l,i),y=g.length,v=new Array(y);for(const[S,E]of m.entries())v[E]=n+d*((S+1)/(y+1));const T=new Map;T.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-SH,C=kH*i,w=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,E]of g.entries()){const _=v[S],R=T.get(E.parentIndex),D=t.append("g").attr("class","ishikawa-sub-group");let L=0,B=0,$=0;if(E.depth%2===0){const A=R.y1-R.y0;L=RH(R.x0,R.x1,A?(_-R.y0)/A:.5),B=_,$=L-(E.childCount>0?Oht+E.childCount*$ht:Nht),wp(D,L,_,$,_,"ishikawa-sub-branch",o),o&&PI(D,L,_,1,0,o),gS(D,E.text,$,_,"ishikawa-label align","end",s)}else{const A=R.childrenDrawn++;L=RH(R.x0,R.x1,(R.childCount-A)/(R.childCount+1)),B=R.y0,$=L+b*((_-B)/C),wp(D,L,B,$,_,"ishikawa-sub-branch",o),o&&PI(D,L,B,L-$,B-_,o),gS(D,E.text,$,_,w,"end",s)}E.childCount>0&&T.set(S,{x0:L,y0:B,x1:$,y1:_,childCount:E.childCount,childrenDrawn:0})}},"drawBranch"),Vht=x(t=>t.split(/|\n/),"splitLines"),_0e=x((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` `)},"wrapText"),gS=x((t,e,r,n,i,a,s)=>{const o=Vht(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),RH=x((t,e,r)=>t+(e-t)*r,"lerp"),wp=x((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),Wht={draw:Pht},qht=x(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { stroke: ${t.lineColor}; stroke-width: 2; fill: none; } .ishikawa .ishikawa-sub-branch { stroke-width: 1; } .ishikawa .ishikawa-arrow { fill: ${t.lineColor}; } .ishikawa .ishikawa-head { fill: ${t.mainBkg}; stroke: ${t.lineColor}; stroke-width: 2; } .ishikawa .ishikawa-label-box { fill: ${t.mainBkg}; stroke: ${t.lineColor}; stroke-width: 2; } .ishikawa text { font-family: ${t.fontFamily}; font-size: ${t.fontSize}; fill: ${t.textColor}; } .ishikawa .ishikawa-head-label { font-weight: 600; text-anchor: middle; dominant-baseline: middle; font-size: 14px; } .ishikawa .ishikawa-label { text-anchor: end; } .ishikawa .ishikawa-label.cause { text-anchor: middle; dominant-baseline: middle; } .ishikawa .ishikawa-label.align { text-anchor: end; dominant-baseline: middle; } .ishikawa .ishikawa-label.up { dominant-baseline: baseline; } .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } `,"getStyles"),Uht=qht,Hht={parser:Iht,get db(){return new Dht},renderer:Wht,styles:Uht};const Yht=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hht},Symbol.toStringTag,{value:"Module"})),A0e=1e-10;function Q_(t,e){const r=jht(t),n=r.filter(o=>Xht(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=L0e(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=MM(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-A0e,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function Xht(t,e){return e.every(r=>Ba(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return MM(t,n)+MM(e,i)}function R0e(t,e){const r=Ba(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function L0e(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function Kht(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)NM(e))}function Ep(t,e){let r=0;for(let n=0;nw.fx-S.fx,v=e.slice(),T=e.slice(),b=e.slice(),C=e.slice();for(let w=0;w{const R=_.slice();return R.fx=_.fx,R.id=_.id,R});E.sort((_,R)=>_.id-R.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:E})}f=0;for(let E=0;E=g[p-1].fx){let E=!1;if(T.fx>S.fx?(Tl(b,1+h,v,-h,S),b.fx=t(b),b.fx=1)break;for(let _=1;_o+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(Tl(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Ep(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function Qht(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),$M(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fbF(t,e,n)-r,0,t+e)}function Jht(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=PM(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function tdt(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function rdt(t,e={}){let r=idt(t,e);const n=e.lossFunction||J0;if(t.length>=8){const i=ndt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>tdt(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+M0e>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function N0e(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=bF(o.radius,l.radius,Ba(o,l))}else i=Q_(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function adt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&Ba(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function sdt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function BM(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function O0e(t,e,r){e==null&&(e=Math.PI/2);let n=B0e(t).map(u=>Object.assign({},u));const i=sdt(n);for(const u of i){adt(u,e,r);const h=BM(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function P0e(t){const e={};for(const r of t)e[r.setid]=r;return e}function B0e(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function odt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],T=0,b=function(E){if(E in y)return y[E];var _=y[E]=v[T];return T+=1,T>=v.length&&(T=0),_},C=D0e,w=J0;function S(E){let _=E.datum();const R=new Set;_.forEach(Q=>{Q.size==0&&Q.sets.length==1&&R.add(Q.sets[0])}),_=_.filter(Q=>!Q.sets.some(oe=>R.has(oe)));let D={},L={};if(_.length>0){let Q=C(_,{lossFunction:w,distinct:p});o&&(Q=O0e(Q,s,f)),D=$0e(Q,r,n,i,l),L=z0e(D,_,m)}const B={};_.forEach(Q=>{Q.label&&(B[Q.sets]=Q.label)});function $(Q){if(Q.sets in B)return B[Q.sets];if(Q.sets.length==1)return""+Q.sets[0]}E.selectAll("svg").data([D]).enter().append("svg");const A=E.select("svg");e?A.attr("viewBox",`0 0 ${r} ${n}`):A.attr("width",r).attr("height",n);const I={};let O=!1;A.selectAll(".venn-area path").each(function(Q){const oe=this.getAttribute("d");Q.sets.length==1&&oe&&!p&&(O=!0,I[Q.sets[0]]=udt(oe))});function N(Q){return oe=>{const ee=Q.sets.map(ne=>{let ie=I[ne],ae=D[ne];return ie||(ie={x:r/2,y:n/2,radius:1}),ae||(ae={x:r/2,y:n/2,radius:1}),{x:ie.x*(1-oe)+ae.x*oe,y:ie.y*(1-oe)+ae.y*oe,radius:ie.radius*(1-oe)+ae.radius*oe}});return IH(ee,g)}}const M=A.selectAll(".venn-area").data(_,Q=>Q.sets),P=M.enter().append("g").attr("class",Q=>`venn-area venn-${Q.sets.length==1?"circle":"intersection"}${Q.colour||Q.color?" venn-coloured":""}`).attr("data-venn-sets",Q=>Q.sets.join("_")),F=P.append("path"),V=P.append("text").attr("class","label").text(Q=>$(Q)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(F.style("fill-opacity","0").filter(Q=>Q.sets.length==1).style("fill",Q=>Q.colour?Q.colour:Q.color?Q.color:b(Q.sets)).style("fill-opacity",".25"),V.style("fill",Q=>Q.colour||Q.color?"#FFF":t.textFill?t.textFill:Q.sets.length==1?b(Q.sets):"#444"));function z(Q){return typeof Q.transition=="function"?Q.transition("venn").duration(a):Q}let W=E;O&&typeof W.transition=="function"?(W=z(E),W.selectAll("path").attrTween("d",N)):W.selectAll("path").attr("d",Q=>IH(Q.sets.map(oe=>D[oe])),g);const X=W.selectAll("text").filter(Q=>Q.sets in L).text(Q=>$(Q)).attr("x",Q=>Math.floor(L[Q.sets].x)).attr("y",Q=>Math.floor(L[Q.sets].y));u&&(O?"on"in X?X.on("end",BI(D,$)):X.each("end",BI(D,$)):X.each(BI(D,$)));const j=z(M.exit()).remove();typeof M.transition=="function"&&j.selectAll("path").attrTween("d",N);const re=j.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),X.style("font-size",d),re.style("font-size","0px")),{circles:D,textCentres:L,nodes:M,enter:P,update:W,exit:j}}return S.wrap=function(E){return arguments.length?(u=E,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(E){return arguments.length?(r=E,S):r},S.height=function(E){return arguments.length?(n=E,S):n},S.padding=function(E){return arguments.length?(i=E,S):i},S.distinct=function(E){return arguments.length?(p=E,S):p},S.colours=function(E){return arguments.length?(b=E,S):b},S.colors=function(E){return arguments.length?(b=E,S):b},S.fontSize=function(E){return arguments.length?(d=E,S):d},S.round=function(E){return arguments.length?(g=E,S):g},S.duration=function(E){return arguments.length?(a=E,S):a},S.layoutFunction=function(E){return arguments.length?(C=E,S):C},S.normalize=function(E){return arguments.length?(o=E,S):o},S.scaleToFit=function(E){return arguments.length?(l=E,S):l},S.styled=function(E){return arguments.length?(h=E,S):h},S.orientation=function(E){return arguments.length?(s=E,S):s},S.orientationOrder=function(E){return arguments.length?(f=E,S):f},S.lossFunction=function(E){return arguments.length?(w=E==="default"?J0:E==="logRatio"?N0e:E,S):w},S}function BI(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const C=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return C.textContent=b,p.push(C),n.append(C),C}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),T=n.getAttribute("y");p.forEach((b,C)=>{b.setAttribute("x",v),b.setAttribute("y",T),b.setAttribute("dy",`${y+C*f}em`)})}}function FI(t,e,r){let n=e[0].radius-Ba(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=I0e(h=>-1*FI({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(Ba(o,h)>h.radius){l=!1;break}for(const h of e)if(Ba(o,h)h.p1))}function ldt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function cdt(t,e,r){const n=[];return n.push(` M`,t,e),n.push(` m`,-r,0),n.push(` a`,r,r,0,1,0,r*2,0),n.push(` a`,r,r,0,1,0,-r*2,0),n.join(" ")}function udt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function G0e(t){if(t.length===0)return[];const e={};return Q_(t,e),e.arcs}function V0e(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return cdt(n(a.x),n(a.y),n(a.radius))}const i=[` M`,n(t[0].p2.x),n(t[0].p2.y)];for(const a of t){const s=n(a.circle.radius);i.push(` A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function IH(t,e){return V0e(G0e(t),e)}function hdt(t,e={}){const{lossFunction:r,layoutFunction:n=D0e,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?J0:r==="logRatio"?N0e:r,distinct:f});i&&(g=O0e(g,a,s));const m=$0e(g,o,l,u,h),y=z0e(m,t,d),v=new Map(Object.keys(m).map(C=>[C,{set:C,x:m[C].x,y:m[C].y,radius:m[C].radius}])),T=t.map(C=>{const w=C.sets.map(_=>v.get(_)),S=G0e(w),E=V0e(S,p);return{circles:w,arcs:S,path:E,area:C,has:new Set(C.sets)}});function b(C){let w="";for(const S of T)S.has.size>C.length&&C.every(E=>S.has.has(E))&&(w+=" "+S.path);return w}return T.map(({circles:C,arcs:w,path:S,area:E})=>({data:E,text:y[E.sets],circles:C,arcs:w,path:S,distinctPath:S+b(E.sets)}))}var FM=(function(){var t=x(function(T,b,C,w){for(C=C||{},w=T.length;w--;C[T[w]]=b);return C},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:x(function(b,C,w,S,E,_,R){var D=_.length-1;switch(E){case 1:return _[D-1];case 2:case 3:case 4:this.$=[];break;case 5:_[D-1].push(_[D]),this.$=_[D-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=_[D];break;case 8:S.setDiagramTitle(_[D].substr(6)),this.$=_[D].substr(6);break;case 9:S.addSubsetData([_[D]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([_[D-1]],_[D],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([_[D-2]],void 0,parseFloat(_[D])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([_[D-3]],_[D-2],parseFloat(_[D])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(_[D].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[D]),S.addSubsetData(_[D],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(_[D-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[D-1]),S.addSubsetData(_[D-1],_[D],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(_[D-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[D-2]),S.addSubsetData(_[D-2],void 0,parseFloat(_[D])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(_[D-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(_[D-3]),S.addSubsetData(_[D-3],_[D-2],parseFloat(_[D])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(_[D-1],_[D],void 0);break;case 20:case 21:S.addTextData(_[D-2],_[D-1],_[D]);break;case 23:S.addStyleData(_[D-1],_[D]);break;case 24:case 25:case 26:var L=S.getCurrentSets();if(!L)throw new Error("text requires set");S.addTextData(L,_[D],void 0);break;case 27:case 28:var L=S.getCurrentSets();if(!L)throw new Error("text requires set");S.addTextData(L,_[D-1],_[D]);break;case 29:case 41:this.$=[_[D]];break;case 30:case 42:this.$=[..._[D-2],_[D]];break;case 31:this.$=[_[D-2],_[D]];break;case 33:this.$=_[D].join(" ");break;case 34:this.$=[_[D]];break;case 35:_[D-1].push(_[D]),this.$=_[D-1];break;case 43:case 44:this.$=_[D];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:x(function(b,C){if(C.recoverable)this.trace(b);else{var w=new Error(b);throw w.hash=C,w}},"parseError"),parse:x(function(b){var C=this,w=[0],S=[],E=[null],_=[],R=this.table,D="",L=0,B=0,$=2,A=1,I=_.slice.call(arguments,1),O=Object.create(this.lexer),N={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(N.yy[M]=this.yy[M]);O.setInput(b,N.yy),N.yy.lexer=O,N.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var P=O.yylloc;_.push(P);var F=O.options&&O.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(de){w.length=w.length-2*de,E.length=E.length-de,_.length=_.length-de}x(V,"popStack");function z(){var de;return de=S.pop()||O.lex()||A,typeof de!="number"&&(de instanceof Array&&(S=de,de=S.pop()),de=C.symbols_[de]||de),de}x(z,"lex");for(var W,X,j,re,Q={},oe,ee,ne,ie;;){if(X=w[w.length-1],this.defaultActions[X]?j=this.defaultActions[X]:((W===null||typeof W>"u")&&(W=z()),j=R[X]&&R[X][W]),typeof j>"u"||!j.length||!j[0]){var ae="";ie=[];for(oe in R[X])this.terminals_[oe]&&oe>$&&ie.push("'"+this.terminals_[oe]+"'");O.showPosition?ae="Parse error on line "+(L+1)+`: `+O.showPosition()+` Expecting `+ie.join(", ")+", got '"+(this.terminals_[W]||W)+"'":ae="Parse error on line "+(L+1)+": Unexpected "+(W==A?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(ae,{text:O.match,token:this.terminals_[W]||W,line:O.yylineno,loc:P,expected:ie})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+W);switch(j[0]){case 1:w.push(W),E.push(O.yytext),_.push(O.yylloc),w.push(j[1]),W=null,B=O.yyleng,D=O.yytext,L=O.yylineno,P=O.yylloc;break;case 2:if(ee=this.productions_[j[1]][1],Q.$=E[E.length-ee],Q._$={first_line:_[_.length-(ee||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(ee||1)].first_column,last_column:_[_.length-1].last_column},F&&(Q._$.range=[_[_.length-(ee||1)].range[0],_[_.length-1].range[1]]),re=this.performAction.apply(Q,[D,B,L,N.yy,j[1],E,_].concat(I)),typeof re<"u")return re;ee&&(w=w.slice(0,-1*ee*2),E=E.slice(0,-1*ee),_=_.slice(0,-1*ee)),w.push(this.productions_[j[1]][0]),E.push(Q.$),_.push(Q._$),ne=R[w[w.length-2]][w[w.length-1]],w.push(ne);break;case 3:return!0}}return!0},"parse")},y=(function(){var T={EOF:1,parseError:x(function(C,w){if(this.yy.parser)this.yy.parser.parseError(C,w);else throw new Error(C)},"parseError"),setInput:x(function(b,C){return this.yy=C||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var C=b.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:x(function(b){var C=b.length,w=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===S.length?this.yylloc.first_column:0)+S[S.length-w.length].length-w[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(b){this.unput(this.match.slice(b))},"less"),pastInput:x(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var b=this.pastInput(),C=new Array(b.length+1).join("-");return b+this.upcomingInput()+` `+C+"^"},"showPosition"),test_match:x(function(b,C){var w,S,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),S=b[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],w=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var _ in E)this[_]=E[_];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,C,w,S;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),_=0;_C[0].length)){if(C=w,S=_,this.options.backtrack_lexer){if(b=this.test_match(w,E[_]),b!==!1)return b;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(b=this.test_match(C,E[S]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var C=this.next();return C||this.lex()},"lex"),begin:x(function(C){this.conditionStack.push(C)},"begin"),popState:x(function(){var C=this.conditionStack.length-1;return C>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:x(function(C){this.begin(C)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(C,w,S,E){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(C.getIndentMode&&C.getIndentMode())return C.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:C.setIndentMode&&C.setIndentMode(!1),this.begin("INITIAL"),this.unput(w.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(C.consumeIndentText)C.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return w.yytext=w.yytext.slice(2,-2),14;case 17:return w.yytext=w.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return T})();m.lexer=y;function v(){this.yy={}}return x(v,"Parser"),v.prototype=m,m.Parser=v,new v})();FM.parser=FM;var ddt=FM,TF=[],CF=[],wF=[],EF=new Set,SF,kF=!1,fdt=x((t,e,r)=>{const n=J_(t).sort(),i=r??10/Math.pow(t.length,2);SF=n,n.length===1&&EF.add(n[0]),TF.push({sets:n,size:i,label:e?Sb(e):void 0})},"addSubsetData"),pdt=x(()=>TF,"getSubsetData"),Sb=x(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),gdt=x(t=>t&&Sb(t),"normalizeStyleValue"),mdt=x((t,e,r)=>{const n=Sb(e);CF.push({sets:J_(t).sort(),id:n,label:r?Sb(r):void 0})},"addTextData"),ydt=x((t,e)=>{const r=J_(t).sort(),n={};for(const[i,a]of e)n[i]=gdt(a)??a;wF.push({targets:r,styles:n})},"addStyleData"),vdt=x(()=>wF,"getStyleData"),J_=x(t=>t.map(e=>Sb(e)),"normalizeIdentifierList"),xdt=x(t=>{const r=J_(t).filter(n=>!EF.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),bdt=x(()=>CF,"getTextData"),Tdt=x(()=>SF,"getCurrentSets"),Cdt=x(()=>kF,"getIndentMode"),wdt=x(t=>{kF=t},"setIndentMode"),Edt=pr.venn;function W0e(){return fn(Edt,It().venn)}x(W0e,"getConfig");var Sdt=x(()=>{Xr(),TF.length=0,CF.length=0,wF.length=0,EF.clear(),SF=void 0,kF=!1},"customClear"),kdt={getConfig:W0e,clear:Sdt,setAccTitle:rn,getAccTitle:pn,setDiagramTitle:dn,getDiagramTitle:an,getAccDescription:mn,setAccDescription:gn,addSubsetData:fdt,getSubsetData:pdt,addTextData:mdt,addStyleData:ydt,validateUnionIdentifiers:xdt,getTextData:bdt,getStyleData:vdt,getCurrentSets:Tdt,getIndentMode:Cdt,setIndentMode:wdt},_dt=x(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; font-family: ${t.fontFamily}; } .venn-circle text { font-size: 48px; font-family: ${t.fontFamily}; } .venn-intersection text { font-size: 48px; fill: ${t.vennSetTextColor}; font-family: ${t.fontFamily}; } .venn-text-node { font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } `,"getStyles"),Adt=_dt;function q0e(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}x(q0e,"buildStyleByKey");var Rdt=x((t,e,r,n)=>{var I,O,N;const i=n.db,a=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=It(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(O=i.getDiagramTitle)==null?void 0:O.call(i),f=i.getSubsetData(),p=i.getTextData(),g=q0e(i.getStyleData()),m=H0e(f),y=(a==null?void 0:a.width)??800,v=(a==null?void 0:a.height)??450,b=y/1600,C=d?48*b:0,w=s.primaryTextColor??s.textColor,S=Yi(e);S.attr("viewBox",`0 0 ${y} ${v}`),d&&S.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",s.vennTitleTextColor||s.titleColor);const E=ft(document.createElement("div")),_=odt().width(y).height(v-C);E.datum(m).call(_);const R=u?St.svg(E.select("svg").node()):void 0,D=hdt(m,{width:y,height:v-C,padding:(a==null?void 0:a.padding)??15}),L=new Map;for(const M of D){const P=kc([...M.data.sets].sort());L.set(P,M)}p.length>0&&U0e(a,L,E,p,b,g);const B=ga(s.background||"#f4f4f4");E.selectAll(".venn-circle").each(function(M,P){var ee;const F=ft(this),z=kc([...M.sets].sort()),W=g.get(z),X=(W==null?void 0:W.fill)||h[P%h.length]||s.primaryColor;F.classed(`venn-set-${P%8}`,!0);const j=(W==null?void 0:W["fill-opacity"])??.1,re=(W==null?void 0:W.stroke)||X,Q=(W==null?void 0:W["stroke-width"])||`${5*b}`;if(u&&R){const ne=L.get(z);if(ne&&ne.circles.length>0){const ie=ne.circles[0],ae=R.circle(ie.x,ie.y,ie.radius*2,{roughness:.7,seed:l,fill:NF(X,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+P*60,stroke:re,strokeWidth:parseFloat(String(Q))});F.select("path").remove(),(ee=F.node())==null||ee.insertBefore(ae,F.select("text").node())}}else F.select("path").style("fill",X).style("fill-opacity",j).style("stroke",re).style("stroke-width",Q).style("stroke-opacity",.95);const oe=(W==null?void 0:W.color)||(B?He(X,30):Ye(X,30));F.select("text").style("font-size",`${48*b}px`).style("fill",oe)}),u&&R?E.selectAll(".venn-intersection").each(function(M){var X;const P=ft(this),V=kc([...M.sets].sort()),z=g.get(V),W=z==null?void 0:z.fill;if(W){const j=P.select("path"),re=j.attr("d");if(re){const Q=R.path(re,{roughness:.7,seed:l,fill:NF(W,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),oe=j.node();(X=oe==null?void 0:oe.parentNode)==null||X.insertBefore(Q,oe),j.remove()}}else P.select("path").style("fill-opacity",0);P.select("text").style("font-size",`${48*b}px`).style("fill",(z==null?void 0:z.color)??s.vennSetTextColor??w)}):(E.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",M=>{var V;const F=kc([...M.sets].sort());return((V=g.get(F))==null?void 0:V.color)??s.vennSetTextColor??w}),E.selectAll(".venn-intersection path").style("fill-opacity",M=>{var V;const F=kc([...M.sets].sort());return(V=g.get(F))!=null&&V.fill?1:0}).style("fill",M=>{var V;const F=kc([...M.sets].sort());return((V=g.get(F))==null?void 0:V.fill)??"transparent"}));const $=S.append("g").attr("transform",`translate(0, ${C})`),A=E.select("svg").node();if(A&&"childNodes"in A)for(const M of[...A.childNodes])(N=$.node())==null||N.appendChild(M);Rn(S,v,y,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function kc(t){return t.join("|")}x(kc,"stableSetsKey");function U0e(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=kc(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(I=>I.radius)),v=Math.min(...p.circles.map(I=>I.radius-Math.hypot(g-I.x,m-I.y)));let T=Number.isFinite(v)?Math.max(0,v):0;T===0&&Number.isFinite(y)&&(T=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const C=Math.max(80*i,T*2*.95),w=Math.max(60*i,T*2*.95),_=(p.data.label&&p.data.label.length>0?Math.min(32*i,T*.25):0)+(f.length<=2?30*i:0),R=g-C/2,D=m-w/2+_,L=Math.max(1,Math.ceil(Math.sqrt(f.length))),B=Math.max(1,Math.ceil(f.length/L)),$=C/L,A=w/B;for(const[I,O]of f.entries()){const N=I%L,M=Math.floor(I/L),P=R+$*(N+.5),F=D+A*(M+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",R+$*N).attr("y",D+A*M).attr("width",$).attr("height",A).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=$*.9,z=A*.9,W=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",z).attr("x",P-V/2).attr("y",F-z/2).attr("overflow","visible"),X=(h=a.get(O.id))==null?void 0:h.color,j=W.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(O.label??O.id);X&&j.style("color",X)}}}x(U0e,"renderTextNodes");function H0e(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const a=[...i.sets].sort();for(let s=0;s0?[...t,...n]:t}x(H0e,"ensurePairwiseSubsets");var Ldt={draw:Rdt},Idt={parser:ddt,db:kdt,renderer:Ldt,styles:Adt};const Ddt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Idt},Symbol.toStringTag,{value:"Module"}));var s0,Y0e=(s0=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=rn,this.getAccTitle=pn,this.setDiagramTitle=dn,this.getDiagramTitle=an,this.getAccDescription=mn,this.setAccDescription=gn}getNodes(){return this.nodes}getConfig(){const e=pr,r=It();return fn({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{pN(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){Xr(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},x(s0,"TreeMapDB"),s0);function X0e(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}x(X0e,"buildHierarchy");var Mdt=x((t,e)=>{va(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=Ndt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=X0e(r),i=x((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),Ndt=x(t=>t.name?String(t.name):"","getItemName"),j0e={parser:{yy:void 0},parse:x(async t=>{var e;try{const n=await Rs("treemap",t);he.debug("Treemap AST:",n);const i=(e=j0e.parser)==null?void 0:e.yy;if(!(i instanceof Y0e))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Mdt(n,i)}catch(r){throw he.error("Error parsing treemap:",r),r}},"parse")},Odt=10,gf=10,d1=25,$dt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??Odt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=It();if(!l)return;const h=o?30:0,d=Yi(e),f=a.nodeWidth?a.nodeWidth*gf:960,p=a.nodeHeight?a.nodeHeight*gf:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),Rn(d,m,g,a.useMaxWidth);let y;try{const z=a.valueFormat||",";if(z==="$0,0")y=x(W=>"$"+rh(",")(W),"valueFormat");else if(z.startsWith("$")&&z.includes(",")){const W=/\.\d+/.exec(z),X=W?W[0]:"";y=x(j=>"$"+rh(","+X)(j),"valueFormat")}else if(z.startsWith("$")){const W=z.substring(1);y=x(X=>"$"+rh(W||"")(X),"valueFormat")}else y=rh(z)}catch(z){he.error("Error creating format function:",z),y=rh(",")}const v=Ih().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),T=Ih().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=Ih().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const C=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),w=oN(l).sum(z=>z.value??0).sort((z,W)=>(W.value??0)-(z.value??0)),E=ewe().size([f,p]).paddingTop(z=>z.children&&z.children.length>0?d1+gf:0).paddingInner(s).paddingLeft(z=>z.children&&z.children.length>0?gf:0).paddingRight(z=>z.children&&z.children.length>0?gf:0).paddingBottom(z=>z.children&&z.children.length>0?gf:0).round(!0)(w),_=E.descendants().filter(z=>z.children&&z.children.length>0),R=C.selectAll(".treemapSection").data(_).enter().append("g").attr("class","treemapSection").attr("transform",z=>`translate(${z.x0},${z.y0})`);R.append("rect").attr("width",z=>z.x1-z.x0).attr("height",d1).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",z=>z.depth===0?"display: none;":""),R.append("clipPath").attr("id",(z,W)=>`clip-section-${e}-${W}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-12)).attr("height",d1),R.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class",(z,W)=>`treemapSection section${W}`).attr("fill",z=>v(z.data.name)).attr("fill-opacity",.6).attr("stroke",z=>T(z.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",z=>{if(z.depth===0)return"display: none;";const W=Et({cssCompiledStyles:z.data.cssCompiledStyles});return W.nodeStyles+";"+W.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",d1/2).attr("dominant-baseline","middle").text(z=>z.depth===0?"":z.data.name).attr("font-weight","bold").attr("clip-path",(z,W)=>`url(#clip-section-${e}-${W})`).attr("style",z=>{if(z.depth===0)return"display: none;";const W="dominant-baseline: middle; font-size: 12px; fill:"+b(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",X=Et({cssCompiledStyles:z.data.cssCompiledStyles});return W+X.labelStyles.replace("color:","fill:")}).each(function(z){if(z.depth===0)return;const W=ft(this),X=z.data.name;W.text(X);const j=z.x1-z.x0,re=6;let Q;a.showValues!==!1&&z.value?Q=j-10-30-10-re:Q=j-re-6;const ee=Math.max(15,Q),ne=W.node();if(ne.getComputedTextLength()>ee){let de=X;for(;de.length>0;){if(de=X.substring(0,de.length-1),de.length===0){W.text("..."),ne.getComputedTextLength()>ee&&W.text("");break}if(W.text(de+"..."),ne.getComputedTextLength()<=ee)break}}}),a.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",z=>z.x1-z.x0-10).attr("y",d1/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(z=>z.value?y(z.value):"").attr("font-style","italic").attr("style",z=>{if(z.depth===0)return"display: none;";const W="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",X=Et({cssCompiledStyles:z.data.cssCompiledStyles});return W+X.labelStyles.replace("color:","fill:")});const D=E.leaves(),L=D.length>20,B=L?16:38,$=L?14:28,A=L?4:8,I=L?4:6,O=L?2:4,N=L?8:10,M=L?1:2,P=C.selectAll(".treemapLeafGroup").data(D).enter().append("g").attr("class",(z,W)=>`treemapNode treemapLeafGroup leaf${W}${z.data.classSelector?` ${z.data.classSelector}`:""}x`).attr("transform",z=>`translate(${z.x0},${z.y0})`);P.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class","treemapLeaf").attr("fill",z=>z.parent?v(z.parent.data.name):v(z.data.name)).attr("style",z=>Et({cssCompiledStyles:z.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",z=>z.parent?v(z.parent.data.name):v(z.data.name)).attr("stroke-width",3),P.append("clipPath").attr("id",(z,W)=>`clip-${e}-${W}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-4)).attr("height",z=>Math.max(0,z.y1-z.y0-4)),P.append("text").attr("class","treemapLabel").attr("x",z=>(z.x1-z.x0)/2).attr("y",z=>(z.y1-z.y0)/2).attr("style",z=>{const W=`text-anchor: middle; dominant-baseline: middle; font-size: ${B}px;fill:`+b(z.data.name)+";",X=Et({cssCompiledStyles:z.data.cssCompiledStyles});return W+X.labelStyles.replace("color:","fill:")}).attr("clip-path",(z,W)=>`url(#clip-${e}-${W})`).text(z=>z.data.name).each(function(z){const W=ft(this),X=z.x1-z.x0,j=z.y1-z.y0,re=W.node(),Q=X-2*O,oe=j-2*O;if(QQ&&ee>A;)ee--,W.style("font-size",`${ee}px`);let ie=Math.max(I,Math.min($,Math.round(ee*ne))),ae=ee+M+ie;for(;ae>oe&&ee>A&&(ee--,ie=Math.max(I,Math.min($,Math.round(ee*ne))),!(ieQ||ee(W.x1-W.x0)/2).attr("y",function(W){return(W.y1-W.y0)/2}).attr("style",W=>{const X=`text-anchor: middle; dominant-baseline: hanging; font-size: ${$}px;fill:`+b(W.data.name)+";",j=Et({cssCompiledStyles:W.data.cssCompiledStyles});return X+j.labelStyles.replace("color:","fill:")}).attr("clip-path",(W,X)=>`url(#clip-${e}-${X})`).text(W=>W.value?y(W.value):"").each(function(W){const X=ft(this),j=this.parentNode;if(!j){X.style("display","none");return}const re=ft(j).select(".treemapLabel");if(re.empty()||re.style("display")==="none"){X.style("display","none");return}const Q=parseFloat(re.style("font-size")),ee=Math.max(I,Math.min($,Math.round(Q*.6)));X.style("font-size",`${ee}px`);const ie=(W.y1-W.y0)/2+Q/2+M;X.attr("y",ie);const ae=W.x1-W.x0,ye=W.y1-W.y0-4,$e=ae-2*O;X.node().getComputedTextLength()>$e||ie+ee>ye||ee{const e=Kl(),r=It(),n=fn(e,r.themeVariables),i=fn(Fdt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` .treemapNode.section { stroke: ${i.sectionStrokeColor}; stroke-width: ${i.sectionStrokeWidth}; fill: ${i.sectionFillColor}; } .treemapNode.leaf { stroke: ${i.leafStrokeColor}; stroke-width: ${i.leafStrokeWidth}; fill: ${i.leafFillColor}; } .treemapLabel { fill: ${s}; font-size: ${i.labelFontSize}; } .treemapValue { fill: ${o}; font-size: ${i.valueFontSize}; } .treemapTitle { fill: ${a}; font-size: ${i.titleFontSize}; } `},"getStyles"),Gdt=zdt,Vdt={parser:j0e,get db(){return new Y0e},renderer:Bdt,styles:Gdt};const Wdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vdt},Symbol.toStringTag,{value:"Module"}));var mS=x((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),Bu=x((t,e,r)=>({x:mS(e,`${r} evolution`),y:mS(t,`${r} visibility`)}),"toCoordinates"),DH=x(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),qdt=x(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Udt=x((t,e)=>{if(va(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=Bu(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=Bu(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=Bu(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=mS(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=DH(r.fromPort)??DH(r.toPort);const{flow:a,label:s}=qdt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=mS(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=Bu(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=Bu(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=Bu(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=Bu(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),K0e={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Rs("wardley",t);he.debug(e);const r=(n=K0e.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Udt(e,r)},"parse")},o0,Hdt=(o0=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},x(o0,"WardleyBuilder"),o0),Ki=new Hdt;function Z0e(){return Pe()["wardley-beta"]}x(Z0e,"getConfig");function Q0e(t,e,r,n,i,a,s,o,l){Ki.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}x(Q0e,"addNode");function J0e(t,e,r=!1,n,i){Ki.addLink({source:t,target:e,dashed:r,label:n,flow:i})}x(J0e,"addLink");function eve(t,e,r){Ki.addTrend({nodeId:t,targetX:e,targetY:r})}x(eve,"addTrend");function tve(t,e,r){Ki.addAnnotation({number:t,coordinates:e,text:r})}x(tve,"addAnnotation");function rve(t,e,r){Ki.addNote({text:t,x:e,y:r})}x(rve,"addNote");function nve(t,e,r){Ki.addAccelerator({name:t,x:e,y:r})}x(nve,"addAccelerator");function ive(t,e,r){Ki.addDeaccelerator({name:t,x:e,y:r})}x(ive,"addDeaccelerator");function ave(t,e){Ki.setAnnotationsBox(t,e)}x(ave,"setAnnotationsBox");function sve(t,e){Ki.setSize(t,e)}x(sve,"setSize");function ove(t){Ki.startPipeline(t)}x(ove,"startPipeline");function lve(t,e){Ki.addPipelineComponent(t,e)}x(lve,"addPipelineComponent");function cve(t){Ki.setAxes(t)}x(cve,"updateAxes");function uve(t){return Ki.getNode(t)}x(uve,"getNode");function hve(t){return Ki.resolveNodeId(t)}x(hve,"resolveNodeId");function dve(){return Ki.build()}x(dve,"getWardleyData");function fve(){Ki.clear(),Xr()}x(fve,"clear");var Ydt={getConfig:Z0e,addNode:Q0e,addLink:J0e,addTrend:eve,addAnnotation:tve,addNote:rve,addAccelerator:nve,addDeaccelerator:ive,setAnnotationsBox:ave,setSize:sve,startPipeline:ove,addPipelineComponent:lve,updateAxes:cve,getNode:uve,resolveNodeId:hve,getWardleyData:dve,clear:fve,setAccTitle:rn,getAccTitle:pn,setDiagramTitle:dn,getDiagramTitle:an,getAccDescription:mn,setAccDescription:gn},Xdt=["Genesis","Custom Built","Product","Commodity"],jdt=x(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Pe();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),Kdt=x(()=>{const t=Pe()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),Zdt=x((t,e,r,n)=>{var M,P;he.debug(`Rendering Wardley map `+t);const i=Kdt(),a=jdt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((M=l.size)==null?void 0:M.width)??i.width,d=((P=l.size)==null?void 0:P.height)??i.height,f=Yi(e);f.selectAll("*").remove(),Rn(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=x(F=>i.padding+F/100*m,"projectX"),T=x(F=>d-i.padding-F/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const C=l.axes.xLabel??"Evolution",w=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(C),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(w);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:Xdt;if(S.length>0){const F=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,z=[];if(V&&V.length===S.length){let W=0;V.forEach(X=>{z.push({start:W,end:X}),W=X})}else{const W=1/S.length;S.forEach((X,j)=>{z.push({start:j*W,end:(j+1)*W})})}S.forEach((W,X)=>{const j=z[X],re=i.padding+j.start*m,Q=i.padding+j.end*m,oe=(re+Q)/2;X>0&&F.append("line").attr("x1",re).attr("x2",re).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),F.append("text").attr("class","wardley-stage-label").attr("x",oe).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(W)})}if(i.showGrid){const F=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const z=V/4,W=i.padding+m*z;F.append("line").attr("x1",W).attr("x2",W).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),F.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*z).attr("y2",d-i.padding-y*z).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const E=new Map;if(l.nodes.forEach(F=>{E.set(F.id,{x:v(F.x),y:T(F.y),node:F})}),l.pipelines.length>0){const F=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(z=>{if(z.componentIds.length===0)return;const W=z.componentIds.map(Q=>({id:Q,pos:E.get(Q),node:l.nodes.find(oe=>oe.id===Q)})).filter(Q=>Q.pos&&Q.node).sort((Q,oe)=>Q.node.x-oe.node.x);for(let Q=0;Q{const oe=E.get(Q);oe&&(X=Math.min(X,oe.x),j=Math.max(j,oe.x),re=oe.y)}),X!==1/0&&j!==-1/0){const oe=i.nodeRadius*4,ee=re-oe/2,ne=E.get(z.nodeId);if(ne){const ie=(X+j)/2;ne.x=ie,ne.y=ee-s/6}F.append("rect").attr("class","wardley-pipeline-box").attr("x",X-15).attr("y",ee).attr("width",j-X+30).attr("height",oe).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=p.append("g").attr("class","wardley-links"),R=new Map;l.pipelines.forEach(F=>{R.set(F.nodeId,new Set(F.componentIds))});const D=l.links.filter(F=>{if(!E.has(F.source)||!E.has(F.target))return!1;const V=R.get(F.target);return!(V!=null&&V.has(F.source))});_.selectAll("line").data(D).enter().append("line").attr("class",F=>`wardley-link${F.dashed?" wardley-link--dashed":""}`).attr("x1",F=>{const V=E.get(F.source),z=E.get(F.target),X=l.nodes.find(oe=>oe.id===F.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,j=z.x-V.x,re=z.y-V.y,Q=Math.sqrt(j*j+re*re);return V.x+j/Q*X}).attr("y1",F=>{const V=E.get(F.source),z=E.get(F.target),X=l.nodes.find(oe=>oe.id===F.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,j=z.x-V.x,re=z.y-V.y,Q=Math.sqrt(j*j+re*re);return V.y+re/Q*X}).attr("x2",F=>{const V=E.get(F.source),z=E.get(F.target),X=l.nodes.find(oe=>oe.id===F.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,j=V.x-z.x,re=V.y-z.y,Q=Math.sqrt(j*j+re*re);return z.x+j/Q*X}).attr("y2",F=>{const V=E.get(F.source),z=E.get(F.target),X=l.nodes.find(oe=>oe.id===F.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,j=V.x-z.x,re=V.y-z.y,Q=Math.sqrt(j*j+re*re);return z.y+re/Q*X}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",F=>F.dashed?"6 6":null).attr("marker-end",F=>F.flow==="forward"||F.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",F=>F.flow==="backward"||F.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),_.selectAll("text").data(D.filter(F=>F.label)).enter().append("text").attr("class","wardley-link-label").attr("x",F=>{const V=E.get(F.source),z=E.get(F.target),W=(V.x+z.x)/2,X=z.y-V.y,j=z.x-V.x,re=Math.sqrt(j*j+X*X),Q=8,oe=X/re;return W+oe*Q}).attr("y",F=>{const V=E.get(F.source),z=E.get(F.target),W=(V.y+z.y)/2,X=z.x-V.x,j=z.y-V.y,re=Math.sqrt(X*X+j*j),Q=8,oe=-X/re;return W+oe*Q}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",F=>{const V=E.get(F.source),z=E.get(F.target),W=(V.x+z.x)/2,X=(V.y+z.y)/2,j=z.x-V.x,re=z.y-V.y,Q=Math.sqrt(j*j+re*re),oe=8,ee=re/Q,ne=-j/Q,ie=W+ee*oe,ae=X+ne*oe;let de=Math.atan2(re,j)*180/Math.PI;return(de>90||de<-90)&&(de+=180),`rotate(${de} ${ie} ${ae})`}).text(F=>F.label);const L=p.append("g").attr("class","wardley-trends"),B=l.trends.map(F=>{const V=E.get(F.nodeId);if(!V)return null;const z=v(F.targetX),W=T(F.targetY),X=z-V.x,j=W-V.y,re=Math.sqrt(X*X+j*j),Q=i.nodeRadius+2,oe=re>Q?z-X/re*Q:z,ee=re>Q?W-j/re*Q:W;return{origin:V,targetX:z,targetY:W,adjustedX2:oe,adjustedY2:ee}}).filter(F=>F!==null);L.selectAll("line").data(B).enter().append("line").attr("class","wardley-trend").attr("x1",F=>F.origin.x).attr("y1",F=>F.origin.y).attr("x2",F=>F.adjustedX2).attr("y2",F=>F.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const A=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",F=>["wardley-node",F.className?`wardley-node--${F.className}`:""].filter(Boolean).join(" "));A.filter(F=>F.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",F=>E.get(F.id).x).attr("cy",F=>E.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(F=>F.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",F=>E.get(F.id).x).attr("cy",F=>E.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(F=>F.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",F=>E.get(F.id).x).attr("cy",F=>E.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=A.filter(F=>F.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",F=>E.get(F.id).x).attr("cy",F=>E.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(F=>!F.isPipelineParent&&F.sourceStrategy!=="market"&&F.className!=="anchor").append("circle").attr("cx",F=>E.get(F.id).x).attr("cy",F=>E.get(F.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const O=i.nodeRadius*.7,N=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",F=>E.get(F.id).x).attr("y1",F=>E.get(F.id).y-N).attr("x2",F=>E.get(F.id).x-N*Math.cos(Math.PI/6)).attr("y2",F=>E.get(F.id).y+N*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",F=>E.get(F.id).x-N*Math.cos(Math.PI/6)).attr("y1",F=>E.get(F.id).y+N*Math.sin(Math.PI/6)).attr("x2",F=>E.get(F.id).x+N*Math.cos(Math.PI/6)).attr("y2",F=>E.get(F.id).y+N*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",F=>E.get(F.id).x+N*Math.cos(Math.PI/6)).attr("y1",F=>E.get(F.id).y+N*Math.sin(Math.PI/6)).attr("x2",F=>E.get(F.id).x).attr("y2",F=>E.get(F.id).y-N).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",F=>E.get(F.id).x).attr("cy",F=>E.get(F.id).y-N).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",F=>E.get(F.id).x-N*Math.cos(Math.PI/6)).attr("cy",F=>E.get(F.id).y+N*Math.sin(Math.PI/6)).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",F=>E.get(F.id).x+N*Math.cos(Math.PI/6)).attr("cy",F=>E.get(F.id).y+N*Math.sin(Math.PI/6)).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),A.filter(F=>F.isPipelineParent===!0).append("rect").attr("x",F=>E.get(F.id).x-s/2).attr("y",F=>E.get(F.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(F=>F.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",F=>{const V=E.get(F.id);let z=F.isPipelineParent?s/2+15:i.nodeRadius+15;return F.sourceStrategy&&(z+=i.nodeRadius+10),V.x+z}).attr("y1",F=>{const V=E.get(F.id),z=F.isPipelineParent?s:i.nodeRadius*2;return V.y-z/2}).attr("x2",F=>{const V=E.get(F.id);let z=F.isPipelineParent?s/2+15:i.nodeRadius+15;return F.sourceStrategy&&(z+=i.nodeRadius+10),V.x+z}).attr("y2",F=>{const V=E.get(F.id),z=F.isPipelineParent?s:i.nodeRadius*2;return V.y+z/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),A.append("text").attr("x",F=>{const V=E.get(F.id);if(F.className==="anchor")return F.labelOffsetX!==void 0?V.x+F.labelOffsetX:V.x;let z=i.nodeLabelOffset;F.sourceStrategy&&F.labelOffsetX===void 0&&(z+=10);const W=F.labelOffsetX??z;return V.x+W}).attr("y",F=>{const V=E.get(F.id);if(F.className==="anchor")return F.labelOffsetY!==void 0?V.y+F.labelOffsetY:V.y-3;let z=-i.nodeLabelOffset;F.sourceStrategy&&F.labelOffsetY===void 0&&(z-=10);const W=F.labelOffsetY??z;return V.y+W}).attr("class","wardley-node-label").attr("fill",F=>F.className==="evolved"?a.evolutionStroke:F.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",F=>F.className==="anchor"?"bold":"normal").attr("text-anchor",F=>F.className==="anchor"?"middle":"start").attr("dominant-baseline",F=>F.className==="anchor"?"middle":"auto").text(F=>F.label),l.annotations.length>0){const F=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const z=V.coordinates.map(W=>({x:v(W.x),y:T(W.y)}));if(z.length>1)for(let W=0;W{const X=F.append("g").attr("class","wardley-annotation");X.append("circle").attr("cx",W.x).attr("cy",W.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),X.append("text").attr("x",W.x).attr("y",W.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=v(l.annotationsBox.x),z=T(l.annotationsBox.y);const W=10,X=16,j=11,re=F.append("g").attr("class","wardley-annotations-box"),Q=[...l.annotations].filter(ee=>ee.text).sort((ee,ne)=>ee.number-ne.number),oe=[];if(Q.forEach((ee,ne)=>{const ie=re.append("text").attr("x",V+W).attr("y",z+W+(ne+1)*X).attr("font-size",j).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${ee.number}. ${ee.text}`);oe.push(ie)}),oe.length>0){let ee=0,ne=0;oe.forEach(Fe=>{const ce=Fe.node(),ve=ce.getComputedTextLength();ee=Math.max(ee,ve);const Ce=ce.getBBox();ne=Math.max(ne,Ce.height)});const ie=ee+W*2+105,ae=Q.length*X+W*2+ne/2,de=i.padding,le=h-i.padding-ie,ye=i.padding,$e=d-i.padding-ae;V=Math.max(de,Math.min(V,le)),z=Math.max(ye,Math.min(z,$e)),oe.forEach((Fe,ce)=>{Fe.attr("x",V+W).attr("y",z+W+(ce+1)*X)}),re.insert("rect","text").attr("x",V).attr("y",z).attr("width",ie).attr("height",ae).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const F=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const z=v(V.x),W=T(V.y);F.append("text").attr("x",z).attr("y",W).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const F=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const z=v(V.x),W=T(V.y),X=60,j=30,re=20,Q=` M ${z} ${W-j/2} L ${z+X-re} ${W-j/2} L ${z+X-re} ${W-j/2-8} L ${z+X} ${W} L ${z+X-re} ${W+j/2+8} L ${z+X-re} ${W+j/2} L ${z} ${W+j/2} Z `;F.append("path").attr("d",Q).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),F.append("text").attr("x",z+X/2).attr("y",W+j/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.name)})}if(l.deaccelerators.length>0){const F=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(V=>{const z=v(V.x),W=T(V.y),X=60,j=30,re=20,Q=` M ${z+X} ${W-j/2} L ${z+re} ${W-j/2} L ${z+re} ${W-j/2-8} L ${z} ${W} L ${z+re} ${W+j/2+8} L ${z+re} ${W+j/2} L ${z+X} ${W+j/2} Z `;F.append("path").attr("d",Q).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),F.append("text").attr("x",z+X/2).attr("y",W+j/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),Qdt={draw:Zdt},Jdt=x(({wardley:t}={})=>{const e=Kl(),r=It(),n=fn(e,r.themeVariables),i=fn(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } .wardley-axes line, .wardley-axes path { stroke: ${i.axisColor}; } .wardley-axis-label { fill: ${i.axisTextColor}; } .wardley-stage-label { fill: ${i.axisTextColor}; } .wardley-grid line { stroke: ${i.gridColor}; } .wardley-node circle { fill: ${i.componentFill}; stroke: ${i.componentStroke}; } .wardley-node-label { fill: ${i.componentLabelColor}; } .wardley-link { stroke: ${i.linkStroke}; } .wardley-link--dashed { stroke-dasharray: 4 4; } .wardley-link-label { fill: ${i.axisTextColor}; } .wardley-trend line { stroke: ${i.evolutionStroke}; } .wardley-annotation-line { stroke: ${i.annotationStroke}; } .wardley-annotation circle { fill: ${i.annotationFill}; stroke: ${i.annotationStroke}; } .wardley-annotation text { fill: ${i.annotationTextColor}; } .wardley-annotations-box rect { fill: ${i.annotationFill}; stroke: ${i.annotationStroke}; } .wardley-annotations-box text { fill: ${i.annotationTextColor}; } .wardley-pipeline-box { stroke: ${i.componentStroke}; } .wardley-notes text { fill: ${i.axisTextColor}; } `},"styles"),eft={parser:K0e,db:Ydt,renderer:Qdt,styles:Jdt};const tft=Object.freeze(Object.defineProperty({__proto__:null,diagram:eft},Symbol.toStringTag,{value:"Module"}));var pve=x(()=>({domains:new Map,transitions:[]}),"createDefaultData"),kT=pve(),rft=x(()=>kT.domains,"getDomains"),nft=x(()=>kT.transitions,"getTransitions"),ift=x(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));kT.domains.set(r,{name:r,items:n})}},"setDomains"),aft=x(t=>{t&&(kT.transitions=t.filter(e=>e.from===e.to?(he.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),sft=x(()=>fn({...pr.cynefin,...It().cynefin}),"getConfig"),oft=x(()=>{Xr(),kT=pve()},"clear"),QC={getDomains:rft,getTransitions:nft,setDomains:ift,setTransitions:aft,getConfig:sft,clear:oft,setAccTitle:rn,getAccTitle:pn,setDiagramTitle:dn,getDiagramTitle:an,getAccDescription:mn,setAccDescription:gn},lft=x(t=>{va(t,QC),QC.setDomains(t.domains),QC.setTransitions(t.transitions)},"populate"),cft={parse:x(async t=>{const e=await Rs("cynefin",t);he.debug(e),lft(e)},"parse")};function kb(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}x(kb,"seededRandom");function gve(t){let e=0;for(let r=0;r{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),hft=x(()=>{const t=Kl(),e=It();return fn(t,e.themeVariables).cynefin},"getCynefinDomainColors"),zI=3,dft=x((t,e,r,n)=>{const i=n.db,a=i.getDomains(),s=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=hft();he.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,T=p+g*2,b={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},C=Yi(e);Rn(C,T,v,h.useMaxWidth??!0),C.attr("viewBox",`0 0 ${v} ${T}`),l&&C.append("title").text(l),u&&C.append("desc").text(u);const w=C.append("g").attr("transform",`translate(${g}, ${g})`),S=uft(f,p),E=mve(h.seed,e),_=w.append("g").attr("class","cynefin-backgrounds"),R=["complex","complicated","chaotic","clear"];for(const M of R){const P=S[M];_.append("rect").attr("class","cynefinDomain").attr("x",P.x).attr("y",P.y).attr("width",P.w).attr("height",P.h).attr("fill",b[M]).attr("fill-opacity",.4).attr("stroke","none")}const D=w.append("g").attr("class","cynefin-boundaries");D.append("path").attr("class","cynefinBoundary").attr("d",yve(f,p,E,y)).attr("fill","none"),D.append("path").attr("class","cynefinBoundary").attr("d",vve(f,p,E+100,y)).attr("fill","none"),D.append("path").attr("class","cynefinCliff").attr("d",xve(f,p)).attr("fill","none");const L=f*.15,B=p*.15;w.append("path").attr("class","cynefinConfusion").attr("d",bve(f/2,p/2,L,B)).attr("fill",b.confusion).attr("fill-opacity",.5);const $=w.append("g").attr("class","cynefin-labels");for(const M of R){const P=S[M];$.append("text").attr("class","cynefinDomainLabel").attr("x",P.cx).attr("y",m?P.cy-30:P.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(M.charAt(0).toUpperCase()+M.slice(1))}if($.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const M=w.append("g").attr("class","cynefin-subtitles");for(const P of R){const F=S[P],V=MH[P];M.append("text").attr("class","cynefinSubtitle").attr("x",F.cx).attr("y",F.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),M.append("text").attr("class","cynefinSubtitle").attr("x",F.cx).attr("y",F.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}M.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(MH.confusion.practice)}const A=w.append("g").attr("class","cynefin-items"),I=26,O=10,N=["complex","complicated","chaotic","clear","confusion"];for(const M of N){const P=a.get(M);if(!P||P.items.length===0)continue;const F=S[M],V=M==="confusion";let z=P.items,W=0;V&&P.items.length>zI&&(W=P.items.length-zI,z=P.items.slice(0,zI));let X;if(V){const j=m?22:14;X=F.cy+j}else X=F.cy+(m?25:15);if([...z].forEach((j,re)=>{const Q=X+re*(I+4),oe=A.append("g"),ee=oe.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(j.label);let ne=j.label.length*7;const ie=ee.node();if(ie&&typeof ie.getBBox=="function"){const le=ie.getBBox();le.width>0&&(ne=le.width)}const ae=ne+O*2,de=F.cx-ae/2;oe.attr("transform",`translate(${de}, ${Q})`),oe.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",ae).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[M]).attr("fill-opacity",.95),ee.attr("x",ae/2).attr("y",I/2)}),W>0){const j=X+z.length*(I+4),re=`+${W} more`,Q=A.append("g"),oe=Q.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(re);let ee=re.length*7;const ne=oe.node();if(ne&&typeof ne.getBBox=="function"){const de=ne.getBBox();de.width>0&&(ee=de.width)}const ie=ee+O*2,ae=F.cx-ie/2;Q.attr("transform",`translate(${ae}, ${j})`),Q.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",ie).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[M]).attr("fill-opacity",.6),oe.attr("x",ie/2).attr("y",I/2)}}if(s.length>0){const M=C.select("defs").empty()?C.append("defs"):C.select("defs"),P=`cynefin-arrow-${e}`;M.append("marker").attr("id",P).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const F=w.append("g").attr("class","cynefin-arrows");s.forEach(V=>{const z=S[V.from],W=S[V.to];if(!z||!W)return;if(V.from===V.to){he.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const X=z.cx,j=z.cy,re=W.cx,Q=W.cy,oe=(X+re)/2,ee=(j+Q)/2,ne=re-X,ie=Q-j,ae=Math.sqrt(ne*ne+ie*ie),de=ae*.15,le=-ie/ae,ye=ne/ae,$e=oe+le*de,Fe=ee+ye*de;F.append("path").attr("class","cynefinArrowLine").attr("d",`M${X},${j} Q${$e},${Fe} ${re},${Q}`).attr("fill","none").attr("marker-end",`url(#${P})`),V.label&&F.append("text").attr("class","cynefinArrowLabel").attr("x",$e).attr("y",Fe-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&w.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),fft={draw:dft},pft=x(()=>{const t=Kl(),e=It();return fn(t,e.themeVariables).cynefin},"getCynefinTheme"),gft=x(()=>{const t=pft();return` .cynefinDomain { stroke: none; } .cynefinDomainLabel { font-size: ${t.domainFontSize}px; font-weight: bold; fill: ${t.labelColor}; } .cynefinSubtitle { font-size: ${t.itemFontSize-1}px; fill: ${t.textColor}; font-style: italic; } .cynefinItem { fill-opacity: 0.95; stroke: ${t.boundaryColor}; stroke-width: 1; } .cynefinItemText { font-size: ${t.itemFontSize}px; fill: ${t.textColor}; } .cynefinItemOverflow { fill-opacity: 0.6; stroke: ${t.boundaryColor}; stroke-width: 1; stroke-dasharray: 3 2; } .cynefinBoundary { stroke: ${t.boundaryColor}; stroke-width: ${t.boundaryWidth}; stroke-dasharray: 6 3; } .cynefinCliff { stroke: ${t.cliffColor}; stroke-width: ${t.cliffWidth}; } .cynefinConfusion { stroke: ${t.boundaryColor}; stroke-width: 1.5; stroke-dasharray: 4 2; } .cynefinArrowLine { stroke: ${t.arrowColor}; stroke-width: ${t.arrowWidth}; fill: none; } .cynefinArrowHead { fill: ${t.arrowColor}; stroke: none; } .cynefinArrowLabel { font-size: ${t.itemFontSize-1}px; fill: ${t.textColor}; } .cynefinTitle { font-size: ${t.domainFontSize+2}px; font-weight: bold; fill: ${t.labelColor}; } `},"styles"),mft=gft,yft={parser:cft,db:QC,renderer:fft,styles:mft};const vft=Object.freeze(Object.defineProperty({__proto__:null,diagram:yft},Symbol.toStringTag,{value:"Module"}));var _F="",AF="",RF="",LF=[],yS=new Map,zc=x(t=>xr(t,Pe()),"sanitizeText"),Bf=x(t=>{switch(t.type){case"terminal":return{...t,value:zc(t.value)};case"nonterminal":return{...t,name:zc(t.name)};case"sequence":return{...t,elements:t.elements.map(Bf)};case"choice":return{...t,alternatives:t.alternatives.map(Bf)};case"optional":return{...t,element:Bf(t.element)};case"repetition":return{...t,element:Bf(t.element),separator:t.separator?Bf(t.separator):void 0};case"special":return{...t,text:zc(t.text)}}},"sanitizeAstNode"),xft=x(()=>{_F="",AF="",RF="",LF.length=0,yS.clear(),Xr(),he.debug("[Railroad] Database cleared")},"clear"),Tve=x(t=>{_F=zc(t),he.debug("[Railroad] Title set:",t)},"setTitle"),Cve=x(()=>_F,"getTitle"),bft=x(t=>{const e={...t,name:zc(t.name),definition:Bf(t.definition),comment:t.comment?zc(t.comment):void 0};he.debug("[Railroad] Adding rule:",e.name),yS.has(e.name)&&he.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),LF.push(e),yS.set(e.name,e)},"addRule"),Tft=x(()=>LF,"getRules"),Cft=x(t=>yS.get(t),"getRule"),wft=x(t=>{AF=zc(t).replace(/^\s+/g,""),he.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Eft=x(()=>AF,"getAccTitle"),Sft=x(t=>{RF=zc(t).replace(/\n\s+/g,` `),he.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),kft=x(()=>RF,"getAccDescription"),_ft=Tve,Aft=Cve,hn={clear:xft,setTitle:Tve,getTitle:Cve,addRule:bft,getRules:Tft,getRule:Cft,setAccTitle:wft,getAccTitle:Eft,setAccDescription:Sft,getAccDescription:kft,setDiagramTitle:_ft,getDiagramTitle:Aft},Ti={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},Rft=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,Lft=/^[\w "',.-]+$/,Ift=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),wve=x(t=>t?Object.keys(t).every(e=>e==="railroad"||Ift.has(e)):!1,"isRailroadStyleOptions"),Dft=x(t=>t?"railroad"in t&&t.railroad?t.railroad:wve(t)?t:{}:{},"extractRailroadOverrides"),Mft=x(t=>{if(!t||wve(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),Ur=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Rft.test(r)?r:e},"sanitizeColorValue"),Eve=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Lft.test(r)?r:e},"sanitizeFontFamilyValue"),Fu=x((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),Nft=x(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),Oft=x(t=>{const e=Eve(t.fontFamily,Ti.fontFamily),r=Nft(t.fontSize)??Ti.fontSize;return{...Ti,fontFamily:e,fontSize:r,terminalFill:Ur(t.secondBkg??t.secondaryColor,Ti.terminalFill),terminalStroke:Ur(t.secondaryBorderColor??t.lineColor,Ti.terminalStroke),terminalTextColor:Ur(t.secondaryTextColor??t.textColor,Ti.terminalTextColor),nonTerminalFill:Ur(t.mainBkg??t.background,Ti.nonTerminalFill),nonTerminalStroke:Ur(t.primaryBorderColor??t.lineColor,Ti.nonTerminalStroke),nonTerminalTextColor:Ur(t.primaryTextColor??t.textColor,Ti.nonTerminalTextColor),lineColor:Ur(t.lineColor,Ti.lineColor),markerFill:Ur(t.lineColor,Ti.markerFill),commentFill:Ur(t.labelBackground??t.tertiaryColor,Ti.commentFill),commentStroke:Ur(t.tertiaryBorderColor??t.lineColor,Ti.commentStroke),commentTextColor:Ur(t.tertiaryTextColor??t.textColor,Ti.commentTextColor),specialFill:Ur(t.tertiaryColor??t.secondaryColor,Ti.specialFill),specialStroke:Ur(t.tertiaryBorderColor??t.secondaryBorderColor,Ti.specialStroke),ruleNameColor:Ur(t.titleColor??t.textColor,Ti.ruleNameColor)}},"buildThemeDefaults"),IF=x(t=>{const e=It(),r={...Kl(),...e.themeVariables??{},...Mft(t)},n=Oft(r),i={...e.railroad??{},...Dft(t)};return{compactMode:i.compactMode??n.compactMode,padding:Fu(i.padding,n.padding),verticalSeparation:Fu(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:Fu(i.horizontalSeparation,n.horizontalSeparation),arcRadius:Fu(i.arcRadius,n.arcRadius),fontSize:Fu(i.fontSize,n.fontSize),fontFamily:Eve(i.fontFamily,n.fontFamily),terminalFill:Ur(i.terminalFill,n.terminalFill),terminalStroke:Ur(i.terminalStroke,n.terminalStroke),terminalTextColor:Ur(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Ur(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Ur(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Ur(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Ur(i.lineColor,n.lineColor),strokeWidth:Fu(i.strokeWidth,n.strokeWidth),markerFill:Ur(i.markerFill,n.markerFill),commentFill:Ur(i.commentFill,n.commentFill),commentStroke:Ur(i.commentStroke,n.commentStroke),commentTextColor:Ur(i.commentTextColor,n.commentTextColor),specialFill:Ur(i.specialFill,n.specialFill),specialStroke:Ur(i.specialStroke,n.specialStroke),ruleNameColor:Ur(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:Fu(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),eA=x(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:s,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:y,ruleNameColor:v}=IF(t);return` .railroad-diagram { font-family: ${e}; font-size: ${r}px; } .railroad-terminal rect { fill: ${n}; stroke: ${i}; stroke-width: ${h}px; } .railroad-terminal text { fill: ${a}; font-family: ${e}; font-size: ${r}px; text-anchor: middle; dominant-baseline: middle; } .railroad-nonterminal rect { fill: ${s}; stroke: ${o}; stroke-width: ${h}px; } .railroad-nonterminal text { fill: ${l}; font-family: ${e}; font-size: ${r}px; text-anchor: middle; dominant-baseline: middle; } .railroad-line { stroke: ${u}; stroke-width: ${h}px; fill: none; } .railroad-start circle, .railroad-end circle { fill: ${d}; } .railroad-comment ellipse { fill: ${f}; stroke: ${p}; stroke-width: ${h}px; } .railroad-comment text { fill: ${g}; font-style: italic; font-family: ${e}; font-size: ${r}px; text-anchor: middle; dominant-baseline: middle; } .railroad-special rect { fill: ${m}; stroke: ${y}; stroke-width: ${h}px; stroke-dasharray: 5,3; } .railroad-special text { fill: ${l}; font-family: ${e}; font-size: ${r}px; text-anchor: middle; dominant-baseline: middle; } .railroad-rule-name { font-weight: bold; fill: ${v}; font-family: ${e}; font-size: ${r}px; } .railroad-group { /* Grouping container, no specific styles */ } `},"getStyles"),l0,us=(l0=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},x(l0,"PathBuilder"),l0),c0,$ft=(c0=class{constructor(e,r=IF()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-terminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-nonterminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,a=0,s=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),s=Math.max(s,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,a=0;for(const f of n)i=Math.max(i,f.dimensions.width),a+=f.dimensions.height;a+=(n.length-1)*this.config.verticalSeparation;const s=this.config.arcRadius,o=s*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=a/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=s*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new us,T=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,T,s,d+(T?s:-s)).lineTo(s,g-(T?s:-s)).arcTo(s,s,0,!1,!T,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new us,C=m+f.dimensions.width,w=l-s*2;g===d?b.moveTo(C,g).lineTo(l,d):b.moveTo(C,g).lineTo(w,g).arcTo(s,s,0,!1,!T,l-s,g+(T?-s:s)).lineTo(l-s,d+(T?s:-s)).arcTo(s,s,0,!1,T,l,d),u.append("path").attr("class","railroad-line").attr("d",b.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:a,up:d,down:a-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,a=i*2,s=n.dimensions.width+i*4,o=n.dimensions.height+a,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=a;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new us().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new us().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new us().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(s-i*2,0).arcTo(i,i,0,!1,!0,s-i,i).lineTo(s-i,f-i).arcTo(i,i,0,!1,!1,s,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:s,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,s=a*2,o=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+s+(l?s:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?s:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new us().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new us().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new us().moveTo(d+i.dimensions.width,g).arcTo(a,a,0,!1,!0,d+i.dimensions.width+a,g+a).lineTo(d+i.dimensions.width+a,m).arcTo(a,a,0,!1,!0,d+i.dimensions.width,m+a).lineTo(a*2,m+a).arcTo(a,a,0,!1,!0,a,m).lineTo(a,g+a).arcTo(a,a,0,!1,!0,a*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new us().moveTo(0,g).arcTo(a,a,0,!1,!1,a,g-a).lineTo(a,a).arcTo(a,a,0,!1,!0,a*2,0).lineTo(o-a*2,0).arcTo(a,a,0,!1,!0,o-a,a).lineTo(o-a,g-a).arcTo(a,a,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-special");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",a=this.measureText(i).width+20,s=a+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${s}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",a).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",s+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new us().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new us().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},x(c0,"RailroadRenderer"),c0),NH=x((t,e,r)=>{Rn(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),Pft=x((t,e,r)=>{he.debug(`[Railroad] Rendering diagram `+t);try{const n=Yi(e);n.attr("class","railroad-diagram");const i=It().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=hn.getRules();if(he.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){he.warn("[Railroad] No rules to render"),NH(n,{height:100,width:200},a);return}const l=new $ft(n,IF()).renderDiagram(s);NH(n,l,a),he.debug("[Railroad] Render complete")}catch(n){throw he.error("[Railroad] Render error:",n),n}},"draw"),tA={draw:Pft},Bft=_B().Railroad.parser.LangiumParser,Ff=x(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Ff);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Ff);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Ff(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Ff(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Ff(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),Fft=x(t=>({name:t.name,definition:Ff(t.definition)}),"transformRule"),zft=x(t=>{va(t,hn),t.title&&hn.setTitle(t.title),t.rules.map(e=>hn.addRule(Fft(e)))},"populateDb"),Gft={parse:x(t=>{hn.clear(),he.debug("[Railroad Parser] Starting Langium parse");const e=Bft.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new wT(e);const r=e.value;he.debug("[Railroad Parser] Parsed rules:",r.rules.length),zft(r),he.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:hn}},Vft={parser:Gft,db:hn,renderer:tA,styles:eA};const Wft=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vft},Symbol.toStringTag,{value:"Module"}));var qft=AB().RailroadEbnf.parser.LangiumParser,JC=x(t=>{const e=t.alternatives.map(Uft);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),Uft=x(t=>{const e=t.elements.map(Yft);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),Sve=x(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return JC(t.element);case"EbnfOptional":return{type:"optional",element:JC(t.element)};case"EbnfRepetition":return{type:"repetition",element:JC(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),Hft=x((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},Sve(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),Yft=x(t=>t.postfixes.reduce((e,r)=>Hft(e,r),Sve(t.base)),"transformTerm"),Xft=x(t=>({name:t.name,definition:JC(t.definition)}),"transformRule"),jft=x(t=>{va(t,hn),t.title&&hn.setTitle(t.title),t.rules.map(e=>hn.addRule(Xft(e)))},"populateDb"),Kft={parse:x(t=>{hn.clear(),he.debug("[EBNF Parser] Starting Langium parse");const e=qft.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new wT(e);const r=e.value;he.debug("[EBNF Parser] Parsed rules:",r.rules.length),jft(r),he.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:hn}},Zft={parser:Kft,db:hn,renderer:tA,styles:eA};const Qft=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zft},Symbol.toStringTag,{value:"Module"}));var Jft=RB().RailroadAbnf.parser.LangiumParser,zM=x(t=>{const e=t.alternatives.map(ept);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),ept=x(t=>{const e=t.elements.map(rpt);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),tpt=x(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),rpt=x(t=>{const e=npt(t.primary);if(!t.repeat)return e;const{min:r,max:n}=tpt(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),npt=x(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return zM(t.element);case"AbnfOptionalGroup":return{type:"optional",element:zM(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),ipt=x(t=>({name:t.name,definition:zM(t.definition)}),"transformRule"),apt=x(t=>{va(t,hn),t.title&&hn.setTitle(t.title),t.rules.map(e=>hn.addRule(ipt(e)))},"populateDb"),spt={parse:x(t=>{hn.clear(),he.debug("[ABNF Parser] Starting Langium parse");const e=Jft.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new wT(e);const r=e.value;he.debug("[ABNF Parser] Parsed rules:",r.rules.length),apt(r),he.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:hn}},opt={parser:spt,db:hn,renderer:tA,styles:eA};const lpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:opt},Symbol.toStringTag,{value:"Module"}));var cpt=LB().RailroadPeg.parser.LangiumParser,kve=x(t=>{const e=t.alternatives.map(upt);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),upt=x(t=>{const e=t.elements.map(hpt);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),hpt=x(t=>{const e=dpt(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${OH(e)}`:`!${OH(e)}`}:e},"transformPrefix"),OH=x(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),dpt=x(t=>{const e=fpt(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),fpt=x(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return kve(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),ppt=x(t=>({name:t.name,definition:kve(t.definition)}),"transformRule"),gpt=x(t=>{va(t,hn),t.title&&hn.setTitle(t.title),t.rules.map(e=>hn.addRule(ppt(e)))},"populateDb"),mpt={parse:x(t=>{hn.clear(),he.debug("[PEG Parser] Starting Langium parse");const e=cpt.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new wT(e);const r=e.value;he.debug("[PEG Parser] Parsed rules:",r.rules.length),gpt(r),he.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:hn}},ypt={parser:mpt,db:hn,renderer:tA,styles:eA};const vpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ypt},Symbol.toStringTag,{value:"Module"})),xpt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:Qpe,createInfoServices:Jpe},Symbol.toStringTag,{value:"Module"})),bpt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:ege,createPacketServices:tge},Symbol.toStringTag,{value:"Module"})),Tpt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:rge,createPieServices:nge},Symbol.toStringTag,{value:"Module"})),Cpt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:ige,createTreeViewServices:age},Symbol.toStringTag,{value:"Module"})),wpt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:sge,createArchitectureServices:oge},Symbol.toStringTag,{value:"Module"})),Ept=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Kpe,createGitGraphServices:Zpe},Symbol.toStringTag,{value:"Module"})),Spt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:cge,createEventModelingServices:uge},Symbol.toStringTag,{value:"Module"})),kpt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Ppe,createRadarServices:Bpe},Symbol.toStringTag,{value:"Module"})),_pt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:Fpe,createRailroadServices:_B},Symbol.toStringTag,{value:"Module"})),Apt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:zpe,createRailroadEbnfServices:AB},Symbol.toStringTag,{value:"Module"})),Rpt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:Gpe,createRailroadAbnfServices:RB},Symbol.toStringTag,{value:"Module"})),Lpt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:Vpe,createRailroadPegServices:LB},Symbol.toStringTag,{value:"Module"})),Ipt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:qpe,createTreemapServices:Upe},Symbol.toStringTag,{value:"Module"})),Dpt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:Hpe,createWardleyServices:Ype},Symbol.toStringTag,{value:"Module"})),Mpt=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:Xpe,createCynefinServices:jpe},Symbol.toStringTag,{value:"Module"}));export{Bt as _,ngt as m};