var t=Object.create,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,s=(t,n)=>e(t,"name",{value:n,configurable:!0}),o=(t,e)=>function(){return e||(0,t[r(t)[0]])((e={exports:{}}).exports,e),e.exports},l=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},h=(t,i,s,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of r(i))a.call(t,l)||l===s||e(t,l,{get:()=>i[l],enumerable:!(o=n(i,l))||o.enumerable});return t},u=(t,e,n)=>(h(t,e,"default"),n&&h(n,e,"default")),d=(n,r,a)=>(a=null!=n?t(i(n)):{},h(!r&&n&&n.__esModule?a:e(a,"default",{value:n,enumerable:!0}),n)),p=o({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js"(t,e){!function(n,r){"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs=r()}(t,(function(){var t=6e4,e=36e5,n="millisecond",r="second",i="minute",a="hour",o="day",l="week",c="month",h="quarter",u="year",d="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={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:s((function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}),"ordinal")},y=s((function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t}),"m"),v={s:y,z:s((function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")}),"z"),m:s((function t(e,n){if(e.date()1)return t(s[0])}else{var o=e.name;b[o]=e,i=o}return!r&&i&&(x=i),i||!r&&x}),"t"),_=s((function(t,e){if(k(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new C(n)}),"O"),E=v;E.l=T,E.i=k,E.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var C=function(){function m(t){this.$L=T(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}s(m,"M");var y=m.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(E.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(g);if(r){var i=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return E},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return _(t){}),"trace"),debug:s(((...t)=>{}),"debug"),info:s(((...t)=>{}),"info"),warn:s(((...t)=>{}),"warn"),error:s(((...t)=>{}),"error"),fatal:s(((...t)=>{}),"fatal")},y=s((function(t="fatal"){let e=f.fatal;"string"==typeof t?t.toLowerCase()in f&&(e=f[t]):"number"==typeof t&&(e=t),m.trace=()=>{},m.debug=()=>{},m.info=()=>{},m.warn=()=>{},m.error=()=>{},m.fatal=()=>{},e<=f.fatal&&(m.fatal=console.error?console.error.bind(console,v("FATAL"),"color: orange"):console.log.bind(console,"",v("FATAL"))),e<=f.error&&(m.error=console.error?console.error.bind(console,v("ERROR"),"color: orange"):console.log.bind(console,"",v("ERROR"))),e<=f.warn&&(m.warn=console.warn?console.warn.bind(console,v("WARN"),"color: orange"):console.log.bind(console,"",v("WARN"))),e<=f.info&&(m.info=console.info?console.info.bind(console,v("INFO"),"color: lightblue"):console.log.bind(console,"",v("INFO"))),e<=f.debug&&(m.debug=console.debug?console.debug.bind(console,v("DEBUG"),"color: lightgreen"):console.log.bind(console,"",v("DEBUG"))),e<=f.trace&&(m.trace=console.debug?console.debug.bind(console,v("TRACE"),"color: lightgreen"):console.log.bind(console,"",v("TRACE")))}),"setLogLevel"),v=s((t=>`%c${(0,g.default)().format("ss.SSS")} : ${t} : `),"format"),x=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,b=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,w=/\s*%%.*\n/gm,k=class extends Error{static{s(this,"UnknownDiagramError")}constructor(t){super(t),this.name="UnknownDiagramError"}},T={},_=s((function(t,e){t=t.replace(x,"").replace(b,"").replace(w,"\n");for(const[n,{detector:r}]of Object.entries(T)){if(r(t,e))return n}throw new k(`No diagram type detected matching given configuration for text: ${t}`)}),"detectType"),E=s(((...t)=>{for(const{id:e,detector:n,loader:r}of t)C(e,n,r)}),"registerLazyLoadedDiagrams"),C=s(((t,e,n)=>{T[t]&&m.warn(`Detector with key ${t} already exists. Overwriting.`),T[t]={detector:e,loader:n},m.debug(`Detector with key ${t} added${n?" with loader":""}`)}),"addDetector"),S=s((t=>T[t].loader),"getDiagramLoader"),A=s(((t,e,{depth:n=2,clobber:r=!1}={})=>{const i={depth:n,clobber:r};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>A(t,e,i))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||n<=0?null!=t&&"object"==typeof t&&"object"==typeof e?Object.assign(t,e):e:(void 0!==e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).forEach((i=>{"object"!=typeof e[i]||void 0!==t[i]&&"object"!=typeof t[i]?(r||"object"!=typeof t[i]&&"object"!=typeof e[i])&&(t[i]=e[i]):(void 0===t[i]&&(t[i]=Array.isArray(e[i])?[]:{}),t[i]=A(t[i],e[i],{depth:n-1,clobber:r}))})),t)}),"assignWithDepth"),L=A,N={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:s((t=>t>=255?255:t<0?0:t),"r"),g:s((t=>t>=255?255:t<0?0:t),"g"),b:s((t=>t>=255?255:t<0?0:t),"b"),h:s((t=>t%360),"h"),s:s((t=>t>=100?100:t<0?0:t),"s"),l:s((t=>t>=100?100:t<0?0:t),"l"),a:s((t=>t>=1?1:t<0?0:t),"a")},toLinear:s((t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92}),"toLinear"),hue2rgb:s(((t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t)),"hue2rgb"),hsl2rgb:s((({h:t,s:e,l:n},r)=>{if(!e)return 2.55*n;t/=360,e/=100;const i=(n/=100)<.5?n*(1+e):n+e-n*e,a=2*n-i;switch(r){case"r":return 255*N.hue2rgb(a,i,t+1/3);case"g":return 255*N.hue2rgb(a,i,t);case"b":return 255*N.hue2rgb(a,i,t-1/3)}}),"hsl2rgb"),rgb2hsl:s((({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),a=Math.min(t,e,n),s=(i+a)/2;if("l"===r)return 100*s;if(i===a)return 0;const o=i-a;if("s"===r)return 100*(s>.5?o/(2-i-a):o/(i+a));switch(i){case t:return 60*((e-n)/o+(ee>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t))),"clamp"),round:s((t=>Math.round(1e10*t)/1e10),"round")},unit:{dec2hex:s((t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}),"dec2hex")}},M={};for(let t=0;t<=255;t++)M[t]=I.unit.dec2hex(t);var R,D=0,O=1,P=2,B=class{static{s(this,"Type")}constructor(){this.type=D}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=D}is(t){return this.type===t}},$=class{static{s(this,"Channels")}constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new B}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=D,this}_ensureHSL(){const t=this.data,{h:e,s:n,l:r}=t;void 0===e&&(t.h=I.channel.rgb2hsl(t,"h")),void 0===n&&(t.s=I.channel.rgb2hsl(t,"s")),void 0===r&&(t.l=I.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:e,g:n,b:r}=t;void 0===e&&(t.r=I.channel.hsl2rgb(t,"r")),void 0===n&&(t.g=I.channel.hsl2rgb(t,"g")),void 0===r&&(t.b=I.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,e=t.r;return this.type.is(P)||void 0===e?(this._ensureHSL(),I.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(P)||void 0===e?(this._ensureHSL(),I.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(P)||void 0===e?(this._ensureHSL(),I.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(O)||void 0===e?(this._ensureRGB(),I.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(O)||void 0===e?(this._ensureRGB(),I.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(O)||void 0===e?(this._ensureRGB(),I.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(O),this.changed=!0,this.data.r=t}set g(t){this.type.set(O),this.changed=!0,this.data.g=t}set b(t){this.type.set(O),this.changed=!0,this.data.b=t}set h(t){this.type.set(P),this.changed=!0,this.data.h=t}set s(t){this.type.set(P),this.changed=!0,this.data.s=t}set l(t){this.type.set(P),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}},F=new $({r:0,g:0,b:0,a:0},"transparent"),z={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:s((t=>{if(35!==t.charCodeAt(0))return;const e=t.match(z.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,a=i%4==0,s=i>4,o=s?1:17,l=s?8:4,c=a?0:-1,h=s?255:15;return F.set({r:(r>>l*(c+3)&h)*o,g:(r>>l*(c+2)&h)*o,b:(r>>l*(c+1)&h)*o,a:a?(r&h)*o/255:1},t)}),"parse"),stringify:s((t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${M[Math.round(e)]}${M[Math.round(n)]}${M[Math.round(r)]}${M[Math.round(255*i)]}`:`#${M[Math.round(e)]}${M[Math.round(n)]}${M[Math.round(r)]}`}),"stringify")},U=z,G={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:s((t=>{const e=t.match(G.hueRe);if(e){const[,t,n]=e;switch(n){case"grad":return I.channel.clamp.h(.9*parseFloat(t));case"rad":return I.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return I.channel.clamp.h(360*parseFloat(t))}}return I.channel.clamp.h(parseFloat(t))}),"_hue2deg"),parse:s((t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const n=t.match(G.re);if(!n)return;const[,r,i,a,s,o]=n;return F.set({h:G._hue2deg(r),s:I.channel.clamp.s(parseFloat(i)),l:I.channel.clamp.l(parseFloat(a)),a:s?I.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)}),"parse"),stringify:s((t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${I.lang.round(e)}, ${I.lang.round(n)}%, ${I.lang.round(r)}%, ${i})`:`hsl(${I.lang.round(e)}, ${I.lang.round(n)}%, ${I.lang.round(r)}%)`}),"stringify")},q=G,j={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:s((t=>{t=t.toLowerCase();const e=j.colors[t];if(e)return U.parse(e)}),"parse"),stringify:s((t=>{const e=U.stringify(t);for(const t in j.colors)if(j.colors[t]===e)return t}),"stringify")},Y=j,W={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:s((t=>{const e=t.charCodeAt(0);if(114!==e&&82!==e)return;const n=t.match(W.re);if(!n)return;const[,r,i,a,s,o,l,c,h]=n;return F.set({r:I.channel.clamp.r(i?2.55*parseFloat(r):parseFloat(r)),g:I.channel.clamp.g(s?2.55*parseFloat(a):parseFloat(a)),b:I.channel.clamp.b(l?2.55*parseFloat(o):parseFloat(o)),a:c?I.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},t)}),"parse"),stringify:s((t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${I.lang.round(e)}, ${I.lang.round(n)}, ${I.lang.round(r)}, ${I.lang.round(i)})`:`rgb(${I.lang.round(e)}, ${I.lang.round(n)}, ${I.lang.round(r)})`}),"stringify")},H=W,V={format:{keyword:Y,hex:U,rgb:H,rgba:H,hsl:q,hsla:q},parse:s((t=>{if("string"!=typeof t)return t;const e=U.parse(t)||H.parse(t)||q.parse(t)||Y.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)}),"parse"),stringify:s((t=>!t.changed&&t.color?t.color:t.type.is(P)||void 0===t.data.r?q.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?H.stringify(t):U.stringify(t)),"stringify")},X=s(((t,e)=>{const n=V.parse(t);for(const t in e)n[t]=I.channel.clamp[t](e[t]);return V.stringify(n)}),"change"),K=X,Z=s(((t,e,n=0,r=1)=>{if("number"!=typeof t)return K(t,{a:e});const i=F.set({r:I.channel.clamp.r(t),g:I.channel.clamp.g(e),b:I.channel.clamp.b(n),a:I.channel.clamp.a(r)});return V.stringify(i)}),"rgba"),Q=Z,J=s(((t,e)=>I.lang.round(V.parse(t)[e])),"channel"),tt=s((t=>{const{r:e,g:n,b:r}=V.parse(t),i=.2126*I.channel.toLinear(e)+.7152*I.channel.toLinear(n)+.0722*I.channel.toLinear(r);return I.lang.round(i)}),"luminance"),et=tt,nt=s((t=>et(t)>=.5),"isLight"),rt=s((t=>!nt(t)),"isDark"),it=s(((t,e,n)=>{const r=V.parse(t),i=r[e],a=I.channel.clamp[e](i+n);return i!==a&&(r[e]=a),V.stringify(r)}),"adjustChannel"),at=s(((t,e)=>it(t,"l",e)),"lighten"),st=s(((t,e)=>it(t,"l",-e)),"darken"),ot=s(((t,e)=>{const n=V.parse(t),r={};for(const t in e)e[t]&&(r[t]=n[t]+e[t]);return K(t,r)}),"adjust"),lt=ot,ct=s(((t,e,n=50)=>{const{r:r,g:i,b:a,a:s}=V.parse(t),{r:o,g:l,b:c,a:h}=V.parse(e),u=n/100,d=2*u-1,p=s-h,g=((d*p==-1?d:(d+p)/(1+d*p))+1)/2,f=1-g;return Q(r*g+o*f,i*g+l*f,a*g+c*f,s*u+h*(1-u))}),"mix"),ht=s(((t,e=100)=>{const n=V.parse(t);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,ct(n,t,e)}),"invert"),ut=s(((t,e)=>lt(t,e?{s:-40,l:10}:{s:-40,l:-10})),"mkBorder"),dt=class{static{s(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||lt(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||lt(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||ht(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||ht(this.tertiaryColor),this.lineColor=this.lineColor||ht(this.background),this.arrowheadColor=this.arrowheadColor||ht(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?st(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||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||ht(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||at(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.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||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||lt(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lt(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lt(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lt(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lt(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lt(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||lt(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lt(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lt(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},pt=s((t=>{const e=new dt;return e.calculate(t),e}),"getThemeVariables"),gt=class{static{s(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=lt(this.primaryColor,{h:-160}),this.primaryBorderColor=ht(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=ht(this.primaryColor),this.secondaryTextColor=ht(this.secondaryColor),this.tertiaryTextColor=ht(this.tertiaryColor),this.lineColor=ht(this.background),this.textColor=ht(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(ht("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Q(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=st("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=st(this.sectionBkgColor,10),this.taskBorderColor=Q(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Q(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.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=at(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=at(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=at(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=lt(this.primaryColor,{h:64}),this.fillType3=lt(this.secondaryColor,{h:64}),this.fillType4=lt(this.primaryColor,{h:-64}),this.fillType5=lt(this.secondaryColor,{h:-64}),this.fillType6=lt(this.primaryColor,{h:128}),this.fillType7=lt(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||lt(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lt(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lt(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lt(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lt(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lt(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lt(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lt(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lt(this.primaryColor,{h:330});for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},ft=s((t=>{const e=new gt;return e.calculate(t),e}),"getThemeVariables"),mt=class{static{s(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=lt(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=lt(this.primaryColor,{h:-160}),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=ht(this.primaryColor),this.secondaryTextColor=ht(this.secondaryColor),this.tertiaryTextColor=ht(this.tertiaryColor),this.lineColor=ht(this.background),this.textColor=ht(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=Q(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.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||lt(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lt(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lt(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lt(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lt(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lt(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lt(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lt(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lt(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},yt=s((t=>{const e=new mt;return e.calculate(t),e}),"getThemeVariables"),vt=class{static{s(this,"Theme")}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=at("#cde498",10),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=ht(this.primaryColor),this.secondaryTextColor=ht(this.secondaryColor),this.tertiaryTextColor=ht(this.primaryColor),this.lineColor=ht(this.background),this.textColor=ht(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=st(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||lt(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lt(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lt(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lt(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lt(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lt(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lt(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lt(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lt(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},xt=s((t=>{const e=new vt;return e.calculate(t),e}),"getThemeVariables"),bt=class{static{s(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=at(this.contrast,55),this.background="#ffffff",this.tertiaryColor=lt(this.primaryColor,{h:-160}),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=ht(this.primaryColor),this.secondaryTextColor=ht(this.secondaryColor),this.tertiaryTextColor=ht(this.tertiaryColor),this.lineColor=ht(this.background),this.textColor=ht(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=at(this.contrast,55),this.border2=this.contrast,this.actorBorder=at(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},wt={base:{getThemeVariables:pt},dark:{getThemeVariables:ft},default:{getThemeVariables:yt},forest:{getThemeVariables:xt},neutral:{getThemeVariables:s((t=>{const e=new bt;return e.calculate(t),e}),"getThemeVariables")}},kt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},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,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"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},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},Tt={...kt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:wt.default.getThemeVariables(),sequence:{...kt.sequence,messageFont:s((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont"),noteFont:s((function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}}),"noteFont"),actorFont:s((function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}),"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...kt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...kt.c4,useWidth:void 0,personFont:s((function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}}),"personFont"),external_personFont:s((function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}}),"external_personFont"),systemFont:s((function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}}),"systemFont"),external_systemFont:s((function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}}),"external_systemFont"),system_dbFont:s((function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}}),"system_dbFont"),external_system_dbFont:s((function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}}),"external_system_dbFont"),system_queueFont:s((function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}}),"system_queueFont"),external_system_queueFont:s((function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}}),"external_system_queueFont"),containerFont:s((function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}}),"containerFont"),external_containerFont:s((function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}}),"external_containerFont"),container_dbFont:s((function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}}),"container_dbFont"),external_container_dbFont:s((function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}}),"external_container_dbFont"),container_queueFont:s((function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}}),"container_queueFont"),external_container_queueFont:s((function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}}),"external_container_queueFont"),componentFont:s((function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}}),"componentFont"),external_componentFont:s((function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}}),"external_componentFont"),component_dbFont:s((function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}}),"component_dbFont"),external_component_dbFont:s((function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}}),"external_component_dbFont"),component_queueFont:s((function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}}),"component_queueFont"),external_component_queueFont:s((function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}}),"external_component_queueFont"),boundaryFont:s((function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}}),"boundaryFont"),messageFont:s((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont")},pie:{...kt.pie,useWidth:984},xyChart:{...kt.xyChart,useWidth:void 0},requirement:{...kt.requirement,useWidth:void 0},packet:{...kt.packet}},_t=s(((t,e="")=>Object.keys(t).reduce(((n,r)=>Array.isArray(t[r])?n:"object"==typeof t[r]&&null!==t[r]?[...n,e+r,..._t(t[r],"")]:[...n,e+r]),[])),"keyify"),Et=new Set(_t(Tt,"")),Ct=Tt,St=s((t=>{if(m.debug("sanitizeDirective called with",t),"object"==typeof t&&null!=t)if(Array.isArray(t))t.forEach((t=>St(t)));else{for(const e of Object.keys(t)){if(m.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Et.has(e)||null==t[e]){m.debug("sanitize deleting key: ",e),delete t[e];continue}if("object"==typeof t[e]){m.debug("sanitizing object",e),St(t[e]);continue}const n=["themeCSS","fontFamily","altFontFamily"];for(const r of n)e.includes(r)&&(m.debug("sanitizing css option",e),t[e]=At(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const n=t.themeVariables[e];n?.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}m.debug("After sanitization",t)}}),"sanitizeDirective"),At=s((t=>{let e=0,n=0;for(const r of t){if(e{let n=L({},t),r={};for(const t of e)zt(t),r=L(r,t);if(n=L(n,r),r.theme&&r.theme in wt){const t=L({},R),e=L(t.themeVariables||{},r.themeVariables);n.theme&&n.theme in wt&&(n.themeVariables=wt[n.theme].getThemeVariables(e))}return Wt(Mt=n),Mt}),"updateCurrentConfig"),Dt=s((t=>(Nt=L({},Lt),Nt=L(Nt,t),t.theme&&wt[t.theme]&&(Nt.themeVariables=wt[t.theme].getThemeVariables(t.themeVariables)),Rt(Nt,It),Nt)),"setSiteConfig"),Ot=s((t=>{R=L({},t)}),"saveConfigFromInitialize"),Pt=s((t=>(Nt=L(Nt,t),Rt(Nt,It),Nt)),"updateSiteConfig"),Bt=s((()=>L({},Nt)),"getSiteConfig"),$t=s((t=>(Wt(t),L(Mt,t),Ft())),"setConfig"),Ft=s((()=>L({},Mt)),"getConfig"),zt=s((t=>{t&&(["secure",...Nt.secure??[]].forEach((e=>{Object.hasOwn(t,e)&&(m.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=>{"string"==typeof t[e]&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],"object"==typeof t[e]&&zt(t[e])})))}),"sanitize"),Ut=s((t=>{St(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),It.push(t),Rt(Nt,It)}),"addDirective"),Gt=s(((t=Nt)=>{Rt(t,It=[])}),"reset"),qt={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},jt={},Yt=s((t=>{jt[t]||(m.warn(qt[t]),jt[t]=!0)}),"issueWarning"),Wt=s((t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Yt("LAZY_LOAD_DEPRECATED")}),"checkConfig"),{entries:Ht,setPrototypeOf:Vt,isFrozen:Xt,getPrototypeOf:Kt,getOwnPropertyDescriptor:Zt}=Object,{freeze:Qt,seal:Jt,create:te}=Object,{apply:ee,construct:ne}="undefined"!=typeof Reflect&&Reflect;Qt||(Qt=s((function(t){return t}),"freeze")),Jt||(Jt=s((function(t){return t}),"seal")),ee||(ee=s((function(t,e,n){return t.apply(e,n)}),"apply")),ne||(ne=s((function(t,e){return new t(...e)}),"construct"));var re=fe(Array.prototype.forEach),ie=fe(Array.prototype.pop),ae=fe(Array.prototype.push),se=fe(String.prototype.toLowerCase),oe=fe(String.prototype.toString),le=fe(String.prototype.match),ce=fe(String.prototype.replace),he=fe(String.prototype.indexOf),ue=fe(String.prototype.trim),de=fe(Object.prototype.hasOwnProperty),pe=fe(RegExp.prototype.test),ge=me(TypeError);function fe(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:se;Vt&&Vt(t,null);let r=e.length;for(;r--;){let i=e[r];if("string"==typeof i){const t=n(i);t!==i&&(Xt(e)||(e[r]=t),i=t)}t[i]=!0}return t}function ve(t){for(let e=0;e/gm),De=Jt(/\${[\w\W]*}/gm),Oe=Jt(/^data-[\-\w.\u00B7-\uFFFF]/),Pe=Jt(/^aria-[\-\w]+$/),Be=Jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$e=Jt(/^(?:\w+script|data):/i),Fe=Jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ze=Jt(/^html$/i),Ue=Jt(/^[a-z][.\w]*(-[.\w]+)+$/i),Ge=Object.freeze({__proto__:null,ARIA_ATTR:Pe,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:Ue,DATA_ATTR:Oe,DOCTYPE_NAME:ze,ERB_EXPR:Re,IS_ALLOWED_URI:Be,IS_SCRIPT_OR_DATA:$e,MUSTACHE_EXPR:Me,TMPLIT_EXPR:De}),qe=1,je=3,Ye=7,We=8,He=9,Ve=s((function(){return"undefined"==typeof window?null:window}),"getGlobal"),Xe=s((function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}),"_createTrustedTypesPolicy");function Ke(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ve();const e=s((t=>Ke(t)),"DOMPurify");if(e.version="3.2.1",e.removed=[],!t||!t.document||t.document.nodeType!==He)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:h,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:g}=t,f=c.prototype,m=be(f,"cloneNode"),y=be(f,"remove"),v=be(f,"nextSibling"),x=be(f,"childNodes"),b=be(f,"parentNode");if("function"==typeof o){const t=n.createElement("template");t.content&&t.content.ownerDocument&&(n=t.content.ownerDocument)}let w,k="";const{implementation:T,createNodeIterator:_,createDocumentFragment:E,getElementsByTagName:C}=n,{importNode:S}=r;let A={};e.isSupported="function"==typeof Ht&&"function"==typeof b&&T&&void 0!==T.createHTMLDocument;const{MUSTACHE_EXPR:L,ERB_EXPR:N,TMPLIT_EXPR:I,DATA_ATTR:M,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:P}=Ge;let{IS_ALLOWED_URI:B}=Ge,$=null;const F=ye({},[...we,...ke,...Te,...Ee,...Se]);let z=null;const U=ye({},[...Ae,...Le,...Ne,...Ie]);let G=Object.seal(te(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}})),q=null,j=null,Y=!0,W=!0,H=!1,V=!0,X=!1,K=!0,Z=!1,Q=!1,J=!1,tt=!1,et=!1,nt=!1,rt=!0,it=!1;const at="user-content-";let st=!0,ot=!1,lt={},ct=null;const ht=ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ut=null;const dt=ye({},["audio","video","img","source","image","track"]);let pt=null;const gt=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",mt="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let vt=yt,xt=!1,bt=null;const wt=ye({},[ft,mt,yt],oe);let kt=ye({},["mi","mo","mn","ms","mtext"]),Tt=ye({},["annotation-xml"]);const _t=ye({},["title","style","font","a","script"]);let Et=null;const Ct=["application/xhtml+xml","text/html"],St="text/html";let At=null,Lt=null;const Nt=n.createElement("form"),It=s((function(t){return t instanceof RegExp||t instanceof Function}),"isRegexOrFunction"),Mt=s((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt||Lt!==t){if(t&&"object"==typeof t||(t={}),t=xe(t),Et=-1===Ct.indexOf(t.PARSER_MEDIA_TYPE)?St:t.PARSER_MEDIA_TYPE,At="application/xhtml+xml"===Et?oe:se,$=de(t,"ALLOWED_TAGS")?ye({},t.ALLOWED_TAGS,At):F,z=de(t,"ALLOWED_ATTR")?ye({},t.ALLOWED_ATTR,At):U,bt=de(t,"ALLOWED_NAMESPACES")?ye({},t.ALLOWED_NAMESPACES,oe):wt,pt=de(t,"ADD_URI_SAFE_ATTR")?ye(xe(gt),t.ADD_URI_SAFE_ATTR,At):gt,ut=de(t,"ADD_DATA_URI_TAGS")?ye(xe(dt),t.ADD_DATA_URI_TAGS,At):dt,ct=de(t,"FORBID_CONTENTS")?ye({},t.FORBID_CONTENTS,At):ht,q=de(t,"FORBID_TAGS")?ye({},t.FORBID_TAGS,At):{},j=de(t,"FORBID_ATTR")?ye({},t.FORBID_ATTR,At):{},lt=!!de(t,"USE_PROFILES")&&t.USE_PROFILES,Y=!1!==t.ALLOW_ARIA_ATTR,W=!1!==t.ALLOW_DATA_ATTR,H=t.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,X=t.SAFE_FOR_TEMPLATES||!1,K=!1!==t.SAFE_FOR_XML,Z=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,et=t.RETURN_DOM_FRAGMENT||!1,nt=t.RETURN_TRUSTED_TYPE||!1,J=t.FORCE_BODY||!1,rt=!1!==t.SANITIZE_DOM,it=t.SANITIZE_NAMED_PROPS||!1,st=!1!==t.KEEP_CONTENT,ot=t.IN_PLACE||!1,B=t.ALLOWED_URI_REGEXP||Be,vt=t.NAMESPACE||yt,kt=t.MATHML_TEXT_INTEGRATION_POINTS||kt,Tt=t.HTML_INTEGRATION_POINTS||Tt,G=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&It(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&It(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(G.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),et&&(tt=!0),lt&&($=ye({},Se),z=[],!0===lt.html&&(ye($,we),ye(z,Ae)),!0===lt.svg&&(ye($,ke),ye(z,Le),ye(z,Ie)),!0===lt.svgFilters&&(ye($,Te),ye(z,Le),ye(z,Ie)),!0===lt.mathMl&&(ye($,Ee),ye(z,Ne),ye(z,Ie))),t.ADD_TAGS&&($===F&&($=xe($)),ye($,t.ADD_TAGS,At)),t.ADD_ATTR&&(z===U&&(z=xe(z)),ye(z,t.ADD_ATTR,At)),t.ADD_URI_SAFE_ATTR&&ye(pt,t.ADD_URI_SAFE_ATTR,At),t.FORBID_CONTENTS&&(ct===ht&&(ct=xe(ct)),ye(ct,t.FORBID_CONTENTS,At)),st&&($["#text"]=!0),Z&&ye($,["html","head","body"]),$.table&&(ye($,["tbody"]),delete q.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=t.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else void 0===w&&(w=Xe(g,i)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));Qt&&Qt(t),Lt=t}}),"_parseConfig"),Rt=ye({},[...ke,...Te,..._e]),Dt=ye({},[...Ee,...Ce]),Ot=s((function(t){let e=b(t);e&&e.tagName||(e={namespaceURI:vt,tagName:"template"});const n=se(t.tagName),r=se(e.tagName);return!!bt[t.namespaceURI]&&(t.namespaceURI===mt?e.namespaceURI===yt?"svg"===n:e.namespaceURI===ft?"svg"===n&&("annotation-xml"===r||kt[r]):Boolean(Rt[n]):t.namespaceURI===ft?e.namespaceURI===yt?"math"===n:e.namespaceURI===mt?"math"===n&&Tt[r]:Boolean(Dt[n]):t.namespaceURI===yt?!(e.namespaceURI===mt&&!Tt[r])&&(!(e.namespaceURI===ft&&!kt[r])&&(!Dt[n]&&(_t[n]||!Rt[n]))):!("application/xhtml+xml"!==Et||!bt[t.namespaceURI]))}),"_checkValidNamespace"),Pt=s((function(t){ae(e.removed,{element:t});try{b(t).removeChild(t)}catch(e){y(t)}}),"_forceRemove"),Bt=s((function(t,n){try{ae(e.removed,{attribute:n.getAttributeNode(t),from:n})}catch(t){ae(e.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!z[t])if(tt||et)try{Pt(n)}catch(t){}else try{n.setAttribute(t,"")}catch(t){}}),"_removeAttribute"),$t=s((function(t){let e=null,r=null;if(J)t=""+t;else{const e=le(t,/^[\r\n\t ]+/);r=e&&e[0]}"application/xhtml+xml"===Et&&vt===yt&&(t=''+t+"");const i=w?w.createHTML(t):t;if(vt===yt)try{e=(new p).parseFromString(i,Et)}catch(t){}if(!e||!e.documentElement){e=T.createDocument(vt,"template",null);try{e.documentElement.innerHTML=xt?k:i}catch(t){}}const a=e.body||e.documentElement;return t&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),vt===yt?C.call(e,Z?"html":"body")[0]:Z?e.documentElement:a}),"_initDocument"),Ft=s((function(t){return _.call(t.ownerDocument||t,t,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)}),"_createNodeIterator"),zt=s((function(t){return t instanceof d&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof u)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)}),"_isClobbered"),Ut=s((function(t){return"function"==typeof l&&t instanceof l}),"_isNode");function Gt(t,n,r){A[t]&&re(A[t],(t=>{t.call(e,n,r,Lt)}))}s(Gt,"_executeHook");const qt=s((function(t){let n=null;if(Gt("beforeSanitizeElements",t,null),zt(t))return Pt(t),!0;const r=At(t.nodeName);if(Gt("uponSanitizeElement",t,{tagName:r,allowedTags:$}),t.hasChildNodes()&&!Ut(t.firstElementChild)&&pe(/<[/\w]/g,t.innerHTML)&&pe(/<[/\w]/g,t.textContent))return Pt(t),!0;if(t.nodeType===Ye)return Pt(t),!0;if(K&&t.nodeType===We&&pe(/<[/\w]/g,t.data))return Pt(t),!0;if(!$[r]||q[r]){if(!q[r]&&Yt(r)){if(G.tagNameCheck instanceof RegExp&&pe(G.tagNameCheck,r))return!1;if(G.tagNameCheck instanceof Function&&G.tagNameCheck(r))return!1}if(st&&!ct[r]){const e=b(t)||t.parentNode,n=x(t)||t.childNodes;if(n&&e){for(let r=n.length-1;r>=0;--r){const i=m(n[r],!0);i.__removalCount=(t.__removalCount||0)+1,e.insertBefore(i,v(t))}}}return Pt(t),!0}return t instanceof c&&!Ot(t)?(Pt(t),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!pe(/<\/no(script|embed|frames)/i,t.innerHTML)?(X&&t.nodeType===je&&(n=t.textContent,re([L,N,I],(t=>{n=ce(n,t," ")})),t.textContent!==n&&(ae(e.removed,{element:t.cloneNode()}),t.textContent=n)),Gt("afterSanitizeElements",t,null),!1):(Pt(t),!0)}),"_sanitizeElements"),jt=s((function(t,e,r){if(rt&&("id"===e||"name"===e)&&(r in n||r in Nt))return!1;if(W&&!j[e]&&pe(M,e));else if(Y&&pe(R,e));else if(!z[e]||j[e]){if(!(Yt(t)&&(G.tagNameCheck instanceof RegExp&&pe(G.tagNameCheck,t)||G.tagNameCheck instanceof Function&&G.tagNameCheck(t))&&(G.attributeNameCheck instanceof RegExp&&pe(G.attributeNameCheck,e)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(e))||"is"===e&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&pe(G.tagNameCheck,r)||G.tagNameCheck instanceof Function&&G.tagNameCheck(r))))return!1}else if(pt[e]);else if(pe(B,ce(r,O,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==he(r,"data:")||!ut[t]){if(H&&!pe(D,ce(r,O,"")));else if(r)return!1}else;return!0}),"_isValidAttribute"),Yt=s((function(t){return"annotation-xml"!==t&&le(t,P)}),"_isBasicCustomElement"),Wt=s((function(t){Gt("beforeSanitizeAttributes",t,null);const{attributes:n}=t;if(!n)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let i=n.length;for(;i--;){const a=n[i],{name:s,namespaceURI:o,value:l}=a,c=At(s);let h="value"===s?l:ue(l);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,Gt("uponSanitizeAttribute",t,r),h=r.attrValue,!it||"id"!==c&&"name"!==c||(Bt(s,t),h=at+h),K&&pe(/((--!?|])>)|<\/(style|title)/i,h)){Bt(s,t);continue}if(r.forceKeepAttr)continue;if(Bt(s,t),!r.keepAttr)continue;if(!V&&pe(/\/>/i,h)){Bt(s,t);continue}X&&re([L,N,I],(t=>{h=ce(h,t," ")}));const u=At(t.nodeName);if(jt(u,c,h)){if(w&&"object"==typeof g&&"function"==typeof g.getAttributeType)if(o);else switch(g.getAttributeType(u,c)){case"TrustedHTML":h=w.createHTML(h);break;case"TrustedScriptURL":h=w.createScriptURL(h)}try{o?t.setAttributeNS(o,s,h):t.setAttribute(s,h),zt(t)?Pt(t):ie(e.removed)}catch(t){}}}Gt("afterSanitizeAttributes",t,null)}),"_sanitizeAttributes"),Vt=s((function t(e){let n=null;const r=Ft(e);for(Gt("beforeSanitizeShadowDOM",e,null);n=r.nextNode();)Gt("uponSanitizeShadowNode",n,null),qt(n)||(n.content instanceof a&&t(n.content),Wt(n));Gt("afterSanitizeShadowDOM",e,null)}),"_sanitizeShadowDOM");return e.sanitize=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,s=null,o=null,c=null;if(xt=!t,xt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Ut(t)){if("function"!=typeof t.toString)throw ge("toString is not a function");if("string"!=typeof(t=t.toString()))throw ge("dirty is not a string, aborting")}if(!e.isSupported)return t;if(Q||Mt(n),e.removed=[],"string"==typeof t&&(ot=!1),ot){if(t.nodeName){const e=At(t.nodeName);if(!$[e]||q[e])throw ge("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)i=$t("\x3c!----\x3e"),s=i.ownerDocument.importNode(t,!0),s.nodeType===qe&&"BODY"===s.nodeName||"HTML"===s.nodeName?i=s:i.appendChild(s);else{if(!tt&&!X&&!Z&&-1===t.indexOf("<"))return w&&nt?w.createHTML(t):t;if(i=$t(t),!i)return tt?null:nt?k:""}i&&J&&Pt(i.firstChild);const h=Ft(ot?t:i);for(;o=h.nextNode();)qt(o)||(o.content instanceof a&&Vt(o.content),Wt(o));if(ot)return t;if(tt){if(et)for(c=E.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(z.shadowroot||z.shadowrootmode)&&(c=S.call(r,c,!0)),c}let u=Z?i.outerHTML:i.innerHTML;return Z&&$["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&pe(ze,i.ownerDocument.doctype.name)&&(u="\n"+u),X&&re([L,N,I],(t=>{u=ce(u,t," ")})),w&&nt?w.createHTML(u):u},e.setConfig=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Mt(t),Q=!0},e.clearConfig=function(){Lt=null,Q=!1},e.isValidAttribute=function(t,e,n){Lt||Mt({});const r=At(t),i=At(e);return jt(r,i,n)},e.addHook=function(t,e){"function"==typeof e&&(A[t]=A[t]||[],ae(A[t],e))},e.removeHook=function(t){if(A[t])return ie(A[t])},e.removeHooks=function(t){A[t]&&(A[t]=[])},e.removeAllHooks=function(){A={}},e}s(Ke,"createDOMPurify");var Ze=Ke(),Qe=//gi,Je=s((t=>{if(!t)return[""];return hn(t).replace(/\\n/g,"#br#").split("#br#")}),"getRows"),tn=(()=>{let t=!1;return()=>{t||(en(),t=!0)}})();function en(){const t="data-temp-href-target";Ze.addHook("beforeSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")})),Ze.addHook("afterSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),"_blank"===e.getAttribute("target")&&e.setAttribute("rel","noopener"))}))}s(en,"setupDompurifyHooks");var nn=s((t=>{tn();return Ze.sanitize(t)}),"removeScript"),rn=s(((t,e)=>{if(!1!==e.flowchart?.htmlLabels){const n=e.securityLevel;"antiscript"===n||"strict"===n?t=nn(t):"loose"!==n&&(t=(t=(t=hn(t)).replace(//g,">")).replace(/=/g,"="),t=cn(t))}return t}),"sanitizeMore"),an=s(((t,e)=>t?t=e.dompurifyConfig?Ze.sanitize(rn(t,e),e.dompurifyConfig).toString():Ze.sanitize(rn(t,e),{FORBID_TAGS:["style"]}).toString():t),"sanitizeText"),sn=s(((t,e)=>"string"==typeof t?an(t,e):t.flat().map((t=>an(t,e)))),"sanitizeTextOrArray"),on=s((t=>Qe.test(t)),"hasBreaks"),ln=s((t=>t.split(Qe)),"splitBreaks"),cn=s((t=>t.replace(/#br#/g,"
")),"placeholderToBreak"),hn=s((t=>t.replace(Qe,"#br#")),"breakToPlaceholder"),un=s((t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e}),"getUrl"),dn=s((t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),pn=s((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.max(...e)}),"getMax"),gn=s((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.min(...e)}),"getMin"),fn=s((function(t){const e=t.split(/(,)/),n=[];for(let t=0;t0&&t+1Math.max(0,t.split(e).length-1)),"countOccurrence"),yn=s(((t,e)=>{const n=mn(t,"~"),r=mn(e,"~");return 1===n&&1===r}),"shouldCombineSets"),vn=s((t=>{const e=mn(t,"~");let n=!1;if(e<=1)return t;e%2!=0&&t.startsWith("~")&&(t=t.substring(1),n=!0);const r=[...t];let i=r.indexOf("~"),a=r.lastIndexOf("~");for(;-1!==i&&-1!==a&&i!==a;)r[i]="<",r[a]=">",i=r.indexOf("~"),a=r.lastIndexOf("~");return n&&r.unshift("~"),r.join("")}),"processSet"),xn=s((()=>void 0!==window.MathMLElement),"isMathMLSupported"),bn=/\$\$(.*)\$\$/g,wn=s((t=>(t.match(bn)?.length??0)>0),"hasKatex"),kn=s((async(t,e)=>{t=await Tn(t,e);const n=document.createElement("div");n.innerHTML=t,n.id="katex-temp",n.style.visibility="hidden",n.style.position="absolute",n.style.top="0";document.querySelector("body")?.insertAdjacentElement("beforeend",n);const r={width:n.clientWidth,height:n.clientHeight};return n.remove(),r}),"calculateMathMLDimensions"),Tn=s((async(t,e)=>{if(!wn(t))return t;if(!(xn()||e.legacyMathML||e.forceLegacyMathML))return t.replace(bn,"MathML is unsupported in this environment.");const{default:n}=await Promise.resolve().then((function(){return TP})),r=e.forceLegacyMathML||!xn()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(Qe).map((t=>wn(t)?`
${t}
`:`
${t}
`)).join("").replace(bn,((t,e)=>n.renderToString(e,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g," ").replace(//g,"")))}),"renderKatex"),_n={getRows:Je,sanitizeText:an,sanitizeTextOrArray:sn,hasBreaks:on,splitBreaks:ln,lineBreakRegex:Qe,removeScript:nn,getUrl:un,evaluate:dn,getMax:pn,getMin:gn},En=s((function(t,e){for(let n of e)t.attr(n[0],n[1])}),"d3Attrs"),Cn=s((function(t,e,n){let r=new Map;return n?(r.set("width","100%"),r.set("style",`max-width: ${e}px;`)):(r.set("height",t),r.set("width",e)),r}),"calculateSvgSizeAttrs"),Sn=s((function(t,e,n,r){const i=Cn(e,n,r);En(t,i)}),"configureSvgSize"),An=s((function(t,e,n,r){const i=e.node().getBBox(),a=i.width,s=i.height;m.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;m.info(`Graph bounds: ${o}x${l}`,t),o=a+2*n,l=s+2*n,m.info(`Calculated bounds: ${o}x${l}`),Sn(e,l,o,r);const c=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;e.attr("viewBox",c)}),"setupGraphViewbox"),Ln={},Nn=s(((t,e,n)=>{let r="";return t in Ln&&Ln[t]?r=Ln[t](n):m.warn(`No theme found for ${t}`),` & {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n fill: ${n.textColor}\n }\n\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${n.errorBkgColor};\n }\n & .error-text {\n fill: ${n.errorTextColor};\n stroke: ${n.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 1px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n & .edge-thickness-invisible {\n stroke-width: 0;\n fill: none;\n }\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${n.lineColor};\n stroke: ${n.lineColor};\n }\n & .marker.cross {\n stroke: ${n.lineColor};\n }\n\n & svg {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n }\n & p {\n margin: 0\n }\n\n ${r}\n\n ${e}\n`}),"getStyles"),In=s(((t,e)=>{void 0!==e&&(Ln[t]=e)}),"addStylesForDiagram"),Mn=Nn,Rn={};l(Rn,{clear:()=>$n,getAccDescription:()=>Gn,getAccTitle:()=>zn,getDiagramTitle:()=>jn,setAccDescription:()=>Un,setAccTitle:()=>Fn,setDiagramTitle:()=>qn});var Dn="",On="",Pn="",Bn=s((t=>an(t,Ft())),"sanitizeText"),$n=s((()=>{Dn="",Pn="",On=""}),"clear"),Fn=s((t=>{Dn=Bn(t).replace(/^\s+/g,"")}),"setAccTitle"),zn=s((()=>Dn),"getAccTitle"),Un=s((t=>{Pn=Bn(t).replace(/\n\s+/g,"\n")}),"setAccDescription"),Gn=s((()=>Pn),"getAccDescription"),qn=s((t=>{On=Bn(t)}),"setDiagramTitle"),jn=s((()=>On),"getDiagramTitle"),Yn=m,Wn=y,Hn=Ft,Vn=$t,Xn=Lt,Kn=s((t=>an(t,Hn())),"sanitizeText"),Zn=An,Qn=s((()=>Rn),"getCommonDb"),Jn={},tr=s(((t,e,n)=>{Jn[t]&&Yn.warn(`Diagram with id ${t} already registered. Overwriting.`),Jn[t]=e,n&&C(t,n),In(t,e.styles),e.injectUtils?.(Yn,Wn,Hn,Kn,Zn,Qn(),(()=>{}))}),"registerDiagram"),er=s((t=>{if(t in Jn)return Jn[t];throw new nr(t)}),"getDiagram"),nr=class extends Error{static{s(this,"DiagramNotFoundError")}constructor(t){super(`Diagram ${t} not found.`)}};function rr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function ir(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function ar(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function sr(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function or(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i>>1;n(t[e],r)<0?i=e+1:a=e}while(i>>1;n(t[e],r)<=0?i=e+1:a=e}while(in&&r(t[s-1],e)>-r(t[s],e)?s-1:s}return 2!==t.length?(e=ar,n=s(((e,n)=>ar(t(e),n)),"compare2"),r=s(((e,n)=>t(e)-n),"delta")):(e=t===ar||t===sr?t:lr,n=t,r=t),s(i,"left"),s(a,"right"),s(o,"center"),{left:i,center:o,right:a}}function lr(){return 0}function cr(t){return null===t?NaN:+t}s(rr,"max"),s(ir,"min"),s(ar,"ascending"),s(sr,"descending"),s(or,"bisector"),s(lr,"zero"),s(cr,"number");var hr=or(ar),ur=hr.right;hr.left,or(cr).center;var dr=ur,pr=class extends Map{static{s(this,"InternMap")}constructor(t,e=yr){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(gr(this,t))}has(t){return super.has(gr(this,t))}set(t,e){return super.set(fr(this,t),e)}delete(t){return super.delete(mr(this,t))}};function gr({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function fr({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function mr({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function yr(t){return null!==t&&"object"==typeof t?t.valueOf():t}s(gr,"intern_get"),s(fr,"intern_set"),s(mr,"intern_delete"),s(yr,"keyof");var vr=Math.sqrt(50),xr=Math.sqrt(10),br=Math.sqrt(2);function wr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=vr?10:a>=xr?5:a>=br?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/s,o=Math.round(t*c),l=Math.round(e*c),o/ce&&--l,c=-c):(c=Math.pow(10,i)*s,o=Math.round(t/c),l=Math.round(e/c),o*ce&&--l),l0))return[];if((t=+t)===(e=+e))return[t];const r=e=i))return[];const o=a-i+1,l=new Array(o);if(r)if(s<0)for(let t=0;t+t(e)}function Nr(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Ir(){return!this.__axis}function Mr(t,e){var n=[],r=null,i=null,a=6,o=6,l=3,c="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,h=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",d=1===t||3===t?Sr:Ar;function p(s){var p=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,g=null==i?e.tickFormat?e.tickFormat.apply(e,n):Cr:i,f=Math.max(a,0)+l,m=e.range(),y=+m[0]+c,v=+m[m.length-1]+c,x=(e.bandwidth?Nr:Lr)(e.copy(),c),b=s.selection?s.selection():s,w=b.selectAll(".domain").data([null]),k=b.selectAll(".tick").data(p,e).order(),T=k.exit(),_=k.enter().append("g").attr("class","tick"),E=k.select("line"),C=k.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(_),E=E.merge(_.append("line").attr("stroke","currentColor").attr(u+"2",h*a)),C=C.merge(_.append("text").attr("fill","currentColor").attr(u,h*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),s!==b&&(w=w.transition(s),k=k.transition(s),E=E.transition(s),C=C.transition(s),T=T.transition(s).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=x(t))?d(t+c):this.getAttribute("transform")})),_.attr("opacity",1e-6).attr("transform",(function(t){var e=this.parentNode.__axis;return d((e&&isFinite(e=e(t))?e:x(t))+c)}))),T.remove(),w.attr("d",4===t||2===t?o?"M"+h*o+","+y+"H"+c+"V"+v+"H"+h*o:"M"+c+","+y+"V"+v:o?"M"+y+","+h*o+"V"+c+"H"+v+"V"+h*o:"M"+y+","+c+"H"+v),k.attr("opacity",1).attr("transform",(function(t){return d(x(t)+c)})),E.attr(u+"2",h*a),C.attr(u,h*f).text(g),b.filter(Ir).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each((function(){this.__axis=x}))}return s(p,"axis"),p.scale=function(t){return arguments.length?(e=t,p):e},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),p):n.slice()},p.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),p):r&&r.slice()},p.tickFormat=function(t){return arguments.length?(i=t,p):i},p.tickSize=function(t){return arguments.length?(a=o=+t,p):a},p.tickSizeInner=function(t){return arguments.length?(a=+t,p):a},p.tickSizeOuter=function(t){return arguments.length?(o=+t,p):o},p.tickPadding=function(t){return arguments.length?(l=+t,p):l},p.offset=function(t){return arguments.length?(c=+t,p):c},p}function Rr(t){return Mr(1,t)}function Dr(t){return Mr(3,t)}function Or(){}function Pr(t){return null==t?Or:function(){return this.querySelector(t)}}function Br(t){"function"!=typeof t&&(t=Pr(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=b+1);!(x=m[w])&&++w=0;)(r=i[a])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this}function pi(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=gi),s(e,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),a=0;ae?1:t>=e?0:NaN}function fi(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function mi(){return Array.from(this)}function yi(){for(var t=this._groups,e=0,n=t.length;e=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),ki.hasOwnProperty(e)?{space:ki[e],local:t}:t}function _i(t){return function(){this.removeAttribute(t)}}function Ei(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ci(t,e){return function(){this.setAttribute(t,e)}}function Si(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ai(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Li(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Ni(t,e){var n=Ti(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?Ei:_i:"function"==typeof e?n.local?Li:Ai:n.local?Si:Ci)(n,e))}function Ii(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Mi(t){return function(){this.style.removeProperty(t)}}function Ri(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Di(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Oi(t,e,n){return arguments.length>1?this.each((null==e?Mi:"function"==typeof e?Di:Ri)(t,e,null==n?"":n)):Pi(this.node(),t)}function Pi(t,e){return t.style.getPropertyValue(e)||Ii(t).getComputedStyle(t,null).getPropertyValue(e)}function Bi(t){return function(){delete this[t]}}function $i(t,e){return function(){this[t]=e}}function Fi(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function zi(t,e){return arguments.length>1?this.each((null==e?Bi:"function"==typeof e?Fi:$i)(t,e)):this.node()[t]}function Ui(t){return t.trim().split(/^|\s+/)}function Gi(t){return t.classList||new qi(t)}function qi(t){this._node=t,this._names=Ui(t.getAttribute("class")||"")}function ji(t,e){for(var n=Gi(t),r=-1,i=e.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function ka(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))}),"remove"),contains:s((function(t){return this._names.indexOf(t)>=0}),"contains")},s(ji,"classedAdd"),s(Yi,"classedRemove"),s(Wi,"classedTrue"),s(Hi,"classedFalse"),s(Vi,"classedFunction"),s(Xi,"default"),s(Ki,"textRemove"),s(Zi,"textConstant"),s(Qi,"textFunction"),s(Ji,"default"),s(ta,"htmlRemove"),s(ea,"htmlConstant"),s(na,"htmlFunction"),s(ra,"default"),s(ia,"raise"),s(aa,"default"),s(sa,"lower"),s(oa,"default"),s(la,"creatorInherit"),s(ca,"creatorFixed"),s(ha,"default"),s(ua,"default"),s(da,"constantNull"),s(pa,"default"),s(ga,"remove"),s(fa,"default"),s(ma,"selection_cloneShallow"),s(ya,"selection_cloneDeep"),s(va,"default"),s(xa,"default"),s(ba,"contextListener"),s(wa,"parseTypenames"),s(ka,"onRemove"),s(Ta,"onAdd"),s(_a,"default"),s(Ea,"dispatchEvent"),s(Ca,"dispatchConstant"),s(Sa,"dispatchFunction"),s(Aa,"default"),s(La,"default");var Na=[null];function Ia(t,e){this._groups=t,this._parents=e}function Ma(){return new Ia([[document.documentElement]],Na)}function Ra(){return this}s(Ia,"Selection"),s(Ma,"selection"),s(Ra,"selection_selection"),Ia.prototype=Ma.prototype={constructor:Ia,select:Br,selectAll:Gr,selectChild:Vr,selectChildren:Qr,filter:Jr,data:oi,enter:ei,exit:ci,join:hi,merge:ui,selection:Ra,order:di,sort:pi,call:fi,nodes:mi,node:yi,size:vi,empty:xi,each:bi,attr:Ni,style:Oi,property:zi,classed:Xi,text:Ji,html:ra,raise:aa,lower:oa,append:ua,insert:pa,remove:fa,clone:va,datum:xa,on:_a,dispatch:Aa,[Symbol.iterator]:La};var Da=Ma;function Oa(t){return"string"==typeof t?new Ia([[document.querySelector(t)]],[document.documentElement]):new Ia([[t]],Na)}function Pa(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ba(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function $a(){}s(Oa,"default"),s(Pa,"default"),s(Ba,"extend"),s($a,"Color");var Fa=1/.7,za="\\s*([+-]?\\d+)\\s*",Ua="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qa=/^#([0-9a-f]{3,8})$/,ja=new RegExp(`^rgb\\(${za},${za},${za}\\)$`),Ya=new RegExp(`^rgb\\(${Ga},${Ga},${Ga}\\)$`),Wa=new RegExp(`^rgba\\(${za},${za},${za},${Ua}\\)$`),Ha=new RegExp(`^rgba\\(${Ga},${Ga},${Ga},${Ua}\\)$`),Va=new RegExp(`^hsl\\(${Ua},${Ga},${Ga}\\)$`),Xa=new RegExp(`^hsla\\(${Ua},${Ga},${Ga},${Ua}\\)$`),Ka={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Za(){return this.rgb().formatHex()}function Qa(){return this.rgb().formatHex8()}function Ja(){return gs(this).formatHsl()}function ts(){return this.rgb().formatRgb()}function es(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=qa.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ns(e):3===n?new ss(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?rs(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?rs(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ja.exec(t))?new ss(e[1],e[2],e[3],1):(e=Ya.exec(t))?new ss(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Wa.exec(t))?rs(e[1],e[2],e[3],e[4]):(e=Ha.exec(t))?rs(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Va.exec(t))?ps(e[1],e[2]/100,e[3]/100,1):(e=Xa.exec(t))?ps(e[1],e[2]/100,e[3]/100,e[4]):Ka.hasOwnProperty(t)?ns(Ka[t]):"transparent"===t?new ss(NaN,NaN,NaN,0):null}function ns(t){return new ss(t>>16&255,t>>8&255,255&t,1)}function rs(t,e,n,r){return r<=0&&(t=e=n=NaN),new ss(t,e,n,r)}function is(t){return t instanceof $a||(t=es(t)),t?new ss((t=t.rgb()).r,t.g,t.b,t.opacity):new ss}function as(t,e,n,r){return 1===arguments.length?is(t):new ss(t,e,n,null==r?1:r)}function ss(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function os(){return`#${ds(this.r)}${ds(this.g)}${ds(this.b)}`}function ls(){return`#${ds(this.r)}${ds(this.g)}${ds(this.b)}${ds(255*(isNaN(this.opacity)?1:this.opacity))}`}function cs(){const t=hs(this.opacity);return`${1===t?"rgb(":"rgba("}${us(this.r)}, ${us(this.g)}, ${us(this.b)}${1===t?")":`, ${t})`}`}function hs(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function us(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ds(t){return((t=us(t))<16?"0":"")+t.toString(16)}function ps(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ms(t,e,n,r)}function gs(t){if(t instanceof ms)return new ms(t.h,t.s,t.l,t.opacity);if(t instanceof $a||(t=es(t)),!t)return new ms;if(t instanceof ms)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,o=a-i,l=(a+i)/2;return o?(s=e===a?(n-r)/o+6*(n0&&l<1?0:s,new ms(s,o,l,t.opacity)}function fs(t,e,n,r){return 1===arguments.length?gs(t):new ms(t,e,n,null==r?1:r)}function ms(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ys(t){return(t=(t||0)%360)<0?t+360:t}function vs(t){return Math.max(0,Math.min(1,t||0))}function xs(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Pa($a,es,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Za,formatHex:Za,formatHex8:Qa,formatHsl:Ja,formatRgb:ts,toString:ts}),s(Za,"color_formatHex"),s(Qa,"color_formatHex8"),s(Ja,"color_formatHsl"),s(ts,"color_formatRgb"),s(es,"color"),s(ns,"rgbn"),s(rs,"rgba"),s(is,"rgbConvert"),s(as,"rgb"),s(ss,"Rgb"),Pa(ss,as,Ba($a,{brighter(t){return t=null==t?Fa:Math.pow(Fa,t),new ss(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new ss(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ss(us(this.r),us(this.g),us(this.b),hs(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:os,formatHex:os,formatHex8:ls,formatRgb:cs,toString:cs})),s(os,"rgb_formatHex"),s(ls,"rgb_formatHex8"),s(cs,"rgb_formatRgb"),s(hs,"clampa"),s(us,"clampi"),s(ds,"hex"),s(ps,"hsla"),s(gs,"hslConvert"),s(fs,"hsl"),s(ms,"Hsl"),Pa(ms,fs,Ba($a,{brighter(t){return t=null==t?Fa:Math.pow(Fa,t),new ms(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new ms(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ss(xs(t>=240?t-240:t+120,i,r),xs(t,i,r),xs(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ms(ys(this.h),vs(this.s),vs(this.l),hs(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=hs(this.opacity);return`${1===t?"hsl(":"hsla("}${ys(this.h)}, ${100*vs(this.s)}%, ${100*vs(this.l)}%${1===t?")":`, ${t})`}`}})),s(ys,"clamph"),s(vs,"clampt"),s(xs,"hsl2rgb");var bs=Math.PI/180,ws=180/Math.PI,ks=4/29,Ts=6/29,_s=3*Ts*Ts;function Es(t){if(t instanceof Ss)return new Ss(t.l,t.a,t.b,t.opacity);if(t instanceof Ds)return Os(t);t instanceof ss||(t=is(t));var e,n,r=Is(t.r),i=Is(t.g),a=Is(t.b),s=As((.2225045*r+.7168786*i+.0606169*a)/1);return r===i&&i===a?e=n=s:(e=As((.4360747*r+.3850649*i+.1430804*a)/.96422),n=As((.0139322*r+.0971045*i+.7141733*a)/.82521)),new Ss(116*s-16,500*(e-s),200*(s-n),t.opacity)}function Cs(t,e,n,r){return 1===arguments.length?Es(t):new Ss(t,e,n,null==r?1:r)}function Ss(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function As(t){return t>.008856451679035631?Math.pow(t,1/3):t/_s+ks}function Ls(t){return t>Ts?t*t*t:_s*(t-ks)}function Ns(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Is(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ms(t){if(t instanceof Ds)return new Ds(t.h,t.c,t.l,t.opacity);if(t instanceof Ss||(t=Es(t)),0===t.a&&0===t.b)return new Ds(NaN,0()=>t),"default");function Bs(t,e){return function(n){return t+n*e}}function $s(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Fs(t,e){var n=e-t;return n?Bs(t,n>180||n<-180?n-360*Math.round(n/360):n):Ps(isNaN(t)?e:t)}function zs(t){return 1==(t=+t)?Us:function(e,n){return n-e?$s(e,n,t):Ps(isNaN(e)?n:e)}}function Us(t,e){var n=e-t;return n?Bs(t,n):Ps(isNaN(t)?e:t)}function Gs(t){return function(e,n){var r=t((e=Rs(e)).h,(n=Rs(n)).h),i=Us(e.c,n.c),a=Us(e.l,n.l),s=Us(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=a(t),e.opacity=s(t),e+""}}}s(Bs,"linear"),s($s,"exponential"),s(Fs,"hue"),s(zs,"gamma"),s(Us,"nogamma"),s(Gs,"hcl");var qs=Gs(Fs);function js(t,e,n,r,i){var a=t*t,s=a*t;return((1-3*t+3*a-s)*e+(4-6*a+3*s)*n+(1+3*t+3*a-3*s)*r+s*i)/6}s(js,"basis"),s((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],s=r>0?t[r-1]:2*i-a,o=ra&&(i=e.slice(a,i),o[s]?o[s]+=i:o[++s]=i),(n=n[0])===(r=r[0])?o[s]?o[s]+=r:o[++s]=r:(o[++s]=null,l.push({i:s,x:Ks(n,r)})),a=Js.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Ks(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}function l(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Ks(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}function c(t,e,n,r,a,s){if(t!==n||e!==r){var o=a.push(i(a)+"scale(",null,",",null,")");s.push({i:o-4,x:Ks(t,n)},{i:o-2,x:Ks(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}return s(i,"pop"),s(a,"translate"),s(o,"rotate"),s(l,"skewX"),s(c,"scale"),function(e,n){var r=[],i=[];return e=t(e),n=t(n),a(e.translateX,e.translateY,n.translateX,n.translateY,r,i),o(e.rotate,n.rotate,r,i),l(e.skewX,n.skewX,r,i),c(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){for(var e,n=-1,a=i.length;++ne&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}function _o(t,e,n){var r=t[0],i=t[1],a=e[0],s=e[1];return i2?Eo:_o,i=a=null,d}function d(e){return null==e||isNaN(e=+e)?n:(i||(i=r(o.map(t),l,c)))(t(h(e)))}return s(u,"rescale"),s(d,"scale"),d.invert=function(n){return h(e((a||(a=r(l,o.map(t),Ks)))(n)))},d.domain=function(t){return arguments.length?(o=Array.from(t,xo),u()):o.slice()},d.range=function(t){return arguments.length?(l=Array.from(t),u()):l.slice()},d.rangeRound=function(t){return l=Array.from(t),c=io,u()},d.clamp=function(t){return arguments.length?(h=!!t||wo,u()):h!==wo},d.interpolate=function(t){return arguments.length?(c=t,u()):c},d.unknown=function(t){return arguments.length?(n=t,d):n},function(n,r){return t=n,e=r,u()}}function Ao(){return So()(wo,wo)}function Lo(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function No(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Io(t){return(t=No(Math.abs(t)))?t[1]:NaN}function Mo(t,e){return function(n,r){for(var i=n.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),a.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function Ro(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}s(wo,"identity"),s(ko,"normalize"),s(To,"clamper"),s(_o,"bimap"),s(Eo,"polymap"),s(Co,"copy"),s(So,"transformer"),s(Ao,"continuous"),s(Lo,"default"),s(No,"formatDecimalParts"),s(Io,"default"),s(Mo,"default"),s(Ro,"default");var Do,Oo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Po(t){if(!(e=Oo.exec(t)))throw new Error("invalid format: "+t);var e;return new Bo({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]})}function Bo(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function $o(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}function Fo(t,e){var n=No(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Do=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+No(t,Math.max(0,e+a-1))[0]}function zo(t,e){var n=No(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}s(Po,"formatSpecifier"),Po.prototype=Bo.prototype,s(Bo,"FormatSpecifier"),Bo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type},s($o,"default"),s(Fo,"default"),s(zo,"default");var Uo={"%":s(((t,e)=>(100*t).toFixed(e)),"%"),b:s((t=>Math.round(t).toString(2)),"b"),c:s((t=>t+""),"c"),d:Lo,e:s(((t,e)=>t.toExponential(e)),"e"),f:s(((t,e)=>t.toFixed(e)),"f"),g:s(((t,e)=>t.toPrecision(e)),"g"),o:s((t=>Math.round(t).toString(8)),"o"),p:s(((t,e)=>zo(100*t,e)),"p"),r:zo,s:Fo,X:s((t=>Math.round(t).toString(16).toUpperCase()),"X"),x:s((t=>Math.round(t).toString(16)),"x")};function Go(t){return t}s(Go,"default");var qo,jo,Yo,Wo=Array.prototype.map,Ho=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vo(t){var e=void 0===t.grouping||void 0===t.thousands?Go:Mo(Wo.call(t.grouping,Number),t.thousands+""),n=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",i=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Go:Ro(Wo.call(t.numerals,String)),o=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var h=(t=Po(t)).fill,u=t.align,d=t.sign,p=t.symbol,g=t.zero,f=t.width,m=t.comma,y=t.precision,v=t.trim,x=t.type;"n"===x?(m=!0,x="g"):Uo[x]||(void 0===y&&(y=12),v=!0,x="g"),(g||"0"===h&&"="===u)&&(g=!0,h="0",u="=");var b="$"===p?n:"#"===p&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",w="$"===p?r:/[%p]/.test(x)?o:"",k=Uo[x],T=/[defgprs%]/.test(x);function _(t){var n,r,s,o=b,p=w;if("c"===x)p=k(t)+p,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:k(Math.abs(t),y),v&&(t=$o(t)),_&&0==+t&&"+"!==d&&(_=!1),o=(_?"("===d?d:l:"-"===d||"("===d?"":d)+o,p=("s"===x?Ho[8+Do/3]:"")+p+(_&&"("===d?")":""),T)for(n=-1,r=t.length;++n(s=t.charCodeAt(n))||s>57){p=(46===s?i+t.slice(n+1):t.slice(n))+p,t=t.slice(0,n);break}}m&&!g&&(t=e(t,1/0));var E=o.length+t.length+p.length,C=E>1)+o+t+p+C.slice(E);break;default:t=C+o+t+p}return a(t)}return y=void 0===y?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),s(_,"format"),_.toString=function(){return t+""},_}function u(t,e){var n=h(((t=Po(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Io(e)/3))),i=Math.pow(10,-r),a=Ho[8+r/3];return function(t){return n(i*t)+a}}return s(h,"newFormat"),s(u,"formatPrefix"),{format:h,formatPrefix:u}}function Xo(t){return qo=Vo(t),jo=qo.format,Yo=qo.formatPrefix,qo}function Ko(t){return Math.max(0,-Io(Math.abs(t)))}function Zo(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Io(e)/3)))-Io(Math.abs(t)))}function Qo(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Io(e)-Io(t))+1}function Jo(t,e,n,r){var i,a=_r(t,e,n);switch((r=Po(null==r?",f":r)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=Zo(a,s))||(r.precision=i),Yo(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Qo(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Ko(a))||(r.precision=i-2*("%"===r.type))}return jo(r)}function tl(t){var e=t.domain;return t.ticks=function(t){var n=e();return kr(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Jo(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,a=e(),s=0,o=a.length-1,l=a[s],c=a[o],h=10;for(c0;){if((i=Tr(l,c,n))===r)return a[s]=l,a[o]=c,e(a);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function el(){var t=Ao();return t.copy=function(){return Co(t,el())},fo.apply(t,arguments),tl(t)}s(Vo,"default"),Xo({thousands:",",grouping:[3],currency:["$",""]}),s(Xo,"defaultLocale"),s(Ko,"default"),s(Zo,"default"),s(Qo,"default"),s(Jo,"tickFormat"),s(tl,"linearish"),s(el,"linear");var nl=new Date,rl=new Date;function il(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s(i,"interval"),i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,a)=>{const s=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n0))return s;let o;do{s.push(o=new Date(+n)),e(n,a),t(n)}while(oil((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(nl.setTime(+e),rl.setTime(+r),t(nl),t(rl),Math.floor(n(nl,rl))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}s(il,"timeInterval");var al=il((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));al.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?il((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):al:null),al.range;var sl=il((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+1e3*e)}),((t,e)=>(e-t)/1e3),(t=>t.getUTCSeconds()));sl.range;var ol=il((t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),((t,e)=>{t.setTime(+t+6e4*e)}),((t,e)=>(e-t)/6e4),(t=>t.getMinutes()));ol.range;var ll=il((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+6e4*e)}),((t,e)=>(e-t)/6e4),(t=>t.getUTCMinutes()));ll.range;var cl=il((t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),((t,e)=>{t.setTime(+t+36e5*e)}),((t,e)=>(e-t)/36e5),(t=>t.getHours()));cl.range;var hl=il((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+36e5*e)}),((t,e)=>(e-t)/36e5),(t=>t.getUTCHours()));hl.range;var ul=il((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5),(t=>t.getDate()-1));ul.range;var dl=il((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/864e5),(t=>t.getUTCDate()-1));dl.range;var pl=il((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/864e5),(t=>Math.floor(t/864e5)));function gl(t){return il((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5))}pl.range,s(gl,"timeWeekday");var fl=gl(0),ml=gl(1),yl=gl(2),vl=gl(3),xl=gl(4),bl=gl(5),wl=gl(6);function kl(t){return il((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/6048e5))}fl.range,ml.range,yl.range,vl.range,xl.range,bl.range,wl.range,s(kl,"utcWeekday");var Tl=kl(0),_l=kl(1),El=kl(2),Cl=kl(3),Sl=kl(4),Al=kl(5),Ll=kl(6);Tl.range,_l.range,El.range,Cl.range,Sl.range,Al.range,Ll.range;var Nl=il((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()));Nl.range;var Il=il((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));Il.range;var Ml=il((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()));Ml.every=t=>isFinite(t=Math.floor(t))&&t>0?il((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,Ml.range;var Rl=il((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()));function Dl(t,e,n,r,i,a){const o=[[sl,1,1e3],[sl,5,5e3],[sl,15,15e3],[sl,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function l(t,e,n){const r=et)).right(o,i);if(a===o.length)return t.every(_r(e/31536e6,n/31536e6,r));if(0===a)return al.every(Math.max(_r(e,n,r),1));const[s,l]=o[i/o[a-1][2]isFinite(t=Math.floor(t))&&t>0?il((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Rl.range,s(Dl,"ticker"),Dl(Rl,Il,Tl,pl,hl,ll);var[Ol,Pl]=Dl(Ml,Nl,fl,ul,cl,ol);function Bl(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function $l(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Fl(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function zl(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,l=t.months,c=t.shortMonths,h=Xl(i),u=Kl(i),d=Xl(a),p=Kl(a),g=Xl(o),f=Kl(o),m=Xl(l),y=Kl(l),v=Xl(c),x=Kl(c),b={a:D,A:O,b:P,B:B,c:null,d:yc,e:yc,f:kc,g:Rc,G:Oc,H:vc,I:xc,j:bc,L:wc,m:Tc,M:_c,p:$,q:F,Q:ih,s:ah,S:Ec,u:Cc,U:Sc,V:Lc,w:Nc,W:Ic,x:null,X:null,y:Mc,Y:Dc,Z:Pc,"%":rh},w={a:z,A:U,b:G,B:q,c:null,d:Bc,e:Bc,f:Gc,g:Jc,G:eh,H:$c,I:Fc,j:zc,L:Uc,m:qc,M:jc,p:j,q:Y,Q:ih,s:ah,S:Yc,u:Wc,U:Hc,V:Xc,w:Kc,W:Zc,x:null,X:null,y:Qc,Y:th,Z:nh,"%":rh},k={a:S,A:A,b:L,B:N,c:I,d:oc,e:oc,f:pc,g:rc,G:nc,H:cc,I:cc,j:lc,L:dc,m:sc,M:hc,p:C,q:ac,Q:fc,s:mc,S:uc,u:Ql,U:Jl,V:tc,w:Zl,W:ec,x:M,X:R,y:rc,Y:nc,Z:ic,"%":gc};function T(t,e){return function(n){var r,i,a,s=[],o=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++o53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=$l(Fl(a.y,0,1))).getUTCDay(),r=i>4||0===i?_l.ceil(r):_l(r),r=dl.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Bl(Fl(a.y,0,1))).getDay(),r=i>4||0===i?ml.ceil(r):ml(r),r=ul.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?$l(Fl(a.y,0,1)).getUTCDay():Bl(Fl(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,$l(a)):Bl(a)}}function E(t,e,n,r){for(var i,a,s=0,o=e.length,l=n.length;s=l)return-1;if(37===(i=e.charCodeAt(s++))){if(i=e.charAt(s++),!(a=k[i in ql?e.charAt(s++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function C(t,e,n){var r=h.exec(e.slice(n));return r?(t.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function S(t,e,n){var r=g.exec(e.slice(n));return r?(t.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function A(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1}function L(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=x.get(r[0].toLowerCase()),n+r[0].length):-1}function N(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1}function I(t,n,r){return E(t,e,n,r)}function M(t,e,r){return E(t,n,e,r)}function R(t,e,n){return E(t,r,e,n)}function D(t){return o[t.getDay()]}function O(t){return a[t.getDay()]}function P(t){return c[t.getMonth()]}function B(t){return l[t.getMonth()]}function $(t){return i[+(t.getHours()>=12)]}function F(t){return 1+~~(t.getMonth()/3)}function z(t){return o[t.getUTCDay()]}function U(t){return a[t.getUTCDay()]}function G(t){return c[t.getUTCMonth()]}function q(t){return l[t.getUTCMonth()]}function j(t){return i[+(t.getUTCHours()>=12)]}function Y(t){return 1+~~(t.getUTCMonth()/3)}return b.x=T(n,b),b.X=T(r,b),b.c=T(e,b),w.x=T(n,w),w.X=T(r,w),w.c=T(e,w),s(T,"newFormat"),s(_,"newParse"),s(E,"parseSpecifier"),s(C,"parsePeriod"),s(S,"parseShortWeekday"),s(A,"parseWeekday"),s(L,"parseShortMonth"),s(N,"parseMonth"),s(I,"parseLocaleDateTime"),s(M,"parseLocaleDate"),s(R,"parseLocaleTime"),s(D,"formatShortWeekday"),s(O,"formatWeekday"),s(P,"formatShortMonth"),s(B,"formatMonth"),s($,"formatPeriod"),s(F,"formatQuarter"),s(z,"formatUTCShortWeekday"),s(U,"formatUTCWeekday"),s(G,"formatUTCShortMonth"),s(q,"formatUTCMonth"),s(j,"formatUTCPeriod"),s(Y,"formatUTCQuarter"),{format:s((function(t){var e=T(t+="",b);return e.toString=function(){return t},e}),"format"),parse:s((function(t){var e=_(t+="",!1);return e.toString=function(){return t},e}),"parse"),utcFormat:s((function(t){var e=T(t+="",w);return e.toString=function(){return t},e}),"utcFormat"),utcParse:s((function(t){var e=_(t+="",!0);return e.toString=function(){return t},e}),"utcParse")}}s(Bl,"localDate"),s($l,"utcDate"),s(Fl,"newDate"),s(zl,"formatLocale");var Ul,Gl,ql={"-":"",_:" ",0:"0"},jl=/^\s*\d+/,Yl=/^%/,Wl=/[\\^$*+?|[\]().{}]/g;function Hl(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[t.toLowerCase(),e])))}function Zl(t,e,n){var r=jl.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ql(t,e,n){var r=jl.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Jl(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function tc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function ec(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function nc(t,e,n){var r=jl.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function rc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ic(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ac(t,e,n){var r=jl.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function sc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function oc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function lc(t,e,n){var r=jl.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function cc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function hc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function uc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function dc(t,e,n){var r=jl.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function pc(t,e,n){var r=jl.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function gc(t,e,n){var r=Yl.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function fc(t,e,n){var r=jl.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function mc(t,e,n){var r=jl.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function yc(t,e){return Hl(t.getDate(),e,2)}function vc(t,e){return Hl(t.getHours(),e,2)}function xc(t,e){return Hl(t.getHours()%12||12,e,2)}function bc(t,e){return Hl(1+ul.count(Ml(t),t),e,3)}function wc(t,e){return Hl(t.getMilliseconds(),e,3)}function kc(t,e){return wc(t,e)+"000"}function Tc(t,e){return Hl(t.getMonth()+1,e,2)}function _c(t,e){return Hl(t.getMinutes(),e,2)}function Ec(t,e){return Hl(t.getSeconds(),e,2)}function Cc(t){var e=t.getDay();return 0===e?7:e}function Sc(t,e){return Hl(fl.count(Ml(t)-1,t),e,2)}function Ac(t){var e=t.getDay();return e>=4||0===e?xl(t):xl.ceil(t)}function Lc(t,e){return t=Ac(t),Hl(xl.count(Ml(t),t)+(4===Ml(t).getDay()),e,2)}function Nc(t){return t.getDay()}function Ic(t,e){return Hl(ml.count(Ml(t)-1,t),e,2)}function Mc(t,e){return Hl(t.getFullYear()%100,e,2)}function Rc(t,e){return Hl((t=Ac(t)).getFullYear()%100,e,2)}function Dc(t,e){return Hl(t.getFullYear()%1e4,e,4)}function Oc(t,e){var n=t.getDay();return Hl((t=n>=4||0===n?xl(t):xl.ceil(t)).getFullYear()%1e4,e,4)}function Pc(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Hl(e/60|0,"0",2)+Hl(e%60,"0",2)}function Bc(t,e){return Hl(t.getUTCDate(),e,2)}function $c(t,e){return Hl(t.getUTCHours(),e,2)}function Fc(t,e){return Hl(t.getUTCHours()%12||12,e,2)}function zc(t,e){return Hl(1+dl.count(Rl(t),t),e,3)}function Uc(t,e){return Hl(t.getUTCMilliseconds(),e,3)}function Gc(t,e){return Uc(t,e)+"000"}function qc(t,e){return Hl(t.getUTCMonth()+1,e,2)}function jc(t,e){return Hl(t.getUTCMinutes(),e,2)}function Yc(t,e){return Hl(t.getUTCSeconds(),e,2)}function Wc(t){var e=t.getUTCDay();return 0===e?7:e}function Hc(t,e){return Hl(Tl.count(Rl(t)-1,t),e,2)}function Vc(t){var e=t.getUTCDay();return e>=4||0===e?Sl(t):Sl.ceil(t)}function Xc(t,e){return t=Vc(t),Hl(Sl.count(Rl(t),t)+(4===Rl(t).getUTCDay()),e,2)}function Kc(t){return t.getUTCDay()}function Zc(t,e){return Hl(_l.count(Rl(t)-1,t),e,2)}function Qc(t,e){return Hl(t.getUTCFullYear()%100,e,2)}function Jc(t,e){return Hl((t=Vc(t)).getUTCFullYear()%100,e,2)}function th(t,e){return Hl(t.getUTCFullYear()%1e4,e,4)}function eh(t,e){var n=t.getUTCDay();return Hl((t=n>=4||0===n?Sl(t):Sl.ceil(t)).getUTCFullYear()%1e4,e,4)}function nh(){return"+0000"}function rh(){return"%"}function ih(t){return+t}function ah(t){return Math.floor(+t/1e3)}function sh(t){return Ul=zl(t),Gl=Ul.format,Ul.parse,Ul.utcFormat,Ul.utcParse,Ul}function oh(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],s=t[i];return s1?0:t<-1?Th:Math.acos(t)}function Sh(t){return t>=1?_h:t<=-1?-_h:Math.asin(t)}s(Ch,"acos"),s(Sh,"asin");var Ah=Math.PI,Lh=2*Ah,Nh=Lh-1e-6;function Ih(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ih;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e1e-6)if(Math.abs(h*o-l*c)>1e-6&&i){let d=n-a,p=r-s,g=o*o+l*l,f=d*d+p*p,m=Math.sqrt(g),y=Math.sqrt(u),v=i*Math.tan((Ah-Math.acos((g+u-f)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>1e-6&&this._append`L${t+x*c},${e+x*h}`,this._append`A${i},${i},0,0,${+(h*d>c*p)},${this._x1=t+b*o},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(r),o=n*Math.sin(r),l=t+s,c=e+o,h=1^a,u=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-c)>1e-6)&&this._append`L${l},${c}`,n&&(u<0&&(u=u%Lh+Lh),u>Nh?this._append`A${n},${n},0,1,${h},${t-s},${e-o}A${n},${n},0,1,${h},${this._x1=l},${this._y1=c}`:u>1e-6&&this._append`A${n},${n},0,${+(u>=Ah)},${h},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Dh(){return new Rh}function Oh(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Rh(e)}function Ph(t){return t.innerRadius}function Bh(t){return t.outerRadius}function $h(t){return t.startAngle}function Fh(t){return t.endAngle}function zh(t){return t&&t.padAngle}function Uh(t,e,n,r,i,a,s,o){var l=n-t,c=r-e,h=s-i,u=o-a,d=u*l-h*c;if(!(d*d<1e-12))return[t+(d=(h*(e-a)-u*(t-i))/d)*l,e+d*c]}function Gh(t,e,n,r,i,a,s){var o=t-n,l=e-r,c=(s?a:-a)/kh(o*o+l*l),h=c*l,u=-c*o,d=t+h,p=e+u,g=n+h,f=r+u,m=(d+g)/2,y=(p+f)/2,v=g-d,x=f-p,b=v*v+x*x,w=i-a,k=d*f-g*p,T=(x<0?-1:1)*kh(xh(0,w*w*b-k*k)),_=(k*x-v*T)/b,E=(-k*v-x*T)/b,C=(k*x+v*T)/b,S=(-k*v+x*T)/b,A=_-m,L=E-y,N=C-m,I=S-y;return A*A+L*L>N*N+I*I&&(_=C,E=S),{cx:_,cy:E,x01:-h,y01:-u,x11:_*(i/w-1),y11:E*(i/w-1)}}function qh(){var t=Ph,e=Bh,n=fh(0),r=null,i=$h,a=Fh,o=zh,l=null,c=Oh(h);function h(){var s,h,u=+t.apply(this,arguments),d=+e.apply(this,arguments),p=i.apply(this,arguments)-_h,g=a.apply(this,arguments)-_h,f=mh(g-p),m=g>p;if(l||(l=s=c()),d1e-12)if(f>Eh-1e-12)l.moveTo(d*vh(p),d*wh(p)),l.arc(0,0,d,p,g,!m),u>1e-12&&(l.moveTo(u*vh(g),u*wh(g)),l.arc(0,0,u,g,p,m));else{var y,v,x=p,b=g,w=p,k=g,T=f,_=f,E=o.apply(this,arguments)/2,C=E>1e-12&&(r?+r.apply(this,arguments):kh(u*u+d*d)),S=bh(mh(d-u)/2,+n.apply(this,arguments)),A=S,L=S;if(C>1e-12){var N=Sh(C/u*wh(E)),I=Sh(C/d*wh(E));(T-=2*N)>1e-12?(w+=N*=m?1:-1,k-=N):(T=0,w=k=(p+g)/2),(_-=2*I)>1e-12?(x+=I*=m?1:-1,b-=I):(_=0,x=b=(p+g)/2)}var M=d*vh(x),R=d*wh(x),D=u*vh(k),O=u*wh(k);if(S>1e-12){var P,B=d*vh(b),$=d*wh(b),F=u*vh(w),z=u*wh(w);if(f1e-12?L>1e-12?(y=Gh(F,z,M,R,d,L,m),v=Gh(B,$,D,O,d,L,m),l.moveTo(y.cx+y.x01,y.cy+y.y01),L1e-12&&T>1e-12?A>1e-12?(y=Gh(D,O,B,$,u,-A,m),v=Gh(M,R,F,z,u,-A,m),l.lineTo(y.cx+y.x01,y.cy+y.y01),At?1:e>=t?0:NaN}function Zh(t){return t}function Qh(){var t=Zh,e=Kh,n=null,r=fh(0),i=fh(Eh),a=fh(0);function o(s){var o,l,c,h,u,d=(s=Wh(s)).length,p=0,g=new Array(d),f=new Array(d),m=+r.apply(this,arguments),y=Math.min(Eh,Math.max(-Eh,i.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,a.apply(this,arguments)),x=v*(y<0?-1:1);for(o=0;o0&&(p+=u);for(null!=e?g.sort((function(t,n){return e(f[t],f[n])})):null!=n&&g.sort((function(t,e){return n(s[t],s[e])})),o=0,c=p?(y-d*x)/p:0;o0?u*c:0)+x,f[l]={data:s[l],index:o,value:u,startAngle:m,endAngle:h,padAngle:v};return f}return s(o,"pie"),o.value=function(e){return arguments.length?(t="function"==typeof e?e:fh(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:fh(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:fh(+t),o):i},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:fh(+t),o):a},o}s(Dh,"path"),Dh.prototype=Rh.prototype,s(Oh,"withPath"),s(Ph,"arcInnerRadius"),s(Bh,"arcOuterRadius"),s($h,"arcStartAngle"),s(Fh,"arcEndAngle"),s(zh,"arcPadAngle"),s(Uh,"intersect"),s(Gh,"cornerTangents"),s(qh,"default"),s(jh,"Linear"),jh.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._point=0}),"lineStart"),lineEnd:s((function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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:this._context.lineTo(t,e)}}),"point")},s(Yh,"default"),s(Wh,"default"),s(Hh,"x"),s(Vh,"y"),s(Xh,"default"),s(Kh,"default"),s(Zh,"default"),s(Qh,"default");var Jh=class{static{s(this,"Bump")}constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(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:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}};function tu(t){return new Jh(t,!0)}function eu(t){return new Jh(t,!1)}function nu(t,e,n){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+n)/6)}function ru(t){this._context=t}function iu(t){return new ru(t)}function au(){}function su(t){this._context=t}function ou(t){return new su(t)}function lu(t){this._context=t}function cu(t){return new lu(t)}function hu(t,e){this._basis=new ru(t),this._beta=e}s(tu,"bumpX"),s(eu,"bumpY"),s(nu,"point"),s(ru,"Basis"),ru.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){switch(this._point){case 3:nu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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:nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},s(iu,"default"),s(au,"default"),s(su,"BasisClosed"),su.prototype={areaStart:au,areaEnd:au,lineStart:s((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}),"lineStart"),lineEnd:s((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)}}),"lineEnd"),point:s((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:nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},s(ou,"default"),s(lu,"BasisOpen"),lu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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 n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},s(cu,"default"),s(hu,"Bundle"),hu.prototype={lineStart:s((function(){this._x=[],this._y=[],this._basis.lineStart()}),"lineStart"),lineEnd:s((function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],s=t[n]-i,o=e[n]-a,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+r*s),this._beta*e[l]+(1-this._beta)*(a+r*o));this._x=this._y=null,this._basis.lineEnd()}),"lineEnd"),point:s((function(t,e){this._x.push(+t),this._y.push(+e)}),"point")};var uu=s((function t(e){function n(t){return 1===e?new ru(t):new hu(t,e)}return s(n,"bundle"),n.beta=function(e){return t(+e)},n}),"custom")(.85);function du(t,e,n){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-n),t._x2,t._y2)}function pu(t,e){this._context=t,this._k=(1-e)/6}s(du,"point"),s(pu,"Cardinal"),pu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:du(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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:du(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var gu=s((function t(e){function n(t){return new pu(t,e)}return s(n,"cardinal"),n.tension=function(e){return t(+e)},n}),"custom")(0);function fu(t,e){this._context=t,this._k=(1-e)/6}s(fu,"CardinalClosed"),fu.prototype={areaStart:au,areaEnd:au,lineStart:s((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}),"lineStart"),lineEnd:s((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)}}),"lineEnd"),point:s((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:du(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var mu=s((function t(e){function n(t){return new fu(t,e)}return s(n,"cardinal"),n.tension=function(e){return t(+e)},n}),"custom")(0);function yu(t,e){this._context=t,this._k=(1-e)/6}s(yu,"CardinalOpen"),yu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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:du(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var vu=s((function t(e){function n(t){return new yu(t,e)}return s(n,"cardinal"),n.tension=function(e){return t(+e)},n}),"custom")(0);function xu(t,e,n){var r=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>1e-12){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);r=(r*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>1e-12){var c=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*c+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/h}t._context.bezierCurveTo(r,i,a,s,t._x2,t._y2)}function bu(t,e){this._context=t,this._alpha=e}s(xu,"point"),s(bu,"CatmullRom"),bu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((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}),"lineStart"),lineEnd:s((function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:xu(this,t,e)}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}),"point")};var wu=s((function t(e){function n(t){return e?new bu(t,e):new pu(t,0)}return s(n,"catmullRom"),n.alpha=function(e){return t(+e)},n}),"custom")(.5);function ku(t,e){this._context=t,this._alpha=e}s(ku,"CatmullRomClosed"),ku.prototype={areaStart:au,areaEnd:au,lineStart:s((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}),"lineStart"),lineEnd:s((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)}}),"lineEnd"),point:s((function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:xu(this,t,e)}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}),"point")};var Tu=s((function t(e){function n(t){return e?new ku(t,e):new fu(t,0)}return s(n,"catmullRom"),n.alpha=function(e){return t(+e)},n}),"custom")(.5);function _u(t,e){this._context=t,this._alpha=e}s(_u,"CatmullRomOpen"),_u.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((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}),"lineStart"),lineEnd:s((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:xu(this,t,e)}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}),"point")};var Eu=s((function t(e){function n(t){return e?new _u(t,e):new yu(t,0)}return s(n,"catmullRom"),n.alpha=function(e){return t(+e)},n}),"custom")(.5);function Cu(t){this._context=t}function Su(t){return new Cu(t)}function Au(t){return t<0?-1:1}function Lu(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(Au(a)+Au(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Nu(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Iu(t,e,n){var r=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-r)/3;t._context.bezierCurveTo(r+o,i+o*e,a-o,s-o*n,a,s)}function Mu(t){this._context=t}function Ru(t){this._context=new Du(t)}function Du(t){this._context=t}function Ou(t){return new Mu(t)}function Pu(t){return new Ru(t)}function Bu(t){this._context=t}function $u(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e=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)}),"lineEnd"),point:s((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 n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}),"point")},s(Uu,"default"),s(Gu,"stepBefore"),s(qu,"stepAfter");var ju={value:s((()=>{}),"value")};function Yu(){for(var t,e=0,n=arguments.length,r={};e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Vu(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),a=0;a=0&&e._call.call(void 0,t),e=e._next;--Ju}function dd(){rd=(nd=ad.now())+id,Ju=td=0;try{ud()}finally{Ju=0,gd(),rd=0}}function pd(){var t=ad.now(),e=t-nd;e>1e3&&(id-=e,nd=t)}function gd(){for(var t,e,n=Ku,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Ku=e);Zu=t,fd(r)}function fd(t){Ju||(td&&(td=clearTimeout(td)),t-rd>24?(t<1/0&&(td=setTimeout(dd,t-ad.now()-id)),ed&&(ed=clearInterval(ed))):(ed||(nd=ad.now(),ed=setInterval(pd,1e3)),Ju=1,sd(dd)))}function md(t,e,n){var r=new cd;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}s(od,"now"),s(ld,"clearNow"),s(cd,"Timer"),cd.prototype=hd.prototype={constructor:cd,restart:s((function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?od():+n)+(null==e?0:+e),this._next||Zu===this||(Zu?Zu._next=this:Ku=this,Zu=this),this._call=t,this._time=n,fd()}),"restart"),stop:s((function(){this._call&&(this._call=null,this._time=1/0,fd())}),"stop")},s(hd,"timer"),s(ud,"timerFlush"),s(dd,"wake"),s(pd,"poke"),s(gd,"nap"),s(fd,"sleep"),s(md,"default");var yd=Qu("start","end","cancel","interrupt"),vd=[];function xd(t,e,n,r,i,a){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};Td(t,n,{name:e,index:r,group:i,on:yd,tween:vd,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function bd(t,e){var n=kd(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function wd(t,e){var n=kd(t,e);if(n.state>3)throw new Error("too late; already running");return n}function kd(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Td(t,e,n){var r,i=t.__transition;function a(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(a){var s,h,u,d;if(1!==n.state)return c();for(s in i)if((d=i[s]).name===n.name){if(3===d.state)return md(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[s]):+s2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):s=!1;s&&delete t.__transition}}function Ed(t){return this.each((function(){_d(this,t)}))}function Cd(t,e){var n,r;return function(){var i=wd(this,t),a=i.tween;if(a!==n)for(var s=0,o=(r=n=a).length;s=0&&(t=t.slice(0,e)),!t||"start"===t}))}function np(t,e,n){var r,i,a=ep(e)?bd:wd;return function(){var s=a(this,t),o=s.on;o!==r&&(i=(r=o).copy()).on(e,n),s.on=i}}function rp(t,e){var n=this._id;return arguments.length<2?kd(this.node(),n).on.on(t):this.each(np(n,t,e))}function ip(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ap(){return this.on("end.remove",ip(this._id))}function sp(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Pr(t));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s{const{securityLevel:e}=Hn();let n=Oa("body");if("sandbox"===e){const e=Oa(`#i${t}`);n=Oa((e.node()?.contentDocument??document).body)}return n.select(`#${t}`)}),"selectSvgElement");function Up(t){return null==t}function Gp(t){return"object"==typeof t&&null!==t}function qp(t){return Array.isArray(t)?t:Up(t)?[]:[t]}function jp(t,e){var n,r,i,a;if(e)for(n=0,r=(a=Object.keys(e)).length;no&&(e=r-o+(a=" ... ").length),n-r>o&&(n=r+o-(s=" ...").length),{str:a+t.slice(e,n).replace(/\t/g,"→")+s,pos:r-e+a.length}}function Qp(t,e){return Hp.repeat(" ",e-t.length)+t}function Jp(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],a=[],s=-1;n=r.exec(t.buffer);)a.push(n.index),i.push(n.index+n[0].length),t.position<=n.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var o,l,c="",h=Math.min(t.line+e.linesAfter,a.length).toString().length,u=e.maxLength-(e.indent+h+3);for(o=1;o<=e.linesBefore&&!(s-o<0);o++)l=Zp(t.buffer,i[s-o],a[s-o],t.position-(i[s]-i[s-o]),u),c=Hp.repeat(" ",e.indent)+Qp((t.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=Zp(t.buffer,i[s],a[s],t.position,u),c+=Hp.repeat(" ",e.indent)+Qp((t.line+1).toString(),h)+" | "+l.str+"\n",c+=Hp.repeat("-",e.indent+h+3+l.pos)+"^\n",o=1;o<=e.linesAfter&&!(s+o>=a.length);o++)l=Zp(t.buffer,i[s+o],a[s+o],t.position-(i[s]-i[s+o]),u),c+=Hp.repeat(" ",e.indent)+Qp((t.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")}s(Zp,"getLine"),s(Qp,"padStart"),s(Jp,"makeSnippet");var tg=Jp,eg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ng=["scalar","sequence","mapping"];function rg(t){var e={};return null!==t&&Object.keys(t).forEach((function(n){t[n].forEach((function(t){e[String(t)]=n}))})),e}function ig(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===eg.indexOf(e))throw new Kp('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=rg(e.styleAliases||null),-1===ng.indexOf(this.kind))throw new Kp('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}s(rg,"compileStyleAliases"),s(ig,"Type$1");var ag=ig;function sg(t,e){var n=[];return t[e].forEach((function(t){var e=n.length;n.forEach((function(n,r){n.tag===t.tag&&n.kind===t.kind&&n.multi===t.multi&&(e=r)})),n[e]=t})),n}function og(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(t){t.multi?(n.multi[t.kind].push(t),n.multi.fallback.push(t)):n[t.kind][t.tag]=n.fallback[t.tag]=t}for(s(r,"collectType"),t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)}),"binary"),octal:s((function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)}),"octal"),decimal:s((function(t){return t.toString(10)}),"decimal"),hexadecimal:s((function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}),"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Lg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ng(t){return null!==t&&!(!Lg.test(t)||"_"===t[t.length-1])}function Ig(t){var e,n;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:n*parseFloat(e,10)}s(Ng,"resolveYamlFloat"),s(Ig,"constructYamlFloat");var Mg=/^[-+]?[0-9]+e/;function Rg(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Hp.isNegativeZero(t))return"-0.0";return n=t.toString(10),Mg.test(n)?n.replace("e",".e"):n}function Dg(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||Hp.isNegativeZero(t))}s(Rg,"representYamlFloat"),s(Dg,"isFloat");var Og=new ag("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ng,construct:Ig,predicate:Dg,represent:Rg,defaultStyle:"lowercase"}),Pg=pg.extend({implicit:[yg,wg,Ag,Og]}),Bg=Pg,$g=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Fg=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 zg(t){return null!==t&&(null!==$g.exec(t)||null!==Fg.exec(t))}function Ug(t){var e,n,r,i,a,s,o,l,c=0,h=null;if(null===(e=$g.exec(t))&&(e=Fg.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(h=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),l=new Date(Date.UTC(n,r,i,a,s,o,c)),h&&l.setTime(l.getTime()-h),l}function Gg(t){return t.toISOString()}s(zg,"resolveYamlTimestamp"),s(Ug,"constructYamlTimestamp"),s(Gg,"representYamlTimestamp");var qg=new ag("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:zg,construct:Ug,instanceOf:Date,represent:Gg});function jg(t){return"<<"===t||null===t}s(jg,"resolveYamlMerge");var Yg=new ag("tag:yaml.org,2002:merge",{kind:"scalar",resolve:jg}),Wg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function Hg(t){if(null===t)return!1;var e,n,r=0,i=t.length,a=Wg;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8==0}function Vg(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,a=Wg,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(255&s)),s=s<<6|a.indexOf(r.charAt(e));return 0===(n=i%4*6)?(o.push(s>>16&255),o.push(s>>8&255),o.push(255&s)):18===n?(o.push(s>>10&255),o.push(s>>2&255)):12===n&&o.push(s>>4&255),new Uint8Array(o)}function Xg(t){var e,n,r="",i=0,a=t.length,s=Wg;for(e=0;e>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]),i=(i<<8)+t[e];return 0===(n=a%3)?(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]):2===n?(r+=s[i>>10&63],r+=s[i>>4&63],r+=s[i<<2&63],r+=s[64]):1===n&&(r+=s[i>>2&63],r+=s[i<<4&63],r+=s[64],r+=s[64]),r}function Kg(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}s(Hg,"resolveYamlBinary"),s(Vg,"constructYamlBinary"),s(Xg,"representYamlBinary"),s(Kg,"isBinary");var Zg=new ag("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Hg,construct:Vg,predicate:Kg,represent:Xg}),Qg=Object.prototype.hasOwnProperty,Jg=Object.prototype.toString;function tf(t){if(null===t)return!0;var e,n,r,i,a,s=[],o=t;for(e=0,n=o.length;e>10),56320+(t-65536&1023))}s(xf,"_class"),s(bf,"is_EOL"),s(wf,"is_WHITE_SPACE"),s(kf,"is_WS_OR_EOL"),s(Tf,"is_FLOW_INDICATOR"),s(_f,"fromHexCode"),s(Ef,"escapedHexLen"),s(Cf,"fromDecimalCode"),s(Sf,"simpleEscapeSequence"),s(Af,"charFromCodepoint");var Lf,Nf=new Array(256),If=new Array(256);for(Lf=0;Lf<256;Lf++)Nf[Lf]=Sf(Lf)?1:0,If[Lf]=Sf(Lf);function Mf(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||df,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Rf(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=tg(n),new Kp(e,n)}function Df(t,e){throw Rf(t,e)}function Of(t,e){t.onWarning&&t.onWarning.call(null,Rf(t,e))}s(Mf,"State$1"),s(Rf,"generateError"),s(Df,"throwError"),s(Of,"throwWarning");var Pf={YAML:s((function(t,e,n){var r,i,a;null!==t.version&&Df(t,"duplication of %YAML directive"),1!==n.length&&Df(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Df(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),a=parseInt(r[2],10),1!==i&&Df(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&Of(t,"unsupported YAML version of the document")}),"handleYamlDirective"),TAG:s((function(t,e,n){var r,i;2!==n.length&&Df(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],yf.test(r)||Df(t,"ill-formed tag handle (first argument) of the TAG directive"),pf.call(t.tagMap,r)&&Df(t,'there is a previously declared suffix for "'+r+'" tag handle'),vf.test(i)||Df(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(e){Df(t,"tag prefix is malformed: "+i)}t.tagMap[r]=i}),"handleTagDirective")};function Bf(t,e,n,r){var i,a,s,o;if(e1&&(t.result+=Hp.repeat("\n",e-1))}function jf(t,e,n){var r,i,a,s,o,l,c,h,u=t.kind,d=t.result;if(kf(h=t.input.charCodeAt(t.position))||Tf(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(kf(r=t.input.charCodeAt(t.position+1))||n&&Tf(r)))return!1;for(t.kind="scalar",t.result="",i=a=t.position,s=!1;0!==h;){if(58===h){if(kf(r=t.input.charCodeAt(t.position+1))||n&&Tf(r))break}else if(35===h){if(kf(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&Gf(t)||n&&Tf(h))break;if(bf(h)){if(o=t.line,l=t.lineStart,c=t.lineIndent,Uf(t,!1,-1),t.lineIndent>=e){s=!0,h=t.input.charCodeAt(t.position);continue}t.position=a,t.line=o,t.lineStart=l,t.lineIndent=c;break}}s&&(Bf(t,i,a,!1),qf(t,t.line-o),i=a=t.position,s=!1),wf(h)||(a=t.position+1),h=t.input.charCodeAt(++t.position)}return Bf(t,i,a,!1),!!t.result||(t.kind=u,t.result=d,!1)}function Yf(t,e){var n,r,i;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(Bf(t,r,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;r=t.position,t.position++,i=t.position}else bf(n)?(Bf(t,r,i,!0),qf(t,Uf(t,!1,e)),r=i=t.position):t.position===t.lineStart&&Gf(t)?Df(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Df(t,"unexpected end of the stream within a single quoted scalar")}function Wf(t,e){var n,r,i,a,s,o;if(34!==(o=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;0!==(o=t.input.charCodeAt(t.position));){if(34===o)return Bf(t,n,t.position,!0),t.position++,!0;if(92===o){if(Bf(t,n,t.position,!0),bf(o=t.input.charCodeAt(++t.position)))Uf(t,!1,e);else if(o<256&&Nf[o])t.result+=If[o],t.position++;else if((s=Ef(o))>0){for(i=s,a=0;i>0;i--)(s=_f(o=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+s:Df(t,"expected hexadecimal character");t.result+=Af(a),t.position++}else Df(t,"unknown escape sequence");n=r=t.position}else bf(o)?(Bf(t,n,r,!0),qf(t,Uf(t,!1,e)),n=r=t.position):t.position===t.lineStart&&Gf(t)?Df(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}Df(t,"unexpected end of the stream within a double quoted scalar")}function Hf(t,e){var n,r,i,a,s,o,l,c,h,u,d,p,g=!0,f=t.tag,m=t.anchor,y=Object.create(null);if(91===(p=t.input.charCodeAt(t.position)))s=93,c=!1,a=[];else{if(123!==p)return!1;s=125,c=!0,a={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),p=t.input.charCodeAt(++t.position);0!==p;){if(Uf(t,!0,e),(p=t.input.charCodeAt(t.position))===s)return t.position++,t.tag=f,t.anchor=m,t.kind=c?"mapping":"sequence",t.result=a,!0;g?44===p&&Df(t,"expected the node content, but found ','"):Df(t,"missed comma between flow collection entries"),d=null,o=l=!1,63===p&&kf(t.input.charCodeAt(t.position+1))&&(o=l=!0,t.position++,Uf(t,!0,e)),n=t.line,r=t.lineStart,i=t.position,tm(t,e,1,!1,!0),u=t.tag,h=t.result,Uf(t,!0,e),p=t.input.charCodeAt(t.position),!l&&t.line!==n||58!==p||(o=!0,p=t.input.charCodeAt(++t.position),Uf(t,!0,e),tm(t,e,1,!1,!0),d=t.result),c?Ff(t,a,y,u,h,d,n,r,i):o?a.push(Ff(t,null,y,u,h,d,n,r,i)):a.push(h),Uf(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(g=!0,p=t.input.charCodeAt(++t.position)):g=!1}Df(t,"unexpected end of the stream within a flow collection")}function Vf(t,e){var n,r,i,a,s=1,o=!1,l=!1,c=e,h=0,u=!1;if(124===(a=t.input.charCodeAt(t.position)))r=!1;else{if(62!==a)return!1;r=!0}for(t.kind="scalar",t.result="";0!==a;)if(43===(a=t.input.charCodeAt(++t.position))||45===a)1===s?s=43===a?3:2:Df(t,"repeat of a chomping mode identifier");else{if(!((i=Cf(a))>=0))break;0===i?Df(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?Df(t,"repeat of an indentation width identifier"):(c=e+i-1,l=!0)}if(wf(a)){do{a=t.input.charCodeAt(++t.position)}while(wf(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!bf(a)&&0!==a)}for(;0!==a;){for(zf(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!l||t.lineIndentc&&(c=t.lineIndent),bf(a))h++;else{if(t.lineIndente)&&0!==r)Df(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),tm(t,e,4,!0,i)&&(y?f=t.result:m=t.result),y||(Ff(t,d,p,g,f,m,s,o,l),g=f=m=null),Uf(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&0!==c)Df(t,"bad indentation of a mapping entry");else if(t.lineIndente?g=1:t.lineIndent===e?g=0:t.lineIndente?g=1:t.lineIndent===e?g=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l"),null!==t.result&&u.kind!==t.kind&&Df(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+u.kind+'", not "'+t.kind+'"'),u.resolve(t.result,t.tag)?(t.result=u.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):Df(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||m}function em(t){var e,n,r,i,a=t.position,s=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(i=t.input.charCodeAt(t.position))&&(Uf(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(s=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!kf(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&Df(t,"directive name must not be less than one character in length");0!==i;){for(;wf(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!bf(i));break}if(bf(i))break;for(e=t.position;0!==i&&!kf(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&zf(t),pf.call(Pf,n)?Pf[n](t,n,r):Of(t,'unknown document directive "'+n+'"')}Uf(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,Uf(t,!0,-1)):s&&Df(t,"directives end mark is expected"),tm(t,t.lineIndent-1,4,!1,!0),Uf(t,!0,-1),t.checkLineBreaks&&ff.test(t.input.slice(a,t.position))&&Of(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Gf(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,Uf(t,!0,-1)):t.position=55296&&r<=56319&&e+1=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function _m(t){return/^\n* /.test(t)}s(pm,"State"),s(gm,"indentString"),s(fm,"generateNextLine"),s(mm,"testImplicitResolving"),s(ym,"isWhitespace"),s(vm,"isPrintable"),s(xm,"isNsCharOrWhitespace"),s(bm,"isPlainSafe"),s(wm,"isPlainSafeFirst"),s(km,"isPlainSafeLast"),s(Tm,"codePointAt"),s(_m,"needIndentIndicator");function Em(t,e,n,r,i,a,s,o){var l,c=0,h=null,u=!1,d=!1,p=-1!==r,g=-1,f=wm(Tm(t,0))&&km(Tm(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(!vm(c=Tm(t,l)))return 5;f=f&&bm(c,h,o),h=c}else{for(l=0;l=65536?l+=2:l++){if(10===(c=Tm(t,l)))u=!0,p&&(d=d||l-g-1>r&&" "!==t[g+1],g=l);else if(!vm(c))return 5;f=f&&bm(c,h,o),h=c}d=d||p&&l-g-1>r&&" "!==t[g+1]}return u||d?n>9&&_m(t)?5:s?2===a?5:2:d?4:3:!f||s||i(t)?2===a?5:2:1}function Cm(t,e,n,r,i){t.dump=function(){if(0===e.length)return 2===t.quotingType?'""':"''";if(!t.noCompatMode&&(-1!==cm.indexOf(e)||hm.test(e)))return 2===t.quotingType?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,n),o=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),l=r||t.flowLevel>-1&&n>=t.flowLevel;function c(e){return mm(t,e)}switch(s(c,"testAmbiguity"),Em(e,l,t.indent,o,c,t.quotingType,t.forceQuotes&&!r,i)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+Sm(e,t.indent)+Am(gm(e,a));case 4:return">"+Sm(e,t.indent)+Am(gm(Lm(e,o),a));case 5:return'"'+Im(e)+'"';default:throw new Kp("impossible error: invalid scalar style")}}()}function Sm(t,e){var n=_m(t)?String(e):"",r="\n"===t[t.length-1];return n+(r&&("\n"===t[t.length-2]||"\n"===t)?"+":r?"":"-")+"\n"}function Am(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function Lm(t,e){for(var n,r,i,a=/(\n+)([^\n]*)/g,s=(n=-1!==(n=t.indexOf("\n"))?n:t.length,a.lastIndex=n,Nm(t.slice(0,n),e)),o="\n"===t[0]||" "===t[0];i=a.exec(t);){var l=i[1],c=i[2];r=" "===c[0],s+=l+(o||r||""===c?"":"\n")+Nm(c,e),o=r}return s}function Nm(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,a=0,s=0,o=0,l="";n=i.exec(t);)(o=n.index)-a>e&&(r=s>a?s:o,l+="\n"+t.slice(a,r),a=r+1),s=o;return l+="\n",t.length-a>e&&s>a?l+=t.slice(a,s)+"\n"+t.slice(s+1):l+=t.slice(a),l.slice(1)}function Im(t){for(var e,n="",r=0,i=0;i=65536?i+=2:i++)r=Tm(t,i),!(e=lm[r])&&vm(r)?(n+=t[i],r>=65536&&(n+=t[i+1])):n+=e||dm(r);return n}function Mm(t,e,n){var r,i,a,s="",o=t.tag;for(r=0,i=n.length;r1024&&(o+="? "),o+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Bm(t,e,s,!1,!1)&&(l+=o+=t.dump));t.tag=c,t.dump="{"+l+"}"}function Om(t,e,n,r){var i,a,s,o,l,c,h="",u=t.tag,d=Object.keys(n);if(!0===t.sortKeys)d.sort();else if("function"==typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new Kp("sortKeys must be a boolean or a function");for(i=0,a=d.length;i1024)&&(t.dump&&10===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,l&&(c+=fm(t,e)),Bm(t,e+1,o,!0,l)&&(t.dump&&10===t.dump.charCodeAt(0)?c+=":":c+=": ",h+=c+=t.dump));t.tag=u,t.dump=h||"{}"}function Pm(t,e,n){var r,i,a,s,o,l;for(a=0,s=(i=n?t.explicitTypes:t.implicitTypes).length;a tag resolver accepts not "'+l+'" style');r=o.represent[l](e,l)}t.dump=r}return!0}return!1}function Bm(t,e,n,r,i,a,s){t.tag=null,t.dump=n,Pm(t,n,!1)||Pm(t,n,!0);var o,l=sm.call(t.dump),c=r;r&&(r=t.flowLevel<0||t.flowLevel>e);var h,u,d="[object Object]"===l||"[object Array]"===l;if(d&&(u=-1!==(h=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||u||2!==t.indent&&e>0)&&(i=!1),u&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(d&&u&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),"[object Object]"===l)r&&0!==Object.keys(t.dump).length?(Om(t,e,t.dump,i),u&&(t.dump="&ref_"+h+t.dump)):(Dm(t,e,t.dump),u&&(t.dump="&ref_"+h+" "+t.dump));else if("[object Array]"===l)r&&0!==t.dump.length?(t.noArrayIndent&&!s&&e>0?Rm(t,e-1,t.dump,i):Rm(t,e,t.dump,i),u&&(t.dump="&ref_"+h+t.dump)):(Mm(t,e,t.dump),u&&(t.dump="&ref_"+h+" "+t.dump));else{if("[object String]"!==l){if("[object Undefined]"===l)return!1;if(t.skipInvalid)return!1;throw new Kp("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&Cm(t,t.dump,e,a,c)}null!==t.tag&&"?"!==t.tag&&(o=encodeURI("!"===t.tag[0]?t.tag.slice(1):t.tag).replace(/!/g,"%21"),o="!"===t.tag[0]?"!"+o:"tag:yaml.org,2002:"===o.slice(0,18)?"!!"+o.slice(18):"!<"+o+">",t.dump=o+" "+t.dump)}return!0}function $m(t,e){var n,r,i=[],a=[];for(Fm(t,i,a),n=0,r=a.length;n{const e=t?.subGraphTitleMargin?.top??0,n=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:e+n}}),"getSubGraphTitleMargins"),qm=o({"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(t,e){var n=1e3,r=60*n,i=60*r,a=24*i;function o(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function l(t){var e=Math.abs(t);return e>=a?Math.round(t/a)+"d":e>=i?Math.round(t/i)+"h":e>=r?Math.round(t/r)+"m":e>=n?Math.round(t/n)+"s":t+"ms"}function c(t){var e=Math.abs(t);return e>=a?h(t,e,a,"day"):e>=i?h(t,e,i,"hour"):e>=r?h(t,e,r,"minute"):e>=n?h(t,e,n,"second"):t+" ms"}function h(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}e.exports=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return o(t);if("number"===n&&isFinite(t))return e.long?c(t):l(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))},s(o,"parse"),s(l,"fmtShort"),s(c,"fmtLong"),s(h,"plural")}}),jm=o({"../../node_modules/.pnpm/debug@4.3.7_supports-color@8.1.1/node_modules/debug/src/common.js"(t,e){function n(t){function e(t){let e=0;for(let n=0;n{if("%%"===e)return"%";s++;const a=n.formatters[i];if("function"==typeof a){const n=t[s];e=a.call(r,n),t.splice(s,1),s--}return e})),n.formatArgs.call(r,t);(r.log||n.log).apply(r,t)}return s(l,"debug"),l.namespace=t,l.useColors=n.useColors(),l.color=n.selectColor(t),l.extend=r,l.destroy=n.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:s((()=>null!==o?o:(i!==n.namespaces&&(i=n.namespaces,a=n.enabled(t)),a)),"get"),set:s((t=>{o=t}),"set")}),"function"==typeof n.init&&n.init(l),l}function r(t,e){const r=n(this.namespace+(void 0===e?":":e)+t);return r.log=this.log,r}function i(t){let e;n.save(t),n.namespaces=t,n.names=[],n.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(e=0;e"-"+t))].join(",");return n.enable(""),t}function o(t){if("*"===t[t.length-1])return!0;let e,r;for(e=0,r=n.skips.length;e{n[e]=t[e]})),n.names=[],n.skips=[],n.formatters={},s(e,"selectColor"),n.selectColor=e,s(n,"createDebug"),s(r,"extend"),s(i,"enable"),s(a,"disable"),s(o,"enabled"),s(l,"toNamespace"),s(c,"coerce"),s(h,"destroy"),n.enable(n.load()),n}s(n,"setup"),e.exports=n}}),Ym=o({"../../node_modules/.pnpm/debug@4.3.7_supports-color@8.1.1/node_modules/debug/src/browser.js"(t,e){function n(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),t.splice(i,0,n)}function i(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(t){}}function a(){let e;try{e=t.storage.getItem("debug")}catch(t){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}function o(){try{return localStorage}catch(t){}}t.formatArgs=r,t.save=i,t.load=a,t.useColors=n,t.storage=o(),t.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],s(n,"useColors"),s(r,"formatArgs"),t.log=console.debug||console.log||(()=>{}),s(i,"save"),s(a,"load"),s(o,"localstorage"),e.exports=jm()(t);var{formatters:l}=e.exports;l.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}}),Wm=Object.freeze({left:0,top:0,width:16,height:16}),Hm=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Vm=Object.freeze({...Wm,...Hm}),Xm=Object.freeze({...Vm,body:"",hidden:!1}),Km=Object.freeze({width:null,height:null}),Zm=Object.freeze({...Km,...Hm}),Qm=/^[a-z0-9]+(-[a-z0-9]+)*$/,Jm=s(((t,e,n,r="")=>{const i=t.split(":");if("@"===t.slice(0,1)){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const t=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:t};return e&&!ty(a)?null:a}const a=i[0],s=a.split("-");if(s.length>1){const t={provider:r,prefix:s.shift(),name:s.join("-")};return e&&!ty(t)?null:t}if(n&&""===r){const t={provider:r,prefix:"",name:a};return e&&!ty(t,n)?null:t}return null}),"stringToIcon"),ty=s(((t,e)=>!!t&&!(""!==t.provider&&!t.provider.match(Qm)||!(e&&""===t.prefix||t.prefix.match(Qm))||!t.name.match(Qm))),"validateIconName");function ey(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const r=((t.rotate||0)+(e.rotate||0))%4;return r&&(n.rotate=r),n}function ny(t,e){const n=ey(t,e);for(const r in Xm)r in Hm?r in t&&!(r in n)&&(n[r]=Hm[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function ry(t,e){const n=t.icons,r=t.aliases||Object.create(null),i=Object.create(null);function a(t){if(n[t])return i[t]=[];if(!(t in i)){i[t]=null;const e=r[t]&&r[t].parent,n=e&&a(e);n&&(i[t]=[e].concat(n))}return i[t]}return s(a,"resolve"),(e||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function iy(t,e,n){const r=t.icons,i=t.aliases||Object.create(null);let a={};function o(t){a=ny(r[t]||i[t],a)}return s(o,"parse"),o(e),n.forEach(o),ny(t,a)}function ay(t,e){if(t.icons[e])return iy(t,e,[]);const n=ry(t,[e])[e];return n?iy(t,e,n):null}s(ey,"mergeIconTransformations"),s(ny,"mergeIconData"),s(ry,"getIconsTree"),s(iy,"internalGetIconData"),s(ay,"getIconData");var sy=/(-?[0-9.]*[0-9]+[0-9.]*)/g,oy=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ly(t,e,n){if(1===e)return t;if(n=n||100,"number"==typeof t)return Math.ceil(t*e*n)/n;if("string"!=typeof t)return t;const r=t.split(sy);if(null===r||!r.length)return t;const i=[];let a=r.shift(),s=oy.test(a);for(;;){if(s){const t=parseFloat(a);isNaN(t)?i.push(a):i.push(Math.ceil(t*e*n)/n)}else i.push(a);if(a=r.shift(),void 0===a)return i.join("");s=!s}}function cy(t,e="defs"){let n="";const r=t.indexOf("<"+e);for(;r>=0;){const i=t.indexOf(">",r),a=t.indexOf("",a);if(-1===s)break;n+=t.slice(i+1,a).trim(),t=t.slice(0,r).trim()+t.slice(s+1)}return{defs:n,content:t}}function hy(t,e){return t?""+t+""+e:e}function uy(t,e,n){const r=cy(t);return hy(r.defs,e+r.content+n)}s(ly,"calculateSize"),s(cy,"splitSVGDefs"),s(hy,"mergeDefsAndContent"),s(uy,"wrapSVGContent");var dy=s((t=>"unset"===t||"undefined"===t||"none"===t),"isUnsetKeyword");function py(t,e){const n={...Vm,...t},r={...Zm,...e},i={left:n.left,top:n.top,width:n.width,height:n.height};let a=n.body;[n,r].forEach((t=>{const e=[],n=t.hFlip,r=t.vFlip;let s,o=t.rotate;switch(n?r?o+=2:(e.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),e.push("scale(-1 1)"),i.top=i.left=0):r&&(e.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),e.push("scale(1 -1)"),i.top=i.left=0),o<0&&(o-=4*Math.floor(o/4)),o%=4,o){case 1:s=i.height/2+i.top,e.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:e.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:s=i.width/2+i.left,e.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),e.length&&(a=uy(a,'',""))}));const o=r.width,l=r.height,c=i.width,h=i.height;let u,d;null===o?(d=null===l?"1em":"auto"===l?h:l,u=ly(d,c/h)):(u="auto"===o?c:o,d=null===l?ly(u,h/c):"auto"===l?h:l);const p={},g=s(((t,e)=>{dy(e)||(p[t]=e.toString())}),"setAttr");g("width",u),g("height",d);const f=[i.left,i.top,c,h];return p.viewBox=f.join(" "),{attributes:p,viewBox:f,body:a}}s(py,"iconToSVG");var gy=/\sid="(\S+)"/g,fy="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),my=0;function yy(t,e=fy){const n=[];let r;for(;r=gy.exec(t);)n.push(r[1]);if(!n.length)return t;const i="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach((n=>{const r="function"==typeof e?e(n):e+(my++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")})),t=t.replace(new RegExp(i,"g"),"")}function vy(t,e){let n=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const t in e)n+=" "+t+'="'+e[t]+'"';return'"+t+""}s(yy,"replaceIDs"),s(vy,"iconToHTML"),d(Ym(),1);var xy={body:'?',height:80,width:80},by=new Map,wy=new Map,ky=s((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(m.debug("Registering icon pack:",e.name),"loader"in e)wy.set(e.name,e.loader);else{if(!("icons"in e))throw m.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');by.set(e.name,e.icons)}}}),"registerIconPacks"),Ty=s((async(t,e)=>{const n=Jm(t,!0,void 0!==e);if(!n)throw new Error(`Invalid icon name: ${t}`);const r=n.prefix||e;if(!r)throw new Error(`Icon name must contain a prefix: ${t}`);let i=by.get(r);if(!i){const t=wy.get(r);if(!t)throw new Error(`Icon set not found: ${n.prefix}`);try{i={...await t(),prefix:r},by.set(r,i)}catch(t){throw m.error(t),new Error(`Failed to load icon set: ${n.prefix}`)}}const a=ay(i,n.name);if(!a)throw new Error(`Icon not found: ${t}`);return a}),"getRegisteredIconData"),_y=s((async(t,e)=>{let n;try{n=await Ty(t,e?.fallbackPrefix)}catch(t){m.error(t),n=xy}const r=py(n,e);return vy(yy(r.body),r.attributes)}),"getIconSVG"),Ey=o({"../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/constants.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BLANK_URL=t.relativeFirstCharacters=t.whitespaceEscapeCharsRegex=t.urlSchemeRegex=t.ctrlCharactersRegex=t.htmlCtrlEntityRegex=t.htmlEntitiesRegex=t.invalidProtocolRegex=void 0,t.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,t.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,t.htmlCtrlEntityRegex=/&(newline|tab);/gi,t.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,t.urlSchemeRegex=/^.+(:|:)/gim,t.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,t.relativeFirstCharacters=[".","/"],t.BLANK_URL="about:blank"}}),Cy=o({"../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeUrl=void 0;var e=Ey();function n(t){return e.relativeFirstCharacters.indexOf(t[0])>-1}function r(t){return t.replace(e.ctrlCharactersRegex,"").replace(e.htmlEntitiesRegex,(function(t,e){return String.fromCharCode(e)}))}function i(t){return URL.canParse(t)}function a(t){try{return decodeURIComponent(t)}catch(e){return t}}function o(t){if(!t)return e.BLANK_URL;var s,o=a(t.trim());do{s=(o=a(o=r(o).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim())).match(e.ctrlCharactersRegex)||o.match(e.htmlEntitiesRegex)||o.match(e.htmlCtrlEntityRegex)||o.match(e.whitespaceEscapeCharsRegex)}while(s&&s.length>0);var l=o;if(!l)return e.BLANK_URL;if(n(l))return l;var c=l.trimStart(),h=c.match(e.urlSchemeRegex);if(!h)return l;var u=h[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var d=c.replace(/\\/g,"/");if("mailto:"===u||u.includes("://"))return d;if("http:"===u||"https:"===u){if(!i(d))return e.BLANK_URL;var p=new URL(d);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return d}s(n,"isRelativeUrlWithoutProtocol"),s(r,"decodeHtmlCharacters"),s(i,"isValidUrl"),s(a,"decodeURI"),s(o,"sanitizeUrl"),t.sanitizeUrl=o}}),Sy="object"==typeof global&&global&&global.Object===Object&&global,Ay="object"==typeof self&&self&&self.Object===Object&&self,Ly=Sy||Ay||Function("return this")(),Ny=Ly.Symbol,Iy=Object.prototype,My=Iy.hasOwnProperty,Ry=Iy.toString,Dy=Ny?Ny.toStringTag:void 0;function Oy(t){var e=My.call(t,Dy),n=t[Dy];try{t[Dy]=void 0;var r=!0}catch(t){}var i=Ry.call(t);return r&&(e?t[Dy]=n:delete t[Dy]),i}s(Oy,"getRawTag");var Py=Oy,By=Object.prototype.toString;function $y(t){return By.call(t)}s($y,"objectToString");var Fy=$y,zy=Ny?Ny.toStringTag:void 0;function Uy(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":zy&&zy in Object(t)?Py(t):Fy(t)}s(Uy,"baseGetTag");var Gy=Uy;function qy(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}s(qy,"isObject");var jy=qy;function Yy(t){if(!jy(t))return!1;var e=Gy(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}s(Yy,"isFunction");var Wy,Hy=Yy,Vy=Ly["__core-js_shared__"],Xy=(Wy=/[^.]+$/.exec(Vy&&Vy.keys&&Vy.keys.IE_PROTO||""))?"Symbol(src)_1."+Wy:"";function Ky(t){return!!Xy&&Xy in t}s(Ky,"isMasked");var Zy=Ky,Qy=Function.prototype.toString;function Jy(t){if(null!=t){try{return Qy.call(t)}catch(t){}try{return t+""}catch(t){}}return""}s(Jy,"toSource");var tv=Jy,ev=/^\[object .+?Constructor\]$/,nv=Function.prototype,rv=Object.prototype,iv=nv.toString,av=rv.hasOwnProperty,sv=RegExp("^"+iv.call(av).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ov(t){return!(!jy(t)||Zy(t))&&(Hy(t)?sv:ev).test(tv(t))}s(ov,"baseIsNative");var lv=ov;function cv(t,e){return null==t?void 0:t[e]}s(cv,"getValue");var hv=cv;function uv(t,e){var n=hv(t,e);return lv(n)?n:void 0}s(uv,"getNative");var dv=uv,pv=dv(Object,"create");function gv(){this.__data__=pv?pv(null):{},this.size=0}s(gv,"hashClear");var fv=gv;function mv(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}s(mv,"hashDelete");var yv=mv,vv=Object.prototype.hasOwnProperty;function xv(t){var e=this.__data__;if(pv){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return vv.call(e,t)?e[t]:void 0}s(xv,"hashGet");var bv=xv,wv=Object.prototype.hasOwnProperty;function kv(t){var e=this.__data__;return pv?void 0!==e[t]:wv.call(e,t)}s(kv,"hashHas");var Tv=kv;function _v(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=pv&&void 0===e?"__lodash_hash_undefined__":e,this}s(_v,"hashSet");var Ev=_v;function Cv(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1}s(Fv,"listCacheHas");var zv=Fv;function Uv(t,e){var n=this.__data__,r=Rv(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}s(Uv,"listCacheSet");var Gv=Uv;function qv(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}s(ub,"isLength");var db=ub;function pb(t){return null!=t&&db(t.length)&&!Hy(t)}s(pb,"isArrayLike");var gb=pb;function fb(t){return nb(t)&&gb(t)}s(fb,"isArrayLikeObject");var mb=fb;function yb(){return!1}s(yb,"stubFalse");var vb=yb,xb="object"==typeof exports&&exports&&!exports.nodeType&&exports,bb=xb&&"object"==typeof module&&module&&!module.nodeType&&module,wb=bb&&bb.exports===xb?Ly.Buffer:void 0,kb=(wb?wb.isBuffer:void 0)||vb,Tb=Function.prototype,_b=Object.prototype,Eb=Tb.toString,Cb=_b.hasOwnProperty,Sb=Eb.call(Object);function Ab(t){if(!nb(t)||"[object Object]"!=Gy(t))return!1;var e=Xx(t);if(null===e)return!0;var n=Cb.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Eb.call(n)==Sb}s(Ab,"isPlainObject");var Lb=Ab,Nb={};function Ib(t){return nb(t)&&db(t.length)&&!!Nb[Gy(t)]}Nb["[object Float32Array]"]=Nb["[object Float64Array]"]=Nb["[object Int8Array]"]=Nb["[object Int16Array]"]=Nb["[object Int32Array]"]=Nb["[object Uint8Array]"]=Nb["[object Uint8ClampedArray]"]=Nb["[object Uint16Array]"]=Nb["[object Uint32Array]"]=!0,Nb["[object Arguments]"]=Nb["[object Array]"]=Nb["[object ArrayBuffer]"]=Nb["[object Boolean]"]=Nb["[object DataView]"]=Nb["[object Date]"]=Nb["[object Error]"]=Nb["[object Function]"]=Nb["[object Map]"]=Nb["[object Number]"]=Nb["[object Object]"]=Nb["[object RegExp]"]=Nb["[object Set]"]=Nb["[object String]"]=Nb["[object WeakMap]"]=!1,s(Ib,"baseIsTypedArray");var Mb=Ib;function Rb(t){return function(e){return t(e)}}s(Rb,"baseUnary");var Db=Rb,Ob="object"==typeof exports&&exports&&!exports.nodeType&&exports,Pb=Ob&&"object"==typeof module&&module&&!module.nodeType&&module,Bb=Pb&&Pb.exports===Ob&&Sy.process,$b=function(){try{var t=Pb&&Pb.require&&Pb.require("util").types;return t||Bb&&Bb.binding&&Bb.binding("util")}catch(t){}}(),Fb=$b&&$b.isTypedArray,zb=Fb?Db(Fb):Mb;function Ub(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}s(Ub,"safeGet");var Gb=Ub,qb=Object.prototype.hasOwnProperty;function jb(t,e,n){var r=t[e];qb.call(t,e)&&Iv(r,n)&&(void 0!==n||e in t)||Cx(t,e,n)}s(jb,"assignValue");var Yb=jb;function Wb(t,e,n,r){var i=!n;n||(n={});for(var a=-1,s=e.length;++a-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}s(Ew,"shortOut");var Cw=Ew(Tw);function Sw(t,e){return Cw(ww(t,e,mw),t+"")}s(Sw,"baseRest");var Aw=Sw;function Lw(t,e,n){if(!jy(n))return!1;var r=typeof e;return!!("number"==r?gb(n)&&Qb(e,n.length):"string"==r&&e in n)&&Iv(n[e],t)}s(Lw,"isIterateeCall");var Nw=Lw;function Iw(t){return Aw((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,s&&Nw(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++rt.args));St(t),r=L(r,[...t])}else r=n.args;if(!r)return;let i=_(t,e);const a="config";return void 0!==r[a]&&("flowchart-v2"===i&&(i="flowchart"),r[i]=r[a],delete r[a]),r}),"detectInit"),Fw=s((function(t,e=null){try{const n=new RegExp(`[%]{2}(?![{]${Bw.source})(?=[}][%]{2}).*\n`,"ig");let r;t=t.trim().replace(n,"").replace(/'/gm,'"'),m.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const i=[];for(;null!==(r=b.exec(t));)if(r.index===b.lastIndex&&b.lastIndex++,r&&!e||e&&r[1]?.match(e)||e&&r[2]?.match(e)){const t=r[1]?r[1]:r[2],e=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:t,args:e})}return 0===i.length?{type:t,args:null}:1===i.length?i[0]:i}catch(n){return m.error(`ERROR: ${n.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}}),"detectDirective"),zw=s((function(t){return t.replace(b,"")}),"removeDirectives"),Uw=s((function(t,e){for(const[n,r]of e.entries())if(r.match(t))return n;return-1}),"isSubstringInArray");function Gw(t,e){if(!t)return e;const n=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Pw[n]??e}function qw(t,e){const n=t.trim();if(n)return"loose"!==e.securityLevel?(0,Ow.sanitizeUrl)(n):n}s(Gw,"interpolateToCurve"),s(qw,"formatUrl");var jw=s(((t,...e)=>{const n=t.split("."),r=n.length-1,i=n[r];let a=window;for(let e=0;e{n+=Yw(t,e),e=t}));return Xw(t,n/2)}function Hw(t){return 1===t.length?t[0]:Ww(t)}s(Yw,"distance"),s(Ww,"traverseEdge"),s(Hw,"calcLabelPosition");var Vw=s(((t,e=2)=>{const n=Math.pow(10,e);return Math.round(t*n)/n}),"roundNumber"),Xw=s(((t,e)=>{let n,r=e;for(const e of t){if(n){const t=Yw(e,n);if(t=1)return{x:e.x,y:e.y};if(i>0&&i<1)return{x:Vw((1-i)*n.x+i*e.x,5),y:Vw((1-i)*n.y+i*e.y,5)}}}n=e}throw new Error("Could not find a suitable point for the given distance")}),"calculatePoint"),Kw=s(((t,e,n)=>{m.info(`our points ${JSON.stringify(e)}`),e[0]!==n&&(e=e.reverse());const r=Xw(e,25),i=t?10:5,a=Math.atan2(e[0].y-r.y,e[0].x-r.x),s={x:0,y:0};return s.x=Math.sin(a)*i+(e[0].x+r.x)/2,s.y=-Math.cos(a)*i+(e[0].y+r.y)/2,s}),"calcCardinalityPosition");function Zw(t,e,n){const r=structuredClone(n);m.info("our points",r),"start_left"!==e&&"start_right"!==e&&r.reverse();const i=Xw(r,25+t),a=10+.5*t,s=Math.atan2(r[0].y-i.y,r[0].x-i.x),o={x:0,y:0};return"start_left"===e?(o.x=Math.sin(s+Math.PI)*a+(r[0].x+i.x)/2,o.y=-Math.cos(s+Math.PI)*a+(r[0].y+i.y)/2):"end_right"===e?(o.x=Math.sin(s-Math.PI)*a+(r[0].x+i.x)/2-5,o.y=-Math.cos(s-Math.PI)*a+(r[0].y+i.y)/2-5):"end_left"===e?(o.x=Math.sin(s)*a+(r[0].x+i.x)/2-5,o.y=-Math.cos(s)*a+(r[0].y+i.y)/2-5):(o.x=Math.sin(s)*a+(r[0].x+i.x)/2,o.y=-Math.cos(s)*a+(r[0].y+i.y)/2),o}function Qw(t){let e="",n="";for(const r of t)void 0!==r&&(r.startsWith("color:")||r.startsWith("text-align:")?n=n+r+";":e=e+r+";");return{style:e,labelStyle:n}}s(Zw,"calcTerminalLabelPosition"),s(Qw,"getStylesFromArray");var Jw=0,tk=s((()=>(Jw++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Jw)),"generateId");function ek(t){let e="";const n="0123456789abcdef",r=n.length;for(let i=0;iek(t.length)),"random"),rk=s((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"),ik=s((function(t,e){const n=e.text.replace(_n.lineBreakRegex," "),[,r]=fk(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",r),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.attr("fill",e.fill),a.text(n),i}),"drawSimpleText"),ak=cx(((t,e,n)=>{if(!t)return t;if(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},n),_n.lineBreakRegex.test(t))return t;const r=t.split(" ").filter(Boolean),i=[];let a="";return r.forEach(((t,s)=>{const o=lk(`${t} `,n),l=lk(a,n);if(o>e){const{hyphenatedStrings:r,remainingWord:s}=sk(t,e,"-",n);i.push(a,...r),a=s}else l+o>=e?(i.push(a),a=t):a=[a,t].filter(Boolean).join(" ");s+1===r.length&&i.push(a)})),i.filter((t=>""!==t)).join(n.joinWith)}),((t,e,n)=>`${t}${e}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`)),sk=cx(((t,e,n="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const i=[...t],a=[];let s="";return i.forEach(((t,o)=>{const l=`${s}${t}`;if(lk(l,r)>=e){const t=o+1,e=i.length===t,r=`${l}${n}`;a.push(e?l:r),s=""}else s=l})),{hyphenatedStrings:a,remainingWord:s}}),((t,e,n="-",r)=>`${t}${e}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`));function ok(t,e){return hk(t,e).height}function lk(t,e){return hk(t,e).width}s(ok,"calculateTextHeight"),s(lk,"calculateTextWidth");var ck,hk=cx(((t,e)=>{const{fontSize:n=12,fontFamily:r="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=fk(n),s=["sans-serif",r],o=t.split(_n.lineBreakRegex),l=[],c=Oa("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const t of s){let e=0;const n={width:0,height:0,lineHeight:0};for(const r of o){const s=rk();s.text=r||"​";const o=ik(h,s).style("font-size",a).style("font-weight",i).style("font-family",t),l=(o._groups||o)[0][0].getBBox();if(0===l.width&&0===l.height)throw new Error("svg element not in render tree");n.width=Math.round(Math.max(n.width,l.width)),e=Math.round(l.height),n.height+=e,n.lineHeight=Math.round(Math.max(n.lineHeight,e))}l.push(n)}h.remove();return l[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]}),((t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`)),uk=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{s(this,"InitIDGenerator")}},dk=s((function(t){return ck=ck||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),ck.innerHTML=t,unescape(ck.textContent)}),"entityDecode");function pk(t){return"str"in t}s(pk,"isDetailedError");var gk=s(((t,e,n,r)=>{if(!r)return;const i=t.node()?.getBBox();i&&t.append("text").text(r).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-n).attr("class",e)}),"insertTitle"),fk=s((t=>{if("number"==typeof t)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 mk(t,e){return Dw({},t,e)}s(mk,"cleanAndMerge");var yk={assignWithDepth:L,wrapLabel:ak,calculateTextHeight:ok,calculateTextWidth:lk,calculateTextDimensions:hk,cleanAndMerge:mk,detectInit:$w,detectDirective:Fw,isSubstringInArray:Uw,interpolateToCurve:Gw,calcLabelPosition:Hw,calcCardinalityPosition:Kw,calcTerminalLabelPosition:Zw,formatUrl:qw,getStylesFromArray:Qw,generateId:tk,random:nk,runFunc:jw,entityDecode:dk,insertTitle:gk,parseFontSize:fk,InitIDGenerator:uk},vk=s((function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/classDef.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/#\w+;/g,(function(t){const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})),e}),"encodeEntities"),xk=s((function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")}),"decodeEntities"),bk=s(((t,e,{counter:n=0,prefix:r,suffix:i})=>`${r?`${r}_`:""}${t}_${e}_${n}${i?`_${i}`:""}`),"getEdgeId");function wk(t){return t??null}function kk(t){for(var e=[],n=1;n"']/,Sk=new RegExp(Ck.source,"g"),Ak=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Lk=new RegExp(Ak.source,"g"),Nk={"&":"&","<":"<",">":">",'"':""","'":"'"},Ik=s((t=>Nk[t]),"getEscapeReplacement");function Mk(t,e){if(e){if(Ck.test(t))return t.replace(Sk,Ik)}else if(Ak.test(t))return t.replace(Lk,Ik);return t}s(Mk,"escape$1");var Rk=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Dk(t){return t.replace(Rk,((t,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}s(Dk,"unescape");var Ok=/(^|[^\[])\^/g;function Pk(t,e){let n="string"==typeof t?t:t.source;e=e||"";const r={replace:s(((t,e)=>{let i="string"==typeof e?e:e.source;return i=i.replace(Ok,"$1"),n=n.replace(t,i),r}),"replace"),getRegex:s((()=>new RegExp(n,e)),"getRegex")};return r}function Bk(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}s(Pk,"edit"),s(Bk,"cleanUrl");var $k={exec:s((()=>null),"exec")};function Fk(t,e){const n=t.replace(/\|/g,((t,e,n)=>{let r=!1,i=e;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length{const e=t.match(/^\s+/);if(null===e)return t;const[n]=e;return n.length>=r.length?t.slice(r.length):t})).join("\n")}s(Fk,"splitCells"),s(zk,"rtrim"),s(Uk,"findClosingBracket"),s(Gk,"outputLink"),s(qk,"indentCodeCompensation");var jk=class{static{s(this,"_Tokenizer")}options;rules;lexer;constructor(t){this.options=t||_k}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:zk(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],n=qk(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(/#$/.test(t)){const e=zk(t,"#");this.options.pedantic?t=e.trim():e&&!/ $/.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:zk(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=zk(e[0],"\n").split("\n"),n="",r="";const i=[];for(;t.length>0;){let e=!1;const a=[];let s;for(s=0;s/.test(t[s]))a.push(t[s]),e=!0;else{if(e)break;a.push(t[s])}t=t.slice(s);const o=a.join("\n"),l=o.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${o}`:o,r=r?`${r}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===t.length)break;const h=i[i.length-1];if("code"===h?.type)break;if("blockquote"===h?.type){const e=h,a=e.raw+"\n"+t.join("\n"),s=this.blockquote(a);i[i.length-1]=s,n=n.substring(0,n.length-e.raw.length)+s.raw,r=r.substring(0,r.length-e.text.length)+s.text;break}if("list"!==h?.type);else{const e=h,a=e.raw+"\n"+t.join("\n"),s=this.list(a);i[i.length-1]=s,n=n.substring(0,n.length-h.raw.length)+s.raw,r=r.substring(0,r.length-e.raw.length)+s.raw,t=a.substring(i[i.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const a=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s=!1;for(;t;){let n=!1,r="",o="";if(!(e=a.exec(t)))break;if(this.rules.block.hr.test(t))break;r=e[0],t=t.substring(r.length);let l=e[2].split("\n",1)[0].replace(/^\t+/,(t=>" ".repeat(3*t.length))),c=t.split("\n",1)[0],h=!l.trim(),u=0;if(this.options.pedantic?(u=2,o=l.trimStart()):h?u=e[1].length+1:(u=e[2].search(/[^ ]/),u=u>4?1:u,o=l.slice(u),u+=e[1].length),h&&/^ *$/.test(c)&&(r+=c+"\n",t=t.substring(c.length+1),n=!0),!n){const e=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),a=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;t;){const s=t.split("\n",1)[0];if(c=s,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(c))break;if(a.test(c))break;if(e.test(c))break;if(n.test(t))break;if(c.search(/[^ ]/)>=u||!c.trim())o+="\n"+c.slice(u);else{if(h)break;if(l.search(/[^ ]/)>=4)break;if(i.test(l))break;if(a.test(l))break;if(n.test(l))break;o+="\n"+c}h||c.trim()||(h=!0),r+=s+"\n",t=t.substring(s.length+1),l=c.slice(u)}}i.loose||(s?i.loose=!0:/\n *\n *$/.test(r)&&(s=!0));let d,p=null;this.options.gfm&&(p=/^\[[ xX]\] /.exec(o),p&&(d="[ ] "!==p[0],o=o.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:r,task:!!p,checked:d,loose:!1,text:o,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let t=0;t"space"===t.type)),n=e.length>0&&e.some((t=>/\n.*\n/.test(t.raw)));i.loose=n}if(i.loose)for(let t=0;t$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(!e)return;if(!/[:|]/.test(e[2]))return;const n=Fk(e[1]),r=e[2].replace(/^\||\| *$/g,"").split("|"),i=e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const t of r)/^ *-+: *$/.test(t)?a.align.push("right"):/^ *:-+: *$/.test(t)?a.align.push("center"):/^ *:-+ *$/.test(t)?a.align.push("left"):a.align.push(null);for(let t=0;t({text:t,tokens:this.lexer.inline(t),header:!1,align:a.align[e]}))));return a}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:Mk(e[1])}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&/^/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^$/.test(t))return;const e=zk(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=Uk(e[2],"()");if(t>-1){const n=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,n).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){const t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);t&&(n=t[1],r=t[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),/^$/.test(t)?n.slice(1):n.slice(1,-1)),Gk(e,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},e[0],this.lexer)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const t=e[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!t){const t=n[0].charAt(0);return{type:"text",raw:t,text:t}}return Gk(n,t,n[0],this.lexer)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let i,a,s=n,o=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+n);null!=(r=l.exec(e));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){s+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){o+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s+o);const e=[...r[0]][0].length,l=t.slice(0,n+r.index+e+a);if(Math.min(n,a)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(/\n/g," ");const n=/[^ ]/.test(t),r=/^ /.test(t)&&/ $/.test(t);return n&&r&&(t=t.substring(1,t.length-1)),t=Mk(t,!0),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,n;return"@"===e[2]?(t=Mk(e[1]),n="mailto:"+t):(t=Mk(e[1]),n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,n;if("@"===e[2])t=Mk(e[0]),n="mailto:"+t;else{let r;do{r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(r!==e[0]);t=Mk(e[0]),n="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){let t;return t=this.lexer.state.inRawBlock?e[0]:Mk(e[0]),{type:"text",raw:e[0],text:t}}}},Yk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wk=/(?:[*+-]|\d{1,9}[.)])/,Hk=Pk(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Wk).replace(/blockCode/g,/ {4}/).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/).getRegex(),Vk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xk=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Kk=Pk(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Xk).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Zk=Pk(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Wk).getRegex(),Qk="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",Jk=/|$))/,tT=Pk("^ {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",Jk).replace("tag",Qk).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eT=Pk(Vk).replace("hr",Yk).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",Qk).getRegex(),nT={blockquote:Pk(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",eT).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Kk,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Yk,html:tT,lheading:Hk,list:Zk,newline:/^(?: *(?:\n|$))+/,paragraph:eT,table:$k,text:/^[^\n]+/},rT=Pk("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Qk).getRegex(),iT={...nT,table:rT,paragraph:Pk(Vk).replace("hr",Yk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",rT).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",Qk).getRegex()},aT={...nT,html:Pk("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Jk).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:$k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pk(Vk).replace("hr",Yk).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Hk).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oT=/^( {2,}|\\)\n(?!\s*$)/,lT=Pk(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,"\\p{P}\\p{S}").getRegex(),cT=Pk(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),hT=Pk("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),uT=Pk("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),dT=Pk(/\\([punct])/,"gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),pT=Pk(/^<(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(),gT=Pk(Jk).replace("(?:--\x3e|$)","--\x3e").getRegex(),fT=Pk("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",gT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mT=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,yT=Pk(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",mT).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vT=Pk(/^!?\[(label)\]\[(ref)\]/).replace("label",mT).replace("ref",Xk).getRegex(),xT=Pk(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xk).getRegex(),bT={_backpedal:$k,anyPunctuation:dT,autolink:pT,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:oT,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:$k,emStrongLDelim:cT,emStrongRDelimAst:hT,emStrongRDelimUnd:uT,escape:sT,link:yT,nolink:xT,punctuation:lT,reflink:vT,reflinkSearch:Pk("reflink|nolink(?!\\()","g").replace("reflink",vT).replace("nolink",xT).getRegex(),tag:fT,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\e+" ".repeat(n.length)));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},t,e))&&(t=t.substring(r.raw.length),e.push(r),!0)))))if(r=this.tokenizer.space(t))t=t.substring(r.raw.length),1===r.raw.length&&e.length>0?e[e.length-1].raw+="\n":e.push(r);else if(r=this.tokenizer.code(t))t=t.substring(r.raw.length),i=e[e.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?e.push(r):(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.fences(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.heading(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.hr(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.blockquote(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.list(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.html(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.def(t))t=t.substring(r.raw.length),i=e[e.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(i.raw+="\n"+r.raw,i.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.table(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.lheading(t))t=t.substring(r.raw.length),e.push(r);else{if(a=t,this.options.extensions&&this.options.extensions.startBlock){let e=1/0;const n=t.slice(1);let r;this.options.extensions.startBlock.forEach((t=>{r=t.call({lexer:this},n),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(a=t.substring(0,e+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a)))i=e[e.length-1],n&&"paragraph"===i?.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(r),n=a.length!==t.length,t=t.substring(r.raw.length);else if(r=this.tokenizer.text(t))t=t.substring(r.raw.length),i=e[e.length-1],i&&"text"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(r);else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n,r,i,a,s,o,l=t;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(l));)t.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,a.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(s||(o=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0)))))if(n=this.tokenizer.escape(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.tag(t))t=t.substring(n.raw.length),r=e[e.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);else if(n=this.tokenizer.link(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(n.raw.length),r=e[e.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);else if(n=this.tokenizer.emStrong(t,l,o))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.codespan(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.br(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.del(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.autolink(t))t=t.substring(n.raw.length),e.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(t))){if(i=t,this.options.extensions&&this.options.extensions.startInline){let e=1/0;const n=t.slice(1);let r;this.options.extensions.startInline.forEach((t=>{r=t.call({lexer:this},n),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}if(n=this.tokenizer.inlineText(i))t=t.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),s=!0,r=e[e.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}else t=t.substring(n.raw.length),e.push(n);return e}},ST=class{static{s(this,"_Renderer")}options;parser;constructor(t){this.options=t||_k}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(/^\S*/)?.[0],i=t.replace(/\n$/,"")+"\n";return r?'
'+(n?i:Mk(i,!0))+"
\n":"
"+(n?i:Mk(i,!0))+"
\n"}blockquote({tokens:t}){return`
\n${this.parser.parse(t)}
\n`}html({text:t}){return t}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)}\n`}hr(t){return"
\n"}list(t){const e=t.ordered,n=t.start;let r="";for(let e=0;e\n"+r+"\n"}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?t.tokens.length>0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=n+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`
  • ${e}
  • \n`}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    \n`}table(t){let e="",n="";for(let e=0;e${r}`),"\n\n"+e+"\n"+r+"
    \n"}tablerow({text:t}){return`\n${t}\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${t}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),i=Bk(t);if(null===i)return r;let a='
    ",a}image({href:t,title:e,text:n}){const r=Bk(t);if(null===r)return n;let i=`${n}{const i=t[r].flat(1/0);n=n.concat(this.walkTokens(i,e))})):t.tokens&&(n=n.concat(this.walkTokens(t.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((t=>{const n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const n=e.renderers[t.name];e.renderers[t.name]=n?function(...e){let r=t.renderer.apply(this,e);return!1===r&&(r=n.apply(this,e)),r}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const n=e[t.level];n?n.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),n.extensions=e),t.renderer){const e=this.defaults.renderer||new ST(this.defaults);for(const n in t.renderer){if(!(n in e))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n;let i=t.renderer[r];t.useNewRenderer||(i=this.#e(i,r,e));const a=e[r];e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=a.apply(e,t)),n||""}}n.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new jk(this.defaults);for(const n in t.tokenizer){if(!(n in e))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=t.tokenizer[r],a=e[r];e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=a.apply(e,t)),n}}n.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new NT;for(const n in t.hooks){if(!(n in e))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=t.hooks[r],a=e[r];NT.passThroughHooks.has(n)?e[r]=t=>{if(this.defaults.async)return Promise.resolve(i.call(e,t)).then((t=>a.call(e,t)));const n=i.call(e,t);return a.call(e,n)}:e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=a.apply(e,t)),n}}n.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,r=t.walkTokens;n.walkTokens=function(t){let n=[];return n.push(r.call(this,t)),e&&(n=n.concat(e.call(this,t))),n}}this.defaults={...this.defaults,...n}})),this}#e(t,e,n){switch(e){case"heading":return function(r){return r.type&&r.type===e?t.call(this,n.parser.parseInline(r.tokens),r.depth,Dk(n.parser.parseInline(r.tokens,n.parser.textRenderer))):t.apply(this,arguments)};case"code":return function(n){return n.type&&n.type===e?t.call(this,n.text,n.lang,!!n.escaped):t.apply(this,arguments)};case"table":return function(n){if(!n.type||n.type!==e)return t.apply(this,arguments);let r="",i="";for(let t=0;t0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=t+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=t+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",text:t+" "}):o+=t+" "}o+=this.parser.parse(e.tokens,a),s+=this.listitem({type:"list_item",raw:o,text:o,task:i,checked:!!r,loose:a,tokens:e.tokens})}return t.call(this,s,r,i)};case"html":return function(n){return n.type&&n.type===e?t.call(this,n.text,n.block):t.apply(this,arguments)};case"paragraph":case"strong":case"em":case"del":return function(n){return n.type&&n.type===e?t.call(this,this.parser.parseInline(n.tokens)):t.apply(this,arguments)};case"escape":case"codespan":case"text":return function(n){return n.type&&n.type===e?t.call(this,n.text):t.apply(this,arguments)};case"link":return function(n){return n.type&&n.type===e?t.call(this,n.href,n.title,this.parser.parseInline(n.tokens)):t.apply(this,arguments)};case"image":return function(n){return n.type&&n.type===e?t.call(this,n.href,n.title,n.text):t.apply(this,arguments)}}return t}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return CT.lex(t,e??this.defaults)}parser(t,e){return LT.parse(t,e??this.defaults)}#t(t,e){return(n,r)=>{const i={...r},a={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(a.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),a.async=!0);const s=this.#n(!!a.silent,!!a.async);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then((e=>t(e,a))).then((t=>a.hooks?a.hooks.processAllTokens(t):t)).then((t=>a.walkTokens?Promise.all(this.walkTokens(t,a.walkTokens)).then((()=>t)):t)).then((t=>e(t,a))).then((t=>a.hooks?a.hooks.postprocess(t):t)).catch(s);try{a.hooks&&(n=a.hooks.preprocess(n));let r=t(n,a);a.hooks&&(r=a.hooks.processAllTokens(r)),a.walkTokens&&this.walkTokens(r,a.walkTokens);let i=e(r,a);return a.hooks&&(i=a.hooks.postprocess(i)),i}catch(t){return s(t)}}}#n(t,e){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="

    An error occurred:

    "+Mk(n.message+"",!0)+"
    ";return e?Promise.resolve(t):t}if(e)return Promise.reject(n);throw n}}},MT=new IT;function RT(t,e){return MT.parse(t,e)}function DT(t,{markdownAutoWrap:e}){const n=kk(t.replace(//g,"\n").replace(/\n{2,}/g,"\n"));return!1===e?n.replace(/ /g," "):n}function OT(t,e={}){const n=DT(t,e),r=RT.lexer(n),i=[[]];let a=0;function o(t,e="normal"){if("text"===t.type){t.text.split("\n").forEach(((t,n)=>{0!==n&&(a++,i.push([])),t.split(" ").forEach((t=>{(t=t.replace(/'/g,"'"))&&i[a].push({content:t,type:e})}))}))}else"strong"===t.type||"em"===t.type?t.tokens.forEach((e=>{o(e,t.type)})):"html"===t.type&&i[a].push({content:t.text,type:"normal"})}return s(o,"processNode"),r.forEach((t=>{"paragraph"===t.type?t.tokens?.forEach((t=>{o(t)})):"html"===t.type&&i[a].push({content:t.text,type:"normal"})})),i}function PT(t,{markdownAutoWrap:e}={}){const n=RT.lexer(t);function r(t){return"text"===t.type?!1===e?t.text.replace(/\n */g,"
    ").replace(/ /g," "):t.text.replace(/\n */g,"
    "):"strong"===t.type?`${t.tokens?.map(r).join("")}`:"em"===t.type?`${t.tokens?.map(r).join("")}`:"paragraph"===t.type?`

    ${t.tokens?.map(r).join("")}

    `:"space"===t.type?"":"html"===t.type?`${t.text}`:"escape"===t.type?t.text:`Unsupported markdown: ${t.type}`}return s(r,"output"),n.map(r).join("")}function BT(t){return Intl.Segmenter?[...(new Intl.Segmenter).segment(t)].map((t=>t.segment)):[...t]}function $T(t,e){return FT(t,[],BT(e.content),e.type)}function FT(t,e,n,r){if(0===n.length)return[{content:e.join(""),type:r},{content:"",type:r}];const[i,...a]=n,s=[...e,i];return t([{content:s.join(""),type:r}])?FT(t,s,a,r):(0===e.length&&i&&(e.push(i),n.shift()),[{content:e.join(""),type:r},{content:n.join(""),type:r}])}function zT(t,e){if(t.some((({content:t})=>t.includes("\n"))))throw new Error("splitLineToFitWidth does not support newlines in the line");return UT(t,e)}function UT(t,e,n=[],r=[]){if(0===t.length)return r.length>0&&n.push(r),n.length>0?n:[];let i="";" "===t[0].content&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...r];if(""!==i&&s.push({content:i,type:"normal"}),s.push(a),e(s))return UT(t,e,n,s);if(r.length>0)n.push(r),t.unshift(a);else if(a.content){const[r,i]=$T(e,a);n.push([r]),i.content&&t.unshift(i)}return UT(t,e,n)}function GT(t,e){e&&t.attr("style",e)}async function qT(t,e,n,r,i=!1){const a=t.append("foreignObject");a.attr("width",10*n+"px"),a.attr("height",10*n+"px");const s=a.append("xhtml:div");let o=e.label;e.label&&wn(e.label)&&(o=await Tn(e.label.replace(_n.lineBreakRegex,"\n"),Hn()));const l=e.isNode?"nodeLabel":"edgeLabel",c=s.append("span");c.html(o),GT(c,e.labelStyle),c.attr("class",`${l} ${r}`),GT(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),s.style("max-width",n+"px"),s.style("text-align","center"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&s.attr("class","labelBkg");let h=s.node().getBoundingClientRect();return h.width===n&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",n+"px"),h=s.node().getBoundingClientRect()),a.node()}function jT(t,e,n){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*n-.1+"em").attr("dy",n+"em")}function YT(t,e,n){const r=t.append("text"),i=jT(r,1,e);VT(i,n);const a=i.node().getComputedTextLength();return r.remove(),a}function WT(t,e,n){const r=t.append("text"),i=jT(r,1,e);VT(i,[{content:n,type:"normal"}]);const a=i.node()?.getBoundingClientRect();return a&&r.remove(),a}function HT(t,e,n,r=!1){const i=e.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),o=i.append("text").attr("y","-10.1");let l=0;for(const e of n){const n=s((e=>YT(i,1.1,e)<=t),"checkWidth"),r=n(e)?[e]:zT(e,n);for(const t of r){VT(jT(o,l,1.1),t),l++}}if(r){const t=o.node().getBBox(),e=2;return a.attr("x",t.x-e).attr("y",t.y-e).attr("width",t.width+2*e).attr("height",t.height+2*e),i.node()}return o.node()}function VT(t,e){t.text(""),e.forEach(((e,n)=>{const r=t.append("tspan").attr("font-style","em"===e.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===e.type?"bold":"normal");0===n?r.text(e.content):r.text(" "+e.content)}))}function XT(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,(t=>``))}s(RT,"marked"),RT.options=RT.setOptions=function(t){return MT.setOptions(t),RT.defaults=MT.defaults,Ek(RT.defaults),RT},RT.getDefaults=Tk,RT.defaults=_k,RT.use=function(...t){return MT.use(...t),RT.defaults=MT.defaults,Ek(RT.defaults),RT},RT.walkTokens=function(t,e){return MT.walkTokens(t,e)},RT.parseInline=MT.parseInline,RT.Parser=LT,RT.parser=LT.parse,RT.Renderer=ST,RT.TextRenderer=AT,RT.Lexer=CT,RT.lexer=CT.lex,RT.Tokenizer=jk,RT.Hooks=NT,RT.parse=RT,RT.options,RT.setOptions,RT.use,RT.walkTokens,RT.parseInline,LT.parse,CT.lex,s(DT,"preprocessMarkdown"),s(OT,"markdownToLines"),s(PT,"markdownToHTML"),s(BT,"splitTextToChars"),s($T,"splitWordToFitWidth"),s(FT,"splitWordToFitWidthRecursion"),s(zT,"splitLineToFitWidth"),s(UT,"splitLineToFitWidthRecursion"),s(GT,"applyStyle"),s(qT,"addHtmlSpan"),s(jT,"createTspan"),s(YT,"computeWidthOfText"),s(WT,"computeDimensionOfText"),s(HT,"createFormattedText"),s(VT,"updateTextContentAndStyles"),s(XT,"replaceIconSubstring");var KT=s((async(t,e="",{style:n="",isTitle:r=!1,classes:i="",useHtmlLabels:a=!0,isNode:s=!0,width:o=200,addSvgBackground:l=!1}={},c)=>{if(m.debug("XYZ createText",e,n,r,i,a,s,"addSvgBackground: ",l),a){const r=PT(e,c),a=XT(xk(r)),h=e.replace(/\\\\/g,"\\"),u={isNode:s,label:wn(e)?h:a,labelStyle:n.replace("fill:","color:")};return await qT(t,u,o,i,l)}{const r=HT(o,t,OT(e.replace(//g,"
    ").replace("
    ","
    "),c),!!e&&l);if(s){/stroke:/.exec(n)&&(n=n.replace("stroke:","lineColor:"));const t=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Oa(r).attr("style",t)}else{const t=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Oa(r).select("rect").attr("style",t.replace(/background:/g,"fill:"));const e=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Oa(r).select("text").attr("style",e)}return r}}),"createText"),ZT=s((async(t,e,n)=>{let r;const i=e.useHtmlLabels||dn(Hn()?.htmlLabels);r=n||"node default";const a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),o=a.insert("g").attr("class","label").attr("style",wk(e.labelStyle));let l;l=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];const c=await KT(o,an(xk(l),Hn()),{useHtmlLabels:i,width:e.width||Hn().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img});let h=c.getBBox();const u=(e?.padding??0)/2;if(i){const t=c.children[0],e=Oa(c),n=t.getElementsByTagName("img");if(n){const t=""===l.replace(/]*>/g,"").trim();await Promise.all([...n].map((e=>new Promise((n=>{function r(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=Hn().fontSize?Hn().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[r=Ct.fontSize]=fk(t),i=r*n+"px";e.style.minWidth=i,e.style.maxWidth=i}else e.style.width="100%";n(e)}s(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return i?o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):o.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:u,label:o}}),"labelHelper"),QT=s((async(t,e,n)=>{const r=n.useHtmlLabels||dn(Hn()?.flowchart?.htmlLabels),i=t.insert("g").attr("class","label").attr("style",n.labelStyle||""),a=await KT(i,an(xk(e),Hn()),{useHtmlLabels:r,width:n.width||Hn()?.flowchart?.wrappingWidth,style:n.labelStyle,addSvgBackground:!!n.icon||!!n.img});let s=a.getBBox();const o=n.padding/2;if(dn(Hn()?.flowchart?.htmlLabels)){const t=a.children[0],e=Oa(a);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}return r?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),n.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}}),"insertLabel"),JT=s(((t,e)=>{const n=e.node().getBBox();t.width=n.width,t.height=n.height}),"updateNodeBounds"),t_=s(((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||"")),"getNodeClasses");function e_(t){const e=t.map(((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`));return e.push("Z"),e.join(" ")}function n_(t,e,n,r,i,a){const s=[],o=n-t,l=r-e,c=o/a,h=2*Math.PI/c,u=e+l/2;for(let e=0;e<=50;e++){const n=t+e/50*o,r=u+i*Math.sin(h*(n-t));s.push({x:n,y:r})}return s}function r_(t,e,n,r,i,a){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(r-1);for(let i=0;i2&&r.push(t)}const i=[];e=Math.max(e,.1);const a=[];for(const t of r)for(let e=0;et.ymine.ymin?1:t.xe.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!a.length)return i;let s=[],o=a[0].ymin,l=0;for(;s.length||a.length;){if(a.length){let t=-1;for(let e=0;eo);e++)t=e;a.splice(0,t+1).forEach((t=>{s.push({s:o,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=o))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==n||l%e==0)&&s.length>1)for(let t=0;t=s.length)break;const n=s[t].edge,r=s[e].edge;i.push([[Math.round(n.x),o],[Math.round(r.x),o]])}o+=n,s.forEach((t=>{t.edge.x=t.edge.x+n*t.edge.islope})),l++}return i}(s,a,r);if(i){for(const t of s)i_(t,o,-i);!function(t,e,n){const r=[];t.forEach((t=>r.push(...t))),i_(r,e,n)}(l,o,-i)}return l}function o_(t,e){var n;const r=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&&((null===(n=e.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(a=i),s_(t,i,r,a||1)}s(e_,"createPathFromPoints"),s(n_,"generateFullSineWavePoints"),s(r_,"generateCirclePoints"),s(i_,"t"),s(a_,"e"),s(s_,"s"),s(o_,"n");var l_=class{static{s(this,"o")}constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const n=o_(t,e);return{type:"fillSketch",ops:this.renderLines(n,e)}}renderLines(t,e){const n=[];for(const r of t)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],e));return n}};function c_(t){const e=t[0],n=t[1];return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}s(c_,"a");var h_=class extends l_{static{s(this,"h")}fillPolygons(t,e){let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);const r=o_(t,Object.assign({},e,{hachureGap:n})),i=Math.PI/180*e.hachureAngle,a=[],s=.5*n*Math.cos(i),o=.5*n*Math.sin(i);for(const[t,e]of r)c_([t,e])&&a.push([[t[0]-s,t[1]+o],[...e]],[[t[0]+s,t[1]-o],[...e]]);return{type:"fillSketch",ops:this.renderLines(a,e)}}},u_=class extends l_{static{s(this,"r")}fillPolygons(t,e){const n=this._fillPolygons(t,e),r=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),i=this._fillPolygons(t,r);return n.ops=n.ops.concat(i.ops),n}},d_=class{static{s(this,"i")}constructor(t){this.helper=t}fillPolygons(t,e){const n=o_(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(n,e)}dotsOnLines(t,e){const n=[];let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);let i=e.fillWeight;i<0&&(i=e.strokeWidth/2);const a=r/4;for(const s of t){const t=c_(s),o=t/r,l=Math.ceil(o)-1,c=t-l*r,h=(s[0][0]+s[1][0])/2-r/4,u=Math.min(s[0][1],s[1][1]);for(let t=0;t{const a=c_(t),s=Math.floor(a/(n+r)),o=(a+r-s*(n+r))/2;let l=t[0],c=t[1];l[0]>c[0]&&(l=t[1],c=t[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let t=0;t{const i=c_(t),a=Math.round(i/(2*e));let s=t[0],o=t[1];s[0]>o[0]&&(s=t[1],o=t[0]);const l=Math.atan((o[1]-s[1])/(o[0]-s[0]));for(let t=0;tr%2?t+n:t+e));a.push({key:"C",data:t}),e=t[4],n=t[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],n=o[3];break;case"q":{const t=o.map(((t,r)=>r%2?t+n:t+e));a.push({key:"Q",data:t}),e=t[2],n=t[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],n=o[6];break;case"a":e+=o[5],n+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,n]});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]}),n=o[0];break;case"v":n+=o[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],n=o[3];break;case"s":{const t=o.map(((t,r)=>r%2?t+n:t+e));a.push({key:"S",data:t}),e=t[2],n=t[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],n=o[1];break;case"t":e+=o[0],n+=o[1],a.push({key:"T",data:[e,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=r,n=i}return a}function w_(t){const e=[];let n="",r=0,i=0,a=0,s=0,o=0,l=0;for(const{key:c,data:h}of t){switch(c){case"M":e.push({key:"M",data:[...h]}),[r,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),r=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[r,i]=h;break;case"H":r=h[0],e.push({key:"L",data:[r,i]});break;case"V":i=h[0],e.push({key:"L",data:[r,i]});break;case"S":{let t=0,a=0;"C"===n||"S"===n?(t=r+(r-o),a=i+(i-l)):(t=r,a=i),e.push({key:"C",data:[t,a,...h]}),o=h[0],l=h[1],r=h[2],i=h[3];break}case"T":{const[t,a]=h;let s=0,c=0;"Q"===n||"T"===n?(s=r+(r-o),c=i+(i-l)):(s=r,c=i);const u=r+2*(s-r)/3,d=i+2*(c-i)/3,p=t+2*(s-t)/3,g=a+2*(c-a)/3;e.push({key:"C",data:[u,d,p,g,t,a]}),o=s,l=c,r=t,i=a;break}case"Q":{const[t,n,a,s]=h,c=r+2*(t-r)/3,u=i+2*(n-i)/3,d=a+2*(t-a)/3,p=s+2*(n-s)/3;e.push({key:"C",data:[c,u,d,p,a,s]}),o=t,l=n,r=a,i=s;break}case"A":{const t=Math.abs(h[0]),n=Math.abs(h[1]),a=h[2],s=h[3],o=h[4],l=h[5],c=h[6];0===t||0===n?(e.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c):r===l&&i===c||(T_(r,i,l,c,t,n,a,s,o).forEach((function(t){e.push({key:"C",data:t})})),r=l,i=c);break}case"Z":e.push({key:"Z",data:[]}),r=a,i=s}n=c}return e}function k_(t,e,n){return[t*Math.cos(n)-e*Math.sin(n),t*Math.sin(n)+e*Math.cos(n)]}function T_(t,e,n,r,i,a,s,o,l,c){const h=(u=s,Math.PI*u/180);var u;let d=[],p=0,g=0,f=0,m=0;if(c)[p,g,f,m]=c;else{[t,e]=k_(t,e,-h),[n,r]=k_(n,r,-h);const s=(t-n)/2,c=(e-r)/2;let u=s*s/(i*i)+c*c/(a*a);u>1&&(u=Math.sqrt(u),i*=u,a*=u);const d=i*i,y=a*a,v=d*y-d*c*c-y*s*s,x=d*c*c+y*s*s,b=(o===l?-1:1)*Math.sqrt(Math.abs(v/x));f=b*i*c/a+(t+n)/2,m=b*-a*s/i+(e+r)/2,p=Math.asin(parseFloat(((e-m)/a).toFixed(9))),g=Math.asin(parseFloat(((r-m)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let y=g-p;if(Math.abs(y)>120*Math.PI/180){const t=g,e=n,o=r;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=T_(n=f+i*Math.cos(g),r=m+a*Math.sin(g),e,o,i,a,s,0,l,[g,t,f,m])}y=g-p;const v=Math.cos(p),x=Math.sin(p),b=Math.cos(g),w=Math.sin(g),k=Math.tan(y/4),T=4/3*i*k,_=4/3*a*k,E=[t,e],C=[t+T*x,e-_*v],S=[n+T*w,r-_*b],A=[n,r];if(C[0]=2*E[0]-C[0],C[1]=2*E[1]-C[1],c)return[C,S,A].concat(d);{d=[C,S,A].concat(d);const t=[];for(let e=0;e2){const i=[];for(let e=0;e2*Math.PI&&(p=0,g=2*Math.PI);const f=2*Math.PI/l.curveStepCount,m=Math.min(f/2,(g-p)/2),y=j_(m,c,h,u,d,p,g,1,l);if(!l.disableMultiStroke){const t=j_(m,c,h,u,d,p,g,1.5,l);y.push(...t)}return s&&(o?y.push(...F_(c,h,c+u*Math.cos(p),h+d*Math.sin(p),l),...F_(c,h,c+u*Math.cos(g),h+d*Math.sin(g),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+u*Math.cos(p),h+d*Math.sin(p)]})),{type:"path",ops:y}}function M_(t,e){const n=w_(b_(x_(t))),r=[];let i=[0,0],a=[0,0];for(const{key:t,data:s}of n)switch(t){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":r.push(...F_(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[t,n,i,o,l,c]=s;r.push(...Y_(t,n,i,o,l,c,a,e)),a=[l,c];break}case"Z":r.push(...F_(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:r}}function R_(t,e){const n=[];for(const r of t)if(r.length){const t=e.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+$_(t,e),r[0][1]+$_(t,e)]});for(let a=1;a500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>l&&(u=c/10);const d=u/2,p=.2+.2*P_(i);let g=i.bowing*i.maxRandomnessOffset*(r-e)/200,f=i.bowing*i.maxRandomnessOffset*(t-n)/200;g=$_(g,i,h),f=$_(f,i,h);const m=[],y=s((()=>$_(d,i,h)),"M"),v=s((()=>$_(u,i,h)),"k"),x=i.preserveVertices;return a&&(o?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:$_(u,i,h)),e+(x?0:$_(u,i,h))]})),o?m.push({op:"bcurveTo",data:[g+t+(n-t)*p+y(),f+e+(r-e)*p+y(),g+t+2*(n-t)*p+y(),f+e+2*(r-e)*p+y(),n+(x?0:y()),r+(x?0:y())]}):m.push({op:"bcurveTo",data:[g+t+(n-t)*p+v(),f+e+(r-e)*p+v(),g+t+2*(n-t)*p+v(),f+e+2*(r-e)*p+v(),n+(x?0:v()),r+(x?0:v())]}),m}function U_(t,e,n){if(!t.length)return[];const r=[];r.push([t[0][0]+$_(e,n),t[0][1]+$_(e,n)]),r.push([t[0][0]+$_(e,n),t[0][1]+$_(e,n)]);for(let i=1;i3){const a=[],s=1-n.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+21&&i.push(n)):i.push(n),i.push(t[e+3])}else{const r=.5,a=t[e+0],s=t[e+1],o=t[e+2],l=t[e+3],c=K_(a,s,r),h=K_(s,o,r),u=K_(o,l,r),d=K_(c,h,r),p=K_(h,u,r),g=K_(d,p,r);Z_([a,c,d,g],0,n,i),Z_([g,p,u,l],0,n,i)}var a,s;return i}function Q_(t,e){return J_(t,0,t.length,e)}function J_(t,e,n,r,i){const a=i||[],s=t[e],o=t[n-1];let l=0,c=1;for(let r=e+1;rl&&(l=e,c=r)}return Math.sqrt(l)>r?(J_(t,e,c+1,r,a),J_(t,c,n,r,a)):(a.length||a.push(s),a.push(o)),a}function tE(t,e=.15,n){const r=[],i=(t.length-1)/3;for(let n=0;n0?J_(r,0,r.length,n):r}s(E_,"v"),s(C_,"S"),s(S_,"O"),s(A_,"L"),s(L_,"T"),s(N_,"D"),s(I_,"A"),s(M_,"_"),s(R_,"I"),s(D_,"C"),s(O_,"z"),s(P_,"W"),s(B_,"E"),s($_,"G"),s(F_,"$"),s(z_,"R"),s(U_,"j"),s(G_,"q"),s(q_,"F"),s(j_,"V"),s(Y_,"Z"),s(W_,"Q"),s(H_,"H"),s(V_,"N"),s(X_,"B"),s(K_,"J"),s(Z_,"K"),s(Q_,"U"),s(J_,"X"),s(tE,"Y");var eE="none",nE=class{static{s(this,"et")}constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,n){return{shape:t,sets:e||[],options:n||this.defaultOptions}}line(t,e,n,r,i){const a=this._o(i);return this._d("line",[E_(t,e,n,r,a)],a)}rectangle(t,e,n,r,i){const a=this._o(i),s=[],o=S_(t,e,n,r,a);if(a.fill){const i=[[t,e],[t+n,e],[t+n,e+r],[t,e+r]];"solid"===a.fillStyle?s.push(R_([i],a)):s.push(D_([i],a))}return a.stroke!==eE&&s.push(o),this._d("rectangle",s,a)}ellipse(t,e,n,r,i){const a=this._o(i),s=[],o=L_(n,r,a),l=N_(t,e,a,o);if(a.fill)if("solid"===a.fillStyle){const n=N_(t,e,a,o).opset;n.type="fillPath",s.push(n)}else s.push(D_([l.estimatedPoints],a));return a.stroke!==eE&&s.push(l.opset),this._d("ellipse",s,a)}circle(t,e,n,r){const i=this.ellipse(t,e,n,n,r);return i.shape="circle",i}linearPath(t,e){const n=this._o(e);return this._d("linearPath",[C_(t,!1,n)],n)}arc(t,e,n,r,i,a,s=!1,o){const l=this._o(o),c=[],h=I_(t,e,n,r,i,a,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){const s=Object.assign({},l);s.disableMultiStroke=!0;const o=I_(t,e,n,r,i,a,!0,!1,s);o.type="fillPath",c.push(o)}else c.push(function(t,e,n,r,i,a,s){const o=t,l=e;let c=Math.abs(n/2),h=Math.abs(r/2);c+=$_(.01*c,s),h+=$_(.01*h,s);let u=i,d=a;for(;u<0;)u+=2*Math.PI,d+=2*Math.PI;d-u>2*Math.PI&&(u=0,d=2*Math.PI);const p=(d-u)/s.curveStepCount,g=[];for(let t=u;t<=d;t+=p)g.push([o+c*Math.cos(t),l+h*Math.sin(t)]);return g.push([o+c*Math.cos(d),l+h*Math.sin(d)]),g.push([o,l]),D_([g],s)}(t,e,n,r,i,a,l));return l.stroke!==eE&&c.push(h),this._d("arc",c,l)}curve(t,e){const n=this._o(e),r=[],i=A_(t,n);if(n.fill&&n.fill!==eE)if("solid"===n.fillStyle){const e=A_(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],i=t;if(i.length){const t="number"==typeof i[0][0]?[i]:i;for(const r of t)r.length<3?e.push(...r):3===r.length?e.push(...tE(H_([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):e.push(...tE(H_(r),10,(1+n.roughness)/2))}e.length&&r.push(D_([e],n))}return n.stroke!==eE&&r.push(i),this._d("curve",r,n)}polygon(t,e){const n=this._o(e),r=[],i=C_(t,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(R_([t],n)):r.push(D_([t],n))),n.stroke!==eE&&r.push(i),this._d("polygon",r,n)}path(t,e){const n=this._o(e),r=[];if(!t)return this._d("path",r,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=n.fill&&"transparent"!==n.fill&&n.fill!==eE,a=n.stroke!==eE,o=!!(n.simplification&&n.simplification<1),l=function(t,e,n){const r=w_(b_(x_(t))),i=[];let a=[],o=[0,0],l=[];const c=s((()=>{l.length>=4&&a.push(...tE(l,1)),l=[]}),"i"),h=s((()=>{c(),a.length&&(i.push(a),a=[])}),"c");for(const{key:t,data:e}of r)switch(t){case"M":h(),o=[e[0],e[1]],a.push(o);break;case"L":c(),a.push([e[0],e[1]]);break;case"C":if(!l.length){const t=a.length?a[a.length-1]:o;l.push([t[0],t[1]])}l.push([e[0],e[1]]),l.push([e[2],e[3]]),l.push([e[4],e[5]]);break;case"Z":c(),a.push([o[0],o[1]])}if(h(),!n)return i;const u=[];for(const t of i){const e=Q_(t,n);e.length&&u.push(e)}return u}(t,0,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=M_(t,n);if(i)if("solid"===n.fillStyle)if(1===l.length){const e=M_(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else r.push(R_(l,n));else r.push(D_(l,n));return a&&(o?l.forEach((t=>{r.push(C_(t,!1,n))})):r.push(c)),this._d("path",r,n)}opsToPath(t,e){let n="";for(const r of t.ops){const t="number"==typeof e&&e>=0?r.data.map((t=>+t.toFixed(e))):r.data;switch(r.op){case"move":n+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":n+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":n+=`L${t[0]} ${t[1]} `}}return n.trim()}toPaths(t){const e=t.sets||[],n=t.options||this.defaultOptions,r=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:eE};break;case"fillPath":e={d:this.opsToPath(t),stroke:eE,strokeWidth:0,fill:n.fill||eE};break;case"fillSketch":e=this.fillSketch(t,n)}e&&r.push(e)}return r}fillSketch(t,e){let n=e.fillWeight;return n<0&&(n=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||eE,strokeWidth:n,fill:eE}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}},rE=class{static{s(this,"st")}constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new nE(e)}draw(t){const e=t.sets||[],n=t.options||this.getDefaultOptions(),r=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(r,a,i,e),r.restore();break}case"fillSketch":this.fillSketch(r,a,n)}}fillSketch(t,e,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=r,this._drawToContext(t,e,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,n,r="nonzero"){t.beginPath();for(const r of e.ops){const e="number"==typeof n&&n>=0?r.data.map((t=>+t.toFixed(n))):r.data;switch(r.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(r):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,n,r,i){const a=this.gen.line(t,e,n,r,i);return this.draw(a),a}rectangle(t,e,n,r,i){const a=this.gen.rectangle(t,e,n,r,i);return this.draw(a),a}ellipse(t,e,n,r,i){const a=this.gen.ellipse(t,e,n,r,i);return this.draw(a),a}circle(t,e,n,r){const i=this.gen.circle(t,e,n,r);return this.draw(i),i}linearPath(t,e){const n=this.gen.linearPath(t,e);return this.draw(n),n}polygon(t,e){const n=this.gen.polygon(t,e);return this.draw(n),n}arc(t,e,n,r,i,a,s=!1,o){const l=this.gen.arc(t,e,n,r,i,a,s,o);return this.draw(l),l}curve(t,e){const n=this.gen.curve(t,e);return this.draw(n),n}path(t,e){const n=this.gen.path(t,e);return this.draw(n),n}},iE="http://www.w3.org/2000/svg",aE=class{static{s(this,"ot")}constructor(t,e){this.svg=t,this.gen=new nE(e)}draw(t){const e=t.sets||[],n=t.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(iE,"g"),a=t.options.fixedDecimalPlaceDigits;for(const s of e){let e=null;switch(s.type){case"path":e=r.createElementNS(iE,"path"),e.setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke",n.stroke),e.setAttribute("stroke-width",n.strokeWidth+""),e.setAttribute("fill","none"),n.strokeLineDash&&e.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":e=r.createElementNS(iE,"path"),e.setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",n.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(r,s,n)}e&&i.appendChild(e)}return i}fillSketch(t,e,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=t.createElementNS(iE,"path");return i.setAttribute("d",this.opsToPath(e,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,n,r,i){const a=this.gen.line(t,e,n,r,i);return this.draw(a)}rectangle(t,e,n,r,i){const a=this.gen.rectangle(t,e,n,r,i);return this.draw(a)}ellipse(t,e,n,r,i){const a=this.gen.ellipse(t,e,n,r,i);return this.draw(a)}circle(t,e,n,r){const i=this.gen.circle(t,e,n,r);return this.draw(i)}linearPath(t,e){const n=this.gen.linearPath(t,e);return this.draw(n)}polygon(t,e){const n=this.gen.polygon(t,e);return this.draw(n)}arc(t,e,n,r,i,a,s=!1,o){const l=this.gen.arc(t,e,n,r,i,a,s,o);return this.draw(l)}curve(t,e){const n=this.gen.curve(t,e);return this.draw(n)}path(t,e){const n=this.gen.path(t,e);return this.draw(n)}},sE={canvas:s(((t,e)=>new rE(t,e)),"canvas"),svg:s(((t,e)=>new aE(t,e)),"svg"),generator:s((t=>new nE(t)),"generator"),newSeed:s((()=>nE.newSeed()),"newSeed")},oE=s(((t,e)=>{var n,r,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),n=0===o?0:c*s/o,r=c):(s<0&&(l=-l),n=l,r=0===s?0:l*o/s),{x:i+n,y:a+r}}),"intersectRect"),lE=oE;function cE(t,e){e&&t.attr("style",e)}async function hE(t){const e=Oa(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=e.append("xhtml:div");let r=t.label;t.label&&wn(t.label)&&(r=await Tn(t.label.replace(_n.lineBreakRegex,"\n"),Hn()));const i=t.isNode?"nodeLabel":"edgeLabel";return n.html('"+r+""),cE(n,t.labelStyle),n.style("display","inline-block"),n.style("padding-right","1px"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}s(cE,"applyStyle"),s(hE,"addHtmlLabel");var uE=s((async(t,e,n,r)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),dn(Hn().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),m.info("vertexText"+i);const t={isNode:r,label:xk(i).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>``)),labelStyle:e?e.replace("fill:","color:"):e};return await hE(t)}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let r=[];r="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(const e of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),n?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=e.trim(),t.appendChild(r)}return t}}),"createLabel"),dE=uE,pE=s(((t,e,n,r,i)=>["M",t+i,e,"H",t+n-i,"A",i,i,0,0,1,t+n,e+i,"V",e+r-i,"A",i,i,0,0,1,t+n-i,e+r,"H",t+i,"A",i,i,0,0,1,t,e+r-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" ")),"createRoundedRectPathD"),gE=s((t=>{const{handDrawnSeed:e}=Hn();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}}),"solidStateFill"),fE=s((t=>{const e=mE([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}}),"compileStyles"),mE=s((t=>{const e=new Map;return t.forEach((t=>{const[n,r]=t.split(":");e.set(n.trim(),r?.trim())})),e}),"styles2Map"),yE=s((t=>{const{stylesArray:e}=fE(t),n=[],r=[],i=[],a=[];return e.forEach((t=>{const e=t[0];"color"===e||"font-size"===e||"font-family"===e||"font-weight"===e||"font-style"===e||"text-decoration"===e||"text-align"===e||"text-transform"===e||"line-height"===e||"letter-spacing"===e||"word-spacing"===e||"text-shadow"===e||"text-overflow"===e||"white-space"===e||"word-wrap"===e||"word-break"===e||"overflow-wrap"===e||"hyphens"===e?n.push(t.join(":")+" !important"):(r.push(t.join(":")+" !important"),e.includes("stroke")&&i.push(t.join(":")+" !important"),"fill"===e&&a.push(t.join(":")+" !important"))})),{labelStyles:n.join(";"),nodeStyles:r.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}}),"styles2String"),vE=s(((t,e)=>{const{themeVariables:n,handDrawnSeed:r}=Hn(),{nodeBorder:i,mainBkg:a}=n,{stylesMap:s}=fE(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:r,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},e)}),"userNodeOverrides"),xE=s((async(t,e)=>{m.info("Creating subgraph rect for ",e.id,e);const n=Hn(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:s}=r,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=yE(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=dn(n.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await KT(p,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0});let f=g.getBBox();if(dn(n.flowchart.htmlLabels)){const t=g.children[0],e=Oa(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const y=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;let w;if(m.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=sE.svg(u),n=vE(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),r=t.path(pE(x,b,y,v,0),n);w=u.insert((()=>(m.debug("Rough node insert CXC",r),r)),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=u.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=Gm(n);if(p.attr("transform",`translate(${e.x-f.width/2}, ${e.y-e.height/2+k})`),o){const t=p.select("span");t&&t.attr("style",o)}const T=w.node().getBBox();return e.offsetX=0,e.width=T.width,e.height=T.height,e.offsetY=f.height-e.padding/2,e.intersect=function(t){return lE(e,t)},{cluster:u,labelBBox:f}}),"rect"),bE=s(((t,e)=>{const n=t.insert("g").attr("class","note-cluster").attr("id",e.id),r=n.insert("rect",":first-child"),i=0*e.padding,a=i/2;r.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=r.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(t){return lE(e,t)},{cluster:n,labelBBox:{width:0,height:0}}}),"noteGroup"),wE=s((async(t,e)=>{const n=Hn(),{themeVariables:r,handDrawnSeed:i}=n,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=r,c=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),h=c.insert("g",":first-child"),u=c.insert("g").attr("class","cluster-label");let d=c.append("rect");const p=u.node().appendChild(await dE(e.label,e.labelStyle,void 0,!0));let g=p.getBBox();if(dn(n.flowchart.htmlLabels)){const t=p.children[0],e=Oa(p);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}const f=0*e.padding,m=f/2,y=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+f;e.width<=g.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height+f,x=e.height+f-g.height-6,b=e.x-y/2,w=e.y-v/2;e.width=y;const k=e.y-e.height/2-m+g.height+2;let T;if("handDrawn"===e.look){const t=e.cssClasses.includes("statediagram-cluster-alt"),n=sE.svg(c),r=e.rx||e.ry?n.path(pE(b,w,y,v,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):n.rectangle(b,w,y,v,{seed:i});T=c.insert((()=>r),":first-child");const h=n.rectangle(b,k,y,x,{fill:t?a:s,fillStyle:t?"hachure":"solid",stroke:l,seed:i});T=c.insert((()=>r),":first-child"),d=c.insert((()=>h))}else{T=h.insert("rect",":first-child");const t="outer";T.attr("class",t).attr("x",b).attr("y",w).attr("width",y).attr("height",v).attr("data-look",e.look),d.attr("class","inner").attr("x",b).attr("y",k).attr("width",y).attr("height",x)}u.attr("transform",`translate(${e.x-g.width/2}, ${w+1-(dn(n.flowchart.htmlLabels)?0:3)})`);const _=T.node().getBBox();return e.height=_.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(t){return lE(e,t)},{cluster:c,labelBBox:g}}),"roundedWithTitle"),kE=s((async(t,e)=>{m.info("Creating subgraph rect for ",e.id,e);const n=Hn(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:s}=r,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=yE(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=dn(n.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await KT(p,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0,width:e.width});let f=g.getBBox();if(dn(n.flowchart.htmlLabels)){const t=g.children[0],e=Oa(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const y=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;let w;if(m.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=sE.svg(u),n=vE(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),r=t.path(pE(x,b,y,v,e.rx),n);w=u.insert((()=>(m.debug("Rough node insert CXC",r),r)),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=u.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=Gm(n);if(p.attr("transform",`translate(${e.x-f.width/2}, ${e.y-e.height/2+k})`),o){const t=p.select("span");t&&t.attr("style",o)}const T=w.node().getBBox();return e.offsetX=0,e.width=T.width,e.height=T.height,e.offsetY=f.height-e.padding/2,e.intersect=function(t){return lE(e,t)},{cluster:u,labelBBox:f}}),"kanbanSection"),TE=s(((t,e)=>{const n=Hn(),{themeVariables:r,handDrawnSeed:i}=n,{nodeBorder:a}=r,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,c=e.width+l;e.diff=-e.padding;const h=e.height+l,u=e.x-c/2,d=e.y-h/2;let p;if(e.width=c,"handDrawn"===e.look){const t=sE.svg(s).rectangle(u,d,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert((()=>t),":first-child")}else{p=o.insert("rect",":first-child");const t="divider";p.attr("class",t).attr("x",u).attr("y",d).attr("width",c).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(t){return lE(e,t)},{cluster:s,labelBBox:{}}}),"divider"),_E={rect:xE,squareRect:xE,roundedWithTitle:wE,noteGroup:bE,divider:TE,kanbanSection:kE},EE=new Map,CE=s((async(t,e)=>{const n=e.shape||"rect",r=await _E[n](t,e);return EE.set(e.id,r),r}),"insertCluster"),SE=s((()=>{EE=new Map}),"clear");function AE(t,e){return t.intersect(e)}s(AE,"intersectNode");var LE=AE;function NE(t,e,n,r){var i=t.x,a=t.y,s=i-r.x,o=a-r.y,l=Math.sqrt(e*e*o*o+n*n*s*s),c=Math.abs(e*n*s/l);r.x0}s(DE,"intersectLine"),s(OE,"sameSign");var PE=DE;function BE(t,e,n){let r=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)})):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=r-t.width/2-s,c=i-t.height/2-o;for(let r=0;r1&&a.sort((function(t,e){let r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),s=e.x-n.x,o=e.y-n.y,l=Math.sqrt(s*s+o*o);return ac),":first-child");return h.attr("class","anchor").attr("style",wk(s)),JT(e,h),e.intersect=function(t){return m.info("Circle intersect",e,1,t),$E.circle(e,1,t)},a}function zE(t,e,n,r,i,a,s){const o=(t+n)/2,l=(e+r)/2,c=Math.atan2(r-e,n-t),h=(n-t)/2/i,u=(r-e)/2/a,d=Math.sqrt(h**2+u**2);if(d>1)throw new Error("The given radii are too small to create an arc between the points.");const p=Math.sqrt(1-d**2),g=o+p*a*Math.sin(c)*(s?-1:1),f=l-p*i*Math.cos(c)*(s?-1:1),m=Math.atan2((e-f)/a,(t-g)/i);let y=Math.atan2((r-f)/a,(n-g)/i)-m;s&&y<0&&(y+=2*Math.PI),!s&&y>0&&(y-=2*Math.PI);const v=[];for(let t=0;t<20;t++){const e=m+t/19*y,n=g+i*Math.cos(e),r=f+a*Math.sin(e);v.push({x:n,y:r})}return v}async function UE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.width+e.padding+20,o=a.height+e.padding,l=o/2,c=l/(2.5+o/50),{cssStyles:h}=e,u=[{x:s/2,y:-o/2},{x:-s/2,y:-o/2},...zE(-s/2,-o/2,-s/2,o/2,c,l,!1),{x:s/2,y:o/2},...zE(s/2,o/2,s/2,-o/2,c,l,!0)],d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=e_(u),f=d.path(g,p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),h&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(${c/2}, 0)`),JT(e,m),e.intersect=function(t){return $E.polygon(e,u,t)},i}function GE(t,e,n,r){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+n/2+")")}async function qE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.height+e.padding,o=a.width+e.padding+12,l=-s,c=[{x:12,y:l},{x:o,y:l},{x:o,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}];let h;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(c),a=t.path(r,n);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&h.attr("style",u)}else h=GE(i,o,s,c);return r&&h.attr("style",r),JT(e,h),e.intersect=function(t){return $E.polygon(e,c,t)},i}function jE(t,e){const{nodeStyles:n}=yE(e);e.label="";const r=t.insert("g").attr("class",t_(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=sE.svg(r),l=vE(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=e_(s),h=o.path(c,l),u=r.insert((()=>h),":first-child");return i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),n&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",n),e.width=28,e.height=28,e.intersect=function(t){return $E.polygon(e,s,t)},r}async function YE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,halfPadding:s}=await ZT(t,e,t_(e)),o=a.width/2+s;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=t.circle(0,0,2*o,n);l=i.insert((()=>r),":first-child"),l.attr("class","basic label-container").attr("style",wk(c))}else l=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",r).attr("r",o).attr("cx",0).attr("cy",0);return JT(e,l),e.intersect=function(t){return m.info("Circle intersect",e,o,t),$E.circle(e,o,t)},i}function WE(t){const e=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=2*t;return`M ${-r/2*e},${r/2*n} L ${r/2*e},${-r/2*n}\n M ${r/2*e},${r/2*n} L ${-r/2*e},${-r/2*n}`}function HE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n,e.label="";const i=t.insert("g").attr("class",t_(e)).attr("id",e.domId??e.id),a=Math.max(30,e?.width??0),{cssStyles:s}=e,o=sE.svg(i),l=vE(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,2*a,l),h=WE(a),u=o.path(h,l),d=i.insert((()=>c),":first-child");return d.insert((()=>u)),s&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",s),r&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",r),JT(e,d),e.intersect=function(t){m.info("crossedCircle intersect",e,{radius:a,point:t});return $E.circle(e,a,t)},i}function VE(t,e,n,r=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(r-1);for(let i=0;iv),":first-child").attr("stroke-opacity",0),x.insert((()=>m),":first-child"),x.attr("class","text"),h&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",r),x.attr("transform",`translate(${c}, 0)`),s.attr("transform",`translate(${-o/2+c-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),JT(e,x),e.intersect=function(t){return $E.polygon(e,d,t)},i}function KE(t,e,n,r=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(r-1);for(let i=0;iv),":first-child").attr("stroke-opacity",0),x.insert((()=>m),":first-child"),x.attr("class","text"),h&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",r),x.attr("transform",`translate(${-c}, 0)`),s.attr("transform",`translate(${-o/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),JT(e,x),e.intersect=function(t){return $E.polygon(e,d,t)},i}function QE(t,e,n,r=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(r-1);for(let i=0;iw),":first-child").attr("stroke-opacity",0),k.insert((()=>y),":first-child"),k.insert((()=>x),":first-child"),k.attr("class","text"),h&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",r),k.attr("transform",`translate(${c-c/4}, 0)`),s.attr("transform",`translate(${-o/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),JT(e,k),e.intersect=function(t){return $E.polygon(e,p,t)},i}async function tC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(80,1.25*(a.width+2*(e.padding??0)),e?.width??0),o=Math.max(20,a.height+2*(e.padding??0),e?.height??0),l=o/2,{cssStyles:c}=e,h=sE.svg(i),u=vE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=s-l,p=o/4,g=[{x:d,y:0},{x:p,y:0},{x:0,y:o/2},{x:p,y:o},{x:d,y:o},...r_(-d,-o/2,l,50,270,90)],f=e_(g),m=h.path(f,u),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",c),r&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",r),y.attr("transform",`translate(${-s/2}, ${-o/2})`),JT(e,y),e.intersect=function(t){return $E.polygon(e,g,t)},i}s(FE,"anchor"),s(zE,"generateArcPoints"),s(UE,"bowTieRect"),s(GE,"insertPolygonShape"),s(qE,"card"),s(jE,"choice"),s(YE,"circle"),s(WE,"createLine"),s(HE,"crossedCircle"),s(VE,"generateCirclePoints"),s(XE,"curlyBraceLeft"),s(KE,"generateCirclePoints"),s(ZE,"curlyBraceRight"),s(QE,"generateCirclePoints"),s(JE,"curlyBraces"),s(tC,"curvedTrapezoid");var eC=s(((t,e,n,r,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r].join(" ")),"createCylinderPathD"),nC=s(((t,e,n,r,i,a)=>[`M${t},${e+a}`,`M${t+n},${e+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r].join(" ")),"createOuterCylinderPathD"),rC=s(((t,e,n,r,i,a)=>[`M${t-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(" ")),"createInnerCylinderPathD");async function iC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+e.padding,e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(a.height+c+e.padding,e.height??0);let u;const{cssStyles:d}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=nC(0,0,o,h,l,c),r=rC(0,c,o,h,l,c),a=t.path(n,vE(e,{})),s=t.path(r,vE(e,{fill:"none"}));u=i.insert((()=>s),":first-child"),u=i.insert((()=>a),":first-child"),u.attr("class","basic label-container"),d&&u.attr("style",d)}else{const t=eC(0,0,o,h,l,c);u=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",wk(d)).attr("style",r)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),JT(e,u),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+(e.padding??0)/1.5-(a.y-(a.top??0))})`),e.intersect=function(t){const n=$E.rect(e,t),r=n.x-(e.x??0);if(0!=l&&(Math.abs(r)<(e.width??0)/2||Math.abs(r)==(e.width??0)/2&&Math.abs(n.y-(e.y??0))>(e.height??0)/2-c)){let i=c*c*(1-r*r/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,t.y-(e.y??0)>0&&(i=-i),n.y+=i}return n},i}async function aC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=a.width+e.padding,l=a.height+e.padding,c=.2*l,h=-o/2,u=-l/2-c/2,{cssStyles:d}=e,p=sE.svg(i),g=vE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=[{x:h,y:u+c},{x:-h,y:u+c},{x:-h,y:-u},{x:h,y:-u},{x:h,y:u},{x:-h,y:u},{x:-h,y:u+c}],m=p.polygon(f.map((t=>[t.x,t.y])),g),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",r),s.attr("transform",`translate(${h+(e.padding??0)/2-(a.x-(a.left??0))}, ${u+c+(e.padding??0)/2-(a.y-(a.top??0))})`),JT(e,y),e.intersect=function(t){return $E.rect(e,t)},i}async function sC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,halfPadding:s}=await ZT(t,e,t_(e)),o=a.width/2+s+5,l=a.width/2+s;let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{roughness:.2,strokeWidth:2.5}),r=vE(e,{roughness:.2,strokeWidth:1.5}),a=t.circle(0,0,2*o,n),s=t.circle(0,0,2*l,r);c=i.insert("g",":first-child"),c.attr("class",wk(e.cssClasses)).attr("style",wk(h)),c.node()?.appendChild(a),c.node()?.appendChild(s)}else{c=i.insert("g",":first-child");const t=c.insert("circle",":first-child"),e=c.insert("circle");c.attr("class","basic label-container").attr("style",r),t.attr("class","outer-circle").attr("style",r).attr("r",o).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",r).attr("r",l).attr("cx",0).attr("cy",0)}return JT(e,c),e.intersect=function(t){return m.info("DoubleCircle intersect",e,o,t),$E.circle(e,o,t)},i}function oC(t,e,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=yE(e);e.label="",e.labelStyle=r;const a=t.insert("g").attr("class",t_(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=sE.svg(a),{nodeBorder:l}=n,c=vE(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(c.roughness=0);const h=o.circle(0,0,14,c),u=a.insert((()=>h),":first-child");return u.selectAll("path").attr("style",`fill: ${l} !important;`),s&&s.length>0&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",s),i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),JT(e,u),e.intersect=function(t){m.info("filledCircle intersect",e,{radius:7,point:t});return $E.circle(e,7,t)},a}async function lC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=a.width+(e.padding??0),l=o+a.height,c=o+a.height,h=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=e_(h),f=d.path(g,p),y=i.insert((()=>f),":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return u&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",u),r&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",r),e.width=o,e.height=l,JT(e,y),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-l/2+(e.padding??0)/2+(a.y-(a.top??0))})`),e.intersect=function(t){return m.info("Triangle intersect",e,h,t),$E.polygon(e,h,t)},i}function cC(t,e,{dir:n,config:{state:r,themeVariables:i}}){const{nodeStyles:a}=yE(e);e.label="";const s=t.insert("g").attr("class",t_(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);"LR"===n&&(l=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));const h=-1*l/2,u=-1*c/2,d=sE.svg(s),p=vE(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=d.rectangle(h,u,l,c,p),f=s.insert((()=>g),":first-child");o&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",o),a&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",a),JT(e,f);const m=r?.padding??0;return e.width&&e.height&&(e.width+=m/2||0,e.height+=m/2||0),e.intersect=function(t){return $E.rect(e,t)},s}async function hC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(80,a.width+2*(e.padding??0),e?.width??0),o=Math.max(50,a.height+2*(e.padding??0),e?.height??0),l=o/2,{cssStyles:c}=e,h=sE.svg(i),u=vE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=[{x:-s/2,y:-o/2},{x:s/2-l,y:-o/2},...r_(-s/2+l,0,l,50,90,270),{x:s/2-l,y:o/2},{x:-s/2,y:o/2}],p=e_(d),g=h.path(p,u),f=i.insert((()=>g),":first-child");return f.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",c),r&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",r),JT(e,f),e.intersect=function(t){m.info("Pill intersect",e,{radius:l,point:t});return $E.polygon(e,d,t)},i}s(iC,"cylinder"),s(aC,"dividedRectangle"),s(sC,"doublecircle"),s(oC,"filledCircle"),s(lC,"flippedTriangle"),s(cC,"forkJoin"),s(hC,"halfRoundedRectangle");var uC=s(((t,e,n,r,i)=>[`M${t+i},${e}`,`L${t+n-i},${e}`,`L${t+n},${e-r/2}`,`L${t+n-i},${e-r}`,`L${t+i},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" ")),"createHexagonPathD");async function dC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.height+e.padding,o=s/4,l=a.width+2*o+e.padding,c=[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}];let h;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=uC(0,0,l,s,o),a=t.path(r,n);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-l/2}, ${s/2})`),u&&h.attr("style",u)}else h=GE(i,l,s,c);return r&&h.attr("style",r),e.width=l,e.height=s,JT(e,h),e.intersect=function(t){return $E.polygon(e,c,t)},i}async function pC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.label="",e.labelStyle=n;const{shapeSvg:i}=await ZT(t,e,t_(e)),a=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:o}=e,l=sE.svg(i),c=vE(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],u=e_(h),d=l.path(u,c),p=i.insert((()=>d),":first-child");return p.attr("class","basic label-container"),o&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",o),r&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",r),p.attr("transform",`translate(${-a/2}, ${-s/2})`),JT(e,p),e.intersect=function(t){m.info("Pill intersect",e,{points:h});return $E.polygon(e,h,t)},i}async function gC(t,e,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=yE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=r?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await ZT(t,e,"icon-shape default"),d="t"===e.pos,p=o,g=o,{nodeBorder:f}=n,{stylesMap:y}=fE(e),v=-g/2,x=-p/2,b=e.label?8:0,w=sE.svg(c),k=vE(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");const T=w.rectangle(v,x,g,p,k),_=Math.max(g,h.width),E=p+h.height+b,C=w.rectangle(-_/2,-E/2,_,E,{...k,fill:"transparent",stroke:"none"}),S=c.insert((()=>T),":first-child"),A=c.insert((()=>C));if(e.icon){const t=c.append("g");t.html(`${await _y(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const n=t.node().getBBox(),r=n.width,i=n.height,a=n.x,s=n.y;t.attr("transform",`translate(${-r/2-a},${d?h.height/2+b/2-i/2-s:-h.height/2-b/2-i/2-s})`),t.attr("style",`color: ${y.get("stroke")??f};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-E/2:E/2-h.height})`),S.attr("transform",`translate(0,${d?h.height/2+b/2:-h.height/2-b/2})`),JT(e,A),e.intersect=function(t){if(m.info("iconSquare intersect",e,t),!e.label)return $E.rect(e,t);const n=e.x??0,r=e.y??0,i=e.height??0;let a=[];a=d?[{x:n-h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2+h.height+b},{x:n+g/2,y:r-i/2+h.height+b},{x:n+g/2,y:r+i/2},{x:n-g/2,y:r+i/2},{x:n-g/2,y:r-i/2+h.height+b},{x:n-h.width/2,y:r-i/2+h.height+b}]:[{x:n-g/2,y:r-i/2},{x:n+g/2,y:r-i/2},{x:n+g/2,y:r-i/2+p},{x:n+h.width/2,y:r-i/2+p},{x:n+h.width/2/2,y:r+i/2},{x:n-h.width/2,y:r+i/2},{x:n-h.width/2,y:r-i/2+p},{x:n-g/2,y:r-i/2+p}];return $E.polygon(e,a,t)},c}async function fC(t,e,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=yE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=r?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await ZT(t,e,"icon-shape default"),d=e.label?8:0,p="t"===e.pos,{nodeBorder:g,mainBkg:f}=n,{stylesMap:y}=fE(e),v=sE.svg(c),x=vE(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=y.get("fill");x.stroke=b??f;const w=c.append("g");e.icon&&w.html(`${await _y(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const k=w.node().getBBox(),T=k.width,_=k.height,E=k.x,C=k.y,S=Math.max(T,_)*Math.SQRT2+40,A=v.circle(0,0,S,x),L=Math.max(S,h.width),N=S+h.height+d,I=v.rectangle(-L/2,-N/2,L,N,{...x,fill:"transparent",stroke:"none"}),M=c.insert((()=>A),":first-child"),R=c.insert((()=>I));return w.attr("transform",`translate(${-T/2-E},${p?h.height/2+d/2-_/2-C:-h.height/2-d/2-_/2-C})`),w.attr("style",`color: ${y.get("stroke")??g};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-N/2:N/2-h.height})`),M.attr("transform",`translate(0,${p?h.height/2+d/2:-h.height/2-d/2})`),JT(e,R),e.intersect=function(t){m.info("iconSquare intersect",e,t);return $E.rect(e,t)},c}async function mC(t,e,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=yE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=r?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await ZT(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*u,f=o+2*u,{nodeBorder:y,mainBkg:v}=n,{stylesMap:x}=fE(e),b=-f/2,w=-g/2,k=e.label?8:0,T=sE.svg(c),_=vE(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const E=x.get("fill");_.stroke=E??v;const C=T.path(pE(b,w,f,g,5),_),S=Math.max(f,h.width),A=g+h.height+k,L=T.rectangle(-S/2,-A/2,S,A,{..._,fill:"transparent",stroke:"none"}),N=c.insert((()=>C),":first-child").attr("class","icon-shape2"),I=c.insert((()=>L));if(e.icon){const t=c.append("g");t.html(`${await _y(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const n=t.node().getBBox(),r=n.width,i=n.height,a=n.x,s=n.y;t.attr("transform",`translate(${-r/2-a},${p?h.height/2+k/2-i/2-s:-h.height/2-k/2-i/2-s})`),t.attr("style",`color: ${x.get("stroke")??y};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),JT(e,I),e.intersect=function(t){if(m.info("iconSquare intersect",e,t),!e.label)return $E.rect(e,t);const n=e.x??0,r=e.y??0,i=e.height??0;let a=[];a=p?[{x:n-h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2+h.height+k},{x:n+f/2,y:r-i/2+h.height+k},{x:n+f/2,y:r+i/2},{x:n-f/2,y:r+i/2},{x:n-f/2,y:r-i/2+h.height+k},{x:n-h.width/2,y:r-i/2+h.height+k}]:[{x:n-f/2,y:r-i/2},{x:n+f/2,y:r-i/2},{x:n+f/2,y:r-i/2+g},{x:n+h.width/2,y:r-i/2+g},{x:n+h.width/2/2,y:r+i/2},{x:n-h.width/2,y:r+i/2},{x:n-h.width/2,y:r-i/2+g},{x:n-f/2,y:r-i/2+g}];return $E.polygon(e,a,t)},c}async function yC(t,e,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=yE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=r?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await ZT(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*u,f=o+2*u,{nodeBorder:y,mainBkg:v}=n,{stylesMap:x}=fE(e),b=-f/2,w=-g/2,k=e.label?8:0,T=sE.svg(c),_=vE(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const E=x.get("fill");_.stroke=E??v;const C=T.path(pE(b,w,f,g,.1),_),S=Math.max(f,h.width),A=g+h.height+k,L=T.rectangle(-S/2,-A/2,S,A,{..._,fill:"transparent",stroke:"none"}),N=c.insert((()=>C),":first-child"),I=c.insert((()=>L));if(e.icon){const t=c.append("g");t.html(`${await _y(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const n=t.node().getBBox(),r=n.width,i=n.height,a=n.x,s=n.y;t.attr("transform",`translate(${-r/2-a},${p?h.height/2+k/2-i/2-s:-h.height/2-k/2-i/2-s})`),t.attr("style",`color: ${x.get("stroke")??y};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),JT(e,I),e.intersect=function(t){if(m.info("iconSquare intersect",e,t),!e.label)return $E.rect(e,t);const n=e.x??0,r=e.y??0,i=e.height??0;let a=[];a=p?[{x:n-h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2+h.height+k},{x:n+f/2,y:r-i/2+h.height+k},{x:n+f/2,y:r+i/2},{x:n-f/2,y:r+i/2},{x:n-f/2,y:r-i/2+h.height+k},{x:n-h.width/2,y:r-i/2+h.height+k}]:[{x:n-f/2,y:r-i/2},{x:n+f/2,y:r-i/2},{x:n+f/2,y:r-i/2+g},{x:n+h.width/2,y:r-i/2+g},{x:n+h.width/2/2,y:r+i/2},{x:n-h.width/2,y:r+i/2},{x:n-h.width/2,y:r-i/2+g},{x:n-f/2,y:r-i/2+g}];return $E.polygon(e,a,t)},c}async function vC(t,e,{config:{flowchart:n}}){const r=new Image;r.src=e?.img??"",await r.decode();const i=Number(r.naturalWidth.toString().replace("px","")),a=Number(r.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=yE(e);e.labelStyle=s;const o=n?.wrappingWidth;e.defaultWidth=n?.wrappingWidth;const l=Math.max(e.label?o??0:0,e?.assetWidth??i),c="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:l,h="on"===e.constraint?c/e.imageAspectRatio:e?.assetHeight??a;e.width=Math.max(c,o??0);const{shapeSvg:u,bbox:d,label:p}=await ZT(t,e,"image-shape default"),g="t"===e.pos,f=-c/2,y=-h/2,v=e.label?8:0,x=sE.svg(u),b=vE(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const w=x.rectangle(f,y,c,h,b),k=Math.max(c,d.width),T=h+d.height+v,_=x.rectangle(-k/2,-T/2,k,T,{...b,fill:"none",stroke:"none"}),E=u.insert((()=>w),":first-child"),C=u.insert((()=>_));if(e.img){const t=u.append("image");t.attr("href",e.img),t.attr("width",c),t.attr("height",h),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-c/2},${g?T/2-h:-T/2})`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-h/2-d.height/2-v/2:h/2-d.height/2+v/2})`),E.attr("transform",`translate(0,${g?d.height/2+v/2:-d.height/2-v/2})`),JT(e,C),e.intersect=function(t){if(m.info("iconSquare intersect",e,t),!e.label)return $E.rect(e,t);const n=e.x??0,r=e.y??0,i=e.height??0;let a=[];a=g?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+v},{x:n+c/2,y:r-i/2+d.height+v},{x:n+c/2,y:r+i/2},{x:n-c/2,y:r+i/2},{x:n-c/2,y:r-i/2+d.height+v},{x:n-d.width/2,y:r-i/2+d.height+v}]:[{x:n-c/2,y:r-i/2},{x:n+c/2,y:r-i/2},{x:n+c/2,y:r-i/2+h},{x:n+d.width/2,y:r-i/2+h},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+h},{x:n-c/2,y:r-i/2+h}];return $E.polygon(e,a,t)},u}async function xC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(l),a=t.path(r,n);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=GE(i,s,o,l);return r&&c.attr("style",r),e.width=s,e.height=o,JT(e,c),e.intersect=function(t){return $E.polygon(e,l,t)},i}async function bC(t,e,n){const{labelStyles:r,nodeStyles:i}=yE(e);e.labelStyle=r;const{shapeSvg:a,bbox:s}=await ZT(t,e,t_(e)),o=Math.max(s.width+2*n.labelPaddingX,e?.width||0),l=Math.max(s.height+2*n.labelPaddingY,e?.height||0),c=-o/2,h=-l/2;let u,{rx:d,ry:p}=e;const{cssStyles:g}=e;if(n?.rx&&n.ry&&(d=n.rx,p=n.ry),"handDrawn"===e.look){const t=sE.svg(a),n=vE(e,{}),r=d||p?t.path(pE(c,h,o,l,d||0),n):t.rectangle(c,h,o,l,n);u=a.insert((()=>r),":first-child"),u.attr("class","basic label-container").attr("style",wk(g))}else u=a.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",i).attr("rx",wk(d)).attr("ry",wk(p)).attr("x",c).attr("y",h).attr("width",o).attr("height",l);return JT(e,u),e.intersect=function(t){return $E.rect(e,t)},a}async function wC(t,e){const{shapeSvg:n,bbox:r,label:i}=await ZT(t,e,"label"),a=n.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),n.attr("class","label edgeLabel"),i.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-r.height/2-(r.y-(r.top??0))})`),JT(e,a),e.intersect=function(t){return $E.rect(e,t)},n}async function kC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),o=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(l),a=t.path(r,n);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=GE(i,s,o,l);return r&&c.attr("style",r),e.width=s,e.height=o,JT(e,c),e.intersect=function(t){return $E.polygon(e,l,t)},i}async function TC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),o=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:-3*o/6,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(l),a=t.path(r,n);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=GE(i,s,o,l);return r&&c.attr("style",r),e.width=s,e.height=o,JT(e,c),e.intersect=function(t){return $E.polygon(e,l,t)},i}function _C(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.label="",e.labelStyle=n;const i=t.insert("g").attr("class",t_(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,e?.width??0),o=Math.max(35,e?.height??0),l=[{x:s,y:0},{x:0,y:o+3.5},{x:s-14,y:o+3.5},{x:0,y:2*o},{x:s,y:o-3.5},{x:14,y:o-3.5}],c=sE.svg(i),h=vE(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const u=e_(l),d=c.path(u,h),p=i.insert((()=>d),":first-child");return a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),r&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",r),p.attr("transform",`translate(-${s/2},${-o})`),JT(e,p),e.intersect=function(t){m.info("lightningBolt intersect",e,t);return $E.polygon(e,l,t)},i}s(dC,"hexagon"),s(pC,"hourglass"),s(gC,"icon"),s(fC,"iconCircle"),s(mC,"iconRounded"),s(yC,"iconSquare"),s(vC,"imageSquare"),s(xC,"inv_trapezoid"),s(bC,"drawRect"),s(wC,"labelRect"),s(kC,"lean_left"),s(TC,"lean_right"),s(_C,"lightningBolt");var EC=s(((t,e,n,r,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${n},0`].join(" ")),"createCylinderPathD"),CC=s(((t,e,n,r,i,a,s)=>[`M${t},${e+a}`,`M${t+n},${e+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${n},0`].join(" ")),"createOuterCylinderPathD"),SC=s(((t,e,n,r,i,a)=>[`M${t-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(" ")),"createInnerCylinderPathD");async function AC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+(e.padding??0),e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(a.height+c+(e.padding??0),e.height??0),u=.1*h;let d;const{cssStyles:p}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=CC(0,0,o,h,l,c,u),r=SC(0,c,o,h,l,c),a=vE(e,{}),s=t.path(n,a),g=t.path(r,a);i.insert((()=>g),":first-child").attr("class","line"),d=i.insert((()=>s),":first-child"),d.attr("class","basic label-container"),p&&d.attr("style",p)}else{const t=EC(0,0,o,h,l,c,u);d=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",wk(p)).attr("style",r)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),JT(e,d),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+c-(a.y-(a.top??0))})`),e.intersect=function(t){const n=$E.rect(e,t),r=n.x-(e.x??0);if(0!=l&&(Math.abs(r)<(e.width??0)/2||Math.abs(r)==(e.width??0)/2&&Math.abs(n.y-(e.y??0))>(e.height??0)/2-c)){let i=c*c*(1-r*r/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,t.y-(e.y??0)>0&&(i=-i),n.y+=i}return n},i}async function LC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=l+c,{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-o/2-o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:h/2},...n_(-o/2-o/2*.1,h/2,o/2+o/2*.1,h/2,c,.8),{x:o/2+o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:-h/2},{x:-o/2,y:-h/2},{x:-o/2,y:h/2*1.1},{x:-o/2,y:-h/2}],f=d.polygon(g.map((t=>[t.x,t.y])),p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)+o/2*.1/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c/2-(a.y-(a.top??0))})`),JT(e,m),e.intersect=function(t){return $E.polygon(e,g,t)},i}async function NC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{}),g=[{x:c-5,y:h+5},{x:c-5,y:h+l+5},{x:c+o-5,y:h+l+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h+l-5},{x:c+o+5,y:h+l-5},{x:c+o+5,y:h-5},{x:c+5,y:h-5},{x:c+5,y:h},{x:c,y:h},{x:c,y:h+5}],f=[{x:c,y:h+5},{x:c+o-5,y:h+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h},{x:c,y:h}];"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const m=e_(g),y=d.path(m,p),v=e_(f),x=d.path(v,{...p,fill:"none"}),b=i.insert((()=>x),":first-child");return b.insert((()=>y),":first-child"),b.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",r),s.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-(a.y-(a.top??0))})`),JT(e,b),e.intersect=function(t){return $E.polygon(e,g,t)},i}async function IC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=l+c,u=-o/2,d=-h/2,{cssStyles:p}=e,g=n_(u-5,d+h+5,u+o-5,d+h+5,c,.8),f=g?.[g.length-1],m=[{x:u-5,y:d+5},{x:u-5,y:d+h+5},...g,{x:u+o-5,y:f.y-5},{x:u+o,y:f.y-5},{x:u+o,y:f.y-10},{x:u+o+5,y:f.y-10},{x:u+o+5,y:d-5},{x:u+5,y:d-5},{x:u+5,y:d},{x:u,y:d},{x:u,y:d+5}],y=[{x:u,y:d+5},{x:u+o-5,y:d+5},{x:u+o-5,y:f.y-5},{x:u+o,y:f.y-5},{x:u+o,y:d},{x:u,y:d}],v=sE.svg(i),x=vE(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=e_(m),w=v.path(b,x),k=e_(y),T=v.path(k,x),_=i.insert((()=>w),":first-child");return _.insert((()=>T)),_.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",r),_.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-c/2-(a.y-(a.top??0))})`),JT(e,_),e.intersect=function(t){return $E.polygon(e,m,t)},i}async function MC(t,e,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=yE(e);e.labelStyle=r;e.useHtmlLabels||!1!==Ft().flowchart?.htmlLabels||(e.centerLabel=!0);const{shapeSvg:a,bbox:s}=await ZT(t,e,t_(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=sE.svg(a),p=vE(e,{fill:n.noteBkgColor,stroke:n.noteBorderColor});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=d.rectangle(c,h,o,l,p),f=a.insert((()=>g),":first-child");return f.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",u),i&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",i),JT(e,f),e.intersect=function(t){return $E.rect(e,t)},a}s(AC,"linedCylinder"),s(LC,"linedWaveEdgedRect"),s(NC,"multiRect"),s(IC,"multiWaveEdgedRectangle"),s(MC,"note");var RC=s(((t,e,n)=>[`M${t+n/2},${e}`,`L${t+n},${e-n/2}`,`L${t+n/2},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" ")),"createDecisionBoxPathD");async function DC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.width+e.padding+(a.height+e.padding),o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=RC(0,0,s),a=t.path(r,n);l=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${s/2})`),c&&l.attr("style",c)}else l=GE(i,s,s,o);return r&&l.attr("style",r),JT(e,l),e.intersect=function(t){return m.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",$E.polygon(e,o,t)),$E.polygon(e,o,t)},i}async function OC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=-Math.max(a.width+(e.padding??0),e?.width??0)/2,l=-Math.max(a.height+(e.padding??0),e?.height??0)/2,c=l/2,h=[{x:o+c,y:l},{x:o,y:0},{x:o+c,y:-l},{x:-o,y:-l},{x:-o,y:l}],{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=e_(h),f=d.path(g,p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(${-c/2},0)`),s.attr("transform",`translate(${-c/2-a.width/2-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),JT(e,m),e.intersect=function(t){return $E.polygon(e,h,t)},i}async function PC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);let i;e.labelStyle=n,i=e.cssClasses?"node "+e.cssClasses:"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",r),l=e.description,c=e.label,h=o.node().appendChild(await dE(c,e.labelStyle,!0,!0));let u={width:0,height:0};if(dn(Hn()?.flowchart?.htmlLabels)){const t=h.children[0],e=Oa(h);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}m.info("Text 2",l);const d=l||[],p=h.getBBox(),g=o.node().appendChild(await dE(d.join?d.join("
    "):d,e.labelStyle,!0,!0)),f=g.children[0],y=Oa(g);u=f.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height);const v=(e.padding||0)/2;Oa(g).attr("transform","translate( "+(u.width>p.width?0:(p.width-u.width)/2)+", "+(p.height+v+5)+")"),Oa(h).attr("transform","translate( "+(u.width(m.debug("Rough node insert CXC",r),i)),":first-child"),T=a.insert((()=>(m.debug("Rough node insert CXC",r),r)),":first-child")}else T=s.insert("rect",":first-child"),_=s.insert("line"),T.attr("class","outer title-state").attr("style",r).attr("x",-u.width/2-v).attr("y",-u.height/2-v).attr("width",u.width+(e.padding||0)).attr("height",u.height+(e.padding||0)),_.attr("class","divider").attr("x1",-u.width/2-v).attr("x2",u.width/2+v).attr("y1",-u.height/2-v+p.height+v).attr("y2",-u.height/2-v+p.height+v);return JT(e,T),e.intersect=function(t){return $E.rect(e,t)},a}async function BC(t,e){return bC(t,e,{rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function $C(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=e?.padding??0,l=Math.max(a.width+2*(e.padding??0),e?.width??0),c=Math.max(a.height+2*(e.padding??0),e?.height??0),h=-a.width/2-o,u=-a.height/2-o,{cssStyles:d}=e,p=sE.svg(i),g=vE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=[{x:h,y:u},{x:h+l+8,y:u},{x:h+l+8,y:u+c},{x:h-8,y:u+c},{x:h-8,y:u},{x:h,y:u},{x:h,y:u+c}],m=p.polygon(f.map((t=>[t.x,t.y])),g),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container").attr("style",wk(d)),r&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",r),d&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",r),s.attr("transform",`translate(${-l/2+4+(e.padding??0)-(a.x-(a.left??0))},${-c/2+(e.padding??0)-(a.y-(a.top??0))})`),JT(e,y),e.intersect=function(t){return $E.rect(e,t)},i}async function FC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:c,y:h},{x:c,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-l/2}],f=e_(g),m=d.path(f,p),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",u),r&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",r),y.attr("transform",`translate(0, ${l/4})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))}, ${-l/4+(e.padding??0)-(a.y-(a.top??0))})`),JT(e,y),e.intersect=function(t){return $E.polygon(e,g,t)},i}async function zC(t,e){return bC(t,e,{rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function UC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.height+e.padding,o=a.width+s/4+e.padding;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=pE(-o/2,-s/2,o,s,s/2),a=t.path(r,n);l=i.insert((()=>a),":first-child"),l.attr("class","basic label-container").attr("style",wk(c))}else l=i.insert("rect",":first-child"),l.attr("class","basic label-container").attr("style",r).attr("rx",s/2).attr("ry",s/2).attr("x",-o/2).attr("y",-s/2).attr("width",o).attr("height",s);return JT(e,l),e.intersect=function(t){return $E.rect(e,t)},i}async function GC(t,e){return bC(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function qC(t,e,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=yE(e);e.labelStyle=r;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l}=n,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),h=sE.svg(c),u=vE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=h.circle(0,0,14,{...u,stroke:s,strokeWidth:2}),p=o??l,g=h.circle(0,0,5,{...u,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),f=c.insert((()=>d),":first-child");return f.insert((()=>g)),a&&f.selectAll("path").attr("style",a),i&&f.selectAll("path").attr("style",i),JT(e,f),e.intersect=function(t){return $E.circle(e,7,t)},c}function jC(t,e,{config:{themeVariables:n}}){const{lineColor:r}=n,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if("handDrawn"===e.look){const t=sE.svg(i).circle(0,0,14,gE(r));a=i.insert((()=>t)),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=i.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return JT(e,a),e.intersect=function(t){return $E.circle(e,7,t)},i}async function YC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=(e?.padding||0)/2,o=a.width+e.padding,l=a.height+e.padding,c=-a.width/2-s,h=-a.height/2-s,u=[{x:0,y:0},{x:o,y:0},{x:o,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=t.rectangle(c-8,h,o+16,l,n),a=t.line(c,h,c,h+l,n),s=t.line(c+o,h,c+o,h+l,n);i.insert((()=>a),":first-child"),i.insert((()=>s),":first-child");const u=i.insert((()=>r),":first-child"),{cssStyles:d}=e;u.attr("class","basic label-container").attr("style",wk(d)),JT(e,u)}else{const t=GE(i,o,l,u);r&&t.attr("style",r),JT(e,t)}return e.intersect=function(t){return $E.polygon(e,u,t)},i}async function WC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),e?.height??0),l=-s/2,c=-o/2,h=.2*o,u=.2*o,{cssStyles:d}=e,p=sE.svg(i),g=vE(e,{}),f=[{x:l-h/2,y:c},{x:l+s+h/2,y:c},{x:l+s+h/2,y:c+o},{x:l-h/2,y:c+o}],m=[{x:l+s-h/2,y:c+o},{x:l+s+h/2,y:c+o},{x:l+s+h/2,y:c+o-u}];"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const y=e_(f),v=p.path(y,g),x=e_(m),b=p.path(x,{...g,fillStyle:"solid"}),w=i.insert((()=>b),":first-child");return w.insert((()=>v),":first-child"),w.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",r),JT(e,w),e.intersect=function(t){return $E.polygon(e,f,t)},i}async function HC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=.2*o,u=.2*l,d=l+c,{cssStyles:p}=e,g=sE.svg(i),f=vE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-o/2*.1,y:d/2},...n_(-o/2-o/2*.1,d/2,o/2+o/2*.1,d/2,c,.8),{x:o/2+o/2*.1,y:-d/2},{x:-o/2-o/2*.1,y:-d/2}],y=-o/2+o/2*.1,v=-d/2-.4*u,x=[{x:y+o-h,y:1.4*(v+l)},{x:y+o,y:v+l-u},{x:y+o,y:.9*(v+l)},...n_(y+o,1.3*(v+l),y+o-h,1.5*(v+l),.03*-l,.5)],b=e_(m),w=g.path(b,f),k=e_(x),T=g.path(k,{...f,fillStyle:"solid"}),_=i.insert((()=>T),":first-child");return _.insert((()=>w),":first-child"),_.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",r),_.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c/2-(a.y-(a.top??0))})`),JT(e,_),e.intersect=function(t){return $E.polygon(e,m,t)},i}async function VC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+e.padding,e?.width||0),o=Math.max(a.height+e.padding,e?.height||0),l=-s/2,c=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",s).attr("height",o),JT(e,h),e.intersect=function(t){return $E.rect(e,t)},i}s(DC,"question"),s(OC,"rect_left_inv_arrow"),s(PC,"rectWithTitle"),s(BC,"roundedRect"),s($C,"shadedProcess"),s(FC,"slopedRect"),s(zC,"squareRect"),s(UC,"stadium"),s(GC,"state"),s(qC,"stateEnd"),s(jC,"stateStart"),s(YC,"subroutine"),s(WC,"taggedRect"),s(HC,"taggedWaveEdgedRectangle"),s(VC,"text");var XC=s(((t,e,n,r,i,a)=>`M${t},${e}\n a${i},${a} 0,0,1 0,${-r}\n l${n},0\n a${i},${a} 0,0,1 0,${r}\n M${n},${-r}\n a${i},${a} 0,0,0 0,${r}\n l${-n},0`),"createCylinderPathD"),KC=s(((t,e,n,r,i,a)=>[`M${t},${e}`,`M${t+n},${e}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(" ")),"createOuterCylinderPathD"),ZC=s(((t,e,n,r,i,a)=>[`M${t+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(" ")),"createInnerCylinderPathD");async function QC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s,halfPadding:o}=await ZT(t,e,t_(e)),l="neo"===e.look?2*o:o,c=a.height+l,h=c/2,u=h/(2.5+c/50),d=a.width+u+l,{cssStyles:p}=e;let g;if("handDrawn"===e.look){const t=sE.svg(i),n=KC(0,0,d,c,u,h),r=ZC(0,0,d,c,u,h),a=t.path(n,vE(e,{})),s=t.path(r,vE(e,{fill:"none"}));g=i.insert((()=>s),":first-child"),g=i.insert((()=>a),":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const t=XC(0,0,d,c,u,h);g=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",wk(p)).attr("style",r),g.attr("class","basic label-container"),p&&g.selectAll("path").attr("style",p),r&&g.selectAll("path").attr("style",r)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-d/2}, ${c/2} )`),s.attr("transform",`translate(${-a.width/2-u-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),JT(e,g),e.intersect=function(t){const n=$E.rect(e,t),r=n.y-(e.y??0);if(0!=h&&(Math.abs(r)<(e.height??0)/2||Math.abs(r)==(e.height??0)/2&&Math.abs(n.x-(e.x??0))>(e.width??0)/2-u)){let i=u*u*(1-r*r/(h*h));0!=i&&(i=Math.sqrt(Math.abs(i))),i=u-i,t.x-(e.x??0)>0&&(i=-i),n.x+=i}return n},i}async function JC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.width+e.padding,o=a.height+e.padding,l=[{x:-3*o/6,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(l),a=t.path(r,n);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=GE(i,s,o,l);return r&&c.attr("style",r),e.width=s,e.height=o,JT(e,c),e.intersect=function(t){return $E.polygon(e,l,t)},i}async function tS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(60,a.width+2*(e.padding??0),e?.width??0),o=Math.max(20,a.height+2*(e.padding??0),e?.height??0),{cssStyles:l}=e,c=sE.svg(i),h=vE(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const u=[{x:-s/2*.8,y:-o/2},{x:s/2*.8,y:-o/2},{x:s/2,y:-o/2*.6},{x:s/2,y:o/2},{x:-s/2,y:o/2},{x:-s/2,y:-o/2*.6}],d=e_(u),p=c.path(d,h),g=i.insert((()=>p),":first-child");return g.attr("class","basic label-container"),l&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",l),r&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",r),JT(e,g),e.intersect=function(t){return $E.polygon(e,u,t)},i}async function eS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=dn(Hn().flowchart?.htmlLabels),l=a.width+(e.padding??0),c=l+a.height,h=l+a.height,u=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-c}],{cssStyles:d}=e,p=sE.svg(i),g=vE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=e_(u),y=p.path(f,g),v=i.insert((()=>y),":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",d),r&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",r),e.width=l,e.height=c,JT(e,v),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${c/2-(a.height+(e.padding??0)/(o?2:1)-(a.y-(a.top??0)))})`),e.intersect=function(t){return m.info("Triangle intersect",e,u,t),$E.polygon(e,u,t)},i}async function nS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/8,h=l+c,{cssStyles:u}=e,d=70-o,p=d>0?d/2:0,g=sE.svg(i),f=vE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-p,y:h/2},...n_(-o/2-p,h/2,o/2+p,h/2,c,.8),{x:o/2+p,y:-h/2},{x:-o/2-p,y:-h/2}],y=e_(m),v=g.path(y,f),x=i.insert((()=>v),":first-child");return x.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",r),x.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c-(a.y-(a.top??0))})`),JT(e,x),e.intersect=function(t){return $E.polygon(e,m,t)},i}async function rS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),e?.height??0),l=s/o;let c=s,h=o;c>h*l?h=c/l:c=h*l,c=Math.max(c,100),h=Math.max(h,50);const u=Math.min(.2*h,h/4),d=h+2*u,{cssStyles:p}=e,g=sE.svg(i),f=vE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-c/2,y:d/2},...n_(-c/2,d/2,c/2,d/2,u,1),{x:c/2,y:-d/2},...n_(c/2,-d/2,-c/2,-d/2,u,-1)],y=e_(m),v=g.path(y,f),x=i.insert((()=>v),":first-child");return x.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",r),JT(e,x),e.intersect=function(t){return $E.polygon(e,m,t)},i}async function iS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{}),g=[{x:c-5,y:h-5},{x:c-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-5}],f=`M${c-5},${h-5} L${c+o},${h-5} L${c+o},${h+l} L${c-5},${h+l} L${c-5},${h-5}\n M${c-5},${h} L${c+o},${h}\n M${c},${h-5} L${c},${h+l}`;"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const m=d.path(f,p),y=i.insert((()=>m),":first-child");return y.attr("transform","translate(2.5, 2.5)"),y.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",r),s.attr("transform",`translate(${-a.width/2+2.5-(a.x-(a.left??0))}, ${-a.height/2+2.5-(a.y-(a.top??0))})`),JT(e,y),e.intersect=function(t){return $E.polygon(e,g,t)},i}async function aS(t,e,n,r,i=n.class.padding??12){const a=r?0:3,s=t.insert("g").attr("class",t_(e)).attr("id",e.domId||e.id);let o=null,l=null,c=null,h=null,u=0,d=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const t=e.annotations[0];await sS(o,{text:`«${t}»`},0);u=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await sS(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();d=g.height,c=s.insert("g").attr("class","members-group text");let f=0;for(const t of e.members){f+=await sS(c,t,f,[t.parseClassifier()])+a}p=c.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let m=0;for(const t of e.methods){m+=await sS(h,t,m,[t.parseClassifier()])+a}let y=s.node().getBBox();if(null!==o){const t=o.node().getBBox();o.attr("transform",`translate(${-t.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${u})`),y=s.node().getBBox(),c.attr("transform",`translate(0, ${u+d+2*i})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${u+d+(p?p+4*i:2*i)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}async function sS(t,e,n,r=[]){const i=t.insert("g").attr("class","label").attr("style",r.join("; ")),a=Ft();let o="useHtmlLabels"in e?e.useHtmlLabels:dn(a.htmlLabels)??!0,l="";l="text"in e?e.text:e.label,!o&&l.startsWith("\\")&&(l=l.substring(1)),wn(l)&&(o=!0);const c=await KT(i,Kn(xk(l)),{width:lk(l,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let h,u=1;if(o){const t=c.children[0],e=Oa(c);u=t.innerHTML.split("
    ").length,t.innerHTML.includes("")&&(u+=t.innerHTML.split("").length-1);const n=t.getElementsByTagName("img");if(n){const t=""===l.replace(/]*>/g,"").trim();await Promise.all([...n].map((e=>new Promise((n=>{function r(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,n=5,r=parseInt(t,10)*n+"px";e.style.minWidth=r,e.style.maxWidth=r}else e.style.width="100%";n(e)}s(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}else{r.includes("font-weight: bolder")&&Oa(c).selectAll("tspan").attr("font-weight",""),u=c.children.length;const t=c.children[0];if(""===c.textContent||c.textContent.includes(">")){t.textContent=l[0]+l.substring(1).replaceAll(">",">").replaceAll("<","<").trim();" "===l[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))}"undefined"===t.textContent&&(t.textContent=""),h=c.getBBox()}return i.attr("transform","translate(0,"+(-h.height/(2*u)+n)+")"),h.height}async function oS(t,e){const n=Hn(),r=n.class.padding??12,i=r,a=e.useHtmlLabels??dn(n.htmlLabels)??!0,s=e;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];const{shapeSvg:o,bbox:l}=await aS(t,e,n,a,i),{labelStyles:c,nodeStyles:h}=yE(e);e.labelStyle=c,e.cssStyles=s.styles||"";const u=s.styles?.join(";")||h||"";e.cssStyles||(e.cssStyles=u.replaceAll("!important","").split(";"));const d=0===s.members.length&&0===s.methods.length&&!n.class?.hideEmptyMembersBox,p=sE.svg(o),g=vE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=l.width;let m=l.height;0===s.members.length&&0===s.methods.length?m+=i:s.members.length>0&&0===s.methods.length&&(m+=2*i);const y=-f/2,v=-m/2,x=p.rectangle(y-r,v-r-(d?r:0===s.members.length&&0===s.methods.length?-r/2:0),f+2*r,m+2*r+(d?2*r:0===s.members.length&&0===s.methods.length?-r:0),g),b=o.insert((()=>x),":first-child");b.attr("class","basic label-container");const w=b.node().getBBox();o.selectAll(".text").each(((t,e,n)=>{const i=Oa(n[e]),l=i.attr("transform");let c=0;if(l){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);t&&(c=parseFloat(t[2]))}let h=c+v+r-(d?r:0===s.members.length&&0===s.methods.length?-r/2:0);a||(h-=4);let u=y;(i.attr("class").includes("label-group")||i.attr("class").includes("annotation-group"))&&(u=-i.node()?.getBBox().width/2||0,o.selectAll("text").each((function(t,e,n){"middle"===window.getComputedStyle(n[e]).textAnchor&&(u=0)}))),i.attr("transform",`translate(${u}, ${h})`)}));const k=o.select(".annotation-group").node().getBBox().height-(d?r/2:0)||0,T=o.select(".label-group").node().getBBox().height-(d?r/2:0)||0,_=o.select(".members-group").node().getBBox().height-(d?r/2:0)||0;if(s.members.length>0||s.methods.length>0||d){const t=p.line(w.x,k+T+v+r,w.x+w.width,k+T+v+r,g);o.insert((()=>t)).attr("class","divider").attr("style",u)}if(d||s.members.length>0||s.methods.length>0){const t=p.line(w.x,k+T+_+v+2*i+r,w.x+w.width,k+T+_+v+r+2*i,g);o.insert((()=>t)).attr("class","divider").attr("style",u)}if("handDrawn"!==s.look&&o.selectAll("path").attr("style",u),b.select(":nth-child(2)").attr("style",u),o.selectAll(".divider").select("path").attr("style",u),e.labelStyle?o.selectAll("span").attr("style",e.labelStyle):o.selectAll("span").attr("style",u),!a){const t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(u);if(e){const t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}else if(c){const e=t.exec(c);if(e){const t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}}}return JT(e,b),e.intersect=function(t){return $E.rect(e,t)},o}s(QC,"tiltedCylinder"),s(JC,"trapezoid"),s(tS,"trapezoidalPentagon"),s(eS,"triangle"),s(nS,"waveEdgedRectangle"),s(rS,"waveRectangle"),s(iS,"windowPane"),s(aS,"textHelper"),s(sS,"addText"),s(oS,"classBox");var lS=s((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 cS(t,e,{config:n}){const{labelStyles:r,nodeStyles:i}=yE(e);e.labelStyle=r||"";const a=e.width;e.width=(e.width??200)-10;const{shapeSvg:s,bbox:o,label:l}=await ZT(t,e,t_(e)),c=e.padding||10;let h,u="";"ticket"in e&&e.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),h=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const d={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let p,g;({label:p,bbox:g}=h?await QT(h,"ticket"in e&&e.ticket||"",d):await QT(s,"ticket"in e&&e.ticket||"",d));const{label:f,bbox:m}=await QT(s,"assigned"in e&&e.assigned||"",d);e.width=a;const y=e?.width||0,v=Math.max(g.height,m.height)/2,x=Math.max(o.height+20,e?.height||0)+v,b=-y/2,w=-x/2;let k;l.attr("transform","translate("+(c-y/2)+", "+(-v-o.height/2)+")"),p.attr("transform","translate("+(c-y/2)+", "+(-v+o.height/2)+")"),f.attr("transform","translate("+(c+y/2-m.width-20)+", "+(-v+o.height/2)+")");const{rx:T,ry:_}=e,{cssStyles:E}=e;if("handDrawn"===e.look){const t=sE.svg(s),n=vE(e,{}),r=T||_?t.path(pE(b,w,y,x,T||0),n):t.rectangle(b,w,y,x,n);k=s.insert((()=>r),":first-child"),k.attr("class","basic label-container").attr("style",E||null)}else{k=s.insert("rect",":first-child"),k.attr("class","basic label-container __APA__").attr("style",i).attr("rx",T??5).attr("ry",_??5).attr("x",b).attr("y",w).attr("width",y).attr("height",x);const t="priority"in e&&e.priority;if(t){const e=s.append("line"),n=b+2,r=w+Math.floor((T??0)/2),i=w+x-Math.floor((T??0)/2);e.attr("x1",n).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width","4").attr("stroke",lS(t))}}return JT(e,k),e.height=x,e.intersect=function(t){return $E.rect(e,t)},s}s(cS,"kanbanItem");var hS=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:zC},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:BC},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:UC},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:YC},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:iC},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:YE},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:DC},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:dC},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:TC},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:kC},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:JC},{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:xC},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:sC},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:VC},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:qE},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:$C},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:jC},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:qC},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:cC},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:pC},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:XE},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:ZE},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:JE},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:_C},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:nS},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:hC},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:QC},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:AC},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:tC},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:aC},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:eS},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:iS},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:oC},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:tS},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:lC},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:FC},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:IC},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:NC},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:UE},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:HE},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:HC},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:WC},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:rS},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:OC},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:LC}],uS=s((()=>{const t={state:GC,choice:jE,note:MC,rectWithTitle:PC,labelRect:wC,iconSquare:yC,iconCircle:fC,icon:gC,iconRounded:mC,imageSquare:vC,anchor:FE,kanbanItem:cS,classBox:oS},e=[...Object.entries(t),...hS.flatMap((t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map((e=>[e,t.handler]))))];return Object.fromEntries(e)}),"generateShapeMap"),dS=uS();function pS(t){return t in dS}s(pS,"isValidShape");var gS=new Map;async function fS(t,e,n){let r,i;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?dS[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;"sandbox"===n.config.securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),r=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(r,e,n)}else i=await a(t,e,n),r=i;return e.tooltip&&i.attr("title",e.tooltip),gS.set(e.id,r),e.haveCallback&&r.attr("class",r.attr("class")+" clickable"),r}s(fS,"insertNode");var mS=s(((t,e)=>{gS.set(e.id,t)}),"setNodeElem"),yS=s((()=>{gS.clear()}),"clear"),vS=s((t=>{const e=gS.get(t.id);m.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n}),"positionNode"),xS={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};function bS(t,e){if(void 0===t||void 0===e)return{angle:0,deltaX:0,deltaY:0};t=wS(t),e=wS(e);const[n,r]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-n,o=a-r;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}s(bS,"calculateDeltaAndAngle");var wS=s((t=>Array.isArray(t)?{x:t[0],y:t[1]}:t),"pointTransformer"),kS=s((t=>({x:s((function(e,n,r){let i=0;const a=wS(r[0]).x=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(xS,t.arrowTypeEnd)){const{angle:e,deltaX:n}=bS(r[r.length-1],r[r.length-2]);i=xS[t.arrowTypeEnd]*Math.cos(e)*(n>=0?1:-1)}const s=Math.abs(wS(e).x-wS(r[r.length-1]).x),o=Math.abs(wS(e).y-wS(r[r.length-1]).y),l=Math.abs(wS(e).x-wS(r[0]).x),c=Math.abs(wS(e).y-wS(r[0]).y),h=xS[t.arrowTypeStart],u=xS[t.arrowTypeEnd];if(s0&&o0&&c=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(xS,t.arrowTypeEnd)){const{angle:e,deltaY:n}=bS(r[r.length-1],r[r.length-2]);i=xS[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(n>=0?1:-1)}const s=Math.abs(wS(e).y-wS(r[r.length-1]).y),o=Math.abs(wS(e).x-wS(r[r.length-1]).x),l=Math.abs(wS(e).y-wS(r[0]).y),c=Math.abs(wS(e).x-wS(r[0]).x),h=xS[t.arrowTypeStart],u=xS[t.arrowTypeEnd];if(s0&&o0&&c{e.arrowTypeStart&&ES(t,"start",e.arrowTypeStart,n,r,i),e.arrowTypeEnd&&ES(t,"end",e.arrowTypeEnd,n,r,i)}),"addEdgeMarkers"),_S={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},ES=s(((t,e,n,r,i,a)=>{const s=_S[n];if(!s)return void m.warn(`Unknown arrow type: ${n}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${r}#${i}_${a}-${s}${o})`)}),"addEdgeMarker"),CS=new Map,SS=new Map,AS=s((()=>{CS.clear(),SS.clear()}),"clear"),LS=s((t=>t?t.reduce(((t,e)=>t+";"+e),""):""),"getLabelStyles"),NS=s((async(t,e)=>{let n=dn(Hn().flowchart.htmlLabels);const r=await KT(t,e.label,{style:LS(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1});m.info("abc82",e,e.labelType);const i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label");a.node().appendChild(r);let s,o=r.getBBox();if(n){const t=r.children[0],e=Oa(r);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}if(a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),CS.set(e.id,i),e.width=o.width,e.height=o.height,e.startLabelLeft){const n=await dE(e.startLabelLeft,LS(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),SS.get(e.id)||SS.set(e.id,{}),SS.get(e.id).startLeft=r,IS(s,e.startLabelLeft)}if(e.startLabelRight){const n=await dE(e.startLabelRight,LS(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=r.node().appendChild(n),i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),SS.get(e.id)||SS.set(e.id,{}),SS.get(e.id).startRight=r,IS(s,e.startLabelRight)}if(e.endLabelLeft){const n=await dE(e.endLabelLeft,LS(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),SS.get(e.id)||SS.set(e.id,{}),SS.get(e.id).endLeft=r,IS(s,e.endLabelLeft)}if(e.endLabelRight){const n=await dE(e.endLabelRight,LS(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),SS.get(e.id)||SS.set(e.id,{}),SS.get(e.id).endRight=r,IS(s,e.endLabelRight)}return r}),"insertEdgeLabel");function IS(t,e){Hn().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}s(IS,"setTerminalWidth");var MS=s(((t,e)=>{m.debug("Moving label abc88 ",t.id,t.label,CS.get(t.id),e);let n=e.updatedPath?e.updatedPath:e.originalPath;const r=Hn(),{subGraphTitleTotalMargin:i}=Gm(r);if(t.label){const r=CS.get(t.id);let a=t.x,s=t.y;if(n){const r=yk.calcLabelPosition(n);m.debug("Moving label "+t.label+" from (",a,",",s,") to (",r.x,",",r.y,") abc88"),e.updatedPath&&(a=r.x,s=r.y)}r.attr("transform",`translate(${a}, ${s+i/2})`)}if(t.startLabelLeft){const e=SS.get(t.id).startLeft;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.startLabelRight){const e=SS.get(t.id).startRight;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.endLabelLeft){const e=SS.get(t.id).endLeft;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.endLabelRight){const e=SS.get(t.id).endRight;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}}),"positionEdgeLabel"),RS=s(((t,e)=>{const n=t.x,r=t.y,i=Math.abs(e.x-n),a=Math.abs(e.y-r),s=t.width/2,o=t.height/2;return i>=s||a>=o}),"outsideNode"),DS=s(((t,e,n)=>{m.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const r=t.x,i=t.y,a=Math.abs(r-n.x),s=t.width/2;let o=n.xMath.abs(r-e.x)*l){let t=n.y{m.warn("abc88 cutPathAtIntersect",t,e);let n=[],r=t[0],i=!1;return t.forEach((t=>{if(m.info("abc88 checking point",t,e),RS(e,t)||i)m.warn("abc88 outside",t,r),r=t,i||n.push(t);else{const a=DS(e,r,t);m.debug("abc88 inside",t,r,a),m.debug("abc88 intersection",a,e);let s=!1;n.forEach((t=>{s=s||t.x===a.x&&t.y===a.y})),n.some((t=>t.x===a.x&&t.y===a.y))?m.warn("abc88 no intersect",a,n):n.push(a),i=!0}})),m.debug("returning points",n),n}),"cutPathAtIntersect");function PS(t){const e=[],n=[];for(let r=1;r5&&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),n.push(r))}return{cornerPoints:e,cornerPointPositions:n}}s(PS,"extractCornerPoints");var BS=s((function(t,e,n){const r=e.x-t.x,i=e.y-t.y,a=n/Math.sqrt(r*r+i*i);return{x:e.x-a*r,y:e.y-a*i}}),"findAdjacentPoint"),$S=s((function(t){const{cornerPointPositions:e}=PS(t),n=[];for(let r=0;r10&&Math.abs(i.y-e.y)>=10){m.debug("Corner point fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));const t=5;u=a.x===s.x?{x:l<0?s.x-t+h:s.x+t-h,y:c<0?s.y-h:s.y+h}:{x:l<0?s.x-h:s.x+h,y:c<0?s.y-t+h:s.y+t-h}}else m.debug("Corner point skipping fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));n.push(u,o)}else n.push(t[r]);return n}),"fixCorners"),FS=s((function(t,e,n,r,i,a,s){const{handDrawnSeed:o}=Hn();let l=e.points,c=!1;const h=i;var u=a;u.intersect&&h.intersect&&(l=l.slice(1,e.points.length-1),l.unshift(h.intersect(l[0])),m.debug("Last point APA12",e.start,"--\x3e",e.end,l[l.length-1],u,u.intersect(l[l.length-1])),l.push(u.intersect(l[l.length-1]))),e.toCluster&&(m.info("to cluster abc88",n.get(e.toCluster)),l=OS(e.points,n.get(e.toCluster).node),c=!0),e.fromCluster&&(m.debug("from cluster abc88",n.get(e.fromCluster),JSON.stringify(l,null,2)),l=OS(l.reverse(),n.get(e.fromCluster).node).reverse(),c=!0);let d=l.filter((t=>!Number.isNaN(t.y)));d=$S(d);let p=iu;e.curve&&(p=e.curve);const{x:g,y:f}=kS(e),y=Xh().x(g).y(f).curve(p);let v,x;switch(e.thickness){case"normal":default:v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-invisible"}switch(e.pattern){case"solid":default:v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed"}let b=y(d);const w=Array.isArray(e.style)?e.style:[e.style];if("handDrawn"===e.look){const n=sE.svg(t);Object.assign([],d);v+=" transition",x=Oa(n.path(b,{roughness:.3,seed:o})).select("path").attr("id",e.id).attr("class"," "+v+(e.classes?" "+e.classes:"")).attr("style",w?w.reduce(((t,e)=>t+";"+e),""):"");let r=x.attr("d");x.attr("d",r),t.node().appendChild(x.node())}else x=t.append("path").attr("d",b).attr("id",e.id).attr("class"," "+v+(e.classes?" "+e.classes:"")).attr("style",w?w.reduce(((t,e)=>t+";"+e),""):"");let k="";(Hn().flowchart.arrowMarkerAbsolute||Hn().state.arrowMarkerAbsolute)&&(k=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,k=k.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),m.info("arrowTypeStart",e.arrowTypeStart),m.info("arrowTypeEnd",e.arrowTypeEnd),TS(x,e,k,s,r);let T={};return c&&(T.updatedPath=l),T.originalPath=e.points,T}),"insertEdge"),zS=s(((t,e,n,r)=>{e.forEach((e=>{KS[e](t,n,r)}))}),"insertMarkers"),US=s(((t,e,n)=>{m.trace("Making markers for ",n),t.append("defs").append("marker").attr("id",n+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",n+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")}),"extension"),GS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",n+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"composition"),qS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",n+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"aggregation"),jS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",n+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"dependency"),YS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",n+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),WS=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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")}),"point"),HS=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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")}),"circle"),VS=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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")}),"cross"),XS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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"),KS={extension:US,composition:GS,aggregation:qS,dependency:jS,lollipop:YS,point:WS,circle:HS,cross:VS,barb:XS},ZS=zS,QS={common:_n,getConfig:Ft,insertCluster:CE,insertEdge:FS,insertEdgeLabel:NS,insertMarkers:ZS,insertNode:fS,interpolateToCurve:Gw,labelHelper:ZT,log:m,positionEdgeLabel:MS},JS={},tA=s((t=>{for(const e of t)JS[e.name]=e}),"registerLayoutLoaders");s((()=>{tA([{name:"dagre",loader:s((async()=>await Promise.resolve().then((function(){return eW}))),"loader")}])}),"registerDefaultLayoutLoaders")();var eA=s((async(t,e)=>{if(!(t.layoutAlgorithm in JS))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const n=JS[t.layoutAlgorithm];return(await n.loader()).render(t,e,QS,{algorithm:n.algorithm})}),"render"),nA=s(((t="",{fallback:e="dagre"}={})=>{if(t in JS)return t;if(e in JS)return m.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"),rA=Vx(Object.keys,Object),iA=Object.prototype.hasOwnProperty;function aA(t){if(!Qx(t))return rA(t);var e=[];for(var n in Object(t))iA.call(t,n)&&"constructor"!=n&&e.push(n);return e}s(aA,"baseKeys");var sA=aA,oA=dv(Ly,"DataView"),lA=dv(Ly,"Promise"),cA=dv(Ly,"Set"),hA=dv(Ly,"WeakMap"),uA=tv(oA),dA=tv(Yv),pA=tv(lA),gA=tv(cA),fA=tv(hA),mA=Gy;(oA&&"[object DataView]"!=mA(new oA(new ArrayBuffer(1)))||Yv&&"[object Map]"!=mA(new Yv)||lA&&"[object Promise]"!=mA(lA.resolve())||cA&&"[object Set]"!=mA(new cA)||hA&&"[object WeakMap]"!=mA(new hA))&&(mA=s((function(t){var e=Gy(t),n="[object Object]"==e?t.constructor:void 0,r=n?tv(n):"";if(r)switch(r){case uA:return"[object DataView]";case dA:return"[object Map]";case pA:return"[object Promise]";case gA:return"[object Set]";case fA:return"[object WeakMap]"}return e}),"getTag"));var yA=mA,vA=Object.prototype.hasOwnProperty;function xA(t){if(null==t)return!0;if(gb(t)&&(hb(t)||"string"==typeof t||"function"==typeof t.splice||kb(t)||zb(t)||cb(t)))return!t.length;var e=yA(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Qx(t))return!sA(t).length;for(var n in t)if(vA.call(t,n))return!1;return!0}s(xA,"isEmpty");var bA=xA,wA={id:"c4",detector:s((t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return $H}));return{id:"c4",diagram:t}}),"loader")},kA=s(((t,e)=>"dagre-wrapper"!==e?.flowchart?.defaultRenderer&&"elk"!==e?.flowchart?.defaultRenderer&&/^\s*graph/.test(t)),"detector"),TA={id:"flowchart",detector:kA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return tX}));return{id:"flowchart",diagram:t}}),"loader")},_A="flowchart-v2",EA=s(((t,e)=>"dagre-d3"!==e?.flowchart?.defaultRenderer&&("elk"===e?.flowchart?.defaultRenderer&&(e.layout="elk"),!(!/^\s*graph/.test(t)||"dagre-wrapper"!==e?.flowchart?.defaultRenderer)||/^\s*flowchart/.test(t))),"detector"),CA={id:_A,detector:EA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return tX}));return{id:_A,diagram:t}}),"loader")},SA={id:"er",detector:s((t=>/^\s*erDiagram/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return GX}));return{id:"er",diagram:t}}),"loader")},AA={id:"gitGraph",detector:s((t=>/^\s*gitGraph/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return ant}));return{id:"gitGraph",diagram:t}}),"loader")},LA={id:"gantt",detector:s((t=>/^\s*gantt/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return zrt}));return{id:"gantt",diagram:t}}),"loader")},NA={id:"info",detector:s((t=>/^\s*info/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Wrt}));return{id:"info",diagram:t}}),"loader")},IA={id:"pie",detector:s((t=>/^\s*pie/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return lit}));return{id:"pie",diagram:t}}),"loader")},MA="quadrantChart",RA={id:MA,detector:s((t=>/^\s*quadrantChart/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Bit}));return{id:MA,diagram:t}}),"loader")},DA={id:"xychart",detector:s((t=>/^\s*xychart-beta/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Rat}));return{id:"xychart",diagram:t}}),"loader")},OA={id:"requirement",detector:s((t=>/^\s*requirement(Diagram)?/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return vst}));return{id:"requirement",diagram:t}}),"loader")},PA={id:"sequence",detector:s((t=>/^\s*sequenceDiagram/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return rlt}));return{id:"sequence",diagram:t}}),"loader")},BA=s(((t,e)=>"dagre-wrapper"!==e?.class?.defaultRenderer&&/^\s*classDiagram/.test(t)),"detector"),$A={id:"class",detector:BA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return oct}));return{id:"class",diagram:t}}),"loader")},FA=s(((t,e)=>!(!/^\s*classDiagram/.test(t)||"dagre-wrapper"!==e?.class?.defaultRenderer)||/^\s*classDiagram-v2/.test(t)),"detector"),zA={id:"classDiagram",detector:FA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return cct}));return{id:"classDiagram",diagram:t}}),"loader")},UA=s(((t,e)=>"dagre-wrapper"!==e?.state?.defaultRenderer&&/^\s*stateDiagram/.test(t)),"detector"),GA={id:"state",detector:UA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Uht}));return{id:"state",diagram:t}}),"loader")},qA=s(((t,e)=>!!/^\s*stateDiagram-v2/.test(t)||!(!/^\s*stateDiagram/.test(t)||"dagre-wrapper"!==e?.state?.defaultRenderer)),"detector"),jA={id:"stateDiagram",detector:qA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return qht}));return{id:"stateDiagram",diagram:t}}),"loader")},YA={id:"journey",detector:s((t=>/^\s*journey/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Nut}));return{id:"journey",diagram:t}}),"loader")},WA=s(((t,e,n)=>{m.debug("rendering svg for syntax error\n");const r=zp(e),i=r.append("g");r.attr("viewBox","0 0 2412 512"),Sn(r,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 ${n}`)}),"draw"),HA={draw:WA},VA=HA,XA={db:{},renderer:HA,parser:{parse:s((()=>{}),"parse")}},KA="flowchart-elk",ZA=s(((t,e={})=>!!(/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&"elk"===e?.flowchart?.defaultRenderer)&&(e.layout="elk",!0)),"detector"),QA={id:KA,detector:ZA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return tX}));return{id:KA,diagram:t}}),"loader")},JA={id:"timeline",detector:s((t=>/^\s*timeline/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return xdt}));return{id:"timeline",diagram:t}}),"loader")},tL={id:"mindmap",detector:s((t=>/^\s*mindmap/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return XCt}));return{id:"mindmap",diagram:t}}),"loader")},eL={id:"kanban",detector:s((t=>/^\s*kanban/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return xSt}));return{id:"kanban",diagram:t}}),"loader")},nL={id:"sankey",detector:s((t=>/^\s*sankey-beta/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return _At}));return{id:"sankey",diagram:t}}),"loader")},rL={id:"packet",detector:s((t=>/^\s*packet-beta/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return zAt}));return{id:"packet",diagram:t}}),"loader")},iL={id:"block",detector:s((t=>/^\s*block-beta/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return aIt}));return{id:"block",diagram:t}}),"loader")},aL={id:"architecture",detector:s((t=>/^\s*architecture/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return hMt}));return{id:"architecture",diagram:t}}),"loader")},sL=!1,oL=s((()=>{sL||(sL=!0,tr("error",XA,(t=>"error"===t.toLowerCase().trim())),tr("---",{db:{clear:s((()=>{}),"clear")},styles:{},renderer:{draw:s((()=>{}),"draw")},parser:{parse:s((()=>{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:s((()=>null),"init")},(t=>t.toLowerCase().trimStart().startsWith("---"))),E(wA,eL,zA,$A,SA,LA,NA,IA,OA,PA,QA,CA,TA,tL,JA,AA,jA,GA,YA,RA,nL,rL,DA,iL,aL))}),"addDiagrams"),lL=s((async()=>{m.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(T).map((async([t,{detector:e,loader:n}])=>{if(n)try{er(t)}catch{try{const{diagram:t,id:r}=await n();tr(r,t,e)}catch(e){throw m.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete T[t],e}}})))).filter((t=>"rejected"===t.status));if(t.length>0){m.error(`Failed to load ${t.length} external diagrams`);for(const e of t)m.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}}),"loadRegisteredDiagrams"),cL=Math.abs,hL=String.fromCharCode;function uL(t){return t.trim()}function dL(t,e,n){return t.replace(e,n)}function pL(t,e,n){return t.indexOf(e,n)}function gL(t,e){return 0|t.charCodeAt(e)}function fL(t,e,n){return t.slice(e,n)}function mL(t){return t.length}function yL(t){return t.length}function vL(t,e){return e.push(t),t}s(uL,"trim"),s(dL,"replace"),s(pL,"indexof"),s(gL,"charat"),s(fL,"substr"),s(mL,"strlen"),s(yL,"sizeof"),s(vL,"append");var xL=1,bL=1,wL=0,kL=0,TL=0,_L="";function EL(t,e,n,r,i,a,s,o){return{value:t,root:e,parent:n,type:r,props:i,children:a,line:xL,column:bL,length:s,return:"",siblings:o}}function CL(){return TL}function SL(){return TL=kL>0?gL(_L,--kL):0,bL--,10===TL&&(bL=1,xL--),TL}function AL(){return TL=kL2||ML(TL)>3?"":" "}function BL(t,e){for(;--e&&AL()&&!(TL<48||TL>102||TL>57&&TL<65||TL>70&&TL<97););return IL(t,NL()+(e<6&&32==LL()&&32==AL()))}function $L(t){for(;AL();)switch(TL){case t:return kL;case 34:case 39:34!==t&&39!==t&&$L(TL);break;case 40:41===t&&$L(t);break;case 92:AL()}return kL}function FL(t,e){for(;AL()&&t+TL!==57&&(t+TL!==84||47!==LL()););return"/*"+IL(e,kL-1)+"*"+hL(47===t?t:AL())}function zL(t){for(;!ML(LL());)AL();return IL(t,kL)}function UL(t){return DL(GL("",null,null,null,[""],t=RL(t),0,[0],t))}function GL(t,e,n,r,i,a,s,o,l){for(var c=0,h=0,u=s,d=0,p=0,g=0,f=1,m=1,y=1,v=0,x="",b=i,w=a,k=r,T=x;m;)switch(g=v,v=AL()){case 40:if(108!=g&&58==gL(T,u-1)){-1!=pL(T+=dL(OL(v),"&","&\f"),"&\f",cL(c?o[c-1]:0))&&(y=-1);break}case 34:case 39:case 91:T+=OL(v);break;case 9:case 10:case 13:case 32:T+=PL(g);break;case 92:T+=BL(NL()-1,7);continue;case 47:switch(LL()){case 42:case 47:vL(jL(FL(AL(),NL()),e,n,l),l),5!=ML(g||1)&&5!=ML(LL()||1)||!mL(T)||" "===fL(T,-1,void 0)||(T+=" ");break;default:T+="/"}break;case 123*f:o[c++]=mL(T)*y;case 125*f:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+h:-1==y&&(T=dL(T,/\f/g,"")),p>0&&(mL(T)-u||0===f&&47===g)&&vL(p>32?YL(T+";",r,n,u-1,l):YL(dL(T," ","")+";",r,n,u-2,l),l);break;case 59:T+=";";default:if(vL(k=qL(T,e,n,c,h,i,o,x,b=[],w=[],u,a),a),123===v)if(0===h)GL(T,e,k,k,b,a,u,o,w);else switch(99===d&&110===gL(T,3)?100:d){case 100:case 108:case 109:case 115:GL(t,k,k,r&&vL(qL(t,k,k,0,0,i,o,x,i,b=[],u,w),w),i,w,u,o,r?b:w);break;default:GL(T,k,k,k,[""],w,0,o,w)}}c=h=p=0,f=y=1,x=T="",u=s;break;case 58:u=1+mL(T),p=g;default:if(f<1)if(123==v)--f;else if(125==v&&0==f++&&125==SL())continue;switch(T+=hL(v),v*f){case 38:y=h>0?1:(T+="\f",-1);break;case 44:o[c++]=(mL(T)-1)*y,y=1;break;case 64:45===LL()&&(T+=OL(AL())),d=LL(),h=u=mL(x=T+=zL(NL())),v++;break;case 45:45===g&&2==mL(T)&&(f=0)}}return a}function qL(t,e,n,r,i,a,s,o,l,c,h,u){for(var d=i-1,p=0===i?a:[""],g=yL(p),f=0,m=0,y=0;f0?p[v]+" "+x:dL(x,/&\f/g,p[v])))&&(l[y++]=b);return EL(t,e,n,0===i?"rule":o,l,c,h,u)}function jL(t,e,n,r){return EL(t,e,n,"comm",hL(CL()),fL(t,2,-2),0,r)}function YL(t,e,n,r,i){return EL(t,e,n,"decl",fL(t,0,r),fL(t,r+1,-1),r,i)}function WL(t,e){for(var n="",r=0;r{ZL.forEach((t=>{t()})),ZL=[]}),"attachFunctions"),JL=s((t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart()),"cleanupComments");function tN(t){const e=t.match(x);if(!e)return{text:t,metadata:{}};let n=Um(e[1],{schema:zm})??{};n="object"!=typeof n||Array.isArray(n)?{}:n;const r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:t.slice(e[0].length),metadata:r}}s(tN,"extractFrontMatter");var eN=s((t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,((t,e,n)=>"<"+e+n.replace(/="([^"]*)"/g,"='$1'")+">"))),"cleanupText"),nN=s((t=>{const{text:e,metadata:n}=tN(t),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||(a.gantt={}),a.gantt.displayMode=r),{title:i,config:a,text:e}}),"processFrontmatter"),rN=s((t=>{const e=yk.detectInit(t)??{},n=yk.detectDirective(t,"wrap");return Array.isArray(n)?e.wrap=n.some((({type:t})=>"wrap"===t)):"wrap"===n?.type&&(e.wrap=!0),{text:zw(t),directive:e}}),"processDirectives");function iN(t){const e=eN(t),n=nN(e),r=rN(n.text),i=mk(n.config,r.directive);return{code:t=JL(r.text),title:n.title,config:i}}function aN(t){const e=(new TextEncoder).encode(t),n=Array.from(e,(t=>String.fromCodePoint(t))).join("");return btoa(n)}s(iN,"preprocessDiagram"),s(aN,"toBase64");var sN=["foreignobject"],oN=["dominant-baseline"];function lN(t){const e=iN(t);return Gt(),Ut(e.config??{}),e}async function cN(t,e){oL();try{const{code:e,config:n}=lN(t);return{diagramType:(await bN(e)).type,config:n}}catch(t){if(e?.suppressErrors)return!1;throw t}}s(lN,"processAndSetConfigs"),s(cN,"parse");var hN=s(((t,e,n=[])=>`\n.${t} ${e} { ${n.join(" !important; ")} !important; }`),"cssImportantStyles"),uN=s(((t,e=new Map)=>{let n="";if(void 0!==t.themeCSS&&(n+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(n+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(n+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const r=["> *","span"],i=["rect","polygon","ellipse","circle","path"],a=t.htmlLabels??t.flowchart?.htmlLabels?r:i;e.forEach((t=>{bA(t.styles)||a.forEach((e=>{n+=hN(t.id,e,t.styles)})),bA(t.textStyles)||(n+=hN(t.id,"tspan",(t?.textStyles||[]).map((t=>t.replace("color","fill")))))}))}return n}),"createCssStyles"),dN=s(((t,e,n,r)=>{const i=uN(t,n);return WL(UL(`${r}{${Mn(e,i,t.themeVariables)}}`),HL)}),"createUserStyles"),pN=s(((t="",e,n)=>{let r=t;return n||e||(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),r=xk(r),r=r.replace(/
    /g,"
    "),r}),"cleanUpSvgCode"),gN=s(((t="",e)=>``),"putIntoIFrame"),fN=s(((t,e,n,r,i)=>{const a=t.append("div");a.attr("id",n),r&&a.attr("style",r);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return i&&s.attr("xmlns:xlink",i),s.append("g"),t}),"appendDivSvgG");function mN(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}s(mN,"sandboxedIframe");var yN=s(((t,e,n,r)=>{t.getElementById(e)?.remove(),t.getElementById(n)?.remove(),t.getElementById(r)?.remove()}),"removeExistingElements"),vN=s((async function(t,e,n){oL();const r=lN(e);e=r.code;const i=Ft();m.debug(i),e.length>(i?.maxTextSize??5e4)&&(e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const a="#"+t,o="i"+t,l="#"+o,c="d"+t,h="#"+c,u=s((()=>{const t=Oa(p?l:h).node();t&&"remove"in t&&t.remove()}),"removeTempElements");let d=Oa("body");const p="sandbox"===i.securityLevel,g="loose"===i.securityLevel,f=i.fontFamily;if(void 0!==n){if(n&&(n.innerHTML=""),p){const t=mN(Oa(n),o);d=Oa(t.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Oa(n);fN(d,t,c,`font-family: ${f}`,"http://www.w3.org/1999/xlink")}else{if(yN(document,t,c,o),p){const t=mN(Oa("body"),o);d=Oa(t.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Oa("body");fN(d,t,c)}let y,v;try{y=await KL.fromText(e,{title:r.title})}catch(t){if(i.suppressErrorRendering)throw u(),t;y=await KL.fromText("error"),v=t}const x=d.select(h).node(),b=y.type,w=x.firstChild,k=w.firstChild,T=y.renderer.getClasses?.(e,y),_=dN(i,b,T,a),E=document.createElement("style");E.innerHTML=_,w.insertBefore(E,k);try{await y.renderer.draw(e,t,"11.4.1",y)}catch(n){throw i.suppressErrorRendering?u():VA.draw(e,t,"11.4.1"),n}const C=d.select(`${h} svg`),S=y.db.getAccTitle?.(),A=y.db.getAccDescription?.();wN(b,C,S,A),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let L=d.select(h).node().innerHTML;if(m.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),L=pN(L,p,dn(i.arrowMarkerAbsolute)),p){const t=d.select(h+" svg").node();L=gN(L,t)}else g||(L=Ze.sanitize(L,{ADD_TAGS:sN,ADD_ATTR:oN,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(QL(),v)throw v;return u(),{diagramType:b,svg:L,bindFunctions:y.db.bindFunctions}}),"render");function xN(t={}){const e=L({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Ot(e),e?.theme&&e.theme in wt?e.themeVariables=wt[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=wt.default.getThemeVariables(e.themeVariables));const n="object"==typeof e?Dt(e):Bt();y(n.logLevel),oL()}s(xN,"initialize");var bN=s(((t,e={})=>{const{code:n}=iN(t);return KL.fromText(n,e)}),"getDiagramFromText");function wN(t,e,n,r){VL(e,t),XL(e,n,r,e.attr("id"))}s(wN,"addA11yInfo");var kN=Object.freeze({render:vN,parse:cN,getDiagramFromText:bN,initialize:xN,getConfig:Ft,setConfig:$t,getSiteConfig:Bt,updateSiteConfig:Pt,reset:s((()=>{Gt()}),"reset"),globalReset:s((()=>{Gt(Lt)}),"globalReset"),defaultConfig:Lt});y(Ft().logLevel),Gt(Ft());var TN=s(((t,e,n)=>{m.warn(t),pk(t)?(n&&n(t.str,t.hash),e.push({...t,message:t.str,error:t})):(n&&n(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))}),"handleError"),_N=s((async function(t={querySelector:".mermaid"}){try{await EN(t)}catch(e){if(pk(e)&&m.error(e.str),PN.parseError&&PN.parseError(e),!t.suppressErrors)throw m.error("Use the suppressErrors option to suppress these errors"),e}}),"run"),EN=s((async function({postRenderCallback:t,querySelector:e,nodes:n}={querySelector:".mermaid"}){const r=kN.getConfig();let i;if(m.debug((t?"":"No ")+"Callback function found"),n)i=n;else{if(!e)throw new Error("Nodes and querySelector are both undefined");i=document.querySelectorAll(e)}m.debug(`Found ${i.length} diagrams`),void 0!==r?.startOnLoad&&(m.debug("Start On Load: "+r?.startOnLoad),kN.updateSiteConfig({startOnLoad:r?.startOnLoad}));const a=new yk.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed);let s;const o=[];for(const e of Array.from(i)){if(m.info("Rendering diagram: "+e.id),e.getAttribute("data-processed"))continue;e.setAttribute("data-processed","true");const n=`mermaid-${a.next()}`;s=e.innerHTML,s=kk(yk.entityDecode(s)).trim().replace(//gi,"
    ");const r=yk.detectInit(s);r&&m.debug("Detected early reinit: ",r);try{const{svg:r,bindFunctions:i}=await ON(n,s,e);e.innerHTML=r,t&&await t(n),i&&i(e)}catch(t){TN(t,o,PN.parseError)}}if(o.length>0)throw o[0]}),"runThrowsErrors"),CN=s((function(t){kN.initialize(t)}),"initialize"),SN=s((async function(t,e,n){m.warn("mermaid.init is deprecated. Please use run instead."),t&&CN(t);const r={postRenderCallback:n,querySelector:".mermaid"};"string"==typeof e?r.querySelector=e:e&&(e instanceof HTMLElement?r.nodes=[e]:r.nodes=e),await _N(r)}),"init"),AN=s((async(t,{lazyLoad:e=!0}={})=>{oL(),E(...t),!1===e&&await lL()}),"registerExternalDiagrams"),LN=s((function(){if(PN.startOnLoad){const{startOnLoad:t}=kN.getConfig();t&&PN.run().catch((t=>m.error("Mermaid failed to initialize",t)))}}),"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",LN,!1);var NN=s((function(t){PN.parseError=t}),"setParseErrorHandler"),IN=[],MN=!1,RN=s((async()=>{if(!MN){for(MN=!0;IN.length>0;){const t=IN.shift();if(t)try{await t()}catch(t){m.error("Error executing queue",t)}}MN=!1}}),"executeQueue"),DN=s((async(t,e)=>new Promise(((n,r)=>{const i=s((()=>new Promise(((i,a)=>{kN.parse(t,e).then((t=>{i(t),n(t)}),(t=>{m.error("Error parsing",t),PN.parseError?.(t),a(t),r(t)}))}))),"performCall");IN.push(i),RN().catch(r)}))),"parse"),ON=s(((t,e,n)=>new Promise(((r,i)=>{const a=s((()=>new Promise(((a,s)=>{kN.render(t,e,n).then((t=>{a(t),r(t)}),(t=>{m.error("Error parsing",t),PN.parseError?.(t),s(t),i(t)}))}))),"performCall");IN.push(a),RN().catch(i)}))),"render"),PN={startOnLoad:!0,mermaidAPI:kN,parse:DN,render:ON,init:SN,run:_N,registerExternalDiagrams:AN,registerLayoutLoaders:tA,initialize:CN,parseError:void 0,contentLoaded:LN,setParseErrorHandler:NN,detectType:_,registerIconPacks:ky},BN=PN;function $N(t){let{beforeRender:e,afterRender:n}=t;return function(t){ /*! Check if previously processed */ /*! * Wait for document loaded before starting the execution */ /*! * reveal.js Mermaid plugin */ return async function(t){let{el:e,beforeRender:n,afterRender:r}=t;if(!1===await(null==n?void 0:n(e)))return;const i=e.textContent.trim();try{const{svg:t}=await BN.render(`mermaid-${Math.random().toString(36).substring(2)}`,i);e.innerHTML=t,await(null==r?void 0:r(e))}catch(t){let n="";null!=t&&t.str&&(n=t.str),null!=t&&t.message&&(n=t.message),console.error(n,{error:t,graphDefinition:i,el:e}),e.innerHTML=n}}({el:t,beforeRender:e,afterRender:n})}}const FN={id:"mermaid",init:function(t){const{...e}=t.getConfig().mermaid||{},{...n}=t.getConfig().mermaidPlugin||{},r=$N({beforeRender:n.beforeRender,afterRender:n.afterRender});BN.initialize({startOnLoad:!1,...e});const i=t.getRevealElement().querySelectorAll(".mermaid");Array.from(i).forEach((function(t){r(t)}))}};var zN=()=>FN,UN=class t{static{s(this,"SourceLocation")}constructor(t,e,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=e,this.end=n}static range(e,n){return n?e&&e.loc&&n.loc&&e.loc.lexer===n.loc.lexer?new t(e.loc.lexer,e.loc.start,n.loc.end):null:e&&e.loc}},GN=class t{static{s(this,"Token")}constructor(t,e){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=e}range(e,n){return new t(n,UN.range(this,e))}},qN=class t{static{s(this,"ParseError")}constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r,i,a="KaTeX parse error: "+e,s=n&&n.loc;if(s&&s.start<=s.end){var o=s.lexer.input;r=s.start,i=s.end,r===o.length?a+=" at end of input: ":a+=" at position "+(r+1)+": ";var l=o.slice(r,i).replace(/[^]/g,"$&̲");a+=(r>15?"…"+o.slice(r-15,r):o.slice(0,r))+l+(i+15":">","<":"<",'"':""","'":"'"},XN=/[&><"']/g;function KN(t){return String(t).replace(XN,(t=>VN[t]))}s(KN,"escape");var ZN=s((function t(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?t(e.body[0]):e:"font"===e.type?t(e.body):e}),"getBaseElem"),QN=s((function(t){var e=ZN(t);return"mathord"===e.type||"textord"===e.type||"atom"===e.type}),"isCharacterBox"),JN=s((function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t}),"assert"),tI={contains:jN,deflt:YN,escape:KN,hyphenate:HN,getBaseElem:ZN,isCharacterBox:QN,protocolFromUrl:s((function(t){var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?":"!==e[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?e[1].toLowerCase():null:"_relative"}),"protocolFromUrl")},eI={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:s((t=>"#"+t),"cliProcessor")},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:s(((t,e)=>(e.push(t),e)),"cliProcessor")},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:s((t=>Math.max(0,t)),"processor"),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:s((t=>Math.max(0,t)),"processor"),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:s((t=>Math.max(0,t)),"processor"),cli:"-e, --max-expand ",cliProcessor:s((t=>"Infinity"===t?1/0:parseInt(t)),"cliProcessor")},globalGroup:{type:"boolean",cli:!1}};function nI(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}s(nI,"getDefaultValue");var rI=class{static{s(this,"Settings")}constructor(t){for(var e in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{},eI)if(eI.hasOwnProperty(e)){var n=eI[e];this[e]=void 0!==t[e]?n.processor?n.processor(t[e]):t[e]:nI(n)}}reportNonstrict(t,e,n){var r=this.strict;if("function"==typeof r&&(r=r(t,e,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new qN("LaTeX-incompatible input and strict mode is set to 'error': "+e+" ["+t+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+e+" ["+t+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+e+" ["+t+"]")}}useStrictBehavior(t,e,n){var r=this.strict;if("function"==typeof r)try{r=r(t,e,n)}catch(t){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+e+" ["+t+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+e+" ["+t+"]"),!1)))}isTrusted(t){if(t.url&&!t.protocol){var e=tI.protocolFromUrl(t.url);if(null==e)return!1;t.protocol=e}var n="function"==typeof this.trust?this.trust(t):this.trust;return Boolean(n)}},iI=class{static{s(this,"Style")}constructor(t,e,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=e,this.cramped=n}sup(){return aI[sI[this.id]]}sub(){return aI[oI[this.id]]}fracNum(){return aI[lI[this.id]]}fracDen(){return aI[cI[this.id]]}cramp(){return aI[hI[this.id]]}text(){return aI[uI[this.id]]}isTight(){return this.size>=2}},aI=[new iI(0,0,!1),new iI(1,0,!0),new iI(2,1,!1),new iI(3,1,!0),new iI(4,2,!1),new iI(5,2,!0),new iI(6,3,!1),new iI(7,3,!0)],sI=[4,5,4,5,6,7,6,7],oI=[5,5,5,5,7,7,7,7],lI=[2,3,4,5,6,7,6,7],cI=[3,3,5,5,7,7,7,7],hI=[1,1,3,3,5,5,7,7],uI=[0,1,2,3,2,3,2,3],dI={DISPLAY:aI[0],TEXT:aI[2],SCRIPT:aI[4],SCRIPTSCRIPT:aI[6]},pI=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function gI(t){for(var e=0;e=i[0]&&t<=i[1])return n.name}return null}s(gI,"scriptFromCodepoint");var fI=[];function mI(t){for(var e=0;e=fI[e]&&t<=fI[e+1])return!0;return!1}pI.forEach((t=>t.blocks.forEach((t=>fI.push(...t))))),s(mI,"supportedCodepoint");var yI=s((function(t,e){return"M95,"+(622+t+e)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+t/2.075+" -"+t+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+t)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtMain"),vI=s((function(t,e){return"M263,"+(601+t+e)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+t/2.084+" -"+t+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+t)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtSize1"),xI=s((function(t,e){return"M983 "+(10+t+e)+"\nl"+t/3.13+" -"+t+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+t)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtSize2"),bI=s((function(t,e){return"M424,"+(2398+t+e)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+t/4.223+" -"+t+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+t)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+t)+" "+e+"\nh400000v"+(40+t)+"h-400000z"}),"sqrtSize3"),wI=s((function(t,e){return"M473,"+(2713+t+e)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+t/5.298+" -"+t+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+t)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+t)+" "+e+"h400000v"+(40+t)+"H1017.7z"}),"sqrtSize4"),kI=s((function(t){return"M400000 "+t+" H0 L"+t/2+" 0 l65 45 L145 "+(t-80)+" H400000z"}),"phasePath"),TI=s((function(t,e,n){return"M702 "+(t+e)+"H400000"+(40+t)+"\nH742v"+(n-54-e-t)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+e+"H400000v"+(40+t)+"H742z"}),"sqrtTall"),_I=s((function(t,e,n){e*=1e3;var r="";switch(t){case"sqrtMain":r=yI(e,80);break;case"sqrtSize1":r=vI(e,80);break;case"sqrtSize2":r=xI(e,80);break;case"sqrtSize3":r=bI(e,80);break;case"sqrtSize4":r=wI(e,80);break;case"sqrtTall":r=TI(e,80,n)}return r}),"sqrtPath"),EI=s((function(t,e){switch(t){case"⎜":return"M291 0 H417 V"+e+" H291z M291 0 H417 V"+e+" H291z";case"∣":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145z";case"∥":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145zM367 0 H410 V"+e+" H367z M367 0 H410 V"+e+" H367z";case"⎟":return"M457 0 H583 V"+e+" H457z M457 0 H583 V"+e+" H457z";case"⎢":return"M319 0 H403 V"+e+" H319z M319 0 H403 V"+e+" H319z";case"⎥":return"M263 0 H347 V"+e+" H263z M263 0 H347 V"+e+" H263z";case"⎪":return"M384 0 H504 V"+e+" H384z M384 0 H504 V"+e+" H384z";case"⏐":return"M312 0 H355 V"+e+" H312z M312 0 H355 V"+e+" H312z";case"‖":return"M257 0 H300 V"+e+" H257z M257 0 H300 V"+e+" H257zM478 0 H521 V"+e+" H478z M478 0 H521 V"+e+" H478z";default:return""}}),"innerPath"),CI={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},SI=s((function(t,e){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+e+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+e+" v1759 h84z";case"vert":return"M145 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+e+" v585 h43z";case"doublevert":return"M145 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+e+" v585 h43z\nM367 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+e+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+e+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+e+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+e+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+e+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+" v602 h84z\nM403 1759 V0 H319 V1759 v"+e+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+e+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(e+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(e+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(e+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(e+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}),"tallDelim"),AI=class{static{s(this,"DocumentFragment")}constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return tI.contains(this.classes,t)}toNode(){for(var t=document.createDocumentFragment(),e=0;et.toText()),"toText");return this.children.map(t).join("")}},LI={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},NI={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},II={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function MI(t,e){LI[t]=e}function RI(t,e,n){if(!LI[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),i=LI[e][r];if(!i&&t[0]in II&&(r=II[t[0]].charCodeAt(0),i=LI[e][r]),i||"text"!==n||mI(r)&&(i=LI[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}s(MI,"setFontMetrics"),s(RI,"getCharacterMetrics");var DI={};function OI(t){var e;if(!DI[e=t>=5?0:t>=3?1:2]){var n=DI[e]={cssEmPerMu:NI.quad[e]/18};for(var r in NI)NI.hasOwnProperty(r)&&(n[r]=NI[r][e])}return DI[e]}s(OI,"getGlobalMetrics");var PI=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],BI=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],$I=s((function(t,e){return e.size<2?t:PI[t-1][e.size-1]}),"sizeAtStyle"),FI=class t{static{s(this,"Options")}constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||t.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=BI[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new t(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:$I(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:BI[t-1]})}havingBaseStyle(e){e=e||this.style.text();var n=$I(t.BASESIZE,e);return this.size===n&&this.textSize===t.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==t.BASESIZE?["sizing","reset-size"+this.size,"size"+t.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=OI(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};FI.BASESIZE=6;var zI={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},UI={ex:!0,em:!0,mu:!0},GI=s((function(t){return"string"!=typeof t&&(t=t.unit),t in zI||t in UI||"ex"===t}),"validUnit"),qI=s((function(t,e){var n;if(t.unit in zI)n=zI[t.unit]/e.fontMetrics().ptPerEm/e.sizeMultiplier;else if("mu"===t.unit)n=e.fontMetrics().cssEmPerMu;else{var r;if(r=e.style.isTight()?e.havingStyle(e.style.text()):e,"ex"===t.unit)n=r.fontMetrics().xHeight;else{if("em"!==t.unit)throw new qN("Invalid unit: '"+t.unit+"'");n=r.fontMetrics().quad}r!==e&&(n*=r.sizeMultiplier/e.sizeMultiplier)}return Math.min(t.number*n,e.maxSize)}),"calculateSize"),jI=s((function(t){return+t.toFixed(4)+"em"}),"makeEm"),YI=s((function(t){return t.filter((t=>t)).join(" ")}),"createClass"),WI=s((function(t,e,n){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},e){e.style.isTight()&&this.classes.push("mtight");var r=e.getColor();r&&(this.style.color=r)}}),"initNode"),HI=s((function(t){var e=document.createElement(t);for(var n in e.className=YI(this.classes),this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&e.setAttribute(r,this.attributes[r]);for(var i=0;i"}),"toMarkup"),XI=class{static{s(this,"Span")}constructor(t,e,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,WI.call(this,t,n,r),this.children=e||[]}setAttribute(t,e){this.attributes[t]=e}hasClass(t){return tI.contains(this.classes,t)}toNode(){return HI.call(this,"span")}toMarkup(){return VI.call(this,"span")}},KI=class{static{s(this,"Anchor")}constructor(t,e,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,WI.call(this,e,r),this.children=n||[],this.setAttribute("href",t)}setAttribute(t,e){this.attributes[t]=e}hasClass(t){return tI.contains(this.classes,t)}toNode(){return HI.call(this,"a")}toMarkup(){return VI.call(this,"a")}},ZI=class{static{s(this,"Img")}constructor(t,e,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=e,this.src=t,this.classes=["mord"],this.style=n}hasClass(t){return tI.contains(this.classes,t)}toNode(){var t=document.createElement("img");for(var e in t.src=this.src,t.alt=this.alt,t.className="mord",this.style)this.style.hasOwnProperty(e)&&(t.style[e]=this.style[e]);return t}toMarkup(){var t=''+tI.escape(this.alt)+'0&&((e=document.createElement("span")).style.marginRight=jI(this.italic)),this.classes.length>0&&((e=e||document.createElement("span")).className=YI(this.classes)),this.style)this.style.hasOwnProperty(n)&&((e=e||document.createElement("span")).style[n]=this.style[n]);return e?(e.appendChild(t),e):t}toMarkup(){var t=!1,e="0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=tI.hyphenate(r)+":"+this.style[r]+";");n&&(t=!0,e+=' style="'+tI.escape(n)+'"');var i=tI.escape(this.text);return t?(e+=">",e+=i,e+=""):i}},tM=class{static{s(this,"SvgNode")}constructor(t,e){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=e||{}}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);for(var n=0;n':''}},nM=class{static{s(this,"LineNode")}constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","line");for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);return t}toMarkup(){var t=" but got "+String(t)+".")}s(rM,"assertSymbolDomNode"),s(iM,"assertSpan");var aM={bin:1,close:1,inner:1,open:1,punct:1,rel:1},sM={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},oM={math:{},text:{}};function lM(t,e,n,r,i,a){oM[t][i]={font:e,group:n,replace:r},a&&r&&(oM[t][r]=oM[t][i])}s(lM,"defineSymbol");var cM="math",hM="text",uM="main",dM="ams",pM="accent-token",gM="bin",fM="close",mM="mathord",yM="op-token",vM="open",xM="rel",bM="textord";lM(cM,uM,xM,"≡","\\equiv",!0),lM(cM,uM,xM,"≺","\\prec",!0),lM(cM,uM,xM,"≻","\\succ",!0),lM(cM,uM,xM,"∼","\\sim",!0),lM(cM,uM,xM,"⊥","\\perp"),lM(cM,uM,xM,"⪯","\\preceq",!0),lM(cM,uM,xM,"⪰","\\succeq",!0),lM(cM,uM,xM,"≃","\\simeq",!0),lM(cM,uM,xM,"∣","\\mid",!0),lM(cM,uM,xM,"≪","\\ll",!0),lM(cM,uM,xM,"≫","\\gg",!0),lM(cM,uM,xM,"≍","\\asymp",!0),lM(cM,uM,xM,"∥","\\parallel"),lM(cM,uM,xM,"⋈","\\bowtie",!0),lM(cM,uM,xM,"⌣","\\smile",!0),lM(cM,uM,xM,"⊑","\\sqsubseteq",!0),lM(cM,uM,xM,"⊒","\\sqsupseteq",!0),lM(cM,uM,xM,"≐","\\doteq",!0),lM(cM,uM,xM,"⌢","\\frown",!0),lM(cM,uM,xM,"∋","\\ni",!0),lM(cM,uM,xM,"∝","\\propto",!0),lM(cM,uM,xM,"⊢","\\vdash",!0),lM(cM,uM,xM,"⊣","\\dashv",!0),lM(cM,uM,xM,"∋","\\owns"),lM(cM,uM,"punct",".","\\ldotp"),lM(cM,uM,"punct","⋅","\\cdotp"),lM(cM,uM,bM,"#","\\#"),lM(hM,uM,bM,"#","\\#"),lM(cM,uM,bM,"&","\\&"),lM(hM,uM,bM,"&","\\&"),lM(cM,uM,bM,"ℵ","\\aleph",!0),lM(cM,uM,bM,"∀","\\forall",!0),lM(cM,uM,bM,"ℏ","\\hbar",!0),lM(cM,uM,bM,"∃","\\exists",!0),lM(cM,uM,bM,"∇","\\nabla",!0),lM(cM,uM,bM,"♭","\\flat",!0),lM(cM,uM,bM,"ℓ","\\ell",!0),lM(cM,uM,bM,"♮","\\natural",!0),lM(cM,uM,bM,"♣","\\clubsuit",!0),lM(cM,uM,bM,"℘","\\wp",!0),lM(cM,uM,bM,"♯","\\sharp",!0),lM(cM,uM,bM,"♢","\\diamondsuit",!0),lM(cM,uM,bM,"ℜ","\\Re",!0),lM(cM,uM,bM,"♡","\\heartsuit",!0),lM(cM,uM,bM,"ℑ","\\Im",!0),lM(cM,uM,bM,"♠","\\spadesuit",!0),lM(cM,uM,bM,"§","\\S",!0),lM(hM,uM,bM,"§","\\S"),lM(cM,uM,bM,"¶","\\P",!0),lM(hM,uM,bM,"¶","\\P"),lM(cM,uM,bM,"†","\\dag"),lM(hM,uM,bM,"†","\\dag"),lM(hM,uM,bM,"†","\\textdagger"),lM(cM,uM,bM,"‡","\\ddag"),lM(hM,uM,bM,"‡","\\ddag"),lM(hM,uM,bM,"‡","\\textdaggerdbl"),lM(cM,uM,fM,"⎱","\\rmoustache",!0),lM(cM,uM,vM,"⎰","\\lmoustache",!0),lM(cM,uM,fM,"⟯","\\rgroup",!0),lM(cM,uM,vM,"⟮","\\lgroup",!0),lM(cM,uM,gM,"∓","\\mp",!0),lM(cM,uM,gM,"⊖","\\ominus",!0),lM(cM,uM,gM,"⊎","\\uplus",!0),lM(cM,uM,gM,"⊓","\\sqcap",!0),lM(cM,uM,gM,"∗","\\ast"),lM(cM,uM,gM,"⊔","\\sqcup",!0),lM(cM,uM,gM,"◯","\\bigcirc",!0),lM(cM,uM,gM,"∙","\\bullet",!0),lM(cM,uM,gM,"‡","\\ddagger"),lM(cM,uM,gM,"≀","\\wr",!0),lM(cM,uM,gM,"⨿","\\amalg"),lM(cM,uM,gM,"&","\\And"),lM(cM,uM,xM,"⟵","\\longleftarrow",!0),lM(cM,uM,xM,"⇐","\\Leftarrow",!0),lM(cM,uM,xM,"⟸","\\Longleftarrow",!0),lM(cM,uM,xM,"⟶","\\longrightarrow",!0),lM(cM,uM,xM,"⇒","\\Rightarrow",!0),lM(cM,uM,xM,"⟹","\\Longrightarrow",!0),lM(cM,uM,xM,"↔","\\leftrightarrow",!0),lM(cM,uM,xM,"⟷","\\longleftrightarrow",!0),lM(cM,uM,xM,"⇔","\\Leftrightarrow",!0),lM(cM,uM,xM,"⟺","\\Longleftrightarrow",!0),lM(cM,uM,xM,"↦","\\mapsto",!0),lM(cM,uM,xM,"⟼","\\longmapsto",!0),lM(cM,uM,xM,"↗","\\nearrow",!0),lM(cM,uM,xM,"↩","\\hookleftarrow",!0),lM(cM,uM,xM,"↪","\\hookrightarrow",!0),lM(cM,uM,xM,"↘","\\searrow",!0),lM(cM,uM,xM,"↼","\\leftharpoonup",!0),lM(cM,uM,xM,"⇀","\\rightharpoonup",!0),lM(cM,uM,xM,"↙","\\swarrow",!0),lM(cM,uM,xM,"↽","\\leftharpoondown",!0),lM(cM,uM,xM,"⇁","\\rightharpoondown",!0),lM(cM,uM,xM,"↖","\\nwarrow",!0),lM(cM,uM,xM,"⇌","\\rightleftharpoons",!0),lM(cM,dM,xM,"≮","\\nless",!0),lM(cM,dM,xM,"","\\@nleqslant"),lM(cM,dM,xM,"","\\@nleqq"),lM(cM,dM,xM,"⪇","\\lneq",!0),lM(cM,dM,xM,"≨","\\lneqq",!0),lM(cM,dM,xM,"","\\@lvertneqq"),lM(cM,dM,xM,"⋦","\\lnsim",!0),lM(cM,dM,xM,"⪉","\\lnapprox",!0),lM(cM,dM,xM,"⊀","\\nprec",!0),lM(cM,dM,xM,"⋠","\\npreceq",!0),lM(cM,dM,xM,"⋨","\\precnsim",!0),lM(cM,dM,xM,"⪹","\\precnapprox",!0),lM(cM,dM,xM,"≁","\\nsim",!0),lM(cM,dM,xM,"","\\@nshortmid"),lM(cM,dM,xM,"∤","\\nmid",!0),lM(cM,dM,xM,"⊬","\\nvdash",!0),lM(cM,dM,xM,"⊭","\\nvDash",!0),lM(cM,dM,xM,"⋪","\\ntriangleleft"),lM(cM,dM,xM,"⋬","\\ntrianglelefteq",!0),lM(cM,dM,xM,"⊊","\\subsetneq",!0),lM(cM,dM,xM,"","\\@varsubsetneq"),lM(cM,dM,xM,"⫋","\\subsetneqq",!0),lM(cM,dM,xM,"","\\@varsubsetneqq"),lM(cM,dM,xM,"≯","\\ngtr",!0),lM(cM,dM,xM,"","\\@ngeqslant"),lM(cM,dM,xM,"","\\@ngeqq"),lM(cM,dM,xM,"⪈","\\gneq",!0),lM(cM,dM,xM,"≩","\\gneqq",!0),lM(cM,dM,xM,"","\\@gvertneqq"),lM(cM,dM,xM,"⋧","\\gnsim",!0),lM(cM,dM,xM,"⪊","\\gnapprox",!0),lM(cM,dM,xM,"⊁","\\nsucc",!0),lM(cM,dM,xM,"⋡","\\nsucceq",!0),lM(cM,dM,xM,"⋩","\\succnsim",!0),lM(cM,dM,xM,"⪺","\\succnapprox",!0),lM(cM,dM,xM,"≆","\\ncong",!0),lM(cM,dM,xM,"","\\@nshortparallel"),lM(cM,dM,xM,"∦","\\nparallel",!0),lM(cM,dM,xM,"⊯","\\nVDash",!0),lM(cM,dM,xM,"⋫","\\ntriangleright"),lM(cM,dM,xM,"⋭","\\ntrianglerighteq",!0),lM(cM,dM,xM,"","\\@nsupseteqq"),lM(cM,dM,xM,"⊋","\\supsetneq",!0),lM(cM,dM,xM,"","\\@varsupsetneq"),lM(cM,dM,xM,"⫌","\\supsetneqq",!0),lM(cM,dM,xM,"","\\@varsupsetneqq"),lM(cM,dM,xM,"⊮","\\nVdash",!0),lM(cM,dM,xM,"⪵","\\precneqq",!0),lM(cM,dM,xM,"⪶","\\succneqq",!0),lM(cM,dM,xM,"","\\@nsubseteqq"),lM(cM,dM,gM,"⊴","\\unlhd"),lM(cM,dM,gM,"⊵","\\unrhd"),lM(cM,dM,xM,"↚","\\nleftarrow",!0),lM(cM,dM,xM,"↛","\\nrightarrow",!0),lM(cM,dM,xM,"⇍","\\nLeftarrow",!0),lM(cM,dM,xM,"⇏","\\nRightarrow",!0),lM(cM,dM,xM,"↮","\\nleftrightarrow",!0),lM(cM,dM,xM,"⇎","\\nLeftrightarrow",!0),lM(cM,dM,xM,"△","\\vartriangle"),lM(cM,dM,bM,"ℏ","\\hslash"),lM(cM,dM,bM,"▽","\\triangledown"),lM(cM,dM,bM,"◊","\\lozenge"),lM(cM,dM,bM,"Ⓢ","\\circledS"),lM(cM,dM,bM,"®","\\circledR"),lM(hM,dM,bM,"®","\\circledR"),lM(cM,dM,bM,"∡","\\measuredangle",!0),lM(cM,dM,bM,"∄","\\nexists"),lM(cM,dM,bM,"℧","\\mho"),lM(cM,dM,bM,"Ⅎ","\\Finv",!0),lM(cM,dM,bM,"⅁","\\Game",!0),lM(cM,dM,bM,"‵","\\backprime"),lM(cM,dM,bM,"▲","\\blacktriangle"),lM(cM,dM,bM,"▼","\\blacktriangledown"),lM(cM,dM,bM,"■","\\blacksquare"),lM(cM,dM,bM,"⧫","\\blacklozenge"),lM(cM,dM,bM,"★","\\bigstar"),lM(cM,dM,bM,"∢","\\sphericalangle",!0),lM(cM,dM,bM,"∁","\\complement",!0),lM(cM,dM,bM,"ð","\\eth",!0),lM(hM,uM,bM,"ð","ð"),lM(cM,dM,bM,"╱","\\diagup"),lM(cM,dM,bM,"╲","\\diagdown"),lM(cM,dM,bM,"□","\\square"),lM(cM,dM,bM,"□","\\Box"),lM(cM,dM,bM,"◊","\\Diamond"),lM(cM,dM,bM,"¥","\\yen",!0),lM(hM,dM,bM,"¥","\\yen",!0),lM(cM,dM,bM,"✓","\\checkmark",!0),lM(hM,dM,bM,"✓","\\checkmark"),lM(cM,dM,bM,"ℶ","\\beth",!0),lM(cM,dM,bM,"ℸ","\\daleth",!0),lM(cM,dM,bM,"ℷ","\\gimel",!0),lM(cM,dM,bM,"ϝ","\\digamma",!0),lM(cM,dM,bM,"ϰ","\\varkappa"),lM(cM,dM,vM,"┌","\\@ulcorner",!0),lM(cM,dM,fM,"┐","\\@urcorner",!0),lM(cM,dM,vM,"└","\\@llcorner",!0),lM(cM,dM,fM,"┘","\\@lrcorner",!0),lM(cM,dM,xM,"≦","\\leqq",!0),lM(cM,dM,xM,"⩽","\\leqslant",!0),lM(cM,dM,xM,"⪕","\\eqslantless",!0),lM(cM,dM,xM,"≲","\\lesssim",!0),lM(cM,dM,xM,"⪅","\\lessapprox",!0),lM(cM,dM,xM,"≊","\\approxeq",!0),lM(cM,dM,gM,"⋖","\\lessdot"),lM(cM,dM,xM,"⋘","\\lll",!0),lM(cM,dM,xM,"≶","\\lessgtr",!0),lM(cM,dM,xM,"⋚","\\lesseqgtr",!0),lM(cM,dM,xM,"⪋","\\lesseqqgtr",!0),lM(cM,dM,xM,"≑","\\doteqdot"),lM(cM,dM,xM,"≓","\\risingdotseq",!0),lM(cM,dM,xM,"≒","\\fallingdotseq",!0),lM(cM,dM,xM,"∽","\\backsim",!0),lM(cM,dM,xM,"⋍","\\backsimeq",!0),lM(cM,dM,xM,"⫅","\\subseteqq",!0),lM(cM,dM,xM,"⋐","\\Subset",!0),lM(cM,dM,xM,"⊏","\\sqsubset",!0),lM(cM,dM,xM,"≼","\\preccurlyeq",!0),lM(cM,dM,xM,"⋞","\\curlyeqprec",!0),lM(cM,dM,xM,"≾","\\precsim",!0),lM(cM,dM,xM,"⪷","\\precapprox",!0),lM(cM,dM,xM,"⊲","\\vartriangleleft"),lM(cM,dM,xM,"⊴","\\trianglelefteq"),lM(cM,dM,xM,"⊨","\\vDash",!0),lM(cM,dM,xM,"⊪","\\Vvdash",!0),lM(cM,dM,xM,"⌣","\\smallsmile"),lM(cM,dM,xM,"⌢","\\smallfrown"),lM(cM,dM,xM,"≏","\\bumpeq",!0),lM(cM,dM,xM,"≎","\\Bumpeq",!0),lM(cM,dM,xM,"≧","\\geqq",!0),lM(cM,dM,xM,"⩾","\\geqslant",!0),lM(cM,dM,xM,"⪖","\\eqslantgtr",!0),lM(cM,dM,xM,"≳","\\gtrsim",!0),lM(cM,dM,xM,"⪆","\\gtrapprox",!0),lM(cM,dM,gM,"⋗","\\gtrdot"),lM(cM,dM,xM,"⋙","\\ggg",!0),lM(cM,dM,xM,"≷","\\gtrless",!0),lM(cM,dM,xM,"⋛","\\gtreqless",!0),lM(cM,dM,xM,"⪌","\\gtreqqless",!0),lM(cM,dM,xM,"≖","\\eqcirc",!0),lM(cM,dM,xM,"≗","\\circeq",!0),lM(cM,dM,xM,"≜","\\triangleq",!0),lM(cM,dM,xM,"∼","\\thicksim"),lM(cM,dM,xM,"≈","\\thickapprox"),lM(cM,dM,xM,"⫆","\\supseteqq",!0),lM(cM,dM,xM,"⋑","\\Supset",!0),lM(cM,dM,xM,"⊐","\\sqsupset",!0),lM(cM,dM,xM,"≽","\\succcurlyeq",!0),lM(cM,dM,xM,"⋟","\\curlyeqsucc",!0),lM(cM,dM,xM,"≿","\\succsim",!0),lM(cM,dM,xM,"⪸","\\succapprox",!0),lM(cM,dM,xM,"⊳","\\vartriangleright"),lM(cM,dM,xM,"⊵","\\trianglerighteq"),lM(cM,dM,xM,"⊩","\\Vdash",!0),lM(cM,dM,xM,"∣","\\shortmid"),lM(cM,dM,xM,"∥","\\shortparallel"),lM(cM,dM,xM,"≬","\\between",!0),lM(cM,dM,xM,"⋔","\\pitchfork",!0),lM(cM,dM,xM,"∝","\\varpropto"),lM(cM,dM,xM,"◀","\\blacktriangleleft"),lM(cM,dM,xM,"∴","\\therefore",!0),lM(cM,dM,xM,"∍","\\backepsilon"),lM(cM,dM,xM,"▶","\\blacktriangleright"),lM(cM,dM,xM,"∵","\\because",!0),lM(cM,dM,xM,"⋘","\\llless"),lM(cM,dM,xM,"⋙","\\gggtr"),lM(cM,dM,gM,"⊲","\\lhd"),lM(cM,dM,gM,"⊳","\\rhd"),lM(cM,dM,xM,"≂","\\eqsim",!0),lM(cM,uM,xM,"⋈","\\Join"),lM(cM,dM,xM,"≑","\\Doteq",!0),lM(cM,dM,gM,"∔","\\dotplus",!0),lM(cM,dM,gM,"∖","\\smallsetminus"),lM(cM,dM,gM,"⋒","\\Cap",!0),lM(cM,dM,gM,"⋓","\\Cup",!0),lM(cM,dM,gM,"⩞","\\doublebarwedge",!0),lM(cM,dM,gM,"⊟","\\boxminus",!0),lM(cM,dM,gM,"⊞","\\boxplus",!0),lM(cM,dM,gM,"⋇","\\divideontimes",!0),lM(cM,dM,gM,"⋉","\\ltimes",!0),lM(cM,dM,gM,"⋊","\\rtimes",!0),lM(cM,dM,gM,"⋋","\\leftthreetimes",!0),lM(cM,dM,gM,"⋌","\\rightthreetimes",!0),lM(cM,dM,gM,"⋏","\\curlywedge",!0),lM(cM,dM,gM,"⋎","\\curlyvee",!0),lM(cM,dM,gM,"⊝","\\circleddash",!0),lM(cM,dM,gM,"⊛","\\circledast",!0),lM(cM,dM,gM,"⋅","\\centerdot"),lM(cM,dM,gM,"⊺","\\intercal",!0),lM(cM,dM,gM,"⋒","\\doublecap"),lM(cM,dM,gM,"⋓","\\doublecup"),lM(cM,dM,gM,"⊠","\\boxtimes",!0),lM(cM,dM,xM,"⇢","\\dashrightarrow",!0),lM(cM,dM,xM,"⇠","\\dashleftarrow",!0),lM(cM,dM,xM,"⇇","\\leftleftarrows",!0),lM(cM,dM,xM,"⇆","\\leftrightarrows",!0),lM(cM,dM,xM,"⇚","\\Lleftarrow",!0),lM(cM,dM,xM,"↞","\\twoheadleftarrow",!0),lM(cM,dM,xM,"↢","\\leftarrowtail",!0),lM(cM,dM,xM,"↫","\\looparrowleft",!0),lM(cM,dM,xM,"⇋","\\leftrightharpoons",!0),lM(cM,dM,xM,"↶","\\curvearrowleft",!0),lM(cM,dM,xM,"↺","\\circlearrowleft",!0),lM(cM,dM,xM,"↰","\\Lsh",!0),lM(cM,dM,xM,"⇈","\\upuparrows",!0),lM(cM,dM,xM,"↿","\\upharpoonleft",!0),lM(cM,dM,xM,"⇃","\\downharpoonleft",!0),lM(cM,uM,xM,"⊶","\\origof",!0),lM(cM,uM,xM,"⊷","\\imageof",!0),lM(cM,dM,xM,"⊸","\\multimap",!0),lM(cM,dM,xM,"↭","\\leftrightsquigarrow",!0),lM(cM,dM,xM,"⇉","\\rightrightarrows",!0),lM(cM,dM,xM,"⇄","\\rightleftarrows",!0),lM(cM,dM,xM,"↠","\\twoheadrightarrow",!0),lM(cM,dM,xM,"↣","\\rightarrowtail",!0),lM(cM,dM,xM,"↬","\\looparrowright",!0),lM(cM,dM,xM,"↷","\\curvearrowright",!0),lM(cM,dM,xM,"↻","\\circlearrowright",!0),lM(cM,dM,xM,"↱","\\Rsh",!0),lM(cM,dM,xM,"⇊","\\downdownarrows",!0),lM(cM,dM,xM,"↾","\\upharpoonright",!0),lM(cM,dM,xM,"⇂","\\downharpoonright",!0),lM(cM,dM,xM,"⇝","\\rightsquigarrow",!0),lM(cM,dM,xM,"⇝","\\leadsto"),lM(cM,dM,xM,"⇛","\\Rrightarrow",!0),lM(cM,dM,xM,"↾","\\restriction"),lM(cM,uM,bM,"‘","`"),lM(cM,uM,bM,"$","\\$"),lM(hM,uM,bM,"$","\\$"),lM(hM,uM,bM,"$","\\textdollar"),lM(cM,uM,bM,"%","\\%"),lM(hM,uM,bM,"%","\\%"),lM(cM,uM,bM,"_","\\_"),lM(hM,uM,bM,"_","\\_"),lM(hM,uM,bM,"_","\\textunderscore"),lM(cM,uM,bM,"∠","\\angle",!0),lM(cM,uM,bM,"∞","\\infty",!0),lM(cM,uM,bM,"′","\\prime"),lM(cM,uM,bM,"△","\\triangle"),lM(cM,uM,bM,"Γ","\\Gamma",!0),lM(cM,uM,bM,"Δ","\\Delta",!0),lM(cM,uM,bM,"Θ","\\Theta",!0),lM(cM,uM,bM,"Λ","\\Lambda",!0),lM(cM,uM,bM,"Ξ","\\Xi",!0),lM(cM,uM,bM,"Π","\\Pi",!0),lM(cM,uM,bM,"Σ","\\Sigma",!0),lM(cM,uM,bM,"Υ","\\Upsilon",!0),lM(cM,uM,bM,"Φ","\\Phi",!0),lM(cM,uM,bM,"Ψ","\\Psi",!0),lM(cM,uM,bM,"Ω","\\Omega",!0),lM(cM,uM,bM,"A","Α"),lM(cM,uM,bM,"B","Β"),lM(cM,uM,bM,"E","Ε"),lM(cM,uM,bM,"Z","Ζ"),lM(cM,uM,bM,"H","Η"),lM(cM,uM,bM,"I","Ι"),lM(cM,uM,bM,"K","Κ"),lM(cM,uM,bM,"M","Μ"),lM(cM,uM,bM,"N","Ν"),lM(cM,uM,bM,"O","Ο"),lM(cM,uM,bM,"P","Ρ"),lM(cM,uM,bM,"T","Τ"),lM(cM,uM,bM,"X","Χ"),lM(cM,uM,bM,"¬","\\neg",!0),lM(cM,uM,bM,"¬","\\lnot"),lM(cM,uM,bM,"⊤","\\top"),lM(cM,uM,bM,"⊥","\\bot"),lM(cM,uM,bM,"∅","\\emptyset"),lM(cM,dM,bM,"∅","\\varnothing"),lM(cM,uM,mM,"α","\\alpha",!0),lM(cM,uM,mM,"β","\\beta",!0),lM(cM,uM,mM,"γ","\\gamma",!0),lM(cM,uM,mM,"δ","\\delta",!0),lM(cM,uM,mM,"ϵ","\\epsilon",!0),lM(cM,uM,mM,"ζ","\\zeta",!0),lM(cM,uM,mM,"η","\\eta",!0),lM(cM,uM,mM,"θ","\\theta",!0),lM(cM,uM,mM,"ι","\\iota",!0),lM(cM,uM,mM,"κ","\\kappa",!0),lM(cM,uM,mM,"λ","\\lambda",!0),lM(cM,uM,mM,"μ","\\mu",!0),lM(cM,uM,mM,"ν","\\nu",!0),lM(cM,uM,mM,"ξ","\\xi",!0),lM(cM,uM,mM,"ο","\\omicron",!0),lM(cM,uM,mM,"π","\\pi",!0),lM(cM,uM,mM,"ρ","\\rho",!0),lM(cM,uM,mM,"σ","\\sigma",!0),lM(cM,uM,mM,"τ","\\tau",!0),lM(cM,uM,mM,"υ","\\upsilon",!0),lM(cM,uM,mM,"ϕ","\\phi",!0),lM(cM,uM,mM,"χ","\\chi",!0),lM(cM,uM,mM,"ψ","\\psi",!0),lM(cM,uM,mM,"ω","\\omega",!0),lM(cM,uM,mM,"ε","\\varepsilon",!0),lM(cM,uM,mM,"ϑ","\\vartheta",!0),lM(cM,uM,mM,"ϖ","\\varpi",!0),lM(cM,uM,mM,"ϱ","\\varrho",!0),lM(cM,uM,mM,"ς","\\varsigma",!0),lM(cM,uM,mM,"φ","\\varphi",!0),lM(cM,uM,gM,"∗","*",!0),lM(cM,uM,gM,"+","+"),lM(cM,uM,gM,"−","-",!0),lM(cM,uM,gM,"⋅","\\cdot",!0),lM(cM,uM,gM,"∘","\\circ",!0),lM(cM,uM,gM,"÷","\\div",!0),lM(cM,uM,gM,"±","\\pm",!0),lM(cM,uM,gM,"×","\\times",!0),lM(cM,uM,gM,"∩","\\cap",!0),lM(cM,uM,gM,"∪","\\cup",!0),lM(cM,uM,gM,"∖","\\setminus",!0),lM(cM,uM,gM,"∧","\\land"),lM(cM,uM,gM,"∨","\\lor"),lM(cM,uM,gM,"∧","\\wedge",!0),lM(cM,uM,gM,"∨","\\vee",!0),lM(cM,uM,bM,"√","\\surd"),lM(cM,uM,vM,"⟨","\\langle",!0),lM(cM,uM,vM,"∣","\\lvert"),lM(cM,uM,vM,"∥","\\lVert"),lM(cM,uM,fM,"?","?"),lM(cM,uM,fM,"!","!"),lM(cM,uM,fM,"⟩","\\rangle",!0),lM(cM,uM,fM,"∣","\\rvert"),lM(cM,uM,fM,"∥","\\rVert"),lM(cM,uM,xM,"=","="),lM(cM,uM,xM,":",":"),lM(cM,uM,xM,"≈","\\approx",!0),lM(cM,uM,xM,"≅","\\cong",!0),lM(cM,uM,xM,"≥","\\ge"),lM(cM,uM,xM,"≥","\\geq",!0),lM(cM,uM,xM,"←","\\gets"),lM(cM,uM,xM,">","\\gt",!0),lM(cM,uM,xM,"∈","\\in",!0),lM(cM,uM,xM,"","\\@not"),lM(cM,uM,xM,"⊂","\\subset",!0),lM(cM,uM,xM,"⊃","\\supset",!0),lM(cM,uM,xM,"⊆","\\subseteq",!0),lM(cM,uM,xM,"⊇","\\supseteq",!0),lM(cM,dM,xM,"⊈","\\nsubseteq",!0),lM(cM,dM,xM,"⊉","\\nsupseteq",!0),lM(cM,uM,xM,"⊨","\\models"),lM(cM,uM,xM,"←","\\leftarrow",!0),lM(cM,uM,xM,"≤","\\le"),lM(cM,uM,xM,"≤","\\leq",!0),lM(cM,uM,xM,"<","\\lt",!0),lM(cM,uM,xM,"→","\\rightarrow",!0),lM(cM,uM,xM,"→","\\to"),lM(cM,dM,xM,"≱","\\ngeq",!0),lM(cM,dM,xM,"≰","\\nleq",!0),lM(cM,uM,"spacing"," ","\\ "),lM(cM,uM,"spacing"," ","\\space"),lM(cM,uM,"spacing"," ","\\nobreakspace"),lM(hM,uM,"spacing"," ","\\ "),lM(hM,uM,"spacing"," "," "),lM(hM,uM,"spacing"," ","\\space"),lM(hM,uM,"spacing"," ","\\nobreakspace"),lM(cM,uM,"spacing",null,"\\nobreak"),lM(cM,uM,"spacing",null,"\\allowbreak"),lM(cM,uM,"punct",",",","),lM(cM,uM,"punct",";",";"),lM(cM,dM,gM,"⊼","\\barwedge",!0),lM(cM,dM,gM,"⊻","\\veebar",!0),lM(cM,uM,gM,"⊙","\\odot",!0),lM(cM,uM,gM,"⊕","\\oplus",!0),lM(cM,uM,gM,"⊗","\\otimes",!0),lM(cM,uM,bM,"∂","\\partial",!0),lM(cM,uM,gM,"⊘","\\oslash",!0),lM(cM,dM,gM,"⊚","\\circledcirc",!0),lM(cM,dM,gM,"⊡","\\boxdot",!0),lM(cM,uM,gM,"△","\\bigtriangleup"),lM(cM,uM,gM,"▽","\\bigtriangledown"),lM(cM,uM,gM,"†","\\dagger"),lM(cM,uM,gM,"⋄","\\diamond"),lM(cM,uM,gM,"⋆","\\star"),lM(cM,uM,gM,"◃","\\triangleleft"),lM(cM,uM,gM,"▹","\\triangleright"),lM(cM,uM,vM,"{","\\{"),lM(hM,uM,bM,"{","\\{"),lM(hM,uM,bM,"{","\\textbraceleft"),lM(cM,uM,fM,"}","\\}"),lM(hM,uM,bM,"}","\\}"),lM(hM,uM,bM,"}","\\textbraceright"),lM(cM,uM,vM,"{","\\lbrace"),lM(cM,uM,fM,"}","\\rbrace"),lM(cM,uM,vM,"[","\\lbrack",!0),lM(hM,uM,bM,"[","\\lbrack",!0),lM(cM,uM,fM,"]","\\rbrack",!0),lM(hM,uM,bM,"]","\\rbrack",!0),lM(cM,uM,vM,"(","\\lparen",!0),lM(cM,uM,fM,")","\\rparen",!0),lM(hM,uM,bM,"<","\\textless",!0),lM(hM,uM,bM,">","\\textgreater",!0),lM(cM,uM,vM,"⌊","\\lfloor",!0),lM(cM,uM,fM,"⌋","\\rfloor",!0),lM(cM,uM,vM,"⌈","\\lceil",!0),lM(cM,uM,fM,"⌉","\\rceil",!0),lM(cM,uM,bM,"\\","\\backslash"),lM(cM,uM,bM,"∣","|"),lM(cM,uM,bM,"∣","\\vert"),lM(hM,uM,bM,"|","\\textbar",!0),lM(cM,uM,bM,"∥","\\|"),lM(cM,uM,bM,"∥","\\Vert"),lM(hM,uM,bM,"∥","\\textbardbl"),lM(hM,uM,bM,"~","\\textasciitilde"),lM(hM,uM,bM,"\\","\\textbackslash"),lM(hM,uM,bM,"^","\\textasciicircum"),lM(cM,uM,xM,"↑","\\uparrow",!0),lM(cM,uM,xM,"⇑","\\Uparrow",!0),lM(cM,uM,xM,"↓","\\downarrow",!0),lM(cM,uM,xM,"⇓","\\Downarrow",!0),lM(cM,uM,xM,"↕","\\updownarrow",!0),lM(cM,uM,xM,"⇕","\\Updownarrow",!0),lM(cM,uM,yM,"∐","\\coprod"),lM(cM,uM,yM,"⋁","\\bigvee"),lM(cM,uM,yM,"⋀","\\bigwedge"),lM(cM,uM,yM,"⨄","\\biguplus"),lM(cM,uM,yM,"⋂","\\bigcap"),lM(cM,uM,yM,"⋃","\\bigcup"),lM(cM,uM,yM,"∫","\\int"),lM(cM,uM,yM,"∫","\\intop"),lM(cM,uM,yM,"∬","\\iint"),lM(cM,uM,yM,"∭","\\iiint"),lM(cM,uM,yM,"∏","\\prod"),lM(cM,uM,yM,"∑","\\sum"),lM(cM,uM,yM,"⨂","\\bigotimes"),lM(cM,uM,yM,"⨁","\\bigoplus"),lM(cM,uM,yM,"⨀","\\bigodot"),lM(cM,uM,yM,"∮","\\oint"),lM(cM,uM,yM,"∯","\\oiint"),lM(cM,uM,yM,"∰","\\oiiint"),lM(cM,uM,yM,"⨆","\\bigsqcup"),lM(cM,uM,yM,"∫","\\smallint"),lM(hM,uM,"inner","…","\\textellipsis"),lM(cM,uM,"inner","…","\\mathellipsis"),lM(hM,uM,"inner","…","\\ldots",!0),lM(cM,uM,"inner","…","\\ldots",!0),lM(cM,uM,"inner","⋯","\\@cdots",!0),lM(cM,uM,"inner","⋱","\\ddots",!0),lM(cM,uM,bM,"⋮","\\varvdots"),lM(cM,uM,pM,"ˊ","\\acute"),lM(cM,uM,pM,"ˋ","\\grave"),lM(cM,uM,pM,"¨","\\ddot"),lM(cM,uM,pM,"~","\\tilde"),lM(cM,uM,pM,"ˉ","\\bar"),lM(cM,uM,pM,"˘","\\breve"),lM(cM,uM,pM,"ˇ","\\check"),lM(cM,uM,pM,"^","\\hat"),lM(cM,uM,pM,"⃗","\\vec"),lM(cM,uM,pM,"˙","\\dot"),lM(cM,uM,pM,"˚","\\mathring"),lM(cM,uM,mM,"","\\@imath"),lM(cM,uM,mM,"","\\@jmath"),lM(cM,uM,bM,"ı","ı"),lM(cM,uM,bM,"ȷ","ȷ"),lM(hM,uM,bM,"ı","\\i",!0),lM(hM,uM,bM,"ȷ","\\j",!0),lM(hM,uM,bM,"ß","\\ss",!0),lM(hM,uM,bM,"æ","\\ae",!0),lM(hM,uM,bM,"œ","\\oe",!0),lM(hM,uM,bM,"ø","\\o",!0),lM(hM,uM,bM,"Æ","\\AE",!0),lM(hM,uM,bM,"Œ","\\OE",!0),lM(hM,uM,bM,"Ø","\\O",!0),lM(hM,uM,pM,"ˊ","\\'"),lM(hM,uM,pM,"ˋ","\\`"),lM(hM,uM,pM,"ˆ","\\^"),lM(hM,uM,pM,"˜","\\~"),lM(hM,uM,pM,"ˉ","\\="),lM(hM,uM,pM,"˘","\\u"),lM(hM,uM,pM,"˙","\\."),lM(hM,uM,pM,"¸","\\c"),lM(hM,uM,pM,"˚","\\r"),lM(hM,uM,pM,"ˇ","\\v"),lM(hM,uM,pM,"¨",'\\"'),lM(hM,uM,pM,"˝","\\H"),lM(hM,uM,pM,"◯","\\textcircled");var wM={"--":!0,"---":!0,"``":!0,"''":!0};lM(hM,uM,bM,"–","--",!0),lM(hM,uM,bM,"–","\\textendash"),lM(hM,uM,bM,"—","---",!0),lM(hM,uM,bM,"—","\\textemdash"),lM(hM,uM,bM,"‘","`",!0),lM(hM,uM,bM,"‘","\\textquoteleft"),lM(hM,uM,bM,"’","'",!0),lM(hM,uM,bM,"’","\\textquoteright"),lM(hM,uM,bM,"“","``",!0),lM(hM,uM,bM,"“","\\textquotedblleft"),lM(hM,uM,bM,"”","''",!0),lM(hM,uM,bM,"”","\\textquotedblright"),lM(cM,uM,bM,"°","\\degree",!0),lM(hM,uM,bM,"°","\\degree"),lM(hM,uM,bM,"°","\\textdegree",!0),lM(cM,uM,bM,"£","\\pounds"),lM(cM,uM,bM,"£","\\mathsterling",!0),lM(hM,uM,bM,"£","\\pounds"),lM(hM,uM,bM,"£","\\textsterling",!0),lM(cM,dM,bM,"✠","\\maltese"),lM(hM,dM,bM,"✠","\\maltese");var kM,TM;for(TM=0;TM<'0123456789/@."'.length;TM++)lM(cM,uM,bM,kM='0123456789/@."'.charAt(TM),kM);var _M,EM;for(EM=0;EM<'0123456789!@*()-=+";:?/.,'.length;EM++)lM(hM,uM,bM,_M='0123456789!@*()-=+";:?/.,'.charAt(EM),_M);var CM,SM,AM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(SM=0;SM0)return zM(i,l,r,e,a.concat(c));if(o){var h,u;if("boldsymbol"===o){var d=GM(i,r,e,a,n);h=d.fontName,u=[d.fontClass]}else s?(h=rR[o].fontName,u=[o]):(h=nR(o,e.fontWeight,e.fontShape),u=[o,e.fontWeight,e.fontShape]);if(FM(i,h,r).metrics)return zM(i,h,r,e,a.concat(u));if(wM.hasOwnProperty(i)&&"Typewriter"===h.slice(0,10)){for(var p=[],g=0;g{if(YI(t.classes)!==YI(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(1===t.classes.length){var n=t.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0}),"canCombine"),YM=s((t=>{for(var e=0;ee&&(e=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}t.height=e,t.depth=n,t.maxFontSize=r}),"sizeElementFromChildren"),HM=s((function(t,e,n,r){var i=new XI(t,e,n,r);return WM(i),i}),"makeSpan"),VM=s(((t,e,n,r)=>new XI(t,e,n,r)),"makeSvgSpan"),XM=s((function(t,e,n){var r=HM([t],[],e);return r.height=Math.max(n||e.fontMetrics().defaultRuleThickness,e.minRuleThickness),r.style.borderBottomWidth=jI(r.height),r.maxFontSize=1,r}),"makeLineSpan"),KM=s((function(t,e,n,r){var i=new KI(t,e,n,r);return WM(i),i}),"makeAnchor"),ZM=s((function(t){var e=new AI(t);return WM(e),e}),"makeFragment"),QM=s((function(t,e){return t instanceof AI?HM([],[t],e):t}),"wrapFragment"),JM=s((function(t){if("individualShift"===t.positionType){for(var e=t.children,n=[e[0]],r=-e[0].shift-e[0].elem.depth,i=r,a=1;a{var n=HM(["mspace"],[],e),r=qI(t,e);return n.style.marginRight=jI(r),n}),"makeGlue"),nR=s((function(t,e,n){var r="";switch(t){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=t}return r+"-"+("textbf"===e&&"textit"===n?"BoldItalic":"textbf"===e?"Bold":"textit"===e?"Italic":"Regular")}),"retrieveTextFontName"),rR={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},iR={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},aR=s((function(t,e){var[n,r,i]=iR[t],a=new eM(n),s=new tM([a],{width:jI(r),height:jI(i),style:"width:"+jI(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),o=VM(["overlay"],[s],e);return o.height=i,o.style.height=jI(i),o.style.width=jI(r),o}),"staticSvg"),sR={fontMap:rR,makeSymbol:zM,mathsym:UM,makeSpan:HM,makeSvgSpan:VM,makeLineSpan:XM,makeAnchor:KM,makeFragment:ZM,wrapFragment:QM,makeVList:tR,makeOrd:qM,makeGlue:eR,staticSvg:aR,svgData:iR,tryCombineChars:YM},oR={number:3,unit:"mu"},lR={number:4,unit:"mu"},cR={number:5,unit:"mu"},hR={mord:{mop:oR,mbin:lR,mrel:cR,minner:oR},mop:{mord:oR,mop:oR,mrel:cR,minner:oR},mbin:{mord:lR,mop:lR,mopen:lR,minner:lR},mrel:{mord:cR,mop:cR,mopen:cR,minner:cR},mopen:{},mclose:{mop:oR,mbin:lR,mrel:cR,minner:oR},mpunct:{mord:oR,mop:oR,mrel:cR,mopen:oR,mclose:oR,mpunct:oR,minner:oR},minner:{mord:oR,mop:oR,mbin:lR,mrel:cR,mopen:oR,mpunct:oR,minner:oR}},uR={mord:{mop:oR},mop:{mord:oR,mop:oR},mbin:{},mrel:{},mopen:{},mclose:{mop:oR},mpunct:{},minner:{mop:oR}},dR={},pR={},gR={};function fR(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l{var n=e.classes[0],r=t.classes[0];"mbin"===n&&tI.contains(wR,r)?e.classes[0]="mord":"mbin"===r&&tI.contains(bR,n)&&(t.classes[0]="mord")}),{node:h},u,d),ER(i,((t,e)=>{var n=AR(e),r=AR(t),i=n&&r?t.hasClass("mtight")?uR[n][r]:hR[n][r]:null;if(i)return sR.makeGlue(i,l)}),{node:h},u,d),i}),"buildExpression"),ER=s((function t(e,n,r,i,a){i&&e.push(i);for(var s=0;sn=>{e.splice(t+1,0,n),s++})(s)}}i&&e.pop()}),"traverseNonSpaceNodes"),CR=s((function(t){return t instanceof AI||t instanceof KI||t instanceof XI&&t.hasClass("enclosing")?t:null}),"checkPartialGroup"),SR=s((function t(e,n){var r=CR(e);if(r){var i=r.children;if(i.length){if("right"===n)return t(i[i.length-1],"right");if("left"===n)return t(i[0],"left")}}return e}),"getOutermostNode"),AR=s((function(t,e){return t?(e&&(t=SR(t,e)),TR[t.classes[0]]||null):null}),"getTypeOfDomTree"),LR=s((function(t,e){var n=["nulldelimiter"].concat(t.baseSizingClasses());return xR(e.concat(n))}),"makeNullDelimiter"),NR=s((function(t,e,n){if(!t)return xR();if(pR[t.type]){var r=pR[t.type](t,e);if(n&&e.size!==n.size){r=xR(e.sizingClasses(n),[r],e);var i=e.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new qN("Got group of unknown type: '"+t.type+"'")}),"buildGroup");function IR(t,e){var n=xR(["base"],t,e),r=xR(["strut"]);return r.style.height=jI(n.height+n.depth),n.depth&&(r.style.verticalAlign=jI(-n.depth)),n.children.unshift(r),n}function MR(t,e){var n=null;1===t.length&&"tag"===t[0].type&&(n=t[0].tag,t=t[0].body);var r,i=_R(t,e,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var a,s=[],o=[],l=0;l0&&(s.push(IR(o,e)),o=[]),s.push(i[l]));o.length>0&&s.push(IR(o,e)),n?((a=IR(_R(n,e,!0))).classes=["tag"],s.push(a)):r&&s.push(r);var h=xR(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),a){var u=a.children[0];u.style.height=jI(h.height+h.depth),h.depth&&(u.style.verticalAlign=jI(-h.depth))}return h}function RR(t){return new AI(t)}s(IR,"buildHTMLUnbreakable"),s(MR,"buildHTML"),s(RR,"newDocumentFragment");var DR=class{static{s(this,"MathNode")}constructor(t,e,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=e||[],this.classes=n||[]}setAttribute(t,e){this.attributes[t]=e}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);this.classes.length>0&&(t.className=YI(this.classes));for(var n=0;n0&&(t+=' class ="'+tI.escape(YI(this.classes))+'"'),t+=">";for(var n=0;n"}toText(){return this.children.map((t=>t.toText())).join("")}},OR=class{static{s(this,"TextNode")}constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return tI.escape(this.toText())}toText(){return this.text}},PR=class{static{s(this,"SpaceNode")}constructor(t){this.width=void 0,this.character=void 0,this.width=t,this.character=t>=.05555&&t<=.05556?" ":t>=.1666&&t<=.1667?" ":t>=.2222&&t<=.2223?" ":t>=.2777&&t<=.2778?"  ":t>=-.05556&&t<=-.05555?" ⁣":t>=-.1667&&t<=-.1666?" ⁣":t>=-.2223&&t<=-.2222?" ⁣":t>=-.2778&&t<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",jI(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}},BR={MathNode:DR,TextNode:OR,SpaceNode:PR,newDocumentFragment:RR},$R=s((function(t,e,n){return!oM[e][t]||!oM[e][t].replace||55349===t.charCodeAt(0)||wM.hasOwnProperty(t)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(t=oM[e][t].replace),new BR.TextNode(t)}),"makeText"),FR=s((function(t){return 1===t.length?t[0]:new BR.MathNode("mrow",t)}),"makeRow"),zR=s((function(t,e){if("texttt"===e.fontFamily)return"monospace";if("textsf"===e.fontFamily)return"textit"===e.fontShape&&"textbf"===e.fontWeight?"sans-serif-bold-italic":"textit"===e.fontShape?"sans-serif-italic":"textbf"===e.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===e.fontShape&&"textbf"===e.fontWeight)return"bold-italic";if("textit"===e.fontShape)return"italic";if("textbf"===e.fontWeight)return"bold";var n=e.font;if(!n||"mathnormal"===n)return null;var r=t.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===t.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var i=t.text;return tI.contains(["\\imath","\\jmath"],i)?null:(oM[r][i]&&oM[r][i].replace&&(i=oM[r][i].replace),RI(i,sR.fontMap[n].fontName,r)?sR.fontMap[n].variant:null)}),"getVariant"),UR=s((function(t,e,n){if(1===t.length){var r=qR(t[0],e);return n&&r instanceof DR&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,a=[],s=0;s0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(o),i=o}return a}),"buildExpression"),GR=s((function(t,e,n){return FR(UR(t,e,n))}),"buildExpressionRow"),qR=s((function(t,e){if(!t)return new BR.MathNode("mrow");if(gR[t.type])return gR[t.type](t,e);throw new qN("Got group of unknown type: '"+t.type+"'")}),"buildGroup");function jR(t,e,n,r,i){var a,s=UR(t,n);a=1===s.length&&s[0]instanceof DR&&tI.contains(["mrow","mtable"],s[0].type)?s[0]:new BR.MathNode("mrow",s);var o=new BR.MathNode("annotation",[new BR.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new BR.MathNode("semantics",[a,o]),c=new BR.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var h=i?"katex":"katex-mathml";return sR.makeSpan([h],[c])}s(jR,"buildMathML");var YR=s((function(t){return new FI({style:t.displayMode?dI.DISPLAY:dI.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})}),"optionsFromSettings"),WR=s((function(t,e){if(e.displayMode){var n=["katex-display"];e.leqno&&n.push("leqno"),e.fleqn&&n.push("fleqn"),t=sR.makeSpan(n,[t])}return t}),"displayWrap"),HR=s((function(t,e,n){var r,i=YR(n);if("mathml"===n.output)return jR(t,e,i,n.displayMode,!0);if("html"===n.output){var a=MR(t,i);r=sR.makeSpan(["katex"],[a])}else{var s=jR(t,e,i,n.displayMode,!1),o=MR(t,i);r=sR.makeSpan(["katex"],[s,o])}return WR(r,n)}),"buildTree"),VR=s((function(t,e,n){var r=MR(t,YR(n)),i=sR.makeSpan(["katex"],[r]);return WR(i,n)}),"buildHTMLTree"),XR={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},KR=s((function(t){var e=new BR.MathNode("mo",[new BR.TextNode(XR[t.replace(/^\\/,"")])]);return e.setAttribute("stretchy","true"),e}),"mathMLnode"),ZR={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},QR=s((function(t){return"ordgroup"===t.type?t.body.length:1}),"groupLength"),JR=s((function(t,e){function n(){var n=4e5,r=t.label.slice(1);if(tI.contains(["widehat","widecheck","widetilde","utilde"],r)){var i,a,s,o=QR(t.base);if(o>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,s=.42,a=r+"4"):(i=312,n=2340,s=.34,a="tilde4");else{var l=[1,1,2,2,3,3][o];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],s=[0,.24,.3,.3,.36,.42][l],a=r+l):(n=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],s=[0,.26,.286,.3,.306,.34][l],a="tilde"+l)}var c=new eM(a),h=new tM([c],{width:"100%",height:jI(s),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:sR.makeSvgSpan([],[h],e),minWidth:0,height:s}}var u,d,p=[],g=ZR[r],[f,m,y]=g,v=y/1e3,x=f.length;if(1===x)u=["hide-tail"],d=[g[3]];else if(2===x)u=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==x)throw new Error("Correct katexImagesData or update code here to support\n "+x+" children.");u=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}for(var b=0;b0&&(r.style.minWidth=jI(i)),r}),"svgSpan"),tD=s((function(t,e,n,r,i){var a,s=t.height+t.depth+n+r;if(/fbox|color|angl/.test(e)){if(a=sR.makeSpan(["stretchy",e],[],i),"fbox"===e){var o=i.color&&i.getColor();o&&(a.style.borderColor=o)}}else{var l=[];/^[bx]cancel$/.test(e)&&l.push(new nM({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(e)&&l.push(new nM({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new tM(l,{width:"100%",height:jI(s)});a=sR.makeSvgSpan([],[c],i)}return a.height=s,a.style.height=jI(s),a}),"encloseSpan"),eD={encloseSpan:tD,mathMLnode:KR,svgSpan:JR};function nD(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function rD(t){var e=iD(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function iD(t){return t&&("atom"===t.type||sM.hasOwnProperty(t.type))?t:null}s(nD,"assertNodeType"),s(rD,"assertSymbolNodeType"),s(iD,"checkSymbolNodeType");var aD=s(((t,e)=>{var n,r,i;t&&"supsub"===t.type?(n=(r=nD(t.base,"accent")).base,t.base=n,i=iM(NR(t,e)),t.base=r):n=(r=nD(t,"accent")).base;var a=NR(n,e.havingCrampedStyle()),s=0;if(r.isShifty&&tI.isCharacterBox(n)){var o=tI.getBaseElem(n);s=rM(NR(o,e.havingCrampedStyle())).skew}var l,c="\\c"===r.label,h=c?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight);if(r.isStretchy)l=eD.svgSpan(r,e),l=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+jI(2*s)+")",marginLeft:jI(2*s)}:void 0}]},e);else{var u,d;"\\vec"===r.label?(u=sR.staticSvg("vec",e),d=sR.svgData.vec[1]):((u=rM(u=sR.makeOrd({mode:r.mode,text:r.label},e,"textord"))).italic=0,d=u.width,c&&(h+=u.depth)),l=sR.makeSpan(["accent-body"],[u]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),h=a.height);var g=s;p||(g-=d/2),l.style.left=jI(g),"\\textcircled"===r.label&&(l.style.top=".2em"),l=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{type:"elem",elem:l}]},e)}var f=sR.makeSpan(["mord","accent"],[l],e);return i?(i.children[0]=f,i.height=Math.max(f.height,i.height),i.classes[0]="mord",i):f}),"htmlBuilder$a"),sD=s(((t,e)=>{var n=t.isStretchy?eD.mathMLnode(t.label):new BR.MathNode("mo",[$R(t.label,t.mode)]),r=new BR.MathNode("mover",[qR(t.base,e),n]);return r.setAttribute("accent","true"),r}),"mathmlBuilder$9"),oD=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((t=>"\\"+t)).join("|"));fR({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:s(((t,e)=>{var n=yR(e[0]),r=!oD.test(t.funcName),i=!r||"\\widehat"===t.funcName||"\\widetilde"===t.funcName||"\\widecheck"===t.funcName;return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:i,base:n}}),"handler"),htmlBuilder:aD,mathmlBuilder:sD}),fR({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:s(((t,e)=>{var n=e[0],r=t.parser.mode;return"math"===r&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}}),"handler"),htmlBuilder:aD,mathmlBuilder:sD}),fR({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}}),"handler"),htmlBuilder:s(((t,e)=>{var n=NR(t.base,e),r=eD.svgSpan(t,e),i="\\utilde"===t.label?.12:0,a=sR.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},e);return sR.makeSpan(["mord","accentunder"],[a],e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=eD.mathMLnode(t.label),r=new BR.MathNode("munder",[qR(t.base,e),n]);return r.setAttribute("accentunder","true"),r}),"mathmlBuilder")});var lD=s((t=>{var e=new BR.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e}),"paddedNode");fR({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r,funcName:i}=t;return{type:"xArrow",mode:r.mode,label:i,body:e[0],below:n[0]}},htmlBuilder(t,e){var n,r=e.style,i=e.havingStyle(r.sup()),a=sR.wrapFragment(NR(t.body,i,e),e),s="\\x"===t.label.slice(0,2)?"x":"cd";a.classes.push(s+"-arrow-pad"),t.below&&(i=e.havingStyle(r.sub()),(n=sR.wrapFragment(NR(t.below,i,e),e)).classes.push(s+"-arrow-pad"));var o,l=eD.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*l.height,h=-e.fontMetrics().axisHeight-.5*l.height-.111;if((a.depth>.25||"\\xleftequilibrium"===t.label)&&(h-=a.depth),n){var u=-e.fontMetrics().axisHeight+n.height+.5*l.height+.111;o=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},e)}else o=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:l,shift:c}]},e);return o.children[0].children[0].children[1].classes.push("svg-align"),sR.makeSpan(["mrel","x-arrow"],[o],e)},mathmlBuilder(t,e){var n,r=eD.mathMLnode(t.label);if(r.setAttribute("minsize","x"===t.label.charAt(0)?"1.75em":"3.0em"),t.body){var i=lD(qR(t.body,e));if(t.below){var a=lD(qR(t.below,e));n=new BR.MathNode("munderover",[r,a,i])}else n=new BR.MathNode("mover",[r,i])}else if(t.below){var s=lD(qR(t.below,e));n=new BR.MathNode("munder",[r,s])}else n=lD(),n=new BR.MathNode("mover",[r,n]);return n}});var cD=sR.makeSpan;function hD(t,e){var n=_R(t.body,e,!0);return cD([t.mclass],n,e)}function uD(t,e){var n,r=UR(t.body,e);return"minner"===t.mclass?n=new BR.MathNode("mpadded",r):"mord"===t.mclass?t.isCharacterBox?(n=r[0]).type="mi":n=new BR.MathNode("mi",r):(t.isCharacterBox?(n=r[0]).type="mo":n=new BR.MathNode("mo",r),"mbin"===t.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===t.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===t.mclass||"mclose"===t.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===t.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}s(hD,"htmlBuilder$9"),s(uD,"mathmlBuilder$8"),fR({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:vR(i),isCharacterBox:tI.isCharacterBox(i)}},htmlBuilder:hD,mathmlBuilder:uD});var dD=s((t=>{var e="ordgroup"===t.type&&t.body.length?t.body[0]:t;return"atom"!==e.type||"bin"!==e.family&&"rel"!==e.family?"mord":"m"+e.family}),"binrelClass");fR({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:dD(e[0]),body:vR(e[1]),isCharacterBox:tI.isCharacterBox(e[1])}}}),fR({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var n,{parser:r,funcName:i}=t,a=e[1],s=e[0];n="\\stackrel"!==i?dD(a):"mrel";var o={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:vR(a)},l={type:"supsub",mode:s.mode,base:o,sup:"\\underset"===i?null:s,sub:"\\underset"===i?s:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:tI.isCharacterBox(l)}},htmlBuilder:hD,mathmlBuilder:uD}),fR({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:dD(e[0]),body:vR(e[0])}},htmlBuilder(t,e){var n=_R(t.body,e,!0),r=sR.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=UR(t.body,e),r=new BR.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var pD={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},gD=s((()=>({type:"styling",body:[],mode:"math",style:"display"})),"newCell"),fD=s((t=>"textord"===t.type&&"@"===t.text),"isStartOfArrow"),mD=s(((t,e)=>("mathord"===t.type||"atom"===t.type)&&t.text===e),"isLabelEnd");function yD(t,e,n){var r=pD[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:r,mode:"math",family:"rel"},a={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[e[0]],[]),n.callFunction("\\Big",[i],[]),n.callFunction("\\\\cdright",[e[1]],[])]};return n.callFunction("\\\\cdparent",[a],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}function vD(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===e[e.length-1].length&&e.pop();break}throw new qN("Expected \\\\ or \\cr or \\end",t.nextToken)}t.consume()}for(var r=[],i=[r],a=0;a-1);else{if(!("<>AV".indexOf(c)>-1))throw new qN('Expected one of "<>AV=|." after @',s[l]);for(var u=0;u<2;u++){for(var d=!0,p=l+1;pnew BR.MathNode("mrow",[qR(t.fragment,e)])}),fR({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=nD(e[0],"ordgroup").body,i="",a=0;a=1114111)throw new qN("\\@char with invalid code point "+i);return o<=65535?s=String.fromCharCode(o):(o-=65536,s=String.fromCharCode(55296+(o>>10),56320+(1023&o))),{type:"textord",mode:n.mode,text:s}}});var xD=s(((t,e)=>{var n=_R(t.body,e.withColor(t.color),!1);return sR.makeFragment(n)}),"htmlBuilder$8"),bD=s(((t,e)=>{var n=UR(t.body,e.withColor(t.color)),r=new BR.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r}),"mathmlBuilder$7");fR({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=nD(e[0],"color-token").color,i=e[1];return{type:"color",mode:n.mode,color:r,body:vR(i)}},htmlBuilder:xD,mathmlBuilder:bD}),fR({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,i=nD(e[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:xD,mathmlBuilder:bD}),fR({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&nD(i,"size").value}},htmlBuilder(t,e){var n=sR.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=jI(qI(t.size,e)))),n},mathmlBuilder(t,e){var n=new BR.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",jI(qI(t.size,e)))),n}});var wD={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},kD=s((t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new qN("Expected a control sequence",t);return e}),"checkControlSequence"),TD=s((t=>{var e=t.gullet.popToken();return"="===e.text&&" "===(e=t.gullet.popToken()).text&&(e=t.gullet.popToken()),e}),"getRHS"),_D=s(((t,e,n,r)=>{var i=t.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,i,r)}),"letCommand");fR({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(wD[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=wD[r.text]),nD(e.parseFunction(),"internal");throw new qN("Invalid token after macro prefix",r)}}),fR({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new qN("Expected a control sequence",r);for(var a,s=0,o=[[]];"{"!==e.gullet.future().text;)if("#"===(r=e.gullet.popToken()).text){if("{"===e.gullet.future().text){a=e.gullet.future(),o[s].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new qN('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==s+1)throw new qN('Argument number "'+r.text+'" out of order');s++,o.push([])}else{if("EOF"===r.text)throw new qN("Expected a macro definition");o[s].push(r.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),"\\edef"!==n&&"\\xdef"!==n||(l=e.gullet.expandTokens(l)).reverse(),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},n===wD[n]),{type:"internal",mode:e.mode}}}),fR({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=kD(e.gullet.popToken());e.gullet.consumeSpaces();var i=TD(e);return _D(e,r,i,"\\\\globallet"===n),{type:"internal",mode:e.mode}}}),fR({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=kD(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return _D(e,r,a,"\\\\globalfuture"===n),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ED=s((function(t,e,n){var r=RI(oM.math[t]&&oM.math[t].replace||t,e,n);if(!r)throw new Error("Unsupported symbol "+t+" and font size "+e+".");return r}),"getMetrics"),CD=s((function(t,e,n,r){var i=n.havingBaseStyle(e),a=sR.makeSpan(r.concat(i.sizingClasses(n)),[t],n),s=i.sizeMultiplier/n.sizeMultiplier;return a.height*=s,a.depth*=s,a.maxFontSize=i.sizeMultiplier,a}),"styleWrap"),SD=s((function(t,e,n){var r=e.havingBaseStyle(n),i=(1-e.sizeMultiplier/r.sizeMultiplier)*e.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=jI(i),t.height-=i,t.depth+=i}),"centerSpan"),AD=s((function(t,e,n,r,i,a){var s=sR.makeSymbol(t,"Main-Regular",i,r),o=CD(s,e,r,a);return n&&SD(o,r,e),o}),"makeSmallDelim"),LD=s((function(t,e,n,r){return sR.makeSymbol(t,"Size"+e+"-Regular",n,r)}),"mathrmSize"),ND=s((function(t,e,n,r,i,a){var s=LD(t,e,i,r),o=CD(sR.makeSpan(["delimsizing","size"+e],[s],r),dI.TEXT,r,a);return n&&SD(o,r,dI.TEXT),o}),"makeLargeDelim"),ID=s((function(t,e,n){var r;return r="Size1-Regular"===e?"delim-size1":"delim-size4",{type:"elem",elem:sR.makeSpan(["delimsizinginner",r],[sR.makeSpan([],[sR.makeSymbol(t,e,n)])])}}),"makeGlyphSpan"),MD=s((function(t,e,n){var r=LI["Size4-Regular"][t.charCodeAt(0)]?LI["Size4-Regular"][t.charCodeAt(0)][4]:LI["Size1-Regular"][t.charCodeAt(0)][4],i=new eM("inner",EI(t,Math.round(1e3*e))),a=new tM([i],{width:jI(r),height:jI(e),style:"width:"+jI(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*e),preserveAspectRatio:"xMinYMin"}),s=sR.makeSvgSpan([],[a],n);return s.height=e,s.style.height=jI(e),s.style.width=jI(r),{type:"elem",elem:s}}),"makeInner"),RD={type:"kern",size:-.008},DD=["|","\\lvert","\\rvert","\\vert"],OD=["\\|","\\lVert","\\rVert","\\Vert"],PD=s((function(t,e,n,r,i,a){var s,o,l,c,h="",u=0;s=l=c=t,o=null;var d="Size1-Regular";"\\uparrow"===t?l=c="⏐":"\\Uparrow"===t?l=c="‖":"\\downarrow"===t?s=l="⏐":"\\Downarrow"===t?s=l="‖":"\\updownarrow"===t?(s="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===t?(s="\\Uparrow",l="‖",c="\\Downarrow"):tI.contains(DD,t)?(l="∣",h="vert",u=333):tI.contains(OD,t)?(l="∥",h="doublevert",u=556):"["===t||"\\lbrack"===t?(s="⎡",l="⎢",c="⎣",d="Size4-Regular",h="lbrack",u=667):"]"===t||"\\rbrack"===t?(s="⎤",l="⎥",c="⎦",d="Size4-Regular",h="rbrack",u=667):"\\lfloor"===t||"⌊"===t?(l=s="⎢",c="⎣",d="Size4-Regular",h="lfloor",u=667):"\\lceil"===t||"⌈"===t?(s="⎡",l=c="⎢",d="Size4-Regular",h="lceil",u=667):"\\rfloor"===t||"⌋"===t?(l=s="⎥",c="⎦",d="Size4-Regular",h="rfloor",u=667):"\\rceil"===t||"⌉"===t?(s="⎤",l=c="⎥",d="Size4-Regular",h="rceil",u=667):"("===t||"\\lparen"===t?(s="⎛",l="⎜",c="⎝",d="Size4-Regular",h="lparen",u=875):")"===t||"\\rparen"===t?(s="⎞",l="⎟",c="⎠",d="Size4-Regular",h="rparen",u=875):"\\{"===t||"\\lbrace"===t?(s="⎧",o="⎨",c="⎩",l="⎪",d="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(s="⎫",o="⎬",c="⎭",l="⎪",d="Size4-Regular"):"\\lgroup"===t||"⟮"===t?(s="⎧",c="⎩",l="⎪",d="Size4-Regular"):"\\rgroup"===t||"⟯"===t?(s="⎫",c="⎭",l="⎪",d="Size4-Regular"):"\\lmoustache"===t||"⎰"===t?(s="⎧",c="⎭",l="⎪",d="Size4-Regular"):"\\rmoustache"!==t&&"⎱"!==t||(s="⎫",c="⎩",l="⎪",d="Size4-Regular");var p=ED(s,d,i),g=p.height+p.depth,f=ED(l,d,i),m=f.height+f.depth,y=ED(c,d,i),v=y.height+y.depth,x=0,b=1;if(null!==o){var w=ED(o,d,i);x=w.height+w.depth,b=2}var k=g+v+x,T=k+Math.max(0,Math.ceil((e-k)/(b*m)))*b*m,_=r.fontMetrics().axisHeight;n&&(_*=r.sizeMultiplier);var E=T/2-_,C=[];if(h.length>0){var S=T-g-v,A=Math.round(1e3*T),L=SI(h,Math.round(1e3*S)),N=new eM(h,L),I=(u/1e3).toFixed(3)+"em",M=(A/1e3).toFixed(3)+"em",R=new tM([N],{width:I,height:M,viewBox:"0 0 "+u+" "+A}),D=sR.makeSvgSpan([],[R],r);D.height=A/1e3,D.style.width=I,D.style.height=M,C.push({type:"elem",elem:D})}else{if(C.push(ID(c,d,i)),C.push(RD),null===o){var O=T-g-v+.016;C.push(MD(l,O,r))}else{var P=(T-g-v-x)/2+.016;C.push(MD(l,P,r)),C.push(RD),C.push(ID(o,d,i)),C.push(RD),C.push(MD(l,P,r))}C.push(RD),C.push(ID(s,d,i))}var B=r.havingBaseStyle(dI.TEXT),$=sR.makeVList({positionType:"bottom",positionData:E,children:C},B);return CD(sR.makeSpan(["delimsizing","mult"],[$],B),dI.TEXT,r,a)}),"makeStackedDelim"),BD=s((function(t,e,n,r,i){var a=_I(t,r,n),s=new eM(t,a),o=new tM([s],{width:"400em",height:jI(e),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return sR.makeSvgSpan(["hide-tail"],[o],i)}),"sqrtSvg"),$D=s((function(t,e){var n,r,i=e.havingBaseSizing(),a=VD("\\surd",t*i.sizeMultiplier,WD,i),s=i.sizeMultiplier,o=Math.max(0,e.minRuleThickness-e.fontMetrics().sqrtRuleThickness),l=0,c=0,h=0;return"small"===a.type?(t<1?s=1:t<1.4&&(s=.7),c=(1+o)/s,(n=BD("sqrtMain",l=(1+o+.08)/s,h=1e3+1e3*o+80,o,e)).style.minWidth="0.853em",r=.833/s):"large"===a.type?(h=1080*GD[a.size],c=(GD[a.size]+o)/s,l=(GD[a.size]+o+.08)/s,(n=BD("sqrtSize"+a.size,l,h,o,e)).style.minWidth="1.02em",r=1/s):(l=t+o+.08,c=t+o,h=Math.floor(1e3*t+o)+80,(n=BD("sqrtTall",l,h,o,e)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=jI(l),{span:n,advanceWidth:r,ruleWidth:(e.fontMetrics().sqrtRuleThickness+o)*s}}),"makeSqrtImage"),FD=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],zD=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],UD=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],GD=[0,1.2,1.8,2.4,3],qD=s((function(t,e,n,r,i){if("<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),tI.contains(FD,t)||tI.contains(UD,t))return ND(t,e,!1,n,r,i);if(tI.contains(zD,t))return PD(t,GD[e],!1,n,r,i);throw new qN("Illegal delimiter: '"+t+"'")}),"makeSizedDelim"),jD=[{type:"small",style:dI.SCRIPTSCRIPT},{type:"small",style:dI.SCRIPT},{type:"small",style:dI.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],YD=[{type:"small",style:dI.SCRIPTSCRIPT},{type:"small",style:dI.SCRIPT},{type:"small",style:dI.TEXT},{type:"stack"}],WD=[{type:"small",style:dI.SCRIPTSCRIPT},{type:"small",style:dI.SCRIPT},{type:"small",style:dI.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],HD=s((function(t){if("small"===t.type)return"Main-Regular";if("large"===t.type)return"Size"+t.size+"-Regular";if("stack"===t.type)return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")}),"delimTypeToFont"),VD=s((function(t,e,n,r){for(var i=Math.min(2,3-r.style.size);ie)return n[i]}return n[n.length-1]}),"traverseSequence"),XD=s((function(t,e,n,r,i,a){var s;"<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),s=tI.contains(UD,t)?jD:tI.contains(FD,t)?WD:YD;var o=VD(t,e,s,r);return"small"===o.type?AD(t,o.style,n,r,i,a):"large"===o.type?ND(t,o.size,n,r,i,a):PD(t,e,n,r,i,a)}),"makeCustomSizedDelim"),KD=s((function(t,e,n,r,i,a){var s=r.fontMetrics().axisHeight*r.sizeMultiplier,o=5/r.fontMetrics().ptPerEm,l=Math.max(e-s,n+s),c=Math.max(l/500*901,2*l-o);return XD(t,c,!0,r,i,a)}),"makeLeftRightDelim"),ZD={sqrtImage:$D,sizedDelim:qD,sizeToMaxHeight:GD,customSizedDelim:XD,leftRightDelim:KD},QD={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},JD=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function tO(t,e){var n=iD(t);if(n&&tI.contains(JD,n.text))return n;throw new qN(n?"Invalid delimiter '"+n.text+"' after '"+e.funcName+"'":"Invalid delimiter type '"+t.type+"'",t)}function eO(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}s(tO,"checkDelimiter"),fR({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:s(((t,e)=>{var n=tO(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:QD[t.funcName].size,mclass:QD[t.funcName].mclass,delim:n.text}}),"handler"),htmlBuilder:s(((t,e)=>"."===t.delim?sR.makeSpan([t.mclass]):ZD.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass])),"htmlBuilder"),mathmlBuilder:s((t=>{var e=[];"."!==t.delim&&e.push($R(t.delim,t.mode));var n=new BR.MathNode("mo",e);"mopen"===t.mclass||"mclose"===t.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=jI(ZD.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}),"mathmlBuilder")}),s(eO,"assertParsed"),fR({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:s(((t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new qN("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:tO(e[0],t).text,color:n}}),"handler")}),fR({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:s(((t,e)=>{var n=tO(e[0],t),r=t.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=nD(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}}),"handler"),htmlBuilder:s(((t,e)=>{eO(t);for(var n,r,i=_R(t.body,e,!0,["mopen","mclose"]),a=0,s=0,o=!1,l=0;l{eO(t);var n=UR(t.body,e);if("."!==t.left){var r=new BR.MathNode("mo",[$R(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==t.right){var i=new BR.MathNode("mo",[$R(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),n.push(i)}return FR(n)}),"mathmlBuilder")}),fR({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:s(((t,e)=>{var n=tO(e[0],t);if(!t.parser.leftrightDepth)throw new qN("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}}),"handler"),htmlBuilder:s(((t,e)=>{var n;if("."===t.delim)n=LR(e,[]);else{n=ZD.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n="\\vert"===t.delim||"|"===t.delim?$R("|","text"):$R(t.delim,t.mode),r=new BR.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}),"mathmlBuilder")});var nO=s(((t,e)=>{var n,r,i=sR.wrapFragment(NR(t.body,e),e),a=t.label.slice(1),s=e.sizeMultiplier,o=0,l=tI.isCharacterBox(t.body);if("sout"===a)(n=sR.makeSpan(["stretchy","sout"])).height=e.fontMetrics().defaultRuleThickness/s,o=-.5*e.fontMetrics().xHeight;else if("phase"===a){var c=qI({number:.6,unit:"pt"},e),h=qI({number:.35,unit:"ex"},e);s/=e.havingBaseSizing().sizeMultiplier;var u=i.height+i.depth+c+h;i.style.paddingLeft=jI(u/2+c);var d=Math.floor(1e3*u*s),p=kI(d),g=new tM([new eM("phase",p)],{width:"400em",height:jI(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=sR.makeSvgSpan(["hide-tail"],[g],e)).style.height=jI(u),o=i.depth+c+h}else{/cancel/.test(a)?l||i.classes.push("cancel-pad"):"angl"===a?i.classes.push("anglpad"):i.classes.push("boxpad");var f=0,m=0,y=0;/box/.test(a)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=f=e.fontMetrics().fboxsep+("colorbox"===a?0:y)):"angl"===a?(f=4*(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness)),m=Math.max(0,.25-i.depth)):m=f=l?.2:0,n=eD.encloseSpan(i,a,f,m,e),/fbox|boxed|fcolorbox/.test(a)?(n.style.borderStyle="solid",n.style.borderWidth=jI(y)):"angl"===a&&.049!==y&&(n.style.borderTopWidth=jI(y),n.style.borderRightWidth=jI(y)),o=i.depth+m,t.backgroundColor&&(n.style.backgroundColor=t.backgroundColor,t.borderColor&&(n.style.borderColor=t.borderColor))}if(t.backgroundColor)r=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:o},{type:"elem",elem:i,shift:0}]},e);else{var v=/cancel|phase/.test(a)?["svg-align"]:[];r=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:o,wrapperClasses:v}]},e)}return/cancel/.test(a)&&(r.height=i.height,r.depth=i.depth),/cancel/.test(a)&&!l?sR.makeSpan(["mord","cancel-lap"],[r],e):sR.makeSpan(["mord"],[r],e)}),"htmlBuilder$7"),rO=s(((t,e)=>{var n=0,r=new BR.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[qR(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===t.label){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r}),"mathmlBuilder$6");fR({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,a=nD(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:nO,mathmlBuilder:rO}),fR({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,a=nD(e[0],"color-token").color,s=nD(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:nO,mathmlBuilder:rO}),fR({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}}),fR({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:nO,mathmlBuilder:rO}),fR({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var iO={};function aO(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{if(!t.parser.settings.displayMode)throw new qN("{"+t.envName+"} can be used only in display mode.")}),"validateAmsEnvironmentContext");function hO(t){if(-1===t.indexOf("ed"))return-1===t.indexOf("*")}function uO(t,e,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:l,autoTag:c,singleRow:h,emptySingleRow:u,maxNumCols:d,leqno:p}=e;if(t.gullet.beginGroup(),h||t.gullet.macros.set("\\cr","\\\\\\relax"),!o){var g=t.gullet.expandMacroAsText("\\arraystretch");if(null==g)o=1;else if(!(o=parseFloat(g))||o<0)throw new qN("Invalid \\arraystretch: "+g)}t.gullet.beginGroup();var f=[],m=[f],y=[],v=[],x=null!=c?[]:void 0;function b(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new GN("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(Boolean(c)&&"1"===t.gullet.macros.get("\\@eqnsw")))}for(s(b,"beginRow"),s(w,"endRow"),b(),v.push(lO(t));;){var k=t.parseExpression(!1,h?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),k={type:"ordgroup",mode:t.mode,body:k},n&&(k={type:"styling",mode:t.mode,style:n,body:[k]}),f.push(k);var T=t.fetch().text;if("&"===T){if(d&&f.length===d){if(h||l)throw new qN("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else{if("\\end"===T){w(),1===f.length&&"styling"===k.type&&0===k.body[0].body.length&&(m.length>1||!u)&&m.pop(),v.length0&&(v+=.25),c.push({pos:v,isDashed:t[e]})}for(s(x,"setHLinePos"),x(a[0]),n=0;n0&&(k<(C+=y)&&(k=C),C=0),t.addJot&&(k+=g),T.height=w,T.depth=k,v+=w,T.pos=v,v+=k+C,l[n]=T,x(a[n+1])}var S,A,L=v/2+e.fontMetrics().axisHeight,N=t.cols||[],I=[],M=[];if(t.tags&&t.tags.some((t=>t)))for(n=0;n=o)){var G=void 0;(r>0||t.hskipBeforeAndAfter)&&0!==(G=tI.deflt(B.pregap,d))&&((S=sR.makeSpan(["arraycolsep"],[])).style.width=jI(G),I.push(S));var q=[];for(n=0;n0){for(var H=sR.makeLineSpan("hline",e,h),V=sR.makeLineSpan("hdashline",e,h),X=[{type:"elem",elem:l,shift:0}];c.length>0;){var K=c.pop(),Z=K.pos-L;K.isDashed?X.push({type:"elem",elem:V,shift:Z}):X.push({type:"elem",elem:H,shift:Z})}l=sR.makeVList({positionType:"individualShift",children:X},e)}if(0===M.length)return sR.makeSpan(["mord"],[l],e);var Q=sR.makeVList({positionType:"individualShift",children:M},e);return Q=sR.makeSpan(["tag"],[Q],e),sR.makeFragment([l,Q])}),"htmlBuilder"),gO={c:"center ",l:"left ",r:"right "},fO=s((function(t,e){for(var n=[],r=new BR.MathNode("mtd",[],["mtr-glue"]),i=new BR.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var p=t.cols,g="",f=!1,m=0,y=p.length;"separator"===p[0].type&&(u+="top ",m=1),"separator"===p[p.length-1].type&&(u+="bottom ",y-=1);for(var v=m;v0?"left ":"",u+=T[T.length-1].length>0?"right ":"";for(var _=1;_-1?"alignat":"align",a="split"===t.envName,s=uO(t.parser,{cols:r,addJot:!0,autoTag:a?void 0:hO(t.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:t.parser.settings.leqno},"display"),o=0,l={type:"ordgroup",mode:t.mode,body:[]};if(e[0]&&"ordgroup"===e[0].type){for(var c="",h=0;h0&&u&&(g=1),r[d]={type:"align",align:p,pregap:g,postgap:0}}return s.colSeparationType=u?"align":"alignat",s}),"alignedHandler");aO({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=(iD(e[0])?[e[0]]:nD(e[0],"ordgroup").body).map((function(t){var e=rD(t).text;if(-1!=="lcr".indexOf(e))return{type:"align",align:e};if("|"===e)return{type:"separator",separator:"|"};if(":"===e)return{type:"separator",separator:":"};throw new qN("Unknown column alignment: "+e,t)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return uO(t.parser,r,dO(t.envName))},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===t.envName.charAt(t.envName.length-1)){var i=t.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new qN("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=uO(t.parser,r,dO(t.envName)),s=Math.max(0,...a.body.map((t=>t.length)));return a.cols=new Array(s).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e=uO(t.parser,{arraystretch:.5},"script");return e.colSeparationType="small",e},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=(iD(e[0])?[e[0]]:nD(e[0],"ordgroup").body).map((function(t){var e=rD(t).text;if(-1!=="lc".indexOf(e))return{type:"align",align:e};throw new qN("Unknown column alignment: "+e,t)}));if(n.length>1)throw new qN("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=uO(t.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new qN("{subarray} can contain only one column");return r},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e=uO(t.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},dO(t.envName));return{type:"leftright",mode:t.mode,body:[e],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:mO,htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){tI.contains(["gather","gather*"],t.envName)&&cO(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:hO(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return uO(t.parser,e,"display")},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:mO,htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){cO(t);var e={autoTag:hO(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return uO(t.parser,e,"display")},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["CD"],props:{numArgs:0},handler:t=>(cO(t),vD(t.parser)),htmlBuilder:pO,mathmlBuilder:fO}),oO("\\nonumber","\\gdef\\@eqnsw{0}"),oO("\\notag","\\nonumber"),fR({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new qN(t.funcName+" valid only within array environment")}});var yO=iO;fR({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];if("ordgroup"!==i.type)throw new qN("Invalid environment name",i);for(var a="",s=0;s{var n=t.font,r=e.withFont(n);return NR(t.body,r)}),"htmlBuilder$5"),xO=s(((t,e)=>{var n=t.font,r=e.withFont(n);return qR(t.body,r)}),"mathmlBuilder$4"),bO={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};fR({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=yR(e[0]),a=r;return a in bO&&(a=bO[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}}),"handler"),htmlBuilder:vO,mathmlBuilder:xO}),fR({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:s(((t,e)=>{var{parser:n}=t,r=e[0],i=tI.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:dD(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}),"handler")}),fR({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:s(((t,e)=>{var{parser:n,funcName:r,breakOnTokenText:i}=t,{mode:a}=n,s=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:s}}}),"handler"),htmlBuilder:vO,mathmlBuilder:xO});var wO=s(((t,e)=>{var n=e;return"display"===t?n=n.id>=dI.SCRIPT.id?n.text():dI.DISPLAY:"text"===t&&n.size===dI.DISPLAY.size?n=dI.TEXT:"script"===t?n=dI.SCRIPT:"scriptscript"===t&&(n=dI.SCRIPTSCRIPT),n}),"adjustStyle"),kO=s(((t,e)=>{var n,r=wO(t.size,e.style),i=r.fracNum(),a=r.fracDen();n=e.havingStyle(i);var s=NR(t.numer,n,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?3*u:7*u,g=e.fontMetrics().denom1):(h>0?(d=e.fontMetrics().num2,p=u):(d=e.fontMetrics().num3,p=3*u),g=e.fontMetrics().denom2),c){var b=e.fontMetrics().axisHeight;d-s.depth-(b+.5*h){var n=new BR.MathNode("mfrac",[qR(t.numer,e),qR(t.denom,e)]);if(t.hasBarLine){if(t.barSize){var r=qI(t.barSize,e);n.setAttribute("linethickness",jI(r))}}else n.setAttribute("linethickness","0px");var i=wO(t.size,e.style);if(i.size!==e.style.size){n=new BR.MathNode("mstyle",[n]);var a=i.size===dI.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",a),n.setAttribute("scriptlevel","0")}if(null!=t.leftDelim||null!=t.rightDelim){var s=[];if(null!=t.leftDelim){var o=new BR.MathNode("mo",[new BR.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(n),null!=t.rightDelim){var l=new BR.MathNode("mo",[new BR.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return FR(s)}return n}),"mathmlBuilder$3");fR({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:s(((t,e)=>{var n,{parser:r,funcName:i}=t,a=e[0],s=e[1],o=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,o="(",l=")";break;case"\\\\bracefrac":n=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:a,denom:s,hasBarLine:n,leftDelim:o,rightDelim:l,size:c,barSize:null}}),"handler"),htmlBuilder:kO,mathmlBuilder:TO}),fR({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0],a=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}),"handler")}),fR({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var e,{parser:n,funcName:r,token:i}=t;switch(r){case"\\over":e="\\frac";break;case"\\choose":e="\\binom";break;case"\\atop":e="\\\\atopfrac";break;case"\\brace":e="\\\\bracefrac";break;case"\\brack":e="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:e,token:i}}});var _O=["display","text","script","scriptscript"],EO=s((function(t){var e=null;return t.length>0&&(e="."===(e=t)?null:e),e}),"delimFromValue");fR({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var n,{parser:r}=t,i=e[4],a=e[5],s=yR(e[0]),o="atom"===s.type&&"open"===s.family?EO(s.text):null,l=yR(e[1]),c="atom"===l.type&&"close"===l.family?EO(l.text):null,h=nD(e[2],"size"),u=null;n=!!h.isBlank||(u=h.value).number>0;var d="auto",p=e[3];if("ordgroup"===p.type){if(p.body.length>0){var g=nD(p.body[0],"textord");d=_O[Number(g.text)]}}else p=nD(p,"textord"),d=_O[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:n,barSize:u,leftDelim:o,rightDelim:c,size:d}},htmlBuilder:kO,mathmlBuilder:TO}),fR({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:i}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:nD(e[0],"size").value,token:i}}}),fR({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0],a=JN(nD(e[1],"infix").size),s=e[2],o=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}}),"handler"),htmlBuilder:kO,mathmlBuilder:TO});var CO=s(((t,e)=>{var n,r,i=e.style;"supsub"===t.type?(n=t.sup?NR(t.sup,e.havingStyle(i.sup()),e):NR(t.sub,e.havingStyle(i.sub()),e),r=nD(t.base,"horizBrace")):r=nD(t,"horizBrace");var a,s=NR(r.base,e.havingBaseStyle(dI.DISPLAY)),o=eD.svgSpan(r,e);if(r.isOver?(a=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e)).children[0].children[0].children[1].classes.push("svg-align"):(a=sR.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=sR.makeSpan(["mord",r.isOver?"mover":"munder"],[a],e);a=r.isOver?sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):sR.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return sR.makeSpan(["mord",r.isOver?"mover":"munder"],[a],e)}),"htmlBuilder$3");fR({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:CO,mathmlBuilder:s(((t,e)=>{var n=eD.mathMLnode(t.label);return new BR.MathNode(t.isOver?"mover":"munder",[qR(t.base,e),n])}),"mathmlBuilder$2")}),fR({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[1],i=nD(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:vR(r)}:n.formatUnsupportedCmd("\\href")}),"handler"),htmlBuilder:s(((t,e)=>{var n=_R(t.body,e,!1);return sR.makeAnchor(t.href,[],n,e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=GR(t.body,e);return n instanceof DR||(n=new DR("mrow",[n])),n.setAttribute("href",t.href),n}),"mathmlBuilder")}),fR({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=nD(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;anew BR.MathNode("mrow",UR(t.body,e))}),fR({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:s(((t,e)=>{var n,{parser:r,funcName:i,token:a}=t,s=nD(e[0],"raw").string,o=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=s,n={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,n={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,n={command:"\\htmlStyle",style:s};break;case"\\htmlData":for(var c=s.split(","),h=0;h{var n=_R(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var i=sR.makeSpan(r,n,e);for(var a in t.attributes)"class"!==a&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>GR(t.body,e)),"mathmlBuilder")}),fR({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:vR(e[0]),mathml:vR(e[1])}}),"handler"),htmlBuilder:s(((t,e)=>{var n=_R(t.html,e,!1);return sR.makeFragment(n)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>GR(t.mathml,e)),"mathmlBuilder")});var SO=s((function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var e=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!e)throw new qN("Invalid size: '"+t+"' in \\includegraphics");var n={number:+(e[1]+e[2]),unit:e[3]};if(!GI(n))throw new qN("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n}),"sizeData");fR({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:s(((t,e,n)=>{var{parser:r}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(n[0])for(var l=nD(n[0],"raw").string.split(","),c=0;c{var n=qI(t.height,e),r=0;t.totalheight.number>0&&(r=qI(t.totalheight,e)-n);var i=0;t.width.number>0&&(i=qI(t.width,e));var a={height:jI(n+r)};i>0&&(a.width=jI(i)),r>0&&(a.verticalAlign=jI(-r));var s=new ZI(t.src,t.alt,a);return s.height=n,s.depth=r,s}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=new BR.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=qI(t.height,e),i=0;if(t.totalheight.number>0&&(i=qI(t.totalheight,e)-r,n.setAttribute("valign",jI(-i))),n.setAttribute("height",jI(r+i)),t.width.number>0){var a=qI(t.width,e);n.setAttribute("width",jI(a))}return n.setAttribute("src",t.src),n}),"mathmlBuilder")}),fR({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=nD(e[0],"size");if(n.settings.strict){var a="m"===r[1],s="mu"===i.value.unit;a?(s||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):s&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(t,e)=>sR.makeGlue(t.dimension,e),mathmlBuilder(t,e){var n=qI(t.dimension,e);return new BR.SpaceNode(n)}}),fR({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}}),"handler"),htmlBuilder:s(((t,e)=>{var n;"clap"===t.alignment?(n=sR.makeSpan([],[NR(t.body,e)]),n=sR.makeSpan(["inner"],[n],e)):n=sR.makeSpan(["inner"],[NR(t.body,e)]);var r=sR.makeSpan(["fix"],[]),i=sR.makeSpan([t.alignment],[n,r],e),a=sR.makeSpan(["strut"]);return a.style.height=jI(i.height+i.depth),i.depth&&(a.style.verticalAlign=jI(-i.depth)),i.children.unshift(a),i=sR.makeSpan(["thinbox"],[i],e),sR.makeSpan(["mord","vbox"],[i],e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=new BR.MathNode("mpadded",[qR(t.body,e)]);if("rlap"!==t.alignment){var r="llap"===t.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}),"mathmlBuilder")}),fR({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,i=r.mode;r.switchMode("math");var a="\\("===n?"\\)":"$",s=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:s}}}),fR({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new qN("Mismatched "+t.funcName)}});var AO=s(((t,e)=>{switch(e.style.size){case dI.DISPLAY.size:return t.display;case dI.TEXT.size:return t.text;case dI.SCRIPT.size:return t.script;case dI.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}}),"chooseMathStyle");fR({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:s(((t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:vR(e[0]),text:vR(e[1]),script:vR(e[2]),scriptscript:vR(e[3])}}),"handler"),htmlBuilder:s(((t,e)=>{var n=AO(t,e),r=_R(n,e,!1);return sR.makeFragment(r)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=AO(t,e);return GR(n,e)}),"mathmlBuilder")});var LO=s(((t,e,n,r,i,a,s)=>{t=sR.makeSpan([],[t]);var o,l,c,h=n&&tI.isCharacterBox(n);if(e){var u=NR(e,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=NR(n,r.havingStyle(i.sub()),r);o={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&o){var p=r.fontMetrics().bigOpSpacing5+o.elem.height+o.elem.depth+o.kern+t.depth+s;c=sR.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:jI(-a)},{type:"kern",size:o.kern},{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:jI(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(o){var g=t.height-s;c=sR.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:jI(-a)},{type:"kern",size:o.kern},{type:"elem",elem:t}]},r)}else{if(!l)return t;var f=t.depth+s;c=sR.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:jI(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var m=[c];if(o&&0!==a&&!h){var y=sR.makeSpan(["mspace"],[],r);y.style.marginRight=jI(a),m.unshift(y)}return sR.makeSpan(["mop","op-limits"],m,r)}),"assembleSupSub"),NO=["\\smallint"],IO=s(((t,e)=>{var n,r,i,a=!1;"supsub"===t.type?(n=t.sup,r=t.sub,i=nD(t.base,"op"),a=!0):i=nD(t,"op");var s,o=e.style,l=!1;if(o.size===dI.DISPLAY.size&&i.symbol&&!tI.contains(NO,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",h="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(h=i.name.slice(1),i.name="oiint"===h?"\\iint":"\\iiint"),s=sR.makeSymbol(i.name,c,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var u=s.italic,d=sR.staticSvg(h+"Size"+(l?"2":"1"),e);s=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},e),i.name="\\"+h,s.classes.unshift("mop"),s.italic=u}}else if(i.body){var p=_R(i.body,e,!0);1===p.length&&p[0]instanceof JI?(s=p[0]).classes[0]="mop":s=sR.makeSpan(["mop"],p,e)}else{for(var g=[],f=1;f{var n;if(t.symbol)n=new DR("mo",[$R(t.name,t.mode)]),tI.contains(NO,t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new DR("mo",UR(t.body,e));else{n=new DR("mi",[new OR(t.name.slice(1))]);var r=new DR("mo",[$R("⁡","text")]);n=t.parentIsSupSub?new DR("mrow",[n,r]):RR([n,r])}return n}),"mathmlBuilder$1"),RO={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};fR({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=r;return 1===i.length&&(i=RO[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}}),"handler"),htmlBuilder:IO,mathmlBuilder:MO}),fR({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:vR(r)}}),"handler"),htmlBuilder:IO,mathmlBuilder:MO});var DO={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};fR({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:IO,mathmlBuilder:MO}),fR({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:IO,mathmlBuilder:MO}),fR({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t,r=n;return 1===r.length&&(r=DO[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:IO,mathmlBuilder:MO});var OO=s(((t,e)=>{var n,r,i,a,s=!1;if("supsub"===t.type?(n=t.sup,r=t.sub,i=nD(t.base,"operatorname"),s=!0):i=nD(t,"operatorname"),i.body.length>0){for(var o=i.body.map((t=>{var e=t.text;return"string"==typeof e?{type:"textord",mode:t.mode,text:e}:t})),l=_R(o,e.withFont("mathrm"),!0),c=0;c{for(var n=UR(t.body,e.withFont("mathrm")),r=!0,i=0;it.toText())).join("");n=[new BR.TextNode(o)]}var l=new BR.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new BR.MathNode("mo",[$R("⁡","text")]);return t.parentIsSupSub?new BR.MathNode("mrow",[l,c]):BR.newDocumentFragment([l,c])}),"mathmlBuilder");function BO(t,e,n){for(var r=_R(t,e,!1),i=e.sizeMultiplier/n.sizeMultiplier,a=0;a{var{parser:n,funcName:r}=t,i=e[0];return{type:"operatorname",mode:n.mode,body:vR(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}}),"handler"),htmlBuilder:OO,mathmlBuilder:PO}),oO("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),mR({type:"ordgroup",htmlBuilder:(t,e)=>t.semisimple?sR.makeFragment(_R(t.body,e,!1)):sR.makeSpan(["mord"],_R(t.body,e,!0),e),mathmlBuilder:(t,e)=>GR(t.body,e,!0)}),fR({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=NR(t.body,e.havingCrampedStyle()),r=sR.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},e);return sR.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var n=new BR.MathNode("mo",[new BR.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new BR.MathNode("mover",[qR(t.body,e),n]);return r.setAttribute("accent","true"),r}}),fR({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:vR(r)}}),"handler"),htmlBuilder:s(((t,e)=>{var n=_R(t.body,e.withPhantom(),!1);return sR.makeFragment(n)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=UR(t.body,e);return new BR.MathNode("mphantom",n)}),"mathmlBuilder")}),fR({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}}),"handler"),htmlBuilder:s(((t,e)=>{var n=sR.makeSpan([],[NR(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=UR(vR(t.body),e),r=new BR.MathNode("mphantom",n),i=new BR.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}),"mathmlBuilder")}),fR({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}}),"handler"),htmlBuilder:s(((t,e)=>{var n=sR.makeSpan(["inner"],[NR(t.body,e.withPhantom())]),r=sR.makeSpan(["fix"],[]);return sR.makeSpan(["mord","rlap"],[n,r],e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=UR(vR(t.body),e),r=new BR.MathNode("mphantom",n),i=new BR.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}),"mathmlBuilder")}),fR({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=nD(e[0],"size").value,i=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(t,e){var n=NR(t.body,e),r=qI(t.dy,e);return sR.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new BR.MathNode("mpadded",[qR(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}}),fR({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),fR({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,i=n[0],a=nD(e[0],"size"),s=nD(e[1],"size");return{type:"rule",mode:r.mode,shift:i&&nD(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var n=sR.makeSpan(["mord","rule"],[],e),r=qI(t.width,e),i=qI(t.height,e),a=t.shift?qI(t.shift,e):0;return n.style.borderRightWidth=jI(r),n.style.borderTopWidth=jI(i),n.style.bottom=jI(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=1.125*i*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=qI(t.width,e),r=qI(t.height,e),i=t.shift?qI(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new BR.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",jI(n)),s.setAttribute("height",jI(r));var o=new BR.MathNode("mpadded",[s]);return i>=0?o.setAttribute("height",jI(i)):(o.setAttribute("height",jI(i)),o.setAttribute("depth",jI(-i))),o.setAttribute("voffset",jI(i)),o}}),s(BO,"sizingGroup");var $O=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],FO=s(((t,e)=>{var n=e.havingSize(t.size);return BO(t.body,n,e)}),"htmlBuilder");fR({type:"sizing",names:$O,props:{numArgs:0,allowedInText:!0},handler:s(((t,e)=>{var{breakOnTokenText:n,funcName:r,parser:i}=t,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:$O.indexOf(r)+1,body:a}}),"handler"),htmlBuilder:FO,mathmlBuilder:s(((t,e)=>{var n=e.havingSize(t.size),r=UR(t.body,n),i=new BR.MathNode("mstyle",r);return i.setAttribute("mathsize",jI(n.sizeMultiplier)),i}),"mathmlBuilder")}),fR({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:s(((t,e,n)=>{var{parser:r}=t,i=!1,a=!1,s=n[0]&&nD(n[0],"ordgroup");if(s)for(var o="",l=0;l{var n=sR.makeSpan([],[NR(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new BR.MathNode("mpadded",[qR(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}),"mathmlBuilder")}),fR({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,i=n[0],a=e[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(t,e){var n=NR(t.body,e.havingCrampedStyle());0===n.height&&(n.height=e.fontMetrics().xHeight),n=sR.wrapFragment(n,e);var r=e.fontMetrics().defaultRuleThickness,i=r;e.style.idn.height+n.depth+a&&(a=(a+h-n.height-n.depth)/2);var u=o.height-n.height-a-l;n.style.paddingLeft=jI(c);var d=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:o},{type:"kern",size:l}]},e);if(t.index){var p=e.havingStyle(dI.SCRIPTSCRIPT),g=NR(t.index,p,e),f=.6*(d.height-d.depth),m=sR.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:g}]},e),y=sR.makeSpan(["root"],[m]);return sR.makeSpan(["mord","sqrt"],[y,d],e)}return sR.makeSpan(["mord","sqrt"],[d],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new BR.MathNode("mroot",[qR(n,e),qR(r,e)]):new BR.MathNode("msqrt",[qR(n,e)])}});var zO={display:dI.DISPLAY,text:dI.TEXT,script:dI.SCRIPT,scriptscript:dI.SCRIPTSCRIPT};fR({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:i}=t,a=i.parseExpression(!0,n),s=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var n=zO[t.style],r=e.havingStyle(n).withFont("");return BO(t.body,r,e)},mathmlBuilder(t,e){var n=zO[t.style],r=e.havingStyle(n),i=UR(t.body,r),a=new BR.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[t.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}});var UO=s((function(t,e){var n=t.base;return n?"op"===n.type?n.limits&&(e.style.size===dI.DISPLAY.size||n.alwaysHandleSupSub)?IO:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(e.style.size===dI.DISPLAY.size||n.limits)?OO:null:"accent"===n.type?tI.isCharacterBox(n.base)?aD:null:"horizBrace"===n.type&&!t.sub===n.isOver?CO:null:null}),"htmlBuilderDelegate");mR({type:"supsub",htmlBuilder(t,e){var n=UO(t,e);if(n)return n(t,e);var r,i,a,{base:s,sup:o,sub:l}=t,c=NR(s,e),h=e.fontMetrics(),u=0,d=0,p=s&&tI.isCharacterBox(s);if(o){var g=e.havingStyle(e.style.sup());r=NR(o,g,e),p||(u=c.height-g.fontMetrics().supDrop*g.sizeMultiplier/e.sizeMultiplier)}if(l){var f=e.havingStyle(e.style.sub());i=NR(l,f,e),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/e.sizeMultiplier)}a=e.style===dI.DISPLAY?h.sup1:e.style.cramped?h.sup3:h.sup2;var m,y=e.sizeMultiplier,v=jI(.5/h.ptPerEm/y),x=null;if(i){var b=t.base&&"op"===t.base.type&&t.base.name&&("\\oiint"===t.base.name||"\\oiiint"===t.base.name);(c instanceof JI||b)&&(x=jI(-c.italic))}if(r&&i){u=Math.max(u,a,r.depth+.25*h.xHeight),d=Math.max(d,h.sub2);var w=4*h.defaultRuleThickness;if(u-r.depth-(i.height-d)0&&(u+=k,d-=k)}var T=[{type:"elem",elem:i,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:r,shift:-u,marginRight:v}];m=sR.makeVList({positionType:"individualShift",children:T},e)}else if(i){d=Math.max(d,h.sub1,i.height-.8*h.xHeight);var _=[{type:"elem",elem:i,marginLeft:x,marginRight:v}];m=sR.makeVList({positionType:"shift",positionData:d,children:_},e)}else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,a,r.depth+.25*h.xHeight),m=sR.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:v}]},e)}var E=AR(c,"right")||"mord";return sR.makeSpan([E],[c,sR.makeSpan(["msupsub"],[m])],e)},mathmlBuilder(t,e){var n,r=!1;t.base&&"horizBrace"===t.base.type&&!!t.sup===t.base.isOver&&(r=!0,n=t.base.isOver),!t.base||"op"!==t.base.type&&"operatorname"!==t.base.type||(t.base.parentIsSupSub=!0);var i,a=[qR(t.base,e)];if(t.sub&&a.push(qR(t.sub,e)),t.sup&&a.push(qR(t.sup,e)),r)i=n?"mover":"munder";else if(t.sub)if(t.sup){var s=t.base;i=s&&"op"===s.type&&s.limits&&e.style===dI.DISPLAY||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(e.style===dI.DISPLAY||s.limits)?"munderover":"msubsup"}else{var o=t.base;i=o&&"op"===o.type&&o.limits&&(e.style===dI.DISPLAY||o.alwaysHandleSupSub)||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(o.limits||e.style===dI.DISPLAY)?"munder":"msub"}else{var l=t.base;i=l&&"op"===l.type&&l.limits&&(e.style===dI.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||e.style===dI.DISPLAY)?"mover":"msup"}return new BR.MathNode(i,a)}}),mR({type:"atom",htmlBuilder:(t,e)=>sR.mathsym(t.text,t.mode,e,["m"+t.family]),mathmlBuilder(t,e){var n=new BR.MathNode("mo",[$R(t.text,t.mode)]);if("bin"===t.family){var r=zR(t,e);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===t.family?n.setAttribute("separator","true"):"open"!==t.family&&"close"!==t.family||n.setAttribute("stretchy","false");return n}});var GO={mi:"italic",mn:"normal",mtext:"normal"};mR({type:"mathord",htmlBuilder:(t,e)=>sR.makeOrd(t,e,"mathord"),mathmlBuilder(t,e){var n=new BR.MathNode("mi",[$R(t.text,t.mode,e)]),r=zR(t,e)||"italic";return r!==GO[n.type]&&n.setAttribute("mathvariant",r),n}}),mR({type:"textord",htmlBuilder:(t,e)=>sR.makeOrd(t,e,"textord"),mathmlBuilder(t,e){var n,r=$R(t.text,t.mode,e),i=zR(t,e)||"normal";return n="text"===t.mode?new BR.MathNode("mtext",[r]):/[0-9]/.test(t.text)?new BR.MathNode("mn",[r]):"\\prime"===t.text?new BR.MathNode("mo",[r]):new BR.MathNode("mi",[r]),i!==GO[n.type]&&n.setAttribute("mathvariant",i),n}});var qO={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},jO={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};mR({type:"spacing",htmlBuilder(t,e){if(jO.hasOwnProperty(t.text)){var n=jO[t.text].className||"";if("text"===t.mode){var r=sR.makeOrd(t,e,"textord");return r.classes.push(n),r}return sR.makeSpan(["mspace",n],[sR.mathsym(t.text,t.mode,e)],e)}if(qO.hasOwnProperty(t.text))return sR.makeSpan(["mspace",qO[t.text]],[],e);throw new qN('Unknown type of space "'+t.text+'"')},mathmlBuilder(t,e){if(!jO.hasOwnProperty(t.text)){if(qO.hasOwnProperty(t.text))return new BR.MathNode("mspace");throw new qN('Unknown type of space "'+t.text+'"')}return new BR.MathNode("mtext",[new BR.TextNode(" ")])}});var YO=s((()=>{var t=new BR.MathNode("mtd",[]);return t.setAttribute("width","50%"),t}),"pad");mR({type:"tag",mathmlBuilder(t,e){var n=new BR.MathNode("mtable",[new BR.MathNode("mtr",[YO(),new BR.MathNode("mtd",[GR(t.body,e)]),YO(),new BR.MathNode("mtd",[GR(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var WO={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},HO={"\\textbf":"textbf","\\textmd":"textmd"},VO={"\\textit":"textit","\\textup":"textup"},XO=s(((t,e)=>{var n=t.font;return n?WO[n]?e.withTextFontFamily(WO[n]):HO[n]?e.withTextFontWeight(HO[n]):"\\emph"===n?"textit"===e.fontShape?e.withTextFontShape("textup"):e.withTextFontShape("textit"):e.withTextFontShape(VO[n]):e}),"optionsWithFont");fR({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"text",mode:n.mode,body:vR(i),font:r}},htmlBuilder(t,e){var n=XO(t,e),r=_R(t.body,n,!0);return sR.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=XO(t,e);return GR(t.body,n)}}),fR({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=NR(t.body,e),r=sR.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=sR.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},e);return sR.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var n=new BR.MathNode("mo",[new BR.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new BR.MathNode("munder",[qR(t.body,e),n]);return r.setAttribute("accentunder","true"),r}}),fR({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=NR(t.body,e),r=e.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return sR.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},e)},mathmlBuilder:(t,e)=>new BR.MathNode("mpadded",[qR(t.body,e)],["vcenter"])}),fR({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new qN("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=KO(t),r=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" ")),"makeVerb"),ZO=dR,QO=new RegExp("[̀-ͯ]+$"),JO=class{static{s(this,"Lexer")}constructor(t,e){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=e,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿][̀-ͯ]*|[\ud800-\udbff][\udc00-\udfff][̀-ͯ]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}setCatcode(t,e){this.catcodes[t]=e}lex(){var t=this.input,e=this.tokenRegex.lastIndex;if(e===t.length)return new GN("EOF",new UN(this,e,e));var n=this.tokenRegex.exec(t);if(null===n||n.index!==e)throw new qN("Unexpected character: '"+t[e]+"'",new GN(t[e],new UN(this,e,e+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=t.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new GN(r,new UN(this,e,this.tokenRegex.lastIndex))}},tP=class{static{s(this,"Namespace")}constructor(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=e,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new qN("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var e in t)t.hasOwnProperty(e)&&(null==t[e]?delete this.current[e]:this.current[e]=t[e])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,e,n){if(void 0===n&&(n=!1),n){for(var r=0;r0&&(this.undefStack[this.undefStack.length-1][t]=e)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}null==e?delete this.current[t]:this.current[t]=e}},eP=sO;oO("\\noexpand",(function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}})),oO("\\expandafter",(function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}})),oO("\\@firstoftwo",(function(t){return{tokens:t.consumeArgs(2)[0],numArgs:0}})),oO("\\@secondoftwo",(function(t){return{tokens:t.consumeArgs(2)[1],numArgs:0}})),oO("\\@ifnextchar",(function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return 1===e[0].length&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}})),oO("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),oO("\\TextOrMath",(function(t){var e=t.consumeArgs(2);return"text"===t.mode?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}}));var nP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};oO("\\char",(function(t){var e,n=t.popToken(),r="";if("'"===n.text)e=8,n=t.popToken();else if('"'===n.text)e=16,n=t.popToken();else if("`"===n.text)if("\\"===(n=t.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new qN("\\char` missing argument");r=n.text.charCodeAt(0)}else e=10;if(e){if(null==(r=nP[n.text])||r>=e)throw new qN("Invalid base-"+e+" digit "+n.text);for(var i;null!=(i=nP[t.future().text])&&i{var r=t.consumeArg().tokens;if(1!==r.length)throw new qN("\\newcommand's first argument must be a macro name");var i=r[0].text,a=t.isDefined(i);if(a&&!e)throw new qN("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!a&&!n)throw new qN("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(r=t.consumeArg().tokens).length&&"["===r[0].text){for(var o="",l=t.expandNextToken();"]"!==l.text&&"EOF"!==l.text;)o+=l.text,l=t.expandNextToken();if(!o.match(/^\s*[0-9]+\s*$/))throw new qN("Invalid number of arguments: "+o);s=parseInt(o),r=t.consumeArg().tokens}return t.macros.set(i,{tokens:r,numArgs:s}),""}),"newcommand");oO("\\newcommand",(t=>rP(t,!1,!0))),oO("\\renewcommand",(t=>rP(t,!0,!1))),oO("\\providecommand",(t=>rP(t,!0,!0))),oO("\\message",(t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map((t=>t.text)).join("")),""})),oO("\\errmessage",(t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map((t=>t.text)).join("")),""})),oO("\\show",(t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),ZO[n],oM.math[n],oM.text[n]),""})),oO("\\bgroup","{"),oO("\\egroup","}"),oO("~","\\nobreakspace"),oO("\\lq","`"),oO("\\rq","'"),oO("\\aa","\\r a"),oO("\\AA","\\r A"),oO("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),oO("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),oO("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),oO("ℬ","\\mathscr{B}"),oO("ℰ","\\mathscr{E}"),oO("ℱ","\\mathscr{F}"),oO("ℋ","\\mathscr{H}"),oO("ℐ","\\mathscr{I}"),oO("ℒ","\\mathscr{L}"),oO("ℳ","\\mathscr{M}"),oO("ℛ","\\mathscr{R}"),oO("ℭ","\\mathfrak{C}"),oO("ℌ","\\mathfrak{H}"),oO("ℨ","\\mathfrak{Z}"),oO("\\Bbbk","\\Bbb{k}"),oO("·","\\cdotp"),oO("\\llap","\\mathllap{\\textrm{#1}}"),oO("\\rlap","\\mathrlap{\\textrm{#1}}"),oO("\\clap","\\mathclap{\\textrm{#1}}"),oO("\\mathstrut","\\vphantom{(}"),oO("\\underbar","\\underline{\\text{#1}}"),oO("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),oO("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),oO("\\ne","\\neq"),oO("≠","\\neq"),oO("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),oO("∉","\\notin"),oO("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),oO("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),oO("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),oO("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),oO("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),oO("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),oO("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),oO("⟂","\\perp"),oO("‼","\\mathclose{!\\mkern-0.8mu!}"),oO("∌","\\notni"),oO("⌜","\\ulcorner"),oO("⌝","\\urcorner"),oO("⌞","\\llcorner"),oO("⌟","\\lrcorner"),oO("©","\\copyright"),oO("®","\\textregistered"),oO("️","\\textregistered"),oO("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),oO("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),oO("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),oO("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),oO("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),oO("⋮","\\vdots"),oO("\\varGamma","\\mathit{\\Gamma}"),oO("\\varDelta","\\mathit{\\Delta}"),oO("\\varTheta","\\mathit{\\Theta}"),oO("\\varLambda","\\mathit{\\Lambda}"),oO("\\varXi","\\mathit{\\Xi}"),oO("\\varPi","\\mathit{\\Pi}"),oO("\\varSigma","\\mathit{\\Sigma}"),oO("\\varUpsilon","\\mathit{\\Upsilon}"),oO("\\varPhi","\\mathit{\\Phi}"),oO("\\varPsi","\\mathit{\\Psi}"),oO("\\varOmega","\\mathit{\\Omega}"),oO("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),oO("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),oO("\\boxed","\\fbox{$\\displaystyle{#1}$}"),oO("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),oO("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),oO("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var iP={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};oO("\\dots",(function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in iP?e=iP[n]:("\\not"===n.slice(0,4)||n in oM.math&&tI.contains(["bin","rel"],oM.math[n].group))&&(e="\\dotsb"),e}));var aP={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};oO("\\dotso",(function(t){return t.future().text in aP?"\\ldots\\,":"\\ldots"})),oO("\\dotsc",(function(t){var e=t.future().text;return e in aP&&","!==e?"\\ldots\\,":"\\ldots"})),oO("\\cdots",(function(t){return t.future().text in aP?"\\@cdots\\,":"\\@cdots"})),oO("\\dotsb","\\cdots"),oO("\\dotsm","\\cdots"),oO("\\dotsi","\\!\\cdots"),oO("\\dotsx","\\ldots\\,"),oO("\\DOTSI","\\relax"),oO("\\DOTSB","\\relax"),oO("\\DOTSX","\\relax"),oO("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),oO("\\,","\\tmspace+{3mu}{.1667em}"),oO("\\thinspace","\\,"),oO("\\>","\\mskip{4mu}"),oO("\\:","\\tmspace+{4mu}{.2222em}"),oO("\\medspace","\\:"),oO("\\;","\\tmspace+{5mu}{.2777em}"),oO("\\thickspace","\\;"),oO("\\!","\\tmspace-{3mu}{.1667em}"),oO("\\negthinspace","\\!"),oO("\\negmedspace","\\tmspace-{4mu}{.2222em}"),oO("\\negthickspace","\\tmspace-{5mu}{.277em}"),oO("\\enspace","\\kern.5em "),oO("\\enskip","\\hskip.5em\\relax"),oO("\\quad","\\hskip1em\\relax"),oO("\\qquad","\\hskip2em\\relax"),oO("\\tag","\\@ifstar\\tag@literal\\tag@paren"),oO("\\tag@paren","\\tag@literal{({#1})}"),oO("\\tag@literal",(t=>{if(t.macros.get("\\df@tag"))throw new qN("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),oO("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),oO("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),oO("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),oO("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),oO("\\newline","\\\\\\relax"),oO("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var sP=jI(LI["Main-Regular"]["T".charCodeAt(0)][1]-.7*LI["Main-Regular"]["A".charCodeAt(0)][1]);oO("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+sP+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),oO("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+sP+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),oO("\\hspace","\\@ifstar\\@hspacer\\@hspace"),oO("\\@hspace","\\hskip #1\\relax"),oO("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),oO("\\ordinarycolon",":"),oO("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),oO("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),oO("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),oO("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),oO("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),oO("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),oO("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),oO("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),oO("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),oO("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),oO("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),oO("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),oO("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),oO("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),oO("∷","\\dblcolon"),oO("∹","\\eqcolon"),oO("≔","\\coloneqq"),oO("≕","\\eqqcolon"),oO("⩴","\\Coloneqq"),oO("\\ratio","\\vcentcolon"),oO("\\coloncolon","\\dblcolon"),oO("\\colonequals","\\coloneqq"),oO("\\coloncolonequals","\\Coloneqq"),oO("\\equalscolon","\\eqqcolon"),oO("\\equalscoloncolon","\\Eqqcolon"),oO("\\colonminus","\\coloneq"),oO("\\coloncolonminus","\\Coloneq"),oO("\\minuscolon","\\eqcolon"),oO("\\minuscoloncolon","\\Eqcolon"),oO("\\coloncolonapprox","\\Colonapprox"),oO("\\coloncolonsim","\\Colonsim"),oO("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),oO("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),oO("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),oO("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),oO("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),oO("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),oO("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),oO("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),oO("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),oO("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),oO("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),oO("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),oO("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),oO("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),oO("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),oO("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),oO("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),oO("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),oO("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),oO("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),oO("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),oO("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),oO("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),oO("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),oO("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),oO("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),oO("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),oO("\\imath","\\html@mathml{\\@imath}{ı}"),oO("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),oO("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),oO("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),oO("⟦","\\llbracket"),oO("⟧","\\rrbracket"),oO("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),oO("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),oO("⦃","\\lBrace"),oO("⦄","\\rBrace"),oO("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),oO("⦵","\\minuso"),oO("\\darr","\\downarrow"),oO("\\dArr","\\Downarrow"),oO("\\Darr","\\Downarrow"),oO("\\lang","\\langle"),oO("\\rang","\\rangle"),oO("\\uarr","\\uparrow"),oO("\\uArr","\\Uparrow"),oO("\\Uarr","\\Uparrow"),oO("\\N","\\mathbb{N}"),oO("\\R","\\mathbb{R}"),oO("\\Z","\\mathbb{Z}"),oO("\\alef","\\aleph"),oO("\\alefsym","\\aleph"),oO("\\Alpha","\\mathrm{A}"),oO("\\Beta","\\mathrm{B}"),oO("\\bull","\\bullet"),oO("\\Chi","\\mathrm{X}"),oO("\\clubs","\\clubsuit"),oO("\\cnums","\\mathbb{C}"),oO("\\Complex","\\mathbb{C}"),oO("\\Dagger","\\ddagger"),oO("\\diamonds","\\diamondsuit"),oO("\\empty","\\emptyset"),oO("\\Epsilon","\\mathrm{E}"),oO("\\Eta","\\mathrm{H}"),oO("\\exist","\\exists"),oO("\\harr","\\leftrightarrow"),oO("\\hArr","\\Leftrightarrow"),oO("\\Harr","\\Leftrightarrow"),oO("\\hearts","\\heartsuit"),oO("\\image","\\Im"),oO("\\infin","\\infty"),oO("\\Iota","\\mathrm{I}"),oO("\\isin","\\in"),oO("\\Kappa","\\mathrm{K}"),oO("\\larr","\\leftarrow"),oO("\\lArr","\\Leftarrow"),oO("\\Larr","\\Leftarrow"),oO("\\lrarr","\\leftrightarrow"),oO("\\lrArr","\\Leftrightarrow"),oO("\\Lrarr","\\Leftrightarrow"),oO("\\Mu","\\mathrm{M}"),oO("\\natnums","\\mathbb{N}"),oO("\\Nu","\\mathrm{N}"),oO("\\Omicron","\\mathrm{O}"),oO("\\plusmn","\\pm"),oO("\\rarr","\\rightarrow"),oO("\\rArr","\\Rightarrow"),oO("\\Rarr","\\Rightarrow"),oO("\\real","\\Re"),oO("\\reals","\\mathbb{R}"),oO("\\Reals","\\mathbb{R}"),oO("\\Rho","\\mathrm{P}"),oO("\\sdot","\\cdot"),oO("\\sect","\\S"),oO("\\spades","\\spadesuit"),oO("\\sub","\\subset"),oO("\\sube","\\subseteq"),oO("\\supe","\\supseteq"),oO("\\Tau","\\mathrm{T}"),oO("\\thetasym","\\vartheta"),oO("\\weierp","\\wp"),oO("\\Zeta","\\mathrm{Z}"),oO("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),oO("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),oO("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),oO("\\bra","\\mathinner{\\langle{#1}|}"),oO("\\ket","\\mathinner{|{#1}\\rangle}"),oO("\\braket","\\mathinner{\\langle{#1}\\rangle}"),oO("\\Bra","\\left\\langle#1\\right|"),oO("\\Ket","\\left|#1\\right\\rangle");var oP=s((t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,o=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var c=s((e=>n=>{t&&(n.macros.set("|",o),i.length&&n.macros.set("\\|",l));var a=e;!e&&i.length&&("|"===n.future().text&&(n.popToken(),a=!0));return{tokens:a?i:r,numArgs:0}}),"midMacro");e.macros.set("|",c(!1)),i.length&&e.macros.set("\\|",c(!0));var h=e.consumeArg().tokens,u=e.expandTokens([...a,...h,...n]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}}),"braketHelper");oO("\\bra@ket",oP(!1)),oO("\\bra@set",oP(!0)),oO("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),oO("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),oO("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),oO("\\angln","{\\angl n}"),oO("\\blue","\\textcolor{##6495ed}{#1}"),oO("\\orange","\\textcolor{##ffa500}{#1}"),oO("\\pink","\\textcolor{##ff00af}{#1}"),oO("\\red","\\textcolor{##df0030}{#1}"),oO("\\green","\\textcolor{##28ae7b}{#1}"),oO("\\gray","\\textcolor{gray}{#1}"),oO("\\purple","\\textcolor{##9d38bd}{#1}"),oO("\\blueA","\\textcolor{##ccfaff}{#1}"),oO("\\blueB","\\textcolor{##80f6ff}{#1}"),oO("\\blueC","\\textcolor{##63d9ea}{#1}"),oO("\\blueD","\\textcolor{##11accd}{#1}"),oO("\\blueE","\\textcolor{##0c7f99}{#1}"),oO("\\tealA","\\textcolor{##94fff5}{#1}"),oO("\\tealB","\\textcolor{##26edd5}{#1}"),oO("\\tealC","\\textcolor{##01d1c1}{#1}"),oO("\\tealD","\\textcolor{##01a995}{#1}"),oO("\\tealE","\\textcolor{##208170}{#1}"),oO("\\greenA","\\textcolor{##b6ffb0}{#1}"),oO("\\greenB","\\textcolor{##8af281}{#1}"),oO("\\greenC","\\textcolor{##74cf70}{#1}"),oO("\\greenD","\\textcolor{##1fab54}{#1}"),oO("\\greenE","\\textcolor{##0d923f}{#1}"),oO("\\goldA","\\textcolor{##ffd0a9}{#1}"),oO("\\goldB","\\textcolor{##ffbb71}{#1}"),oO("\\goldC","\\textcolor{##ff9c39}{#1}"),oO("\\goldD","\\textcolor{##e07d10}{#1}"),oO("\\goldE","\\textcolor{##a75a05}{#1}"),oO("\\redA","\\textcolor{##fca9a9}{#1}"),oO("\\redB","\\textcolor{##ff8482}{#1}"),oO("\\redC","\\textcolor{##f9685d}{#1}"),oO("\\redD","\\textcolor{##e84d39}{#1}"),oO("\\redE","\\textcolor{##bc2612}{#1}"),oO("\\maroonA","\\textcolor{##ffbde0}{#1}"),oO("\\maroonB","\\textcolor{##ff92c6}{#1}"),oO("\\maroonC","\\textcolor{##ed5fa6}{#1}"),oO("\\maroonD","\\textcolor{##ca337c}{#1}"),oO("\\maroonE","\\textcolor{##9e034e}{#1}"),oO("\\purpleA","\\textcolor{##ddd7ff}{#1}"),oO("\\purpleB","\\textcolor{##c6b9fc}{#1}"),oO("\\purpleC","\\textcolor{##aa87ff}{#1}"),oO("\\purpleD","\\textcolor{##7854ab}{#1}"),oO("\\purpleE","\\textcolor{##543b78}{#1}"),oO("\\mintA","\\textcolor{##f5f9e8}{#1}"),oO("\\mintB","\\textcolor{##edf2df}{#1}"),oO("\\mintC","\\textcolor{##e0e5cc}{#1}"),oO("\\grayA","\\textcolor{##f6f7f7}{#1}"),oO("\\grayB","\\textcolor{##f0f1f2}{#1}"),oO("\\grayC","\\textcolor{##e3e5e6}{#1}"),oO("\\grayD","\\textcolor{##d6d8da}{#1}"),oO("\\grayE","\\textcolor{##babec2}{#1}"),oO("\\grayF","\\textcolor{##888d93}{#1}"),oO("\\grayG","\\textcolor{##626569}{#1}"),oO("\\grayH","\\textcolor{##3b3e40}{#1}"),oO("\\grayI","\\textcolor{##21242c}{#1}"),oO("\\kaBlue","\\textcolor{##314453}{#1}"),oO("\\kaGreen","\\textcolor{##71B307}{#1}");var lP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},cP=class{static{s(this,"MacroExpander")}constructor(t,e,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=e,this.expansionCount=0,this.feed(t),this.macros=new tP(eP,e.macros),this.mode=n,this.stack=[]}feed(t){this.lexer=new JO(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var e,n,r;if(t){if(this.consumeSpaces(),"["!==this.future().text)return null;e=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:e,end:n}=this.consumeArg());return this.pushToken(new GN("EOF",n.loc)),this.pushTokens(r),e.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(t){var e=[],n=t&&t.length>0;n||this.consumeSpaces();var r,i=this.future(),a=0,s=0;do{if(r=this.popToken(),e.push(r),"{"===r.text)++a;else if("}"===r.text){if(-1===--a)throw new qN("Extra }",r)}else if("EOF"===r.text)throw new qN("Unexpected end of input in a macro argument, expected '"+(t&&n?t[s]:"}")+"'",r);if(t&&n)if((0===a||1===a&&"{"===t[s])&&r.text===t[s]){if(++s===t.length){e.splice(-s,s);break}}else s=0}while(0!==a||n);return"{"===i.text&&"}"===e[e.length-1].text&&(e.pop(),e.shift()),e.reverse(),{tokens:e,start:i,end:r}}consumeArgs(t,e){if(e){if(e.length!==t+1)throw new qN("The length of delimiters doesn't match the number of args!");for(var n=e[0],r=0;rthis.settings.maxExpand)throw new qN("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var e=this.popToken(),n=e.text,r=e.noexpand?null:this._getExpansion(n);if(null==r||t&&r.unexpandable){if(t&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new qN("Undefined control sequence: "+n);return this.pushToken(e),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var s=(i=i.slice()).length-1;s>=0;--s){var o=i[s];if("#"===o.text){if(0===s)throw new qN("Incomplete placeholder at end of macro body",o);if("#"===(o=i[--s]).text)i.splice(s+1,1);else{if(!/^[1-9]$/.test(o.text))throw new qN("Not a valid argument number",o);i.splice(s,2,...a[+o.text-1])}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new GN(t)]):void 0}expandTokens(t){var e=[],n=this.stack.length;for(this.pushTokens(t);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),e.push(r)}return this.countExpansion(e.length),e}expandMacroAsText(t){var e=this.expandMacro(t);return e?e.map((t=>t.text)).join(""):e}_getExpansion(t){var e=this.macros.get(t);if(null==e)return e;if(1===t.length){var n=this.lexer.catcodes[t];if(null!=n&&13!==n)return}var r="function"==typeof e?e(this):e;if("string"==typeof r){var i=0;if(-1!==r.indexOf("#"))for(var a=r.replace(/##/g,"");-1!==a.indexOf("#"+(i+1));)++i;for(var s=new JO(r,this.settings),o=[],l=s.lex();"EOF"!==l.text;)o.push(l),l=s.lex();return o.reverse(),{tokens:o,numArgs:i}}return r}isDefined(t){return this.macros.has(t)||ZO.hasOwnProperty(t)||oM.math.hasOwnProperty(t)||oM.text.hasOwnProperty(t)||lP.hasOwnProperty(t)}isExpandable(t){var e=this.macros.get(t);return null!=e?"string"==typeof e||"function"==typeof e||!e.unexpandable:ZO.hasOwnProperty(t)&&!ZO[t].primitive}},hP=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,uP=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),dP={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},pP={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"},gP=class t{static{s(this,"Parser")}constructor(t,e){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new cP(t,e,this.mode),this.settings=e,this.leftrightDepth=0}expect(t,e){if(void 0===e&&(e=!0),this.fetch().text!==t)throw new qN("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());e&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var e=this.nextToken;this.consume(),this.gullet.pushToken(new GN("}")),this.gullet.pushTokens(t);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=e,n}parseExpression(e,n){for(var r=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==t.endOfExpression.indexOf(i.text))break;if(n&&i.text===n)break;if(e&&ZO[i.text]&&ZO[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;"internal"!==a.type&&r.push(a)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var e,n=-1,r=0;r=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+e[0]+'" used in math mode',t);var s,o=oM[this.mode][e].group,l=UN.range(t);if(aM.hasOwnProperty(o)){var c=o;s={type:"atom",mode:this.mode,family:c,loc:l,text:e}}else s={type:o,mode:this.mode,loc:l,text:e};i=s}else{if(!(e.charCodeAt(0)>=128))return null;this.settings.strict&&(mI(e.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+e[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+e[0]+'" ('+e.charCodeAt(0)+")",t)),i={type:"textord",mode:"text",loc:UN.range(t),text:e}}if(this.consume(),a)for(var h=0;h2?e[2]:void 0;for(i&&Nw(e[0],e[1],i)&&(r=1);++no))return!1;var c=a.get(t),h=a.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,p=2&n?new VB:void 0;for(a.set(t,e),a.set(e,t);++ue}s(MF,"baseGt");var RF=MF;function DF(t){return t&&t.length?IF(t,mw,RF):void 0}s(DF,"max");var OF=DF;function PF(t,e,n,r){if(!jy(t))return t;for(var i=-1,a=(e=H$(e,t)).length,s=a-1,o=t;null!=o&&++i0&&n(o)?e>1?YF(o,e-1,n,r,i):qP(i,o):r||(i[i.length]=o)}return i}s(YF,"baseFlatten");var WF=YF;function HF(t){return(null==t?0:t.length)?WF(t,1):[]}s(HF,"flatten");var VF=HF;function XF(t){return Cw(ww(t,void 0,VF),t+"")}s(XF,"flatRest");var KF=XF((function(t,e){return null==t?{}:UF(t,e)})),ZF=KF;function QF(t,e,n,r){var i=-1,a=null==t?0:t.length;for(r&&a&&(n=t[++i]);++i-1}s(dz,"arrayIncludes");var pz=dz;function gz(t,e,n){for(var r=-1,i=null==t?0:t.length;++r=200){var c=e?null:vz(t);if(c)return i$(c);s=!1,i=QB,l=new VB}else l=e?[]:o;t:for(;++ri?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Array(i);++r=200&&(a=QB,s=!1,e=new VB(e));t:for(;++i-1?i[a?e[o]:o]:void 0}}s(yU,"createFind");var vU=yU,xU=Math.max;function bU(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Bz(n);return i<0&&(i=xU(r+i,0)),az(t,fF(e),i)}s(bU,"findIndex");var wU=vU(bU);function kU(t){return t&&t.length?t[0]:void 0}s(kU,"head");var TU=kU;function _U(t,e){return WF(wF(t,e),1)}s(_U,"flatMap");var EU=_U;function CU(t,e){return null==t?t:Nx(t,$B(e),lw)}s(CU,"forIn");var SU=CU;function AU(t,e){return t&&DB(t,$B(e))}s(AU,"forOwn");var LU=AU,NU=Object.prototype.hasOwnProperty,IU=eU((function(t,e,n){NU.call(t,n)?t[n].push(e):Cx(t,n,[e])})),MU=IU,RU=Object.prototype.hasOwnProperty;function DU(t,e){return null!=t&&RU.call(t,e)}s(DU,"baseHas");var OU=DU;function PU(t,e){return null!=t&&rF(t,e,OU)}s(PU,"has");var BU=PU;function $U(t){return"string"==typeof t||!hb(t)&&nb(t)&&"[object String]"==Gy(t)}s($U,"isString");var FU=$U,zU=Math.max;function UU(t,e,n,r){t=gb(t)?t:EF(t),n=n&&!r?Bz(n):0;var i=t.length;return n<0&&(n=zU(i+n,0)),FU(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&uz(t,e,n)>-1}s(UU,"includes");var GU=UU,qU=Math.max;function jU(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Bz(n);return i<0&&(i=qU(r+i,0)),uz(t,e,i)}s(jU,"indexOf");var YU=jU;function WU(t){return nb(t)&&"[object RegExp]"==Gy(t)}s(WU,"baseIsRegExp");var HU=WU,VU=$b&&$b.isRegExp,XU=VU?Db(VU):HU;function KU(t,e){return te||a&&s&&l&&!o&&!c||r&&s&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&t=o?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}s(hG,"compareMultiple");var uG=hG;function dG(t,e,n){e=e.length?F$(e,(function(t){return hb(t)?function(e){return Z$(e,1===t.length?t[0]:t)}:t})):[mw];var r=-1;e=F$(e,Db(fF));var i=xF(t,(function(t,n,i){return{criteria:F$(e,(function(e){return e(t)})),index:++r,value:t}}));return oG(i,(function(t,e){return uG(t,e,n)}))}s(dG,"baseOrderBy");var pG=dG,gG=cF("length"),fG="[\\ud800-\\udfff]",mG="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",yG="\\ud83c[\\udffb-\\udfff]",vG="[^\\ud800-\\udfff]",xG="(?:\\ud83c[\\udde6-\\uddff]){2}",bG="[\\ud800-\\udbff][\\udc00-\\udfff]",wG="(?:"+mG+"|"+yG+")"+"?",kG="[\\ufe0e\\ufe0f]?"+wG+("(?:\\u200d(?:"+[vG,xG,bG].join("|")+")[\\ufe0e\\ufe0f]?"+wG+")*"),TG="(?:"+[vG+mG+"?",mG,xG,bG,fG].join("|")+")",_G=RegExp(yG+"(?="+yG+")|"+TG+kG,"g");function EG(t){for(var e=_G.lastIndex=0;_G.test(t);)++e;return e}s(EG,"unicodeSize");var CG=EG;function SG(t){return Yz(t)?CG(t):gG(t)}s(SG,"stringSize");var AG=SG,LG=Math.ceil,NG=Math.max;function IG(t,e,n,r){for(var i=-1,a=NG(LG((e-t)/(n||1)),0),s=Array(a);a--;)s[r?a:++i]=t,t+=n;return s}s(IG,"baseRange");var MG=IG;function RG(t){return function(e,n,r){return r&&"number"!=typeof r&&Nw(e,n,r)&&(n=r=void 0),e=Oz(e),void 0===n?(n=e,e=0):n=Oz(n),r=void 0===r?e1&&Nw(t,e[0],e[1])?e=[]:n>2&&Nw(e[0],e[1],e[2])&&(e=[e[0]]),pG(t,WF(e,1),[])})),jG=qG;function YG(t){return t&&t.length?bz(t):[]}s(YG,"uniq");var WG=YG;function HG(t,e){return t&&t.length?bz(t,fF(e)):[]}s(HG,"uniqBy");var VG=HG,XG=0;function KG(t){var e=++XG;return Y$(t)+e}s(KG,"uniqueId");var ZG=KG;function QG(t,e,n){for(var r=-1,i=t.length,a=e.length,s={};++r1?r.setNode(t,e):r.setNode(t)})),this}setNode(t,e){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=s((t=>this.removeEdge(this._edgeObjs[t])),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],zB(this.children(t),(t=>{this.setParent(t)})),delete this._children[t]),zB(EP(this._in[t]),e),delete this._in[t],delete this._preds[t],zB(EP(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(SF(e))e="\0";else{for(var n=e+="";!SF(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}}children(t){if(SF(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return EP(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return EP(e)}successors(t){var e=this._sucs[t];if(e)return EP(e)}neighbors(t){var e=this.predecessors(t);if(e)return wz(e,this.successors(t))}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;zB(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),zB(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var a=n.parent(t);return void 0===a||e.hasNode(a)?(r[t]=a,a):a in r?r[a]:i(a)}return s(i,"findParent"),this._isCompound&&zB(e.nodes(),(function(t){e.setParent(t,i(t))})),e}setDefaultEdgeLabel(t){return Hy(t)||(t=ux(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return EF(this._edgeObjs)}setPath(t,e){var n=this,r=arguments;return rz(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this}setEdge(){var t,e,n,r,i=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(t=a.v,e=a.w,n=a.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=a,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,SF(n)||(n=""+n);var s=aq(this._isDirected,t,e,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return i&&(this._edgeLabels[s]=r),this;if(!SF(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[s]=i?r:this._defaultEdgeLabelFn(t,e,n);var o=sq(this._isDirected,t,e,n);return t=o.v,e=o.w,Object.freeze(o),this._edgeObjs[s]=o,rq(this._preds[e],t),rq(this._sucs[t],e),this._in[e][s]=o,this._out[t][s]=o,this._edgeCount++,this}edge(t,e,n){var r=1===arguments.length?oq(this._isDirected,arguments[0]):aq(this._isDirected,t,e,n);return this._edgeLabels[r]}hasEdge(t,e,n){var r=1===arguments.length?oq(this._isDirected,arguments[0]):aq(this._isDirected,t,e,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(t,e,n){var r=1===arguments.length?oq(this._isDirected,arguments[0]):aq(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],iq(this._preds[e],t),iq(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var r=EF(n);return e?yF(r,(function(t){return t.v===e})):r}}outEdges(t,e){var n=this._out[t];if(n){var r=EF(n);return e?yF(r,(function(t){return t.w===e})):r}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}}; /*! 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 *) */function rq(t,e){t[e]?t[e]++:t[e]=1}function iq(t,e){--t[e]||delete t[e]}function aq(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var s=i;i=a,a=s}return i+""+a+""+(SF(r)?"\0":r)}function sq(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return r&&(o.name=r),o}function oq(t,e){return aq(t,e.v,e.w,e.name)}function lq(t,e,n,r){var i;do{i=ZG(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function cq(t){var e=(new nq).setGraph(t.graph());return zB(t.nodes(),(function(n){e.setNode(n,t.node(n))})),zB(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e}function hq(t){var e=new nq({multigraph:t.isMultigraph()}).setGraph(t.graph());return zB(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),zB(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e}function uq(t,e){var n,r,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;if(!s&&!o)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),n=c*s/o,r=c):(s<0&&(l=-l),n=l,r=l*o/s),{x:i+n,y:a+r}}function dq(t){var e=wF(DG(mq(t)+1),(function(){return[]}));return zB(t.nodes(),(function(n){var r=t.node(n),i=r.rank;SF(i)||(e[i][r.order]=n)})),e}function pq(t){var e=JU(wF(t.nodes(),(function(e){return t.node(e).rank})));zB(t.nodes(),(function(n){var r=t.node(n);BU(r,"rank")&&(r.rank-=e)}))}function gq(t){var e=JU(wF(t.nodes(),(function(e){return t.node(e).rank}))),n=[];zB(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var r=0,i=t.graph().nodeRankFactor;zB(n,(function(e,n){SF(e)&&n%i!=0?--r:r&&zB(e,(function(e){t.node(e).rank+=r}))}))}function fq(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),lq(t,"border",i,e)}function mq(t){return OF(wF(t.nodes(),(function(e){var n=t.node(e).rank;if(!SF(n))return n})))}function yq(t,e){var n={lhs:[],rhs:[]};return zB(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n}function vq(t,e){var n=nU();try{return e()}finally{console.log(t+" time: "+(nU()-n)+"ms")}}function xq(t,e){return e()}function bq(t){function e(n){var r=t.children(n),i=t.node(n);if(r.length&&zB(r,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a0;--o)if(r=e[o].dequeue()){i=i.concat(Pq(t,e,n,r,!0));break}}return i}function Pq(t,e,n,r,i){var a=i?[]:void 0;return zB(t.inEdges(r.v),(function(r){var s=t.edge(r),o=t.node(r.v);i&&a.push({v:r.v,w:r.w}),o.out-=s,$q(e,n,o)})),zB(t.outEdges(r.v),(function(r){var i=t.edge(r),a=r.w,s=t.node(a);s.in-=i,$q(e,n,s)})),t.removeNode(r.v),a}function Bq(t,e){var n=new nq,r=0,i=0;zB(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),zB(t.edges(),(function(t){var a=n.edge(t.v,t.w)||0,s=e(t),o=a+s;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=s),r=Math.max(r,n.node(t.w).in+=s)}));var a=DG(i+r+3).map((function(){return new Nq})),s=r+1;return zB(n.nodes(),(function(t){$q(a,s,n.node(t))})),{graph:n,buckets:a,zeroIdx:s}}function $q(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}function Fq(t){var e="greedy"===t.graph().acyclicer?Dq(t,n(t)):zq(t);function n(t){return function(e){return t.edge(e).weight}}zB(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,ZG("rev"))})),s(n,"weightFn")}function zq(t){var e=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,zB(t.outEdges(a),(function(t){Object.prototype.hasOwnProperty.call(n,t.w)?e.push(t):i(t.w)})),delete n[a])}return s(i,"dfs"),zB(t.nodes(),i),e}function Uq(t){zB(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}function Gq(t){t.graph().dummyChains=[],zB(t.edges(),(function(e){qq(t,e)}))}function qq(t,e){var n=e.v,r=t.node(n).rank,i=e.w,a=t.node(i).rank,s=e.name,o=t.edge(e),l=o.labelRank;if(a!==r+1){t.removeEdge(e);var c,h,u=void 0;for(h=0,++r;rs.lim&&(o=s,l=!0);var c=yF(e.edges(),(function(e){return l===gj(t,t.node(e.v),o)&&l!==gj(t,t.node(e.w),o)}));return eG(c,(function(t){return Wq(e,t)}))}function uj(t,e,n,r){var i=n.v,a=n.w;t.removeEdge(i,a),t.setEdge(r.v,r.w,{}),oj(t),ij(t,e),dj(t,e)}function dj(t,e){var n=wU(t.nodes(),(function(t){return!e.node(t).parent})),r=nj(t,n);r=r.slice(1),zB(r,(function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)}))}function pj(t,e,n){return t.hasEdge(e,n)}function gj(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}function fj(t){switch(t.graph().ranker){case"network-simplex":default:vj(t);break;case"tight-tree":yj(t);break;case"longest-path":mj(t)}}s(Dq,"greedyFAS"),s(Oq,"doGreedyFAS"),s(Pq,"removeNode"),s(Bq,"buildState"),s($q,"assignBucket"),s(Fq,"run"),s(zq,"dfsFAS"),s(Uq,"undo"),s(Gq,"run"),s(qq,"normalizeEdge"),s(jq,"undo"),s(Yq,"longestPath"),s(Wq,"slack"),s(Hq,"feasibleTree"),s(Vq,"tightTree"),s(Xq,"findMinSlackEdge"),s(Kq,"shiftRanks"),Zq.CycleException=Qq,s(Zq,"topsort"),s(Qq,"CycleException"),Qq.prototype=new Error,s(Jq,"dfs"),s(tj,"doDfs"),s(ej,"postorder"),s(nj,"preorder"),rj.initLowLimValues=oj,rj.initCutValues=ij,rj.calcCutValue=sj,rj.leaveEdge=cj,rj.enterEdge=hj,rj.exchangeEdges=uj,s(rj,"networkSimplex"),s(ij,"initCutValues"),s(aj,"assignCutValue"),s(sj,"calcCutValue"),s(oj,"initLowLimValues"),s(lj,"dfsAssignLowLim"),s(cj,"leaveEdge"),s(hj,"enterEdge"),s(uj,"exchangeEdges"),s(dj,"updateRanks"),s(pj,"isTreeEdge"),s(gj,"isDescendant"),s(fj,"rank");var mj=Yq;function yj(t){Yq(t),Hq(t)}function vj(t){rj(t)}function xj(t){var e=lq(t,"root",{},"_root"),n=wj(t),r=OF(EF(n))-1,i=2*r+1;t.graph().nestingRoot=e,zB(t.edges(),(function(e){t.edge(e).minlen*=i}));var a=kj(t)+1;zB(t.children(),(function(s){bj(t,e,i,a,r,n,s)})),t.graph().nodeRankFactor=i}function bj(t,e,n,r,i,a,s){var o=t.children(s);if(o.length){var l=fq(t,"_bt"),c=fq(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(c,s),h.borderBottom=c,zB(o,(function(o){bj(t,e,n,r,i,a,o);var h=t.node(o),u=h.borderTop?h.borderTop:o,d=h.borderBottom?h.borderBottom:o,p=h.borderTop?r:2*r,g=u!==d?1:i-a[s]+1;t.setEdge(l,u,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,c,{weight:p,minlen:g,nestingEdge:!0})})),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}else s!==e&&t.setEdge(e,s,{weight:0,minlen:n})}function wj(t){var e={};function n(r,i){var a=t.children(r);a&&a.length&&zB(a,(function(t){n(t,i+1)})),e[r]=i}return s(n,"dfs"),zB(t.children(),(function(t){n(t,1)})),e}function kj(t){return rz(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}function Tj(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,zB(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}function _j(t,e,n){var r,i={};zB(n,(function(n){for(var a,s,o=t.parent(n);o;){if((a=t.parent(o))?(s=i[a],i[a]=o):(s=r,r=o),s&&s!==o)return void e.setEdge(s,o);o=a}}))}function Ej(t,e,n){var r=Cj(t),i=new nq({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return zB(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||r),zB(t[n](a),(function(e){var n=e.v===a?e.w:e.v,r=i.edge(n,a),s=SF(r)?0:r.weight;i.setEdge(n,a,{weight:t.edge(e).weight+s})})),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),i}function Cj(t){for(var e;t.hasNode(e=ZG("_root")););return e}function Sj(t,e){for(var n=0,r=1;r0;)e%2&&(n+=o[e+1]),o[e=e-1>>1]+=t.weight;l+=t.weight*n}))),l}function Lj(t){var e={},n=yF(t.nodes(),(function(e){return!t.children(e).length})),r=OF(wF(n,(function(e){return t.node(e).rank}))),i=wF(DG(r+1),(function(){return[]}));function a(n){if(!BU(e,n)){e[n]=!0;var r=t.node(n);i[r.rank].push(n),zB(t.successors(n),a)}}s(a,"dfs");var o=jG(n,(function(e){return t.node(e).rank}));return zB(o,a),i}function Nj(t,e){return wF(e,(function(e){var n=t.inEdges(e);if(n.length){var r=rz(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}function Ij(t,e){var n={};return zB(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};SF(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),zB(e.edges(),(function(t){var e=n[t.v],r=n[t.w];SF(e)||SF(r)||(r.indegree++,e.out.push(n[t.w]))})),Mj(yF(n,(function(t){return!t.indegree})))}function Mj(t){var e=[];function n(t){return function(e){e.merged||(SF(e.barycenter)||SF(t.barycenter)||e.barycenter>=t.barycenter)&&Rj(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(s(n,"handleIn"),s(r,"handleOut");t.length;){var i=t.pop();e.push(i),zB(i.in.reverse(),n(i)),zB(i.out,r(i))}return wF(yF(e,(function(t){return!t.merged})),(function(t){return ZF(t,["vs","i","barycenter","weight"])}))}function Rj(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}function Dj(t,e){var n=yq(t,(function(t){return Object.prototype.hasOwnProperty.call(t,"barycenter")})),r=n.lhs,i=jG(n.rhs,(function(t){return-t.i})),a=[],s=0,o=0,l=0;r.sort(Pj(!!e)),l=Oj(a,i,l),zB(r,(function(t){l+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,o+=t.weight,l=Oj(a,i,l)}));var c={vs:VF(a)};return o&&(c.barycenter=s/o,c.weight=o),c}function Oj(t,e,n){for(var r;e.length&&(r=MB(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function Pj(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}function Bj(t,e,n,r){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=yF(i,(function(t){return t!==s&&t!==o})));var c=Nj(t,i);zB(c,(function(e){if(t.children(e.v).length){var i=Bj(t,e.v,n,r);l[e.v]=i,Object.prototype.hasOwnProperty.call(i,"barycenter")&&Fj(e,i)}}));var h=Ij(c,n);$j(h,l);var u=Dj(h,r);if(s&&(u.vs=VF([s,u.vs,o]),t.predecessors(s).length)){var d=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+d.order+p.order)/(u.weight+2),u.weight+=2}return u}function $j(t,e){zB(t,(function(t){t.vs=VF(t.vs.map((function(t){return e[t]?e[t].vs:t})))}))}function Fj(t,e){SF(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 zj(t){var e=mq(t),n=Uj(t,DG(1,e+1),"inEdges"),r=Uj(t,DG(e-1,-1,-1),"outEdges"),i=Lj(t);qj(t,i);for(var a,s=Number.POSITIVE_INFINITY,o=0,l=0;l<4;++o,++l){Gj(o%2?n:r,o%4>=2);var c=Sj(t,i=dq(t));cl||c>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function Wj(t){var e={},n=0;function r(i){var a=n;zB(t.children(i),r),e[i]={low:a,lim:n++}}return s(r,"dfs"),zB(t.children(),r),e}function Hj(t,e){var n={};function r(e,r){var i=0,a=0,s=e.length,o=MB(r);return zB(r,(function(e,l){var c=Xj(t,e),h=c?t.node(c).order:s;(c||e===o)&&(zB(r.slice(a,l+1),(function(e){zB(t.predecessors(e),(function(r){var a=t.node(r),s=a.order;!(ss)&&Kj(n,e,o)}))}))}function i(e,n){var i,a=-1,s=0;return zB(n,(function(o,l){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,r(n,s,l,a,i),s=l,a=i)}r(n,s,n.length,i,e.length)})),n}return s(r,"scan"),s(i,"visitLayer"),rz(e,i),n}function Xj(t,e){if(t.node(e).dummy)return wU(t.predecessors(e),(function(e){return t.node(e).dummy}))}function Kj(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function Zj(t,e,n){if(e>n){var r=e;e=n,n=r}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],n)}function Qj(t,e,n,r){var i={},a={},s={};return zB(e,(function(t){zB(t,(function(t,e){i[t]=t,a[t]=t,s[t]=e}))})),zB(e,(function(t){var e=-1;zB(t,(function(t){var o=r(t);if(o.length)for(var l=((o=jG(o,(function(t){return s[t]}))).length-1)/2,c=Math.floor(l),h=Math.ceil(l);c<=h;++c){var u=o[c];a[t]===t&&e{var e=n(" buildLayoutGraph",(()=>bY(t)));n(" runLayout",(()=>hY(e,n))),n(" updateInputGraph",(()=>uY(t,e)))}))}function hY(t,e){e(" makeSpaceForEdgeLabels",(()=>wY(t))),e(" removeSelfEdges",(()=>NY(t))),e(" acyclic",(()=>Fq(t))),e(" nestingGraph.run",(()=>xj(t))),e(" rank",(()=>fj(hq(t)))),e(" injectEdgeLabelProxies",(()=>kY(t))),e(" removeEmptyRanks",(()=>gq(t))),e(" nestingGraph.cleanup",(()=>Tj(t))),e(" normalizeRanks",(()=>pq(t))),e(" assignRankMinMax",(()=>TY(t))),e(" removeEdgeLabelProxies",(()=>_Y(t))),e(" normalize.run",(()=>Gq(t))),e(" parentDummyChains",(()=>jj(t))),e(" addBorderSegments",(()=>bq(t))),e(" order",(()=>zj(t))),e(" insertSelfEdges",(()=>IY(t))),e(" adjustCoordinateSystem",(()=>kq(t))),e(" position",(()=>oY(t))),e(" positionSelfEdges",(()=>MY(t))),e(" removeBorderNodes",(()=>LY(t))),e(" normalize.undo",(()=>jq(t))),e(" fixupEdgeLabelCoords",(()=>SY(t))),e(" undoCoordinateSystem",(()=>Tq(t))),e(" translateGraph",(()=>EY(t))),e(" assignNodeIntersects",(()=>CY(t))),e(" reversePoints",(()=>AY(t))),e(" acyclic.undo",(()=>Uq(t)))}function uY(t,e){zB(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),zB(t.edges(),(function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}s(yj,"tightTreeRanker"),s(vj,"networkSimplexRanker"),s(xj,"run"),s(bj,"dfs"),s(wj,"treeDepths"),s(kj,"sumWeights"),s(Tj,"cleanup"),s(_j,"addSubgraphConstraints"),s(Ej,"buildLayerGraph"),s(Cj,"createRootNode"),s(Sj,"crossCount"),s(Aj,"twoLayerCrossCount"),s(Lj,"initOrder"),s(Nj,"barycenter"),s(Ij,"resolveConflicts"),s(Mj,"doResolveConflicts"),s(Rj,"mergeEntries"),s(Dj,"sort"),s(Oj,"consumeUnsortable"),s(Pj,"compareWithBias"),s(Bj,"sortSubgraph"),s($j,"expandSubgraphs"),s(Fj,"mergeBarycenters"),s(zj,"order"),s(Uj,"buildLayerGraphs"),s(Gj,"sweepLayerGraphs"),s(qj,"assignOrder"),s(jj,"parentDummyChains"),s(Yj,"findPath"),s(Wj,"postorder"),s(Hj,"findType1Conflicts"),s(Vj,"findType2Conflicts"),s(Xj,"findOtherInnerSegmentNode"),s(Kj,"addConflict"),s(Zj,"hasConflict"),s(Qj,"verticalAlignment"),s(Jj,"horizontalCompaction"),s(tY,"buildBlockGraph"),s(eY,"findSmallestWidthAlignment"),s(nY,"alignCoordinates"),s(rY,"balance"),s(iY,"positionX"),s(aY,"sep"),s(sY,"width"),s(oY,"position"),s(lY,"positionY"),s(cY,"layout"),s(hY,"runLayout"),s(uY,"updateInputGraph");var dY=["nodesep","edgesep","ranksep","marginx","marginy"],pY={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},gY=["acyclicer","ranker","rankdir","align"],fY=["width","height"],mY={width:0,height:0},yY=["minlen","weight","width","height","labeloffset"],vY={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xY=["labelpos"];function bY(t){var e=new nq({multigraph:!0,compound:!0}),n=DY(t.graph());return e.setGraph(Dw({},pY,RY(n,dY),ZF(n,gY))),zB(t.nodes(),(function(n){var r=DY(t.node(n));e.setNode(n,NB(RY(r,fY),mY)),e.setParent(n,t.parent(n))})),zB(t.edges(),(function(n){var r=DY(t.edge(n));e.setEdge(n,Dw({},vY,RY(r,yY),ZF(r,xY)))})),e}function wY(t){var e=t.graph();e.ranksep/=2,zB(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}function kY(t){zB(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};lq(t,"edge-proxy",i,"_ep")}}))}function TY(t){var e=0;zB(t.nodes(),(function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=OF(e,r.maxRank))})),t.graph().maxRank=e}function _Y(t){zB(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}function EY(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,a=t.graph(),o=a.marginx||0,l=a.marginy||0;function c(t){var a=t.x,s=t.y,o=t.width,l=t.height;e=Math.min(e,a-o/2),n=Math.max(n,a+o/2),r=Math.min(r,s-l/2),i=Math.max(i,s+l/2)}s(c,"getExtremes"),zB(t.nodes(),(function(e){c(t.node(e))})),zB(t.edges(),(function(e){var n=t.edge(e);Object.prototype.hasOwnProperty.call(n,"x")&&c(n)})),e-=o,r-=l,zB(t.nodes(),(function(n){var i=t.node(n);i.x-=e,i.y-=r})),zB(t.edges(),(function(n){var i=t.edge(n);zB(i.points,(function(t){t.x-=e,t.y-=r})),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=e),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=r)})),a.width=n-e+o,a.height=i-r+l}function CY(t){zB(t.edges(),(function(e){var n,r,i=t.edge(e),a=t.node(e.v),s=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=a),i.points.unshift(uq(a,n)),i.points.push(uq(s,r))}))}function SY(t){zB(t.edges(),(function(e){var n=t.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}function AY(t){zB(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}function LY(t){zB(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(MB(n.borderLeft)),s=t.node(MB(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}})),zB(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}function NY(t){zB(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}function IY(t){var e=dq(t);zB(e,(function(e){var n=0;zB(e,(function(e,r){var i=t.node(e);i.order=r+n,zB(i.selfEdges,(function(e){lq(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}function MY(t){zB(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,s=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.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}],n.label.x=n.x,n.label.y=n.y}}))}function RY(t,e){return LF(ZF(t,e),Number)}function DY(t){var e={};return zB(t,(function(t,n){e[n.toLowerCase()]=t})),e}function OY(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:PY(t),edges:BY(t)};return SF(t.graph())||(e.value=CB(t.graph())),e}function PY(t){return wF(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),i={v:e};return SF(n)||(i.value=n),SF(r)||(i.parent=r),i}))}function BY(t){return wF(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return SF(e.name)||(r.name=e.name),SF(n)||(r.value=n),r}))}s(bY,"buildLayoutGraph"),s(wY,"makeSpaceForEdgeLabels"),s(kY,"injectEdgeLabelProxies"),s(TY,"assignRankMinMax"),s(_Y,"removeEdgeLabelProxies"),s(EY,"translateGraph"),s(CY,"assignNodeIntersects"),s(SY,"fixupEdgeLabelCoords"),s(AY,"reversePointsForReversedEdges"),s(LY,"removeBorderNodes"),s(NY,"removeSelfEdges"),s(IY,"insertSelfEdges"),s(MY,"positionSelfEdges"),s(RY,"selectNumberAttrs"),s(DY,"canonicalize"),s(OY,"write"),s(PY,"writeNodes"),s(BY,"writeEdges");var $Y=new Map,FY=new Map,zY=new Map,UY=s((()=>{FY.clear(),zY.clear(),$Y.clear()}),"clear"),GY=s(((t,e)=>{const n=FY.get(e)||[];return m.trace("In isDescendant",e," ",t," = ",n.includes(t)),n.includes(t)}),"isDescendant"),qY=s(((t,e)=>{const n=FY.get(e)||[];return m.info("Descendants of ",e," is ",n),m.info("Edge is ",t),t.v!==e&&t.w!==e&&(n?n.includes(t.v)||GY(t.v,e)||GY(t.w,e)||n.includes(t.w):(m.debug("Tilt, ",e,",not in descendants"),!1))}),"edgeInCluster"),jY=s(((t,e,n,r)=>{m.warn("Copying children of ",t,"root",r,"data",e.node(t),r);const i=e.children(t)||[];t!==r&&i.push(t),m.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach((i=>{if(e.children(i).length>0)jY(i,e,n,r);else{const a=e.node(i);m.info("cp ",i," to ",r," with parent ",t),n.setNode(i,a),r!==e.parent(i)&&(m.warn("Setting parent",i,e.parent(i)),n.setParent(i,e.parent(i))),t!==r&&i!==t?(m.debug("Setting parent",i,t),n.setParent(i,t)):(m.info("In copy ",t,"root",r,"data",e.node(t),r),m.debug("Not Setting parent for node=",i,"cluster!==rootId",t!==r,"node!==clusterId",i!==t));const s=e.edges(i);m.debug("Copying Edges",s),s.forEach((i=>{m.info("Edge",i);const a=e.edge(i.v,i.w,i.name);m.info("Edge data",a,r);try{qY(i,r)?(m.info("Copying as ",i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),m.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):m.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",t)}catch(t){m.error(t)}}))}m.debug("Removing node",i),e.removeNode(i)}))}),"copy"),YY=s(((t,e)=>{const n=e.children(t);let r=[...n];for(const i of n)zY.set(i,t),r=[...r,...YY(i,e)];return r}),"extractDescendants"),WY=s(((t,e,n)=>{const r=t.edges().filter((t=>t.v===e||t.w===e)),i=t.edges().filter((t=>t.v===n||t.w===n)),a=r.map((t=>({v:t.v===e?n:t.v,w:t.w===e?e:t.w}))),s=i.map((t=>({v:t.v,w:t.w})));return a.filter((t=>s.some((e=>t.v===e.v&&t.w===e.w))))}),"findCommonEdges"),HY=s(((t,e,n)=>{const r=e.children(t);if(m.trace("Searching children of id ",t,r),r.length<1)return t;let i;for(const t of r){const r=HY(t,e,n),a=WY(e,n,r);if(r){if(!(a.length>0))return r;i=r}}return i}),"findNonClusterChild"),VY=s((t=>$Y.has(t)&&$Y.get(t).externalConnections&&$Y.has(t)?$Y.get(t).id:t),"getAnchorId"),XY=s(((t,e)=>{if(!t||e>10)m.debug("Opting out, no graph ");else{m.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(m.warn("Cluster identified",e," Replacement id in edges: ",HY(e,t,e)),FY.set(e,YY(e,t)),$Y.set(e,{id:HY(e,t,e),clusterData:t.node(e)}))})),t.nodes().forEach((function(e){const n=t.children(e),r=t.edges();n.length>0?(m.debug("Cluster identified",e,FY),r.forEach((t=>{GY(t.v,e)^GY(t.w,e)&&(m.warn("Edge: ",t," leaves cluster ",e),m.warn("Descendants of XXX ",e,": ",FY.get(e)),$Y.get(e).externalConnections=!0)}))):m.debug("Not a cluster ",e,FY)}));for(let e of $Y.keys()){const n=$Y.get(e).id,r=t.parent(n);r!==e&&$Y.has(r)&&!$Y.get(r).externalConnections&&($Y.get(e).id=r)}t.edges().forEach((function(e){const n=t.edge(e);m.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),m.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));let r=e.v,i=e.w;if(m.warn("Fix XXX",$Y,"ids:",e.v,e.w,"Translating: ",$Y.get(e.v)," --- ",$Y.get(e.w)),$Y.get(e.v)||$Y.get(e.w)){if(m.warn("Fixing and trying - removing XXX",e.v,e.w,e.name),r=VY(e.v),i=VY(e.w),t.removeEdge(e.v,e.w,e.name),r!==e.v){const i=t.parent(r);$Y.get(i).externalConnections=!0,n.fromCluster=e.v}if(i!==e.w){const r=t.parent(i);$Y.get(r).externalConnections=!0,n.toCluster=e.w}m.warn("Fix Replacing with XXX",r,i,e.name),t.setEdge(r,i,n,e.name)}})),m.warn("Adjusted Graph",OY(t)),KY(t,0),m.trace($Y)}}),"adjustClustersAndEdges"),KY=s(((t,e)=>{if(m.warn("extractor - ",e,OY(t),t.children("D")),e>10)return void m.error("Bailing out");let n=t.nodes(),r=!1;for(const e of n){const n=t.children(e);r=r||n.length>0}if(r){m.debug("Nodes = ",n,e);for(const r of n)if(m.debug("Extracting node",r,$Y,$Y.has(r)&&!$Y.get(r).externalConnections,!t.parent(r),t.node(r),t.children("D")," Depth ",e),$Y.has(r))if(!$Y.get(r).externalConnections&&t.children(r)&&t.children(r).length>0){m.warn("Cluster without external connections, without a parent and with children",r,e);let n="TB"===t.graph().rankdir?"LR":"TB";$Y.get(r)?.clusterData?.dir&&(n=$Y.get(r).clusterData.dir,m.warn("Fixing dir",$Y.get(r).clusterData.dir,n));const i=new nq({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));m.warn("Old graph before copy",OY(t)),jY(r,t,i,r),t.setNode(r,{clusterNode:!0,id:r,clusterData:$Y.get(r).clusterData,label:$Y.get(r).label,graph:i}),m.warn("New graph after copy node: (",r,")",OY(i)),m.debug("Old graph after copy",OY(t))}else m.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!$Y.get(r).externalConnections," no parent: ",!t.parent(r)," children ",t.children(r)&&t.children(r).length>0,t.children("D"),e),m.debug($Y);else m.debug("Not a cluster",r,e);n=t.nodes(),m.warn("New list of nodes",n);for(const r of n){const n=t.node(r);m.warn(" Now next level",r,n),n?.clusterNode&&KY(n.graph,e+1)}}else m.debug("Done, no node has children",t.nodes())}),"extractor"),ZY=s(((t,e)=>{if(0===e.length)return[];let n=Object.assign([],e);return e.forEach((e=>{const r=t.children(e),i=ZY(t,r);n=[...n,...i]})),n}),"sorter"),QY=s((t=>ZY(t,t.children())),"sortNodesByHierarchy"),JY=s((async(t,e,n,r,i,a)=>{m.warn("Graph in recursive render:XAX",OY(e),i);const o=e.graph().rankdir;m.trace("Dir in recursive render - dir:",o);const l=t.insert("g").attr("class","root");e.nodes()?m.info("Recursive render XXX",e.nodes()):m.info("No nodes found for",e),e.edges().length>0&&m.info("Recursive edges",e.edge(e.edges()[0]));const c=l.insert("g").attr("class","clusters"),h=l.insert("g").attr("class","edgePaths"),u=l.insert("g").attr("class","edgeLabels"),d=l.insert("g").attr("class","nodes");await Promise.all(e.nodes().map((async function(t){const s=e.node(t);if(void 0!==i){const n=JSON.parse(JSON.stringify(i.clusterData));m.trace("Setting data for parent cluster XXX\n Node.id = ",t,"\n data=",n.height,"\nParent cluster",i.height),e.setNode(i.id,n),e.parent(t)||(m.trace("Setting parent",t,i.id),e.setParent(t,i.id,n))}if(m.info("(Insert) Node XXX"+t+": "+JSON.stringify(e.node(t))),s?.clusterNode){m.info("Cluster identified XBX",t,s.width,e.node(t));const{ranksep:i,nodesep:o}=e.graph();s.graph.setGraph({...s.graph.graph(),ranksep:i+25,nodesep:o});const l=await JY(d,s.graph,n,r,e.node(t),a),c=l.elem;JT(s,c),s.diff=l.diff||0,m.info("New compound node after recursive render XAX",t,"width",s.width,"height",s.height),mS(c,s)}else e.children(t).length>0?(m.trace("Cluster - the non recursive path XBX",t,s.id,s,s.width,"Graph:",e),m.trace(HY(s.id,e)),$Y.set(s.id,{id:HY(s.id,e),node:s})):(m.trace("Node - the non recursive path XAX",t,d,e.node(t),o),await fS(d,e.node(t),{config:a,dir:o}))})));const p=s((async()=>{const t=e.edges().map((async function(t){const n=e.edge(t.v,t.w,t.name);m.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),m.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(e.edge(t))),m.info("Fix",$Y,"ids:",t.v,t.w,"Translating: ",$Y.get(t.v),$Y.get(t.w)),await NS(u,n)}));await Promise.all(t)}),"processEdges");await p(),m.info("Graph before layout:",JSON.stringify(OY(e))),m.info("############################################# XXX"),m.info("### Layout ### XXX"),m.info("############################################# XXX"),cY(e),m.info("Graph after layout:",JSON.stringify(OY(e)));let g=0,{subGraphTitleTotalMargin:f}=Gm(a);return await Promise.all(QY(e).map((async function(t){const n=e.node(t);if(m.info("Position XBX => "+t+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=f,m.info("A tainted cluster node XBX1",t,n.id,n.width,n.height,n.x,n.y,e.parent(t)),$Y.get(n.id).node=n,vS(n);else if(e.children(t).length>0){m.info("A pure cluster node XBX1",t,n.id,n.x,n.y,n.width,n.height,e.parent(t)),n.height+=f,e.node(n.parentId);const r=n?.padding/2||0,i=n?.labelBBox?.height||0,a=i-r||0;m.debug("OffsetY",a,"labelHeight",i,"halfPadding",r),await CE(c,n),$Y.get(n.id).node=n}else{const t=e.node(n.parentId);n.y+=f/2,m.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",t,t?.offsetY,n),vS(n)}}))),e.edges().forEach((function(t){const i=e.edge(t);m.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(i),i),i.points.forEach((t=>t.y+=f/2));const a=e.node(t.v);var s=e.node(t.w);const o=FS(h,i,$Y,n,a,s,r);MS(i,o)})),e.nodes().forEach((function(t){const n=e.node(t);m.info(t,n.type,n.diff),n.isGroup&&(g=n.diff)})),m.warn("Returning from recursive render XAX",l,g),{elem:l,diff:g}}),"recursiveRender"),tW=s((async(t,e)=>{const n=new nq({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.config?.flowchart?.nodeSpacing||t.nodeSpacing,ranksep:t.config?.rankSpacing||t.config?.flowchart?.rankSpacing||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),r=e.select("g");ZS(r,t.markers,t.type,t.diagramId),yS(),AS(),SE(),UY(),t.nodes.forEach((t=>{n.setNode(t.id,{...t}),t.parentId&&n.setParent(t.id,t.parentId)})),m.debug("Edges:",t.edges),t.edges.forEach((t=>{if(t.start===t.end){const e=t.start,r=e+"---"+e+"---1",i=e+"---"+e+"---2",a=n.node(e);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(i,a.parentId);const s=structuredClone(t),o=structuredClone(t),l=structuredClone(t);s.label="",s.arrowTypeEnd="none",s.id=e+"-cyclic-special-1",o.arrowTypeEnd="none",o.id=e+"-cyclic-special-mid",l.label="",a.isGroup&&(s.fromCluster=e,l.toCluster=e),l.id=e+"-cyclic-special-2",n.setEdge(e,r,s,e+"-cyclic-special-0"),n.setEdge(r,i,o,e+"-cyclic-special-1"),n.setEdge(i,e,l,e+"-cyc{const n=t.append("rect");if(n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),e.name&&n.attr("name",e.name),e.rx&&n.attr("rx",e.rx),e.ry&&n.attr("ry",e.ry),void 0!==e.attrs)for(const t in e.attrs)n.attr(t,e.attrs[t]);return e.class&&n.attr("class",e.class),n}),"drawRect"),iW=s(((t,e)=>{const n={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};rW(t,n).lower()}),"drawBackgroundRect"),aW=s(((t,e)=>{const n=e.text.replace(Qe," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),e.class&&r.attr("class",e.class);const i=r.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(n),r}),"drawText"),sW=s(((t,e,n,r)=>{const i=t.append("image");i.attr("x",e),i.attr("y",n);const a=(0,nW.sanitizeUrl)(r);i.attr("xlink:href",a)}),"drawImage"),oW=s(((t,e,n,r)=>{const i=t.append("use");i.attr("x",e),i.attr("y",n);const a=(0,nW.sanitizeUrl)(r);i.attr("xlink:href",`#${a}`)}),"drawEmbeddedImage"),lW=s((()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0})),"getNoteRect"),cW=s((()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0})),"getTextObj"),hW=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,24],n=[1,25],r=[1,26],i=[1,27],a=[1,28],o=[1,63],l=[1,64],h=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],f=[1,29],m=[1,30],y=[1,31],v=[1,32],x=[1,33],b=[1,34],w=[1,35],k=[1,36],T=[1,37],_=[1,38],E=[1,39],C=[1,40],S=[1,41],A=[1,42],L=[1,43],N=[1,44],I=[1,45],M=[1,46],R=[1,47],D=[1,48],O=[1,50],P=[1,51],B=[1,52],$=[1,53],F=[1,54],z=[1,55],U=[1,56],G=[1,57],q=[1,58],j=[1,59],Y=[1,60],W=[14,42],H=[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],V=[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],X=[1,82],K=[1,83],Z=[1,84],Q=[1,85],J=[12,14,42],tt=[12,14,33,42],et=[12,14,33,42,76,77,79,80],nt=[12,33],rt=[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],it={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 3:r.setDirection("TB");break;case 4:r.setDirection("BT");break;case 5:r.setDirection("RL");break;case 6:r.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[o-3]);break;case 19:r.setTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 20:r.setAccDescription(a[o].substring(15)),this.$=a[o].substring(15);break;case 21:this.$=a[o].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 28:a[o].splice(2,0,"ENTERPRISE"),r.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 29:a[o].splice(2,0,"SYSTEM"),r.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 30:r.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 31:a[o].splice(2,0,"CONTAINER"),r.addContainerBoundary(...a[o]),this.$=a[o];break;case 32:r.addDeploymentNode("node",...a[o]),this.$=a[o];break;case 33:r.addDeploymentNode("nodeL",...a[o]),this.$=a[o];break;case 34:r.addDeploymentNode("nodeR",...a[o]),this.$=a[o];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem("person",...a[o]),this.$=a[o];break;case 40:r.addPersonOrSystem("external_person",...a[o]),this.$=a[o];break;case 41:r.addPersonOrSystem("system",...a[o]),this.$=a[o];break;case 42:r.addPersonOrSystem("system_db",...a[o]),this.$=a[o];break;case 43:r.addPersonOrSystem("system_queue",...a[o]),this.$=a[o];break;case 44:r.addPersonOrSystem("external_system",...a[o]),this.$=a[o];break;case 45:r.addPersonOrSystem("external_system_db",...a[o]),this.$=a[o];break;case 46:r.addPersonOrSystem("external_system_queue",...a[o]),this.$=a[o];break;case 47:r.addContainer("container",...a[o]),this.$=a[o];break;case 48:r.addContainer("container_db",...a[o]),this.$=a[o];break;case 49:r.addContainer("container_queue",...a[o]),this.$=a[o];break;case 50:r.addContainer("external_container",...a[o]),this.$=a[o];break;case 51:r.addContainer("external_container_db",...a[o]),this.$=a[o];break;case 52:r.addContainer("external_container_queue",...a[o]),this.$=a[o];break;case 53:r.addComponent("component",...a[o]),this.$=a[o];break;case 54:r.addComponent("component_db",...a[o]),this.$=a[o];break;case 55:r.addComponent("component_queue",...a[o]),this.$=a[o];break;case 56:r.addComponent("external_component",...a[o]),this.$=a[o];break;case 57:r.addComponent("external_component_db",...a[o]),this.$=a[o];break;case 58:r.addComponent("external_component_queue",...a[o]),this.$=a[o];break;case 60:r.addRel("rel",...a[o]),this.$=a[o];break;case 61:r.addRel("birel",...a[o]),this.$=a[o];break;case 62:r.addRel("rel_u",...a[o]),this.$=a[o];break;case 63:r.addRel("rel_d",...a[o]),this.$=a[o];break;case 64:r.addRel("rel_l",...a[o]),this.$=a[o];break;case 65:r.addRel("rel_r",...a[o]),this.$=a[o];break;case 66:r.addRel("rel_b",...a[o]),this.$=a[o];break;case 67:a[o].splice(0,1),r.addRel("rel",...a[o]),this.$=a[o];break;case 68:r.updateElStyle("update_el_style",...a[o]),this.$=a[o];break;case 69:r.updateRelStyle("update_rel_style",...a[o]),this.$=a[o];break;case 70:r.updateLayoutConfig("update_layout_config",...a[o]),this.$=a[o];break;case 71:this.$=[a[o]];break;case 72:a[o].unshift(a[o-1]),this.$=a[o];break;case 73:case 75:this.$=a[o].trim();break;case 74:let t={};t[a[o-1].trim()]=a[o].trim(),this.$=t;break;case 76:this.$=""}}),"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:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{13:70,19:20,20:21,21:22,22:e,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{13:71,19:20,20:21,21:22,22:e,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{13:72,19:20,20:21,21:22,22:e,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{13:73,19:20,20:21,21:22,22:e,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{14:[1,74]},t(W,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:l,37:h,38:u,39:d,40:p,41:g,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y}),t(W,[2,14]),t(H,[2,16],{12:[1,76]}),t(W,[2,36],{12:[1,77]}),t(V,[2,19]),t(V,[2,20]),{25:[1,78]},{27:[1,79]},t(V,[2,23]),{35:80,75:81,76:X,77:K,79:Z,80:Q},{35:86,75:81,76:X,77:K,79:Z,80:Q},{35:87,75:81,76:X,77:K,79:Z,80:Q},{35:88,75:81,76:X,77:K,79:Z,80:Q},{35:89,75:81,76:X,77:K,79:Z,80:Q},{35:90,75:81,76:X,77:K,79:Z,80:Q},{35:91,75:81,76:X,77:K,79:Z,80:Q},{35:92,75:81,76:X,77:K,79:Z,80:Q},{35:93,75:81,76:X,77:K,79:Z,80:Q},{35:94,75:81,76:X,77:K,79:Z,80:Q},{35:95,75:81,76:X,77:K,79:Z,80:Q},{35:96,75:81,76:X,77:K,79:Z,80:Q},{35:97,75:81,76:X,77:K,79:Z,80:Q},{35:98,75:81,76:X,77:K,79:Z,80:Q},{35:99,75:81,76:X,77:K,79:Z,80:Q},{35:100,75:81,76:X,77:K,79:Z,80:Q},{35:101,75:81,76:X,77:K,79:Z,80:Q},{35:102,75:81,76:X,77:K,79:Z,80:Q},{35:103,75:81,76:X,77:K,79:Z,80:Q},{35:104,75:81,76:X,77:K,79:Z,80:Q},t(J,[2,59]),{35:105,75:81,76:X,77:K,79:Z,80:Q},{35:106,75:81,76:X,77:K,79:Z,80:Q},{35:107,75:81,76:X,77:K,79:Z,80:Q},{35:108,75:81,76:X,77:K,79:Z,80:Q},{35:109,75:81,76:X,77:K,79:Z,80:Q},{35:110,75:81,76:X,77:K,79:Z,80:Q},{35:111,75:81,76:X,77:K,79:Z,80:Q},{35:112,75:81,76:X,77:K,79:Z,80:Q},{35:113,75:81,76:X,77:K,79:Z,80:Q},{35:114,75:81,76:X,77:K,79:Z,80:Q},{35:115,75:81,76:X,77:K,79:Z,80:Q},{20:116,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:X,77:K,79:Z,80:Q},{35:120,75:81,76:X,77:K,79:Z,80:Q},{35:121,75:81,76:X,77:K,79:Z,80:Q},{35:122,75:81,76:X,77:K,79:Z,80:Q},{35:123,75:81,76:X,77:K,79:Z,80:Q},{35:124,75:81,76:X,77:K,79:Z,80:Q},{35:125,75:81,76:X,77:K,79:Z,80:Q},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(W,[2,15]),t(H,[2,17],{21:22,19:130,22:e,23:n,24:r,26:i,28:a}),t(W,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:n,24:r,26:i,28:a,34:o,36:l,37:h,38:u,39:d,40:p,41:g,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y}),t(V,[2,21]),t(V,[2,22]),t(J,[2,39]),t(tt,[2,71],{75:81,35:132,76:X,77:K,79:Z,80:Q}),t(et,[2,73]),{78:[1,133]},t(et,[2,75]),t(et,[2,76]),t(J,[2,40]),t(J,[2,41]),t(J,[2,42]),t(J,[2,43]),t(J,[2,44]),t(J,[2,45]),t(J,[2,46]),t(J,[2,47]),t(J,[2,48]),t(J,[2,49]),t(J,[2,50]),t(J,[2,51]),t(J,[2,52]),t(J,[2,53]),t(J,[2,54]),t(J,[2,55]),t(J,[2,56]),t(J,[2,57]),t(J,[2,58]),t(J,[2,60]),t(J,[2,61]),t(J,[2,62]),t(J,[2,63]),t(J,[2,64]),t(J,[2,65]),t(J,[2,66]),t(J,[2,67]),t(J,[2,68]),t(J,[2,69]),t(J,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(nt,[2,28]),t(nt,[2,29]),t(nt,[2,30]),t(nt,[2,31]),t(nt,[2,32]),t(nt,[2,33]),t(nt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(H,[2,18]),t(W,[2,38]),t(tt,[2,72]),t(et,[2,74]),t(J,[2,24]),t(J,[2,35]),t(rt,[2,25]),t(rt,[2,26],{12:[1,138]}),t(rt,[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:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},at=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:s((function(t,e,n,r){switch(n){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:case 73:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 16:case 70:break;case 14:c;break;case 15:return 12;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: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:case 53:return this.begin("rel_u"),66;case 54:case 55:return this.begin("rel_d"),67;case 56:case 57:return this.begin("rel_l"),68;case 58: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:case 79:this.popState(),this.popState();break;case 69:case 71:return 80;case 72:this.begin("string");break;case 74:case 80: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 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:[],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 t}();function st(){this.yy={}}return it.lexer=at,s(st,"Parser"),st.prototype=it,it.Parser=st,new st}();hW.parser=hW;var uW,dW=hW,pW=[],gW=[""],fW="global",mW="",yW=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],vW=[],xW="",bW=!1,wW=4,kW=2,TW=s((function(){return uW}),"getC4Type"),_W=s((function(t){let e=an(t,Hn());uW=e}),"setC4Type"),EW=s((function(t,e,n,r,i,a,s,o,l){if(null==t||null==e||null==n||null==r)return;let c={};const h=vW.find((t=>t.from===e&&t.to===n));if(h?c=h:vW.push(c),c.type=t,c.from=e,c.to=n,c.label={text:r},null==i)c.techn={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];c[t]={text:e}}else c.techn={text:i};if(null==a)c.descr={text:""};else if("object"==typeof a){let[t,e]=Object.entries(a)[0];c[t]={text:e}}else c.descr={text:a};if("object"==typeof s){let[t,e]=Object.entries(s)[0];c[t]=e}else c.sprite=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];c[t]=e}else c.tags=o;if("object"==typeof l){let[t,e]=Object.entries(l)[0];c[t]=e}else c.link=l;c.wrap=VW()}),"addRel"),CW=s((function(t,e,n,r,i,a,s){if(null===e||null===n)return;let o={};const l=pW.find((t=>t.alias===e));if(l&&e===l.alias?o=l:(o.alias=e,pW.push(o)),o.label=null==n?{text:""}:{text:n},null==r)o.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]={text:e}}else o.descr={text:r};if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]=e}else o.sprite=i;if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=e}else o.tags=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=e}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=fW,o.wrap=VW()}),"addPersonOrSystem"),SW=s((function(t,e,n,r,i,a,s,o){if(null===e||null===n)return;let l={};const c=pW.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,pW.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.techn={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.techn={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=VW(),l.typeC4Shape={text:t},l.parentBoundary=fW}),"addContainer"),AW=s((function(t,e,n,r,i,a,s,o){if(null===e||null===n)return;let l={};const c=pW.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,pW.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.techn={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.techn={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=VW(),l.typeC4Shape={text:t},l.parentBoundary=fW}),"addComponent"),LW=s((function(t,e,n,r,i){if(null===t||null===e)return;let a={};const s=yW.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,yW.push(a)),a.label=null==e?{text:""}:{text:e},null==n)a.type={text:"system"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]={text:e}}else a.type={text:n};if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]=e}else a.tags=r;if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.link=i;a.parentBoundary=fW,a.wrap=VW(),mW=fW,fW=t,gW.push(mW)}),"addPersonOrSystemBoundary"),NW=s((function(t,e,n,r,i){if(null===t||null===e)return;let a={};const s=yW.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,yW.push(a)),a.label=null==e?{text:""}:{text:e},null==n)a.type={text:"container"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]={text:e}}else a.type={text:n};if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]=e}else a.tags=r;if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.link=i;a.parentBoundary=fW,a.wrap=VW(),mW=fW,fW=t,gW.push(mW)}),"addContainerBoundary"),IW=s((function(t,e,n,r,i,a,s,o){if(null===e||null===n)return;let l={};const c=yW.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,yW.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.type={text:"node"};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.type={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.nodeType=t,l.parentBoundary=fW,l.wrap=VW(),mW=fW,fW=e,gW.push(mW)}),"addDeploymentNode"),MW=s((function(){fW=mW,gW.pop(),mW=gW.pop(),gW.push(mW)}),"popBoundaryParseStack"),RW=s((function(t,e,n,r,i,a,s,o,l,c,h){let u=pW.find((t=>t.alias===e));if(void 0!==u||(u=yW.find((t=>t.alias===e)),void 0!==u)){if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];u[t]=e}else u.bgColor=n;if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];u[t]=e}else u.fontColor=r;if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];u[t]=e}else u.borderColor=i;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];u[t]=e}else u.shadowing=a;if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];u[t]=e}else u.shape=s;if(null!=o)if("object"==typeof o){let[t,e]=Object.entries(o)[0];u[t]=e}else u.sprite=o;if(null!=l)if("object"==typeof l){let[t,e]=Object.entries(l)[0];u[t]=e}else u.techn=l;if(null!=c)if("object"==typeof c){let[t,e]=Object.entries(c)[0];u[t]=e}else u.legendText=c;if(null!=h)if("object"==typeof h){let[t,e]=Object.entries(h)[0];u[t]=e}else u.legendSprite=h}}),"updateElStyle"),DW=s((function(t,e,n,r,i,a,s){const o=vW.find((t=>t.from===e&&t.to===n));if(void 0!==o){if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]=e}else o.textColor=r;if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]=e}else o.lineColor=i;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=parseInt(e)}else o.offsetX=parseInt(a);if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=parseInt(e)}else o.offsetY=parseInt(s)}}),"updateRelStyle"),OW=s((function(t,e,n){let r=wW,i=kW;if("object"==typeof e){const t=Object.values(e)[0];r=parseInt(t)}else r=parseInt(e);if("object"==typeof n){const t=Object.values(n)[0];i=parseInt(t)}else i=parseInt(n);r>=1&&(wW=r),i>=1&&(kW=i)}),"updateLayoutConfig"),PW=s((function(){return wW}),"getC4ShapeInRow"),BW=s((function(){return kW}),"getC4BoundaryInRow"),$W=s((function(){return fW}),"getCurrentBoundaryParse"),FW=s((function(){return mW}),"getParentBoundaryParse"),zW=s((function(t){return null==t?pW:pW.filter((e=>e.parentBoundary===t))}),"getC4ShapeArray"),UW=s((function(t){return pW.find((e=>e.alias===t))}),"getC4Shape"),GW=s((function(t){return Object.keys(zW(t))}),"getC4ShapeKeys"),qW=s((function(t){return null==t?yW:yW.filter((e=>e.parentBoundary===t))}),"getBoundaries"),jW=qW,YW=s((function(){return vW}),"getRels"),WW=s((function(){return xW}),"getTitle"),HW=s((function(t){bW=t}),"setWrap"),VW=s((function(){return bW}),"autoWrap"),XW=s((function(){pW=[],yW=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],mW="",fW="global",gW=[""],vW=[],gW=[""],xW="",bW=!1,wW=4,kW=2}),"clear"),KW=s((function(t){let e=an(t,Hn());xW=e}),"setTitle"),ZW={addPersonOrSystem:CW,addPersonOrSystemBoundary:LW,addContainer:SW,addContainerBoundary:NW,addComponent:AW,addDeploymentNode:IW,popBoundaryParseStack:MW,addRel:EW,updateElStyle:RW,updateRelStyle:DW,updateLayoutConfig:OW,autoWrap:VW,setWrap:HW,getC4ShapeArray:zW,getC4Shape:UW,getC4ShapeKeys:GW,getBoundaries:qW,getBoundarys:jW,getCurrentBoundaryParse:$W,getParentBoundaryParse:FW,getRels:YW,getTitle:WW,getC4Type:TW,getC4ShapeInRow:PW,getC4BoundaryInRow:BW,setAccTitle:Fn,getAccTitle:zn,getAccDescription:Gn,setAccDescription:Un,getConfig:s((()=>Hn().c4),"getConfig"),clear:XW,LINETYPE:{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},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:KW,setC4Type:_W},QW=d(Cy(),1),JW=s((function(t,e){return rW(t,e)}),"drawRect"),tH=s((function(t,e,n,r,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",n),s.attr("x",r),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:(0,QW.sanitizeUrl)(a);s.attr("xlink:href",o)}),"drawImage"),eH=s(((t,e,n)=>{const r=t.append("g");let i=0;for(let t of e){let e=t.textColor?t.textColor:"#444444",a=t.lineColor?t.lineColor:"#444444",s=t.offsetX?parseInt(t.offsetX):0,o=t.offsetY?parseInt(t.offsetY):0,l="";if(0===i){let e=r.append("line");e.attr("x1",t.startPoint.x),e.attr("y1",t.startPoint.y),e.attr("x2",t.endPoint.x),e.attr("y2",t.endPoint.y),e.attr("stroke-width","1"),e.attr("stroke",a),e.style("fill","none"),"rel_b"!==t.type&&e.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+l+"#arrowend)"),i=-1}else{let e=r.append("path");e.attr("fill","none").attr("stroke-width","1").attr("stroke",a).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",t.startPoint.x).replaceAll("starty",t.startPoint.y).replaceAll("controlx",t.startPoint.x+(t.endPoint.x-t.startPoint.x)/2-(t.endPoint.x-t.startPoint.x)/4).replaceAll("controly",t.startPoint.y+(t.endPoint.y-t.startPoint.y)/2).replaceAll("stopx",t.endPoint.x).replaceAll("stopy",t.endPoint.y)),"rel_b"!==t.type&&e.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+l+"#arrowend)")}let c=n.messageFont();pH(n)(t.label.text,r,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+s,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+o,t.label.width,t.label.height,{fill:e},c),t.techn&&""!==t.techn.text&&(c=n.messageFont(),pH(n)("["+t.techn.text+"]",r,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+s,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+n.messageFontSize+5+o,Math.max(t.label.width,t.techn.width),t.techn.height,{fill:e,"font-style":"italic"},c))}}),"drawRels"),nH=s((function(t,e,n){const r=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let 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};JW(r,l);let c=n.boundaryFont();c.fontWeight="bold",c.fontSize=c.fontSize+2,c.fontColor=s,pH(n)(e.label.text,r,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},c),e.type&&""!==e.type.text&&(c=n.boundaryFont(),c.fontColor=s,pH(n)(e.type.text,r,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},c)),e.descr&&""!==e.descr.text&&(c=n.boundaryFont(),c.fontSize=c.fontSize-2,c.fontColor=s,pH(n)(e.descr.text,r,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},c))}),"drawBoundary"),rH=s((function(t,e,n){let r=e.bgColor?e.bgColor:n[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:n[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="}const o=t.append("g");o.attr("class","person-man");const l=lW();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=r,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},JW(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",r).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",r).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2))}let c=dH(n,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",c.fontFamily).attr("font-size",c.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":tH(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s)}let h=n[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,pH(n)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=n[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&""!==e.techn?.text?pH(n)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&""!==e.type.text&&pH(n)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&""!==e.descr.text&&(h=n.personFont(),h.fontColor=a,pH(n)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height}),"drawC4Shape"),iH=s((function(t){t.append("defs").append("symbol").attr("id","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"),aH=s((function(t){t.append("defs").append("symbol").attr("id","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"),sH=s((function(t){t.append("defs").append("symbol").attr("id","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"),oH=s((function(t){t.append("defs").append("marker").attr("id","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"),lH=s((function(t){t.append("defs").append("marker").attr("id","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"),cH=s((function(t){t.append("defs").append("marker").attr("id","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"),hH=s((function(t){t.append("defs").append("marker").attr("id","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)}),"insertDynamicNumber"),uH=s((function(t){const e=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);e.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"),e.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"),dH=s(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"getC4ShapeFont"),pH=function(){function t(t,e,n,i,a,s,o){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,n,i,a,s,o,l){const{fontSize:c,fontFamily:h,fontWeight:u}=l,d=t.split(_n.lineBreakRegex);for(let t=0;t=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>yH)&&(e=this.nextData.startx+t.margin+xH.nextLinePaddingX,r=this.nextData.stopy+2*t.margin,this.nextData.stopx=n=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=i=r+t.height,this.nextData.cnt=1),t.x=e,t.y=r,this.updateVal(this.data,"startx",e,Math.min),this.updateVal(this.data,"starty",r,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",i,Math.max),this.updateVal(this.nextData,"startx",e,Math.min),this.updateVal(this.nextData,"starty",r,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",i,Math.max)}init(t){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},wH(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},wH=s((function(t){L(xH,t),t.fontFamily&&(xH.personFontFamily=xH.systemFontFamily=xH.messageFontFamily=t.fontFamily),t.fontSize&&(xH.personFontSize=xH.systemFontSize=xH.messageFontSize=t.fontSize),t.fontWeight&&(xH.personFontWeight=xH.systemFontWeight=xH.messageFontWeight=t.fontWeight)}),"setConf"),kH=s(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"c4ShapeFont"),TH=s((t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight})),"boundaryFont"),_H=s((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont");function EH(t,e,n,r,i){if(!e[t].width)if(n)e[t].text=ak(e[t].text,i,r),e[t].textLines=e[t].text.split(_n.lineBreakRegex).length,e[t].width=i,e[t].height=ok(e[t].text,r);else{let n=e[t].text.split(_n.lineBreakRegex);e[t].textLines=n.length;let i=0;e[t].height=0,e[t].width=0;for(const a of n)e[t].width=Math.max(lk(a,r),e[t].width),i=ok(a,r),e[t].height=e[t].height+i}}s(EH,"calcC4ShapeTextWH");var CH=s((function(t,e,n){e.x=n.data.startx,e.y=n.data.starty,e.width=n.data.stopx-n.data.startx,e.height=n.data.stopy-n.data.starty,e.label.y=xH.c4ShapeMargin-35;let r=e.wrap&&xH.wrap,i=TH(xH);i.fontSize=i.fontSize+2,i.fontWeight="bold",EH("label",e,r,i,lk(e.label.text,i)),gH.drawBoundary(t,e,xH)}),"drawBoundary"),SH=s((function(t,e,n,r){let i=0;for(const a of r){i=0;const r=n[a];let s=kH(xH,r.typeC4Shape.text);switch(s.fontSize=s.fontSize-2,r.typeC4Shape.width=lk("«"+r.typeC4Shape.text+"»",s),r.typeC4Shape.height=s.fontSize+2,r.typeC4Shape.Y=xH.c4ShapePadding,i=r.typeC4Shape.Y+r.typeC4Shape.height-4,r.image={width:0,height:0,Y:0},r.typeC4Shape.text){case"person":case"external_person":r.image.width=48,r.image.height=48,r.image.Y=i,i=r.image.Y+r.image.height}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=i,i=r.image.Y+r.image.height);let o=r.wrap&&xH.wrap,l=xH.width-2*xH.c4ShapePadding,c=kH(xH,r.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",EH("label",r,o,c,l),r.label.Y=i+8,i=r.label.Y+r.label.height,r.type&&""!==r.type.text){r.type.text="["+r.type.text+"]",EH("type",r,o,kH(xH,r.typeC4Shape.text),l),r.type.Y=i+5,i=r.type.Y+r.type.height}else if(r.techn&&""!==r.techn.text){r.techn.text="["+r.techn.text+"]",EH("techn",r,o,kH(xH,r.techn.text),l),r.techn.Y=i+5,i=r.techn.Y+r.techn.height}let h=i,u=r.label.width;if(r.descr&&""!==r.descr.text){EH("descr",r,o,kH(xH,r.typeC4Shape.text),l),r.descr.Y=i+20,i=r.descr.Y+r.descr.height,u=Math.max(r.label.width,r.descr.width),h=i-5*r.descr.textLines}u+=xH.c4ShapePadding,r.width=Math.max(r.width||xH.width,u,xH.width),r.height=Math.max(r.height||xH.height,h,xH.height),r.margin=r.margin||xH.c4ShapeMargin,t.insert(r),gH.drawC4Shape(e,r,xH)}t.bumpLastMargin(xH.c4ShapeMargin)}),"drawC4ShapeArray"),AH=class{static{s(this,"Point")}constructor(t,e){this.x=t,this.y=e}},LH=s((function(t,e){let n=t.x,r=t.y,i=e.x,a=e.y,s=n+t.width/2,o=r+t.height/2,l=Math.abs(n-i),c=Math.abs(r-a),h=c/l,u=t.height/t.width,d=null;return r==a&&ni?d=new AH(n,o):n==i&&ra&&(d=new AH(s,r)),n>i&&r=h?new AH(n,o+h*t.width/2):new AH(s-l/c*t.height/2,r+t.height):n=h?new AH(n+t.width,o+h*t.width/2):new AH(s+l/c*t.height/2,r+t.height):na?d=u>=h?new AH(n+t.width,o-h*t.width/2):new AH(s+t.height/2*l/c,r):n>i&&r>a&&(d=u>=h?new AH(n,o-t.width/2*h):new AH(s-t.height/2*l/c,r)),d}),"getIntersectPoint"),NH=s((function(t,e){let n={x:0,y:0};n.x=e.x+e.width/2,n.y=e.y+e.height/2;let r=LH(t,n);return n.x=t.x+t.width/2,n.y=t.y+t.height/2,{startPoint:r,endPoint:LH(e,n)}}),"getIntersectPoints"),IH=s((function(t,e,n,r){let i=0;for(let t of e){i+=1;let e=t.wrap&&xH.wrap,a=_H(xH);"C4Dynamic"===r.db.getC4Type()&&(t.label.text=i+": "+t.label.text);let s=lk(t.label.text,a);EH("label",t,e,a,s),t.techn&&""!==t.techn.text&&(s=lk(t.techn.text,a),EH("techn",t,e,a,s)),t.descr&&""!==t.descr.text&&(s=lk(t.descr.text,a),EH("descr",t,e,a,s));let o=n(t.from),l=n(t.to),c=NH(o,l);t.startPoint=c.startPoint,t.endPoint=c.endPoint}gH.drawRels(t,e,xH)}),"drawRels");function MH(t,e,n,r,i){let a=new bH(i);a.data.widthLimit=n.data.widthLimit/Math.min(vH,r.length);for(let[s,o]of r.entries()){let r=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=r,r=o.image.Y+o.image.height);let l=o.wrap&&xH.wrap,c=TH(xH);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",EH("label",o,l,c,a.data.widthLimit),o.label.Y=r+8,r=o.label.Y+o.label.height,o.type&&""!==o.type.text){o.type.text="["+o.type.text+"]",EH("type",o,l,TH(xH),a.data.widthLimit),o.type.Y=r+5,r=o.type.Y+o.type.height}if(o.descr&&""!==o.descr.text){let t=TH(xH);t.fontSize=t.fontSize-2,EH("descr",o,l,t,a.data.widthLimit),o.descr.Y=r+20,r=o.descr.Y+o.descr.height}if(0==s||s%vH==0){let t=n.data.startx+xH.diagramMarginX,e=n.data.stopy+xH.diagramMarginY+r;a.setData(t,t,e,e)}else{let t=a.data.stopx!==a.data.startx?a.data.stopx+xH.diagramMarginX:a.data.startx,e=a.data.starty;a.setData(t,t,e,e)}a.name=o.alias;let h=i.db.getC4ShapeArray(o.alias),u=i.db.getC4ShapeKeys(o.alias);u.length>0&&SH(a,t,h,u),e=o.alias;let d=i.db.getBoundarys(e);d.length>0&&MH(t,e,a,d,i),"global"!==o.alias&&CH(t,o,a),n.data.stopy=Math.max(a.data.stopy+xH.c4ShapeMargin,n.data.stopy),n.data.stopx=Math.max(a.data.stopx+xH.c4ShapeMargin,n.data.stopx),fH=Math.max(fH,n.data.stopx),mH=Math.max(mH,n.data.stopy)}}s(MH,"drawInsideBoundary");var RH,DH,OH=s((function(t,e,n,r){xH=Hn().c4;const i=Hn().securityLevel;let a;"sandbox"===i&&(a=Oa("#i"+e));const s=Oa("sandbox"===i?a.nodes()[0].contentDocument.body:"body");let o=r.db;r.db.setWrap(xH.wrap),yH=o.getC4ShapeInRow(),vH=o.getC4BoundaryInRow(),m.debug(`C:${JSON.stringify(xH,null,2)}`);const l="sandbox"===i?s.select(`[id="${e}"]`):Oa(`[id="${e}"]`);gH.insertComputerIcon(l),gH.insertDatabaseIcon(l),gH.insertClockIcon(l);let c=new bH(r);c.setData(xH.diagramMarginX,xH.diagramMarginX,xH.diagramMarginY,xH.diagramMarginY),c.data.widthLimit=screen.availWidth,fH=xH.diagramMarginX,mH=xH.diagramMarginY;const h=r.db.getTitle();MH(l,"",c,r.db.getBoundarys(""),r),gH.insertArrowHead(l),gH.insertArrowEnd(l),gH.insertArrowCrossHead(l),gH.insertArrowFilledHead(l),IH(l,r.db.getRels(),r.db.getC4Shape,r),c.data.stopx=fH,c.data.stopy=mH;const u=c.data;let d=u.stopy-u.starty+2*xH.diagramMarginY;const p=u.stopx-u.startx+2*xH.diagramMarginX;h&&l.append("text").text(h).attr("x",(u.stopx-u.startx)/2-4*xH.diagramMarginX).attr("y",u.starty+xH.diagramMarginY),Sn(l,d,p,xH.useMaxWidth);const g=h?60:0;l.attr("viewBox",u.startx-xH.diagramMarginX+" -"+(xH.diagramMarginY+g)+" "+p+" "+(d+g)),m.debug("models:",u)}),"draw"),PH={drawPersonOrSystemArray:SH,drawBoundary:CH,setConf:wH,draw:OH},BH={parser:dW,db:ZW,renderer:PH,styles:s((t=>`.person {\n stroke: ${t.personBorder};\n fill: ${t.personBkg};\n }\n`),"getStyles"),init:s((({c4:t,wrap:e})=>{PH.setConf(t),ZW.setWrap(e)}),"init")},$H=Object.freeze({__proto__:null,diagram:BH}),FH=s(((t,e)=>{let n;"sandbox"===e&&(n=Oa("#i"+t));return Oa("sandbox"===e?n.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)}),"getDiagramElement"),zH=s(((t,e,n,r)=>{t.attr("class",n);const{width:i,height:a,x:s,y:o}=UH(t,e);Sn(t,a,i,r);const l=GH(s,o,i,a,e);t.attr("viewBox",l),m.debug(`viewBox configured: ${l} with padding: ${e}`)}),"setupViewPortForSVG"),UH=s(((t,e)=>{const n=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+2*e,height:n.height+2*e,x:n.x,y:n.y}}),"calculateDimensionsWithPadding"),GH=s(((t,e,n,r,i)=>`${t-i} ${e-i} ${n} ${r}`),"createViewBox"),qH=0,jH=Hn(),YH=new Map,WH=[],HH=new Map,VH=[],XH=new Map,KH=new Map,ZH=0,QH=!0,JH=[],tV=s((t=>_n.sanitizeText(t,jH)),"sanitizeText"),eV=s((function(t){for(const e of YH.values())if(e.id===t)return e.domId;return t}),"lookUpDomId"),nV=s((function(t,e,n,r,i,a,s={},o){if(!t||0===t.trim().length)return;let l,c=YH.get(t);if(void 0===c&&(c={id:t,labelType:"text",domId:"flowchart-"+t+"-"+qH,styles:[],classes:[]},YH.set(t,c)),qH++,void 0!==e?(jH=Hn(),l=tV(e.text.trim()),c.labelType=e.type,l.startsWith('"')&&l.endsWith('"')&&(l=l.substring(1,l.length-1)),c.text=l):void 0===c.text&&(c.text=t),void 0!==n&&(c.type=n),null!=r&&r.forEach((function(t){c.styles.push(t)})),null!=i&&i.forEach((function(t){c.classes.push(t)})),void 0!==a&&(c.dir=a),void 0===c.props?c.props=s:void 0!==s&&Object.assign(c.props,s),void 0!==o){let e;e=o.includes("\n")?o+"\n":"{\n"+o+"\n}";const n=Um(e,{schema:zm});if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!pS(n.shape))throw new Error(`No such shape: ${n.shape}.`);c.type=n?.shape}n?.label&&(c.text=n?.label),n?.icon&&(c.icon=n?.icon,n.label?.trim()||c.text!==t||(c.text="")),n?.form&&(c.form=n?.form),n?.pos&&(c.pos=n?.pos),n?.img&&(c.img=n?.img,n.label?.trim()||c.text!==t||(c.text="")),n?.constraint&&(c.constraint=n.constraint),n.w&&(c.assetWidth=Number(n.w)),n.h&&(c.assetHeight=Number(n.h))}}),"addVertex"),rV=s((function(t,e,n){const r={start:t,end:e,type:void 0,text:"",labelType:"text"};m.info("abc78 Got edge...",r);const i=n.text;if(void 0!==i&&(r.text=tV(i.text.trim()),r.text.startsWith('"')&&r.text.endsWith('"')&&(r.text=r.text.substring(1,r.text.length-1)),r.labelType=i.type),void 0!==n&&(r.type=n.type,r.stroke=n.stroke,r.length=n.length>10?10:n.length),!(WH.length<(jH.maxEdges??500)))throw new Error(`Edge limit exceeded. ${WH.length} edges found, but the limit is ${jH.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`);m.info("Pushing edge..."),WH.push(r)}),"addSingleLink"),iV=s((function(t,e,n){m.info("addLink",t,e,n);for(const r of t)for(const t of e)rV(r,t,n)}),"addLink"),aV=s((function(t,e){t.forEach((function(t){"default"===t?WH.defaultInterpolate=e:WH[t].interpolate=e}))}),"updateLinkInterpolate"),sV=s((function(t,e){t.forEach((function(t){if("number"==typeof t&&t>=WH.length)throw new Error(`The index ${t} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${WH.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);"default"===t?WH.defaultStyle=e:(WH[t].style=e,(WH[t]?.style?.length??0)>0&&!WH[t]?.style?.some((t=>t?.startsWith("fill")))&&WH[t]?.style?.push("fill:none"))}))}),"updateLink"),oV=s((function(t,e){t.split(",").forEach((function(t){let n=HH.get(t);void 0===n&&(n={id:t,styles:[],textStyles:[]},HH.set(t,n)),null!=e&&e.forEach((function(t){if(/color/.exec(t)){const e=t.replace("fill","bgFill");n.textStyles.push(e)}n.styles.push(t)}))}))}),"addClass"),lV=s((function(t){/.*/.exec(RH)&&(RH="LR"),/.*v/.exec(RH)&&(RH="TB"),"TD"===RH&&(RH="TB")}),"setDirection"),cV=s((function(t,e){for(const n of t.split(",")){const t=YH.get(n);t&&t.classes.push(e);const r=XH.get(n);r&&r.classes.push(e)}}),"setClass"),hV=s((function(t,e){if(void 0!==e){e=tV(e);for(const n of t.split(","))KH.set("gen-1"===DH?eV(n):n,e)}}),"setTooltip"),uV=s((function(t,e,n){const r=eV(t);if("loose"!==Hn().securityLevel)return;if(void 0===e)return;let i=[];if("string"==typeof n){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);Oa(this).classed("hover",!1)}))}),"setupToolTips");JH.push(bV);var wV=s((function(t="gen-1"){YH=new Map,HH=new Map,WH=[],JH=[bV],VH=[],XH=new Map,ZH=0,KH=new Map,QH=!0,DH=t,jH=Hn(),$n()}),"clear"),kV=s((t=>{DH=t||"gen-2"}),"setGen"),TV=s((function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}),"defaultStyle"),_V=s((function(t,e,n){let r=t.text.trim(),i=n.text;function a(t){const e={boolean:{},number:{},string:{}},n=[];let r;const i=t.filter((function(t){const i=typeof t;return t.stmt&&"dir"===t.stmt?(r=t.value,!1):""!==t.trim()&&(i in e?!e[i].hasOwnProperty(t)&&(e[i][t]=!0):!n.includes(t)&&n.push(t))}));return{nodeList:i,dir:r}}t===n&&/\s/.exec(n.text)&&(r=void 0),s(a,"uniq");const{nodeList:o,dir:l}=a(e.flat());if("gen-1"===DH)for(let t=0;t2e3)return{result:!1,count:0};if(SV[CV]=e,VH[e].id===t)return{result:!0,count:0};let r=0,i=1;for(;r=0){const n=AV(t,e);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}),"indexNodes2"),LV=s((function(t){return SV[t]}),"getDepthFirstPos"),NV=s((function(){CV=-1,VH.length>0&&AV("none",VH.length-1)}),"indexNodes"),IV=s((function(){return VH}),"getSubGraphs"),MV=s((()=>!!QH&&(QH=!1,!0)),"firstGraph"),RV=s((t=>{let e=t.trim(),n="arrow_open";switch(e[0]){case"<":n="arrow_point",e=e.slice(1);break;case"x":n="arrow_cross",e=e.slice(1);break;case"o":n="arrow_circle",e=e.slice(1)}let r="normal";return e.includes("=")&&(r="thick"),e.includes(".")&&(r="dotted"),{type:n,stroke:r}}),"destructStartLink"),DV=s(((t,e)=>{const n=e.length;let r=0;for(let i=0;i{const e=t.trim();let n=e.slice(0,-1),r="arrow_open";switch(e.slice(-1)){case"x":r="arrow_cross",e.startsWith("x")&&(r="double_"+r,n=n.slice(1));break;case">":r="arrow_point",e.startsWith("<")&&(r="double_"+r,n=n.slice(1));break;case"o":r="arrow_circle",e.startsWith("o")&&(r="double_"+r,n=n.slice(1))}let i="normal",a=n.length-1;n.startsWith("=")&&(i="thick"),n.startsWith("~")&&(i="invisible");const s=DV(".",n);return s&&(i="dotted",a=s),{type:r,stroke:i,length:a}}),"destructEndLink"),PV=s(((t,e)=>{const n=OV(t);let r;if(e){if(r=RV(e),r.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===r.type)r.type=n.type;else{if(r.type!==n.type)return{type:"INVALID",stroke:"INVALID"};r.type="double_"+r.type}return"double_arrow"===r.type&&(r.type="double_arrow_point"),r.length=n.length,r}return n}),"destructLink"),BV=s(((t,e)=>{for(const n of t)if(n.nodes.includes(e))return!0;return!1}),"exists"),$V=s(((t,e)=>{const n=[];return t.nodes.forEach(((r,i)=>{BV(e,r)||n.push(t.nodes[i])})),{nodes:n}}),"makeUniq"),FV={firstGraph:MV},zV=s((t=>{if(t.img)return"imageSquare";if(t.icon)return"circle"===t.form?"iconCircle":"square"===t.form?"iconSquare":"rounded"===t.form?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}),"getTypeFromVertex"),UV=s(((t,e)=>t.find((t=>t.id===e))),"findNode"),GV=s((t=>{let e="none",n="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":n=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),n=e}return{arrowTypeStart:e,arrowTypeEnd:n}}),"destructEdgeType"),qV=s(((t,e,n,r,i,a)=>{const s=n.get(t.id),o=r.get(t.id)??!1,l=UV(e,t.id);if(l)l.cssStyles=t.styles,l.cssCompiledStyles=jV(t.classes),l.cssClasses=t.classes.join(" ");else{const n={id:t.id,label:t.text,labelStyle:"",parentId:s,padding:i.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:jV(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:a,link:t.link,linkTarget:t.linkTarget,tooltip:pV(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};o?e.push({...n,isGroup:!0,shape:"rect"}):e.push({...n,isGroup:!1,shape:zV(t)})}}),"addNodeFromVertex");function jV(t){let e=[];for(const n of t){const t=HH.get(n);t?.styles&&(e=[...e,...t.styles??[]].map((t=>t.trim()))),t?.textStyles&&(e=[...e,...t.textStyles??[]].map((t=>t.trim())))}return e}s(jV,"getCompiledStyles");var YV=s((()=>{const t=Hn(),e=[],n=[],r=IV(),i=new Map,a=new Map;for(let t=r.length-1;t>=0;t--){const e=r[t];e.nodes.length>0&&a.set(e.id,!0);for(const t of e.nodes)i.set(t,e.id)}for(let n=r.length-1;n>=0;n--){const a=r[n];e.push({id:a.id,label:a.title,labelStyle:"",parentId:i.get(a.id),padding:8,cssCompiledStyles:jV(a.classes),cssClasses:a.classes.join(" "),shape:"rect",dir:a.dir,isGroup:!0,look:t.look})}yV().forEach((n=>{qV(n,e,i,a,t,t.look||"classic")}));const s=vV();return s.forEach(((e,r)=>{const{arrowTypeStart:i,arrowTypeEnd:a}=GV(e.type),o=[...s.defaultStyle??[]];e.style&&o.push(...e.style);const l={id:bk(e.start,e.end,{counter:r,prefix:"L"}),start:e.start,end:e.end,type:e.type??"normal",label:e.text,labelpos:"c",thickness:e.stroke,minlen:e.length,classes:"invisible"===e?.stroke?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:"invisible"===e?.stroke?"none":i,arrowTypeEnd:"invisible"===e?.stroke?"none":a,arrowheadStyle:"fill: #333",labelStyle:o,style:o,pattern:e.stroke,look:t.look};n.push(l)})),{nodes:e,edges:n,other:{},config:t}}),"getData"),WV={defaultConfig:s((()=>Xn.flowchart),"defaultConfig"),setAccTitle:Fn,getAccTitle:zn,getAccDescription:Gn,getData:YV,setAccDescription:Un,addVertex:nV,lookUpDomId:eV,addLink:iV,updateLinkInterpolate:aV,updateLink:sV,addClass:oV,setDirection:lV,setClass:cV,setTooltip:hV,getTooltip:pV,setClickEvent:gV,setLink:dV,bindFunctions:fV,getDirection:mV,getVertices:yV,getEdges:vV,getClasses:xV,clear:wV,setGen:kV,defaultStyle:TV,addSubGraph:_V,getDepthFirstPos:LV,indexNodes:NV,getSubGraphs:IV,destructLink:PV,lex:FV,exists:BV,makeUniq:$V,setDiagramTitle:qn,getDiagramTitle:jn},HV=s((function(t,e){return e.db.getClasses()}),"getClasses"),VV=s((async function(t,e,n,r){m.info("REF0:"),m.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Hn();let o;"sandbox"===i&&(o=Oa("#i"+e));const l="sandbox"===i?o.nodes()[0].contentDocument:document;m.debug("Before getData: ");const c=r.db.getData();m.debug("Data: ",c);const h=FH(e,i),u=mV();c.type=r.type,c.layoutAlgorithm=nA(s),"dagre"===c.layoutAlgorithm&&"elk"===s&&m.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."),c.direction=u,c.nodeSpacing=a?.nodeSpacing||50,c.rankSpacing=a?.rankSpacing||50,c.markers=["point","circle","cross"],c.diagramId=e,m.debug("REF1:",c),await eA(c,h);const d=c.config.flowchart?.diagramPadding??8;yk.insertTitle(h,"flowchartTitleText",a?.titleTopMargin||0,r.db.getDiagramTitle()),zH(h,d,"flowchart",a?.useMaxWidth||!1);for(const t of c.nodes){const n=Oa(`#${e} [id="${t.id}"]`);if(!n||!t.link)continue;const r=l.createElementNS("http://www.w3.org/2000/svg","a");r.setAttributeNS("http://www.w3.org/2000/svg","class",t.cssClasses),r.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===i?r.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):t.linkTarget&&r.setAttributeNS("http://www.w3.org/2000/svg","target",t.linkTarget);const a=n.insert((function(){return r}),":first-child"),s=n.select(".label-container");s&&a.append((function(){return s.node()}));const o=n.select(".label");o&&a.append((function(){return o.node()}))}}),"draw"),XV={getClasses:HV,draw:VV},KV=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,4],n=[1,3],r=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,83,84,85,86,87,88,101,104,105,108,110,113,114,115,120,121,122,123],a=[2,2],o=[1,13],l=[1,14],c=[1,15],h=[1,16],u=[1,23],d=[1,25],p=[1,26],g=[1,27],f=[1,49],m=[1,48],y=[1,29],v=[1,30],x=[1,31],b=[1,32],w=[1,33],k=[1,44],T=[1,46],_=[1,42],E=[1,47],C=[1,43],S=[1,50],A=[1,45],L=[1,51],N=[1,52],I=[1,34],M=[1,35],R=[1,36],D=[1,37],O=[1,57],P=[1,8,9,10,11,27,32,34,36,38,44,60,83,84,85,86,87,88,101,104,105,108,110,113,114,115,120,121,122,123],B=[1,61],$=[1,60],F=[1,62],z=[8,9,11,75,77],U=[1,77],G=[1,90],q=[1,95],j=[1,94],Y=[1,91],W=[1,87],H=[1,93],V=[1,89],X=[1,96],K=[1,92],Z=[1,97],Q=[1,88],J=[8,9,10,11,40,75,77],tt=[8,9,10,11,40,46,75,77],et=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,88,101,104,105,108,110,113,114,115],nt=[8,9,11,44,60,75,77,88,101,104,105,108,110,113,114,115],rt=[44,60,88,101,104,105,108,110,113,114,115],it=[1,123],at=[1,122],st=[1,130],ot=[1,144],lt=[1,145],ct=[1,146],ht=[1,147],ut=[1,132],dt=[1,134],pt=[1,138],gt=[1,139],ft=[1,140],mt=[1,141],yt=[1,142],vt=[1,143],xt=[1,148],bt=[1,149],wt=[1,128],kt=[1,129],Tt=[1,136],_t=[1,131],Et=[1,135],Ct=[1,133],St=[8,9,10,11,27,32,34,36,38,44,60,83,84,85,86,87,88,101,104,105,108,110,113,114,115,120,121,122,123],At=[1,151],Lt=[1,153],Nt=[8,9,11],It=[8,9,10,11,14,44,60,88,104,105,108,110,113,114,115],Mt=[1,173],Rt=[1,169],Dt=[1,170],Ot=[1,174],Pt=[1,171],Bt=[1,172],$t=[77,115,118],Ft=[8,9,10,11,12,14,27,29,32,44,60,75,83,84,85,86,87,88,89,104,108,110,113,114,115],zt=[10,105],Ut=[31,49,51,53,55,57,62,64,66,67,69,71,115,116,117],Gt=[1,242],qt=[1,240],jt=[1,244],Yt=[1,238],Wt=[1,239],Ht=[1,241],Vt=[1,243],Xt=[1,245],Kt=[1,263],Zt=[8,9,11,105],Qt=[8,9,10,11,60,83,104,105,108,109,110,111],Jt={trace:s((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,edgeTextToken:78,STR:79,MD_STR:80,textToken:81,keywords:82,STYLE:83,LINKSTYLE:84,CLASSDEF:85,CLASS:86,CLICK:87,DOWN:88,UP:89,textNoTagsToken:90,stylesOpt:91,"idString[vertex]":92,"idString[class]":93,CALLBACKNAME:94,CALLBACKARGS:95,HREF:96,LINK_TARGET:97,"STR[link]":98,"STR[tooltip]":99,alphaNum:100,DEFAULT:101,numList:102,INTERPOLATE:103,NUM:104,COMMA:105,style:106,styleComponent:107,NODE_STRING:108,UNIT:109,BRKT:110,PCT:111,idStringToken:112,MINUS:113,MULT:114,UNICODE_TEXT:115,TEXT:116,TAGSTART:117,EDGE_TEXT:118,alphaNumToken:119,direction_tb:120,direction_bt:121,direction_rl:122,direction_lr:123,$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",79:"STR",80:"MD_STR",83:"STYLE",84:"LINKSTYLE",85:"CLASSDEF",86:"CLASS",87:"CLICK",88:"DOWN",89:"UP",92:"idString[vertex]",93:"idString[class]",94:"CALLBACKNAME",95:"CALLBACKARGS",96:"HREF",97:"LINK_TARGET",98:"STR[link]",99:"STR[tooltip]",101:"DEFAULT",103:"INTERPOLATE",104:"NUM",105:"COMMA",108:"NODE_STRING",109:"UNIT",110:"BRKT",111:"PCT",113:"MINUS",114:"MULT",115:"UNICODE_TEXT",116:"TEXT",117:"TAGSTART",118:"EDGE_TEXT",120:"direction_tb",121:"direction_bt",122:"direction_rl",123:"direction_lr"},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],[76,1],[76,2],[76,1],[76,1],[72,1],[73,3],[30,1],[30,2],[30,1],[30,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,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],[102,1],[102,3],[91,1],[91,3],[106,1],[106,2],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[81,1],[81,1],[81,1],[81,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[78,1],[78,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[47,1],[47,2],[100,1],[100,2],[33,1],[33,1],[33,1],[33,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 2:case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 3:(!Array.isArray(a[o])||a[o].length>0)&&a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 181:case 44:case 54:case 76:case 179:this.$=a[o];break;case 11:r.setDirection("TB"),this.$="TB";break;case 12:r.setDirection(a[o-1]),this.$=a[o-1];break;case 27:this.$=a[o-1].nodes;break;case 33:this.$=r.addSubGraph(a[o-6],a[o-1],a[o-4]);break;case 34:this.$=r.addSubGraph(a[o-3],a[o-1],a[o-3]);break;case 35:this.$=r.addSubGraph(void 0,a[o-1],void 0);break;case 37:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 43:case 131:this.$=a[o-1]+a[o];break;case 45:r.addVertex(a[o-1][0],void 0,void 0,void 0,void 0,void 0,void 0,a[o]),r.addLink(a[o-3].stmt,a[o-1],a[o-2]),this.$={stmt:a[o-1],nodes:a[o-1].concat(a[o-3].nodes)};break;case 46:r.addLink(a[o-2].stmt,a[o],a[o-1]),this.$={stmt:a[o],nodes:a[o].concat(a[o-2].nodes)};break;case 47:r.addLink(a[o-3].stmt,a[o-1],a[o-2]),this.$={stmt:a[o-1],nodes:a[o-1].concat(a[o-3].nodes)};break;case 48:this.$={stmt:a[o-1],nodes:a[o-1]};break;case 49:r.addVertex(a[o-1][0],void 0,void 0,void 0,void 0,void 0,void 0,a[o]),this.$={stmt:a[o-1],nodes:a[o-1],shapeData:a[o]};break;case 50:this.$={stmt:a[o],nodes:a[o]};break;case 51:case 126:case 128:this.$=[a[o]];break;case 52:r.addVertex(a[o-5][0],void 0,void 0,void 0,void 0,void 0,void 0,a[o-4]),this.$=a[o-5].concat(a[o]);break;case 53:this.$=a[o-4].concat(a[o]);break;case 55:this.$=a[o-2],r.setClass(a[o-2],a[o]);break;case 56:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"square");break;case 57:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"doublecircle");break;case 58:this.$=a[o-5],r.addVertex(a[o-5],a[o-2],"circle");break;case 59:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"ellipse");break;case 60:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"stadium");break;case 61:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"subroutine");break;case 62:this.$=a[o-7],r.addVertex(a[o-7],a[o-1],"rect",void 0,void 0,void 0,Object.fromEntries([[a[o-5],a[o-3]]]));break;case 63:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"cylinder");break;case 64:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"round");break;case 65:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"diamond");break;case 66:this.$=a[o-5],r.addVertex(a[o-5],a[o-2],"hexagon");break;case 67:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"odd");break;case 68:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"trapezoid");break;case 69:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"inv_trapezoid");break;case 70:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"lean_right");break;case 71:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"lean_left");break;case 72:this.$=a[o],r.addVertex(a[o]);break;case 73:a[o-1].text=a[o],this.$=a[o-1];break;case 74:case 75:a[o-2].text=a[o-1],this.$=a[o-2];break;case 77:var l=r.destructLink(a[o],a[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[o-1]};break;case 78:case 84:case 99:case 101:this.$={text:a[o],type:"text"};break;case 79:case 85:case 100:this.$={text:a[o-1].text+""+a[o],type:a[o-1].type};break;case 80:case 86:this.$={text:a[o],type:"string"};break;case 81:case 87:case 102:this.$={text:a[o],type:"markdown"};break;case 82:l=r.destructLink(a[o]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 83:this.$=a[o-1];break;case 103:this.$=a[o-4],r.addClass(a[o-2],a[o]);break;case 104:this.$=a[o-4],r.setClass(a[o-2],a[o]);break;case 105:case 113:this.$=a[o-1],r.setClickEvent(a[o-1],a[o]);break;case 106:case 114:this.$=a[o-3],r.setClickEvent(a[o-3],a[o-2]),r.setTooltip(a[o-3],a[o]);break;case 107:this.$=a[o-2],r.setClickEvent(a[o-2],a[o-1],a[o]);break;case 108:this.$=a[o-4],r.setClickEvent(a[o-4],a[o-3],a[o-2]),r.setTooltip(a[o-4],a[o]);break;case 109:this.$=a[o-2],r.setLink(a[o-2],a[o]);break;case 110:this.$=a[o-4],r.setLink(a[o-4],a[o-2]),r.setTooltip(a[o-4],a[o]);break;case 111:this.$=a[o-4],r.setLink(a[o-4],a[o-2],a[o]);break;case 112:this.$=a[o-6],r.setLink(a[o-6],a[o-4],a[o]),r.setTooltip(a[o-6],a[o-2]);break;case 115:this.$=a[o-1],r.setLink(a[o-1],a[o]);break;case 116:this.$=a[o-3],r.setLink(a[o-3],a[o-2]),r.setTooltip(a[o-3],a[o]);break;case 117:this.$=a[o-3],r.setLink(a[o-3],a[o-2],a[o]);break;case 118:this.$=a[o-5],r.setLink(a[o-5],a[o-4],a[o]),r.setTooltip(a[o-5],a[o-2]);break;case 119:this.$=a[o-4],r.addVertex(a[o-2],void 0,void 0,a[o]);break;case 120:this.$=a[o-4],r.updateLink([a[o-2]],a[o]);break;case 121:this.$=a[o-4],r.updateLink(a[o-2],a[o]);break;case 122:this.$=a[o-8],r.updateLinkInterpolate([a[o-6]],a[o-2]),r.updateLink([a[o-6]],a[o]);break;case 123:this.$=a[o-8],r.updateLinkInterpolate(a[o-6],a[o-2]),r.updateLink(a[o-6],a[o]);break;case 124:this.$=a[o-6],r.updateLinkInterpolate([a[o-4]],a[o]);break;case 125:this.$=a[o-6],r.updateLinkInterpolate(a[o-4],a[o]);break;case 127:case 129:a[o-2].push(a[o]),this.$=a[o-2];break;case 180:case 182:this.$=a[o-1]+""+a[o];break;case 183:this.$={stmt:"dir",value:"TB"};break;case 184:this.$={stmt:"dir",value:"BT"};break;case 185:this.$={stmt:"dir",value:"RL"};break;case 186:this.$={stmt:"dir",value:"LR"}}}),"anonymous"),table:[{3:1,4:2,9:e,10:n,12:r},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:n,12:r},{4:8,9:e,10:n,12:r},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:o,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,83:y,84:v,85:x,86:b,87:w,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N,120:I,121:M,122:R,123:D},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,54],9:[1,55],10:O,15:53,18:56},t(P,[2,3]),t(P,[2,4]),t(P,[2,5]),t(P,[2,6]),t(P,[2,7]),t(P,[2,8]),{8:B,9:$,11:F,21:58,41:59,72:63,75:[1,64],77:[1,65]},{8:B,9:$,11:F,21:66},{8:B,9:$,11:F,21:67},{8:B,9:$,11:F,21:68},{8:B,9:$,11:F,21:69},{8:B,9:$,11:F,21:70},{8:B,9:$,10:[1,71],11:F,21:72},t(P,[2,36]),{35:[1,73]},{37:[1,74]},t(P,[2,39]),t(z,[2,50],{18:75,39:76,10:O,40:U}),{10:[1,78]},{10:[1,79]},{10:[1,80]},{10:[1,81]},{14:G,44:q,60:j,79:[1,85],88:Y,94:[1,82],96:[1,83],100:84,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q,119:86},t(P,[2,183]),t(P,[2,184]),t(P,[2,185]),t(P,[2,186]),t(J,[2,51]),t(J,[2,54],{46:[1,98]}),t(tt,[2,72],{112:111,29:[1,99],44:f,48:[1,100],50:[1,101],52:[1,102],54:[1,103],56:[1,104],58:[1,105],60:m,63:[1,106],65:[1,107],67:[1,108],68:[1,109],70:[1,110],88:k,101:T,104:_,105:E,108:C,110:S,113:A,114:L,115:N}),t(et,[2,179]),t(et,[2,140]),t(et,[2,141]),t(et,[2,142]),t(et,[2,143]),t(et,[2,144]),t(et,[2,145]),t(et,[2,146]),t(et,[2,147]),t(et,[2,148]),t(et,[2,149]),t(et,[2,150]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,112]},t(nt,[2,26],{18:113,10:O}),t(P,[2,27]),{42:114,43:38,44:f,45:39,47:40,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},t(P,[2,40]),t(P,[2,41]),t(P,[2,42]),t(rt,[2,76],{73:115,62:[1,117],74:[1,116]}),{76:118,78:119,79:[1,120],80:[1,121],115:it,118:at},t([44,60,62,74,88,101,104,105,108,110,113,114,115],[2,82]),t(P,[2,28]),t(P,[2,29]),t(P,[2,30]),t(P,[2,31]),t(P,[2,32]),{10:st,12:ot,14:lt,27:ct,28:124,32:ht,44:ut,60:dt,75:pt,79:[1,126],80:[1,127],82:137,83:gt,84:ft,85:mt,86:yt,87:vt,88:xt,89:bt,90:125,104:wt,108:kt,110:Tt,113:_t,114:Et,115:Ct},t(St,a,{5:150}),t(P,[2,37]),t(P,[2,38]),t(z,[2,48],{44:At}),t(z,[2,49],{18:152,10:O,40:Lt}),t(J,[2,44]),{44:f,47:154,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},{101:[1,155],102:156,104:[1,157]},{44:f,47:158,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},{44:f,47:159,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},t(Nt,[2,105],{10:[1,160],95:[1,161]}),{79:[1,162]},t(Nt,[2,113],{119:164,10:[1,163],14:G,44:q,60:j,88:Y,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q}),t(Nt,[2,115],{10:[1,165]}),t(It,[2,181]),t(It,[2,168]),t(It,[2,169]),t(It,[2,170]),t(It,[2,171]),t(It,[2,172]),t(It,[2,173]),t(It,[2,174]),t(It,[2,175]),t(It,[2,176]),t(It,[2,177]),t(It,[2,178]),{44:f,47:166,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},{30:167,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:175,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:177,50:[1,176],67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:178,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:179,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:180,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{108:[1,181]},{30:182,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:183,65:[1,184],67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:185,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:186,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:187,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},t(et,[2,180]),t(i,[2,20]),t(nt,[2,25]),t(z,[2,46],{39:188,18:189,10:O,40:U}),t(rt,[2,73],{10:[1,190]}),{10:[1,191]},{30:192,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{77:[1,193],78:194,115:it,118:at},t($t,[2,78]),t($t,[2,80]),t($t,[2,81]),t($t,[2,166]),t($t,[2,167]),{8:B,9:$,10:st,11:F,12:ot,14:lt,21:196,27:ct,29:[1,195],32:ht,44:ut,60:dt,75:pt,82:137,83:gt,84:ft,85:mt,86:yt,87:vt,88:xt,89:bt,90:197,104:wt,108:kt,110:Tt,113:_t,114:Et,115:Ct},t(Ft,[2,99]),t(Ft,[2,101]),t(Ft,[2,102]),t(Ft,[2,155]),t(Ft,[2,156]),t(Ft,[2,157]),t(Ft,[2,158]),t(Ft,[2,159]),t(Ft,[2,160]),t(Ft,[2,161]),t(Ft,[2,162]),t(Ft,[2,163]),t(Ft,[2,164]),t(Ft,[2,165]),t(Ft,[2,88]),t(Ft,[2,89]),t(Ft,[2,90]),t(Ft,[2,91]),t(Ft,[2,92]),t(Ft,[2,93]),t(Ft,[2,94]),t(Ft,[2,95]),t(Ft,[2,96]),t(Ft,[2,97]),t(Ft,[2,98]),{6:11,7:12,8:o,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,198],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,83:y,84:v,85:x,86:b,87:w,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N,120:I,121:M,122:R,123:D},{10:O,18:199},{44:[1,200]},t(J,[2,43]),{10:[1,201],44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:111,113:A,114:L,115:N},{10:[1,202]},{10:[1,203],105:[1,204]},t(zt,[2,126]),{10:[1,205],44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:111,113:A,114:L,115:N},{10:[1,206],44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:111,113:A,114:L,115:N},{79:[1,207]},t(Nt,[2,107],{10:[1,208]}),t(Nt,[2,109],{10:[1,209]}),{79:[1,210]},t(It,[2,182]),{79:[1,211],97:[1,212]},t(J,[2,55],{112:111,44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,113:A,114:L,115:N}),{31:[1,213],67:Mt,81:214,115:Ot,116:Pt,117:Bt},t(Ut,[2,84]),t(Ut,[2,86]),t(Ut,[2,87]),t(Ut,[2,151]),t(Ut,[2,152]),t(Ut,[2,153]),t(Ut,[2,154]),{49:[1,215],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{30:216,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{51:[1,217],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{53:[1,218],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{55:[1,219],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{57:[1,220],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{60:[1,221]},{64:[1,222],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{66:[1,223],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{30:224,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{31:[1,225],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{67:Mt,69:[1,226],71:[1,227],81:214,115:Ot,116:Pt,117:Bt},{67:Mt,69:[1,229],71:[1,228],81:214,115:Ot,116:Pt,117:Bt},t(z,[2,45],{18:152,10:O,40:Lt}),t(z,[2,47],{44:At}),t(rt,[2,75]),t(rt,[2,74]),{62:[1,230],67:Mt,81:214,115:Ot,116:Pt,117:Bt},t(rt,[2,77]),t($t,[2,79]),{30:231,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},t(St,a,{5:232}),t(Ft,[2,100]),t(P,[2,35]),{43:233,44:f,45:39,47:40,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},{10:O,18:234},{10:Gt,60:qt,83:jt,91:235,104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{10:Gt,60:qt,83:jt,91:246,103:[1,247],104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{10:Gt,60:qt,83:jt,91:248,103:[1,249],104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{104:[1,250]},{10:Gt,60:qt,83:jt,91:251,104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{44:f,47:252,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},t(Nt,[2,106]),{79:[1,253]},{79:[1,254],97:[1,255]},t(Nt,[2,114]),t(Nt,[2,116],{10:[1,256]}),t(Nt,[2,117]),t(tt,[2,56]),t(Ut,[2,85]),t(tt,[2,57]),{51:[1,257],67:Mt,81:214,115:Ot,116:Pt,117:Bt},t(tt,[2,64]),t(tt,[2,59]),t(tt,[2,60]),t(tt,[2,61]),{108:[1,258]},t(tt,[2,63]),t(tt,[2,65]),{66:[1,259],67:Mt,81:214,115:Ot,116:Pt,117:Bt},t(tt,[2,67]),t(tt,[2,68]),t(tt,[2,70]),t(tt,[2,69]),t(tt,[2,71]),t([10,44,60,88,101,104,105,108,110,113,114,115],[2,83]),{31:[1,260],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{6:11,7:12,8:o,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,261],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,83:y,84:v,85:x,86:b,87:w,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N,120:I,121:M,122:R,123:D},t(J,[2,53]),{43:262,44:f,45:39,47:40,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},t(Nt,[2,119],{105:Kt}),t(Zt,[2,128],{107:264,10:Gt,60:qt,83:jt,104:Yt,108:Wt,109:Ht,110:Vt,111:Xt}),t(Qt,[2,130]),t(Qt,[2,132]),t(Qt,[2,133]),t(Qt,[2,134]),t(Qt,[2,135]),t(Qt,[2,136]),t(Qt,[2,137]),t(Qt,[2,138]),t(Qt,[2,139]),t(Nt,[2,120],{105:Kt}),{10:[1,265]},t(Nt,[2,121],{105:Kt}),{10:[1,266]},t(zt,[2,127]),t(Nt,[2,103],{105:Kt}),t(Nt,[2,104],{112:111,44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,113:A,114:L,115:N}),t(Nt,[2,108]),t(Nt,[2,110],{10:[1,267]}),t(Nt,[2,111]),{97:[1,268]},{51:[1,269]},{62:[1,270]},{66:[1,271]},{8:B,9:$,11:F,21:272},t(P,[2,34]),t(J,[2,52]),{10:Gt,60:qt,83:jt,104:Yt,106:273,107:237,108:Wt,109:Ht,110:Vt,111:Xt},t(Qt,[2,131]),{14:G,44:q,60:j,88:Y,100:274,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q,119:86},{14:G,44:q,60:j,88:Y,100:275,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q,119:86},{97:[1,276]},t(Nt,[2,118]),t(tt,[2,58]),{30:277,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},t(tt,[2,66]),t(St,a,{5:278}),t(Zt,[2,129],{107:264,10:Gt,60:qt,83:jt,104:Yt,108:Wt,109:Ht,110:Vt,111:Xt}),t(Nt,[2,124],{119:164,10:[1,279],14:G,44:q,60:j,88:Y,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q}),t(Nt,[2,125],{119:164,10:[1,280],14:G,44:q,60:j,88:Y,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q}),t(Nt,[2,112]),{31:[1,281],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{6:11,7:12,8:o,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,282],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,83:y,84:v,85:x,86:b,87:w,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N,120:I,121:M,122:R,123:D},{10:Gt,60:qt,83:jt,91:283,104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{10:Gt,60:qt,83:jt,91:284,104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},t(tt,[2,62]),t(P,[2,33]),t(Nt,[2,122],{105:Kt}),t(Nt,[2,123],{105:Kt})],defaultActions:{},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},te=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:s((function(t,e,n,r){switch(n){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:case 12:case 14:case 17:case 20:case 23:case 33:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),e.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"
    "),40;case 11:return 40;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 94;case 18:return 95;case 19:return"MD_STR";case 21:this.begin("md_string");break;case 22:return"STR";case 24:this.pushState("string");break;case 25:return 83;case 26:return 101;case 27:return 84;case 28:return 103;case 29:return 85;case 30:return 86;case 31:return 96;case 32:this.begin("click");break;case 34:return 87;case 35:case 36:case 37:return t.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:case 41:case 42:case 43:return 97;case 44:return this.popState(),13;case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:return this.popState(),14;case 55:return 120;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 104;case 60:case 101:return 110;case 61:return 46;case 62:return 60;case 63:case 102:return 44;case 64:return 8;case 65:return 105;case 66:case 100:return 114;case 67:case 70:case 73:return this.popState(),77;case 68:return this.pushState("edgeText"),75;case 69:case 72:case 75:return 118;case 71:return this.pushState("thickEdgeText"),75;case 74:return this.pushState("dottedEdgeText"),75;case 76:return 77;case 77:return this.popState(),53;case 78:case 114:return"TEXT";case 79:return this.pushState("ellipseText"),52;case 80:return this.popState(),55;case 81:return this.pushState("text"),54;case 82:return this.popState(),57;case 83:return this.pushState("text"),56;case 84:return 58;case 85:return this.pushState("text"),67;case 86:return this.popState(),64;case 87:return this.pushState("text"),63;case 88:return this.popState(),49;case 89:return this.pushState("text"),48;case 90:return this.popState(),69;case 91:return this.popState(),71;case 92:return 116;case 93:return this.pushState("trapText"),68;case 94:return this.pushState("trapText"),70;case 95:return 117;case 96:return 67;case 97:return 89;case 98:return"SEP";case 99:return 88;case 103:return 108;case 104:return 113;case 105:return 115;case 106:return this.popState(),62;case 107:return this.pushState("text"),62;case 108:return this.popState(),51;case 109:return this.pushState("text"),50;case 110:return this.popState(),31;case 111:return this.pushState("text"),29;case 112:return this.popState(),66;case 113:return this.pushState("text"),65;case 115:return"QUOTE";case 116:return 9;case 117:return 10;case 118: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)/,/^(?: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]*)/,/^(?:[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,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},href:{rules:[21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},click:{rules:[21,24,33,34,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},dottedEdgeText:{rules:[21,24,73,75,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},thickEdgeText:{rules:[21,24,70,72,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},edgeText:{rules:[21,24,67,69,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},trapText:{rules:[21,24,76,79,81,83,87,89,90,91,92,93,94,107,109,111,113],inclusive:!1},ellipseText:{rules:[21,24,76,77,78,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},text:{rules:[21,24,76,79,80,81,82,83,86,87,88,89,93,94,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},acc_descr:{rules:[3,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},acc_title:{rules:[1,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},md_string:{rules:[19,20,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},string:{rules:[21,22,23,24,76,79,81,83,87,89,93,94,107,109,111,113],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,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,73,74,76,79,81,83,84,85,87,89,93,94,95,96,97,98,99,100,101,102,103,104,105,107,109,111,113,115,116,117,118],inclusive:!0}}};return t}();function ee(){this.yy={}}return Jt.lexer=te,s(ee,"Parser"),ee.prototype=Jt,Jt.Parser=ee,new ee}();KV.parser=KV;var ZV=KV,QV=s(((t,e)=>{const n=J,r=n(t,"r"),i=n(t,"g"),a=n(t,"b");return Q(r,i,a,e)}),"fade"),JV={parser:ZV,db:WV,renderer:XV,styles:s((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .katex path {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n }\n\n .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n\n .root .anchor path {\n fill: ${t.lineColor} !important;\n stroke-width: 0;\n stroke: ${t.lineColor};\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${QV(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n\n rect.text {\n fill: none;\n stroke-width: 0;\n }\n\n .icon-shape, .image-shape {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n padding: 2px;\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n`),"getStyles"),init:s((t=>{t.flowchart||(t.flowchart={}),t.layout&&Vn({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Vn({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}}),WV.clear(),WV.setGen("gen-2")}),"init")},tX=Object.freeze({__proto__:null,diagram:JV}),eX=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[6,8,10,20,22,24,26,27,28],n=[1,10],r=[1,11],i=[1,12],a=[1,13],o=[1,14],l=[1,15],c=[1,21],h=[1,22],u=[1,23],d=[1,24],p=[1,25],g=[6,8,10,13,15,18,19,20,22,24,26,27,28,41,42,43,44,45],f=[1,34],m=[27,28,46,47],y=[41,42,43,44,45],v=[17,34],x=[1,54],b=[1,53],w=[17,34,36,38],k={trace:s((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,":":13,role:14,BLOCK_START:15,attributes:16,BLOCK_STOP:17,SQS:18,SQE:19,title:20,title_value:21,acc_title:22,acc_title_value:23,acc_descr:24,acc_descr_value:25,acc_descr_multiline_value:26,ALPHANUM:27,ENTITY_NAME:28,attribute:29,attributeType:30,attributeName:31,attributeKeyTypeList:32,attributeComment:33,ATTRIBUTE_WORD:34,attributeKeyType:35,COMMA:36,ATTRIBUTE_KEY:37,COMMENT:38,cardinality:39,relType:40,ZERO_OR_ONE:41,ZERO_OR_MORE:42,ONE_OR_MORE:43,ONLY_ONE:44,MD_PARENT:45,NON_IDENTIFYING:46,IDENTIFYING:47,WORD:48,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:":",15:"BLOCK_START",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:"ALPHANUM",28:"ENTITY_NAME",34:"ATTRIBUTE_WORD",36:"COMMA",37:"ATTRIBUTE_KEY",38:"COMMENT",41:"ZERO_OR_ONE",42:"ZERO_OR_MORE",43:"ONE_OR_MORE",44:"ONLY_ONE",45:"MD_PARENT",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,4],[9,3],[9,1],[9,7],[9,6],[9,4],[9,2],[9,2],[9,2],[9,1],[11,1],[11,1],[16,1],[16,2],[29,2],[29,3],[29,3],[29,4],[30,1],[31,1],[32,1],[32,3],[35,1],[33,1],[12,3],[39,1],[39,1],[39,1],[39,1],[39,1],[40,1],[40,1],[14,1],[14,1],[14,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 1:break;case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:case 19:case 43:case 27:case 28:case 31:this.$=a[o];break;case 8:r.addEntity(a[o-4]),r.addEntity(a[o-2]),r.addRelationship(a[o-4],a[o],a[o-2],a[o-3]);break;case 9:r.addEntity(a[o-3]),r.addAttributes(a[o-3],a[o-1]);break;case 10:r.addEntity(a[o-2]);break;case 11:r.addEntity(a[o]);break;case 12:r.addEntity(a[o-6],a[o-4]),r.addAttributes(a[o-6],a[o-1]);break;case 13:r.addEntity(a[o-5],a[o-3]);break;case 14:r.addEntity(a[o-3],a[o-1]);break;case 15:case 16:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 20:case 41:case 42:case 32:this.$=a[o].replace(/"/g,"");break;case 21:case 29:this.$=[a[o]];break;case 22:a[o].push(a[o-1]),this.$=a[o];break;case 23:this.$={attributeType:a[o-1],attributeName:a[o]};break;case 24:this.$={attributeType:a[o-2],attributeName:a[o-1],attributeKeyTypeList:a[o]};break;case 25:this.$={attributeType:a[o-2],attributeName:a[o-1],attributeComment:a[o]};break;case 26:this.$={attributeType:a[o-3],attributeName:a[o-2],attributeKeyTypeList:a[o-1],attributeComment:a[o]};break;case 30:a[o-2].push(a[o]),this.$=a[o-2];break;case 33:this.$={cardA:a[o],relType:a[o-1],cardB:a[o-2]};break;case 34:this.$=r.Cardinality.ZERO_OR_ONE;break;case 35:this.$=r.Cardinality.ZERO_OR_MORE;break;case 36:this.$=r.Cardinality.ONE_OR_MORE;break;case 37:this.$=r.Cardinality.ONLY_ONE;break;case 38:this.$=r.Cardinality.MD_PARENT;break;case 39:this.$=r.Identification.NON_IDENTIFYING;break;case 40:this.$=r.Identification.IDENTIFYING}}),"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:9,20:n,22:r,24:i,26:a,27:o,28:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:16,11:9,20:n,22:r,24:i,26:a,27:o,28:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,11],{12:17,39:20,15:[1,18],18:[1,19],41:c,42:h,43:u,44:d,45:p}),{21:[1,26]},{23:[1,27]},{25:[1,28]},t(e,[2,18]),t(g,[2,19]),t(g,[2,20]),t(e,[2,4]),{11:29,27:o,28:l},{16:30,17:[1,31],29:32,30:33,34:f},{11:35,27:o,28:l},{40:36,46:[1,37],47:[1,38]},t(m,[2,34]),t(m,[2,35]),t(m,[2,36]),t(m,[2,37]),t(m,[2,38]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),{13:[1,39]},{17:[1,40]},t(e,[2,10]),{16:41,17:[2,21],29:32,30:33,34:f},{31:42,34:[1,43]},{34:[2,27]},{19:[1,44]},{39:45,41:c,42:h,43:u,44:d,45:p},t(y,[2,39]),t(y,[2,40]),{14:46,27:[1,49],28:[1,48],48:[1,47]},t(e,[2,9]),{17:[2,22]},t(v,[2,23],{32:50,33:51,35:52,37:x,38:b}),t([17,34,37,38],[2,28]),t(e,[2,14],{15:[1,55]}),t([27,28],[2,33]),t(e,[2,8]),t(e,[2,41]),t(e,[2,42]),t(e,[2,43]),t(v,[2,24],{33:56,36:[1,57],38:b}),t(v,[2,25]),t(w,[2,29]),t(v,[2,32]),t(w,[2,31]),{16:58,17:[1,59],29:32,30:33,34:f},t(v,[2,26]),{35:60,37:x},{17:[1,61]},t(e,[2,13]),t(w,[2,30]),t(e,[2,12])],defaultActions:{34:[2,27],41:[2,22]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},T=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return this.begin("acc_title"),22;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),24;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 10;case 8:case 15:case 20:break;case 9:return 8;case 10:return 28;case 11:return 48;case 12:return 4;case 13:return this.begin("block"),15;case 14:return 36;case 16:return 37;case 17:case 18:return 34;case 19:return 38;case 21:return this.popState(),17;case 22:case 54:return e.yytext[0];case 23:return 18;case 24:return 19;case 25:case 29:case 30:case 43:return 41;case 26:case 27:case 28:case 36:case 38:case 45:return 43;case 31:case 32:case 33:case 34:case 35:case 37:case 44:return 42;case 39:case 40:case 41:case 42:return 44;case 46:return 45;case 47:case 50:case 51:case 52:return 46;case 48:case 49:return 47;case 53:return 27;case 55:return 6}}),"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:,)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:(.*?)[~](.*?)*[~])/i,/^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/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,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[14,15,16,17,18,19,20,21,22],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,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],inclusive:!0}}};return t}();function _(){this.yy={}}return k.lexer=T,s(_,"Parser"),_.prototype=k,k.Parser=_,new _}();eX.parser=eX;var nX=eX,rX=new Map,iX=[],aX=s((function(t,e){return rX.has(t)?!rX.get(t).alias&&e&&(rX.get(t).alias=e,m.info(`Add alias '${e}' to entity '${t}'`)):(rX.set(t,{attributes:[],alias:e}),m.info("Added new entity :",t)),rX.get(t)}),"addEntity"),sX=s((()=>rX),"getEntities"),oX=s((function(t,e){let n,r=aX(t);for(n=e.length-1;n>=0;n--)r.attributes.push(e[n]),m.debug("Added attribute ",e[n].attributeName)}),"addAttributes"),lX=s((function(t,e,n,r){let i={entityA:t,roleA:e,entityB:n,relSpec:r};iX.push(i),m.debug("Added new relationship :",i)}),"addRelationship"),cX=s((()=>iX),"getRelationships"),hX=s((function(){rX=new Map,iX=[],$n()}),"clear"),uX={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"},Identification:{NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},getConfig:s((()=>Hn().er),"getConfig"),addEntity:aX,addAttributes:oX,getEntities:sX,addRelationship:lX,getRelationships:cX,clear:hX,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,setDiagramTitle:qn,getDiagramTitle:jn},dX={ONLY_ONE_START:"ONLY_ONE_START",ONLY_ONE_END:"ONLY_ONE_END",ZERO_OR_ONE_START:"ZERO_OR_ONE_START",ZERO_OR_ONE_END:"ZERO_OR_ONE_END",ONE_OR_MORE_START:"ONE_OR_MORE_START",ONE_OR_MORE_END:"ONE_OR_MORE_END",ZERO_OR_MORE_START:"ZERO_OR_MORE_START",ZERO_OR_MORE_END:"ZERO_OR_MORE_END",MD_PARENT_END:"MD_PARENT_END",MD_PARENT_START:"MD_PARENT_START"},pX={ERMarkers:dX,insertMarkers:s((function(t,e){let n;t.append("defs").append("marker").attr("id",dX.MD_PARENT_START).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",dX.MD_PARENT_END).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",dX.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",dX.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),n=t.append("defs").append("marker").attr("id",dX.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),n=t.append("defs").append("marker").attr("id",dX.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",dX.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").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",dX.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),n=t.append("defs").append("marker").attr("id",dX.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),n=t.append("defs").append("marker").attr("id",dX.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")}),"insertMarkers")},gX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function fX(t){return"string"==typeof t&&gX.test(t)}s(fX,"validate");var mX=fX,yX=[];for(let t=0;t<256;++t)yX.push((t+256).toString(16).slice(1));function vX(t,e=0){return yX[t[e+0]]+yX[t[e+1]]+yX[t[e+2]]+yX[t[e+3]]+"-"+yX[t[e+4]]+yX[t[e+5]]+"-"+yX[t[e+6]]+yX[t[e+7]]+"-"+yX[t[e+8]]+yX[t[e+9]]+"-"+yX[t[e+10]]+yX[t[e+11]]+yX[t[e+12]]+yX[t[e+13]]+yX[t[e+14]]+yX[t[e+15]]}function xX(t){if(!mX(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}s(vX,"unsafeStringify"),s(xX,"parse");var bX=xX;function wX(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n>>32-e}function EX(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n>>0;c=l,l=o,o=_X(s,30)>>>0,s=i,i=a}n[0]=n[0]+i>>>0,n[1]=n[1]+s>>>0,n[2]=n[2]+o>>>0,n[3]=n[3]+l>>>0,n[4]=n[4]+c>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}s(kX,"v35"),s(TX,"f"),s(_X,"ROTL"),s(EX,"sha1");var CX=kX("v5",80,EX),SX=/[^\dA-Za-z](\W)*/g,AX={},LX=new Map,NX=s((function(t){const e=Object.keys(t);for(const n of e)AX[n]=t[n]}),"setConf"),IX=s(((t,e,n)=>{const r=AX.entityPadding/3,i=AX.entityPadding/3,a=.85*AX.fontSize,s=e.node().getBBox(),o=[];let l=!1,c=!1,h=0,u=0,d=0,p=0,g=s.height+2*r,f=1;n.forEach((t=>{void 0!==t.attributeKeyTypeList&&t.attributeKeyTypeList.length>0&&(l=!0),void 0!==t.attributeComment&&(c=!0)})),n.forEach((n=>{const i=`${e.node().id}-attr-${f}`;let s=0;const m=fn(n.attributeType),y=t.append("text").classed("er entityLabel",!0).attr("id",`${i}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Hn().fontFamily).style("font-size",a+"px").text(m),v=t.append("text").classed("er entityLabel",!0).attr("id",`${i}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Hn().fontFamily).style("font-size",a+"px").text(n.attributeName),x={};x.tn=y,x.nn=v;const b=y.node().getBBox(),w=v.node().getBBox();if(h=Math.max(h,b.width),u=Math.max(u,w.width),s=Math.max(b.height,w.height),l){const e=void 0!==n.attributeKeyTypeList?n.attributeKeyTypeList.join(","):"",r=t.append("text").classed("er entityLabel",!0).attr("id",`${i}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Hn().fontFamily).style("font-size",a+"px").text(e);x.kn=r;const o=r.node().getBBox();d=Math.max(d,o.width),s=Math.max(s,o.height)}if(c){const e=t.append("text").classed("er entityLabel",!0).attr("id",`${i}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Hn().fontFamily).style("font-size",a+"px").text(n.attributeComment||"");x.cn=e;const r=e.node().getBBox();p=Math.max(p,r.width),s=Math.max(s,r.height)}x.height=s,o.push(x),g+=s+2*r,f+=1}));let m=4;l&&(m+=2),c&&(m+=2);const y=h+u+d+p,v={width:Math.max(AX.minEntityWidth,Math.max(s.width+2*AX.entityPadding,y+i*m)),height:n.length>0?g:Math.max(AX.minEntityHeight,s.height+2*AX.entityPadding)};if(n.length>0){const n=Math.max(0,(v.width-y-i*m)/(m/2));e.attr("transform","translate("+v.width/2+","+(r+s.height/2)+")");let a=s.height+2*r,g="attributeBoxOdd";o.forEach((e=>{const s=a+r+e.height/2;e.tn.attr("transform","translate("+i+","+s+")");const o=t.insert("rect","#"+e.tn.node().id).classed(`er ${g}`,!0).attr("x",0).attr("y",a).attr("width",h+2*i+n).attr("height",e.height+2*r),f=parseFloat(o.attr("x"))+parseFloat(o.attr("width"));e.nn.attr("transform","translate("+(f+i)+","+s+")");const m=t.insert("rect","#"+e.nn.node().id).classed(`er ${g}`,!0).attr("x",f).attr("y",a).attr("width",u+2*i+n).attr("height",e.height+2*r);let y=parseFloat(m.attr("x"))+parseFloat(m.attr("width"));if(l){e.kn.attr("transform","translate("+(y+i)+","+s+")");const o=t.insert("rect","#"+e.kn.node().id).classed(`er ${g}`,!0).attr("x",y).attr("y",a).attr("width",d+2*i+n).attr("height",e.height+2*r);y=parseFloat(o.attr("x"))+parseFloat(o.attr("width"))}c&&(e.cn.attr("transform","translate("+(y+i)+","+s+")"),t.insert("rect","#"+e.cn.node().id).classed(`er ${g}`,"true").attr("x",y).attr("y",a).attr("width",p+2*i+n).attr("height",e.height+2*r)),a+=e.height+2*r,g="attributeBoxOdd"===g?"attributeBoxEven":"attributeBoxOdd"}))}else v.height=Math.max(AX.minEntityHeight,g),e.attr("transform","translate("+v.width/2+","+v.height/2+")");return v}),"drawAttributes"),MX=s((function(t,e,n){let r;return[...e.keys()].forEach((function(i){const a=FX(i,"entity");LX.set(i,a);const s=t.append("g").attr("id",a);r=void 0===r?a:r;const o="text-"+a,l=s.append("text").classed("er entityLabel",!0).attr("id",o).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",Hn().fontFamily).style("font-size",AX.fontSize+"px").text(e.get(i).alias??i),{width:c,height:h}=IX(s,l,e.get(i).attributes),u=s.insert("rect","#"+o).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",c).attr("height",h).node().getBBox();n.setNode(a,{width:u.width,height:u.height,shape:"rect",id:a})})),r}),"drawEntities"),RX=s((function(t,e){e.nodes().forEach((function(n){void 0!==n&&void 0!==e.node(n)&&t.select("#"+n).attr("transform","translate("+(e.node(n).x-e.node(n).width/2)+","+(e.node(n).y-e.node(n).height/2)+" )")}))}),"adjustEntities"),DX=s((function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")}),"getEdgeName"),OX=s((function(t,e){return t.forEach((function(t){e.setEdge(LX.get(t.entityA),LX.get(t.entityB),{relationship:t},DX(t))})),t}),"addRelationships"),PX=0,BX=s((function(t,e,n,r,i){PX++;const a=n.edge(LX.get(e.entityA),LX.get(e.entityB),DX(e)),s=Xh().x((function(t){return t.x})).y((function(t){return t.y})).curve(iu),o=t.insert("path","#"+r).classed("er relationshipLine",!0).attr("d",s(a.points)).style("stroke",AX.stroke).style("fill","none");e.relSpec.relType===i.db.Identification.NON_IDENTIFYING&&o.attr("stroke-dasharray","8,8");let l="";switch(AX.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),e.relSpec.cardA){case i.db.Cardinality.ZERO_OR_ONE:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.ZERO_OR_ONE_END+")");break;case i.db.Cardinality.ZERO_OR_MORE:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.ZERO_OR_MORE_END+")");break;case i.db.Cardinality.ONE_OR_MORE:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.ONE_OR_MORE_END+")");break;case i.db.Cardinality.ONLY_ONE:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.ONLY_ONE_END+")");break;case i.db.Cardinality.MD_PARENT:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.MD_PARENT_END+")")}switch(e.relSpec.cardB){case i.db.Cardinality.ZERO_OR_ONE:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.ZERO_OR_ONE_START+")");break;case i.db.Cardinality.ZERO_OR_MORE:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.ZERO_OR_MORE_START+")");break;case i.db.Cardinality.ONE_OR_MORE:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.ONE_OR_MORE_START+")");break;case i.db.Cardinality.ONLY_ONE:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.ONLY_ONE_START+")");break;case i.db.Cardinality.MD_PARENT:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.MD_PARENT_START+")")}const c=o.node().getTotalLength(),h=o.node().getPointAtLength(.5*c),u="rel"+PX,d=e.roleA.split(/
    /g),p=t.append("text").classed("er relationshipLabel",!0).attr("id",u).attr("x",h.x).attr("y",h.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",Hn().fontFamily).style("font-size",AX.fontSize+"px");if(1==d.length)p.text(e.roleA);else{const t=.5*-(d.length-1);d.forEach(((e,n)=>{p.append("tspan").attr("x",h.x).attr("dy",`${0===n?t:1}em`).text(e)}))}const g=p.node().getBBox();t.insert("rect","#"+u).classed("er relationshipLabelBox",!0).attr("x",h.x-g.width/2).attr("y",h.y-g.height/2).attr("width",g.width).attr("height",g.height)}),"drawRelationshipFromLayout"),$X=s((function(t,e,n,r){AX=Hn().er,m.info("Drawing ER diagram");const i=Hn().securityLevel;let a;"sandbox"===i&&(a=Oa("#i"+e));const s=Oa("sandbox"===i?a.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);let o;pX.insertMarkers(s,AX),o=new nq({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:AX.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));const l=MX(s,r.db.getEntities(),o),c=OX(r.db.getRelationships(),o);cY(o),RX(s,o),c.forEach((function(t){BX(s,t,o,l,r)}));const h=AX.diagramPadding;yk.insertTitle(s,"entityTitleText",AX.titleTopMargin,r.db.getDiagramTitle());const u=s.node().getBBox(),d=u.width+2*h,p=u.height+2*h;Sn(s,p,d,AX.useMaxWidth),s.attr("viewBox",`${u.x-h} ${u.y-h} ${d} ${p}`)}),"draw");function FX(t="",e=""){const n=t.replace(SX,"");return`${zX(e)}${zX(n)}${CX(t,"28e9f9db-3c8d-5aa5-9faf-44286ae5937c")}`}function zX(t=""){return t.length>0?`${t}-`:""}s(FX,"generateId"),s(zX,"strWithHyphen");var UX={parser:nX,db:uX,renderer:{setConf:NX,draw:$X},styles:s((t=>`\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxOdd {\n fill: ${t.attributeBackgroundColorOdd};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxEven {\n fill: ${t.attributeBackgroundColorEven};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n }\n\n .entityTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n } \n #MD_PARENT_START {\n fill: #f5f5f5 !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n #MD_PARENT_END {\n fill: #f5f5f5 !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n \n`),"getStyles")},GX=Object.freeze({__proto__:null,diagram:UX}),qX=class{constructor(t){this.init=t,this.records=this.init()}static{s(this,"ImperativeState")}reset(){this.records=this.init()}};function jX(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}s(jX,"populateCommonDb");var YX=o({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){var e;function n(){if(void 0===e)throw new Error("No runtime abstraction layer installed");return e}Object.defineProperty(t,"__esModule",{value:!0}),s(n,"RAL"),function(t){function n(t){if(void 0===t)throw new Error("No runtime abstraction layer provided");e=t}s(n,"install"),t.install=n}(n||(n={})),t.default=n}}),WX=o({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){function e(t){return!0===t||!1===t}function n(t){return"string"==typeof t||t instanceof String}function r(t){return"number"==typeof t||t instanceof Number}function i(t){return t instanceof Error}function a(t){return"function"==typeof t}function o(t){return Array.isArray(t)}function l(t){return o(t)&&t.every((t=>n(t)))}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,s(e,"boolean"),t.boolean=e,s(n,"string"),t.string=n,s(r,"number"),t.number=r,s(i,"error"),t.error=i,s(a,"func"),t.func=a,s(o,"array"),t.array=o,s(l,"stringArray"),t.stringArray=l}}),HX=o({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e,n=YX();!function(t){const e={dispose(){}};t.None=function(){return e}}(e||(t.Event=e={}));var r=class{static{s(this,"CallbackList")}add(t,e=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(e),Array.isArray(n)&&n.push({dispose:s((()=>this.remove(t,e)),"dispose")})}remove(t,e=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const a={dispose:s((()=>{this._callbacks&&(this._callbacks.remove(e,n),a.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}),"dispose")};return Array.isArray(i)&&i.push(a),a}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};t.Emitter=i,i._noop=function(){}}}),VX=o({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e,n=YX(),r=WX(),i=HX();!function(t){function e(e){const n=e;return n&&(n===t.None||n===t.Cancelled||r.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),s(e,"is"),t.is=e}(e||(t.CancellationToken=e={}));var a=Object.freeze((function(t,e){const r=(0,n.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}})),o=class{static{s(this,"MutableToken")}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 i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},l=class{static{s(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=e.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=e.None}};t.CancellationTokenSource=l}}),XX={};l(XX,{AbstractAstReflection:()=>eK,AbstractCstNode:()=>H6,AbstractLangiumParser:()=>e7,AbstractParserErrorMessageProvider:()=>r7,AbstractThreadedAsyncParser:()=>b9,AstUtils:()=>AQ,BiMap:()=>o8,Cancellation:()=>I7,CompositeCstNodeImpl:()=>X6,ContextCache:()=>g8,CstNodeBuilder:()=>W6,CstUtils:()=>KX,DONE_RESULT:()=>cK,DatatypeSymbol:()=>Q6,DefaultAstNodeDescriptionProvider:()=>I8,DefaultAstNodeLocator:()=>R8,DefaultAsyncParser:()=>x9,DefaultCommentProvider:()=>m9,DefaultConfigurationProvider:()=>D8,DefaultDocumentBuilder:()=>O8,DefaultDocumentValidator:()=>S8,DefaultHydrator:()=>T9,DefaultIndexManager:()=>P8,DefaultJsonSerializer:()=>w8,DefaultLangiumDocumentFactory:()=>t8,DefaultLangiumDocuments:()=>e8,DefaultLexer:()=>$8,DefaultLinker:()=>n8,DefaultNameProvider:()=>i8,DefaultReferenceDescriptionProvider:()=>M8,DefaultReferences:()=>a8,DefaultScopeComputation:()=>l8,DefaultScopeProvider:()=>y8,DefaultServiceRegistry:()=>k8,DefaultTokenBuilder:()=>L7,DefaultValueConverter:()=>N7,DefaultWorkspaceLock:()=>k9,DefaultWorkspaceManager:()=>B8,Deferred:()=>G7,Disposable:()=>N8,DisposableCache:()=>d8,DocumentCache:()=>f8,DocumentState:()=>K7,DocumentValidator:()=>_8,EMPTY_SCOPE:()=>u8,EMPTY_STREAM:()=>lK,EmptyFileSystem:()=>O9,EmptyFileSystemProvider:()=>D9,ErrorWithLocation:()=>PK,GrammarAST:()=>$K,GrammarUtils:()=>OK,JSDocDocumentationProvider:()=>f9,LangiumCompletionParser:()=>a7,LangiumParser:()=>n7,LangiumParserErrorMessageProvider:()=>i7,LeafCstNodeImpl:()=>V6,MapScope:()=>h8,Module:()=>v9,MultiMap:()=>s8,OperationCancelled:()=>B7,ParserWorker:()=>w9,Reduction:()=>uK,RegExpUtils:()=>qQ,RootCstNodeImpl:()=>Z6,SimpleCache:()=>p8,StreamImpl:()=>aK,StreamScope:()=>c8,TextDocument:()=>z7,TreeStreamImpl:()=>gK,URI:()=>Q7,UriUtils:()=>X7,ValidationCategory:()=>b8,ValidationRegistry:()=>C8,ValueConverter:()=>A7,WorkspaceCache:()=>m8,assertUnreachable:()=>BK,createCompletionParser:()=>E7,createDefaultCoreModule:()=>_9,createDefaultSharedCoreModule:()=>E9,createGrammarConfig:()=>QJ,createLangiumParser:()=>C7,delayNextTick:()=>M7,diagnosticData:()=>T8,eagerLoad:()=>A9,getDiagnosticRange:()=>A8,inject:()=>C9,interruptAndCheck:()=>F7,isAstNode:()=>ZX,isAstNodeDescription:()=>JX,isAstNodeWithComment:()=>v8,isCompositeCstNode:()=>nK,isIMultiModeLexerDefinition:()=>z8,isJSDoc:()=>q8,isLeafCstNode:()=>rK,isLinkingError:()=>tK,isNamed:()=>r8,isOperationCancelled:()=>$7,isReference:()=>QX,isRootCstNode:()=>iK,isTokenTypeArray:()=>F8,isTokenTypeDictionary:()=>U8,loadGrammarFromJson:()=>F9,parseJSDoc:()=>G8,prepareLangiumParser:()=>S7,setInterruptionPeriod:()=>P7,startCancelableOperation:()=>O7,stream:()=>hK,toDiagnosticSeverity:()=>L8});var KX={};function ZX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.$type}function QX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.$refText}function JX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.name&&"string"==typeof t.type&&"string"==typeof t.path}function tK(t){return"object"==typeof t&&null!==t&&ZX(t.container)&&QX(t.reference)&&"string"==typeof t.message}l(KX,{DefaultNameRegexp:()=>kK,RangeComparison:()=>dK,compareRange:()=>bK,findCommentNode:()=>_K,findDeclarationNodeAtOffset:()=>TK,findLeafNodeAtOffset:()=>CK,findLeafNodeBeforeOffset:()=>SK,flattenCst:()=>mK,getInteriorNodes:()=>MK,getNextNode:()=>NK,getPreviousNode:()=>LK,getStartlineNode:()=>IK,inRange:()=>wK,isChildNode:()=>yK,isCommentNode:()=>EK,streamCst:()=>fK,toDocumentSegment:()=>xK,tokenToRange:()=>vK}),s(ZX,"isAstNode"),s(QX,"isReference"),s(JX,"isAstNodeDescription"),s(tK,"isLinkingError");var eK=class{static{s(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}isInstance(t,e){return ZX(t)&&this.isSubtype(t.$type,e)}isSubtype(t,e){if(t===e)return!0;let n=this.subtypes[t];n||(n=this.subtypes[t]={});const r=n[e];if(void 0!==r)return r;{const r=this.computeIsSubtype(t,e);return n[e]=r,r}}getAllSubTypes(t){const e=this.allSubtypes[t];if(e)return e;{const e=this.getAllTypes(),n=[];for(const r of e)this.isSubtype(r,t)&&n.push(r);return this.allSubtypes[t]=n,n}}};function nK(t){return"object"==typeof t&&null!==t&&Array.isArray(t.content)}function rK(t){return"object"==typeof t&&null!==t&&"object"==typeof t.tokenType}function iK(t){return nK(t)&&"string"==typeof t.fullText}s(nK,"isCompositeCstNode"),s(rK,"isLeafCstNode"),s(iK,"isRootCstNode");var aK=class t{static{s(this,"StreamImpl")}constructor(t,e){this.startFn=t,this.nextFn=e}iterator(){const t={state:this.startFn(),next:s((()=>this.nextFn(t.state)),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){const t=this.iterator();return Boolean(t.next().done)}count(){const t=this.iterator();let e=0,n=t.next();for(;!n.done;)e++,n=t.next();return e}toArray(){const t=[],e=this.iterator();let n;do{n=e.next(),void 0!==n.value&&t.push(n.value)}while(!n.done);return t}toSet(){return new Set(this)}toMap(t,e){const n=this.map((n=>[t?t(n):n,e?e(n):n]));return new Map(n)}toString(){return this.join()}concat(e){const n=e[Symbol.iterator]();return new t((()=>({first:this.startFn(),firstDone:!1})),(t=>{let e;if(!t.firstDone){do{if(e=this.nextFn(t.first),!e.done)return e}while(!e.done);t.firstDone=!0}do{if(e=n.next(),!e.done)return e}while(!e.done);return cK}))}join(t=","){const e=this.iterator();let n,r="",i=!1;do{n=e.next(),n.done||(i&&(r+=t),r+=sK(n.value)),i=!0}while(!n.done);return r}indexOf(t,e=0){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(r>=e&&i.value===t)return r;i=n.next(),r++}return-1}every(t){const e=this.iterator();let n=e.next();for(;!n.done;){if(!t(n.value))return!1;n=e.next()}return!0}some(t){const e=this.iterator();let n=e.next();for(;!n.done;){if(t(n.value))return!0;n=e.next()}return!1}forEach(t){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)t(r.value,n),r=e.next(),n++}map(e){return new t(this.startFn,(t=>{const{done:n,value:r}=this.nextFn(t);return n?cK:{done:!1,value:e(r)}}))}filter(e){return new t(this.startFn,(t=>{let n;do{if(n=this.nextFn(t),!n.done&&e(n.value))return n}while(!n.done);return cK}))}nonNullable(){return this.filter((t=>null!=t))}reduce(t,e){const n=this.iterator();let r=e,i=n.next();for(;!i.done;)r=void 0===r?i.value:t(r,i.value),i=n.next();return r}reduceRight(t,e){return this.recursiveReduce(this.iterator(),t,e)}recursiveReduce(t,e,n){const r=t.next();if(r.done)return n;const i=this.recursiveReduce(t,e,n);return void 0===i?r.value:e(i,r.value)}find(t){const e=this.iterator();let n=e.next();for(;!n.done;){if(t(n.value))return n.value;n=e.next()}}findIndex(t){const e=this.iterator();let n=0,r=e.next();for(;!r.done;){if(t(r.value))return n;r=e.next(),n++}return-1}includes(t){const e=this.iterator();let n=e.next();for(;!n.done;){if(n.value===t)return!0;n=e.next()}return!1}flatMap(e){return new t((()=>({this:this.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:n,value:r}=this.nextFn(t.this);if(!n){const n=e(r);if(!oK(n))return{done:!1,value:n};t.iterator=n[Symbol.iterator]()}}while(t.iterator);return cK}))}flat(e){if(void 0===e&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new t((()=>({this:n.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:e,value:r}=n.nextFn(t.this);if(!e){if(!oK(r))return{done:!1,value:r};t.iterator=r[Symbol.iterator]()}}while(t.iterator);return cK}))}head(){const t=this.iterator().next();if(!t.done)return t.value}tail(e=1){return new t((()=>{const t=this.startFn();for(let n=0;n({size:0,state:this.startFn()})),(t=>(t.size++,t.size>e?cK:this.nextFn(t.state))))}distinct(t){const e=new Set;return this.filter((n=>{const r=t?t(n):n;return!e.has(r)&&(e.add(r),!0)}))}exclude(t,e){const n=new Set;for(const r of t){const t=e?e(r):r;n.add(t)}return this.filter((t=>{const r=e?e(t):t;return!n.has(r)}))}};function sK(t){return"string"==typeof t?t:void 0===t?"undefined":"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}function oK(t){return!!t&&"function"==typeof t[Symbol.iterator]}s(sK,"toString"),s(oK,"isIterable");var lK=new aK((()=>{}),(()=>cK)),cK=Object.freeze({done:!0,value:void 0});function hK(...t){if(1===t.length){const e=t[0];if(e instanceof aK)return e;if(oK(e))return new aK((()=>e[Symbol.iterator]()),(t=>t.next()));if("number"==typeof e.length)return new aK((()=>({index:0})),(t=>t.index1?new aK((()=>({collIndex:0,arrIndex:0})),(e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:(null==n?void 0:n.includeRoot)?[[t][Symbol.iterator]()]:[e(t)[Symbol.iterator]()],pruned:!1})),(t=>{for(t.pruned&&(t.iterators.pop(),t.pruned=!1);t.iterators.length>0;){const n=t.iterators[t.iterators.length-1].next();if(!n.done)return t.iterators.push(e(n.value)[Symbol.iterator]()),n;t.iterators.pop()}return cK}))}iterator(){const t={state:this.startFn(),next:s((()=>this.nextFn(t.state)),"next"),prune:s((()=>{t.state.pruned=!0}),"prune"),[Symbol.iterator]:()=>t};return t}};function fK(t){return new gK(t,(t=>nK(t)?t.content:[]),{includeRoot:!0})}function mK(t){return fK(t).filter(rK)}function yK(t,e){for(;t.container;)if((t=t.container)===e)return!0;return!1}function vK(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function xK(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}function bK(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>e.end.character)return dK.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.linedK.After}!function(t){function e(t){return t.reduce(((t,e)=>t+e),0)}function n(t){return t.reduce(((t,e)=>t*e),0)}function r(t){return t.reduce(((t,e)=>Math.min(t,e)))}function i(t){return t.reduce(((t,e)=>Math.max(t,e)))}s(e,"sum"),t.sum=e,s(n,"product"),t.product=n,s(r,"min"),t.min=r,s(i,"max"),t.max=i}(uK||(uK={})),s(fK,"streamCst"),s(mK,"flattenCst"),s(yK,"isChildNode"),s(vK,"tokenToRange"),s(xK,"toDocumentSegment"),(pK=dK||(dK={}))[pK.Before=0]="Before",pK[pK.After=1]="After",pK[pK.OverlapFront=2]="OverlapFront",pK[pK.OverlapBack=3]="OverlapBack",pK[pK.Inside=4]="Inside",s(bK,"compareRange"),s(wK,"inRange");var kK=/^[\w\p{L}]$/u;function TK(t,e,n=kK){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return CK(t,e)}}function _K(t,e){if(t){const n=LK(t,!0);if(n&&EK(n,e))return n;if(iK(t)){const n=t.content.findIndex((t=>!t.hidden));for(let r=n-1;r>=0;r--){const n=t.content[r];if(EK(n,e))return n}}}}function EK(t,e){return rK(t)&&e.includes(t.tokenType.name)}function CK(t,e){if(rK(t))return t;if(nK(t)){const n=AK(t,e,!1);if(n)return CK(n,e)}}function SK(t,e){if(rK(t))return t;if(nK(t)){const n=AK(t,e,!0);if(n)return SK(n,e)}}function AK(t,e,n){let r,i=0,a=t.content.length-1;for(;i<=a;){const s=Math.floor((i+a)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(r=n?o:void 0,i=s+1):a=s-1}return r}function LK(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const t=n.content[r];if(e||!t.hidden)return t}t=n}}function NK(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);const i=n.content.length-1;for(;rSJ,findNameAssignment:()=>AJ,findNodeForKeyword:()=>EJ,findNodeForProperty:()=>kJ,findNodesForKeyword:()=>_J,findNodesForKeywordInternal:()=>CJ,findNodesForProperty:()=>wJ,getActionAtElement:()=>NJ,getActionType:()=>zJ,getAllReachableRules:()=>yJ,getCrossReferenceTerminal:()=>xJ,getEntryRule:()=>fJ,getExplicitRuleType:()=>$J,getHiddenRules:()=>mJ,getRuleType:()=>UJ,getTypeName:()=>FJ,isArrayCardinality:()=>MJ,isArrayOperator:()=>RJ,isCommentTerminal:()=>bJ,isDataType:()=>PJ,isDataTypeRule:()=>DJ,isOptionalCardinality:()=>IJ,terminalRegex:()=>GJ});var PK=class extends Error{static{s(this,"ErrorWithLocation")}constructor(t,e){super(t?`${e} at ${t.range.start.line}:${t.range.start.character}`:e)}};function BK(t){throw new Error("Error! The input value was not handled.")}s(BK,"assertUnreachable");var $K={};l($K,{AbstractElement:()=>QK,AbstractRule:()=>zK,AbstractType:()=>GK,Action:()=>WZ,Alternatives:()=>VZ,ArrayLiteral:()=>tZ,ArrayType:()=>nZ,Assignment:()=>KZ,BooleanLiteral:()=>iZ,CharacterRange:()=>QZ,Condition:()=>jK,Conjunction:()=>sZ,CrossReference:()=>tQ,Disjunction:()=>lZ,EndOfFile:()=>nQ,Grammar:()=>hZ,GrammarImport:()=>dZ,Group:()=>iQ,InferredType:()=>gZ,Interface:()=>mZ,Keyword:()=>sQ,LangiumGrammarAstReflection:()=>CQ,LangiumGrammarTerminals:()=>FK,NamedArgument:()=>vZ,NegatedToken:()=>lQ,Negation:()=>bZ,NumberLiteral:()=>kZ,Parameter:()=>_Z,ParameterReference:()=>CZ,ParserRule:()=>AZ,ReferenceType:()=>NZ,RegexToken:()=>hQ,ReturnType:()=>MZ,RuleCall:()=>dQ,SimpleType:()=>DZ,StringLiteral:()=>PZ,TerminalAlternatives:()=>gQ,TerminalGroup:()=>mQ,TerminalRule:()=>$Z,TerminalRuleCall:()=>vQ,Type:()=>zZ,TypeAttribute:()=>GZ,TypeDefinition:()=>VK,UnionType:()=>jZ,UnorderedGroup:()=>bQ,UntilToken:()=>kQ,ValueLiteral:()=>KK,Wildcard:()=>_Q,isAbstractElement:()=>JK,isAbstractRule:()=>UK,isAbstractType:()=>qK,isAction:()=>HZ,isAlternatives:()=>XZ,isArrayLiteral:()=>eZ,isArrayType:()=>rZ,isAssignment:()=>ZZ,isBooleanLiteral:()=>aZ,isCharacterRange:()=>JZ,isCondition:()=>YK,isConjunction:()=>oZ,isCrossReference:()=>eQ,isDisjunction:()=>cZ,isEndOfFile:()=>rQ,isFeatureName:()=>WK,isGrammar:()=>uZ,isGrammarImport:()=>pZ,isGroup:()=>aQ,isInferredType:()=>fZ,isInterface:()=>yZ,isKeyword:()=>oQ,isNamedArgument:()=>xZ,isNegatedToken:()=>cQ,isNegation:()=>wZ,isNumberLiteral:()=>TZ,isParameter:()=>EZ,isParameterReference:()=>SZ,isParserRule:()=>LZ,isPrimitiveType:()=>HK,isReferenceType:()=>IZ,isRegexToken:()=>uQ,isReturnType:()=>RZ,isRuleCall:()=>pQ,isSimpleType:()=>OZ,isStringLiteral:()=>BZ,isTerminalAlternatives:()=>fQ,isTerminalGroup:()=>yQ,isTerminalRule:()=>FZ,isTerminalRuleCall:()=>xQ,isType:()=>UZ,isTypeAttribute:()=>qZ,isTypeDefinition:()=>XK,isUnionType:()=>YZ,isUnorderedGroup:()=>wQ,isUntilToken:()=>TQ,isValueLiteral:()=>ZK,isWildcard:()=>EQ,reflection:()=>SQ});var FK={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]*/},zK="AbstractRule";function UK(t){return SQ.isInstance(t,zK)}s(UK,"isAbstractRule");var GK="AbstractType";function qK(t){return SQ.isInstance(t,GK)}s(qK,"isAbstractType");var jK="Condition";function YK(t){return SQ.isInstance(t,jK)}function WK(t){return HK(t)||"current"===t||"entry"===t||"extends"===t||"false"===t||"fragment"===t||"grammar"===t||"hidden"===t||"import"===t||"interface"===t||"returns"===t||"terminal"===t||"true"===t||"type"===t||"infer"===t||"infers"===t||"with"===t||"string"==typeof t&&/\^?[_a-zA-Z][\w_]*/.test(t)}function HK(t){return"string"===t||"number"===t||"boolean"===t||"Date"===t||"bigint"===t}s(YK,"isCondition"),s(WK,"isFeatureName"),s(HK,"isPrimitiveType");var VK="TypeDefinition";function XK(t){return SQ.isInstance(t,VK)}s(XK,"isTypeDefinition");var KK="ValueLiteral";function ZK(t){return SQ.isInstance(t,KK)}s(ZK,"isValueLiteral");var QK="AbstractElement";function JK(t){return SQ.isInstance(t,QK)}s(JK,"isAbstractElement");var tZ="ArrayLiteral";function eZ(t){return SQ.isInstance(t,tZ)}s(eZ,"isArrayLiteral");var nZ="ArrayType";function rZ(t){return SQ.isInstance(t,nZ)}s(rZ,"isArrayType");var iZ="BooleanLiteral";function aZ(t){return SQ.isInstance(t,iZ)}s(aZ,"isBooleanLiteral");var sZ="Conjunction";function oZ(t){return SQ.isInstance(t,sZ)}s(oZ,"isConjunction");var lZ="Disjunction";function cZ(t){return SQ.isInstance(t,lZ)}s(cZ,"isDisjunction");var hZ="Grammar";function uZ(t){return SQ.isInstance(t,hZ)}s(uZ,"isGrammar");var dZ="GrammarImport";function pZ(t){return SQ.isInstance(t,dZ)}s(pZ,"isGrammarImport");var gZ="InferredType";function fZ(t){return SQ.isInstance(t,gZ)}s(fZ,"isInferredType");var mZ="Interface";function yZ(t){return SQ.isInstance(t,mZ)}s(yZ,"isInterface");var vZ="NamedArgument";function xZ(t){return SQ.isInstance(t,vZ)}s(xZ,"isNamedArgument");var bZ="Negation";function wZ(t){return SQ.isInstance(t,bZ)}s(wZ,"isNegation");var kZ="NumberLiteral";function TZ(t){return SQ.isInstance(t,kZ)}s(TZ,"isNumberLiteral");var _Z="Parameter";function EZ(t){return SQ.isInstance(t,_Z)}s(EZ,"isParameter");var CZ="ParameterReference";function SZ(t){return SQ.isInstance(t,CZ)}s(SZ,"isParameterReference");var AZ="ParserRule";function LZ(t){return SQ.isInstance(t,AZ)}s(LZ,"isParserRule");var NZ="ReferenceType";function IZ(t){return SQ.isInstance(t,NZ)}s(IZ,"isReferenceType");var MZ="ReturnType";function RZ(t){return SQ.isInstance(t,MZ)}s(RZ,"isReturnType");var DZ="SimpleType";function OZ(t){return SQ.isInstance(t,DZ)}s(OZ,"isSimpleType");var PZ="StringLiteral";function BZ(t){return SQ.isInstance(t,PZ)}s(BZ,"isStringLiteral");var $Z="TerminalRule";function FZ(t){return SQ.isInstance(t,$Z)}s(FZ,"isTerminalRule");var zZ="Type";function UZ(t){return SQ.isInstance(t,zZ)}s(UZ,"isType");var GZ="TypeAttribute";function qZ(t){return SQ.isInstance(t,GZ)}s(qZ,"isTypeAttribute");var jZ="UnionType";function YZ(t){return SQ.isInstance(t,jZ)}s(YZ,"isUnionType");var WZ="Action";function HZ(t){return SQ.isInstance(t,WZ)}s(HZ,"isAction");var VZ="Alternatives";function XZ(t){return SQ.isInstance(t,VZ)}s(XZ,"isAlternatives");var KZ="Assignment";function ZZ(t){return SQ.isInstance(t,KZ)}s(ZZ,"isAssignment");var QZ="CharacterRange";function JZ(t){return SQ.isInstance(t,QZ)}s(JZ,"isCharacterRange");var tQ="CrossReference";function eQ(t){return SQ.isInstance(t,tQ)}s(eQ,"isCrossReference");var nQ="EndOfFile";function rQ(t){return SQ.isInstance(t,nQ)}s(rQ,"isEndOfFile");var iQ="Group";function aQ(t){return SQ.isInstance(t,iQ)}s(aQ,"isGroup");var sQ="Keyword";function oQ(t){return SQ.isInstance(t,sQ)}s(oQ,"isKeyword");var lQ="NegatedToken";function cQ(t){return SQ.isInstance(t,lQ)}s(cQ,"isNegatedToken");var hQ="RegexToken";function uQ(t){return SQ.isInstance(t,hQ)}s(uQ,"isRegexToken");var dQ="RuleCall";function pQ(t){return SQ.isInstance(t,dQ)}s(pQ,"isRuleCall");var gQ="TerminalAlternatives";function fQ(t){return SQ.isInstance(t,gQ)}s(fQ,"isTerminalAlternatives");var mQ="TerminalGroup";function yQ(t){return SQ.isInstance(t,mQ)}s(yQ,"isTerminalGroup");var vQ="TerminalRuleCall";function xQ(t){return SQ.isInstance(t,vQ)}s(xQ,"isTerminalRuleCall");var bQ="UnorderedGroup";function wQ(t){return SQ.isInstance(t,bQ)}s(wQ,"isUnorderedGroup");var kQ="UntilToken";function TQ(t){return SQ.isInstance(t,kQ)}s(TQ,"isUntilToken");var _Q="Wildcard";function EQ(t){return SQ.isInstance(t,_Q)}s(EQ,"isWildcard");var CQ=class extends eK{static{s(this,"LangiumGrammarAstReflection")}getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayLiteral","ArrayType","Assignment","BooleanLiteral","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","EndOfFile","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","NamedArgument","NegatedToken","Negation","NumberLiteral","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","StringLiteral","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","ValueLiteral","Wildcard"]}computeIsSubtype(t,e){switch(t){case WZ:case VZ:case KZ:case QZ:case tQ:case nQ:case iQ:case sQ:case lQ:case hQ:case dQ:case gQ:case mQ:case vQ:case bQ:case kQ:case _Q:return this.isSubtype(QK,e);case tZ:case kZ:case PZ:return this.isSubtype(KK,e);case nZ:case NZ:case DZ:case jZ:return this.isSubtype(VK,e);case iZ:return this.isSubtype(jK,e)||this.isSubtype(KK,e);case sZ:case lZ:case bZ:case CZ:return this.isSubtype(jK,e);case gZ:case mZ:case zZ:return this.isSubtype(GK,e);case AZ:return this.isSubtype(zK,e)||this.isSubtype(GK,e);case $Z:return this.isSubtype(zK,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;switch(e){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return GK;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return zK;case"Grammar:usedGrammars":return hZ;case"NamedArgument:parameter":case"ParameterReference:parameter":return _Z;case"TerminalRuleCall:rule":return $Z;default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(t){switch(t){case"AbstractElement":return{name:"AbstractElement",properties:[{name:"cardinality"},{name:"lookahead"}]};case"ArrayLiteral":return{name:"ArrayLiteral",properties:[{name:"elements",defaultValue:[]}]};case"ArrayType":return{name:"ArrayType",properties:[{name:"elementType"}]};case"BooleanLiteral":return{name:"BooleanLiteral",properties:[{name:"true",defaultValue:!1}]};case"Conjunction":return{name:"Conjunction",properties:[{name:"left"},{name:"right"}]};case"Disjunction":return{name:"Disjunction",properties:[{name:"left"},{name:"right"}]};case"Grammar":return{name:"Grammar",properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case"GrammarImport":return{name:"GrammarImport",properties:[{name:"path"}]};case"InferredType":return{name:"InferredType",properties:[{name:"name"}]};case"Interface":return{name:"Interface",properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case"NamedArgument":return{name:"NamedArgument",properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case"Negation":return{name:"Negation",properties:[{name:"value"}]};case"NumberLiteral":return{name:"NumberLiteral",properties:[{name:"value"}]};case"Parameter":return{name:"Parameter",properties:[{name:"name"}]};case"ParameterReference":return{name:"ParameterReference",properties:[{name:"parameter"}]};case"ParserRule":return{name:"ParserRule",properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case"ReferenceType":return{name:"ReferenceType",properties:[{name:"referenceType"}]};case"ReturnType":return{name:"ReturnType",properties:[{name:"name"}]};case"SimpleType":return{name:"SimpleType",properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case"StringLiteral":return{name:"StringLiteral",properties:[{name:"value"}]};case"TerminalRule":return{name:"TerminalRule",properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case"Type":return{name:"Type",properties:[{name:"name"},{name:"type"}]};case"TypeAttribute":return{name:"TypeAttribute",properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case"UnionType":return{name:"UnionType",properties:[{name:"types",defaultValue:[]}]};case"Action":return{name:"Action",properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case"Alternatives":return{name:"Alternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"Assignment":return{name:"Assignment",properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case"CharacterRange":return{name:"CharacterRange",properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case"CrossReference":return{name:"CrossReference",properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case"EndOfFile":return{name:"EndOfFile",properties:[{name:"cardinality"},{name:"lookahead"}]};case"Group":return{name:"Group",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case"Keyword":return{name:"Keyword",properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case"NegatedToken":return{name:"NegatedToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"RegexToken":return{name:"RegexToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case"RuleCall":return{name:"RuleCall",properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalGroup":return{name:"TerminalGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalRuleCall":return{name:"TerminalRuleCall",properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"UnorderedGroup":return{name:"UnorderedGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"UntilToken":return{name:"UntilToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"Wildcard":return{name:"Wildcard",properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:t,properties:[]}}}},SQ=new CQ,AQ={};function LQ(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach(((n,r)=>{ZX(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=r)})):ZX(n)&&(n.$container=t,n.$containerProperty=e))}function NQ(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function IQ(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function MQ(t){const e=RQ(t).$document;if(!e)throw new Error("AST node has no document.");return e}function RQ(t){for(;t.$container;)t=t.$container;return t}function DQ(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=null==e?void 0:e.range;return new aK((()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0})),(e=>{for(;e.keyIndexDQ(t,e)))}function PQ(t,e){if(!t)throw new Error("Root node must be an AstNode.");return(null==e?void 0:e.range)&&!BQ(t,e.range)?new gK(t,(()=>[])):new gK(t,(t=>DQ(t,e)),{includeRoot:!0})}function BQ(t,e){var n;if(!e)return!0;const r=null===(n=t.$cstNode)||void 0===n?void 0:n.range;return!!r&&wK(r,e)}function $Q(t){return new aK((()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0})),(e=>{for(;e.keyIndex{$Q(e).forEach((e=>{e.reference.ref===t&&n.push(e.reference)}))})),hK(n)}function zQ(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const t of n.properties)void 0!==t.defaultValue&&void 0===r[t.name]&&(r[t.name]=UQ(t.defaultValue))}function UQ(t){return Array.isArray(t)?[...t.map(UQ)]:t}function GQ(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(ZX(i))n[r]=GQ(i,e);else if(QX(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const t=[];for(const a of i)ZX(a)?t.push(GQ(a,e)):QX(a)?t.push(e(n,r,a.$refNode,a.$refText)):t.push(a);n[r]=t}else n[r]=i;return LQ(n),n}l(AQ,{assignMandatoryProperties:()=>zQ,copyAstNode:()=>GQ,findLocalReferences:()=>FQ,findRootNode:()=>RQ,getContainerOfType:()=>NQ,getDocument:()=>MQ,hasContainerOfType:()=>IQ,linkContentToContainer:()=>LQ,streamAllContents:()=>OQ,streamAst:()=>PQ,streamContents:()=>DQ,streamReferences:()=>$Q}),s(LQ,"linkContentToContainer"),s(NQ,"getContainerOfType"),s(IQ,"hasContainerOfType"),s(MQ,"getDocument"),s(RQ,"findRootNode"),s(DQ,"streamContents"),s(OQ,"streamAllContents"),s(PQ,"streamAst"),s(BQ,"isAstNodeInRange"),s($Q,"streamReferences"),s(FQ,"findLocalReferences"),s(zQ,"assignMandatoryProperties"),s(UQ,"copyDefaultValue"),s(GQ,"copyAstNode");var qQ={};function jQ(t){return t.charCodeAt(0)}function YQ(t,e){Array.isArray(t)?t.forEach((function(t){e.push(t)})):e.push(t)}function WQ(t,e){if(!0===t[e])throw"duplicate flag "+e;t[e],t[e]=!0}function HQ(t){if(void 0===t)throw Error("Internal Error - Should never get here!");return!0}function VQ(){throw Error("Internal Error - Should never get here!")}function XQ(t){return"Character"===t.type}l(qQ,{NEWLINE_REGEXP:()=>iJ,escapeRegExp:()=>uJ,getCaseInsensitivePattern:()=>dJ,getTerminalParts:()=>lJ,isMultilineComment:()=>cJ,isWhitespace:()=>hJ,partialMatches:()=>pJ,partialRegExp:()=>gJ}),s(jQ,"cc"),s(YQ,"insertToSet"),s(WQ,"addFlag"),s(HQ,"ASSERT_EXISTS"),s(VQ,"ASSERT_NEVER_REACH_HERE"),s(XQ,"isCharacter");var KQ=[];for(let t=jQ("0");t<=jQ("9");t++)KQ.push(t);var ZQ=[jQ("_")].concat(KQ);for(let t=jQ("a");t<=jQ("z");t++)ZQ.push(t);for(let t=jQ("A");t<=jQ("Z");t++)ZQ.push(t);var QQ=[jQ(" "),jQ("\f"),jQ("\n"),jQ("\r"),jQ("\t"),jQ("\v"),jQ("\t"),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ("\u2028"),jQ("\u2029"),jQ(" "),jQ(" "),jQ(" "),jQ("\ufeff")],JQ=/[0-9a-fA-F]/,tJ=/[0-9]/,eJ=/[1-9]/,nJ=class{static{s(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");const e=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":WQ(n,"global");break;case"i":WQ(n,"ignoreCase");break;case"m":WQ(n,"multiLine");break;case"u":WQ(n,"unicode");break;case"y":WQ(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:e,loc:this.loc(0)}}disjunction(){const t=[],e=this.idx;for(t.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(e)}}alternative(){const t=[],e=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(e)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":let e;switch(this.consumeChar("?"),this.popChar()){case"=":e="Lookahead";break;case"!":e="NegativeLookahead"}HQ(e);const n=this.disjunction();return this.consumeChar(")"),{type:e,value:n,loc:this.loc(t)}}return VQ()}quantifier(t=!1){let e;const n=this.idx;switch(this.popChar()){case"*":e={atLeast:0,atMost:1/0};break;case"+":e={atLeast:1,atMost:1/0};break;case"?":e={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":e={atLeast:n,atMost:n};break;case",":let t;this.isDigit()?(t=this.integerIncludingZero(),e={atLeast:n,atMost:t}):e={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===t&&void 0===e)return;HQ(e)}if(!0!==t||void 0!==e)return HQ(e)?("?"===this.peekChar(0)?(this.consumeChar("?"),e.greedy=!1):e.greedy=!0,e.type="Quantifier",e.loc=this.loc(n),e):void 0}atom(){let t;const e=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group()}if(void 0===t&&this.isPatternCharacter()&&(t=this.patternCharacter()),HQ(t))return t.loc=this.loc(e),this.isQuantifier()&&(t.quantifier=this.quantifier()),t}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[jQ("\n"),jQ("\r"),jQ("\u2028"),jQ("\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 t,e=!1;switch(this.popChar()){case"d":t=KQ;break;case"D":t=KQ,e=!0;break;case"s":t=QQ;break;case"S":t=QQ,e=!0;break;case"w":t=ZQ;break;case"W":t=ZQ,e=!0}if(HQ(t))return{type:"Set",value:t,complement:e}}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=jQ("\f");break;case"n":t=jQ("\n");break;case"r":t=jQ("\r");break;case"t":t=jQ("\t");break;case"v":t=jQ("\v")}if(HQ(t))return{type:"Character",value:t}}controlLetterEscapeAtom(){this.consumeChar("c");const t=this.popChar();if(!1===/[a-zA-Z]/.test(t))throw Error("Invalid ");return{type:"Character",value:t.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:jQ("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:jQ(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:jQ(this.popChar())}}}characterClass(){const t=[];let e=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),e=!0);this.isClassAtom();){const e=this.classAtom();if(e.type,XQ(e)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,XQ(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(t){return{begin:t,end:this.idx}}},rJ=class{static{s(this,"BaseRegExpVisitor")}visitChildren(t){for(const e in t){const n=t[e];t.hasOwnProperty(e)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach((t=>{this.visit(t)}),this))}}visit(t){switch(t.type){case"Pattern":this.visitPattern(t);break;case"Flags":this.visitFlags(t);break;case"Disjunction":this.visitDisjunction(t);break;case"Alternative":this.visitAlternative(t);break;case"StartAnchor":this.visitStartAnchor(t);break;case"EndAnchor":this.visitEndAnchor(t);break;case"WordBoundary":this.visitWordBoundary(t);break;case"NonWordBoundary":this.visitNonWordBoundary(t);break;case"Lookahead":this.visitLookahead(t);break;case"NegativeLookahead":this.visitNegativeLookahead(t);break;case"Character":this.visitCharacter(t);break;case"Set":this.visitSet(t);break;case"Group":this.visitGroup(t);break;case"GroupBackReference":this.visitGroupBackReference(t);break;case"Quantifier":this.visitQuantifier(t)}this.visitChildren(t)}visitPattern(t){}visitFlags(t){}visitDisjunction(t){}visitAlternative(t){}visitStartAnchor(t){}visitEndAnchor(t){}visitWordBoundary(t){}visitNonWordBoundary(t){}visitLookahead(t){}visitNegativeLookahead(t){}visitCharacter(t){}visitSet(t){}visitGroup(t){}visitGroupBackReference(t){}visitQuantifier(t){}},iJ=/\r?\n/gm,aJ=new nJ,sJ=class extends rJ{static{s(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(t){this.multiline=!1,this.regex=t,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(t){t.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(t){const e=String.fromCharCode(t.value);if(this.multiline||"\n"!==e||(this.multiline=!0),t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=uJ(e);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitSet(t){if(!this.multiline){const e=this.regex.substring(t.loc.begin,t.loc.end),n=new RegExp(e);this.multiline=Boolean("\n".match(n))}if(t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const e=this.regex.substring(t.loc.begin,t.loc.end);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitChildren(t){if("Group"===t.type){if(t.quantifier)return}super.visitChildren(t)}},oJ=new sJ;function lJ(t){try{"string"!=typeof t&&(t=t.source),t=`/${t}/`;const e=aJ.pattern(t),n=[];for(const r of e.value.value)oJ.reset(t),oJ.visit(r),n.push({start:oJ.startRegexp,end:oJ.endRegex});return n}catch(t){return[]}}function cJ(t){try{return"string"==typeof t&&(t=new RegExp(t)),t=t.toString(),oJ.reset(t),oJ.visit(aJ.pattern(t)),oJ.multiline}catch(t){return!1}}function hJ(t){return("string"==typeof t?new RegExp(t):t).test(" ")}function uJ(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dJ(t){return Array.prototype.map.call(t,(t=>/\w/.test(t)?`[${t.toLowerCase()}${t.toUpperCase()}]`:uJ(t))).join("")}function pJ(t,e){const n=gJ(t),r=e.match(n);return!!r&&r[0].length>0}function gJ(t){"string"==typeof t&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let t,a="";function o(t){a+=n.substr(r,t),r+=t}function l(t){a+="(?:"+n.substr(r,t)+"|$)",r+=t}for(s(o,"appendRaw"),s(l,"appendOptional");r",r)-r+1);break;default:l(2)}break;case"[":t=/\[(?:\\.|.)*?\]/g,t.lastIndex=r,t=t.exec(n)||[],l(t[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":t=/\{\d+,?\d*\}/g,t.lastIndex=r,t=t.exec(n),t?o(t[0].length):l(1);break;case"(":if("?"===n[r+1])switch(n[r+2]){case":":a+="(?:",r+=3,a+=i()+"|$)";break;case"=":a+="(?=",r+=3,a+=i()+")";break;case"!":t=r,r+=3,i(),a+=n.substr(t,r-t);break;case"<":switch(n[r+3]){case"=":case"!":t=r,r+=4,i(),a+=n.substr(t,r-t);break;default:o(n.indexOf(">",r)-r+1),a+=i()+"|$)"}}else o(1),a+=i()+"|$)";break;case")":return++r,a;default:l(1)}return a}return s(i,"process"),new RegExp(i(),t.flags)}function fJ(t){return t.rules.find((t=>LZ(t)&&t.entry))}function mJ(t){return t.rules.filter((t=>FZ(t)&&t.hidden))}function yJ(t,e){const n=new Set,r=fJ(t);if(!r)return new Set(t.rules);const i=[r].concat(mJ(t));for(const t of i)vJ(t,n,e);const a=new Set;for(const e of t.rules)(n.has(e.name)||FZ(e)&&e.hidden)&&a.add(e);return a}function vJ(t,e,n){e.add(t.name),OQ(t).forEach((t=>{if(pQ(t)||n&&xQ(t)){const r=t.rule.ref;r&&!e.has(r.name)&&vJ(r,e,n)}}))}function xJ(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=AJ(t.type.ref);return null==e?void 0:e.terminal}}function bJ(t){return t.hidden&&!GJ(t).test(" ")}function wJ(t,e){return t&&e?TJ(t,e,t.astNode,!0):[]}function kJ(t,e,n){if(!t||!e)return;const r=TJ(t,e,t.astNode,!0);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function TJ(t,e,n,r){if(!r){const n=NQ(t.grammarSource,ZZ);if(n&&n.feature===e)return[t]}return nK(t)&&t.astNode===n?t.content.flatMap((t=>TJ(t,e,n,!1))):[]}function _J(t,e){return t?CJ(t,e,null==t?void 0:t.astNode):[]}function EJ(t,e,n){if(!t)return;const r=CJ(t,e,null==t?void 0:t.astNode);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function CJ(t,e,n){if(t.astNode!==n)return[];if(oQ(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=fK(t).iterator();let i;const a=[];do{if(i=r.next(),!i.done){const t=i.value;t.astNode===n?oQ(t.grammarSource)&&t.grammarSource.value===e&&a.push(t):r.prune()}}while(!i.done);return a}function SJ(t){var e;const n=t.astNode;for(;n===(null===(e=t.container)||void 0===e?void 0:e.astNode);){const e=NQ(t.grammarSource,ZZ);if(e)return e;t=t.container}}function AJ(t){let e=t;return fZ(e)&&(HZ(e.$container)?e=e.$container.$container:LZ(e.$container)?e=e.$container:BK(e.$container)),LJ(t,e,new Map)}function LJ(t,e,n){var r;function i(e,r){let i;return NQ(e,ZZ)||(i=LJ(r,r,n)),n.set(t,i),i}if(s(i,"go"),n.has(t))return n.get(t);n.set(t,void 0);for(const a of OQ(e)){if(ZZ(a)&&"name"===a.feature.toLowerCase())return n.set(t,a),a;if(pQ(a)&&LZ(a.rule.ref))return i(a,a.rule.ref);if(OZ(a)&&(null===(r=a.typeRef)||void 0===r?void 0:r.ref))return i(a,a.typeRef.ref)}}function NJ(t){const e=t.$container;if(aQ(e)){const n=e.elements;for(let e=n.indexOf(t)-1;e>=0;e--){const t=n[e];if(HZ(t))return t;{const t=OQ(n[e]).find(HZ);if(t)return t}}}return JK(e)?NJ(e):void 0}function IJ(t,e){return"?"===t||"*"===t||aQ(e)&&Boolean(e.guardCondition)}function MJ(t){return"*"===t||"+"===t}function RJ(t){return"+="===t}function DJ(t){return OJ(t,new Set)}function OJ(t,e){if(e.has(t))return!0;e.add(t);for(const n of OQ(t))if(pQ(n)){if(!n.rule.ref)return!1;if(LZ(n.rule.ref)&&!OJ(n.rule.ref,e))return!1}else{if(ZZ(n))return!1;if(HZ(n))return!1}return Boolean(t.definition)}function PJ(t){return BJ(t.type,new Set)}function BJ(t,e){if(e.has(t))return!0;if(e.add(t),rZ(t))return!1;if(IZ(t))return!1;if(YZ(t))return t.types.every((t=>BJ(t,e)));if(OZ(t)){if(void 0!==t.primitiveType)return!0;if(void 0!==t.stringType)return!0;if(void 0!==t.typeRef){const n=t.typeRef.ref;return!!UZ(n)&&BJ(n.type,e)}return!1}return!1}function $J(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(LZ(e))return e.name;if(yZ(e)||UZ(e))return e.name}}}function FJ(t){var e;if(LZ(t))return DJ(t)?t.name:null!==(e=$J(t))&&void 0!==e?e:t.name;if(yZ(t)||UZ(t)||RZ(t))return t.name;if(HZ(t)){const e=zJ(t);if(e)return e}else if(fZ(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function zJ(t){var e;return t.inferredType?t.inferredType.name:(null===(e=t.type)||void 0===e?void 0:e.ref)?FJ(t.type.ref):void 0}function UJ(t){var e,n,r;return FZ(t)?null!==(n=null===(e=t.type)||void 0===e?void 0:e.name)&&void 0!==n?n:"string":DJ(t)?t.name:null!==(r=$J(t))&&void 0!==r?r:t.name}function GJ(t){const e={s:!1,i:!1,u:!1},n=jJ(t.definition,e),r=Object.entries(e).filter((([,t])=>t)).map((([t])=>t)).join("");return new RegExp(n,r)}s(lJ,"getTerminalParts"),s(cJ,"isMultilineComment"),s(hJ,"isWhitespace"),s(uJ,"escapeRegExp"),s(dJ,"getCaseInsensitivePattern"),s(pJ,"partialMatches"),s(gJ,"partialRegExp"),s(fJ,"getEntryRule"),s(mJ,"getHiddenRules"),s(yJ,"getAllReachableRules"),s(vJ,"ruleDfs"),s(xJ,"getCrossReferenceTerminal"),s(bJ,"isCommentTerminal"),s(wJ,"findNodesForProperty"),s(kJ,"findNodeForProperty"),s(TJ,"findNodesForPropertyInternal"),s(_J,"findNodesForKeyword"),s(EJ,"findNodeForKeyword"),s(CJ,"findNodesForKeywordInternal"),s(SJ,"findAssignment"),s(AJ,"findNameAssignment"),s(LJ,"findNameAssignmentInternal"),s(NJ,"getActionAtElement"),s(IJ,"isOptionalCardinality"),s(MJ,"isArrayCardinality"),s(RJ,"isArrayOperator"),s(DJ,"isDataTypeRule"),s(OJ,"isDataTypeRuleInternal"),s(PJ,"isDataType"),s(BJ,"isDataTypeInternal"),s($J,"getExplicitRuleType"),s(FJ,"getTypeName"),s(zJ,"getActionType"),s(UJ,"getRuleType"),s(GJ,"terminalRegex");var qJ=/[\s\S]/.source;function jJ(t,e){if(fQ(t))return YJ(t);if(yQ(t))return WJ(t);if(JZ(t))return XJ(t);if(xQ(t)){const e=t.rule.ref;if(!e)throw new Error("Missing rule reference.");return ZJ(jJ(e.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}if(cQ(t))return VJ(t);if(TQ(t))return HJ(t);if(uQ(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ZJ(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}if(EQ(t))return ZJ(qJ,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${null==t?void 0:t.$type}`)}function YJ(t){return ZJ(t.elements.map((t=>jJ(t))).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function WJ(t){return ZJ(t.elements.map((t=>jJ(t))).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function HJ(t){return ZJ(`${qJ}*?${jJ(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function VJ(t){return ZJ(`(?!${jJ(t.terminal)})${qJ}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function XJ(t){return t.right?ZJ(`[${KJ(t.left)}-${KJ(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ZJ(KJ(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function KJ(t){return uJ(t.value)}function ZJ(t,e){var n;return(!1!==e.wrap||e.lookahead)&&(t=`(${null!==(n=e.lookahead)&&void 0!==n?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function QJ(t){const e=[],n=t.Grammar;for(const t of n.rules)FZ(t)&&bJ(t)&&cJ(GJ(t))&&e.push(t.name);return{multilineCommentRules:e,nameRegexp:kK}}function JJ(t){console&&console.error&&console.error(`Error: ${t}`)}function t0(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function e0(t){const e=(new Date).getTime(),n=t();return{time:(new Date).getTime()-e,value:n}}function n0(t){function e(){}s(e,"FakeConstructor"),e.prototype=t;const n=new e;function r(){return typeof n.bar}return s(r,"fakeAccess"),r(),r(),t}function r0(t){return i0(t)?t.LABEL:t.name}function i0(t){return FU(t.LABEL)&&""!==t.LABEL}s(jJ,"abstractElementToRegex"),s(YJ,"terminalAlternativesToRegex"),s(WJ,"terminalGroupToRegex"),s(HJ,"untilTokenToRegex"),s(VJ,"negateTokenToRegex"),s(XJ,"characterRangeToRegex"),s(KJ,"keywordToRegex"),s(ZJ,"withCardinality"),s(QJ,"createGrammarConfig"),s(JJ,"PRINT_ERROR"),s(t0,"PRINT_WARNING"),s(e0,"timer"),s(n0,"toFastProperties"),s(r0,"tokenLabel"),s(i0,"hasTokenLabel");var a0=class{static{s(this,"AbstractProduction")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),zB(this.definition,(e=>{e.accept(t)}))}},s0=class extends a0{static{s(this,"NonTerminal")}constructor(t){super([]),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}set definition(t){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(t){t.visit(this)}},o0=class extends a0{static{s(this,"Rule")}constructor(t){super(t.definition),this.orgText="",zz(this,aG(t,(t=>void 0!==t)))}},l0=class extends a0{static{s(this,"Alternative")}constructor(t){super(t.definition),this.ignoreAmbiguities=!1,zz(this,aG(t,(t=>void 0!==t)))}},c0=class extends a0{static{s(this,"Option")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},h0=class extends a0{static{s(this,"RepetitionMandatory")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},u0=class extends a0{static{s(this,"RepetitionMandatoryWithSeparator")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},d0=class extends a0{static{s(this,"Repetition")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},p0=class extends a0{static{s(this,"RepetitionWithSeparator")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},g0=class extends a0{static{s(this,"Alternation")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,zz(this,aG(t,(t=>void 0!==t)))}},f0=class{static{s(this,"Terminal")}constructor(t){this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}accept(t){t.visit(this)}};function m0(t){return wF(t,y0)}function y0(t){function e(t){return wF(t,y0)}if(s(e,"convertDefinition"),t instanceof s0){const e={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return FU(t.label)&&(e.label=t.label),e}if(t instanceof l0)return{type:"Alternative",definition:e(t.definition)};if(t instanceof c0)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof h0)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof u0)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:y0(new f0({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof p0)return{type:"RepetitionWithSeparator",idx:t.idx,separator:y0(new f0({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof d0)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof g0)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof f0){const e={type:"Terminal",name:t.terminalType.name,label:r0(t.terminalType),idx:t.idx};FU(t.label)&&(e.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(e.pattern=XU(n)?n.source:n),e}if(t instanceof o0)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}s(m0,"serializeGrammar"),s(y0,"serializeProduction");var v0=class{static{s(this,"GAstVisitor")}visit(t){const e=t;switch(e.constructor){case s0:return this.visitNonTerminal(e);case l0:return this.visitAlternative(e);case c0:return this.visitOption(e);case h0:return this.visitRepetitionMandatory(e);case u0:return this.visitRepetitionMandatoryWithSeparator(e);case p0:return this.visitRepetitionWithSeparator(e);case d0:return this.visitRepetition(e);case g0:return this.visitAlternation(e);case f0:return this.visitTerminal(e);case o0:return this.visitRule(e);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}};function x0(t){return t instanceof l0||t instanceof c0||t instanceof d0||t instanceof h0||t instanceof u0||t instanceof p0||t instanceof f0||t instanceof o0}function b0(t,e=[]){return!!(t instanceof c0||t instanceof d0||t instanceof p0)||(t instanceof g0?GG(t.definition,(t=>b0(t,e))):!(t instanceof s0&&GU(e,t))&&(t instanceof a0&&(t instanceof s0&&e.push(t),mU(t.definition,(t=>b0(t,e))))))}function w0(t){return t instanceof g0}function k0(t){if(t instanceof s0)return"SUBRULE";if(t instanceof c0)return"OPTION";if(t instanceof g0)return"OR";if(t instanceof h0)return"AT_LEAST_ONE";if(t instanceof u0)return"AT_LEAST_ONE_SEP";if(t instanceof p0)return"MANY_SEP";if(t instanceof d0)return"MANY";if(t instanceof f0)return"CONSUME";throw Error("non exhaustive match")}s(x0,"isSequenceProd"),s(b0,"isOptionalProd"),s(w0,"isBranchingProd"),s(k0,"getProductionDslName");var T0=class{static{s(this,"RestWalker")}walk(t,e=[]){zB(t.definition,((n,r)=>{const i=lU(t.definition,r+1);if(n instanceof s0)this.walkProdRef(n,i,e);else if(n instanceof f0)this.walkTerminal(n,i,e);else if(n instanceof l0)this.walkFlat(n,i,e);else if(n instanceof c0)this.walkOption(n,i,e);else if(n instanceof h0)this.walkAtLeastOne(n,i,e);else if(n instanceof u0)this.walkAtLeastOneSep(n,i,e);else if(n instanceof p0)this.walkManySep(n,i,e);else if(n instanceof d0)this.walkMany(n,i,e);else{if(!(n instanceof g0))throw Error("non exhaustive match");this.walkOr(n,i,e)}}))}walkTerminal(t,e,n){}walkProdRef(t,e,n){}walkFlat(t,e,n){const r=e.concat(n);this.walk(t,r)}walkOption(t,e,n){const r=e.concat(n);this.walk(t,r)}walkAtLeastOne(t,e,n){const r=[new c0({definition:t.definition})].concat(e,n);this.walk(t,r)}walkAtLeastOneSep(t,e,n){const r=_0(t,e,n);this.walk(t,r)}walkMany(t,e,n){const r=[new c0({definition:t.definition})].concat(e,n);this.walk(t,r)}walkManySep(t,e,n){const r=_0(t,e,n);this.walk(t,r)}walkOr(t,e,n){const r=e.concat(n);zB(t.definition,(t=>{const e=new l0({definition:[t]});this.walk(e,r)}))}};function _0(t,e,n){return[new c0({definition:[new f0({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function E0(t){if(t instanceof s0)return E0(t.referencedRule);if(t instanceof f0)return A0(t);if(x0(t))return C0(t);if(w0(t))return S0(t);throw Error("non exhaustive match")}function C0(t){let e=[];const n=t.definition;let r,i=0,a=n.length>i,s=!0;for(;a&&s;)r=n[i],s=b0(r),e=e.concat(E0(r)),i+=1,a=n.length>i;return WG(e)}function S0(t){const e=wF(t.definition,(t=>E0(t)));return WG(VF(e))}function A0(t){return[t.terminalType]}s(_0,"restForRepetitionWithSeparator"),s(E0,"first"),s(C0,"firstForSequence"),s(S0,"firstForBranching"),s(A0,"firstForTerminal");var L0=class extends T0{static{s(this,"ResyncFollowsWalker")}constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,e,n){}walkProdRef(t,e,n){const r=I0(t.referencedRule,t.idx)+this.topProd.name,i=e.concat(n),a=E0(new l0({definition:i}));this.follows[r]=a}};function N0(t){const e={};return zB(t,(t=>{const n=new L0(t).startWalking();zz(e,n)})),e}function I0(t,e){return t.name+e+"_~IN~_"}s(N0,"computeAllProdsFollows"),s(I0,"buildBetweenProdsFollowPrefix");var M0={},R0=new nJ;function D0(t){const e=t.toString();if(M0.hasOwnProperty(e))return M0[e];{const t=R0.pattern(e);return M0[e]=t,t}}function O0(){M0={}}s(D0,"getRegExpAst"),s(O0,"clearRegExpParserCache");var P0='Unable to use "first char" lexer optimizations:\n';function B0(t,e=!1){try{const e=D0(t);return $0(e.value,{},e.flags.ignoreCase)}catch(n){if("Complement Sets are not supported for first char optimization"===n.message)e&&t0(`${P0}\tUnable to optimize: < ${t.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),JJ(`${P0}\n\tFailed parsing: < ${t.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function $0(t,e,n){switch(t.type){case"Disjunction":for(let r=0;r{if("number"==typeof t)F0(t,e,n);else{const r=t;if(!0===n)for(let t=r.from;t<=r.to;t++)F0(t,e,n);else{for(let t=r.from;t<=r.to&&t=w1){const t=r.from>=w1?r.from:w1,n=r.to,i=T1(t),a=T1(n);for(let t=i;t<=a;t++)e[t]=t}}}}));break;case"Group":$0(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const s=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===G0(a)||"Group"!==a.type&&!1===s)break}break;default:throw Error("non exhaustive match!")}return EF(e)}function F0(t,e,n){const r=T1(t);e[r]=r,!0===n&&z0(t,e)}function z0(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const t=T1(r.charCodeAt(0));e[t]=t}else{const t=n.toLowerCase();if(t!==n){const n=T1(t.charCodeAt(0));e[n]=n}}}function U0(t,e){return wU(t.value,(t=>{if("number"==typeof t)return GU(e,t);{const n=t;return void 0!==wU(e,(t=>n.from<=t&&t<=n.to))}}))}function G0(t){const e=t.quantifier;return!(!e||0!==e.atLeast)||!!t.value&&(hb(t.value)?mU(t.value,G0):G0(t.value))}s(B0,"getOptimizedStartCodesIndices"),s($0,"firstCharOptimizedIndices"),s(F0,"addOptimizedIdxToResult"),s(z0,"handleIgnoreCase"),s(U0,"findCode"),s(G0,"isWholeOptional");var q0=class extends rJ{static{s(this,"CharCodeFinder")}constructor(t){super(),this.targetCharCodes=t,this.found=!1}visitChildren(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}super.visitChildren(t)}}visitCharacter(t){GU(this.targetCharCodes,t.value)&&(this.found=!0)}visitSet(t){t.complement?void 0===U0(t,this.targetCharCodes)&&(this.found=!0):void 0!==U0(t,this.targetCharCodes)&&(this.found=!0)}};function j0(t,e){if(e instanceof RegExp){const n=D0(e),r=new q0(t);return r.visit(n),r.found}return void 0!==wU(e,(e=>GU(t,e.charCodeAt(0))))}s(j0,"canMatchCharCode");var Y0="boolean"==typeof new RegExp("(?:)").sticky;function W0(t,e){const n=(e=NB(e,{useSticky:Y0,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:s(((t,e)=>e()),"tracer")})).tracer;let r;n("initCharCodeToOptimizedIndexMap",(()=>{_1()})),n("Reject Lexer.NA",(()=>{r=PG(t,(t=>t.PATTERN===j1.NA))}));let i,a,o,l,c,h,u,d,p,g,f,m=!1;n("Transform Patterns",(()=>{m=!1,i=wF(r,(t=>{const n=t.PATTERN;if(XU(n)){const t=n.source;return 1!==t.length||"^"===t||"$"===t||"."===t||n.ignoreCase?2!==t.length||"\\"!==t[0]||GU(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],t[1])?e.useSticky?h1(n):c1(n):t[1]:t}if(Hy(n))return m=!0,{exec:n};if("object"==typeof n)return m=!0,n;if("string"==typeof n){if(1===n.length)return n;{const t=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(t);return e.useSticky?h1(r):c1(r)}}throw Error("non exhaustive match")}))})),n("misc mapping",(()=>{a=wF(r,(t=>t.tokenTypeIdx)),o=wF(r,(t=>{const e=t.GROUP;if(e!==j1.SKIPPED){if(FU(e))return e;if(SF(e))return!1;throw Error("non exhaustive match")}})),l=wF(r,(t=>{const e=t.LONGER_ALT;if(e){const t=hb(e)?wF(e,(t=>YU(r,t))):[YU(r,e)];return t}})),c=wF(r,(t=>t.PUSH_MODE)),h=wF(r,(t=>BU(t,"POP_MODE")))})),n("Line Terminator Handling",(()=>{const t=x1(e.lineTerminatorCharacters);u=wF(r,(t=>!1)),"onlyOffset"!==e.positionTracking&&(u=wF(r,(e=>BU(e,"LINE_BREAKS")?!!e.LINE_BREAKS:!1===y1(e,t)&&j0(t,e.PATTERN))))})),n("Misc Mapping #2",(()=>{d=wF(r,g1),p=wF(i,f1),g=rz(r,((t,e)=>{const n=e.GROUP;return FU(n)&&n!==j1.SKIPPED&&(t[n]=[]),t}),{}),f=wF(i,((t,e)=>({pattern:i[e],longerAlt:l[e],canLineTerminator:u[e],isCustom:d[e],short:p[e],group:o[e],push:c[e],pop:h[e],tokenTypeIdx:a[e],tokenType:r[e]})))}));let y=!0,v=[];return e.safeMode||n("First Char Optimization",(()=>{v=rz(r,((t,n,r)=>{if("string"==typeof n.PATTERN){const e=T1(n.PATTERN.charCodeAt(0));b1(t,e,f[r])}else if(hb(n.START_CHARS_HINT)){let e;zB(n.START_CHARS_HINT,(n=>{const i=T1("string"==typeof n?n.charCodeAt(0):n);e!==i&&(e=i,b1(t,i,f[r]))}))}else if(XU(n.PATTERN))if(n.PATTERN.unicode)y=!1,e.ensureOptimizations&&JJ(`${P0}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=B0(n.PATTERN,e.ensureOptimizations);bA(i)&&(y=!1),zB(i,(e=>{b1(t,e,f[r])}))}else e.ensureOptimizations&&JJ(`${P0}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return t}),[])})),{emptyGroups:g,patternIdxToConfig:f,charCodeToPatternIdxToConfig:v,hasCustom:m,canBeOptimized:y}}function H0(t,e){let n=[];const r=X0(t);n=n.concat(r.errors);const i=K0(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(V0(a)),n=n.concat(i1(a)),n=n.concat(a1(a,e)),n=n.concat(s1(a)),n}function V0(t){let e=[];const n=yF(t,(t=>XU(t.PATTERN)));return e=e.concat(Q0(n)),e=e.concat(e1(n)),e=e.concat(n1(n)),e=e.concat(r1(n)),e=e.concat(J0(n)),e}function X0(t){const e=yF(t,(t=>!BU(t,"PATTERN")));return{errors:wF(e,(t=>({message:"Token Type: ->"+t.name+"<- missing static 'PATTERN' property",type:z1.MISSING_PATTERN,tokenTypes:[t]}))),valid:sU(t,e)}}function K0(t){const e=yF(t,(t=>{const e=t.PATTERN;return!(XU(e)||Hy(e)||BU(e,"exec")||FU(e))}));return{errors:wF(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:z1.INVALID_PATTERN,tokenTypes:[t]}))),valid:sU(t,e)}}s(W0,"analyzeTokenTypes"),s(H0,"validatePatterns"),s(V0,"validateRegExpPattern"),s(X0,"findMissingPatterns"),s(K0,"findInvalidPatterns");var Z0=/[^\\][$]/;function Q0(t){class e extends rJ{static{s(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(t){this.found=!0}}const n=yF(t,(t=>{const n=t.PATTERN;try{const t=D0(n),r=new e;return r.visit(t),r.found}catch(t){return Z0.test(n.source)}}));return wF(n,(t=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:z1.EOI_ANCHOR_FOUND,tokenTypes:[t]})))}function J0(t){const e=yF(t,(t=>t.PATTERN.test("")));return wF(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' must not match an empty string",type:z1.EMPTY_MATCH_PATTERN,tokenTypes:[t]})))}s(Q0,"findEndOfInputAnchor"),s(J0,"findEmptyMatchRegExps");var t1=/[^\\[][\^]|^\^/;function e1(t){class e extends rJ{static{s(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(t){this.found=!0}}const n=yF(t,(t=>{const n=t.PATTERN;try{const t=D0(n),r=new e;return r.visit(t),r.found}catch(t){return t1.test(n.source)}}));return wF(n,(t=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:z1.SOI_ANCHOR_FOUND,tokenTypes:[t]})))}function n1(t){const e=yF(t,(t=>{const e=t.PATTERN;return e instanceof RegExp&&(e.multiline||e.global)}));return wF(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:z1.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]})))}function r1(t){const e=[];let n=wF(t,(n=>rz(t,((t,r)=>(n.PATTERN.source!==r.PATTERN.source||GU(e,r)||r.PATTERN===j1.NA||(e.push(r),t.push(r)),t)),[])));n=Xz(n);const r=yF(n,(t=>t.length>1));return wF(r,(t=>{const e=wF(t,(t=>t.name));return{message:`The same RegExp pattern ->${TU(t).PATTERN}<-has been used in all of the following Token Types: ${e.join(", ")} <-`,type:z1.DUPLICATE_PATTERNS_FOUND,tokenTypes:t}}))}function i1(t){const e=yF(t,(t=>{if(!BU(t,"GROUP"))return!1;const e=t.GROUP;return e!==j1.SKIPPED&&e!==j1.NA&&!FU(e)}));return wF(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:z1.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]})))}function a1(t,e){const n=yF(t,(t=>void 0!==t.PUSH_MODE&&!GU(e,t.PUSH_MODE)));return wF(n,(t=>({message:`Token Type: ->${t.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${t.PUSH_MODE}<-which does not exist`,type:z1.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[t]})))}function s1(t){const e=[],n=rz(t,((t,e,n)=>{const r=e.PATTERN;return r===j1.NA||(FU(r)?t.push({str:r,idx:n,tokenType:e}):XU(r)&&l1(r)&&t.push({str:r.source,idx:n,tokenType:e})),t}),[]);return zB(t,((t,r)=>{zB(n,(({str:n,idx:i,tokenType:a})=>{if(r${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${t.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:n,type:z1.UNREACHABLE_PATTERN,tokenTypes:[t,a]})}}))})),e}function o1(t,e){if(XU(e)){const n=e.exec(t);return null!==n&&0===n.index}if(Hy(e))return e(t,0,[],{});if(BU(e,"exec"))return e.exec(t,0,[],{});if("string"==typeof e)return e===t;throw Error("non exhaustive match")}function l1(t){return void 0===wU([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(e=>-1!==t.source.indexOf(e)))}function c1(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function h1(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function u1(t,e,n){const r=[];return BU(t,"defaultMode")||r.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:z1.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),BU(t,"modes")||r.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:z1.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),BU(t,"modes")&&BU(t,"defaultMode")&&!BU(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a defaultMode: <${t.defaultMode}>which does not exist\n`,type:z1.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),BU(t,"modes")&&zB(t.modes,((t,e)=>{zB(t,((n,i)=>{if(SF(n))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${e}> at index: <${i}>\n`,type:z1.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(BU(n,"LONGER_ALT")){const i=hb(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT];zB(i,(i=>{SF(i)||GU(t,i)||r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${n.name}> outside of mode <${e}>\n`,type:z1.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),r}function d1(t,e,n){const r=[];let i=!1;const a=Xz(VF(EF(t.modes))),s=PG(a,(t=>t.PATTERN===j1.NA)),o=x1(n);return e&&zB(s,(t=>{const e=y1(t,o);if(!1!==e){const n={message:v1(t,e),type:e.issue,tokenType:t};r.push(n)}else BU(t,"LINE_BREAKS")?!0===t.LINE_BREAKS&&(i=!0):j0(o,t.PATTERN)&&(i=!0)})),e&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:z1.NO_LINE_BREAKS_FLAGS}),r}function p1(t){const e={},n=EP(t);return zB(n,(n=>{const r=t[n];if(!hb(r))throw Error("non exhaustive match");e[n]=[]})),e}function g1(t){const e=t.PATTERN;if(XU(e))return!1;if(Hy(e))return!0;if(BU(e,"exec"))return!0;if(FU(e))return!1;throw Error("non exhaustive match")}function f1(t){return!(!FU(t)||1!==t.length)&&t.charCodeAt(0)}s(e1,"findStartOfInputAnchor"),s(n1,"findUnsupportedFlags"),s(r1,"findDuplicatePatterns"),s(i1,"findInvalidGroupType"),s(a1,"findModesThatDoNotExist"),s(s1,"findUnreachablePatterns"),s(o1,"testTokenType"),s(l1,"noMetaChar"),s(c1,"addStartOfInput"),s(h1,"addStickyFlag"),s(u1,"performRuntimeChecks"),s(d1,"performWarningRuntimeChecks"),s(p1,"cloneEmptyGroups"),s(g1,"isCustomPattern"),s(f1,"isShortPattern");var m1={test:s((function(t){const e=t.length;for(let n=this.lastIndex;n Token Type\n\t Root cause: ${e.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===z1.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${t.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function x1(t){return wF(t,(t=>FU(t)?t.charCodeAt(0):t))}function b1(t,e,n){void 0===t[e]?t[e]=[n]:t[e].push(n)}s(y1,"checkLineBreaksIssues"),s(v1,"buildLineBreakIssueMessage"),s(x1,"getCharCodes"),s(b1,"addToMapOfArrays");var w1=256,k1=[];function T1(t){return t255?255+~~(t/255):t}}function E1(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx||!0===e.isParent&&!0===e.categoryMatchesMap[n]}function C1(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}s(T1,"charCodeToOptimizedIndex"),s(_1,"initCharCodeToOptimizedIndexMap"),s(E1,"tokenStructuredMatcher"),s(C1,"tokenStructuredMatcherNoCategories");var S1=1,A1={};function L1(t){const e=N1(t);I1(e),R1(e),M1(e),zB(e,(t=>{t.isParent=t.categoryMatches.length>0}))}function N1(t){let e=CB(t),n=t,r=!0;for(;r;){n=Xz(VF(wF(n,(t=>t.CATEGORIES))));const t=sU(n,e);e=e.concat(t),bA(t)?r=!1:n=t}return e}function I1(t){zB(t,(t=>{O1(t)||(A1[S1]=t,t.tokenTypeIdx=S1++),P1(t)&&!hb(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),P1(t)||(t.CATEGORIES=[]),B1(t)||(t.categoryMatches=[]),$1(t)||(t.categoryMatchesMap={})}))}function M1(t){zB(t,(t=>{t.categoryMatches=[],zB(t.categoryMatchesMap,((e,n)=>{t.categoryMatches.push(A1[n].tokenTypeIdx)}))}))}function R1(t){zB(t,(t=>{D1([],t)}))}function D1(t,e){zB(t,(t=>{e.categoryMatchesMap[t.tokenTypeIdx]=!0})),zB(e.CATEGORIES,(n=>{const r=t.concat(e);GU(r,n)||D1(r,n)}))}function O1(t){return BU(t,"tokenTypeIdx")}function P1(t){return BU(t,"CATEGORIES")}function B1(t){return BU(t,"categoryMatches")}function $1(t){return BU(t,"categoryMatchesMap")}function F1(t){return BU(t,"tokenTypeIdx")}s(L1,"augmentTokenTypes"),s(N1,"expandCategories"),s(I1,"assignTokenDefaultProps"),s(M1,"assignCategoriesTokensProp"),s(R1,"assignCategoriesMapProp"),s(D1,"singleAssignCategoriesToksMap"),s(O1,"hasShortKeyProperty"),s(P1,"hasCategoriesProperty"),s(B1,"hasExtendingTokensTypesProperty"),s($1,"hasExtendingTokensTypesMapProperty"),s(F1,"isTokenType");var z1,U1,G1={buildUnableToPopLexerModeMessage:t=>`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(t,e,n,r,i)=>`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`};(U1=z1||(z1={}))[U1.MISSING_PATTERN=0]="MISSING_PATTERN",U1[U1.INVALID_PATTERN=1]="INVALID_PATTERN",U1[U1.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",U1[U1.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",U1[U1.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",U1[U1.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",U1[U1.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",U1[U1.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",U1[U1.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",U1[U1.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",U1[U1.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",U1[U1.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",U1[U1.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",U1[U1.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",U1[U1.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",U1[U1.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",U1[U1.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",U1[U1.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";var q1={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:G1,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(q1);var j1=class{static{s(this,"Lexer")}constructor(t,e=q1){if(this.lexerDefinition=t,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=(t,e)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=e0(e),a=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return e()},"boolean"==typeof e)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=zz({},q1,e);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",(()=>{if(this.config.lineTerminatorsPattern===q1.lineTerminatorsPattern)this.config.lineTerminatorsPattern=m1;else if(this.config.lineTerminatorCharacters===q1.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(e.safeMode&&e.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),hb(t)?n={modes:{defaultMode:CB(t)},defaultMode:"defaultMode"}:(r=!1,n=CB(t))})),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(u1(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),this.TRACE_INIT("performWarningRuntimeChecks",(()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(d1(n,this.trackStartLines,this.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},zB(n.modes,((t,e)=>{n.modes[e]=PG(t,(t=>SF(t)))}));const i=EP(n.modes);if(zB(n.modes,((t,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,(()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(H0(t,i))})),bA(this.lexerDefinitionErrors)){let r;L1(t),this.TRACE_INIT("analyzeTokenTypes",(()=>{r=W0(t,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode,tracer:this.TRACE_INIT})})),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=zz({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}}))})),this.defaultMode=n.defaultMode,!bA(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const t=wF(this.lexerDefinitionErrors,(t=>t.message)),e=t.join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}zB(this.lexerDefinitionWarning,(t=>{t0(t.message)})),this.TRACE_INIT("Choosing sub-methods implementations",(()=>{if(Y0?(this.chopInput=mw,this.match=this.matchWithTest):(this.updateLastIndex=yz,this.match=this.matchWithExec),r&&(this.handleModes=yz),!1===this.trackStartLines&&(this.computeNewColumn=mw),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=yz),/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))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}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 t=rz(this.canModeBeOptimized,((t,e,n)=>(!1===e&&t.push(n),t)),[]);if(e.ensureOptimizations&&!bA(t))throw Error(`Lexer Modes: < ${t.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)})),this.TRACE_INIT("clearRegExpParserCache",(()=>{O0()})),this.TRACE_INIT("toFastProperties",(()=>{n0(this)}))}))}tokenize(t,e=this.defaultMode){if(!bA(this.lexerDefinitionErrors)){const t=wF(this.lexerDefinitionErrors,(t=>t.message)),e=t.join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(t,e)}tokenizeInternal(t,e){let n,r,i,a,o,l,c,h,u,d,p,g,f,m,y;const v=t,x=v.length;let b=0,w=0;const k=this.hasCustom?0:Math.floor(t.length/10),T=new Array(k),_=[];let E=this.trackStartLines?1:void 0,C=this.trackStartLines?1:void 0;const S=p1(this.emptyGroups),A=this.trackStartLines,L=this.config.lineTerminatorsPattern;let N=0,I=[],M=[];const R=[],D=[];let O;function P(){return I}function B(t){const e=T1(t),n=M[e];return void 0===n?D:n}Object.freeze(D),s(P,"getPossiblePatternsSlow"),s(B,"getPossiblePatternsOptimized");const $=s((t=>{if(1===R.length&&void 0===t.tokenType.PUSH_MODE){const e=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(t);_.push({offset:t.startOffset,line:t.startLine,column:t.startColumn,length:t.image.length,message:e})}else{R.pop();const t=MB(R);I=this.patternIdxToConfig[t],M=this.charCodeToPatternIdxToConfig[t],N=I.length;const e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;O=M&&e?B:P}}),"pop_mode");function F(t){R.push(t),M=this.charCodeToPatternIdxToConfig[t],I=this.patternIdxToConfig[t],N=I.length,N=I.length;const e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;O=M&&e?B:P}let z;s(F,"push_mode"),F.call(this,e);const U=this.config.recoveryEnabled;for(;bl.length){l=a,c=h,z=e;break}}}break}}if(null!==l){if(u=l.length,d=z.group,void 0!==d&&(p=z.tokenTypeIdx,g=this.createTokenInstance(l,b,p,z.tokenType,E,C,u),this.handlePayload(g,c),!1===d?w=this.addToken(T,w,g):S[d].push(g)),t=this.chopInput(t,u),b+=u,C=this.computeNewColumn(C,u),!0===A&&!0===z.canLineTerminator){let t,e,n=0;L.lastIndex=0;do{t=L.test(l),!0===t&&(e=L.lastIndex-1,n++)}while(!0===t);0!==n&&(E+=n,C=u-e,this.updateTokenEndLineColumnLocation(g,d,e,n,E,C,u))}this.handleModes(z,$,F,g)}else{const e=b,n=E,i=C;let a=!1===U;for(;!1===a&&b`Expecting ${W1(t)?`--\x3e ${Y1(t)} <--`:`token of type --\x3e ${t.name} <--`} but found --\x3e '${e.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:t,ruleName:e})=>"Redundant input, expecting EOF but found: "+t.image,buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const a="Expecting: ",s="\nbut found: '"+TU(e).image+"'";if(r)return a+r+s;{const e=rz(t,((t,e)=>t.concat(e)),[]),n=wF(e,(t=>`[${wF(t,(t=>Y1(t))).join(", ")}]`));return a+`one of these possible Token sequences:\n${wF(n,((t,e)=>` ${e+1}. ${t}`)).join("\n")}`+s}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a="\nbut found: '"+TU(e).image+"'";if(n)return i+n+a;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${wF(t,(t=>`[${wF(t,(t=>Y1(t))).join(",")}]`)).join(" ,")}>`+a}};Object.freeze(Q1);var J1={buildRuleNotFoundError:(t,e)=>"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+"<-\ninside top level rule: ->"+t.name+"<-"},t2={buildDuplicateFoundError(t,e){function n(t){return t instanceof f0?t.terminalType.name:t instanceof s0?t.nonTerminalName:""}s(n,"getExtraProductionArgument");const r=t.name,i=TU(e),a=i.idx,o=k0(i),l=n(i);let c=`->${o}${a>0?a:""}<- ${l?`with argument: ->${l}<-`:""}\n appears more than once (${e.length} times) in the top level rule: ->${r}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,"\n"),c},buildNamespaceConflictError:t=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(t){const e=wF(t.prefixPath,(t=>Y1(t))).join(", "),n=0===t.alternation.idx?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(t){const e=wF(t.prefixPath,(t=>Y1(t))).join(", "),n=0===t.alternation.idx?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(t){let e=k0(t.repetition);0!==t.repetition.idx&&(e+=t.repetition.idx);return`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:t=>"deprecated",buildEmptyAlternationError:t=>`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:t=>`An Alternation cannot have more than 256 alternatives:\n inside <${t.topLevelRule.name}> Rule.\n has ${t.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(t){const e=t.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${e}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${e} --\x3e ${wF(t.leftRecursionPath,(t=>t.name)).concat([e]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:t=>"deprecated",buildDuplicateRuleNameError(t){let e;e=t.topLevelRule instanceof o0?t.topLevelRule.name:t.topLevelRule;return`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function e2(t,e){const n=new i2(t,e);return n.resolveRefs(),n.errors}s(e2,"resolveGrammar");var n2,r2,i2=class extends v0{static{s(this,"GastRefResolverVisitor")}constructor(t,e){super(),this.nameToTopRule=t,this.errMsgProvider=e,this.errors=[]}resolveRefs(){zB(EF(this.nameToTopRule),(t=>{this.currTopLevel=t,t.accept(this)}))}visitNonTerminal(t){const e=this.nameToTopRule[t.nonTerminalName];if(e)t.referencedRule=e;else{const e=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:e,type:W4.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}},a2=class extends T0{static{s(this,"AbstractNextPossibleTokensWalker")}constructor(t,e){super(),this.topProd=t,this.path=e,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=CB(this.path.ruleStack).reverse(),this.occurrenceStack=CB(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,e=[]){this.found||super.walk(t,e)}walkProdRef(t,e,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){const r=e.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,r)}}updateExpectedNext(){bA(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},s2=class extends a2{static{s(this,"NextAfterTokenWalker")}constructor(t,e){super(t,e),this.path=e,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,e,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){const t=e.concat(n),r=new l0({definition:t});this.possibleTokTypes=E0(r),this.found=!0}}},o2=class extends T0{static{s(this,"AbstractNextTerminalAfterProductionWalker")}constructor(t,e){super(),this.topRule=t,this.occurrence=e,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},l2=class extends o2{static{s(this,"NextTerminalAfterManyWalker")}walkMany(t,e,n){if(t.idx===this.occurrence){const t=TU(e.concat(n));this.result.isEndOfRule=void 0===t,t instanceof f0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkMany(t,e,n)}},c2=class extends o2{static{s(this,"NextTerminalAfterManySepWalker")}walkManySep(t,e,n){if(t.idx===this.occurrence){const t=TU(e.concat(n));this.result.isEndOfRule=void 0===t,t instanceof f0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkManySep(t,e,n)}},h2=class extends o2{static{s(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(t,e,n){if(t.idx===this.occurrence){const t=TU(e.concat(n));this.result.isEndOfRule=void 0===t,t instanceof f0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkAtLeastOne(t,e,n)}},u2=class extends o2{static{s(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(t,e,n){if(t.idx===this.occurrence){const t=TU(e.concat(n));this.result.isEndOfRule=void 0===t,t instanceof f0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkAtLeastOneSep(t,e,n)}};function d2(t,e,n=[]){n=CB(n);let r=[],i=0;function a(e){return e.concat(lU(t,i+1))}function o(t){const i=d2(a(t),e,n);return r.concat(i)}for(s(a,"remainingPathWith"),s(o,"getAlternativesForProd");n.length{!1===bA(t.definition)&&(r=o(t.definition))})),r;if(!(e instanceof f0))throw Error("non exhaustive match");n.push(e.terminalType)}}i++}return r.push({partialPath:n,suffixDef:lU(t,i)}),r}function p2(t,e,n,r){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,c=l-r-1,h=[],u=[];for(u.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!bA(u);){const t=u.pop();if(t===s){o&&MB(u).idx<=c&&u.pop();continue}const r=t.def,d=t.idx,p=t.ruleStack,g=t.occurrenceStack;if(bA(r))continue;const f=r[0];if(f===i){const t={idx:d,def:lU(r),ruleStack:hU(p),occurrenceStack:hU(g)};u.push(t)}else if(f instanceof f0)if(d=0;t--){const e={idx:d,def:f.definition[t].definition.concat(lU(r)),ruleStack:p,occurrenceStack:g};u.push(e),u.push(s)}else if(f instanceof l0)u.push({idx:d,def:f.definition.concat(lU(r)),ruleStack:p,occurrenceStack:g});else{if(!(f instanceof o0))throw Error("non exhaustive match");u.push(g2(f,d,p,g))}}return h}function g2(t,e,n,r){const i=CB(n);i.push(t.name);const a=CB(r);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}function f2(t){if(t instanceof c0||"Option"===t)return n2.OPTION;if(t instanceof d0||"Repetition"===t)return n2.REPETITION;if(t instanceof h0||"RepetitionMandatory"===t)return n2.REPETITION_MANDATORY;if(t instanceof u0||"RepetitionMandatoryWithSeparator"===t)return n2.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof p0||"RepetitionWithSeparator"===t)return n2.REPETITION_WITH_SEPARATOR;if(t instanceof g0||"Alternation"===t)return n2.ALTERNATION;throw Error("non exhaustive match")}function m2(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,a=f2(r);return a===n2.ALTERNATION?S2(e,n,i):A2(e,n,a,i)}function y2(t,e,n,r,i,a){const s=S2(t,e,n);return a(s,r,I2(s)?C1:E1,i)}function v2(t,e,n,r,i,a){const s=A2(t,e,i,n),o=I2(s)?C1:E1;return a(s[0],o,r)}function x2(t,e,n,r){const i=t.length,a=mU(t,(t=>mU(t,(t=>1===t.length))));if(e)return function(e){const r=wF(e,(t=>t.GATE));for(let e=0;eVF(t))),n=rz(e,((t,e,n)=>(zB(e,(e=>{BU(t,e.tokenTypeIdx)||(t[e.tokenTypeIdx]=n),zB(e.categoryMatches,(e=>{BU(t,e)||(t[e]=n)}))})),t)),{});return function(){const t=this.LA(1);return n[t.tokenTypeIdx]}}return function(){for(let e=0;e1===t.length)),i=t.length;if(r&&!n){const e=VF(t);if(1===e.length&&bA(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=rz(e,((t,e,n)=>(t[e.tokenTypeIdx]=!0,zB(e.categoryMatches,(e=>{t[e]=!0})),t)),[]);return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){t:for(let n=0;nd2([t],1))),r=T2(n.length),i=wF(n,(t=>{const e={};return zB(t,(t=>{const n=_2(t.partialPath);zB(n,(t=>{e[t]=!0}))})),e}));let a=n;for(let t=1;t<=e;t++){const n=a;a=T2(n.length);for(let s=0;s{const e=_2(t.partialPath);zB(e,(t=>{i[s][t]=!0}))}))}}}}return r}function S2(t,e,n,r){const i=new k2(t,n2.ALTERNATION,r);return e.accept(i),C2(i.result,n)}function A2(t,e,n,r){const i=new k2(t,n);e.accept(i);const a=i.result,s=new w2(e,t,n).startWalking();return C2([new l0({definition:a}),new l0({definition:s})],r)}function L2(t,e){t:for(let n=0;n{const r=e[n];return t===r||r.categoryMatchesMap[t.tokenTypeIdx]}))}function I2(t){return mU(t,(t=>mU(t,(t=>mU(t,(t=>bA(t.categoryMatches)))))))}function M2(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return wF(e,(t=>Object.assign({type:W4.CUSTOM_LOOKAHEAD_VALIDATION},t)))}function R2(t,e,n,r){const i=EU(t,(t=>D2(t,n))),a=K2(t,e,n),s=EU(t,(t=>W2(t,n))),o=EU(t,(e=>$2(e,t,r,n)));return i.concat(a,s,o)}function D2(t,e){const n=new B2;t.accept(n);const r=n.allProductions,i=MU(r,O2),a=aG(i,(t=>t.length>1));return wF(EF(a),(n=>{const r=TU(n),i=e.buildDuplicateFoundError(t,n),a=k0(r),s={message:i,type:W4.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:a,occurrence:r.idx},o=P2(r);return o&&(s.parameter=o),s}))}function O2(t){return`${k0(t)}_#_${t.idx}_#_${P2(t)}`}function P2(t){return t instanceof f0?t.terminalType.name:t instanceof s0?t.nonTerminalName:""}s(T2,"initializeArrayOfArrays"),s(_2,"pathToHashKeys"),s(E2,"isUniquePrefixHash"),s(C2,"lookAheadSequenceFromAlternatives"),s(S2,"getLookaheadPathsForOr"),s(A2,"getLookaheadPathsForOptionalProd"),s(L2,"containsPath"),s(N2,"isStrictPrefixOfPath"),s(I2,"areTokenCategoriesNotUsed"),s(M2,"validateLookahead"),s(R2,"validateGrammar"),s(D2,"validateDuplicateProductions"),s(O2,"identifyProductionForDuplicates"),s(P2,"getExtraProductionArgument");var B2=class extends v0{static{s(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(t){this.allProductions.push(t)}visitOption(t){this.allProductions.push(t)}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}visitAlternation(t){this.allProductions.push(t)}visitTerminal(t){this.allProductions.push(t)}};function $2(t,e,n,r){const i=[];if(rz(e,((e,n)=>n.name===t.name?e+1:e),0)>1){const e=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:e,type:W4.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function F2(t,e,n){const r=[];let i;return GU(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:W4.INVALID_RULE_OVERRIDE,ruleName:t})),r}function z2(t,e,n,r=[]){const i=[],a=U2(e.definition);if(bA(a))return[];{const e=t.name;GU(a,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:W4.LEFT_RECURSION,ruleName:e});const s=sU(a,r.concat([t])),o=EU(s,(e=>{const i=CB(r);return i.push(e),z2(t,e,n,i)}));return i.concat(o)}}function U2(t){let e=[];if(bA(t))return e;const n=TU(t);if(n instanceof s0)e.push(n.referencedRule);else if(n instanceof l0||n instanceof c0||n instanceof h0||n instanceof u0||n instanceof p0||n instanceof d0)e=e.concat(U2(n.definition));else if(n instanceof g0)e=VF(wF(n.definition,(t=>U2(t.definition))));else if(!(n instanceof f0))throw Error("non exhaustive match");const r=b0(n),i=t.length>1;if(r&&i){const n=lU(t);return e.concat(U2(n))}return e}s($2,"validateRuleDoesNotAlreadyExist"),s(F2,"validateRuleIsOverridden"),s(z2,"validateNoLeftRecursion"),s(U2,"getFirstNoneTerminal");var G2=class extends v0{static{s(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function q2(t,e){const n=new G2;t.accept(n);const r=n.alternations;return EU(r,(n=>{const r=hU(n.definition);return EU(r,((r,i)=>{const a=p2([r],[],E1,1);return bA(a)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:n,emptyChoiceIdx:i}),type:W4.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:n.idx,alternative:i+1}]:[]}))}))}function j2(t,e,n){const r=new G2;t.accept(r);let i=r.alternations;i=PG(i,(t=>!0===t.ignoreAmbiguities));return EU(i,(r=>{const i=r.idx,a=r.maxLookahead||e,s=S2(i,t,a,r),o=V2(s,r,t,n),l=X2(s,r,t,n);return o.concat(l)}))}s(q2,"validateEmptyOrAlternative"),s(j2,"validateAmbiguousAlternationAlternatives");var Y2=class extends v0{static{s(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}};function W2(t,e){const n=new G2;t.accept(n);const r=n.alternations;return EU(r,(n=>n.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:n}),type:W4.TOO_MANY_ALTS,ruleName:t.name,occurrence:n.idx}]:[]))}function H2(t,e,n){const r=[];return zB(t,(t=>{const i=new Y2;t.accept(i);const a=i.allProductions;zB(a,(i=>{const a=f2(i),s=i.maxLookahead||e,o=A2(i.idx,t,a,s)[0];if(bA(VF(o))){const e=n.buildEmptyRepetitionError({topLevelRule:t,repetition:i});r.push({message:e,type:W4.NO_NON_EMPTY_LOOKAHEAD,ruleName:t.name})}}))})),r}function V2(t,e,n,r){const i=[],a=rz(t,((n,r,a)=>(!0===e.definition[a].ignoreAmbiguities||zB(r,(r=>{const s=[a];zB(t,((t,n)=>{a!==n&&L2(t,r)&&!0!==e.definition[n].ignoreAmbiguities&&s.push(n)})),s.length>1&&!L2(i,r)&&(i.push(r),n.push({alts:s,path:r}))})),n)),[]);return wF(a,(t=>{const i=wF(t.alts,(t=>t+1));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:W4.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:t.alts}}))}function X2(t,e,n,r){const i=rz(t,((t,e,n)=>{const r=wF(e,(t=>({idx:n,path:t})));return t.concat(r)}),[]);return Xz(EU(i,(t=>{if(!0===e.definition[t.idx].ignoreAmbiguities)return[];const a=t.idx,s=t.path,o=yF(i,(t=>!0!==e.definition[t.idx].ignoreAmbiguities&&t.idx{const i=[t.idx+1,a+1],s=0===e.idx?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:W4.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:s,alternatives:i}}))})))}function K2(t,e,n){const r=[],i=wF(e,(t=>t.name));return zB(t,(t=>{const e=t.name;if(GU(i,e)){const i=n.buildNamespaceConflictError(t);r.push({message:i,type:W4.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:e})}})),r}function Z2(t){const e=NB(t,{errMsgProvider:J1}),n={};return zB(t.rules,(t=>{n[t.name]=t})),e2(n,e.errMsgProvider)}function Q2(t){return R2((t=NB(t,{errMsgProvider:t2})).rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}s(W2,"validateTooManyAlts"),s(H2,"validateSomeNonEmptyLookaheadPath"),s(V2,"checkAlternativesAmbiguities"),s(X2,"checkPrefixAlternativesAmbiguities"),s(K2,"checkTerminalAndNoneTerminalsNameSpace"),s(Z2,"resolveGrammar"),s(Q2,"validateGrammar");var J2=["MismatchedTokenException","NoViableAltException","EarlyExitException","NotAllInputParsedException"];function t4(t){return GU(J2,t.name)}Object.freeze(J2),s(t4,"isRecognitionException");var e4=class extends Error{static{s(this,"RecognitionException")}constructor(t,e){super(t),this.token=e,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},n4=class extends e4{static{s(this,"MismatchedTokenException")}constructor(t,e,n){super(t,e),this.previousToken=n,this.name="MismatchedTokenException"}},r4=class extends e4{static{s(this,"NoViableAltException")}constructor(t,e,n){super(t,e),this.previousToken=n,this.name="NoViableAltException"}},i4=class extends e4{static{s(this,"NotAllInputParsedException")}constructor(t,e){super(t,e),this.name="NotAllInputParsedException"}},a4=class extends e4{static{s(this,"EarlyExitException")}constructor(t,e,n){super(t,e),this.previousToken=n,this.name="EarlyExitException"}},s4={},o4=class extends Error{static{s(this,"InRuleRecoveryException")}constructor(t){super(t),this.name="InRuleRecoveryException"}},l4=class{static{s(this,"Recoverable")}initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=BU(t,"recoveryEnabled")?t.recoveryEnabled:V4.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=c4)}getTokenToInsert(t){const e=K1(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return e.isInsertedInRecovery=!0,e}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,e,n,r){const i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const c=this.LA(1);let h=this.LA(1);const u=s((()=>{const t=this.LA(0),e=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:t,ruleName:this.getCurrRuleFullName()}),n=new n4(e,c,this.LA(0));n.resyncedTokens=hU(o),this.SAVE_ERROR(n)}),"generateErrorMessage");for(;!l;){if(this.tokenMatcher(h,r))return void u();if(n.call(this))return u(),void t.apply(this,e);this.tokenMatcher(h,i)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o))}this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(t,e,n){return!1!==n&&(!this.tokenMatcher(this.LA(1),t)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,e))))}getFollowsForInRuleRecovery(t,e){const n=this.getCurrentGrammarPath(t,e);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(t,e){if(this.canRecoverWithSingleTokenInsertion(t,e)){return this.getTokenToInsert(t)}if(this.canRecoverWithSingleTokenDeletion(t)){const t=this.SKIP_TOKEN();return this.consumeToken(),t}throw new o4("sad sad panda")}canPerformInRuleRecovery(t,e){return this.canRecoverWithSingleTokenInsertion(t,e)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,e){if(!this.canTokenTypeBeInsertedInRecovery(t))return!1;if(bA(e))return!1;const n=this.LA(1);return void 0!==wU(e,(t=>this.tokenMatcher(n,t)))}canRecoverWithSingleTokenDeletion(t){if(!this.canTokenTypeBeDeletedInRecovery(t))return!1;return this.tokenMatcher(this.LA(2),t)}isInCurrentRuleReSyncSet(t){const e=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(e);return GU(n,t)}findReSyncTokenType(){const t=this.flattenFollowSet();let e=this.LA(1),n=2;for(;;){const r=wU(t,(t=>Z1(e,t)));if(void 0!==r)return r;e=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return s4;const t=this.getLastExplicitRuleShortName(),e=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:e,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const t=this.RULE_STACK,e=this.RULE_OCCURRENCE_STACK;return wF(t,((n,r)=>0===r?s4:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:e[r],inRule:this.shortRuleNameToFullName(t[r-1])}))}flattenFollowSet(){const t=wF(this.buildFullFollowKeyStack(),(t=>this.getFollowSetFromFollowKey(t)));return VF(t)}getFollowSetFromFollowKey(t){if(t===s4)return[X1];const e=t.ruleName+t.idxInCallingRule+"_~IN~_"+t.inRule;return this.resyncFollows[e]}addToResyncTokens(t,e){return this.tokenMatcher(t,X1)||e.push(t),e}reSyncTo(t){const e=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,t);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,e);return hU(e)}attemptInRepetitionRecovery(t,e,n,r,i,a,s){}getCurrentGrammarPath(t,e){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:CB(this.RULE_OCCURRENCE_STACK),lastTok:t,lastTokOccurrence:e}}getHumanReadableRuleStack(){return wF(this.RULE_STACK,(t=>this.shortRuleNameToFullName(t)))}};function c4(t,e,n,r,i,a,s){const o=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[o];if(void 0===l){const t=this.getCurrRuleFullName();l=new a(this.getGAstProductions()[t],i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,h=l.occurrence;const u=l.isEndOfRule;1===this.RULE_STACK.length&&u&&void 0===c&&(c=X1,h=1),void 0!==c&&void 0!==h&&this.shouldInRepetitionRecoveryBeTried(c,h,s)&&this.tryInRepetitionRecovery(t,e,n,c)}s(c4,"attemptInRepetitionRecovery");function h4(t,e,n){return n|e|t}s(h4,"getKeyForAutomaticLookahead");var u4=class{static{s(this,"LLkLookaheadStrategy")}constructor(t){var e;this.maxLookahead=null!==(e=null==t?void 0:t.maxLookahead)&&void 0!==e?e:V4.maxLookahead}validate(t){const e=this.validateNoLeftRecursion(t.rules);if(bA(e)){const n=this.validateEmptyOrAlternatives(t.rules),r=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...e,...n,...r,...i]}return e}validateNoLeftRecursion(t){return EU(t,(t=>z2(t,t,t2)))}validateEmptyOrAlternatives(t){return EU(t,(t=>q2(t,t2)))}validateAmbiguousAlternationAlternatives(t,e){return EU(t,(t=>j2(t,e,t2)))}validateSomeNonEmptyLookaheadPath(t,e){return H2(t,e,t2)}buildLookaheadForAlternation(t){return y2(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,x2)}buildLookaheadForOptional(t){return v2(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,f2(t.prodType),b2)}},d4=class{static{s(this,"LooksAhead")}initLooksAhead(t){this.dynamicTokensEnabled=BU(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:V4.dynamicTokensEnabled,this.maxLookahead=BU(t,"maxLookahead")?t.maxLookahead:V4.maxLookahead,this.lookaheadStrategy=BU(t,"lookaheadStrategy")?t.lookaheadStrategy:new u4({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(t){zB(t,(t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,(()=>{const{alternation:e,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:s}=g4(t);zB(e,(e=>{const n=0===e.idx?"":e.idx;this.TRACE_INIT(`${k0(e)}${n}`,(()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:e.idx,rule:t,maxLookahead:e.maxLookahead||this.maxLookahead,hasPredicates:e.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=h4(this.fullRuleNameToShort[t.name],256,e.idx);this.setLaFuncCache(r,n)}))})),zB(n,(e=>{this.computeLookaheadFunc(t,e.idx,768,"Repetition",e.maxLookahead,k0(e))})),zB(r,(e=>{this.computeLookaheadFunc(t,e.idx,512,"Option",e.maxLookahead,k0(e))})),zB(i,(e=>{this.computeLookaheadFunc(t,e.idx,1024,"RepetitionMandatory",e.maxLookahead,k0(e))})),zB(a,(e=>{this.computeLookaheadFunc(t,e.idx,1536,"RepetitionMandatoryWithSeparator",e.maxLookahead,k0(e))})),zB(s,(e=>{this.computeLookaheadFunc(t,e.idx,1280,"RepetitionWithSeparator",e.maxLookahead,k0(e))}))}))}))}computeLookaheadFunc(t,e,n,r,i,a){this.TRACE_INIT(`${a}${0===e?"":e}`,(()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:e,rule:t,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),s=h4(this.fullRuleNameToShort[t.name],n,e);this.setLaFuncCache(s,a)}))}getKeyForAutomaticLookahead(t,e){return h4(this.getLastExplicitRuleShortName(),t,e)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,e){this.lookAheadFuncsCache.set(t,e)}},p4=new class extends v0{static{s(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(t){this.dslMethods.option.push(t)}visitRepetitionWithSeparator(t){this.dslMethods.repetitionWithSeparator.push(t)}visitRepetitionMandatory(t){this.dslMethods.repetitionMandatory.push(t)}visitRepetitionMandatoryWithSeparator(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)}visitRepetition(t){this.dslMethods.repetition.push(t)}visitAlternation(t){this.dslMethods.alternation.push(t)}};function g4(t){p4.reset(),t.accept(p4);const e=p4.dslMethods;return p4.reset(),e}function f4(t,e){!0===isNaN(t.startOffset)?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsett.msg));throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${e.join("\n\n").replace(/\n/g,"\n\t")}`)}}),"validateVisitor")};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function _4(t,e,n){const r=s((function(){}),"derivedConstructor");w4(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return zB(e,(t=>{i[t]=k4})),r.prototype=i,r.prototype.constructor=r,r}function E4(t,e){return C4(t,e)}function C4(t,e){const n=yF(e,(e=>!1===Hy(t[e]))),r=wF(n,(e=>({msg:`Missing visitor method: <${e}> on ${t.constructor.name} CST Visitor.`,type:x4.MISSING_METHOD,methodName:e})));return Xz(r)}s(w4,"defineNameProp"),s(k4,"defaultVisit"),s(T4,"createBaseSemanticVisitorConstructor"),s(_4,"createBaseVisitorConstructorWithDefaults"),(b4=x4||(x4={}))[b4.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",b4[b4.MISSING_METHOD=1]="MISSING_METHOD",s(E4,"validateVisitor"),s(C4,"validateMissingCstMethods");var S4=class{static{s(this,"TreeBuilder")}initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=BU(t,"nodeLocationTracking")?t.nodeLocationTracking:V4.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=m4,this.setNodeLocationFromNode=m4,this.cstPostRule=yz,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=yz,this.setNodeLocationFromNode=yz,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=f4,this.setNodeLocationFromNode=f4,this.cstPostRule=yz,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=yz,this.setNodeLocationFromNode=yz,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${t.nodeLocationTracking}"`);this.setNodeLocationFromToken=yz,this.setNodeLocationFromNode=yz,this.cstPostRule=yz,this.setInitialNodeLocation=yz}else this.cstInvocationStateUpdate=yz,this.cstFinallyStateUpdate=yz,this.cstPostTerminal=yz,this.cstPostNonTerminal=yz,this.cstPostRule=yz}setInitialNodeLocationOnlyOffsetRecovery(t){t.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(t){const e=this.LA(1);t.location={startOffset:e.startOffset,startLine:e.startLine,startColumn:e.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(t){const e={name:t,children:Object.create(null)};this.setInitialNodeLocation(e),this.CST_STACK.push(e)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){const e=this.LA(0),n=t.location;n.startOffset<=e.startOffset==!0?(n.endOffset=e.endOffset,n.endLine=e.endLine,n.endColumn=e.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(t){const e=this.LA(0),n=t.location;n.startOffset<=e.startOffset==!0?n.endOffset=e.endOffset:n.startOffset=NaN}cstPostTerminal(t,e){const n=this.CST_STACK[this.CST_STACK.length-1];y4(n,e,t),this.setNodeLocationFromToken(n.location,e)}cstPostNonTerminal(t,e){const n=this.CST_STACK[this.CST_STACK.length-1];v4(n,e,t),this.setNodeLocationFromNode(n.location,t.location)}getBaseCstVisitorConstructor(){if(SF(this.baseCstVisitorConstructor)){const t=T4(this.className,EP(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(SF(this.baseCstVisitorWithDefaultsConstructor)){const t=_4(this.className,EP(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const t=this.RULE_STACK;return t[t.length-1]}getPreviousExplicitRuleShortName(){const t=this.RULE_STACK;return t[t.length-2]}getLastExplicitRuleOccurrenceIndex(){const t=this.RULE_OCCURRENCE_STACK;return t[t.length-1]}},A4=class{static{s(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(t){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Y4}LA(t){const e=this.currIdx+t;return e<0||this.tokVectorLength<=e?Y4:this.tokVector[e]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(t){this.currIdx=t}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},L4=class{static{s(this,"RecognizerApi")}ACTION(t){return t.call(this)}consume(t,e,n){return this.consumeInternal(e,t,n)}subrule(t,e,n){return this.subruleInternal(e,t,n)}option(t,e){return this.optionInternal(e,t)}or(t,e){return this.orInternal(e,t)}many(t,e){return this.manyInternal(t,e)}atLeastOne(t,e){return this.atLeastOneInternal(t,e)}CONSUME(t,e){return this.consumeInternal(t,0,e)}CONSUME1(t,e){return this.consumeInternal(t,1,e)}CONSUME2(t,e){return this.consumeInternal(t,2,e)}CONSUME3(t,e){return this.consumeInternal(t,3,e)}CONSUME4(t,e){return this.consumeInternal(t,4,e)}CONSUME5(t,e){return this.consumeInternal(t,5,e)}CONSUME6(t,e){return this.consumeInternal(t,6,e)}CONSUME7(t,e){return this.consumeInternal(t,7,e)}CONSUME8(t,e){return this.consumeInternal(t,8,e)}CONSUME9(t,e){return this.consumeInternal(t,9,e)}SUBRULE(t,e){return this.subruleInternal(t,0,e)}SUBRULE1(t,e){return this.subruleInternal(t,1,e)}SUBRULE2(t,e){return this.subruleInternal(t,2,e)}SUBRULE3(t,e){return this.subruleInternal(t,3,e)}SUBRULE4(t,e){return this.subruleInternal(t,4,e)}SUBRULE5(t,e){return this.subruleInternal(t,5,e)}SUBRULE6(t,e){return this.subruleInternal(t,6,e)}SUBRULE7(t,e){return this.subruleInternal(t,7,e)}SUBRULE8(t,e){return this.subruleInternal(t,8,e)}SUBRULE9(t,e){return this.subruleInternal(t,9,e)}OPTION(t){return this.optionInternal(t,0)}OPTION1(t){return this.optionInternal(t,1)}OPTION2(t){return this.optionInternal(t,2)}OPTION3(t){return this.optionInternal(t,3)}OPTION4(t){return this.optionInternal(t,4)}OPTION5(t){return this.optionInternal(t,5)}OPTION6(t){return this.optionInternal(t,6)}OPTION7(t){return this.optionInternal(t,7)}OPTION8(t){return this.optionInternal(t,8)}OPTION9(t){return this.optionInternal(t,9)}OR(t){return this.orInternal(t,0)}OR1(t){return this.orInternal(t,1)}OR2(t){return this.orInternal(t,2)}OR3(t){return this.orInternal(t,3)}OR4(t){return this.orInternal(t,4)}OR5(t){return this.orInternal(t,5)}OR6(t){return this.orInternal(t,6)}OR7(t){return this.orInternal(t,7)}OR8(t){return this.orInternal(t,8)}OR9(t){return this.orInternal(t,9)}MANY(t){this.manyInternal(0,t)}MANY1(t){this.manyInternal(1,t)}MANY2(t){this.manyInternal(2,t)}MANY3(t){this.manyInternal(3,t)}MANY4(t){this.manyInternal(4,t)}MANY5(t){this.manyInternal(5,t)}MANY6(t){this.manyInternal(6,t)}MANY7(t){this.manyInternal(7,t)}MANY8(t){this.manyInternal(8,t)}MANY9(t){this.manyInternal(9,t)}MANY_SEP(t){this.manySepFirstInternal(0,t)}MANY_SEP1(t){this.manySepFirstInternal(1,t)}MANY_SEP2(t){this.manySepFirstInternal(2,t)}MANY_SEP3(t){this.manySepFirstInternal(3,t)}MANY_SEP4(t){this.manySepFirstInternal(4,t)}MANY_SEP5(t){this.manySepFirstInternal(5,t)}MANY_SEP6(t){this.manySepFirstInternal(6,t)}MANY_SEP7(t){this.manySepFirstInternal(7,t)}MANY_SEP8(t){this.manySepFirstInternal(8,t)}MANY_SEP9(t){this.manySepFirstInternal(9,t)}AT_LEAST_ONE(t){this.atLeastOneInternal(0,t)}AT_LEAST_ONE1(t){return this.atLeastOneInternal(1,t)}AT_LEAST_ONE2(t){this.atLeastOneInternal(2,t)}AT_LEAST_ONE3(t){this.atLeastOneInternal(3,t)}AT_LEAST_ONE4(t){this.atLeastOneInternal(4,t)}AT_LEAST_ONE5(t){this.atLeastOneInternal(5,t)}AT_LEAST_ONE6(t){this.atLeastOneInternal(6,t)}AT_LEAST_ONE7(t){this.atLeastOneInternal(7,t)}AT_LEAST_ONE8(t){this.atLeastOneInternal(8,t)}AT_LEAST_ONE9(t){this.atLeastOneInternal(9,t)}AT_LEAST_ONE_SEP(t){this.atLeastOneSepFirstInternal(0,t)}AT_LEAST_ONE_SEP1(t){this.atLeastOneSepFirstInternal(1,t)}AT_LEAST_ONE_SEP2(t){this.atLeastOneSepFirstInternal(2,t)}AT_LEAST_ONE_SEP3(t){this.atLeastOneSepFirstInternal(3,t)}AT_LEAST_ONE_SEP4(t){this.atLeastOneSepFirstInternal(4,t)}AT_LEAST_ONE_SEP5(t){this.atLeastOneSepFirstInternal(5,t)}AT_LEAST_ONE_SEP6(t){this.atLeastOneSepFirstInternal(6,t)}AT_LEAST_ONE_SEP7(t){this.atLeastOneSepFirstInternal(7,t)}AT_LEAST_ONE_SEP8(t){this.atLeastOneSepFirstInternal(8,t)}AT_LEAST_ONE_SEP9(t){this.atLeastOneSepFirstInternal(9,t)}RULE(t,e,n=X4){if(GU(this.definedRulesNames,t)){const e={message:t2.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:W4.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(e)}this.definedRulesNames.push(t);const r=this.defineRule(t,e,n);return this[t]=r,r}OVERRIDE_RULE(t,e,n=X4){const r=F2(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(t,e,n);return this[t]=i,i}BACKTRACK(t,e){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return t.apply(this,e),!0}catch(t){if(t4(t))return!1;throw t}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return m0(EF(this.gastProductionsCache))}},N4=class{static{s(this,"RecognizerEngine")}initRecognizerEngine(t,e){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=C1,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},BU(e,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(hb(t)){if(bA(t))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof t[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(hb(t))this.tokensMap=rz(t,((t,e)=>(t[e.name]=e,t)),{});else if(BU(t,"modes")&&mU(VF(EF(t.modes)),F1)){const e=VF(EF(t.modes)),n=WG(e);this.tokensMap=rz(n,((t,e)=>(t[e.name]=e,t)),{})}else{if(!jy(t))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=CB(t)}this.tokensMap.EOF=X1;const n=BU(t,"modes")?VF(EF(t.modes)):EF(t),r=mU(n,(t=>bA(t.categoryMatches)));this.tokenMatcher=r?C1:E1,L1(EF(this.tokensMap))}defineRule(t,e,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${t}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=BU(n,"resyncEnabled")?n.resyncEnabled:X4.resyncEnabled,i=BU(n,"recoveryValueFunc")?n.recoveryValueFunc:X4.recoveryValueFunc,a=this.ruleShortNameIdx<<12;let o;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=t,this.fullRuleNameToShort[t]=a,o=!0===this.outputCst?s((function(...n){try{this.ruleInvocationStateUpdate(a,t,this.subruleIdx),e.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(t){return this.invokeRuleCatch(t,r,i)}finally{this.ruleFinallyStateUpdate()}}),"invokeRuleWithTry"):s((function(...n){try{return this.ruleInvocationStateUpdate(a,t,this.subruleIdx),e.apply(this,n)}catch(t){return this.invokeRuleCatch(t,r,i)}finally{this.ruleFinallyStateUpdate()}}),"invokeRuleWithTryCst");return Object.assign(o,{ruleName:t,originalGrammarAction:e})}invokeRuleCatch(t,e,n){const r=1===this.RULE_STACK.length,i=e&&!this.isBackTracking()&&this.recoveryEnabled;if(t4(t)){const e=t;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(e.resyncedTokens=this.reSyncTo(r),this.outputCst){const t=this.CST_STACK[this.CST_STACK.length-1];return t.recoveredNode=!0,t}return n(t)}if(this.outputCst){const t=this.CST_STACK[this.CST_STACK.length-1];t.recoveredNode=!0,e.partialCstResult=t}throw e}if(r)return this.moveToTerminatedState(),n(t);throw e}throw t}optionInternal(t,e){const n=this.getKeyForAutomaticLookahead(512,e);return this.optionInternalLogic(t,e,n)}optionInternalLogic(t,e,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=s((()=>e.call(this)&&t.call(this)),"lookAheadFunc")}}else r=t;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(t,e){const n=this.getKeyForAutomaticLookahead(1024,t);return this.atLeastOneInternalLogic(t,e,n)}atLeastOneInternalLogic(t,e,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=s((()=>t.call(this)&&e.call(this)),"lookAheadFunc")}}else r=e;if(!0!==i.call(this))throw this.raiseEarlyExitException(t,n2.REPETITION_MANDATORY,e.ERR_MSG);{let t=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===t;)t=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,e],i,1024,t,h2)}atLeastOneSepFirstInternal(t,e){const n=this.getKeyForAutomaticLookahead(1536,t);this.atLeastOneSepFirstInternalLogic(t,e,n)}atLeastOneSepFirstInternalLogic(t,e,n){const r=e.DEF,i=e.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(t,n2.REPETITION_MANDATORY_WITH_SEPARATOR,e.ERR_MSG);{r.call(this);const e=s((()=>this.tokenMatcher(this.LA(1),i)),"separatorLookAheadFunc");for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,e,r,u2],e,1536,t,u2)}}manyInternal(t,e){const n=this.getKeyForAutomaticLookahead(768,t);return this.manyInternalLogic(t,e,n)}manyInternalLogic(t,e,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=s((()=>t.call(this)&&e.call(this)),"lookaheadFunction")}}else r=e;let a=!0;for(;!0===i.call(this)&&!0===a;)a=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[t,e],i,768,t,l2,a)}manySepFirstInternal(t,e){const n=this.getKeyForAutomaticLookahead(1280,t);this.manySepFirstInternalLogic(t,e,n)}manySepFirstInternalLogic(t,e,n){const r=e.DEF,i=e.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const e=s((()=>this.tokenMatcher(this.LA(1),i)),"separatorLookAheadFunc");for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,e,r,c2],e,1280,t,c2)}}repetitionSepSecondInternal(t,e,n,r,i){for(;n();)this.CONSUME(e),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,e,n,r,i],n,1536,t,i)}doSingleRepetition(t){const e=this.getLexerPosition();t.call(this);return this.getLexerPosition()>e}orInternal(t,e){const n=this.getKeyForAutomaticLookahead(256,e),r=hb(t)?t:t.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i){return r[i].ALT.call(this)}this.raiseNoAltException(e,t.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const t=this.LA(1),e=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new i4(e,t))}}subruleInternal(t,e,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=e,r=t.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:t.ruleName),r}catch(e){throw this.subruleInternalError(e,n,t.ruleName)}}subruleInternalError(t,e,n){throw t4(t)&&void 0!==t.partialCstResult&&(this.cstPostNonTerminal(t.partialCstResult,void 0!==e&&void 0!==e.LABEL?e.LABEL:n),delete t.partialCstResult),t}consumeInternal(t,e,n){let r;try{const e=this.LA(1);!0===this.tokenMatcher(e,t)?(this.consumeToken(),r=e):this.consumeInternalError(t,e,n)}catch(n){r=this.consumeInternalRecovery(t,e,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:t.name,r),r}consumeInternalError(t,e,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:e,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n4(r,e,i))}consumeInternalRecovery(t,e,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(t,e);try{return this.tryInRuleRecovery(t,r)}catch(t){throw"InRuleRecoveryException"===t.name?n:t}}}saveRecogState(){const t=this.errors,e=CB(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:e,CST_STACK:this.CST_STACK}}reloadRecogState(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK}ruleInvocationStateUpdate(t,e,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(e)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[t]}shortRuleNameToFullName(t){return this.shortRuleNameToFull[t]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),X1)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},I4=class{static{s(this,"ErrorHandler")}initErrorHandler(t){this._errors=[],this.errorMessageProvider=BU(t,"errorMessageProvider")?t.errorMessageProvider:V4.errorMessageProvider}SAVE_ERROR(t){if(t4(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:CB(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return CB(this._errors)}set errors(t){this._errors=t}raiseEarlyExitException(t,e,n){const r=this.getCurrRuleFullName(),i=A2(t,this.getGAstProductions()[r],e,this.maxLookahead)[0],a=[];for(let t=1;t<=this.maxLookahead;t++)a.push(this.LA(t));const s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:a,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new a4(s,this.LA(1),this.LA(0)))}raiseNoAltException(t,e){const n=this.getCurrRuleFullName(),r=S2(t,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let t=1;t<=this.maxLookahead;t++)i.push(this.LA(t));const a=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:a,customUserDescription:e,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new r4(s,this.LA(1),a))}},M4=class{static{s(this,"ContentAssist")}initContentAssist(){}computeContentAssist(t,e){const n=this.gastProductionsCache[t];if(SF(n))throw Error(`Rule ->${t}<- does not exist in this grammar.`);return p2([n],e,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(t){const e=TU(t.ruleStack),n=this.getGAstProductions()[e];return new s2(n,t).startWalking()}},R4={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(R4);var D4=Math.pow(2,8)-1,O4=H1({name:"RECORDING_PHASE_TOKEN",pattern:j1.NA});L1([O4]);var P4=K1(O4,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(P4);var B4={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},$4=class{static{s(this,"GastRecorder")}initGastRecorder(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(()=>{for(let t=0;t<10;t++){const e=t>0?t:"";this[`CONSUME${e}`]=function(e,n){return this.consumeInternalRecord(e,t,n)},this[`SUBRULE${e}`]=function(e,n){return this.subruleInternalRecord(e,t,n)},this[`OPTION${e}`]=function(e){return this.optionInternalRecord(e,t)},this[`OR${e}`]=function(e){return this.orInternalRecord(e,t)},this[`MANY${e}`]=function(e){this.manyInternalRecord(t,e)},this[`MANY_SEP${e}`]=function(e){this.manySepFirstInternalRecord(t,e)},this[`AT_LEAST_ONE${e}`]=function(e){this.atLeastOneInternalRecord(t,e)},this[`AT_LEAST_ONE_SEP${e}`]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}}this.consume=function(t,e,n){return this.consumeInternalRecord(e,t,n)},this.subrule=function(t,e,n){return this.subruleInternalRecord(e,t,n)},this.option=function(t,e){return this.optionInternalRecord(e,t)},this.or=function(t,e){return this.orInternalRecord(e,t)},this.many=function(t,e){this.manyInternalRecord(t,e)},this.atLeastOne=function(t,e){this.atLeastOneInternalRecord(t,e)},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 t=this;for(let e=0;e<10;e++){const n=e>0?e:"";delete t[`CONSUME${n}`],delete t[`SUBRULE${n}`],delete t[`OPTION${n}`],delete t[`OR${n}`],delete t[`MANY${n}`],delete t[`MANY_SEP${n}`],delete t[`AT_LEAST_ONE${n}`],delete t[`AT_LEAST_ONE_SEP${n}`]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA}))}ACTION_RECORD(t){}BACKTRACK_RECORD(t,e){return()=>!0}LA_RECORD(t){return Y4}topLevelRuleRecord(t,e){try{const n=new o0({definition:[],name:t});return n.name=t,this.recordingProdStack.push(n),e.call(this),this.recordingProdStack.pop(),n}catch(t){if(!0!==t.KNOWN_RECORDER_ERROR)try{t.message=t.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(e){throw t}throw t}}optionInternalRecord(t,e){return F4.call(this,c0,t,e)}atLeastOneInternalRecord(t,e){F4.call(this,h0,e,t)}atLeastOneSepFirstInternalRecord(t,e){F4.call(this,u0,e,t,true)}manyInternalRecord(t,e){F4.call(this,d0,e,t)}manySepFirstInternalRecord(t,e){F4.call(this,p0,e,t,true)}orInternalRecord(t,e){return z4.call(this,t,e)}subruleInternalRecord(t,e,n){if(G4(e),!t||!1===BU(t,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=MB(this.recordingProdStack),i=t.ruleName,a=new s0({idx:e,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?B4:R4}consumeInternalRecord(t,e,n){if(G4(e),!O1(t)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=MB(this.recordingProdStack),i=new f0({idx:e,terminalType:t,label:null==n?void 0:n.LABEL});return r.definition.push(i),P4}};function F4(t,e,n,r=!1){G4(n);const i=MB(this.recordingProdStack),a=Hy(e)?e:e.DEF,s=new t({definition:[],idx:n});return r&&(s.separator=e.SEP),BU(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),R4}function z4(t,e){G4(e);const n=MB(this.recordingProdStack),r=!1===hb(t),i=!1===r?t:t.DEF,a=new g0({definition:[],idx:e,ignoreAmbiguities:r&&!0===t.IGNORE_AMBIGUITIES});BU(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=GG(i,(t=>Hy(t.GATE)));return a.hasPredicates=s,n.definition.push(a),zB(i,(t=>{const e=new l0({definition:[]});a.definition.push(e),BU(t,"IGNORE_AMBIGUITIES")?e.ignoreAmbiguities=t.IGNORE_AMBIGUITIES:BU(t,"GATE")&&(e.ignoreAmbiguities=!0),this.recordingProdStack.push(e),t.ALT.call(this),this.recordingProdStack.pop()})),R4}function U4(t){return 0===t?"":`${t}`}function G4(t){if(t<0||t>D4){const e=new Error(`Invalid DSL Method idx value: <${t}>\n\tIdx value must be a none negative value smaller than ${D4+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}s(F4,"recordProd"),s(z4,"recordOrProd"),s(U4,"getIdxSuffix"),s(G4,"assertMethodIdxIsValid");var q4=class{static{s(this,"PerformanceTracer")}initPerformanceTracer(t){if(BU(t,"traceInitPerf")){const e=t.traceInitPerf,n="number"==typeof e;this.traceInitMaxIdent=n?e:1/0,this.traceInitPerf=n?e>0:e}else this.traceInitMaxIdent=0,this.traceInitPerf=V4.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(t,e){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=e0(e),a=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return e()}};function j4(t,e){e.forEach((e=>{const n=e.prototype;Object.getOwnPropertyNames(n).forEach((r=>{if("constructor"===r)return;const i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(t.prototype,r,i):t.prototype[r]=e.prototype[r]}))}))}s(j4,"applyMixins");var Y4=K1(X1,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Y4);var W4,H4,V4=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Q1,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),X4=Object.freeze({recoveryValueFunc:s((()=>{}),"recoveryValueFunc"),resyncEnabled:!0});function K4(t){return function(){return t}}(H4=W4||(W4={}))[H4.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",H4[H4.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",H4[H4.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",H4[H4.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",H4[H4.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",H4[H4.LEFT_RECURSION=5]="LEFT_RECURSION",H4[H4.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",H4[H4.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",H4[H4.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",H4[H4.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",H4[H4.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",H4[H4.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",H4[H4.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",H4[H4.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION",s(K4,"EMPTY_ALT");var Z4=class t{static{s(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",(()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",(()=>{n0(this)})),this.TRACE_INIT("Grammar Recording",(()=>{try{this.enableRecording(),zB(this.definedRulesNames,(t=>{const e=this[t].originalGrammarAction;let n;this.TRACE_INIT(`${t} Rule`,(()=>{n=this.topLevelRuleRecord(t,e)})),this.gastProductionsCache[t]=n}))}finally{this.disableRecording()}}));let r=[];if(this.TRACE_INIT("Grammar Resolving",(()=>{r=Z2({rules:EF(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)})),this.TRACE_INIT("Grammar Validations",(()=>{if(bA(r)&&!1===this.skipValidations){const t=Q2({rules:EF(this.gastProductionsCache),tokenTypes:EF(this.tokensMap),errMsgProvider:t2,grammarName:n}),e=M2({lookaheadStrategy:this.lookaheadStrategy,rules:EF(this.gastProductionsCache),tokenTypes:EF(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(t,e)}})),bA(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",(()=>{const t=N0(EF(this.gastProductionsCache));this.resyncFollows=t})),this.TRACE_INIT("ComputeLookaheadFunctions",(()=>{var t,e;null===(e=(t=this.lookaheadStrategy).initialize)||void 0===e||e.call(t,{rules:EF(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(EF(this.gastProductionsCache))}))),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!bA(this.definitionErrors))throw e=wF(this.definitionErrors,(t=>t.message)),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)}))}constructor(t,e){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(e),n.initLexerAdapter(),n.initLooksAhead(e),n.initRecognizerEngine(t,e),n.initRecoverable(e),n.initTreeBuilder(e),n.initContentAssist(),n.initGastRecorder(e),n.initPerformanceTracer(e),BU(e,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=BU(e,"skipValidations")?e.skipValidations:V4.skipValidations}};Z4.DEFER_DEFINITION_ERRORS_HANDLING=!1,j4(Z4,[l4,d4,S4,A4,N4,L4,I4,M4,$4,q4]);var Q4=class extends Z4{static{s(this,"EmbeddedActionsParser")}constructor(t,e=V4){const n=CB(e);n.outputCst=!1,super(t,n)}};function J4(t,e,n){return`${t.name}_${e}_${n}`}s(J4,"buildATNKey");var t3=class{static{s(this,"AbstractTransition")}constructor(t){this.target=t}isEpsilon(){return!1}},e3=class extends t3{static{s(this,"AtomTransition")}constructor(t,e){super(t),this.tokenType=e}},n3=class extends t3{static{s(this,"EpsilonTransition")}constructor(t){super(t)}isEpsilon(){return!0}},r3=class extends t3{static{s(this,"RuleTransition")}constructor(t,e,n){super(t),this.rule=e,this.followState=n}isEpsilon(){return!0}};function i3(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};a3(e,t);const n=t.length;for(let r=0;rs3(t,e,n)));return v3(t,e,r,n,...i)}function d3(t,e,n){const r=E3(t,e,n,{type:1});y3(t,r);return m3(t,e,n,v3(t,e,r,n,p3(t,e,n)))}function p3(t,e,n){const r=yF(wF(n.definition,(n=>s3(t,e,n))),(t=>void 0!==t));return 1===r.length?r[0]:0===r.length?void 0:b3(t,r)}function g3(t,e,n,r,i){const a=r.left,s=r.right,o=E3(t,e,n,{type:11});y3(t,o);const l=E3(t,e,n,{type:12});return a.loopback=o,l.loopback=o,t.decisionMap[J4(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,_3(s,o),void 0===i?(_3(o,a),_3(o,l)):(_3(o,l),_3(o,i.left),_3(i.right,a)),{left:a,right:l}}function f3(t,e,n,r,i){const a=r.left,s=r.right,o=E3(t,e,n,{type:10});y3(t,o);const l=E3(t,e,n,{type:12}),c=E3(t,e,n,{type:9});return o.loopback=c,l.loopback=c,_3(o,a),_3(o,l),_3(s,c),void 0!==i?(_3(c,l),_3(c,i.left),_3(i.right,a)):_3(c,o),t.decisionMap[J4(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:l}}function m3(t,e,n,r){const i=r.left;return _3(i,r.right),t.decisionMap[J4(e,"Option",n.idx)]=i,r}function y3(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function v3(t,e,n,r,...i){const a=E3(t,e,r,{type:8,start:n});n.end=a;for(const t of i)void 0!==t?(_3(n,t.left),_3(t.right,a)):_3(n,a);const s={left:n,right:a};return t.decisionMap[J4(e,x3(r),r.idx)]=n,s}function x3(t){if(t instanceof g0)return"Alternation";if(t instanceof c0)return"Option";if(t instanceof d0)return"Repetition";if(t instanceof p0)return"RepetitionWithSeparator";if(t instanceof h0)return"RepetitionMandatory";if(t instanceof u0)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function b3(t,e){const n=e.length;for(let r=0;rt.alt))}get key(){let t="";for(const e in this.map)t+=e+":";return t}};function N3(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map((t=>t.stateNumber.toString())).join("_")}`}function I3(t,e){const n={};return r=>{const i=r.toString();let a=n[i];return void 0!==a||(a={atnStartState:t,decision:e,states:{}},n[i]=a),a}}s(N3,"getATNConfigKey"),s(I3,"createDFACache");var M3,R3,D3,O3,P3,B3,$3,F3,z3,U3,G3,q3,j3,Y3,W3,H3,V3,X3,K3,Z3,Q3,J3,t5,e5,n5,r5,i5,a5,s5,o5,l5,c5,h5,u5,d5,p5,g5,f5,m5,y5,v5,x5,b5,w5,k5,T5,_5,E5,C5,S5,A5,L5,N5,I5,M5,R5,D5,O5,P5,B5,$5,F5,z5,U5,G5,q5,j5,Y5,W5,H5,V5,X5,K5,Z5,Q5,J5,t6,e6,n6,r6,i6,a6,s6,o6,l6,c6,h6,u6,d6,p6,g6,f6,m6=class{static{s(this,"PredicateSet")}constructor(){this.predicates=[]}is(t){return t>=this.predicates.length||this.predicates[t]}set(t,e){this.predicates[t]=e}toString(){let t="";const e=this.predicates.length;for(let n=0;nconsole.log(t)}initialize(t){this.atn=i3(t.rules),this.dfas=b6(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){const{prodOccurrence:e,rule:n,hasPredicates:r,dynamicTokensEnabled:i}=t,a=this.dfas,s=this.logging,o=J4(n,"Alternation",e),l=this.atn.decisionMap[o].decision,c=wF(m2({maxLookahead:1,occurrence:e,prodType:"Alternation",rule:n}),(t=>wF(t,(t=>t[0]))));if(x6(c,!1)&&!i){const t=rz(c,((t,e,n)=>(zB(e,(e=>{e&&(t[e.tokenTypeIdx]=n,zB(e.categoryMatches,(e=>{t[e]=n})))})),t)),{});return r?function(e){var n;const r=this.LA(1),i=t[r.tokenTypeIdx];if(void 0!==e&&void 0!==i){const t=null===(n=e[i])||void 0===n?void 0:n.GATE;if(void 0!==t&&!1===t.call(this))return}return i}:function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return r?function(t){const e=new m6,n=void 0===t?0:t.length;for(let r=0;rwF(t,(t=>t[0]))));if(x6(c)&&c[0][0]&&!i){const t=c[0],e=VF(t);if(1===e.length&&bA(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=rz(e,((t,e)=>(void 0!==e&&(t[e.tokenTypeIdx]=!0,zB(e.categoryMatches,(e=>{t[e]=!0}))),t)),{});return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){const t=w6.call(this,a,l,y6,s);return"object"!=typeof t&&0===t}}};function x6(t,e=!0){const n=new Set;for(const r of t){const t=new Set;for(const i of r){if(void 0===i){if(e)break;return!1}const r=[i.tokenTypeIdx].concat(i.categoryMatches);for(const e of r)if(n.has(e)){if(!t.has(e))return!1}else n.add(e),t.add(e)}}return!0}function b6(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;rY1(t))).join(", "),n=0===t.production.idx?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${C6(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r}function C6(t){if(t instanceof s0)return"SUBRULE";if(t instanceof c0)return"OPTION";if(t instanceof g0)return"OR";if(t instanceof h0)return"AT_LEAST_ONE";if(t instanceof u0)return"AT_LEAST_ONE_SEP";if(t instanceof p0)return"MANY_SEP";if(t instanceof d0)return"MANY";if(t instanceof f0)return"CONSUME";throw Error("non exhaustive match")}function S6(t,e,n){const r=EU(e.configs.elements,(t=>t.state.transitions)),i=VG(r.filter((t=>t instanceof e3)).map((t=>t.tokenType)),(t=>t.tokenTypeIdx));return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function A6(t,e){return t.edges[e.tokenTypeIdx]}function L6(t,e,n){const r=new L3,i=[];for(const a of t.elements){if(!1===n.is(a.alt))continue;if(7===a.state.type){i.push(a);continue}const t=a.state.transitions.length;for(let n=0;n0&&!$6(a))for(const t of i)a.add(t);return a}function N6(t,e){if(t instanceof e3&&Z1(e,t.tokenType))return t.target}function I6(t,e){let n;for(const r of t.elements)if(!0===e.is(r.alt))if(void 0===n)n=r.alt;else if(n!==r.alt)return;return n}function M6(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function R6(t,e,n,r){return r=D6(t,r),e.edges[n.tokenTypeIdx]=r,r}function D6(t,e){if(e===A3)return e;const n=e.configs.key,r=t.states[n];return void 0!==r?r:(e.configs.finalize(),t.states[n]=e,e)}function O6(t){const e=new L3,n=t.transitions.length;for(let r=0;r0){const n=[...t.stack];P6({state:n.pop(),alt:t.alt,stack:n},e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i1)return!0;return!1}function q6(t){for(const e of Array.from(t.values()))if(1===Object.keys(e).length)return!0;return!1}s(x6,"isLL1Sequence"),s(b6,"initATNSimulator"),s(w6,"adaptivePredict"),s(k6,"performLookahead"),s(T6,"computeLookaheadTarget"),s(_6,"reportLookaheadAmbiguity"),s(E6,"buildAmbiguityError"),s(C6,"getProductionDslName"),s(S6,"buildAdaptivePredictError"),s(A6,"getExistingTargetState"),s(L6,"computeReachSet"),s(N6,"getReachableTarget"),s(I6,"getUniqueAlt"),s(M6,"newDFAState"),s(R6,"addDFAEdge"),s(D6,"addDFAState"),s(O6,"computeStartState"),s(P6,"closure"),s(B6,"getEpsilonTarget"),s($6,"hasConfigInRuleStopState"),s(F6,"allConfigsInRuleStopStates"),s(z6,"hasConflictTerminatingPrediction"),s(U6,"getConflictingAltSets"),s(G6,"hasConflictingAltSet"),s(q6,"hasStateAssociatedWithOneAlt"),function(t){function e(t){return"string"==typeof t}s(e,"is"),t.is=e}(M3||(M3={})),function(t){function e(t){return"string"==typeof t}s(e,"is"),t.is=e}(R3||(R3={})),function(t){function e(e){return"number"==typeof e&&t.MIN_VALUE<=e&&e<=t.MAX_VALUE}t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,s(e,"is"),t.is=e}(D3||(D3={})),function(t){function e(e){return"number"==typeof e&&t.MIN_VALUE<=e&&e<=t.MAX_VALUE}t.MIN_VALUE=0,t.MAX_VALUE=2147483647,s(e,"is"),t.is=e}(O3||(O3={})),function(t){function e(t,e){return t===Number.MAX_VALUE&&(t=O3.MAX_VALUE),e===Number.MAX_VALUE&&(e=O3.MAX_VALUE),{line:t,character:e}}function n(t){let e=t;return j6.objectLiteral(e)&&j6.uinteger(e.line)&&j6.uinteger(e.character)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(P3||(P3={})),function(t){function e(t,e,n,r){if(j6.uinteger(t)&&j6.uinteger(e)&&j6.uinteger(n)&&j6.uinteger(r))return{start:P3.create(t,e),end:P3.create(n,r)};if(P3.is(t)&&P3.is(e))return{start:t,end:e};throw new Error(`Range#create called with invalid arguments[${t}, ${e}, ${n}, ${r}]`)}function n(t){let e=t;return j6.objectLiteral(e)&&P3.is(e.start)&&P3.is(e.end)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(B3||(B3={})),function(t){function e(t,e){return{uri:t,range:e}}function n(t){let e=t;return j6.objectLiteral(e)&&B3.is(e.range)&&(j6.string(e.uri)||j6.undefined(e.uri))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}($3||($3={})),function(t){function e(t,e,n,r){return{targetUri:t,targetRange:e,targetSelectionRange:n,originSelectionRange:r}}function n(t){let e=t;return j6.objectLiteral(e)&&B3.is(e.targetRange)&&j6.string(e.targetUri)&&B3.is(e.targetSelectionRange)&&(B3.is(e.originSelectionRange)||j6.undefined(e.originSelectionRange))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(F3||(F3={})),function(t){function e(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}}function n(t){const e=t;return j6.objectLiteral(e)&&j6.numberRange(e.red,0,1)&&j6.numberRange(e.green,0,1)&&j6.numberRange(e.blue,0,1)&&j6.numberRange(e.alpha,0,1)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(z3||(z3={})),function(t){function e(t,e){return{range:t,color:e}}function n(t){const e=t;return j6.objectLiteral(e)&&B3.is(e.range)&&z3.is(e.color)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(U3||(U3={})),function(t){function e(t,e,n){return{label:t,textEdit:e,additionalTextEdits:n}}function n(t){const e=t;return j6.objectLiteral(e)&&j6.string(e.label)&&(j6.undefined(e.textEdit)||t5.is(e))&&(j6.undefined(e.additionalTextEdits)||j6.typedArray(e.additionalTextEdits,t5.is))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(G3||(G3={})),(j3=q3||(q3={})).Comment="comment",j3.Imports="imports",j3.Region="region",function(t){function e(t,e,n,r,i,a){const s={startLine:t,endLine:e};return j6.defined(n)&&(s.startCharacter=n),j6.defined(r)&&(s.endCharacter=r),j6.defined(i)&&(s.kind=i),j6.defined(a)&&(s.collapsedText=a),s}function n(t){const e=t;return j6.objectLiteral(e)&&j6.uinteger(e.startLine)&&j6.uinteger(e.startLine)&&(j6.undefined(e.startCharacter)||j6.uinteger(e.startCharacter))&&(j6.undefined(e.endCharacter)||j6.uinteger(e.endCharacter))&&(j6.undefined(e.kind)||j6.string(e.kind))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(Y3||(Y3={})),function(t){function e(t,e){return{location:t,message:e}}function n(t){let e=t;return j6.defined(e)&&$3.is(e.location)&&j6.string(e.message)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(W3||(W3={})),(V3=H3||(H3={})).Error=1,V3.Warning=2,V3.Information=3,V3.Hint=4,(K3=X3||(X3={})).Unnecessary=1,K3.Deprecated=2,function(t){function e(t){const e=t;return j6.objectLiteral(e)&&j6.string(e.href)}s(e,"is"),t.is=e}(Z3||(Z3={})),function(t){function e(t,e,n,r,i,a){let s={range:t,message:e};return j6.defined(n)&&(s.severity=n),j6.defined(r)&&(s.code=r),j6.defined(i)&&(s.source=i),j6.defined(a)&&(s.relatedInformation=a),s}function n(t){var e;let n=t;return j6.defined(n)&&B3.is(n.range)&&j6.string(n.message)&&(j6.number(n.severity)||j6.undefined(n.severity))&&(j6.integer(n.code)||j6.string(n.code)||j6.undefined(n.code))&&(j6.undefined(n.codeDescription)||j6.string(null===(e=n.codeDescription)||void 0===e?void 0:e.href))&&(j6.string(n.source)||j6.undefined(n.source))&&(j6.undefined(n.relatedInformation)||j6.typedArray(n.relatedInformation,W3.is))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(Q3||(Q3={})),function(t){function e(t,e,...n){let r={title:t,command:e};return j6.defined(n)&&n.length>0&&(r.arguments=n),r}function n(t){let e=t;return j6.defined(e)&&j6.string(e.title)&&j6.string(e.command)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(J3||(J3={})),function(t){function e(t,e){return{range:t,newText:e}}function n(t,e){return{range:{start:t,end:t},newText:e}}function r(t){return{range:t,newText:""}}function i(t){const e=t;return j6.objectLiteral(e)&&j6.string(e.newText)&&B3.is(e.range)}s(e,"replace"),t.replace=e,s(n,"insert"),t.insert=n,s(r,"del"),t.del=r,s(i,"is"),t.is=i}(t5||(t5={})),function(t){function e(t,e,n){const r={label:t};return void 0!==e&&(r.needsConfirmation=e),void 0!==n&&(r.description=n),r}function n(t){const e=t;return j6.objectLiteral(e)&&j6.string(e.label)&&(j6.boolean(e.needsConfirmation)||void 0===e.needsConfirmation)&&(j6.string(e.description)||void 0===e.description)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(e5||(e5={})),function(t){function e(t){const e=t;return j6.string(e)}s(e,"is"),t.is=e}(n5||(n5={})),function(t){function e(t,e,n){return{range:t,newText:e,annotationId:n}}function n(t,e,n){return{range:{start:t,end:t},newText:e,annotationId:n}}function r(t,e){return{range:t,newText:"",annotationId:e}}function i(t){const e=t;return t5.is(e)&&(e5.is(e.annotationId)||n5.is(e.annotationId))}s(e,"replace"),t.replace=e,s(n,"insert"),t.insert=n,s(r,"del"),t.del=r,s(i,"is"),t.is=i}(r5||(r5={})),function(t){function e(t,e){return{textDocument:t,edits:e}}function n(t){let e=t;return j6.defined(e)&&u5.is(e.textDocument)&&Array.isArray(e.edits)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(i5||(i5={})),function(t){function e(t,e,n){let r={kind:"create",uri:t};return void 0===e||void 0===e.overwrite&&void 0===e.ignoreIfExists||(r.options=e),void 0!==n&&(r.annotationId=n),r}function n(t){let e=t;return e&&"create"===e.kind&&j6.string(e.uri)&&(void 0===e.options||(void 0===e.options.overwrite||j6.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||j6.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||n5.is(e.annotationId))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(a5||(a5={})),function(t){function e(t,e,n,r){let i={kind:"rename",oldUri:t,newUri:e};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i}function n(t){let e=t;return e&&"rename"===e.kind&&j6.string(e.oldUri)&&j6.string(e.newUri)&&(void 0===e.options||(void 0===e.options.overwrite||j6.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||j6.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||n5.is(e.annotationId))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(s5||(s5={})),function(t){function e(t,e,n){let r={kind:"delete",uri:t};return void 0===e||void 0===e.recursive&&void 0===e.ignoreIfNotExists||(r.options=e),void 0!==n&&(r.annotationId=n),r}function n(t){let e=t;return e&&"delete"===e.kind&&j6.string(e.uri)&&(void 0===e.options||(void 0===e.options.recursive||j6.boolean(e.options.recursive))&&(void 0===e.options.ignoreIfNotExists||j6.boolean(e.options.ignoreIfNotExists)))&&(void 0===e.annotationId||n5.is(e.annotationId))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(o5||(o5={})),function(t){function e(t){let e=t;return e&&(void 0!==e.changes||void 0!==e.documentChanges)&&(void 0===e.documentChanges||e.documentChanges.every((t=>j6.string(t.kind)?a5.is(t)||s5.is(t)||o5.is(t):i5.is(t))))}s(e,"is"),t.is=e}(l5||(l5={})),function(t){function e(t){return{uri:t}}function n(t){let e=t;return j6.defined(e)&&j6.string(e.uri)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(c5||(c5={})),function(t){function e(t,e){return{uri:t,version:e}}function n(t){let e=t;return j6.defined(e)&&j6.string(e.uri)&&j6.integer(e.version)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(h5||(h5={})),function(t){function e(t,e){return{uri:t,version:e}}function n(t){let e=t;return j6.defined(e)&&j6.string(e.uri)&&(null===e.version||j6.integer(e.version))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(u5||(u5={})),function(t){function e(t,e,n,r){return{uri:t,languageId:e,version:n,text:r}}function n(t){let e=t;return j6.defined(e)&&j6.string(e.uri)&&j6.string(e.languageId)&&j6.integer(e.version)&&j6.string(e.text)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(d5||(d5={})),function(t){function e(e){const n=e;return n===t.PlainText||n===t.Markdown}t.PlainText="plaintext",t.Markdown="markdown",s(e,"is"),t.is=e}(p5||(p5={})),function(t){function e(t){const e=t;return j6.objectLiteral(t)&&p5.is(e.kind)&&j6.string(e.value)}s(e,"is"),t.is=e}(g5||(g5={})),(m5=f5||(f5={})).Text=1,m5.Method=2,m5.Function=3,m5.Constructor=4,m5.Field=5,m5.Variable=6,m5.Class=7,m5.Interface=8,m5.Module=9,m5.Property=10,m5.Unit=11,m5.Value=12,m5.Enum=13,m5.Keyword=14,m5.Snippet=15,m5.Color=16,m5.File=17,m5.Reference=18,m5.Folder=19,m5.EnumMember=20,m5.Constant=21,m5.Struct=22,m5.Event=23,m5.Operator=24,m5.TypeParameter=25,(v5=y5||(y5={})).PlainText=1,v5.Snippet=2,(x5||(x5={})).Deprecated=1,function(t){function e(t,e,n){return{newText:t,insert:e,replace:n}}function n(t){const e=t;return e&&j6.string(e.newText)&&B3.is(e.insert)&&B3.is(e.replace)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(b5||(b5={})),(k5=w5||(w5={})).asIs=1,k5.adjustIndentation=2,function(t){function e(t){const e=t;return e&&(j6.string(e.detail)||void 0===e.detail)&&(j6.string(e.description)||void 0===e.description)}s(e,"is"),t.is=e}(T5||(T5={})),function(t){function e(t){return{label:t}}s(e,"create"),t.create=e}(_5||(_5={})),function(t){function e(t,e){return{items:t||[],isIncomplete:!!e}}s(e,"create"),t.create=e}(E5||(E5={})),function(t){function e(t){return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(t){const e=t;return j6.string(e)||j6.objectLiteral(e)&&j6.string(e.language)&&j6.string(e.value)}s(e,"fromPlainText"),t.fromPlainText=e,s(n,"is"),t.is=n}(C5||(C5={})),function(t){function e(t){let e=t;return!!e&&j6.objectLiteral(e)&&(g5.is(e.contents)||C5.is(e.contents)||j6.typedArray(e.contents,C5.is))&&(void 0===t.range||B3.is(t.range))}s(e,"is"),t.is=e}(S5||(S5={})),function(t){function e(t,e){return e?{label:t,documentation:e}:{label:t}}s(e,"create"),t.create=e}(A5||(A5={})),function(t){function e(t,e,...n){let r={label:t};return j6.defined(e)&&(r.documentation=e),j6.defined(n)?r.parameters=n:r.parameters=[],r}s(e,"create"),t.create=e}(L5||(L5={})),(I5=N5||(N5={})).Text=1,I5.Read=2,I5.Write=3,function(t){function e(t,e){let n={range:t};return j6.number(e)&&(n.kind=e),n}s(e,"create"),t.create=e}(M5||(M5={})),(D5=R5||(R5={})).File=1,D5.Module=2,D5.Namespace=3,D5.Package=4,D5.Class=5,D5.Method=6,D5.Property=7,D5.Field=8,D5.Constructor=9,D5.Enum=10,D5.Interface=11,D5.Function=12,D5.Variable=13,D5.Constant=14,D5.String=15,D5.Number=16,D5.Boolean=17,D5.Array=18,D5.Object=19,D5.Key=20,D5.Null=21,D5.EnumMember=22,D5.Struct=23,D5.Event=24,D5.Operator=25,D5.TypeParameter=26,(O5||(O5={})).Deprecated=1,function(t){function e(t,e,n,r,i){let a={name:t,kind:e,location:{uri:r,range:n}};return i&&(a.containerName=i),a}s(e,"create"),t.create=e}(P5||(P5={})),function(t){function e(t,e,n,r){return void 0!==r?{name:t,kind:e,location:{uri:n,range:r}}:{name:t,kind:e,location:{uri:n}}}s(e,"create"),t.create=e}(B5||(B5={})),function(t){function e(t,e,n,r,i,a){let s={name:t,detail:e,kind:n,range:r,selectionRange:i};return void 0!==a&&(s.children=a),s}function n(t){let e=t;return e&&j6.string(e.name)&&j6.number(e.kind)&&B3.is(e.range)&&B3.is(e.selectionRange)&&(void 0===e.detail||j6.string(e.detail))&&(void 0===e.deprecated||j6.boolean(e.deprecated))&&(void 0===e.children||Array.isArray(e.children))&&(void 0===e.tags||Array.isArray(e.tags))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}($5||($5={})),(z5=F5||(F5={})).Empty="",z5.QuickFix="quickfix",z5.Refactor="refactor",z5.RefactorExtract="refactor.extract",z5.RefactorInline="refactor.inline",z5.RefactorRewrite="refactor.rewrite",z5.Source="source",z5.SourceOrganizeImports="source.organizeImports",z5.SourceFixAll="source.fixAll",(G5=U5||(U5={})).Invoked=1,G5.Automatic=2,function(t){function e(t,e,n){let r={diagnostics:t};return null!=e&&(r.only=e),null!=n&&(r.triggerKind=n),r}function n(t){let e=t;return j6.defined(e)&&j6.typedArray(e.diagnostics,Q3.is)&&(void 0===e.only||j6.typedArray(e.only,j6.string))&&(void 0===e.triggerKind||e.triggerKind===U5.Invoked||e.triggerKind===U5.Automatic)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(q5||(q5={})),function(t){function e(t,e,n){let r={title:t},i=!0;return"string"==typeof e?(i=!1,r.kind=e):J3.is(e)?r.command=e:r.edit=e,i&&void 0!==n&&(r.kind=n),r}function n(t){let e=t;return e&&j6.string(e.title)&&(void 0===e.diagnostics||j6.typedArray(e.diagnostics,Q3.is))&&(void 0===e.kind||j6.string(e.kind))&&(void 0!==e.edit||void 0!==e.command)&&(void 0===e.command||J3.is(e.command))&&(void 0===e.isPreferred||j6.boolean(e.isPreferred))&&(void 0===e.edit||l5.is(e.edit))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(j5||(j5={})),function(t){function e(t,e){let n={range:t};return j6.defined(e)&&(n.data=e),n}function n(t){let e=t;return j6.defined(e)&&B3.is(e.range)&&(j6.undefined(e.command)||J3.is(e.command))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(Y5||(Y5={})),function(t){function e(t,e){return{tabSize:t,insertSpaces:e}}function n(t){let e=t;return j6.defined(e)&&j6.uinteger(e.tabSize)&&j6.boolean(e.insertSpaces)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(W5||(W5={})),function(t){function e(t,e,n){return{range:t,target:e,data:n}}function n(t){let e=t;return j6.defined(e)&&B3.is(e.range)&&(j6.undefined(e.target)||j6.string(e.target))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(H5||(H5={})),function(t){function e(t,e){return{range:t,parent:e}}function n(e){let n=e;return j6.objectLiteral(n)&&B3.is(n.range)&&(void 0===n.parent||t.is(n.parent))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(V5||(V5={})),(K5=X5||(X5={})).namespace="namespace",K5.type="type",K5.class="class",K5.enum="enum",K5.interface="interface",K5.struct="struct",K5.typeParameter="typeParameter",K5.parameter="parameter",K5.variable="variable",K5.property="property",K5.enumMember="enumMember",K5.event="event",K5.function="function",K5.method="method",K5.macro="macro",K5.keyword="keyword",K5.modifier="modifier",K5.comment="comment",K5.string="string",K5.number="number",K5.regexp="regexp",K5.operator="operator",K5.decorator="decorator",(Q5=Z5||(Z5={})).declaration="declaration",Q5.definition="definition",Q5.readonly="readonly",Q5.static="static",Q5.deprecated="deprecated",Q5.abstract="abstract",Q5.async="async",Q5.modification="modification",Q5.documentation="documentation",Q5.defaultLibrary="defaultLibrary",function(t){function e(t){const e=t;return j6.objectLiteral(e)&&(void 0===e.resultId||"string"==typeof e.resultId)&&Array.isArray(e.data)&&(0===e.data.length||"number"==typeof e.data[0])}s(e,"is"),t.is=e}(J5||(J5={})),function(t){function e(t,e){return{range:t,text:e}}function n(t){const e=t;return null!=e&&B3.is(e.range)&&j6.string(e.text)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(t6||(t6={})),function(t){function e(t,e,n){return{range:t,variableName:e,caseSensitiveLookup:n}}function n(t){const e=t;return null!=e&&B3.is(e.range)&&j6.boolean(e.caseSensitiveLookup)&&(j6.string(e.variableName)||void 0===e.variableName)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(e6||(e6={})),function(t){function e(t,e){return{range:t,expression:e}}function n(t){const e=t;return null!=e&&B3.is(e.range)&&(j6.string(e.expression)||void 0===e.expression)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(n6||(n6={})),function(t){function e(t,e){return{frameId:t,stoppedLocation:e}}function n(t){const e=t;return j6.defined(e)&&B3.is(t.stoppedLocation)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(r6||(r6={})),function(t){function e(t){return 1===t||2===t}t.Type=1,t.Parameter=2,s(e,"is"),t.is=e}(i6||(i6={})),function(t){function e(t){return{value:t}}function n(t){const e=t;return j6.objectLiteral(e)&&(void 0===e.tooltip||j6.string(e.tooltip)||g5.is(e.tooltip))&&(void 0===e.location||$3.is(e.location))&&(void 0===e.command||J3.is(e.command))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(a6||(a6={})),function(t){function e(t,e,n){const r={position:t,label:e};return void 0!==n&&(r.kind=n),r}function n(t){const e=t;return j6.objectLiteral(e)&&P3.is(e.position)&&(j6.string(e.label)||j6.typedArray(e.label,a6.is))&&(void 0===e.kind||i6.is(e.kind))&&void 0===e.textEdits||j6.typedArray(e.textEdits,t5.is)&&(void 0===e.tooltip||j6.string(e.tooltip)||g5.is(e.tooltip))&&(void 0===e.paddingLeft||j6.boolean(e.paddingLeft))&&(void 0===e.paddingRight||j6.boolean(e.paddingRight))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(s6||(s6={})),function(t){function e(t){return{kind:"snippet",value:t}}s(e,"createSnippet"),t.createSnippet=e}(o6||(o6={})),function(t){function e(t,e,n,r){return{insertText:t,filterText:e,range:n,command:r}}s(e,"create"),t.create=e}(l6||(l6={})),function(t){function e(t){return{items:t}}s(e,"create"),t.create=e}(c6||(c6={})),(u6=h6||(h6={})).Invoked=0,u6.Automatic=1,function(t){function e(t,e){return{range:t,text:e}}s(e,"create"),t.create=e}(d6||(d6={})),function(t){function e(t,e){return{triggerKind:t,selectedCompletionInfo:e}}s(e,"create"),t.create=e}(p6||(p6={})),function(t){function e(t){const e=t;return j6.objectLiteral(e)&&R3.is(e.uri)&&j6.string(e.name)}s(e,"is"),t.is=e}(g6||(g6={})),function(t){function e(t,e,n,r){return new Y6(t,e,n,r)}function n(t){let e=t;return!!(j6.defined(e)&&j6.string(e.uri)&&(j6.undefined(e.languageId)||j6.string(e.languageId))&&j6.uinteger(e.lineCount)&&j6.func(e.getText)&&j6.func(e.positionAt)&&j6.func(e.offsetAt))}function r(t,e){let n=t.getText(),r=i(e,((t,e)=>{let n=t.range.start.line-e.range.start.line;return 0===n?t.range.start.character-e.range.start.character:n})),a=n.length;for(let e=r.length-1;e>=0;e--){let i=r[e],s=t.offsetAt(i.range.start),o=t.offsetAt(i.range.end);if(!(o<=a))throw new Error("Overlapping edit");n=n.substring(0,s)+i.newText+n.substring(o,n.length),a=s}return n}function i(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),a=t.slice(n);i(r,e),i(a,e);let s=0,o=0,l=0;for(;s0&&t.push(e.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let e=this.getLineOffsets(),n=0,r=e.length;if(0===r)return P3.create(0,t);for(;nt?r=i:n=i+1}let i=n-1;return P3.create(i,t-e[i])}offsetAt(t){let e=this.getLineOffsets();if(t.line>=e.length)return this._content.length;if(t.line<0)return 0;let n=e[t.line],r=t.line+1=0&&e.content.splice(n,1)}}construct(t){const e=this.current;"string"==typeof t.$type&&(this.current.astNode=t),t.$cstNode=e;const n=this.nodeStack.pop();0===(null==n?void 0:n.content.length)&&this.removeNode(n)}addHiddenTokens(t){for(const e of t){const t=new V6(e.startOffset,e.image.length,vK(e),e.tokenType,!0);t.root=this.rootNode,this.addHiddenToken(this.rootNode,t)}}addHiddenToken(t,e){const{offset:n,end:r}=e;for(let i=0;is&&r=0;t--){const e=this.content[t];if(!e.hidden)return e}return this.content[this.content.length-1]}},K6=class t extends Array{static{s(this,"CstNodeContainer")}constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,e,...n){return this.addParents(n),super.splice(t,e,...n)}addParents(t){for(const e of t)e.container=this.parent}},Z6=class extends X6{static{s(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(t){super(),this._text="",this._text=null!=t?t:""}},Q6=Symbol("Datatype");function J6(t){return t.$type===Q6}s(J6,"isDataTypeNode");var t7=s((t=>t.endsWith("​")?t:t+"​"),"withRuleSuffix"),e7=class{static{s(this,"AbstractLangiumParser")}constructor(t){this._unorderedGroups=new Map,this.lexer=t.parser.Lexer;const e=this.lexer.definition;this.wrapper=new o7(e,Object.assign(Object.assign({},t.parser.ParserConfig),{errorMessageProvider:t.parser.ParserErrorMessageProvider}))}alternatives(t,e){this.wrapper.wrapOr(t,e)}optional(t,e){this.wrapper.wrapOption(t,e)}many(t,e){this.wrapper.wrapMany(t,e)}atLeastOne(t,e){this.wrapper.wrapAtLeastOne(t,e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},n7=class extends e7{static{s(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(t){super(t),this.nodeBuilder=new W6,this.stack=[],this.assignmentMap=new Map,this.linker=t.references.Linker,this.converter=t.parser.ValueConverter,this.astReflection=t.shared.AstReflection}rule(t,e){const n=t.fragment?void 0:DJ(t)?Q6:FJ(t),r=this.wrapper.DEFINE_RULE(t7(t.name),this.startImplementation(n,e).bind(this));return t.entry&&(this.mainRule=r),r}parse(t){this.nodeBuilder.buildRootNode(t);const e=this.lexer.tokenize(t);this.wrapper.input=e.tokens;const n=this.mainRule.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(e.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:e.errors,parserErrors:this.wrapper.errors}}startImplementation(t,e){return n=>{if(!this.isRecording()){const e={$type:t};this.stack.push(e),t===Q6&&(e.value="")}let r;try{r=e(n)}catch(t){r=void 0}return this.isRecording()||void 0!==r||(r=this.construct()),r}}consume(t,e,n){const r=this.wrapper.wrapConsume(t,e);if(!this.isRecording()&&this.isValidToken(r)){const t=this.nodeBuilder.buildLeafNode(r,n),{assignment:e,isCrossRef:i}=this.getAssignment(n),a=this.current;if(e){const a=oQ(n)?r.image:this.converter.convert(r.image,t);this.assign(e.operator,e.feature,a,t,i)}else if(J6(a)){let e=r.image;oQ(n)||(e=this.converter.convert(e,t).toString()),a.value+=e}}}isValidToken(t){return!t.isInsertedInRecovery&&!isNaN(t.startOffset)&&"number"==typeof t.endOffset&&!isNaN(t.endOffset)}subrule(t,e,n,r){let i;this.isRecording()||(i=this.nodeBuilder.buildCompositeNode(n));const a=this.wrapper.wrapSubrule(t,e,r);!this.isRecording()&&i&&i.length>0&&this.performSubruleAssignment(a,n,i)}performSubruleAssignment(t,e,n){const{assignment:r,isCrossRef:i}=this.getAssignment(e);if(r)this.assign(r.operator,r.feature,t,n,i);else if(!r){const e=this.current;if(J6(e))e.value+=t.toString();else if("object"==typeof t&&t){const n=t.$type,r=this.assignWithoutOverride(t,e);n&&(r.$type=n);const i=r;this.stack.pop(),this.stack.push(i)}}}action(t,e){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&e.feature&&e.operator){n=this.construct(!1);const t=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(t)}const r={$type:t};this.stack.pop(),this.stack.push(r),e.feature&&e.operator&&this.assign(e.operator,e.feature,n,n.$cstNode,!1)}}construct(t=!0){if(this.isRecording())return;const e=this.current;return LQ(e),this.nodeBuilder.construct(e),t&&this.stack.pop(),J6(e)?this.converter.convert(e.value,e.$cstNode):(zQ(this.astReflection,e),e)}getAssignment(t){if(!this.assignmentMap.has(t)){const e=NQ(t,ZZ);this.assignmentMap.set(t,{assignment:e,isCrossRef:!!e&&eQ(e.terminal)})}return this.assignmentMap.get(t)}assign(t,e,n,r,i){const a=this.current;let s;switch(s=i&&"string"==typeof n?this.linker.buildReference(a,e,r,n):n,t){case"=":a[e]=s;break;case"?=":a[e]=!0;break;case"+=":Array.isArray(a[e])||(a[e]=[]),a[e].push(s)}}assignWithoutOverride(t,e){for(const[n,r]of Object.entries(e)){const e=t[n];void 0===e?t[n]=r:Array.isArray(e)&&Array.isArray(r)&&(r.push(...e),t[n]=r)}return t}get definitionErrors(){return this.wrapper.definitionErrors}},r7=class{static{s(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(t){return Q1.buildMismatchTokenMessage(t)}buildNotAllInputParsedMessage(t){return Q1.buildNotAllInputParsedMessage(t)}buildNoViableAltMessage(t){return Q1.buildNoViableAltMessage(t)}buildEarlyExitMessage(t){return Q1.buildEarlyExitMessage(t)}},i7=class extends r7{static{s(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:t,actual:e}){return`Expecting ${t.LABEL?"`"+t.LABEL+"`":t.name.endsWith(":KW")?`keyword '${t.name.substring(0,t.name.length-3)}'`:`token of type '${t.name}'`} but found \`${e.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:t}){return`Expecting end of file but found \`${t.image}\`.`}},a7=class extends e7{static{s(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(t){this.resetState();const e=this.lexer.tokenize(t);return this.tokens=e.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(t,e){const n=this.wrapper.DEFINE_RULE(t7(t.name),this.startImplementation(e).bind(this));return t.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(t){return e=>{const n=this.keepStackSize();try{t(e)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const t=this.elementStack.length;return this.stackSize=t,t}resetStackSize(t){this.removeUnexpectedElements(),this.stackSize=t}consume(t,e,n){this.wrapper.wrapConsume(t,e),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(t,e,n,r){this.before(n),this.wrapper.wrapSubrule(t,e,r),this.after(n)}before(t){this.isRecording()||this.elementStack.push(t)}after(t){if(!this.isRecording()){const e=this.elementStack.lastIndexOf(t);e>=0&&this.elementStack.splice(e)}}get currIdx(){return this.wrapper.currIdx}},s7={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new i7},o7=class extends Q4{static{s(this,"ChevrotainWrapper")}constructor(t,e){const n=e&&"maxLookahead"in e;super(t,Object.assign(Object.assign(Object.assign({},s7),{lookaheadStrategy:n?new u4({maxLookahead:e.maxLookahead}):new v6}),e))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(t,e){return this.RULE(t,e)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(t,e){return this.consume(t,e)}wrapSubrule(t,e,n){return this.subrule(t,e,{ARGS:[n]})}wrapOr(t,e){this.or(t,e)}wrapOption(t,e){this.option(t,e)}wrapMany(t,e){this.many(t,e)}wrapAtLeastOne(t,e){this.atLeastOne(t,e)}};function l7(t,e,n){return c7({parser:e,tokens:n,rules:new Map,ruleNames:new Map},t),e}function c7(t,e){const n=yJ(e,!1),r=hK(e.rules).filter(LZ).filter((t=>n.has(t)));for(const e of r){const n=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});n.rules.set(e.name,t.parser.rule(e,h7(n,e.definition)))}}function h7(t,e,n=!1){let r;if(oQ(e))r=b7(t,e);else if(HZ(e))r=u7(t,e);else if(ZZ(e))r=h7(t,e.terminal);else if(eQ(e))r=x7(t,e);else if(pQ(e))r=d7(t,e);else if(XZ(e))r=f7(t,e);else if(wQ(e))r=m7(t,e);else if(aQ(e))r=y7(t,e);else{if(!rQ(e))throw new PK(e.$cstNode,`Unexpected element type: ${e.$type}`);{const n=t.consume++;r=s((()=>t.parser.consume(n,X1,e)),"method")}}return w7(t,n?void 0:v7(e),r,e.cardinality)}function u7(t,e){const n=FJ(e);return()=>t.parser.action(n,e)}function d7(t,e){const n=e.rule.ref;if(LZ(n)){const r=t.subrule++,i=e.arguments.length>0?p7(n,e.arguments):()=>({});return a=>t.parser.subrule(r,k7(t,n),e,i(a))}if(FZ(n)){const r=t.consume++,i=_7(t,n.name);return()=>t.parser.consume(r,i,e)}if(!n)throw new PK(e.$cstNode,`Undefined rule type: ${e.$type}`);BK()}function p7(t,e){const n=e.map((t=>g7(t.value)));return e=>{const r={};for(let i=0;ie(t)||n(t)}if(oZ(t)){const e=g7(t.left),n=g7(t.right);return t=>e(t)&&n(t)}if(wZ(t)){const e=g7(t.value);return t=>!e(t)}if(SZ(t)){const e=t.parameter.ref.name;return t=>void 0!==t&&!0===t[e]}if(aZ(t)){const e=Boolean(t.true);return()=>e}BK()}function f7(t,e){if(1===e.elements.length)return h7(t,e.elements[0]);{const n=[];for(const r of e.elements){const e={ALT:h7(t,r,!0)},i=v7(r);i&&(e.GATE=g7(i)),n.push(e)}const r=t.or++;return e=>t.parser.alternatives(r,n.map((t=>{const n={ALT:s((()=>t.ALT(e)),"ALT")},r=t.GATE;return r&&(n.GATE=()=>r(e)),n})))}}function m7(t,e){if(1===e.elements.length)return h7(t,e.elements[0]);const n=[];for(const r of e.elements){const e={ALT:h7(t,r,!0)},i=v7(r);i&&(e.GATE=g7(i)),n.push(e)}const r=t.or++,i=s(((t,e)=>`uGroup_${t}_${e.getRuleStack().join("-")}`),"idFunc"),a=s((e=>t.parser.alternatives(r,n.map(((n,a)=>{const o={ALT:s((()=>!0),"ALT")},l=t.parser;o.ALT=()=>{if(n.ALT(e),!l.isRecording()){const t=i(r,l);l.unorderedGroups.get(t)||l.unorderedGroups.set(t,[]);const e=l.unorderedGroups.get(t);void 0===(null==e?void 0:e[a])&&(e[a]=!0)}};const c=n.GATE;return o.GATE=c?()=>c(e):()=>{const t=l.unorderedGroups.get(i(r,l));return!(null==t?void 0:t[a])},o})))),"alternatives"),o=w7(t,v7(e),a,"*");return e=>{o(e),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function y7(t,e){const n=e.elements.map((e=>h7(t,e)));return t=>n.forEach((e=>e(t)))}function v7(t){if(aQ(t))return t.guardCondition}function x7(t,e,n=e.terminal){if(n){if(pQ(n)&&LZ(n.rule.ref)){const r=t.subrule++;return i=>t.parser.subrule(r,k7(t,n.rule.ref),e,i)}if(pQ(n)&&FZ(n.rule.ref)){const r=t.consume++,i=_7(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}if(oQ(n)){const r=t.consume++,i=_7(t,n.value);return()=>t.parser.consume(r,i,e)}throw new Error("Could not build cross reference parser")}{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=AJ(e.type.ref),r=null==n?void 0:n.terminal;if(!r)throw new Error("Could not find name assignment for type: "+FJ(e.type.ref));return x7(t,e,r)}}function b7(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function w7(t,e,n,r){const i=e&&g7(e);if(!r){if(i){const e=t.or++;return r=>t.parser.alternatives(e,[{ALT:s((()=>n(r)),"ALT"),GATE:s((()=>i(r)),"GATE")},{ALT:K4(),GATE:s((()=>!i(r)),"GATE")}])}return n}if("*"===r){const e=t.many++;return r=>t.parser.many(e,{DEF:s((()=>n(r)),"DEF"),GATE:i?()=>i(r):void 0})}if("+"===r){const e=t.many++;if(i){const r=t.or++;return a=>t.parser.alternatives(r,[{ALT:s((()=>t.parser.atLeastOne(e,{DEF:s((()=>n(a)),"DEF")})),"ALT"),GATE:s((()=>i(a)),"GATE")},{ALT:K4(),GATE:s((()=>!i(a)),"GATE")}])}return r=>t.parser.atLeastOne(e,{DEF:s((()=>n(r)),"DEF")})}if("?"===r){const e=t.optional++;return r=>t.parser.optional(e,{DEF:s((()=>n(r)),"DEF"),GATE:i?()=>i(r):void 0})}BK()}function k7(t,e){const n=T7(t,e),r=t.rules.get(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function T7(t,e){if(LZ(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!LZ(r);){if(aQ(r)||XZ(r)||wQ(r)){i=r.elements.indexOf(n).toString()+":"+i}n=r,r=r.$container}return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function _7(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function E7(t){const e=t.Grammar,n=t.parser.Lexer,r=new a7(t);return l7(e,r,n.definition),r.finalize(),r}function C7(t){const e=S7(t);return e.finalize(),e}function S7(t){const e=t.Grammar,n=t.parser.Lexer;return l7(e,new n7(t),n.definition)}s(l7,"createParser"),s(c7,"buildRules"),s(h7,"buildElement"),s(u7,"buildAction"),s(d7,"buildRuleCall"),s(p7,"buildRuleCallPredicate"),s(g7,"buildPredicate"),s(f7,"buildAlternatives"),s(m7,"buildUnorderedGroup"),s(y7,"buildGroup"),s(v7,"getGuardCondition"),s(x7,"buildCrossReference"),s(b7,"buildKeyword"),s(w7,"wrap"),s(k7,"getRule"),s(T7,"getRuleName"),s(_7,"getToken"),s(E7,"createCompletionParser"),s(C7,"createLangiumParser"),s(S7,"prepareLangiumParser");var A7,L7=class{static{s(this,"DefaultTokenBuilder")}buildTokens(t,e){const n=hK(yJ(t,!1)),r=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,r,e);return r.forEach((t=>{const e=t.PATTERN;"object"==typeof e&&e&&"test"in e&&hJ(e)?i.unshift(t):i.push(t)})),i}buildTerminalTokens(t){return t.filter(FZ).filter((t=>!t.fragment)).map((t=>this.buildTerminalToken(t))).toArray()}buildTerminalToken(t){const e=GJ(t),n=this.requiresCustomPattern(e)?this.regexPatternFunction(e):e,r={name:t.name,PATTERN:n,LINE_BREAKS:!0};return t.hidden&&(r.GROUP=hJ(e)?j1.SKIPPED:"hidden"),r}requiresCustomPattern(t){return!!t.flags.includes("u")||!(!t.source.includes("?<=")&&!t.source.includes("?{e.lastIndex=n;return e.exec(t)}}buildKeywordTokens(t,e,n){return t.filter(LZ).flatMap((t=>OQ(t).filter(oQ))).distinct((t=>t.value)).toArray().sort(((t,e)=>e.value.length-t.value.length)).map((t=>this.buildKeywordToken(t,e,Boolean(null==n?void 0:n.caseInsensitive))))}buildKeywordToken(t,e,n){return{name:t.value,PATTERN:this.buildKeywordPattern(t,n),LONGER_ALT:this.findLongerAlt(t,e)}}buildKeywordPattern(t,e){return e?new RegExp(dJ(t.value)):t.value}findLongerAlt(t,e){return e.reduce(((e,n)=>{const r=null==n?void 0:n.PATTERN;return(null==r?void 0:r.source)&&pJ("^"+r.source+"$",t.value)&&e.push(n),e}),[])}},N7=class{static{s(this,"DefaultValueConverter")}convert(t,e){let n=e.grammarSource;if(eQ(n)&&(n=xJ(n)),pQ(n)){const r=n.rule.ref;if(!r)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(r,t,e)}return t}runConverter(t,e,n){var r;switch(t.name.toUpperCase()){case"INT":return A7.convertInt(e);case"STRING":return A7.convertString(e);case"ID":return A7.convertID(e)}switch(null===(r=UJ(t))||void 0===r?void 0:r.toLowerCase()){case"number":return A7.convertNumber(e);case"boolean":return A7.convertBoolean(e);case"bigint":return A7.convertBigint(e);case"date":return A7.convertDate(e);default:return e}}};!function(t){function e(t){let e="";for(let r=1;r{"undefined"==typeof setImmediate?setTimeout(t,0):setImmediate(t)}))}u(I7,d(VX(),1)),s(M7,"delayNextTick");var R7=0,D7=10;function O7(){return R7=Date.now(),new I7.CancellationTokenSource}function P7(t){D7=t}s(O7,"startCancelableOperation"),s(P7,"setInterruptionPeriod");var B7=Symbol("OperationCancelled");function $7(t){return t===B7}async function F7(t){if(t===I7.CancellationToken.None)return;const e=Date.now();if(e-R7>=D7&&(R7=e,await M7()),t.isCancellationRequested)throw B7}s($7,"isOperationCancelled"),s(F7,"interruptAndCheck");var z7,U7,G7=class{static{s(this,"Deferred")}constructor(){this.promise=new Promise(((t,e)=>{this.resolve=e=>(t(e),this),this.reject=t=>(e(t),this)}))}},q7=class t{static{s(this,"FullTextDocument")}constructor(t,e,n,r){this._uri=t,this._languageId=e,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const e=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(e,n)}return this._content}update(e,n){for(const n of e)if(t.isIncremental(n)){const t=H7(n.range),e=this.offsetAt(t.start),r=this.offsetAt(t.end);this._content=this._content.substring(0,e)+n.text+this._content.substring(r,this._content.length);const i=Math.max(t.start.line,0),a=Math.max(t.end.line,0);let s=this._lineOffsets;const o=Y7(n.text,!1,e);if(a-i===o.length)for(let t=0,e=o.length;tt?r=i:n=i+1}const i=n-1;return{line:i,character:(t=this.ensureBeforeEOL(t,e[i]))-e[i]}}offsetAt(t){const e=this.getLineOffsets();if(t.line>=e.length)return this._content.length;if(t.line<0)return 0;const n=e[t.line];if(t.character<=0)return n;const r=t.line+1e&&W7(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const e=t;return null!=e&&"string"==typeof e.text&&void 0!==e.range&&(void 0===e.rangeLength||"number"==typeof e.rangeLength)}static isFull(t){const e=t;return null!=e&&"string"==typeof e.text&&void 0===e.range&&void 0===e.rangeLength}};function j7(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);j7(r,e),j7(i,e);let a=0,s=0,o=0;for(;an.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function V7(t){const e=H7(t.range);return e!==t.range?{newText:t.newText,range:e}:t}!function(t){function e(t,e,n,r){return new q7(t,e,n,r)}function n(t,e,n){if(t instanceof q7)return t.update(e,n),t;throw new Error("TextDocument.update: document must be created by TextDocument.create")}function r(t,e){const n=t.getText(),r=j7(e.map(V7),((t,e)=>{const n=t.range.start.line-e.range.start.line;return 0===n?t.range.start.character-e.range.start.character:n}));let i=0;const a=[];for(const e of r){const r=t.offsetAt(e.range.start);if(ri&&a.push(n.substring(i,r)),e.newText.length&&a.push(e.newText),i=t.offsetAt(e.range.end)}return a.push(n.substr(i)),a.join("")}s(e,"create"),t.create=e,s(n,"update"),t.update=n,s(r,"applyEdits"),t.applyEdits=r}(z7||(z7={})),s(j7,"mergeSort"),s(Y7,"computeLineOffsets"),s(W7,"isEOL"),s(H7,"getWellformedRange"),s(V7,"getWellformedEdit"),(()=>{var t={470:t=>{function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var n,r="",i=0,a=-1,s=0,o=0;o<=t.length;++o){if(o2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=o,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=o,s=0;continue}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(a+1,o):r=t.slice(a+1,o),i=o-a-1;a=o,s=0}else 46===n&&-1!==s?++s:s=-1}return r}s(e,"e"),s(n,"r");var r={resolve:s((function(){for(var t,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var s;a>=0?s=arguments[a]:(void 0===t&&(t=process.cwd()),s=t),e(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."}),"resolve"),normalize:s((function(t){if(e(t),0===t.length)return".";var r=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!r)).length||r||(t="."),t.length>0&&i&&(t+="/"),r?"/"+t:t}),"normalize"),isAbsolute:s((function(t){return e(t),t.length>0&&47===t.charCodeAt(0)}),"isAbsolute"),join:s((function(){if(0===arguments.length)return".";for(var t,n=0;n0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":r.normalize(t)}),"join"),relative:s((function(t,n){if(e(t),e(n),t===n)return"";if((t=r.resolve(t))===(n=r.resolve(n)))return"";for(var i=1;ic){if(47===n.charCodeAt(o+u))return n.slice(o+u+1);if(0===u)return n.slice(o+u)}else s>c&&(47===t.charCodeAt(i+u)?h=u:0===u&&(h=0));break}var d=t.charCodeAt(i+u);if(d!==n.charCodeAt(o+u))break;47===d&&(h=u)}var p="";for(u=i+h+1;u<=a;++u)u!==a&&47!==t.charCodeAt(u)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(o+h):(o+=h,47===n.charCodeAt(o)&&++o,n.slice(o))}),"relative"),_makeLong:s((function(t){return t}),"_makeLong"),dirname:s((function(t){if(e(t),0===t.length)return".";for(var n=t.charCodeAt(0),r=47===n,i=-1,a=!0,s=t.length-1;s>=1;--s)if(47===(n=t.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":t.slice(0,i)}),"dirname"),basename:s((function(t,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');e(t);var r,i=0,a=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var o=n.length-1,l=-1;for(r=t.length-1;r>=0;--r){var c=t.charCodeAt(r);if(47===c){if(!s){i=r+1;break}}else-1===l&&(s=!1,l=r+1),o>=0&&(c===n.charCodeAt(o)?-1==--o&&(a=r):(o=-1,a=l))}return i===a?a=l:-1===a&&(a=t.length),t.slice(i,a)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){i=r+1;break}}else-1===a&&(s=!1,a=r+1);return-1===a?"":t.slice(i,a)}),"basename"),extname:s((function(t){e(t);for(var n=-1,r=0,i=-1,a=!0,s=0,o=t.length-1;o>=0;--o){var l=t.charCodeAt(o);if(47!==l)-1===i&&(a=!1,i=o+1),46===l?-1===n?n=o:1!==s&&(s=1):-1!==n&&(s=-1);else if(!a){r=o+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":t.slice(n,i)}),"extname"),format:s((function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n=(e=t).dir||e.root,r=e.base||(e.name||"")+(e.ext||""),n?n===e.root?n+r:n+"/"+r:r;var e,n,r}),"format"),parse:s((function(t){e(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return n;var r,i=t.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var s=-1,o=0,l=-1,c=!0,h=t.length-1,u=0;h>=r;--h)if(47!==(i=t.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===i?-1===s?s=h:1!==u&&(u=1):-1!==s&&(u=-1);else if(!c){o=h+1;break}return-1===s||-1===l||0===u||1===u&&s===l-1&&s===o+1?-1!==l&&(n.base=n.name=0===o&&a?t.slice(1,l):t.slice(o,l)):(0===o&&a?(n.name=t.slice(1,s),n.base=t.slice(1,l)):(n.name=t.slice(o,s),n.base=t.slice(o,l)),n.ext=t.slice(s,l)),o>0?n.dir=t.slice(0,o-1):a&&(n.dir="/"),n}),"parse"),sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,t.exports=r}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}s(n,"r"),n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{let t;if(n.r(r),n.d(r,{URI:s((()=>u),"URI"),Utils:s((()=>E),"Utils")}),"object"==typeof process)t="win32"===process.platform;else if("object"==typeof navigator){let e=navigator.userAgent;t=e.indexOf("Windows")>=0}const e=/^\w[\w\d+.-]*$/,i=/^\//,a=/^\/\//;function o(t,n){if(!t.scheme&&n)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!e.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path)if(t.authority){if(!i.test(t.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(a.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}s(o,"s");const l="",c="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static{s(this,"f")}static isUri(t){return t instanceof u||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"string"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString}scheme;authority;path;query;fragment;constructor(t,e,n,r,i,a=!1){"object"==typeof t?(this.scheme=t.scheme||l,this.authority=t.authority||l,this.path=t.path||l,this.query=t.query||l,this.fragment=t.fragment||l):(this.scheme=function(t,e){return t||e?t:"file"}(t,a),this.authority=e||l,this.path=function(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==c&&(e=c+e):e=c}return e}(this.scheme,n||l),this.query=r||l,this.fragment=i||l,o(this,a))}get fsPath(){return y(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:n,path:r,query:i,fragment:a}=t;return void 0===e?e=this.scheme:null===e&&(e=l),void 0===n?n=this.authority:null===n&&(n=l),void 0===r?r=this.path:null===r&&(r=l),void 0===i?i=this.query:null===i&&(i=l),void 0===a?a=this.fragment:null===a&&(a=l),e===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new p(e,n,r,i,a)}static parse(t,e=!1){const n=h.exec(t);return n?new p(n[2]||l,w(n[4]||l),w(n[5]||l),w(n[7]||l),w(n[9]||l),e):new p(l,l,l,l,l)}static file(e){let n=l;if(t&&(e=e.replace(/\\/g,c)),e[0]===c&&e[1]===c){const t=e.indexOf(c,2);-1===t?(n=e.substring(2),e=c):(n=e.substring(2,t),e=e.substring(t)||c)}return new p("file",n,e,l,l)}static from(t){const e=new p(t.scheme,t.authority,t.path,t.query,t.fragment);return o(e,!0),e}toString(t=!1){return v(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof u)return t;{const e=new p(t);return e._formatted=t.external,e._fsPath=t._sep===d?t.fsPath:null,e}}return t}}const d=t?1:void 0;class p extends u{static{s(this,"l")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=y(this,!1)),this._fsPath}toString(t=!1){return t?v(this,!0):(this._formatted||(this._formatted=v(this,!1)),this._formatted)}toJSON(){const t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=d),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}}const g={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 f(t,e,n){let r,i=-1;for(let a=0;a=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||e&&47===s||n&&91===s||n&&93===s||n&&58===s)-1!==i&&(r+=encodeURIComponent(t.substring(i,a)),i=-1),void 0!==r&&(r+=t.charAt(a));else{void 0===r&&(r=t.substr(0,a));const e=g[s];void 0!==e?(-1!==i&&(r+=encodeURIComponent(t.substring(i,a)),i=-1),r+=e):-1===i&&(i=a)}}return-1!==i&&(r+=encodeURIComponent(t.substring(i))),void 0!==r?r:t}function m(t){let e;for(let n=0;n1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?n?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,t&&(r=r.replace(/\//g,"\\")),r}function v(t,e){const n=e?m:f;let r="",{scheme:i,authority:a,path:s,query:o,fragment:l}=t;if(i&&(r+=i,r+=":"),(a||"file"===i)&&(r+=c,r+=c),a){let t=a.indexOf("@");if(-1!==t){const e=a.substr(0,t);a=a.substr(t+1),t=e.lastIndexOf(":"),-1===t?r+=n(e,!1,!1):(r+=n(e.substr(0,t),!1,!1),r+=":",r+=n(e.substr(t+1),!1,!0)),r+="@"}a=a.toLowerCase(),t=a.lastIndexOf(":"),-1===t?r+=n(a,!1,!0):(r+=n(a.substr(0,t),!1,!0),r+=a.substr(t))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){const t=s.charCodeAt(1);t>=65&&t<=90&&(s=`/${String.fromCharCode(t+32)}:${s.substr(3)}`)}else if(s.length>=2&&58===s.charCodeAt(1)){const t=s.charCodeAt(0);t>=65&&t<=90&&(s=`${String.fromCharCode(t+32)}:${s.substr(2)}`)}r+=n(s,!0,!1)}return o&&(r+="?",r+=n(o,!1,!1)),l&&(r+="#",r+=e?l:f(l,!1,!1)),r}function x(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+x(t.substr(3)):t}}s(f,"d"),s(m,"p"),s(y,"m"),s(v,"y"),s(x,"v");const b=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function w(t){return t.match(b)?t.replace(b,(t=>x(t))):t}s(w,"C");var k=n(470);const T=k.posix||k,_="/";var E;!function(t){t.joinPath=function(t,...e){return t.with({path:T.join(t.path,...e)})},t.resolvePath=function(t,...e){let n=t.path,r=!1;n[0]!==_&&(n=_+n,r=!0);let i=T.resolve(n,...e);return r&&i[0]===_&&!t.authority&&(i=i.substring(1)),t.with({path:i})},t.dirname=function(t){if(0===t.path.length||t.path===_)return t;let e=T.dirname(t.path);return 1===e.length&&46===e.charCodeAt(0)&&(e=""),t.with({path:e})},t.basename=function(t){return T.basename(t.path)},t.extname=function(t){return T.extname(t.path)}}(E||(E={}))})(),U7=r})();var X7,K7,Z7,{URI:Q7,Utils:J7}=U7;!function(t){function e(t,e){return(null==t?void 0:t.toString())===(null==e?void 0:e.toString())}function n(t,e){const n="string"==typeof t?t:t.path,r="string"==typeof e?e:e.path,i=n.split("/").filter((t=>t.length>0)),a=r.split("/").filter((t=>t.length>0));let s=0;for(;snull!=r?r:r=z7.create(t.toString(),n.getServices(t).LanguageMetaData.languageId,0,null!=e?e:"")}},e8=class{static{s(this,"DefaultLangiumDocuments")}constructor(t){this.documentMap=new Map,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory}get all(){return hK(this.documentMap.values())}addDocument(t){const e=t.uri.toString();if(this.documentMap.has(e))throw new Error(`A document with the URI '${e}' is already present.`);this.documentMap.set(e,t)}getDocument(t){const e=t.toString();return this.documentMap.get(e)}async getOrCreateDocument(t,e){let n=this.getDocument(t);return n||(n=await this.langiumDocumentFactory.fromUri(t,e),this.addDocument(n),n)}createDocument(t,e,n){if(n)return this.langiumDocumentFactory.fromString(e,t,n).then((t=>(this.addDocument(t),t)));{const n=this.langiumDocumentFactory.fromString(e,t);return this.addDocument(n),n}}hasDocument(t){return this.documentMap.has(t.toString())}invalidateDocument(t){const e=t.toString(),n=this.documentMap.get(e);return n&&(n.state=K7.Changed,n.precomputedScopes=void 0,n.references=[],n.diagnostics=void 0),n}deleteDocument(t){const e=t.toString(),n=this.documentMap.get(e);return n&&(n.state=K7.Changed,this.documentMap.delete(e)),n}},n8=class{static{s(this,"DefaultLinker")}constructor(t){this.reflection=t.shared.AstReflection,this.langiumDocuments=()=>t.shared.workspace.LangiumDocuments,this.scopeProvider=t.references.ScopeProvider,this.astNodeLocator=t.workspace.AstNodeLocator}async link(t,e=I7.CancellationToken.None){for(const n of PQ(t.parseResult.value))await F7(e),$Q(n).forEach((e=>this.doLink(e,t)))}doLink(t,e){const n=t.reference;if(void 0===n._ref)try{const e=this.getCandidate(t);if(tK(e))n._ref=e;else if(n._nodeDescription=e,this.langiumDocuments().hasDocument(e.documentUri)){const r=this.loadAstNode(e);n._ref=null!=r?r:this.createLinkingError(t,e)}}catch(e){n._ref=Object.assign(Object.assign({},t),{message:`An error occurred while resolving reference to '${n.$refText}': ${e}`})}e.references.push(n)}unlink(t){for(const e of t.references)delete e._ref,delete e._nodeDescription;t.references=[]}getCandidate(t){const e=this.scopeProvider.getScope(t).getElement(t.reference.$refText);return null!=e?e:this.createLinkingError(t)}buildReference(t,e,n,r){const i=this,a={$refNode:n,$refText:r,get ref(){var n;if(ZX(this._ref))return this._ref;if(JX(this._nodeDescription)){const n=i.loadAstNode(this._nodeDescription);this._ref=null!=n?n:i.createLinkingError({reference:a,container:t,property:e},this._nodeDescription)}else if(void 0===this._ref){const r=i.getLinkedNode({reference:a,container:t,property:e});if(r.error&&MQ(t).state=t.end)return e.ref}if(n){const e=this.nameProvider.getNameNode(n);if(e&&(e===t||yK(t,e)))return n}}}findDeclarationNode(t){const e=this.findDeclaration(t);if(null==e?void 0:e.$cstNode){const t=this.nameProvider.getNameNode(e);return null!=t?t:e.$cstNode}}findReferences(t,e){const n=[];if(e.includeDeclaration){const e=this.getReferenceToSelf(t);e&&n.push(e)}let r=this.index.findAllReferences(t,this.nodeLocator.getAstNodePath(t));return e.documentUri&&(r=r.filter((t=>X7.equals(t.sourceUri,e.documentUri)))),n.push(...r),hK(n)}getReferenceToSelf(t){const e=this.nameProvider.getNameNode(t);if(e){const n=MQ(t),r=this.nodeLocator.getAstNodePath(t);return{sourceUri:n.uri,sourcePath:r,targetUri:n.uri,targetPath:r,segment:xK(e),local:!0}}}},s8=class{static{s(this,"MultiMap")}constructor(t){if(this.map=new Map,t)for(const[e,n]of t)this.add(e,n)}get size(){return uK.sum(hK(this.map.values()).map((t=>t.length)))}clear(){this.map.clear()}delete(t,e){if(void 0===e)return this.map.delete(t);{const n=this.map.get(t);if(n){const r=n.indexOf(e);if(r>=0)return 1===n.length?this.map.delete(t):n.splice(r,1),!0}return!1}}get(t){var e;return null!==(e=this.map.get(t))&&void 0!==e?e:[]}has(t,e){if(void 0===e)return this.map.has(t);{const n=this.map.get(t);return!!n&&n.indexOf(e)>=0}}add(t,e){return this.map.has(t)?this.map.get(t).push(e):this.map.set(t,[e]),this}addAll(t,e){return this.map.has(t)?this.map.get(t).push(...e):this.map.set(t,Array.from(e)),this}forEach(t){this.map.forEach(((e,n)=>e.forEach((e=>t(e,n,this)))))}[Symbol.iterator](){return this.entries().iterator()}entries(){return hK(this.map.entries()).flatMap((([t,e])=>e.map((e=>[t,e]))))}keys(){return hK(this.map.keys())}values(){return hK(this.map.values()).flat()}entriesGroupedByKey(){return hK(this.map.entries())}},o8=class{static{s(this,"BiMap")}get size(){return this.map.size}constructor(t){if(this.map=new Map,this.inverse=new Map,t)for(const[e,n]of t)this.set(e,n)}clear(){this.map.clear(),this.inverse.clear()}set(t,e){return this.map.set(t,e),this.inverse.set(e,t),this}get(t){return this.map.get(t)}getKey(t){return this.inverse.get(t)}delete(t){const e=this.map.get(t);return void 0!==e&&(this.map.delete(t),this.inverse.delete(e),!0)}},l8=class{static{s(this,"DefaultScopeComputation")}constructor(t){this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider}async computeExports(t,e=I7.CancellationToken.None){return this.computeExportsForNode(t.parseResult.value,t,void 0,e)}async computeExportsForNode(t,e,n=DQ,r=I7.CancellationToken.None){const i=[];this.exportNode(t,i,e);for(const a of n(t))await F7(r),this.exportNode(a,i,e);return i}exportNode(t,e,n){const r=this.nameProvider.getName(t);r&&e.push(this.descriptions.createDescription(t,r,n))}async computeLocalScopes(t,e=I7.CancellationToken.None){const n=t.parseResult.value,r=new s8;for(const i of OQ(n))await F7(e),this.processNode(i,t,r);return r}processNode(t,e,n){const r=t.$container;if(r){const i=this.nameProvider.getName(t);i&&n.add(r,this.descriptions.createDescription(t,i,e))}}},c8=class{static{s(this,"StreamScope")}constructor(t,e,n){var r;this.elements=t,this.outerScope=e,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(t){const e=this.caseInsensitive?this.elements.find((e=>e.name.toLowerCase()===t.toLowerCase())):this.elements.find((e=>e.name===t));return e||(this.outerScope?this.outerScope.getElement(t):void 0)}},h8=class{static{s(this,"MapScope")}constructor(t,e,n){var r;this.elements=new Map,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r;for(const e of t){const t=this.caseInsensitive?e.name.toLowerCase():e.name;this.elements.set(t,e)}this.outerScope=e}getElement(t){const e=this.caseInsensitive?t.toLowerCase():t,n=this.elements.get(e);return n||(this.outerScope?this.outerScope.getElement(t):void 0)}getAllElements(){let t=hK(this.elements.values());return this.outerScope&&(t=t.concat(this.outerScope.getAllElements())),t}},u8={getElement(){},getAllElements:()=>lK},d8=class{static{s(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(t){this.toDispose.push(t)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach((t=>t.dispose()))}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},p8=class extends d8{static{s(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(t){return this.throwIfDisposed(),this.cache.has(t)}set(t,e){this.throwIfDisposed(),this.cache.set(t,e)}get(t,e){if(this.throwIfDisposed(),this.cache.has(t))return this.cache.get(t);if(e){const n=e();return this.cache.set(t,n),n}}delete(t){return this.throwIfDisposed(),this.cache.delete(t)}clear(){this.throwIfDisposed(),this.cache.clear()}},g8=class extends d8{static{s(this,"ContextCache")}constructor(t){super(),this.cache=new Map,this.converter=null!=t?t:t=>t}has(t,e){return this.throwIfDisposed(),this.cacheForContext(t).has(e)}set(t,e,n){this.throwIfDisposed(),this.cacheForContext(t).set(e,n)}get(t,e,n){this.throwIfDisposed();const r=this.cacheForContext(t);if(r.has(e))return r.get(e);if(n){const t=n();return r.set(e,t),t}}delete(t,e){return this.throwIfDisposed(),this.cacheForContext(t).delete(e)}clear(t){if(this.throwIfDisposed(),t){const e=this.converter(t);this.cache.delete(e)}else this.cache.clear()}cacheForContext(t){const e=this.converter(t);let n=this.cache.get(e);return n||(n=new Map,this.cache.set(e,n)),n}},f8=class extends g8{static{s(this,"DocumentCache")}constructor(t){super((t=>t.toString())),this.onDispose(t.workspace.DocumentBuilder.onUpdate(((t,e)=>{const n=t.concat(e);for(const t of n)this.clear(t)})))}},m8=class extends p8{static{s(this,"WorkspaceCache")}constructor(t){super(),this.onDispose(t.workspace.DocumentBuilder.onUpdate((()=>{this.clear()})))}},y8=class{static{s(this,"DefaultScopeProvider")}constructor(t){this.reflection=t.shared.AstReflection,this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider,this.indexManager=t.shared.workspace.IndexManager,this.globalScopeCache=new m8(t.shared)}getScope(t){const e=[],n=this.reflection.getReferenceType(t),r=MQ(t.container).precomputedScopes;if(r){let i=t.container;do{const t=r.get(i);t.length>0&&e.push(hK(t).filter((t=>this.reflection.isSubtype(t.type,n)))),i=i.$container}while(i)}let i=this.getGlobalScope(n,t);for(let t=e.length-1;t>=0;t--)i=this.createScope(e[t],i);return i}createScope(t,e,n){return new c8(hK(t),e,n)}createScopeForNodes(t,e,n){const r=hK(t).map((t=>{const e=this.nameProvider.getName(t);if(e)return this.descriptions.createDescription(t,e)})).nonNullable();return new c8(r,e,n)}getGlobalScope(t,e){return this.globalScopeCache.get(t,(()=>new h8(this.indexManager.allElements(t))))}};function v8(t){return"string"==typeof t.$comment}function x8(t){return"object"==typeof t&&!!t&&("$ref"in t||"$error"in t)}s(v8,"isAstNodeWithComment"),s(x8,"isIntermediateReference");var b8,w8=class{static{s(this,"DefaultJsonSerializer")}constructor(t){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=t.shared.workspace.LangiumDocuments,this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider,this.commentProvider=t.documentation.CommentProvider}serialize(t,e={}){const n=null==e?void 0:e.replacer,r=s(((t,n)=>this.replacer(t,n,e)),"defaultReplacer"),i=n?(t,e)=>n(t,e,r):r;try{return this.currentDocument=MQ(t),JSON.stringify(t,i,null==e?void 0:e.space)}finally{this.currentDocument=void 0}}deserialize(t,e={}){const n=JSON.parse(t);return this.linkNode(n,n,e),n}replacer(t,e,{refText:n,sourceText:r,textRegions:i,comments:a,uriConverter:s}){var o,l,c,h;if(!this.ignoreProperties.has(t)){if(QX(e)){const t=e.ref,r=n?e.$refText:void 0;if(t){const n=MQ(t);let i="";this.currentDocument&&this.currentDocument!==n&&(i=s?s(n.uri,e):n.uri.toString());return{$ref:`${i}#${this.astNodeLocator.getAstNodePath(t)}`,$refText:r}}return{$error:null!==(l=null===(o=e.error)||void 0===o?void 0:o.message)&&void 0!==l?l:"Could not resolve reference",$refText:r}}if(ZX(e)){let n;if(i&&(n=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},e)),t&&!e.$document||!(null==n?void 0:n.$textRegion)||(n.$textRegion.documentURI=null===(c=this.currentDocument)||void 0===c?void 0:c.uri.toString())),r&&!t&&(null!=n||(n=Object.assign({},e)),n.$sourceText=null===(h=e.$cstNode)||void 0===h?void 0:h.text),a){null!=n||(n=Object.assign({},e));const t=this.commentProvider.getComment(e);t&&(n.$comment=t.replace(/\r/g,""))}return null!=n?n:e}return e}}addAstNodeRegionWithAssignmentsTo(t){const e=s((t=>({offset:t.offset,end:t.end,length:t.length,range:t.range})),"createDocumentSegment");if(t.$cstNode){const n=(t.$textRegion=e(t.$cstNode)).assignments={};return Object.keys(t).filter((t=>!t.startsWith("$"))).forEach((r=>{const i=wJ(t.$cstNode,r).map(e);0!==i.length&&(n[r]=i)})),t}}linkNode(t,e,n,r,i,a){for(const[r,i]of Object.entries(t))if(Array.isArray(i))for(let a=0;a{try{await t.call(e,n,r,i)}catch(t){if($7(t))throw t;console.error("An error occurred during validation:",t);const e=t instanceof Error?t.message:String(t);t instanceof Error&&t.stack&&console.error(t.stack),r("error","An error occurred during validation: "+e,{node:n})}}}addEntry(t,e){if("AstNode"!==t)for(const n of this.reflection.getAllSubTypes(t))this.entries.add(n,e);else this.entries.add("AstNode",e)}getChecks(t,e){let n=hK(this.entries.get(t)).concat(this.entries.get("AstNode"));return e&&(n=n.filter((t=>e.includes(t.category)))),n.map((t=>t.check))}},S8=class{static{s(this,"DefaultDocumentValidator")}constructor(t){this.validationRegistry=t.validation.ValidationRegistry,this.metadata=t.LanguageMetaData}async validateDocument(t,e={},n=I7.CancellationToken.None){const r=t.parseResult,i=[];if(await F7(n),!e.categories||e.categories.includes("built-in")){if(this.processLexingErrors(r,i,e),e.stopAfterLexingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===_8.LexingError})))return i;if(this.processParsingErrors(r,i,e),e.stopAfterParsingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===_8.ParsingError})))return i;if(this.processLinkingErrors(t,i,e),e.stopAfterLinkingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===_8.LinkingError})))return i}try{i.push(...await this.validateAst(r.value,e,n))}catch(t){if($7(t))throw t;console.error("An error occurred during validation:",t)}return await F7(n),i}processLexingErrors(t,e,n){for(const n of t.lexerErrors){const t={severity:L8("error"),range:{start:{line:n.line-1,character:n.column-1},end:{line:n.line-1,character:n.column+n.length-1}},message:n.message,data:T8(_8.LexingError),source:this.getSource()};e.push(t)}}processParsingErrors(t,e,n){for(const n of t.parserErrors){let t;if(isNaN(n.token.startOffset)){if("previousToken"in n){const e=n.previousToken;if(isNaN(e.startOffset)){const e={line:0,character:0};t={start:e,end:e}}else{const n={line:e.endLine-1,character:e.endColumn};t={start:n,end:n}}}}else t=vK(n.token);if(t){const r={severity:L8("error"),range:t,message:n.message,data:T8(_8.ParsingError),source:this.getSource()};e.push(r)}}}processLinkingErrors(t,e,n){for(const n of t.references){const t=n.error;if(t){const n={node:t.container,property:t.property,index:t.index,data:{code:_8.LinkingError,containerType:t.container.$type,property:t.property,refText:t.reference.$refText}};e.push(this.toDiagnostic("error",t.message,n))}}}async validateAst(t,e,n=I7.CancellationToken.None){const r=[],i=s(((t,e,n)=>{r.push(this.toDiagnostic(t,e,n))}),"acceptor");return await Promise.all(PQ(t).map((async t=>{await F7(n);const r=this.validationRegistry.getChecks(t.$type,e.categories);for(const e of r)await e(t,i,n)}))),r}toDiagnostic(t,e,n){return{message:e,range:A8(n),severity:L8(t),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function A8(t){if(t.range)return t.range;let e;return"string"==typeof t.property?e=kJ(t.node.$cstNode,t.property,t.index):"string"==typeof t.keyword&&(e=EJ(t.node.$cstNode,t.keyword,t.index)),null!=e||(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function L8(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)}}s(A8,"getDiagnosticRange"),s(L8,"toDiagnosticSeverity"),(E8=_8||(_8={})).LexingError="lexing-error",E8.ParsingError="parsing-error",E8.LinkingError="linking-error";var N8,I8=class{static{s(this,"DefaultAstNodeDescriptionProvider")}constructor(t){this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider}createDescription(t,e,n=MQ(t)){null!=e||(e=this.nameProvider.getName(t));const r=this.astNodeLocator.getAstNodePath(t);if(!e)throw new Error(`Node at path ${r} has no name.`);let i;const a=s((()=>{var e;return null!=i?i:i=xK(null!==(e=this.nameProvider.getNameNode(t))&&void 0!==e?e:t.$cstNode)}),"nameSegmentGetter");return{node:t,name:e,get nameSegment(){return a()},selectionSegment:xK(t.$cstNode),type:t.$type,documentUri:n.uri,path:r}}},M8=class{static{s(this,"DefaultReferenceDescriptionProvider")}constructor(t){this.nodeLocator=t.workspace.AstNodeLocator}async createDescriptions(t,e=I7.CancellationToken.None){const n=[],r=t.parseResult.value;for(const t of PQ(r))await F7(e),$Q(t).filter((t=>!tK(t))).forEach((t=>{const e=this.createDescription(t);e&&n.push(e)}));return n}createDescription(t){const e=t.reference.$nodeDescription,n=t.reference.$refNode;if(!e||!n)return;const r=MQ(t.container).uri;return{sourceUri:r,sourcePath:this.nodeLocator.getAstNodePath(t.container),targetUri:e.documentUri,targetPath:e.path,segment:xK(n),local:X7.equals(e.documentUri,r)}}},R8=class{static{s(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(t){if(t.$container){const e=this.getAstNodePath(t.$container),n=this.getPathSegment(t);return e+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:t,$containerIndex:e}){if(!t)throw new Error("Missing '$containerProperty' in AST node.");return void 0!==e?t+this.indexSeparator+e:t}getAstNode(t,e){return e.split(this.segmentSeparator).reduce(((t,e)=>{if(!t||0===e.length)return t;const n=e.indexOf(this.indexSeparator);if(n>0){const r=e.substring(0,n),i=parseInt(e.substring(n+1)),a=t[r];return null==a?void 0:a[i]}return t[e]}),t)}},D8=class{static{s(this,"DefaultConfigurationProvider")}constructor(t){this._ready=new G7,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=t.ServiceRegistry}get ready(){return this._ready.promise}initialize(t){var e,n;this.workspaceConfig=null!==(n=null===(e=t.capabilities.workspace)||void 0===e?void 0:e.configuration)&&void 0!==n&&n}async initialized(t){if(this.workspaceConfig){if(t.register){const e=this.serviceRegistry.all;t.register({section:e.map((t=>this.toSectionName(t.LanguageMetaData.languageId)))})}if(t.fetchConfiguration){const e=this.serviceRegistry.all.map((t=>({section:this.toSectionName(t.LanguageMetaData.languageId)}))),n=await t.fetchConfiguration(e);e.forEach(((t,e)=>{this.updateSectionConfiguration(t.section,n[e])}))}}this._ready.resolve()}updateConfiguration(t){t.settings&&Object.keys(t.settings).forEach((e=>{this.updateSectionConfiguration(e,t.settings[e])}))}updateSectionConfiguration(t,e){this.settings[t]=e}async getConfiguration(t,e){await this.ready;const n=this.toSectionName(t);if(this.settings[n])return this.settings[n][e]}toSectionName(t){return`${t}`}};!function(t){function e(t){return{dispose:s((async()=>await t()),"dispose")}}s(e,"create"),t.create=e}(N8||(N8={}));var O8=class{static{s(this,"DefaultDocumentBuilder")}constructor(t){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new s8,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=K7.Changed,this.langiumDocuments=t.workspace.LangiumDocuments,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.indexManager=t.workspace.IndexManager,this.serviceRegistry=t.ServiceRegistry}async build(t,e={},n=I7.CancellationToken.None){var r,i;for(const n of t){const t=n.uri.toString();if(n.state===K7.Validated){if("boolean"==typeof e.validation&&e.validation)n.state=K7.IndexedReferences,n.diagnostics=void 0,this.buildState.delete(t);else if("object"==typeof e.validation){const a=this.buildState.get(t),s=null===(r=null==a?void 0:a.result)||void 0===r?void 0:r.validationChecks;if(s){const r=(null!==(i=e.validation.categories)&&void 0!==i?i:b8.all).filter((t=>!s.includes(t)));r.length>0&&(this.buildState.set(t,{completed:!1,options:{validation:Object.assign(Object.assign({},e.validation),{categories:r})},result:a.result}),n.state=K7.IndexedReferences)}}}else this.buildState.delete(t)}this.currentState=K7.Changed,await this.emitUpdate(t.map((t=>t.uri)),[]),await this.buildDocuments(t,e,n)}async update(t,e,n=I7.CancellationToken.None){this.currentState=K7.Changed;for(const t of e)this.langiumDocuments.deleteDocument(t),this.buildState.delete(t.toString()),this.indexManager.remove(t);for(const e of t){if(!this.langiumDocuments.invalidateDocument(e)){const t=this.langiumDocumentFactory.fromModel({$type:"INVALID"},e);t.state=K7.Changed,this.langiumDocuments.addDocument(t)}this.buildState.delete(e.toString())}const r=hK(t).concat(e).map((t=>t.toString())).toSet();this.langiumDocuments.all.filter((t=>!r.has(t.uri.toString())&&this.shouldRelink(t,r))).forEach((t=>{this.serviceRegistry.getServices(t.uri).references.Linker.unlink(t),t.state=Math.min(t.state,K7.ComputedScopes),t.diagnostics=void 0})),await this.emitUpdate(t,e),await F7(n);const i=this.langiumDocuments.all.filter((t=>{var e;return t.staten(t,e))))}shouldRelink(t,e){return!!t.references.some((t=>void 0!==t.error))||this.indexManager.isAffected(t,e)}onUpdate(t){return this.updateListeners.push(t),N8.create((()=>{const e=this.updateListeners.indexOf(t);e>=0&&this.updateListeners.splice(e,1)}))}async buildDocuments(t,e,n){this.prepareBuild(t,e),await this.runCancelable(t,K7.Parsed,n,(t=>this.langiumDocumentFactory.update(t,n))),await this.runCancelable(t,K7.IndexedContent,n,(t=>this.indexManager.updateContent(t,n))),await this.runCancelable(t,K7.ComputedScopes,n,(async t=>{const e=this.serviceRegistry.getServices(t.uri).references.ScopeComputation;t.precomputedScopes=await e.computeLocalScopes(t,n)})),await this.runCancelable(t,K7.Linked,n,(t=>this.serviceRegistry.getServices(t.uri).references.Linker.link(t,n))),await this.runCancelable(t,K7.IndexedReferences,n,(t=>this.indexManager.updateReferences(t,n)));const r=t.filter((t=>this.shouldValidate(t)));await this.runCancelable(r,K7.Validated,n,(t=>this.validate(t,n)));for(const e of t){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}}prepareBuild(t,e){for(const n of t){const t=n.uri.toString(),r=this.buildState.get(t);r&&!r.completed||this.buildState.set(t,{completed:!1,options:e,result:null==r?void 0:r.result})}}async runCancelable(t,e,n,r){const i=t.filter((t=>t.state{this.buildPhaseListeners.delete(t,e)}))}waitUntil(t,e,n){let r;if(e&&"path"in e?r=e:n=e,null!=n||(n=I7.CancellationToken.None),r){const e=this.langiumDocuments.getDocument(r);if(e&&e.state>t)return Promise.resolve(r)}return this.currentState>=t?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(B7):new Promise(((e,i)=>{const a=this.onBuildPhase(t,(()=>{if(a.dispose(),s.dispose(),r){const t=this.langiumDocuments.getDocument(r);e(null==t?void 0:t.uri)}else e(void 0)})),s=n.onCancellationRequested((()=>{a.dispose(),s.dispose(),i(B7)}))}))}async notifyBuildPhase(t,e,n){if(0===t.length)return;const r=this.buildPhaseListeners.get(e);for(const e of r)await F7(n),await e(t,n)}shouldValidate(t){return Boolean(this.getBuildOptions(t).validation)}async validate(t,e){var n,r;const i=this.serviceRegistry.getServices(t.uri).validation.DocumentValidator,a=this.getBuildOptions(t).validation,s="object"==typeof a?a:void 0,o=await i.validateDocument(t,s,e);t.diagnostics?t.diagnostics.push(...o):t.diagnostics=o;const l=this.buildState.get(t.uri.toString());if(l){null!==(n=l.result)&&void 0!==n||(l.result={});const t=null!==(r=null==s?void 0:s.categories)&&void 0!==r?r:b8.all;l.result.validationChecks?l.result.validationChecks.push(...t):l.result.validationChecks=[...t]}}getBuildOptions(t){var e,n;return null!==(n=null===(e=this.buildState.get(t.uri.toString()))||void 0===e?void 0:e.options)&&void 0!==n?n:{}}},P8=class{static{s(this,"DefaultIndexManager")}constructor(t){this.symbolIndex=new Map,this.symbolByTypeIndex=new g8,this.referenceIndex=new Map,this.documents=t.workspace.LangiumDocuments,this.serviceRegistry=t.ServiceRegistry,this.astReflection=t.AstReflection}findAllReferences(t,e){const n=MQ(t).uri,r=[];return this.referenceIndex.forEach((t=>{t.forEach((t=>{X7.equals(t.targetUri,n)&&t.targetPath===e&&r.push(t)}))})),hK(r)}allElements(t,e){let n=hK(this.symbolIndex.keys());return e&&(n=n.filter((t=>!e||e.has(t)))),n.map((e=>this.getFileDescriptions(e,t))).flat()}getFileDescriptions(t,e){var n;if(!e)return null!==(n=this.symbolIndex.get(t))&&void 0!==n?n:[];const r=this.symbolByTypeIndex.get(t,e,(()=>{var n;return(null!==(n=this.symbolIndex.get(t))&&void 0!==n?n:[]).filter((t=>this.astReflection.isSubtype(t.type,e)))}));return r}remove(t){const e=t.toString();this.symbolIndex.delete(e),this.symbolByTypeIndex.clear(e),this.referenceIndex.delete(e)}async updateContent(t,e=I7.CancellationToken.None){const n=this.serviceRegistry.getServices(t.uri),r=await n.references.ScopeComputation.computeExports(t,e),i=t.uri.toString();this.symbolIndex.set(i,r),this.symbolByTypeIndex.clear(i)}async updateReferences(t,e=I7.CancellationToken.None){const n=this.serviceRegistry.getServices(t.uri),r=await n.workspace.ReferenceDescriptionProvider.createDescriptions(t,e);this.referenceIndex.set(t.uri.toString(),r)}isAffected(t,e){const n=this.referenceIndex.get(t.uri.toString());return!!n&&n.some((t=>!t.local&&e.has(t.targetUri.toString())))}},B8=class{static{s(this,"DefaultWorkspaceManager")}constructor(t){this.initialBuildOptions={},this._ready=new G7,this.serviceRegistry=t.ServiceRegistry,this.langiumDocuments=t.workspace.LangiumDocuments,this.documentBuilder=t.workspace.DocumentBuilder,this.fileSystemProvider=t.workspace.FileSystemProvider,this.mutex=t.workspace.WorkspaceLock}get ready(){return this._ready.promise}initialize(t){var e;this.folders=null!==(e=t.workspaceFolders)&&void 0!==e?e:void 0}initialized(t){return this.mutex.write((t=>{var e;return this.initializeWorkspace(null!==(e=this.folders)&&void 0!==e?e:[],t)}))}async initializeWorkspace(t,e=I7.CancellationToken.None){const n=await this.performStartup(t);await F7(e),await this.documentBuilder.build(n,this.initialBuildOptions,e)}async performStartup(t){const e=this.serviceRegistry.all.flatMap((t=>t.LanguageMetaData.fileExtensions)),n=[],r=s((t=>{n.push(t),this.langiumDocuments.hasDocument(t.uri)||this.langiumDocuments.addDocument(t)}),"collector");return await this.loadAdditionalDocuments(t,r),await Promise.all(t.map((t=>[t,this.getRootFolder(t)])).map((async t=>this.traverseFolder(...t,e,r)))),this._ready.resolve(),n}loadAdditionalDocuments(t,e){return Promise.resolve()}getRootFolder(t){return Q7.parse(t.uri)}async traverseFolder(t,e,n,r){const i=await this.fileSystemProvider.readDirectory(e);await Promise.all(i.map((async e=>{if(this.includeEntry(t,e,n))if(e.isDirectory)await this.traverseFolder(t,e.uri,n,r);else if(e.isFile){const t=await this.langiumDocuments.getOrCreateDocument(e.uri);r(t)}})))}includeEntry(t,e,n){const r=X7.basename(e.uri);if(r.startsWith("."))return!1;if(e.isDirectory)return"node_modules"!==r&&"out"!==r;if(e.isFile){const t=X7.extname(e.uri);return n.includes(t)}return!1}},$8=class{static{s(this,"DefaultLexer")}constructor(t){const e=t.parser.TokenBuilder.buildTokens(t.Grammar,{caseInsensitive:t.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(e);const n=U8(e)?Object.values(e):e;this.chevrotainLexer=new j1(n,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(t){var e;const n=this.chevrotainLexer.tokenize(t);return{tokens:n.tokens,errors:n.errors,hidden:null!==(e=n.groups.hidden)&&void 0!==e?e:[]}}toTokenTypeDictionary(t){if(U8(t))return t;const e=z8(t)?Object.values(t.modes).flat():t,n={};return e.forEach((t=>n[t.name]=t)),n}};function F8(t){return Array.isArray(t)&&(0===t.length||"name"in t[0])}function z8(t){return t&&"modes"in t&&"defaultMode"in t}function U8(t){return!F8(t)&&!z8(t)}function G8(t,e,n){let r,i;"string"==typeof t?(i=e,r=n):(i=t.range.start,r=e),i||(i=P3.create(0,0));return J8({index:0,tokens:H8({lines:j8(t),position:i,options:s9(r)}),position:i})}function q8(t,e){const n=s9(e),r=j8(t);if(0===r.length)return!1;const i=r[0],a=r[r.length-1],s=n.start,o=n.end;return Boolean(null==s?void 0:s.exec(i))&&Boolean(null==o?void 0:o.exec(a))}function j8(t){let e="";e="string"==typeof t?t:t.text;return e.split(iJ)}s(F8,"isTokenTypeArray"),s(z8,"isIMultiModeLexerDefinition"),s(U8,"isTokenTypeDictionary"),s(G8,"parseJSDoc"),s(q8,"isJSDoc"),s(j8,"getLines");var Y8=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,W8=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function H8(t){var e,n,r;const i=[];let a=t.position.line,s=t.position.character;for(let o=0;o=h.length){if(i.length>0){const t=P3.create(a,s);i.push({type:"break",content:"",range:B3.create(t,t)})}}else{Y8.lastIndex=u;const t=Y8.exec(h);if(t){const e=t[0],n=t[1],r=P3.create(a,s+u),o=P3.create(a,s+u+e.length);i.push({type:"tag",content:n,range:B3.create(r,o)}),u+=e.length,u=Z8(h,u)}if(u0&&"break"===i[i.length-1].type?i.slice(0,-1):i}function V8(t,e,n,r){const i=[];if(0===t.length){const t=P3.create(n,r),a=P3.create(n,r+e.length);i.push({type:"text",content:e,range:B3.create(t,a)})}else{let a=0;for(const s of t){const t=s.index,o=e.substring(a,t);o.length>0&&i.push({type:"text",content:e.substring(a,t),range:B3.create(P3.create(n,a+r),P3.create(n,t+r))});let l=o.length+1;const c=s[1];if(i.push({type:"inline-tag",content:c,range:B3.create(P3.create(n,a+l+r),P3.create(n,a+l+c.length+r))}),l+=c.length,4===s.length){l+=s[2].length;const t=s[3];i.push({type:"text",content:t,range:B3.create(P3.create(n,a+l+r),P3.create(n,a+l+t.length+r))})}else i.push({type:"text",content:"",range:B3.create(P3.create(n,a+l+r),P3.create(n,a+l+r))});a=t+s[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:B3.create(P3.create(n,a+r),P3.create(n,a+r+s.length))})}return i}s(H8,"tokenize"),s(V8,"buildInlineTokens");var X8=/\S/,K8=/\s*$/;function Z8(t,e){const n=t.substring(e).match(X8);return n?e+n.index:t.length}function Q8(t){const e=t.match(K8);if(e&&"number"==typeof e.index)return e.index}function J8(t){var e,n,r,i;const a=P3.create(t.position.line,t.position.character);if(0===t.tokens.length)return new l9([],B3.create(a,a));const s=[];for(;t.indexe.name===t))}getTags(t){return this.getAllTags().filter((e=>e.name===t))}getAllTags(){return this.elements.filter((t=>"name"in t))}toString(){let t="";for(const e of this.elements)if(0===t.length)t=e.toString();else{const n=e.toString();t+=g9(t)+n}return t.trim()}toMarkdown(t){let e="";for(const n of this.elements)if(0===e.length)e=n.toMarkdown(t);else{const r=n.toMarkdown(t);e+=g9(e)+r}return e.trim()}},c9=class{static{s(this,"JSDocTagImpl")}constructor(t,e,n,r){this.name=t,this.content=e,this.inline=n,this.range=r}toString(){let t=`@${this.name}`;const e=this.content.toString();return 1===this.content.inlines.length?t=`${t} ${e}`:this.content.inlines.length>1&&(t=`${t}\n${e}`),this.inline?`{${t}}`:t}toMarkdown(t){var e,n;return null!==(n=null===(e=null==t?void 0:t.renderTag)||void 0===e?void 0:e.call(t,this))&&void 0!==n?n:this.toMarkdownDefault(t)}toMarkdownDefault(t){const e=this.content.toMarkdown(t);if(this.inline){const n=h9(this.name,e,null!=t?t:{});if("string"==typeof n)return n}let n="";"italic"===(null==t?void 0:t.tag)||void 0===(null==t?void 0:t.tag)?n="*":"bold"===(null==t?void 0:t.tag)?n="**":"bold-italic"===(null==t?void 0:t.tag)&&(n="***");let r=`${n}@${this.name}${n}`;return 1===this.content.inlines.length?r=`${r} — ${e}`:this.content.inlines.length>1&&(r=`${r}\n${e}`),this.inline?`{${r}}`:r}};function h9(t,e,n){var r,i;if("linkplain"===t||"linkcode"===t||"link"===t){const a=e.indexOf(" ");let s=e;if(a>0){const t=Z8(e,a);s=e.substring(t),e=e.substring(0,a)}("linkcode"===t||"link"===t&&"code"===n.link)&&(s=`\`${s}\``);return null!==(i=null===(r=n.renderLink)||void 0===r?void 0:r.call(n,e,s))&&void 0!==i?i:u9(e,s)}}function u9(t,e){try{return Q7.parse(t,!0),`[${e}](${t})`}catch(e){return t}}s(h9,"renderInlineTag"),s(u9,"renderLinkDefault");var d9=class{static{s(this,"JSDocTextImpl")}constructor(t,e){this.inlines=t,this.range=e}toString(){let t="";for(let e=0;en.range.start.line&&(t+="\n")}return t}toMarkdown(t){let e="";for(let n=0;nr.range.start.line&&(e+="\n")}return e}},p9=class{static{s(this,"JSDocLineImpl")}constructor(t,e){this.text=t,this.range=e}toString(){return this.text}toMarkdown(){return this.text}};function g9(t){return t.endsWith("\n")?"\n":"\n\n"}s(g9,"fillNewlines");var f9=class{static{s(this,"JSDocDocumentationProvider")}constructor(t){this.indexManager=t.shared.workspace.IndexManager,this.commentProvider=t.documentation.CommentProvider}getDocumentation(t){const e=this.commentProvider.getComment(t);if(e&&q8(e)){return G8(e).toMarkdown({renderLink:s(((e,n)=>this.documentationLinkRenderer(t,e,n)),"renderLink"),renderTag:s((e=>this.documentationTagRenderer(t,e)),"renderTag")})}}documentationLinkRenderer(t,e,n){var r;const i=null!==(r=this.findNameInPrecomputedScopes(t,e))&&void 0!==r?r:this.findNameInGlobalScope(t,e);if(i&&i.nameSegment){const t=i.nameSegment.range.start.line+1,e=i.nameSegment.range.start.character+1;return`[${n}](${i.documentUri.with({fragment:`L${t},${e}`}).toString()})`}}documentationTagRenderer(t,e){}findNameInPrecomputedScopes(t,e){const n=MQ(t).precomputedScopes;if(!n)return;let r=t;do{const t=n.get(r).find((t=>t.name===e));if(t)return t;r=r.$container}while(r)}findNameInGlobalScope(t,e){const n=this.indexManager.allElements().find((t=>t.name===e));return n}},m9=class{static{s(this,"DefaultCommentProvider")}constructor(t){this.grammarConfig=()=>t.parser.GrammarConfig}getComment(t){var e;return v8(t)?t.$comment:null===(e=_K(t.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===e?void 0:e.text}},y9={};u(y9,d(HX(),1));var v9,x9=class{static{s(this,"DefaultAsyncParser")}constructor(t){this.syncParser=t.parser.LangiumParser}parse(t){return Promise.resolve(this.syncParser.parse(t))}},b9=class{static{s(this,"AbstractThreadedAsyncParser")}constructor(t){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=t.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const e=this.queue.shift();e&&(t.lock(),e.resolve(t))}})),this.workerPool.push(t)}}async parse(t,e){const n=await this.acquireParserWorker(e),r=new G7;let i;const a=e.onCancellationRequested((()=>{i=setTimeout((()=>{this.terminateWorker(n)}),this.terminationDelay)}));return n.parse(t).then((t=>{const e=this.hydrator.hydrate(t);r.resolve(e)})).catch((t=>{r.reject(t)})).finally((()=>{a.dispose(),clearTimeout(i)})),r.promise}terminateWorker(t){t.terminate();const e=this.workerPool.indexOf(t);e>=0&&this.workerPool.splice(e,1)}async acquireParserWorker(t){this.initializeWorkers();for(const t of this.workerPool)if(t.ready)return t.lock(),t;const e=new G7;return t.onCancellationRequested((()=>{const t=this.queue.indexOf(e);t>=0&&this.queue.splice(t,1),e.reject(B7)})),this.queue.push(e),e.promise}},w9=class{static{s(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(t,e,n,r){this.onReadyEmitter=new y9.Emitter,this.deferred=new G7,this._ready=!0,this._parsing=!1,this.sendMessage=t,this._terminate=r,e((t=>{const e=t;this.deferred.resolve(e),this.unlock()})),n((t=>{this.deferred.reject(t),this.unlock()}))}terminate(){this.deferred.reject(B7),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(t){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new G7,this.sendMessage(t),this.deferred.promise}},k9=class{static{s(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new I7.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(t){this.cancelWrite();const e=new I7.CancellationTokenSource;return this.previousTokenSource=e,this.enqueue(this.writeQueue,t,e.token)}read(t){return this.enqueue(this.readQueue,t)}enqueue(t,e,n){const r=new G7,i={action:e,deferred:r,cancellationToken:null!=n?n:I7.CancellationToken.None};return t.push(i),this.performNextOperation(),r.promise}async performNextOperation(){if(!this.done)return;const t=[];if(this.writeQueue.length>0)t.push(this.writeQueue.shift());else{if(!(this.readQueue.length>0))return;t.push(...this.readQueue.splice(0,this.readQueue.length))}this.done=!1,await Promise.all(t.map((async({action:t,deferred:e,cancellationToken:n})=>{try{const r=await Promise.resolve().then((()=>t(n)));e.resolve(r)}catch(t){$7(t)?e.resolve(void 0):e.reject(t)}}))),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},T9=class{static{s(this,"DefaultHydrator")}constructor(t){this.grammarElementIdMap=new o8,this.tokenTypeIdMap=new o8,this.grammar=t.Grammar,this.lexer=t.parser.Lexer,this.linker=t.references.Linker}dehydrate(t){return{lexerErrors:t.lexerErrors.map((t=>Object.assign({},t))),parserErrors:t.parserErrors.map((t=>Object.assign({},t))),value:this.dehydrateAstNode(t.value,this.createDehyrationContext(t.value))}}createDehyrationContext(t){const e=new Map,n=new Map;for(const n of PQ(t))e.set(n,{});if(t.$cstNode)for(const e of fK(t.$cstNode))n.set(e,{});return{astNodes:e,cstNodes:n}}dehydrateAstNode(t,e){const n=e.astNodes.get(t);n.$type=t.$type,n.$containerIndex=t.$containerIndex,n.$containerProperty=t.$containerProperty,void 0!==t.$cstNode&&(n.$cstNode=this.dehydrateCstNode(t.$cstNode,e));for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(Array.isArray(i)){const t=[];n[r]=t;for(const n of i)ZX(n)?t.push(this.dehydrateAstNode(n,e)):QX(n)?t.push(this.dehydrateReference(n,e)):t.push(n)}else ZX(i)?n[r]=this.dehydrateAstNode(i,e):QX(i)?n[r]=this.dehydrateReference(i,e):void 0!==i&&(n[r]=i);return n}dehydrateReference(t,e){const n={};return n.$refText=t.$refText,t.$refNode&&(n.$refNode=e.cstNodes.get(t.$refNode)),n}dehydrateCstNode(t,e){const n=e.cstNodes.get(t);return iK(t)?n.fullText=t.fullText:n.grammarSource=this.getGrammarElementId(t.grammarSource),n.hidden=t.hidden,n.astNode=e.astNodes.get(t.astNode),nK(t)?n.content=t.content.map((t=>this.dehydrateCstNode(t,e))):rK(t)&&(n.tokenType=t.tokenType.name,n.offset=t.offset,n.length=t.length,n.startLine=t.range.start.line,n.startColumn=t.range.start.character,n.endLine=t.range.end.line,n.endColumn=t.range.end.character),n}hydrate(t){const e=t.value,n=this.createHydrationContext(e);return"$cstNode"in e&&this.hydrateCstNode(e.$cstNode,n),{lexerErrors:t.lexerErrors,parserErrors:t.parserErrors,value:this.hydrateAstNode(e,n)}}createHydrationContext(t){const e=new Map,n=new Map;for(const n of PQ(t))e.set(n,{});let r;if(t.$cstNode)for(const e of fK(t.$cstNode)){let t;"fullText"in e?(t=new Z6(e.fullText),r=t):"content"in e?t=new X6:"tokenType"in e&&(t=this.hydrateCstLeafNode(e)),t&&(n.set(e,t),t.root=r)}return{astNodes:e,cstNodes:n}}hydrateAstNode(t,e){const n=e.astNodes.get(t);n.$type=t.$type,n.$containerIndex=t.$containerIndex,n.$containerProperty=t.$containerProperty,t.$cstNode&&(n.$cstNode=e.cstNodes.get(t.$cstNode));for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(Array.isArray(i)){const t=[];n[r]=t;for(const a of i)ZX(a)?t.push(this.setParent(this.hydrateAstNode(a,e),n)):QX(a)?t.push(this.hydrateReference(a,n,r,e)):t.push(a)}else ZX(i)?n[r]=this.setParent(this.hydrateAstNode(i,e),n):QX(i)?n[r]=this.hydrateReference(i,n,r,e):void 0!==i&&(n[r]=i);return n}setParent(t,e){return t.$container=e,t}hydrateReference(t,e,n,r){return this.linker.buildReference(e,n,r.cstNodes.get(t.$refNode),t.$refText)}hydrateCstNode(t,e,n=0){const r=e.cstNodes.get(t);if("number"==typeof t.grammarSource&&(r.grammarSource=this.getGrammarElement(t.grammarSource)),r.astNode=e.astNodes.get(t.astNode),nK(r))for(const i of t.content){const t=this.hydrateCstNode(i,e,n++);r.content.push(t)}return r}hydrateCstLeafNode(t){const e=this.getTokenType(t.tokenType),n=t.offset,r=t.length,i=t.startLine,a=t.startColumn,s=t.endLine,o=t.endColumn,l=t.hidden;return new V6(n,r,{start:{line:i,character:a},end:{line:s,character:o}},e,l)}getTokenType(t){return this.lexer.definition[t]}getGrammarElementId(t){return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(t)}getGrammarElement(t){0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap();const e=this.grammarElementIdMap.getKey(t);if(e)return e;throw new Error("Invalid grammar element id: "+t)}createGrammarElementIdMap(){let t=0;for(const e of PQ(this.grammar))JK(e)&&this.grammarElementIdMap.set(e,t++)}};function _9(t){return{documentation:{CommentProvider:s((t=>new m9(t)),"CommentProvider"),DocumentationProvider:s((t=>new f9(t)),"DocumentationProvider")},parser:{AsyncParser:s((t=>new x9(t)),"AsyncParser"),GrammarConfig:s((t=>QJ(t)),"GrammarConfig"),LangiumParser:s((t=>C7(t)),"LangiumParser"),CompletionParser:s((t=>E7(t)),"CompletionParser"),ValueConverter:s((()=>new N7),"ValueConverter"),TokenBuilder:s((()=>new L7),"TokenBuilder"),Lexer:s((t=>new $8(t)),"Lexer"),ParserErrorMessageProvider:s((()=>new i7),"ParserErrorMessageProvider")},workspace:{AstNodeLocator:s((()=>new R8),"AstNodeLocator"),AstNodeDescriptionProvider:s((t=>new I8(t)),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:s((t=>new M8(t)),"ReferenceDescriptionProvider")},references:{Linker:s((t=>new n8(t)),"Linker"),NameProvider:s((()=>new i8),"NameProvider"),ScopeProvider:s((t=>new y8(t)),"ScopeProvider"),ScopeComputation:s((t=>new l8(t)),"ScopeComputation"),References:s((t=>new a8(t)),"References")},serializer:{Hydrator:s((t=>new T9(t)),"Hydrator"),JsonSerializer:s((t=>new w8(t)),"JsonSerializer")},validation:{DocumentValidator:s((t=>new S8(t)),"DocumentValidator"),ValidationRegistry:s((t=>new C8(t)),"ValidationRegistry")},shared:s((()=>t.shared),"shared")}}function E9(t){return{ServiceRegistry:s((()=>new k8),"ServiceRegistry"),workspace:{LangiumDocuments:s((t=>new e8(t)),"LangiumDocuments"),LangiumDocumentFactory:s((t=>new t8(t)),"LangiumDocumentFactory"),DocumentBuilder:s((t=>new O8(t)),"DocumentBuilder"),IndexManager:s((t=>new P8(t)),"IndexManager"),WorkspaceManager:s((t=>new B8(t)),"WorkspaceManager"),FileSystemProvider:s((e=>t.fileSystemProvider(e)),"FileSystemProvider"),WorkspaceLock:s((()=>new k9),"WorkspaceLock"),ConfigurationProvider:s((t=>new D8(t)),"ConfigurationProvider")}}}function C9(t,e,n,r,i,a,s,o,l){return L9([t,e,n,r,i,a,s,o,l].reduce(M9,{}))}s(_9,"createDefaultCoreModule"),s(E9,"createDefaultSharedCoreModule"),(v9||(v9={})).merge=(t,e)=>M9(M9({},t),e),s(C9,"inject");var S9=Symbol("isProxy");function A9(t){if(t&&t[S9])for(const e of Object.values(t))A9(e);return t}function L9(t,e){const n=new Proxy({},{deleteProperty:s((()=>!1),"deleteProperty"),get:s(((r,i)=>I9(r,i,t,e||n)),"get"),getOwnPropertyDescriptor:s(((r,i)=>(I9(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i))),"getOwnPropertyDescriptor"),has:s(((e,n)=>n in t),"has"),ownKeys:s((()=>[...Reflect.ownKeys(t),S9]),"ownKeys")});return n[S9]=!0,n}s(A9,"eagerLoad"),s(L9,"_inject");var N9=Symbol();function I9(t,e,n,r){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]===N9)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');return t[e]}if(e in n){const i=n[e];t[e]=N9;try{t[e]="function"==typeof i?i(r):L9(i,r)}catch(n){throw t[e]=n instanceof Error?n:void 0,n}return t[e]}}function M9(t,e){if(e)for(const[n,r]of Object.entries(e))if(void 0!==r){const e=t[n];t[n]=null!==e&&null!==r&&"object"==typeof e&&"object"==typeof r?M9(e,r):r}return t}s(I9,"_resolve"),s(M9,"_merge");var R9={};l(R9,{AstUtils:()=>AQ,BiMap:()=>o8,Cancellation:()=>I7,ContextCache:()=>g8,CstUtils:()=>KX,DONE_RESULT:()=>cK,Deferred:()=>G7,Disposable:()=>N8,DisposableCache:()=>d8,DocumentCache:()=>f8,EMPTY_STREAM:()=>lK,ErrorWithLocation:()=>PK,GrammarUtils:()=>OK,MultiMap:()=>s8,OperationCancelled:()=>B7,Reduction:()=>uK,RegExpUtils:()=>qQ,SimpleCache:()=>p8,StreamImpl:()=>aK,TreeStreamImpl:()=>gK,URI:()=>Q7,UriUtils:()=>X7,WorkspaceCache:()=>m8,assertUnreachable:()=>BK,delayNextTick:()=>M7,interruptAndCheck:()=>F7,isOperationCancelled:()=>$7,loadGrammarFromJson:()=>F9,setInterruptionPeriod:()=>P7,startCancelableOperation:()=>O7,stream:()=>hK}),u(R9,y9);var D9=class{static{s(this,"EmptyFileSystemProvider")}readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}},O9={fileSystemProvider:s((()=>new D9),"fileSystemProvider")},P9={Grammar:s((()=>{}),"Grammar"),LanguageMetaData:s((()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})),"LanguageMetaData")},B9={AstReflection:s((()=>new CQ),"AstReflection")};function $9(){const t=C9(E9(O9),B9),e=C9(_9({shared:t}),P9);return t.ServiceRegistry.register(e),e}function F9(t){var e;const n=$9(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Q7.parse(`memory://${null!==(e=r.name)&&void 0!==e?e:"grammar"}.langium`)),r}s($9,"createMinimalGrammarServices"),s(F9,"loadGrammarFromJson"),u(XX,R9);var z9=Object.defineProperty,U9=s(((t,e)=>z9(t,"name",{value:e,configurable:!0})),"__name");function G9(t){return att.isInstance(t,"Architecture")}s(G9,"isArchitecture"),U9(G9,"isArchitecture");function q9(t){return att.isInstance(t,"Branch")}s(q9,"isBranch"),U9(q9,"isBranch");function j9(t){return att.isInstance(t,"Commit")}s(j9,"isCommit"),U9(j9,"isCommit");function Y9(t){return att.isInstance(t,"Common")}s(Y9,"isCommon"),U9(Y9,"isCommon");function W9(t){return att.isInstance(t,"GitGraph")}s(W9,"isGitGraph"),U9(W9,"isGitGraph");function H9(t){return att.isInstance(t,"Info")}s(H9,"isInfo"),U9(H9,"isInfo");function V9(t){return att.isInstance(t,"Merge")}s(V9,"isMerge"),U9(V9,"isMerge");function X9(t){return att.isInstance(t,"Packet")}s(X9,"isPacket"),U9(X9,"isPacket");function K9(t){return att.isInstance(t,"PacketBlock")}s(K9,"isPacketBlock"),U9(K9,"isPacketBlock");function Z9(t){return att.isInstance(t,"Pie")}s(Z9,"isPie"),U9(Z9,"isPie");function Q9(t){return att.isInstance(t,"PieSection")}s(Q9,"isPieSection"),U9(Q9,"isPieSection");var J9,ttt,ett,ntt,rtt,itt=class extends eK{static{s(this,"MermaidAstReflection")}static{U9(this,"MermaidAstReflection")}getAllTypes(){return["Architecture","Branch","Checkout","CherryPicking","Commit","Common","Direction","Edge","GitGraph","Group","Info","Junction","Merge","Packet","PacketBlock","Pie","PieSection","Service","Statement"]}computeIsSubtype(t,e){switch(t){case"Branch":case"Checkout":case"CherryPicking":case"Commit":case"Merge":return this.isSubtype("Statement",e);case"Direction":return this.isSubtype("GitGraph",e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;throw new Error(`${e} is not a valid reference id.`)}getTypeMetaData(t){switch(t){case"Architecture":return{name:"Architecture",properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case"Branch":return{name:"Branch",properties:[{name:"name"},{name:"order"}]};case"Checkout":return{name:"Checkout",properties:[{name:"branch"}]};case"CherryPicking":return{name:"CherryPicking",properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case"Commit":return{name:"Commit",properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Common":return{name:"Common",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Edge":return{name:"Edge",properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case"GitGraph":return{name:"GitGraph",properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case"Group":return{name:"Group",properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case"Info":return{name:"Info",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Junction":return{name:"Junction",properties:[{name:"id"},{name:"in"}]};case"Merge":return{name:"Merge",properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Packet":return{name:"Packet",properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case"PacketBlock":return{name:"PacketBlock",properties:[{name:"end"},{name:"label"},{name:"start"}]};case"Pie":return{name:"Pie",properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case"PieSection":return{name:"PieSection",properties:[{name:"label"},{name:"value"}]};case"Service":return{name:"Service",properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case"Direction":return{name:"Direction",properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:t,properties:[]}}}},att=new itt,stt=U9((()=>J9??(J9=F9('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","name":"Info","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"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@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"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":[]}],"types":[],"usedGrammars":[]}'))),"InfoGrammar"),ott=U9((()=>ttt??(ttt=F9('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","name":"Packet","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"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":[]}],"types":[],"usedGrammars":[]}'))),"PacketGrammar"),ltt=U9((()=>ett??(ett=F9('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","name":"Pie","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"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":[]}],"types":[],"usedGrammars":[]}'))),"PieGrammar"),ctt=U9((()=>ntt??(ntt=F9('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","name":"Architecture","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","fragment":true,"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":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LeftPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RightPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Arrow","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"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@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"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":[]}],"types":[],"usedGrammars":[]}'))),"ArchitectureGrammar"),htt=U9((()=>rtt??(rtt=F9('{"$type":"Grammar","isDeclared":true,"name":"GitGraph","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","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","name":"GitGraph","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"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@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","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":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}'))),"GitGraphGrammar"),utt={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},dtt={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},ptt={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},gtt={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},ftt={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},mtt={AstReflection:U9((()=>new itt),"AstReflection")},ytt={Grammar:U9((()=>stt()),"Grammar"),LanguageMetaData:U9((()=>utt),"LanguageMetaData"),parser:{}},vtt={Grammar:U9((()=>ott()),"Grammar"),LanguageMetaData:U9((()=>dtt),"LanguageMetaData"),parser:{}},xtt={Grammar:U9((()=>ltt()),"Grammar"),LanguageMetaData:U9((()=>ptt),"LanguageMetaData"),parser:{}},btt={Grammar:U9((()=>ctt()),"Grammar"),LanguageMetaData:U9((()=>gtt),"LanguageMetaData"),parser:{}},wtt={Grammar:U9((()=>htt()),"Grammar"),LanguageMetaData:U9((()=>ftt),"LanguageMetaData"),parser:{}},ktt={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},Ttt=class extends N7{static{s(this,"AbstractMermaidValueConverter")}static{U9(this,"AbstractMermaidValueConverter")}runConverter(t,e,n){let r=this.runCommonConverter(t,e,n);return void 0===r&&(r=this.runCustomConverter(t,e,n)),void 0===r?super.runConverter(t,e,n):r}runCommonConverter(t,e,n){const r=ktt[t.name];if(void 0===r)return;const i=r.exec(e);return null!==i?void 0!==i[1]?i[1].trim().replace(/[\t ]{2,}/gm," "):void 0!==i[2]?i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n"):void 0:void 0}},_tt=class extends Ttt{static{s(this,"CommonValueConverter")}static{U9(this,"CommonValueConverter")}runCustomConverter(t,e,n){}},Ett=class extends L7{static{s(this,"AbstractMermaidTokenBuilder")}static{U9(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,n){const r=super.buildKeywordTokens(t,e,n);return r.forEach((t=>{this.keywords.has(t.name)&&void 0!==t.PATTERN&&(t.PATTERN=new RegExp(t.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))})),r}};(class extends Ett{static{s(this,"CommonTokenBuilder")}static{U9(this,"CommonTokenBuilder")}});var Ctt={},Stt={info:U9((async()=>{const{createInfoServices:t}=await Promise.resolve().then((function(){return uMt})),e=t().Info.parser.LangiumParser;Ctt.info=e}),"info"),packet:U9((async()=>{const{createPacketServices:t}=await Promise.resolve().then((function(){return dMt})),e=t().Packet.parser.LangiumParser;Ctt.packet=e}),"packet"),pie:U9((async()=>{const{createPieServices:t}=await Promise.resolve().then((function(){return pMt})),e=t().Pie.parser.LangiumParser;Ctt.pie=e}),"pie"),architecture:U9((async()=>{const{createArchitectureServices:t}=await Promise.resolve().then((function(){return gMt})),e=t().Architecture.parser.LangiumParser;Ctt.architecture=e}),"architecture"),gitGraph:U9((async()=>{const{createGitGraphServices:t}=await Promise.resolve().then((function(){return fMt})),e=t().GitGraph.parser.LangiumParser;Ctt.gitGraph=e}),"gitGraph")};async function Att(t,e){const n=Stt[t];if(!n)throw new Error(`Unknown diagram type: ${t}`);Ctt[t]||await n();const r=Ctt[t].parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new Ltt(r);return r.value}s(Att,"parse"),U9(Att,"parse");var Ltt=class extends Error{static{s(this,"MermaidParseError")}constructor(t){super(`Parsing failed: ${t.lexerErrors.map((t=>t.message)).join("\n")} ${t.parserErrors.map((t=>t.message)).join("\n")}`),this.result=t}static{U9(this,"MermaidParseError")}},Ntt=class extends Ett{static{s(this,"PieTokenBuilder")}static{U9(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},Itt=class extends Ttt{static{s(this,"PieValueConverter")}static{U9(this,"PieValueConverter")}runCustomConverter(t,e,n){if("PIE_SECTION_LABEL"===t.name)return e.replace(/"/g,"").trim()}},Mtt={parser:{TokenBuilder:U9((()=>new Ntt),"TokenBuilder"),ValueConverter:U9((()=>new Itt),"ValueConverter")}};function Rtt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),xtt,Mtt);return e.ServiceRegistry.register(n),{shared:e,Pie:n}}s(Rtt,"createPieServices"),U9(Rtt,"createPieServices");var Dtt=class extends Ett{static{s(this,"ArchitectureTokenBuilder")}static{U9(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},Ott=class extends Ttt{static{s(this,"ArchitectureValueConverter")}static{U9(this,"ArchitectureValueConverter")}runCustomConverter(t,e,n){return"ARCH_ICON"===t.name?e.replace(/[()]/g,"").trim():"ARCH_TEXT_ICON"===t.name?e.replace(/["()]/g,""):"ARCH_TITLE"===t.name?e.replace(/[[\]]/g,"").trim():void 0}},Ptt={parser:{TokenBuilder:U9((()=>new Dtt),"TokenBuilder"),ValueConverter:U9((()=>new Ott),"ValueConverter")}};function Btt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),btt,Ptt);return e.ServiceRegistry.register(n),{shared:e,Architecture:n}}s(Btt,"createArchitectureServices"),U9(Btt,"createArchitectureServices");var $tt=class extends Ett{static{s(this,"GitGraphTokenBuilder")}static{U9(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},Ftt={parser:{TokenBuilder:U9((()=>new $tt),"TokenBuilder"),ValueConverter:U9((()=>new _tt),"ValueConverter")}};function ztt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),wtt,Ftt);return e.ServiceRegistry.register(n),{shared:e,GitGraph:n}}s(ztt,"createGitGraphServices"),U9(ztt,"createGitGraphServices");var Utt=class extends Ett{static{s(this,"InfoTokenBuilder")}static{U9(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},Gtt={parser:{TokenBuilder:U9((()=>new Utt),"TokenBuilder"),ValueConverter:U9((()=>new _tt),"ValueConverter")}};function qtt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),ytt,Gtt);return e.ServiceRegistry.register(n),{shared:e,Info:n}}s(qtt,"createInfoServices"),U9(qtt,"createInfoServices");var jtt=class extends Ett{static{s(this,"PacketTokenBuilder")}static{U9(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},Ytt={parser:{TokenBuilder:U9((()=>new jtt),"TokenBuilder"),ValueConverter:U9((()=>new _tt),"ValueConverter")}};function Wtt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),vtt,Ytt);return e.ServiceRegistry.register(n),{shared:e,Packet:n}}s(Wtt,"createPacketServices"),U9(Wtt,"createPacketServices");var Htt={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Vtt=Ct.gitGraph,Xtt=s((()=>mk({...Vtt,...Ft().gitGraph})),"getConfig"),Ktt=new qX((()=>{const t=Xtt(),e=t.mainBranchName,n=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:n}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}}));function Ztt(){return nk({length:7})}function Qtt(t,e){const n=Object.create(null);return t.reduce(((t,r)=>{const i=e(r);return n[i]||(n[i]=!0,t.push(r)),t}),[])}s(Ztt,"getID"),s(Qtt,"uniqBy");var Jtt=s((function(t){Ktt.records.direction=t}),"setDirection"),tet=s((function(t){m.debug("options str",t),t=t?.trim(),t=t||"{}";try{Ktt.records.options=JSON.parse(t)}catch(t){m.error("error while parsing gitGraph options",t.message)}}),"setOptions"),eet=s((function(){return Ktt.records.options}),"getOptions"),net=s((function(t){let e=t.msg,n=t.id;const r=t.type;let i=t.tags;m.info("commit",e,n,r,i),m.debug("Entering commit:",e,n,r,i);const a=Xtt();n=_n.sanitizeText(n,a),e=_n.sanitizeText(e,a),i=i?.map((t=>_n.sanitizeText(t,a)));const s={id:n||Ktt.records.seq+"-"+Ztt(),message:e,seq:Ktt.records.seq++,type:r??Htt.NORMAL,tags:i??[],parents:null==Ktt.records.head?[]:[Ktt.records.head.id],branch:Ktt.records.currBranch};Ktt.records.head=s,m.info("main branch",a.mainBranchName),Ktt.records.commits.set(s.id,s),Ktt.records.branches.set(Ktt.records.currBranch,s.id),m.debug("in pushCommit "+s.id)}),"commit"),ret=s((function(t){let e=t.name;const n=t.order;if(e=_n.sanitizeText(e,Xtt()),Ktt.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}")`);Ktt.records.branches.set(e,null!=Ktt.records.head?Ktt.records.head.id:null),Ktt.records.branchConfig.set(e,{name:e,order:n}),set(e),m.debug("in createBranch")}),"branch"),iet=s((t=>{let e=t.branch,n=t.id;const r=t.type,i=t.tags,a=Xtt();e=_n.sanitizeText(e,a),n&&(n=_n.sanitizeText(n,a));const s=Ktt.records.branches.get(Ktt.records.currBranch),o=Ktt.records.branches.get(e),l=s?Ktt.records.commits.get(s):void 0,c=o?Ktt.records.commits.get(o):void 0;if(l&&c&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Ktt.records.currBranch===e){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(void 0===l||!l){const t=new Error(`Incorrect usage of "merge". Current branch (${Ktt.records.currBranch})has no commits`);throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},t}if(!Ktt.records.branches.has(e)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},t}if(void 0===c||!c){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},t}if(l===c){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(n&&Ktt.records.commits.has(n)){const t=new Error('Incorrect usage of "merge". Commit with id:'+n+" already exists, use different custom Id");throw t.hash={text:`merge ${e} ${n} ${r} ${i?.join(" ")}`,token:`merge ${e} ${n} ${r} ${i?.join(" ")}`,expected:[`merge ${e} ${n}_UNIQUE ${r} ${i?.join(" ")}`]},t}const h=o||"",u={id:n||`${Ktt.records.seq}-${Ztt()}`,message:`merged branch ${e} into ${Ktt.records.currBranch}`,seq:Ktt.records.seq++,parents:null==Ktt.records.head?[]:[Ktt.records.head.id,h],branch:Ktt.records.currBranch,type:Htt.MERGE,customType:r,customId:!!n,tags:i??[]};Ktt.records.head=u,Ktt.records.commits.set(u.id,u),Ktt.records.branches.set(Ktt.records.currBranch,u.id),m.debug(Ktt.records.branches),m.debug("in mergeBranch")}),"merge"),aet=s((function(t){let e=t.id,n=t.targetId,r=t.tags,i=t.parent;m.debug("Entering cherryPick:",e,n,r);const a=Xtt();if(e=_n.sanitizeText(e,a),n=_n.sanitizeText(n,a),r=r?.map((t=>_n.sanitizeText(t,a))),i=_n.sanitizeText(i,a),!e||!Ktt.records.commits.has(e)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},t}const s=Ktt.records.commits.get(e);if(void 0===s||!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===Htt.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(!n||!Ktt.records.commits.has(n)){if(o===Ktt.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},t}const t=Ktt.records.branches.get(Ktt.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ktt.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},t}const a=Ktt.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ktt.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},t}const l={id:Ktt.records.seq+"-"+Ztt(),message:`cherry-picked ${s?.message} into ${Ktt.records.currBranch}`,seq:Ktt.records.seq++,parents:null==Ktt.records.head?[]:[Ktt.records.head.id,s.id],branch:Ktt.records.currBranch,type:Htt.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${s.id}${s.type===Htt.MERGE?`|parent:${i}`:""}`]};Ktt.records.head=l,Ktt.records.commits.set(l.id,l),Ktt.records.branches.set(Ktt.records.currBranch,l.id),m.debug(Ktt.records.branches),m.debug("in cherryPick")}}),"cherryPick"),set=s((function(t){if(t=_n.sanitizeText(t,Xtt()),!Ktt.records.branches.has(t)){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}{Ktt.records.currBranch=t;const e=Ktt.records.branches.get(Ktt.records.currBranch);Ktt.records.head=void 0!==e&&e?Ktt.records.commits.get(e)??null:null}}),"checkout");function oet(t,e,n){const r=t.indexOf(e);-1===r?t.push(n):t.splice(r,1,n)}function cet(t){const e=t.reduce(((t,e)=>t.seq>e.seq?t:e),t[0]);let n="";t.forEach((function(t){n+=t===e?"\t*":"\t|"}));const r=[n,e.id,e.seq];for(const t in Ktt.records.branches)Ktt.records.branches.get(t)===e.id&&r.push(t);if(m.debug(r.join(" ")),e.parents&&2==e.parents.length&&e.parents[0]&&e.parents[1]){const n=Ktt.records.commits.get(e.parents[0]);oet(t,e,n),e.parents[1]&&t.push(Ktt.records.commits.get(e.parents[1]))}else{if(0==e.parents.length)return;if(e.parents[0]){const n=Ktt.records.commits.get(e.parents[0]);oet(t,e,n)}}cet(t=Qtt(t,(t=>t.id)))}s(oet,"upsert"),s(cet,"prettyPrintCommitHistory");var het=s((function(){m.debug(Ktt.records.commits);cet([fet()[0]])}),"prettyPrint"),uet=s((function(){Ktt.reset(),$n()}),"clear"),det=s((function(){const t=[...Ktt.records.branchConfig.values()].map(((t,e)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${e}`)})).sort(((t,e)=>(t.order??0)-(e.order??0))).map((({name:t})=>({name:t})));return t}),"getBranchesAsObjArray"),pet=s((function(){return Ktt.records.branches}),"getBranches"),get=s((function(){return Ktt.records.commits}),"getCommits"),fet=s((function(){const t=[...Ktt.records.commits.values()];return t.forEach((function(t){m.debug(t.id)})),t.sort(((t,e)=>t.seq-e.seq)),t}),"getCommitsArray"),met={commitType:Htt,getConfig:Xtt,setDirection:Jtt,setOptions:tet,getOptions:eet,commit:net,branch:ret,merge:iet,cherryPick:aet,checkout:set,prettyPrint:het,clear:uet,getBranchesAsObjArray:det,getBranches:pet,getCommits:get,getCommitsArray:fet,getCurrentBranch:s((function(){return Ktt.records.currBranch}),"getCurrentBranch"),getDirection:s((function(){return Ktt.records.direction}),"getDirection"),getHead:s((function(){return Ktt.records.head}),"getHead"),setAccTitle:Fn,getAccTitle:zn,getAccDescription:Gn,setAccDescription:Un,setDiagramTitle:qn,getDiagramTitle:jn},yet=s(((t,e)=>{jX(t,e),t.dir&&e.setDirection(t.dir);for(const n of t.statements)vet(n,e)}),"populate"),vet=s(((t,e)=>{const n={Commit:s((t=>e.commit(xet(t))),"Commit"),Branch:s((t=>e.branch(bet(t))),"Branch"),Merge:s((t=>e.merge(wet(t))),"Merge"),Checkout:s((t=>e.checkout(ket(t))),"Checkout"),CherryPicking:s((t=>e.cherryPick(Tet(t))),"CherryPicking")}[t.$type];n?n(t):m.error(`Unknown statement type: ${t.$type}`)}),"parseStatement"),xet=s((t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?Htt[t.type]:Htt.NORMAL,tags:t.tags??void 0})),"parseCommit"),bet=s((t=>({name:t.name,order:t.order??0})),"parseBranch"),wet=s((t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?Htt[t.type]:void 0,tags:t.tags??void 0})),"parseMerge"),ket=s((t=>t.branch),"parseCheckout"),Tet=s((t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent})),"parseCherryPicking"),_et={parse:s((async t=>{const e=await Att("gitGraph",t);m.debug(e),yet(e,met)}),"parse")},Eet=Hn()?.gitGraph,Cet=new Map,Aet=new Map,Let=new Map,Net=[],Iet=0,Met="LR",Ret=s((()=>{Cet.clear(),Aet.clear(),Let.clear(),Iet=0,Net=[],Met="LR"}),"clear"),Det=s((t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|/gi):t).forEach((t=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),n.setAttribute("class","row"),n.textContent=t.trim(),e.appendChild(n)})),e}),"drawText"),Oet=s((t=>{let e,n,r;return"BT"===Met?(n=s(((t,e)=>t<=e),"comparisonFunc"),r=1/0):(n=s(((t,e)=>t>=e),"comparisonFunc"),r=0),t.forEach((t=>{const i="TB"===Met||"BT"==Met?Aet.get(t)?.y:Aet.get(t)?.x;void 0!==i&&n(i,r)&&(e=t,r=i)})),e}),"findClosestParent"),Pet=s((t=>{let e="",n=1/0;return t.forEach((t=>{const r=Aet.get(t).y;r<=n&&(e=t,n=r)})),e||void 0}),"findClosestParentBT"),Bet=s(((t,e,n)=>{let r=n,i=n;const a=[];t.forEach((t=>{const n=e.get(t);if(!n)throw new Error(`Commit not found for key ${t}`);n.parents.length?(r=Fet(n),i=Math.max(r,i)):a.push(n),zet(n,r)})),r=i,a.forEach((t=>{Uet(t,r,n)})),t.forEach((t=>{const n=e.get(t);if(n?.parents.length){const t=Pet(n.parents);r=Aet.get(t).y-40,r<=i&&(i=r);const e=Cet.get(n.branch).pos,a=r-10;Aet.set(n.id,{x:e,y:a})}}))}),"setParallelBTPos"),$et=s((t=>{const e=Oet(t.parents.filter((t=>null!==t)));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const n=Aet.get(e)?.y;if(void 0===n)throw new Error(`Closest parent position not found for commit ${t.id}`);return n}),"findClosestParentPos"),Fet=s((t=>$et(t)+40),"calculateCommitPosition"),zet=s(((t,e)=>{const n=Cet.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const r=n.pos,i=e+10;return Aet.set(t.id,{x:r,y:i}),{x:r,y:i}}),"setCommitPosition"),Uet=s(((t,e,n)=>{const r=Cet.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const i=e+n,a=r.pos;Aet.set(t.id,{x:a,y:i})}),"setRootPosition"),Get=s(((t,e,n,r,i,a)=>{if(a===Htt.HIGHLIGHT)t.append("rect").attr("x",n.x-10).attr("y",n.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${i%8} ${r}-outer`),t.append("rect").attr("x",n.x-6).attr("y",n.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${i%8} ${r}-inner`);else if(a===Htt.CHERRY_PICK)t.append("circle").attr("cx",n.x).attr("cy",n.y).attr("r",10).attr("class",`commit ${e.id} ${r}`),t.append("circle").attr("cx",n.x-3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${r}`),t.append("circle").attr("cx",n.x+3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${r}`),t.append("line").attr("x1",n.x+3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${r}`),t.append("line").attr("x1",n.x-3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${r}`);else{const s=t.append("circle");if(s.attr("cx",n.x),s.attr("cy",n.y),s.attr("r",e.type===Htt.MERGE?9:10),s.attr("class",`commit ${e.id} commit${i%8}`),a===Htt.MERGE){const a=t.append("circle");a.attr("cx",n.x),a.attr("cy",n.y),a.attr("r",6),a.attr("class",`commit ${r} ${e.id} commit${i%8}`)}if(a===Htt.REVERSE){t.append("path").attr("d",`M ${n.x-5},${n.y-5}L${n.x+5},${n.y+5}M${n.x-5},${n.y+5}L${n.x+5},${n.y-5}`).attr("class",`commit ${r} ${e.id} commit${i%8}`)}}}),"drawCommitBullet"),qet=s(((t,e,n,r)=>{if(e.type!==Htt.CHERRY_PICK&&(e.customId&&e.type===Htt.MERGE||e.type!==Htt.MERGE)&&Eet?.showCommitLabel){const i=t.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),s=i.append("text").attr("x",r).attr("y",n.y+25).attr("class","commit-label").text(e.id),o=s.node()?.getBBox();if(o&&(a.attr("x",n.posWithOffset-o.width/2-2).attr("y",n.y+13.5).attr("width",o.width+4).attr("height",o.height+4),"TB"===Met||"BT"===Met?(a.attr("x",n.x-(o.width+16+5)).attr("y",n.y-12),s.attr("x",n.x-(o.width+16)).attr("y",n.y+o.height-12)):s.attr("x",n.posWithOffset-o.width/2),Eet.rotateCommitLabel))if("TB"===Met||"BT"===Met)s.attr("transform","rotate(-45, "+n.x+", "+n.y+")"),a.attr("transform","rotate(-45, "+n.x+", "+n.y+")");else{const t=-7.5-(o.width+10)/25*9.5,e=10+o.width/25*8.5;i.attr("transform","translate("+t+", "+e+") rotate(-45, "+r+", "+n.y+")")}}}),"drawCommitLabel"),jet=s(((t,e,n,r)=>{if(e.tags.length>0){let i=0,a=0,s=0;const o=[];for(const r of e.tags.reverse()){const e=t.insert("polygon"),l=t.append("circle"),c=t.append("text").attr("y",n.y-16-i).attr("class","tag-label").text(r),h=c.node()?.getBBox();if(!h)throw new Error("Tag bbox not found");a=Math.max(a,h.width),s=Math.max(s,h.height),c.attr("x",n.posWithOffset-h.width/2),o.push({tag:c,hole:l,rect:e,yOffset:i}),i+=20}for(const{tag:t,hole:e,rect:i,yOffset:l}of o){const o=s/2,c=n.y-19.2-l;if(i.attr("class","tag-label-bkg").attr("points",`\n ${r-a/2-2},${c+2} \n ${r-a/2-2},${c-2}\n ${n.posWithOffset-a/2-4},${c-o-2}\n ${n.posWithOffset+a/2+4},${c-o-2}\n ${n.posWithOffset+a/2+4},${c+o+2}\n ${n.posWithOffset-a/2-4},${c+o+2}`),e.attr("cy",c).attr("cx",r-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===Met||"BT"===Met){const s=r+l;i.attr("class","tag-label-bkg").attr("points",`\n ${n.x},${s+2}\n ${n.x},${s-2}\n ${n.x+10},${s-o-2}\n ${n.x+10+a+4},${s-o-2}\n ${n.x+10+a+4},${s+o+2}\n ${n.x+10},${s+o+2}`).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")"),e.attr("cx",n.x+2).attr("cy",s).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")"),t.attr("x",n.x+5).attr("y",s+3).attr("transform","translate(14,14) rotate(45, "+n.x+","+r+")")}}}}),"drawCommitTags"),Yet=s((t=>{switch(t.customType??t.type){case Htt.NORMAL:return"commit-normal";case Htt.REVERSE:return"commit-reverse";case Htt.HIGHLIGHT:return"commit-highlight";case Htt.MERGE:return"commit-merge";case Htt.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}}),"getCommitClassType"),Wet=s(((t,e,n,r)=>{const i={x:0,y:0};if(!(t.parents.length>0)){if("TB"===e)return 30;if("BT"===e){return(r.get(t.id)??i).y-40}return 0}{const n=Oet(t.parents);if(n){const a=r.get(n)??i;if("TB"===e)return a.y+40;if("BT"===e){return(r.get(t.id)??i).y-40}return a.x+40}}return 0}),"calculatePosition"),Het=s(((t,e,n)=>{const r="BT"===Met&&n?e:e+10,i="TB"===Met||"BT"===Met?r:Cet.get(t.branch)?.pos,a="TB"===Met||"BT"===Met?Cet.get(t.branch)?.pos:r;if(void 0===a||void 0===i)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:i,posWithOffset:r}}),"getCommitPosition"),Vet=s(((t,e,n)=>{if(!Eet)throw new Error("GitGraph config not found");const r=t.append("g").attr("class","commit-bullets"),i=t.append("g").attr("class","commit-labels");let a="TB"===Met||"BT"===Met?30:0;const o=[...e.keys()],l=Eet?.parallelCommits??!1,c=s(((t,n)=>{const r=e.get(t)?.seq,i=e.get(n)?.seq;return void 0!==r&&void 0!==i?r-i:0}),"sortKeys");let h=o.sort(c);"BT"===Met&&(l&&Bet(h,e,a),h=h.reverse()),h.forEach((t=>{const s=e.get(t);if(!s)throw new Error(`Commit not found for key ${t}`);l&&(a=Wet(s,Met,a,Aet));const o=Het(s,a,l);if(n){const t=Yet(s),e=s.customType??s.type,n=Cet.get(s.branch)?.index??0;Get(r,s,o,t,n,e),qet(i,s,o,a),jet(i,s,o,a)}"TB"===Met||"BT"===Met?Aet.set(s.id,{x:o.x,y:o.posWithOffset}):Aet.set(s.id,{x:o.posWithOffset,y:o.y}),a="BT"===Met&&l?a+40:a+40+10,a>Iet&&(Iet=a)}))}),"drawCommits"),Xet=s(((t,e,n,r,i)=>{const a=("TB"===Met||"BT"===Met?n.xt.branch===a),"isOnBranchToGetCurve"),l=s((n=>n.seq>t.seq&&n.seql(t)&&o(t)))}),"shouldRerouteArrow"),Ket=s(((t,e,n=0)=>{const r=t+Math.abs(t-e)/2;if(n>5)return r;if(Net.every((t=>Math.abs(t-r)>=10)))return Net.push(r),r;const i=Math.abs(t-e);return Ket(t,e-i/5,n+1)}),"findLane"),Zet=s(((t,e,n,r)=>{const i=Aet.get(e.id),a=Aet.get(n.id);if(void 0===i||void 0===a)throw new Error(`Commit positions not found for commits ${e.id} and ${n.id}`);const s=Xet(e,n,i,a,r);let o,l="",c="",h=0,u=0,d=Cet.get(n.branch)?.index;if(n.type===Htt.MERGE&&e.id!==n.parents[0]&&(d=Cet.get(e.branch)?.index),s){l="A 10 10, 0, 0, 0,",c="A 10 10, 0, 0, 1,",h=10,u=10;const t=i.ya.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y-h} ${c} ${i.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x+h} ${i.y} ${l} ${a.x} ${i.y+u} L ${a.x} ${a.y}`),i.x===a.x&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):"BT"===Met?(i.xa.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${l} ${i.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-u} L ${a.x} ${a.y}`),i.x===a.x&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):(i.ya.y&&(o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-u} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${c} ${i.x+u} ${a.y} L ${a.x} ${a.y}`),i.y===a.y&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`));if(void 0===o)throw new Error("Line definition not found");t.append("path").attr("d",o).attr("class","arrow arrow"+d%8)}),"drawArrow"),Qet=s(((t,e)=>{const n=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach((t=>{const r=e.get(t);r.parents&&r.parents.length>0&&r.parents.forEach((t=>{Zet(n,e.get(t),r,e)}))}))}),"drawArrows"),Jet=s(((t,e)=>{const n=t.append("g");e.forEach(((t,e)=>{const r=e%8,i=Cet.get(t.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${t.name}`);const a=n.append("line");a.attr("x1",0),a.attr("y1",i),a.attr("x2",Iet),a.attr("y2",i),a.attr("class","branch branch"+r),"TB"===Met?(a.attr("y1",30),a.attr("x1",i),a.attr("y2",Iet),a.attr("x2",i)):"BT"===Met&&(a.attr("y1",Iet),a.attr("x1",i),a.attr("y2",30),a.attr("x2",i)),Net.push(i);const s=t.name,o=Det(s),l=n.insert("rect"),c=n.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+r);c.node().appendChild(o);const h=o.getBBox();l.attr("class","branchLabelBkg label"+r).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===Eet?.rotateCommitLabel?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4),c.attr("transform","translate("+(-h.width-14-(!0===Eet?.rotateCommitLabel?30:0))+", "+(i-h.height/2-1)+")"),"TB"===Met?(l.attr("x",i-h.width/2-10).attr("y",0),c.attr("transform","translate("+(i-h.width/2-5)+", 0)")):"BT"===Met?(l.attr("x",i-h.width/2-10).attr("y",Iet),c.attr("transform","translate("+(i-h.width/2-5)+", "+Iet+")")):l.attr("transform","translate(-19, "+(i-h.height/2)+")")}))}),"drawBranches"),tnt=s((function(t,e,n,r,i){return Cet.set(t,{pos:e,index:n}),e+=50+(i?40:0)+("TB"===Met||"BT"===Met?r.width/2:0)}),"setBranchPosition"),ent=s((function(t,e,n,r){if(Ret(),m.debug("in gitgraph renderer",t+"\n","id:",e,n),!Eet)throw new Error("GitGraph config not found");const i=Eet.rotateCommitLabel??!1,a=r.db;Let=a.getCommits();const s=a.getBranchesAsObjArray();Met=a.getDirection();const o=Oa(`[id="${e}"]`);let l=0;s.forEach(((t,e)=>{const n=Det(t.name),r=o.append("g"),a=r.insert("g").attr("class","branchLabel"),s=a.insert("g").attr("class","label branch-label");s.node()?.appendChild(n);const c=n.getBBox();l=tnt(t.name,l,e,c,i),s.remove(),a.remove(),r.remove()})),Vet(o,Let,!1),Eet.showBranches&&Jet(o,s),Qet(o,Let),Vet(o,Let,!0),yk.insertTitle(o,"gitTitleText",Eet.titleTopMargin??0,a.getDiagramTitle()),Zn(void 0,o,Eet.diagramPadding,Eet.useMaxWidth)}),"draw"),nnt={draw:ent},rnt=s((t=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map((e=>`\n .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${e} { fill: ${t["git"+e]}; }\n .arrow${e} { stroke: ${t["git"+e]}; }\n `)).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${t.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n .commit-reverse {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`),"getStyles"),int={parser:_et,db:met,renderer:nnt,styles:rnt},ant=Object.freeze({__proto__:null,diagram:int}),snt=o({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isoWeek.js"(t,e){!function(n,r){"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_isoWeek=r()}(t,(function(){var t="day";return function(e,n,r){var i=s((function(e){return e.add(4-e.isoWeekday(),t)}),"a"),a=n.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(e){if(!this.$utils().u(e))return this.add(7*(e-this.isoWeek()),t);var n,a,s,o=i(this),l=(n=this.isoWeekYear(),s=4-(a=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),a.isoWeekday()>4&&(s+=7),a.add(s,t));return o.diff(l,"week")+1},a.isoWeekday=function(t){return this.$utils().u(t)?this.day()||7:this.day(this.day()%7?t:t-7)};var o=a.startOf;a.startOf=function(t,e){var n=this.$utils(),r=!!n.u(e)||e;return"isoweek"===n.p(t)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):o.bind(this)(t,e)}}}))}}),ont=o({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/customParseFormat.js"(t,e){!function(n,r){"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_customParseFormat=r()}(t,(function(){var t={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"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},l=s((function(t){return(t=+t)+(t>68?1900:2e3)}),"a"),c=s((function(t){return function(e){this[t]=+e}}),"f"),h=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],u=s((function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))}),"u"),d=s((function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n}),"d"),p={A:[a,function(t){this.afternoon=d(t,!1)}],a:[a,function(t){this.afternoon=d(t,!0)}],Q:[n,function(t){this.month=3*(t-1)+1}],S:[n,function(t){this.milliseconds=100*+t}],SS:[r,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[i,c("seconds")],ss:[i,c("seconds")],m:[i,c("minutes")],mm:[i,c("minutes")],H:[i,c("hours")],h:[i,c("hours")],HH:[i,c("hours")],hh:[i,c("hours")],D:[i,c("day")],DD:[r,c("day")],Do:[a,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],w:[i,c("week")],ww:[r,c("week")],M:[i,c("month")],MM:[r,c("month")],MMM:[a,function(t){var e=u("months"),n=(u("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[a,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,c("year")],YY:[r,function(t){this.year=l(t)}],YYYY:[/\d{4}/,c("year")],Z:h,ZZ:h};function g(n){var r,i;r=n,i=o&&o.formats;for(var a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var a=r&&r.toUpperCase();return n||i[r]||t[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),s=a.length,l=0;l-1)return new Date(("X"===e?1e3:1)*t);var i=g(e)(t),a=i.year,s=i.month,o=i.day,l=i.hours,c=i.minutes,h=i.seconds,u=i.milliseconds,d=i.zone,p=i.week,f=new Date,m=o||(a||s?1:f.getDate()),y=a||f.getFullYear(),v=0;a&&!s||(v=s>0?s-1:f.getMonth());var x,b=l||0,w=c||0,k=h||0,T=u||0;return d?new Date(Date.UTC(y,v,m,b,w,k,T+60*d.offset*1e3)):n?new Date(Date.UTC(y,v,m,b,w,k,T)):(x=new Date(y,v,m,b,w,k,T),p&&(x=r(x).week(p).toDate()),x)}catch(t){return new Date("")}}(e,s,r,n),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&e!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var d=s.length,p=1;p<=d;p+=1){a[1]=s[p-1];var f=n.apply(this,a);if(f.isValid()){this.$d=f.$d,this.$L=f.$L,this.init();break}p===d&&(this.$d=new Date(""))}else i.call(this,t)}}}))}}),lnt=o({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/advancedFormat.js"(t,e){!function(n,r){"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_advancedFormat=r()}(t,(function(){return function(t,e){var n=e.prototype,r=n.format;n.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return r.bind(this)(t);var i=this.$utils(),a=(t||"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(t){switch(t){case"Q":return Math.ceil((e.$M+1)/3);case"Do":return n.ordinal(e.$D);case"gggg":return e.weekYear();case"GGGG":return e.isoWeekYear();case"wo":return n.ordinal(e.week(),"W");case"w":case"ww":return i.s(e.week(),"w"===t?1:2,"0");case"W":case"WW":return i.s(e.isoWeek(),"W"===t?1:2,"0");case"k":case"kk":return i.s(String(0===e.$H?24:e.$H),"k"===t?1:2,"0");case"X":return Math.floor(e.$d.getTime()/1e3);case"x":return e.$d.getTime();case"z":return"["+e.offsetName()+"]";case"zzz":return"["+e.offsetName("long")+"]";default:return t}}));return r.bind(this)(a)}}}))}}),cnt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"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],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],l=[1,31],c=[1,32],h=[1,33],u=[1,34],d=[1,9],p=[1,10],g=[1,11],f=[1,12],m=[1,13],y=[1,14],v=[1,15],x=[1,16],b=[1,19],w=[1,20],k=[1,21],T=[1,22],_=[1,23],E=[1,25],C=[1,35],S={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:r.setWeekday("monday");break;case 9:r.setWeekday("tuesday");break;case 10:r.setWeekday("wednesday");break;case 11:r.setWeekday("thursday");break;case 12:r.setWeekday("friday");break;case 13:r.setWeekday("saturday");break;case 14:r.setWeekday("sunday");break;case 15:r.setWeekend("friday");break;case 16:r.setWeekend("saturday");break;case 17:r.setDateFormat(a[o].substr(11)),this.$=a[o].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[o].substr(18);break;case 19:r.TopAxis(),this.$=a[o].substr(8);break;case 20:r.setAxisFormat(a[o].substr(11)),this.$=a[o].substr(11);break;case 21:r.setTickInterval(a[o].substr(13)),this.$=a[o].substr(13);break;case 22:r.setExcludes(a[o].substr(9)),this.$=a[o].substr(9);break;case 23:r.setIncludes(a[o].substr(9)),this.$=a[o].substr(9);break;case 24:r.setTodayMarker(a[o].substr(12)),this.$=a[o].substr(12);break;case 27:r.setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 28:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 33:r.addTask(a[o-1],a[o]),this.$="task";break;case 34:this.$=a[o-1],r.setClickEvent(a[o-1],a[o],null);break;case 35:this.$=a[o-2],r.setClickEvent(a[o-2],a[o-1],a[o]);break;case 36:this.$=a[o-2],r.setClickEvent(a[o-2],a[o-1],null),r.setLink(a[o-2],a[o]);break;case 37:this.$=a[o-3],r.setClickEvent(a[o-3],a[o-2],a[o-1]),r.setLink(a[o-3],a[o]);break;case 38:this.$=a[o-2],r.setClickEvent(a[o-2],a[o],null),r.setLink(a[o-2],a[o-1]);break;case 39:this.$=a[o-3],r.setClickEvent(a[o-3],a[o-1],a[o]),r.setLink(a[o-3],a[o-2]);break;case 40:this.$=a[o-1],r.setLink(a[o-1],a[o]);break;case 41:case 47:this.$=a[o-1]+" "+a[o];break;case 42:case 43:case 45:this.$=a[o-2]+" "+a[o-1]+" "+a[o];break;case 44:case 46:this.$=a[o-3]+" "+a[o-2]+" "+a[o-1]+" "+a[o]}}),"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:n,13:r,14:i,15:a,16:o,17:l,18:c,19:18,20:h,21:u,22:d,23:p,24:g,25:f,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:T,36:_,37:24,38:E,40:C},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:l,18:c,19:18,20:h,21:u,22:d,23:p,24:g,25:f,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:T,36:_,37:24,38:E,40:C},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:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},A=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){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:case 15:case 18:case 21:case 24:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:case 9:case 10:case 12:case 13:break;case 11:return 10;case 14:this.begin("href");break;case 16:return 43;case 17:this.begin("callbackname");break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 22:return 42;case 23:this.begin("click");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 t}();function L(){this.yy={}}return S.lexer=A,s(L,"Parser"),L.prototype=S,S.Parser=L,new L}();cnt.parser=cnt;var hnt=cnt,unt=d(Cy(),1),dnt=d(p(),1),pnt=d(snt(),1),gnt=d(ont(),1),fnt=d(lnt(),1);dnt.default.extend(pnt.default),dnt.default.extend(gnt.default),dnt.default.extend(fnt.default);var mnt,ynt,vnt={friday:5,saturday:6},xnt="",bnt="",wnt=void 0,knt="",Tnt=[],_nt=[],Ent=new Map,Cnt=[],Snt=[],Ant="",Lnt="",Nnt=["active","done","crit","milestone"],Int=[],Mnt=!1,Rnt=!1,Dnt="sunday",Ont="saturday",Pnt=0,Bnt=s((function(){Cnt=[],Snt=[],Ant="",Int=[],frt=0,mnt=void 0,ynt=void 0,xrt=[],xnt="",bnt="",Lnt="",wnt=void 0,knt="",Tnt=[],_nt=[],Mnt=!1,Rnt=!1,Pnt=0,Ent=new Map,$n(),Dnt="sunday",Ont="saturday"}),"clear"),$nt=s((function(t){bnt=t}),"setAxisFormat"),Fnt=s((function(){return bnt}),"getAxisFormat"),znt=s((function(t){wnt=t}),"setTickInterval"),Unt=s((function(){return wnt}),"getTickInterval"),Gnt=s((function(t){knt=t}),"setTodayMarker"),qnt=s((function(){return knt}),"getTodayMarker"),jnt=s((function(t){xnt=t}),"setDateFormat"),Ynt=s((function(){Mnt=!0}),"enableInclusiveEndDates"),Wnt=s((function(){return Mnt}),"endDatesAreInclusive"),Hnt=s((function(){Rnt=!0}),"enableTopAxis"),Vnt=s((function(){return Rnt}),"topAxisEnabled"),Xnt=s((function(t){Lnt=t}),"setDisplayMode"),Knt=s((function(){return Lnt}),"getDisplayMode"),Znt=s((function(){return xnt}),"getDateFormat"),Qnt=s((function(t){Tnt=t.toLowerCase().split(/[\s,]+/)}),"setIncludes"),Jnt=s((function(){return Tnt}),"getIncludes"),trt=s((function(t){_nt=t.toLowerCase().split(/[\s,]+/)}),"setExcludes"),ert=s((function(){return _nt}),"getExcludes"),nrt=s((function(){return Ent}),"getLinks"),rrt=s((function(t){Ant=t,Cnt.push(t)}),"addSection"),irt=s((function(){return Cnt}),"getSections"),art=s((function(){let t=_rt();let e=0;for(;!t&&e<10;)t=_rt(),e++;return Snt=xrt}),"getTasks"),srt=s((function(t,e,n,r){return!r.includes(t.format(e.trim()))&&(!(!n.includes("weekends")||t.isoWeekday()!==vnt[Ont]&&t.isoWeekday()!==vnt[Ont]+1)||(!!n.includes(t.format("dddd").toLowerCase())||n.includes(t.format(e.trim()))))}),"isInvalidDate"),ort=s((function(t){Dnt=t}),"setWeekday"),lrt=s((function(){return Dnt}),"getWeekday"),crt=s((function(t){Ont=t}),"setWeekend"),hrt=s((function(t,e,n,r){if(!n.length||t.manualEndTime)return;let i,a;i=t.startTime instanceof Date?(0,dnt.default)(t.startTime):(0,dnt.default)(t.startTime,e,!0),i=i.add(1,"d"),a=t.endTime instanceof Date?(0,dnt.default)(t.endTime):(0,dnt.default)(t.endTime,e,!0);const[s,o]=urt(i,a,e,n,r);t.endTime=s.toDate(),t.renderEndTime=o}),"checkTaskDates"),urt=s((function(t,e,n,r,i){let a=!1,s=null;for(;t<=e;)a||(s=e.toDate()),a=srt(t,n,r,i),a&&(e=e.add(1,"d")),t=t.add(1,"d");return[e,s]}),"fixTaskDates"),drt=s((function(t,e,n){n=n.trim();const r=/^after\s+(?[\d\w- ]+)/.exec(n);if(null!==r){let t=null;for(const e of r.groups.ids.split(" ")){let n=krt(e);void 0!==n&&(!t||n.endTime>t.endTime)&&(t=n)}if(t)return t.endTime;const e=new Date;return e.setHours(0,0,0,0),e}let i=(0,dnt.default)(n,e.trim(),!0);if(i.isValid())return i.toDate();{m.debug("Invalid date:"+n),m.debug("With date format:"+e.trim());const t=new Date(n);if(void 0===t||isNaN(t.getTime())||t.getFullYear()<-1e4||t.getFullYear()>1e4)throw new Error("Invalid date:"+n);return t}}),"getStartDate"),prt=s((function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return null!==e?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]}),"parseDuration"),grt=s((function(t,e,n,r=!1){n=n.trim();const i=/^until\s+(?[\d\w- ]+)/.exec(n);if(null!==i){let t=null;for(const e of i.groups.ids.split(" ")){let n=krt(e);void 0!==n&&(!t||n.startTime{window.open(n,"_self")})),Ent.set(t,n))})),Crt(t,"clickable")}),"setLink"),Crt=s((function(t,e){t.split(",").forEach((function(t){let n=krt(t);void 0!==n&&n.classes.push(e)}))}),"setClass"),Srt=s((function(t,e,n){if("loose"!==Hn().securityLevel)return;if(void 0===e)return;let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{yk.runFunc(e,...r)}))}),"setClickFun"),Art=s((function(t,e){Int.push((function(){const n=document.querySelector(`[id="${t}"]`);null!==n&&n.addEventListener("click",(function(){e()}))}),(function(){const n=document.querySelector(`[id="${t}-text"]`);null!==n&&n.addEventListener("click",(function(){e()}))}))}),"pushFun"),Lrt=s((function(t,e,n){t.split(",").forEach((function(t){Srt(t,e,n)})),Crt(t,"clickable")}),"setClickEvent"),Nrt=s((function(t){Int.forEach((function(e){e(t)}))}),"bindFunctions"),Irt={getConfig:s((()=>Hn().gantt),"getConfig"),clear:Bnt,setDateFormat:jnt,getDateFormat:Znt,enableInclusiveEndDates:Ynt,endDatesAreInclusive:Wnt,enableTopAxis:Hnt,topAxisEnabled:Vnt,setAxisFormat:$nt,getAxisFormat:Fnt,setTickInterval:znt,getTickInterval:Unt,setTodayMarker:Gnt,getTodayMarker:qnt,setAccTitle:Fn,getAccTitle:zn,setDiagramTitle:qn,getDiagramTitle:jn,setDisplayMode:Xnt,getDisplayMode:Knt,setAccDescription:Un,getAccDescription:Gn,addSection:rrt,getSections:irt,getTasks:art,addTask:wrt,findTaskById:krt,addTaskOrg:Trt,setIncludes:Qnt,getIncludes:Jnt,setExcludes:trt,getExcludes:ert,setClickEvent:Lrt,setLink:Ert,getLinks:nrt,bindFunctions:Nrt,parseDuration:prt,isInvalidDate:srt,setWeekday:ort,getWeekday:lrt,setWeekend:crt};function Mrt(t,e,n){let r=!0;for(;r;)r=!1,n.forEach((function(n){const i=new RegExp("^\\s*"+n+"\\s*$");t[0].match(i)&&(e[n]=!0,t.shift(1),r=!0)}))}s(Mrt,"getTaskTags");var Rrt,Drt=d(p(),1),Ort=s((function(){m.debug("Something is calling, setConf, remove the call")}),"setConf"),Prt={monday:ml,tuesday:yl,wednesday:vl,thursday:xl,friday:bl,saturday:wl,sunday:fl},Brt=s(((t,e)=>{let n=[...t].map((()=>-1/0)),r=[...t].sort(((t,e)=>t.startTime-e.startTime||t.order-e.order)),i=0;for(const t of r)for(let r=0;r=n[r]){n[r]=t.endTime,t.order=r+e,r>i&&(i=r);break}return i}),"getMaxIntersections"),$rt=s((function(t,e,n,r){const i=Hn().gantt,a=Hn().securityLevel;let o;"sandbox"===a&&(o=Oa("#i"+e));const l=Oa("sandbox"===a?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===a?o.nodes()[0].contentDocument:document,h=c.getElementById(e);void 0===(Rrt=h.parentElement.offsetWidth)&&(Rrt=1200),void 0!==i.useWidth&&(Rrt=i.useWidth);const u=r.db.getTasks();let d=[];for(const t of u)d.push(t.type);d=E(d);const p={};let g=2*i.topPadding;if("compact"===r.db.getDisplayMode()||"compact"===i.displayMode){const t={};for(const e of u)void 0===t[e.section]?t[e.section]=[e]:t[e.section].push(e);let e=0;for(const n of Object.keys(t)){const r=Brt(t[n],e)+1;e+=r,g+=r*(i.barHeight+i.barGap),p[n]=r}}else{g+=u.length*(i.barHeight+i.barGap);for(const t of d)p[t]=u.filter((e=>e.type===t)).length}h.setAttribute("viewBox","0 0 "+Rrt+" "+g);const f=l.select(`[id="${e}"]`),y=uh().domain([ir(u,(function(t){return t.startTime})),rr(u,(function(t){return t.endTime}))]).rangeRound([0,Rrt-i.leftPadding-i.rightPadding]);function v(t,e){const n=t.startTime,r=e.startTime;let i=0;return n>r?i=1:nt.order)))].map((e=>t.find((t=>t.order===e))));f.append("g").selectAll("rect").data(h).enter().append("rect").attr("x",0).attr("y",(function(t,e){return t.order*n+a-2})).attr("width",(function(){return c-i.rightPadding/2})).attr("height",n).attr("class",(function(t){for(const[e,n]of d.entries())if(t.type===n)return"section section"+e%i.numberSectionStyles;return"section section0"}));const u=f.append("g").selectAll("rect").data(t).enter(),p=r.db.getLinks();u.append("rect").attr("id",(function(t){return t.id})).attr("rx",3).attr("ry",3).attr("x",(function(t){return t.milestone?y(t.startTime)+s+.5*(y(t.endTime)-y(t.startTime))-.5*o:y(t.startTime)+s})).attr("y",(function(t,e){return t.order*n+a})).attr("width",(function(t){return t.milestone?o:y(t.renderEndTime||t.endTime)-y(t.startTime)})).attr("height",o).attr("transform-origin",(function(t,e){return e=t.order,(y(t.startTime)+s+.5*(y(t.endTime)-y(t.startTime))).toString()+"px "+(e*n+a+.5*o).toString()+"px"})).attr("class",(function(t){let e="";t.classes.length>0&&(e=t.classes.join(" "));let n=0;for(const[e,r]of d.entries())t.type===r&&(n=e%i.numberSectionStyles);let r="";return t.active?t.crit?r+=" activeCrit":r=" active":t.done?r=t.crit?" doneCrit":" done":t.crit&&(r+=" crit"),0===r.length&&(r=" task"),t.milestone&&(r=" milestone "+r),r+=n,r+=" "+e,"task"+r})),u.append("text").attr("id",(function(t){return t.id+"-text"})).text((function(t){return t.task})).attr("font-size",i.fontSize).attr("x",(function(t){let e=y(t.startTime),n=y(t.renderEndTime||t.endTime);t.milestone&&(e+=.5*(y(t.endTime)-y(t.startTime))-.5*o),t.milestone&&(n=e+o);const r=this.getBBox().width;return r>n-e?n+r+1.5*i.leftPadding>c?e+s-5:n+s+5:(n-e)/2+e+s})).attr("y",(function(t,e){return t.order*n+i.barHeight/2+(i.fontSize/2-2)+a})).attr("text-height",o).attr("class",(function(t){const e=y(t.startTime);let n=y(t.endTime);t.milestone&&(n=e+o);const r=this.getBBox().width;let a="";t.classes.length>0&&(a=t.classes.join(" "));let s=0;for(const[e,n]of d.entries())t.type===n&&(s=e%i.numberSectionStyles);let l="";return t.active&&(l=t.crit?"activeCritText"+s:"activeText"+s),t.done?l=t.crit?l+" doneCritText"+s:l+" doneText"+s:t.crit&&(l=l+" critText"+s),t.milestone&&(l+=" milestoneText"),r>n-e?n+r+1.5*i.leftPadding>c?a+" taskTextOutsideLeft taskTextOutside"+s+" "+l:a+" taskTextOutsideRight taskTextOutside"+s+" "+l+" width-"+r:a+" taskText taskText"+s+" "+l+" width-"+r}));if("sandbox"===Hn().securityLevel){let t;t=Oa("#i"+e);const n=t.nodes()[0].contentDocument;u.filter((function(t){return p.has(t.id)})).each((function(t){var e=n.querySelector("#"+t.id),r=n.querySelector("#"+t.id+"-text");const i=e.parentNode;var a=n.createElement("a");a.setAttribute("xlink:href",p.get(t.id)),a.setAttribute("target","_top"),i.appendChild(a),a.appendChild(e),a.appendChild(r)}))}}function w(t,e,n,a,s,o,l,c){if(0===l.length&&0===c.length)return;let h,u;for(const{startTime:t,endTime:e}of o)(void 0===h||tu)&&(u=e);if(!h||!u)return;if((0,Drt.default)(u).diff((0,Drt.default)(h),"year")>5)return void m.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");const d=r.db.getDateFormat(),p=[];let g=null,v=(0,Drt.default)(h);for(;v.valueOf()<=u;)r.db.isInvalidDate(v,d,l,c)?g?g.end=v:g={start:v,end:v}:g&&(p.push(g),g=null),v=v.add(1,"d");f.append("g").selectAll("rect").data(p).enter().append("rect").attr("id",(function(t){return"exclude-"+t.start.format("YYYY-MM-DD")})).attr("x",(function(t){return y(t.start)+n})).attr("y",i.gridLineStartPadding).attr("width",(function(t){const e=t.end.add(1,"day");return y(e)-y(t.start)})).attr("height",s-e-i.gridLineStartPadding).attr("transform-origin",(function(e,r){return(y(e.start)+n+.5*(y(e.end)-y(e.start))).toString()+"px "+(r*t+.5*s).toString()+"px"})).attr("class","exclude-range")}function k(t,e,n,a){let s=Dr(y).tickSize(-a+e+i.gridLineStartPadding).tickFormat(Gl(r.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(null!==o){const t=o[1],e=o[2],n=r.db.getWeekday()||i.weekday;switch(e){case"millisecond":s.ticks(al.every(t));break;case"second":s.ticks(sl.every(t));break;case"minute":s.ticks(ol.every(t));break;case"hour":s.ticks(cl.every(t));break;case"day":s.ticks(ul.every(t));break;case"week":s.ticks(Prt[n].every(t));break;case"month":s.ticks(Nl.every(t))}}if(f.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(s).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let n=Rr(y).tickSize(-a+e+i.gridLineStartPadding).tickFormat(Gl(r.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));if(null!==o){const t=o[1],e=o[2],a=r.db.getWeekday()||i.weekday;switch(e){case"millisecond":n.ticks(al.every(t));break;case"second":n.ticks(sl.every(t));break;case"minute":n.ticks(ol.every(t));break;case"hour":n.ticks(cl.every(t));break;case"day":n.ticks(ul.every(t));break;case"week":n.ticks(Prt[a].every(t));break;case"month":n.ticks(Nl.every(t))}}f.append("g").attr("class","grid").attr("transform","translate("+t+", "+e+")").call(n).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}function T(t,e){let n=0;const r=Object.keys(p).map((t=>[t,p[t]]));f.append("g").selectAll("text").data(r).enter().append((function(t){const e=t[0].split(_n.lineBreakRegex),n=-(e.length-1)/2,r=c.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("dy",n+"em");for(const[t,n]of e.entries()){const e=c.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttribute("alignment-baseline","central"),e.setAttribute("x","10"),t>0&&e.setAttribute("dy","1em"),e.textContent=n,r.appendChild(e)}return r})).attr("x",10).attr("y",(function(i,a){if(!(a>0))return i[1]*t/2+e;for(let s=0;s`\n .mermaid-main-font {\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n\n .exclude-range {\n fill: ${t.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${t.sectionBkgColor};\n }\n\n .section2 {\n fill: ${t.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${t.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${t.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n }\n\n .grid .tick text {\n font-family: ${t.fontFamily};\n fill: ${t.textColor};\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${t.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n\n .taskTextOutsideLeft {\n fill: ${t.taskTextDarkColor};\n text-anchor: end;\n }\n\n\n /* Special case clickable */\n\n .task.clickable {\n cursor: pointer;\n }\n\n .taskText.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${t.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${t.taskBkgColor};\n stroke: ${t.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${t.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${t.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${t.activeTaskBkgColor};\n stroke: ${t.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${t.doneTaskBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.titleColor||t.textColor};\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n`),"getStyles")},zrt=Object.freeze({__proto__:null,diagram:Frt}),Urt={parse:s((async t=>{const e=await Att("info",t);m.debug(e)}),"parse")},Grt="11.4.1",qrt={getVersion:s((()=>Grt),"getVersion")},jrt=s(((t,e,n)=>{m.debug("rendering info diagram\n"+t);const r=zp(e);Sn(r,100,400,!0);r.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)}),"draw"),Yrt={parser:Urt,db:qrt,renderer:{draw:jrt}},Wrt=Object.freeze({__proto__:null,diagram:Yrt}),Hrt=Ct.pie,Vrt={sections:new Map,showData:!1,config:Hrt},Xrt=Vrt.sections,Krt=Vrt.showData,Zrt=structuredClone(Hrt),Qrt=s((()=>structuredClone(Zrt)),"getConfig"),Jrt=s((()=>{Xrt=new Map,Krt=Vrt.showData,$n()}),"clear"),tit=s((({label:t,value:e})=>{Xrt.has(t)||(Xrt.set(t,e),m.debug(`added new section: ${t}, with value: ${e}`))}),"addSection"),eit={getConfig:Qrt,clear:Jrt,setDiagramTitle:qn,getDiagramTitle:jn,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,addSection:tit,getSections:s((()=>Xrt),"getSections"),setShowData:s((t=>{Krt=t}),"setShowData"),getShowData:s((()=>Krt),"getShowData")},nit=s(((t,e)=>{jX(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)}),"populateDb"),rit={parse:s((async t=>{const e=await Att("pie",t);m.debug(e),nit(e,eit)}),"parse")},iit=s((t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`),"getStyles"),ait=s((t=>{const e=[...t.entries()].map((t=>({label:t[0],value:t[1]}))).sort(((t,e)=>e.value-t.value));return Qh().value((t=>t.value))(e)}),"createPieArcs"),sit=s(((t,e,n,r)=>{m.debug("rendering pie chart\n"+t);const i=r.db,a=Hn(),s=mk(i.getConfig(),a.pie),o=18,l=450,c=zp(e),h=c.append("g");h.attr("transform","translate(225,225)");const{themeVariables:u}=a;let[d]=fk(u.pieOuterStrokeWidth);d??=2;const p=s.textPosition,g=Math.min(450,l)/2-40,f=qh().innerRadius(0).outerRadius(g),y=qh().innerRadius(g*p).outerRadius(g*p);h.append("circle").attr("cx",0).attr("cy",0).attr("r",g+d/2).attr("class","pieOuterCircle");const v=i.getSections(),x=ait(v),b=yo([u.pie1,u.pie2,u.pie3,u.pie4,u.pie5,u.pie6,u.pie7,u.pie8,u.pie9,u.pie10,u.pie11,u.pie12]);h.selectAll("mySlices").data(x).enter().append("path").attr("d",f).attr("fill",(t=>b(t.data.label))).attr("class","pieCircle");let w=0;v.forEach((t=>{w+=t})),h.selectAll("mySlices").data(x).enter().append("text").text((t=>(t.data.value/w*100).toFixed(0)+"%")).attr("transform",(t=>"translate("+y.centroid(t)+")")).style("text-anchor","middle").attr("class","slice"),h.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const k=h.selectAll(".legend").data(b.domain()).enter().append("g").attr("class","legend").attr("transform",((t,e)=>"translate(216,"+(22*e-22*b.domain().length/2)+")"));k.append("rect").attr("width",o).attr("height",o).style("fill",b).style("stroke",b),k.data(x).append("text").attr("x",22).attr("y",14).text((t=>{const{label:e,value:n}=t.data;return i.getShowData()?`${e} [${n}]`:e}));const T=Math.max(...k.selectAll("text").nodes().map((t=>t?.getBoundingClientRect().width??0))),_=512+T;c.attr("viewBox",`0 0 ${_} 450`),Sn(c,l,_,s.useMaxWidth)}),"draw"),oit={parser:rit,db:eit,renderer:{draw:sit},styles:iit},lit=Object.freeze({__proto__:null,diagram:oit}),cit=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[1,7],o=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],h=[2,36],u=[1,37],d=[1,36],p=[1,38],g=[1,35],f=[1,43],m=[1,41],y=[1,14],v=[1,23],x=[1,18],b=[1,19],w=[1,20],k=[1,21],T=[1,22],_=[1,24],E=[1,25],C=[1,26],S=[1,27],A=[1,28],L=[1,29],N=[1,32],I=[1,33],M=[1,34],R=[1,39],D=[1,40],O=[1,42],P=[1,44],B=[1,62],$=[1,61],F=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],z=[1,65],U=[1,66],G=[1,67],q=[1,68],j=[1,69],Y=[1,70],W=[1,71],H=[1,72],V=[1,73],X=[1,74],K=[1,75],Z=[1,76],Q=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,90],tt=[1,91],et=[1,92],nt=[1,99],rt=[1,93],it=[1,96],at=[1,94],st=[1,95],ot=[1,97],lt=[1,98],ct=[1,102],ht=[10,55,56,57],ut=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],dt={trace:s((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],[59,1],[59,1],[59,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 23:case 68:this.$=a[o];break;case 24:case 69:this.$=a[o-1]+""+a[o];break;case 26:this.$=a[o-1]+a[o];break;case 27:this.$=[a[o].trim()];break;case 28:a[o-2].push(a[o].trim()),this.$=a[o-2];break;case 29:this.$=a[o-4],r.addClass(a[o-2],a[o]);break;case 37:this.$=[];break;case 42:this.$=a[o].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 47:r.addPoint(a[o-3],"",a[o-1],a[o],[]);break;case 48:r.addPoint(a[o-4],a[o-3],a[o-1],a[o],[]);break;case 49:r.addPoint(a[o-4],"",a[o-2],a[o-1],a[o]);break;case 50:r.addPoint(a[o-5],a[o-4],a[o-2],a[o-1],a[o]);break;case 51:r.setXAxisLeftText(a[o-2]),r.setXAxisRightText(a[o]);break;case 52:a[o-1].text+=" ⟶ ",r.setXAxisLeftText(a[o-1]);break;case 53:r.setXAxisLeftText(a[o]);break;case 54:r.setYAxisBottomText(a[o-2]),r.setYAxisTopText(a[o]);break;case 55:a[o-1].text+=" ⟶ ",r.setYAxisBottomText(a[o-1]);break;case 56:r.setYAxisBottomText(a[o]);break;case 57:r.setQuadrant1Text(a[o]);break;case 58:r.setQuadrant2Text(a[o]);break;case 59:r.setQuadrant3Text(a[o]);break;case 60:r.setQuadrant4Text(a[o]);break;case 64:case 66:this.$={text:a[o],type:"text"};break;case 65:this.$={text:a[o-1].text+""+a[o],type:a[o-1].type};break;case 67:this.$={text:a[o],type:"markdown"}}}),"anonymous"),table:[{18:e,26:1,27:2,28:n,55:r,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:n,55:r,56:i,57:a},{18:e,26:9,27:2,28:n,55:r,56:i,57:a},t(o,[2,33],{29:10}),t(l,[2,61]),t(l,[2,62]),t(l,[2,63]),{1:[2,30]},{1:[2,31]},t(c,h,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:d,10:p,12:g,13:f,14:m,18:y,25:v,35:x,37:b,39:w,41:k,42:T,48:_,50:E,51:C,52:S,53:A,54:L,60:N,61:I,63:M,64:R,65:D,66:O,67:P}),t(o,[2,34]),{27:45,55:r,56:i,57:a},t(c,[2,37]),t(c,h,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:u,5:d,10:p,12:g,13:f,14:m,18:y,25:v,35:x,37:b,39:w,41:k,42:T,48:_,50:E,51:C,52:S,53:A,54:L,60:N,61:I,63:M,64:R,65:D,66:O,67:P}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(c,[2,45]),t(c,[2,46]),{18:[1,50]},{4:u,5:d,10:p,12:g,13:f,14:m,43:51,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:52,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:53,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:54,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:55,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:56,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,44:[1,57],47:[1,58],58:60,59:59,63:M,64:R,65:D,66:O,67:P},t(F,[2,64]),t(F,[2,66]),t(F,[2,67]),t(F,[2,70]),t(F,[2,71]),t(F,[2,72]),t(F,[2,73]),t(F,[2,74]),t(F,[2,75]),t(F,[2,76]),t(F,[2,77]),t(F,[2,78]),t(F,[2,79]),t(F,[2,80]),t(o,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:64,4:z,5:U,6:G,7:q,8:j,9:Y,10:W,11:H,12:V,13:X,14:K,15:Z,21:63},t(c,[2,53],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,49:[1,77],63:M,64:R,65:D,66:O,67:P}),t(c,[2,56],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,49:[1,78],63:M,64:R,65:D,66:O,67:P}),t(c,[2,57],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,58],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,59],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,60],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),{45:[1,79]},{44:[1,80]},t(F,[2,65]),t(F,[2,81]),t(F,[2,82]),t(F,[2,83]),{3:82,4:z,5:U,6:G,7:q,8:j,9:Y,10:W,11:H,12:V,13:X,14:K,15:Z,18:[1,81]},t(Q,[2,23]),t(Q,[2,1]),t(Q,[2,2]),t(Q,[2,3]),t(Q,[2,4]),t(Q,[2,5]),t(Q,[2,6]),t(Q,[2,7]),t(Q,[2,8]),t(Q,[2,9]),t(Q,[2,10]),t(Q,[2,11]),t(Q,[2,12]),t(c,[2,52],{58:31,43:83,4:u,5:d,10:p,12:g,13:f,14:m,60:N,61:I,63:M,64:R,65:D,66:O,67:P}),t(c,[2,55],{58:31,43:84,4:u,5:d,10:p,12:g,13:f,14:m,60:N,61:I,63:M,64:R,65:D,66:O,67:P}),{46:[1,85]},{45:[1,86]},{4:J,5:tt,6:et,8:nt,11:rt,13:it,16:89,17:at,18:st,19:ot,20:lt,22:88,23:87},t(Q,[2,24]),t(c,[2,51],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,54],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,47],{22:88,16:89,23:100,4:J,5:tt,6:et,8:nt,11:rt,13:it,17:at,18:st,19:ot,20:lt}),{46:[1,101]},t(c,[2,29],{10:ct}),t(ht,[2,27],{16:103,4:J,5:tt,6:et,8:nt,11:rt,13:it,17:at,18:st,19:ot,20:lt}),t(ut,[2,25]),t(ut,[2,13]),t(ut,[2,14]),t(ut,[2,15]),t(ut,[2,16]),t(ut,[2,17]),t(ut,[2,18]),t(ut,[2,19]),t(ut,[2,20]),t(ut,[2,21]),t(ut,[2,22]),t(c,[2,49],{10:ct}),t(c,[2,48],{22:88,16:89,23:104,4:J,5:tt,6:et,8:nt,11:rt,13:it,17:at,18:st,19:ot,20:lt}),{4:J,5:tt,6:et,8:nt,11:rt,13:it,16:89,17:at,18:st,19:ot,20:lt,22:105},t(ut,[2,26]),t(c,[2,50],{10:ct}),t(ht,[2,28],{16:103,4:J,5:tt,6:et,8:nt,11:rt,13:it,17:at,18:st,19:ot,20:lt})],defaultActions:{8:[2,30],9:[2,31]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},pt=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 1:case 3:break;case 2:return 55;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:case 23:case 25:case 31: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 24:this.begin("string");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 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 11;case 37:return 64;case 38:return 10;case 39:case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51: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,/^(?::)/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],inclusive:!0}}};return t}();function gt(){this.yy={}}return dt.lexer=pt,s(gt,"Parser"),gt.prototype=dt,dt.Parser=gt,new gt}();cit.parser=cit;var hit=cit,uit=yt(),dit=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{s(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:Ct.quadrantChart?.chartWidth||500,chartWidth:Ct.quadrantChart?.chartHeight||500,titlePadding:Ct.quadrantChart?.titlePadding||10,titleFontSize:Ct.quadrantChart?.titleFontSize||20,quadrantPadding:Ct.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:Ct.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:Ct.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:Ct.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:Ct.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:Ct.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:Ct.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:Ct.quadrantChart?.pointTextPadding||5,pointLabelFontSize:Ct.quadrantChart?.pointLabelFontSize||12,pointRadius:Ct.quadrantChart?.pointRadius||5,xAxisPosition:Ct.quadrantChart?.xAxisPosition||"top",yAxisPosition:Ct.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:Ct.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:Ct.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:uit.quadrant1Fill,quadrant2Fill:uit.quadrant2Fill,quadrant3Fill:uit.quadrant3Fill,quadrant4Fill:uit.quadrant4Fill,quadrant1TextFill:uit.quadrant1TextFill,quadrant2TextFill:uit.quadrant2TextFill,quadrant3TextFill:uit.quadrant3TextFill,quadrant4TextFill:uit.quadrant4TextFill,quadrantPointFill:uit.quadrantPointFill,quadrantPointTextFill:uit.quadrantPointTextFill,quadrantXAxisTextFill:uit.quadrantXAxisTextFill,quadrantYAxisTextFill:uit.quadrantYAxisTextFill,quadrantTitleFill:uit.quadrantTitleFill,quadrantInternalBorderStrokeFill:uit.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:uit.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,m.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,e){this.classes.set(t,e)}setConfig(t){m.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){m.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,e,n,r){const i=2*this.config.xAxisLabelPadding+this.config.xAxisLabelFontSize,a={top:"top"===t&&e?i:0,bottom:"bottom"===t&&e?i:0},s=2*this.config.yAxisLabelPadding+this.config.yAxisLabelFontSize,o={left:"left"===this.config.yAxisPosition&&n?s:0,right:"right"===this.config.yAxisPosition&&n?s:0},l=this.config.titleFontSize+2*this.config.titlePadding,c={top:r?l:0},h=this.config.quadrantPadding+o.left,u=this.config.quadrantPadding+a.top+c.top,d=this.config.chartWidth-2*this.config.quadrantPadding-o.left-o.right,p=this.config.chartHeight-2*this.config.quadrantPadding-a.top-a.bottom-c.top;return{xAxisSpace:a,yAxisSpace:o,titleSpace:c,quadrantSpace:{quadrantLeft:h,quadrantTop:u,quadrantWidth:d,quadrantHalfWidth:d/2,quadrantHeight:p,quadrantHalfHeight:p/2}}}getAxisLabels(t,e,n,r){const{quadrantSpace:i,titleSpace:a}=r,{quadrantHalfHeight:s,quadrantHeight:o,quadrantLeft:l,quadrantHalfWidth:c,quadrantTop:h,quadrantWidth:u}=i,d=Boolean(this.data.xAxisRightText),p=Boolean(this.data.yAxisTopText),g=[];return this.data.xAxisLeftText&&e&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(d?c/2:0),y:"top"===t?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&e&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+c+(d?c/2:0),y:"top"===t?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+u+this.config.quadrantPadding,y:h+o-(p?s/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+u+this.config.quadrantPadding,y:h+s-(p?s/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(t){const{quadrantSpace:e}=t,{quadrantHalfHeight:n,quadrantLeft:r,quadrantHalfWidth:i,quadrantTop:a}=e,s=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+i,y:a,width:i,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:r,y:a,width:i,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:r,y:a+n,width:i,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:r+i,y:a+n,width:i,height:n,fill:this.themeConfig.quadrant4Fill}];for(const t of s)t.text.x=t.x+t.width/2,0===this.data.points.length?(t.text.y=t.y+t.height/2,t.text.horizontalPos="middle"):(t.text.y=t.y+this.config.quadrantTextTopPadding,t.text.horizontalPos="top");return s}getQuadrantPoints(t){const{quadrantSpace:e}=t,{quadrantHeight:n,quadrantLeft:r,quadrantTop:i,quadrantWidth:a}=e,s=el().domain([0,1]).range([r,a+r]),o=el().domain([0,1]).range([n+i,i]),l=this.data.points.map((t=>{const e=this.classes.get(t.className);e&&(t={...e,...t});return{x:s(t.x),y:o(t.y),fill:t.color??this.themeConfig.quadrantPointFill,radius:t.radius??this.config.pointRadius,text:{text:t.text,fill:this.themeConfig.quadrantPointTextFill,x:s(t.x),y:o(t.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:t.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:t.strokeWidth??"0px"}}));return l}getBorders(t){const e=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=t,{quadrantHalfHeight:r,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:s,quadrantTop:o,quadrantWidth:l}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-e,y1:o,x2:a+l+e,y2:o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+l,y1:o+e,x2:a+l,y2:o+i-e},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-e,y1:o+i,x2:a+l+e,y2:o+i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:o+e,x2:a,y2:o+i-e},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+s,y1:o+e,x2:a+s,y2:o+i-e},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+e,y1:o+r,x2:a+l-e,y2:o+r}]}getTitle(t){if(t)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 t=this.config.showXAxis&&!(!this.data.xAxisLeftText&&!this.data.xAxisRightText),e=this.config.showYAxis&&!(!this.data.yAxisTopText&&!this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,r=this.data.points.length>0?"bottom":this.config.xAxisPosition,i=this.calculateSpace(r,t,e,n);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(r,t,e,i),borderLines:this.getBorders(i),title:this.getTitle(n)}}},pit=class extends Error{static{s(this,"InvalidStyleError")}constructor(t,e,n){super(`value for ${t} ${e} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}};function git(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}function fit(t){return!/^\d+$/.test(t)}function mit(t){return!/^\d+px$/.test(t)}s(git,"validateHexCode"),s(fit,"validateNumber"),s(mit,"validateSizeInPixels");var yit=Hn();function vit(t){return an(t.trim(),yit)}s(vit,"textSanitizer");var xit=new dit;function bit(t){xit.setData({quadrant1Text:vit(t.text)})}function wit(t){xit.setData({quadrant2Text:vit(t.text)})}function kit(t){xit.setData({quadrant3Text:vit(t.text)})}function Tit(t){xit.setData({quadrant4Text:vit(t.text)})}function _it(t){xit.setData({xAxisLeftText:vit(t.text)})}function Eit(t){xit.setData({xAxisRightText:vit(t.text)})}function Cit(t){xit.setData({yAxisTopText:vit(t.text)})}function Sit(t){xit.setData({yAxisBottomText:vit(t.text)})}function Ait(t){const e={};for(const n of t){const[t,r]=n.trim().split(/\s*:\s*/);if("radius"===t){if(fit(r))throw new pit(t,r,"number");e.radius=parseInt(r)}else if("color"===t){if(git(r))throw new pit(t,r,"hex code");e.color=r}else if("stroke-color"===t){if(git(r))throw new pit(t,r,"hex code");e.strokeColor=r}else{if("stroke-width"!==t)throw new Error(`style named ${t} is not supported.`);if(mit(r))throw new pit(t,r,"number of pixels (eg. 10px)");e.strokeWidth=r}}return e}function Lit(t,e,n,r,i){const a=Ait(i);xit.addPoints([{x:n,y:r,text:vit(t.text),className:e,...a}])}function Nit(t,e){xit.addClass(t,Ait(e))}function Iit(t){xit.setConfig({chartWidth:t})}function Mit(t){xit.setConfig({chartHeight:t})}function Rit(){const t=Hn(),{themeVariables:e,quadrantChart:n}=t;return n&&xit.setConfig(n),xit.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}),xit.setData({titleText:jn()}),xit.build()}s(bit,"setQuadrant1Text"),s(wit,"setQuadrant2Text"),s(kit,"setQuadrant3Text"),s(Tit,"setQuadrant4Text"),s(_it,"setXAxisLeftText"),s(Eit,"setXAxisRightText"),s(Cit,"setYAxisTopText"),s(Sit,"setYAxisBottomText"),s(Ait,"parseStyles"),s(Lit,"addPoint"),s(Nit,"addClass"),s(Iit,"setWidth"),s(Mit,"setHeight"),s(Rit,"getQuadrantData");var Dit={setWidth:Iit,setHeight:Mit,setQuadrant1Text:bit,setQuadrant2Text:wit,setQuadrant3Text:kit,setQuadrant4Text:Tit,setXAxisLeftText:_it,setXAxisRightText:Eit,setYAxisTopText:Cit,setYAxisBottomText:Sit,parseStyles:Ait,addPoint:Lit,addClass:Nit,getQuadrantData:Rit,clear:s((function(){xit.clear(),$n()}),"clear"),setAccTitle:Fn,getAccTitle:zn,setDiagramTitle:qn,getDiagramTitle:jn,getAccDescription:Gn,setAccDescription:Un},Oit=s(((t,e,n,r)=>{function i(t){return"top"===t?"hanging":"middle"}function a(t){return"left"===t?"start":"middle"}function o(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}s(i,"getDominantBaseLine"),s(a,"getTextAnchor"),s(o,"getTransformation");const l=Hn();m.debug("Rendering quadrant chart\n"+t);const c=l.securityLevel;let h;"sandbox"===c&&(h=Oa("#i"+e));const u=Oa("sandbox"===c?h.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),d=u.append("g").attr("class","main"),p=l.quadrantChart?.chartWidth??500,g=l.quadrantChart?.chartHeight??500;Sn(u,g,p,l.quadrantChart?.useMaxWidth??!0),u.attr("viewBox","0 0 "+p+" "+g),r.db.setHeight(g),r.db.setWidth(p);const f=r.db.getQuadrantData(),y=d.append("g").attr("class","quadrants"),v=d.append("g").attr("class","border"),x=d.append("g").attr("class","data-points"),b=d.append("g").attr("class","labels"),w=d.append("g").attr("class","title");f.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",f.title.fill).attr("font-size",f.title.fontSize).attr("dominant-baseline",i(f.title.horizontalPos)).attr("text-anchor",a(f.title.verticalPos)).attr("transform",o(f.title)).text(f.title.text),f.borderLines&&v.selectAll("line").data(f.borderLines).enter().append("line").attr("x1",(t=>t.x1)).attr("y1",(t=>t.y1)).attr("x2",(t=>t.x2)).attr("y2",(t=>t.y2)).style("stroke",(t=>t.strokeFill)).style("stroke-width",(t=>t.strokeWidth));const k=y.selectAll("g.quadrant").data(f.quadrants).enter().append("g").attr("class","quadrant");k.append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)),k.append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>i(t.text.horizontalPos))).attr("text-anchor",(t=>a(t.text.verticalPos))).attr("transform",(t=>o(t.text))).text((t=>t.text.text));b.selectAll("g.label").data(f.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text((t=>t.text)).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>i(t.horizontalPos))).attr("text-anchor",(t=>a(t.verticalPos))).attr("transform",(t=>o(t)));const T=x.selectAll("g.data-point").data(f.points).enter().append("g").attr("class","data-point");T.append("circle").attr("cx",(t=>t.x)).attr("cy",(t=>t.y)).attr("r",(t=>t.radius)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeColor)).attr("stroke-width",(t=>t.strokeWidth)),T.append("text").attr("x",0).attr("y",0).text((t=>t.text.text)).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>i(t.text.horizontalPos))).attr("text-anchor",(t=>a(t.text.verticalPos))).attr("transform",(t=>o(t.text)))}),"draw"),Pit={parser:hit,db:Dit,renderer:{draw:Oit},styles:s((()=>""),"styles")},Bit=Object.freeze({__proto__:null,diagram:Pit}),$it=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,10,12,14,16,18,19,21,23],n=[2,6],r=[1,3],i=[1,5],a=[1,6],o=[1,7],l=[1,5,10,12,14,16,18,19,21,23,34,35,36],c=[1,25],h=[1,26],u=[1,28],d=[1,29],p=[1,30],g=[1,31],f=[1,32],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],w=[1,43],k=[1,42],T=[1,47],_=[1,50],E=[1,10,12,14,16,18,19,21,23,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],A=[1,64],L={trace:s((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,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$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",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"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],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 5:r.setOrientation(a[o]);break;case 9:r.setDiagramTitle(a[o].text.trim());break;case 12:r.setLineData({text:"",type:"text"},a[o]);break;case 13:r.setLineData(a[o-1],a[o]);break;case 14:r.setBarData({text:"",type:"text"},a[o]);break;case 15:r.setBarData(a[o-1],a[o]);break;case 16:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 19:case 27:this.$=a[o-1];break;case 20:this.$=[Number(a[o-2]),...a[o]];break;case 21:this.$=[Number(a[o])];break;case 22:r.setXAxisTitle(a[o]);break;case 23:r.setXAxisTitle(a[o-1]);break;case 24:r.setXAxisTitle({type:"text",text:""});break;case 25:r.setXAxisBand(a[o]);break;case 26:r.setXAxisRangeData(Number(a[o-2]),Number(a[o]));break;case 28:this.$=[a[o-2],...a[o]];break;case 29:this.$=[a[o]];break;case 30:r.setYAxisTitle(a[o]);break;case 31:r.setYAxisTitle(a[o-1]);break;case 32:r.setYAxisTitle({type:"text",text:""});break;case 33:r.setYAxisRangeData(Number(a[o-2]),Number(a[o]));break;case 37:case 38:this.$={text:a[o],type:"text"};break;case 39:this.$={text:a[o],type:"markdown"};break;case 40:this.$=a[o];break;case 41:this.$=a[o-1]+""+a[o]}}),"anonymous"),table:[t(e,n,{3:1,4:2,7:4,5:r,34:i,35:a,36:o}),{1:[3]},t(e,n,{4:2,7:4,3:8,5:r,34:i,35:a,36:o}),t(e,n,{4:2,7:4,6:9,3:10,5:r,8:[1,11],34:i,35:a,36:o}),{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(l,[2,34]),t(l,[2,35]),t(l,[2,36]),{1:[2,1]},t(e,n,{4:2,7:4,3:21,5:r,34:i,35:a,36:o}),{1:[2,3]},t(l,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:o}),{11:23,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:39,13:38,24:w,27:k,29:40,30:41,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:45,15:44,27:T,33:46,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:49,17:48,24:_,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:52,17:51,24:_,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(C,[2,37],{40:55,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b}),t(C,[2,38]),t(C,[2,39]),t(S,[2,40]),t(S,[2,42]),t(S,[2,43]),t(S,[2,44]),t(S,[2,45]),t(S,[2,46]),t(S,[2,47]),t(S,[2,48]),t(S,[2,49]),t(S,[2,50]),t(S,[2,51]),t(E,[2,10]),t(E,[2,22],{30:41,29:56,24:w,27:k}),t(E,[2,24]),t(E,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},t(E,[2,11]),t(E,[2,30],{33:60,27:T}),t(E,[2,32]),{31:[1,61]},t(E,[2,12]),{17:62,24:_},{25:63,27:A},t(E,[2,14]),{17:65,24:_},t(E,[2,16]),t(E,[2,17]),t(S,[2,41]),t(E,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(E,[2,31]),{27:[1,69]},t(E,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(E,[2,15]),t(E,[2,26]),t(E,[2,27]),{11:59,32:72,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},t(E,[2,33]),t(E,[2,19]),{25:73,27:A},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},N=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 1:case 5:case 43:break;case 2:case 3:return this.popState(),34;case 4:return 34;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:case 25:case 27:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 26:this.pushState("string");break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 44:return 35;case 45:return 36}}),"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,/^(?:(?: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,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],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:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return t}();function I(){this.yy={}}return L.lexer=N,s(I,"Parser"),I.prototype=L,L.Parser=I,new I}();$it.parser=$it;var Fit=$it;function zit(t){return"bar"===t.type}function Uit(t){return"band"===t.type}function Git(t){return"linear"===t.type}s(zit,"isBarPlot"),s(Uit,"isBandAxisData"),s(Git,"isLinearAxisData");var qit=class{constructor(t){this.parentGroup=t}static{s(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce(((t,e)=>Math.max(e.length,t)),0)*e,height:e};const n={width:0,height:0},r=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const i of t){const t=WT(r,1,i),a=t?t.width:i.length*e,s=t?t.height:e;n.width=Math.max(n.width,a),n.height=Math.max(n.height,s)}return r.remove(),n}},jit=class{constructor(t,e,n,r){this.axisConfig=t,this.title=e,this.textDimensionCalculator=n,this.axisThemeConfig=r,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.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{s(this,"BaseAxis")}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((t=>t.toString())),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let e=t.height;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),r=.2*t.width;this.outerPadding=Math.min(n.width/2,r);const i=n.height+2*this.axisConfig.labelPadding;this.labelTextHeight=n.height,i<=e&&(e-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,n<=e&&(e-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-e}calculateSpaceIfDrawnVertical(t){let e=t.width;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),r=.2*t.height;this.outerPadding=Math.min(n.height/2,r);const i=n.width+2*this.axisConfig.labelPadding;i<=e&&(e-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,n<=e&&(e-=n,this.showTitle=!0)}this.boundingRect.width=t.width-e,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${e},${this.boundingRect.y} L ${e},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((t=>({text:t.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(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"})))}),this.showTick){const e=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${e},${this.getScaleValue(t)} L ${e-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.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"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const e=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${e} L ${this.getScaleValue(t)},${e+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.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"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const e=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${e+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.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"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},Yit=class extends jit{static{s(this,"BandAxis")}constructor(t,e,n,r,i){super(t,r,i,e),this.categories=n,this.scale=dh().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=dh().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},Wit=class extends jit{static{s(this,"LinearAxis")}constructor(t,e,n,r,i){super(t,r,i,e),this.domain=n,this.scale=el().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=el().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function Hit(t,e,n,r){const i=new qit(r);return Uit(t)?new Yit(e,n,t.categories,t.title,i):new Wit(e,n,[t.min,t.max],t.title,i)}s(Hit,"getAxis");var Vit=class{constructor(t,e,n,r){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{s(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const e=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(e.width,t.width),r=e.height+2*this.chartConfig.titlePadding;return e.width<=n&&e.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.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}]}),t}};function Xit(t,e,n,r){const i=new qit(r);return new Vit(i,t,e,n)}s(Xit,"getChartTitleComponent");var Kit=class{constructor(t,e,n,r,i){this.plotData=t,this.xAxis=e,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{s(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]));let e;return e="horizontal"===this.orientation?Xh().y((t=>t[0])).x((t=>t[1]))(t):Xh().x((t=>t[0])).y((t=>t[1]))(t),e?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},Zit=class{constructor(t,e,n,r,i,a){this.barData=t,this.boundingRect=e,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{s(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])])),e=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),n=e/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:this.boundingRect.x,y:t[0]-n,height:e,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:t[0]-n,y:t[1],width:e,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}},Qit=class{constructor(t,e,n){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{s(this,"BasePlot")}setAxes(t,e){this.xAxis=t,this.yAxis=e}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.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 t=[];for(const[e,n]of this.chartData.plots.entries())switch(n.type){case"line":{const r=new Kit(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...r.getDrawableElement())}break;case"bar":{const r=new Zit(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...r.getDrawableElement())}}return t}};function Jit(t,e,n){return new Qit(t,e,n)}s(Jit,"getPlotComponent");var tat,eat=class{constructor(t,e,n,r){this.chartConfig=t,this.chartData=e,this.componentStore={title:Xit(t,e,n,r),plot:Jit(t,e,n),xAxis:Hit(e.xAxis,t.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:Hit(e.yAxis,t.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{s(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,n=0,r=0,i=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:i,height:a});t-=s.width,e-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),r=s.height,e-=s.height,this.componentStore.xAxis.setAxisPosition("bottom"),s=this.componentStore.xAxis.calculateSpace({width:t,height:e}),e-=s.height,this.componentStore.yAxis.setAxisPosition("left"),s=this.componentStore.yAxis.calculateSpace({width:t,height:e}),n=s.width,t-=s.width,t>0&&(i+=t,t=0),e>0&&(a+=e,e=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some((t=>zit(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});t-=o.width,e-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),n=o.height,e-=o.height,this.componentStore.xAxis.setAxisPosition("left"),o=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=o.width,r=o.width,this.componentStore.yAxis.setAxisPosition("top"),o=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=o.height,i=n+o.height,t>0&&(a+=t,t=0),e>0&&(s+=e,e=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some((t=>zit(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const e of Object.values(this.componentStore))t.push(...e.getDrawableElements());return t}},nat=class{static{s(this,"XYChartBuilder")}static build(t,e,n,r){return new eat(t,e,n,r).getDrawableElement()}},rat=0,iat=uat(),aat=hat(),sat=dat(),oat=aat.plotColorPalette.split(",").map((t=>t.trim())),lat=!1,cat=!1;function hat(){const t=yt(),e=Ft();return mk(t.xyChart,e.themeVariables.xyChart)}function uat(){const t=Ft();return mk(Ct.xyChart,t.xyChart)}function dat(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function pat(t){const e=Ft();return an(t.trim(),e)}function gat(t){tat=t}function fat(t){iat.chartOrientation="horizontal"===t?"horizontal":"vertical"}function mat(t){sat.xAxis.title=pat(t.text)}function yat(t,e){sat.xAxis={type:"linear",title:sat.xAxis.title,min:t,max:e},lat=!0}function vat(t){sat.xAxis={type:"band",title:sat.xAxis.title,categories:t.map((t=>pat(t.text)))},lat=!0}function xat(t){sat.yAxis.title=pat(t.text)}function bat(t,e){sat.yAxis={type:"linear",title:sat.yAxis.title,min:t,max:e},cat=!0}function wat(t){const e=Math.min(...t),n=Math.max(...t),r=Git(sat.yAxis)?sat.yAxis.min:1/0,i=Git(sat.yAxis)?sat.yAxis.max:-1/0;sat.yAxis={type:"linear",title:sat.yAxis.title,min:Math.min(r,e),max:Math.max(i,n)}}function kat(t){let e=[];if(0===t.length)return e;if(!lat){const e=Git(sat.xAxis)?sat.xAxis.min:1/0,n=Git(sat.xAxis)?sat.xAxis.max:-1/0;yat(Math.min(e,1),Math.max(n,t.length))}if(cat||wat(t),Uit(sat.xAxis)&&(e=sat.xAxis.categories.map(((e,n)=>[e,t[n]]))),Git(sat.xAxis)){const n=sat.xAxis.min,r=sat.xAxis.max,i=(r-n)/(t.length-1),a=[];for(let t=n;t<=r;t+=i)a.push(`${t}`);e=a.map(((e,n)=>[e,t[n]]))}return e}function Tat(t){return oat[0===t?0:t%oat.length]}function _at(t,e){const n=kat(e);sat.plots.push({type:"line",strokeFill:Tat(rat),strokeWidth:2,data:n}),rat++}function Eat(t,e){const n=kat(e);sat.plots.push({type:"bar",fill:Tat(rat),data:n}),rat++}function Cat(){if(0===sat.plots.length)throw Error("No Plot to render, please provide a plot with some data");return sat.title=jn(),nat.build(iat,sat,aat,tat)}function Sat(){return aat}function Aat(){return iat}s(hat,"getChartDefaultThemeConfig"),s(uat,"getChartDefaultConfig"),s(dat,"getChartDefaultData"),s(pat,"textSanitizer"),s(gat,"setTmpSVGG"),s(fat,"setOrientation"),s(mat,"setXAxisTitle"),s(yat,"setXAxisRangeData"),s(vat,"setXAxisBand"),s(xat,"setYAxisTitle"),s(bat,"setYAxisRangeData"),s(wat,"setYAxisRangeFromPlotData"),s(kat,"transformDataWithoutCategory"),s(Tat,"getPlotColorFromPalette"),s(_at,"setLineData"),s(Eat,"setBarData"),s(Cat,"getDrawableElem"),s(Sat,"getChartThemeConfig"),s(Aat,"getChartConfig");var Lat=s((function(){$n(),rat=0,iat=uat(),sat={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},aat=hat(),oat=aat.plotColorPalette.split(",").map((t=>t.trim())),lat=!1,cat=!1}),"clear"),Nat={getDrawableElem:Cat,clear:Lat,setAccTitle:Fn,getAccTitle:zn,setDiagramTitle:qn,getDiagramTitle:jn,getAccDescription:Gn,setAccDescription:Un,setOrientation:fat,setXAxisTitle:mat,setXAxisRangeData:yat,setXAxisBand:vat,setYAxisTitle:xat,setYAxisRangeData:bat,setLineData:_at,setBarData:Eat,setTmpSVGG:gat,getChartThemeConfig:Sat,getChartConfig:Aat},Iat=s(((t,e,n,r)=>{const i=r.db,a=i.getChartThemeConfig(),o=i.getChartConfig();function l(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function h(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}s(l,"getDominantBaseLine"),s(c,"getTextAnchor"),s(h,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=zp(e),d=u.append("g").attr("class","main"),p=d.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");Sn(u,o.height,o.width,!0),u.attr("viewBox",`0 0 ${o.width} ${o.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),f={};function y(t){let e=d,n="";for(const[r]of t.entries()){let i=d;r>0&&f[n]&&(i=f[n]),n+=t[r],e=f[n],e||(e=f[n]=i.append("g").attr("class",t[r]))}return e}s(y,"getGroup");for(const t of g){if(0===t.data.length)continue;const e=y(t.groupTexts);switch(t.type){case"rect":e.selectAll("rect").data(t.data).enter().append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth));break;case"text":e.selectAll("text").data(t.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>l(t.verticalPos))).attr("text-anchor",(t=>c(t.horizontalPos))).attr("transform",(t=>h(t))).text((t=>t.text));break;case"path":e.selectAll("path").data(t.data).enter().append("path").attr("d",(t=>t.path)).attr("fill",(t=>t.fill?t.fill:"none")).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth))}}}),"draw"),Mat={parser:Fit,db:Nat,renderer:{draw:Iat}},Rat=Object.freeze({__proto__:null,diagram:Mat}),Dat=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],o=[1,18],l=[2,7],c=[1,22],h=[1,23],u=[1,24],d=[1,25],p=[1,26],g=[1,27],f=[1,20],m=[1,28],y=[1,29],v=[62,63],x=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],b=[1,47],w=[1,48],k=[1,49],T=[1,50],_=[1,51],E=[1,52],C=[1,53],S=[53,54],A=[1,64],L=[1,60],N=[1,61],I=[1,62],M=[1,63],R=[1,65],D=[1,69],O=[1,70],P=[1,67],B=[1,68],$=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],F={trace:s((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,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$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",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"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],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 4:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:r.addRequirement(a[o-3],a[o-4]);break;case 14:r.setNewReqId(a[o-2]);break;case 15:r.setNewReqText(a[o-2]);break;case 16:r.setNewReqRisk(a[o-2]);break;case 17:r.setNewReqVerifyMethod(a[o-2]);break;case 20:this.$=r.RequirementType.REQUIREMENT;break;case 21:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=r.RiskLevel.LOW_RISK;break;case 27:this.$=r.RiskLevel.MED_RISK;break;case 28:this.$=r.RiskLevel.HIGH_RISK;break;case 29:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=r.VerifyType.VERIFY_TEST;break;case 33:r.addElement(a[o-3]);break;case 34:r.setNewElementType(a[o-2]);break;case 35:r.setNewElementDocRef(a[o-2]);break;case 38:r.addRelationship(a[o-2],a[o],a[o-4]);break;case 39:r.addRelationship(a[o-2],a[o-4],a[o]);break;case 40:this.$=r.Relationships.CONTAINS;break;case 41:this.$=r.Relationships.COPIES;break;case 42:this.$=r.Relationships.DERIVES;break;case 43:this.$=r.Relationships.SATISFIES;break;case 44:this.$=r.Relationships.VERIFIES;break;case 45:this.$=r.Relationships.REFINES;break;case 46:this.$=r.Relationships.TRACES}}),"anonymous"),table:[{3:1,4:2,6:e,9:n,11:r,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:n,11:r,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:n,11:r,13:i},{1:[2,2]},{4:17,5:o,7:13,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:o,7:31,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{4:17,5:o,7:32,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{4:17,5:o,7:33,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{4:17,5:o,7:34,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{4:17,5:o,7:35,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},t(v,[2,20]),t(v,[2,21]),t(v,[2,22]),t(v,[2,23]),t(v,[2,24]),t(v,[2,25]),t(x,[2,49]),t(x,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:b,56:w,57:k,58:T,59:_,60:E,61:C},{52:54,55:b,56:w,57:k,58:T,59:_,60:E,61:C},{5:[1,55]},{5:[1,56]},{53:[1,57]},t(S,[2,40]),t(S,[2,41]),t(S,[2,42]),t(S,[2,43]),t(S,[2,44]),t(S,[2,45]),t(S,[2,46]),{54:[1,58]},{5:A,20:59,21:L,24:N,26:I,28:M,30:R},{5:D,30:O,46:66,47:P,49:B},{23:71,62:m,63:y},{23:72,62:m,63:y},t($,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:A,20:77,21:L,24:N,26:I,28:M,30:R},t($,[2,19]),t($,[2,33]),{22:[1,78]},{22:[1,79]},{5:D,30:O,46:80,47:P,49:B},t($,[2,37]),t($,[2,38]),t($,[2,39]),{23:81,62:m,63:y},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},t($,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},t($,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:A,20:106,21:L,24:N,26:I,28:M,30:R},{5:A,20:107,21:L,24:N,26:I,28:M,30:R},{5:A,20:108,21:L,24:N,26:I,28:M,30:R},{5:A,20:109,21:L,24:N,26:I,28:M,30:R},{5:D,30:O,46:110,47:P,49:B},{5:D,30:O,46:111,47:P,49:B},t($,[2,14]),t($,[2,15]),t($,[2,16]),t($,[2,17]),t($,[2,34]),t($,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},z=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){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:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}}),"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,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/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,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],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,50],inclusive:!0}}};return t}();function U(){this.yy={}}return F.lexer=z,s(U,"Parser"),U.prototype=F,F.Parser=U,new U}();Dat.parser=Dat;var Oat=Dat,Pat=[],Bat={},$at=new Map,Fat={},zat=new Map,Uat=s(((t,e)=>($at.has(t)||$at.set(t,{name:t,type:e,id:Bat.id,text:Bat.text,risk:Bat.risk,verifyMethod:Bat.verifyMethod}),Bat={},$at.get(t))),"addRequirement"),Gat=s((()=>$at),"getRequirements"),qat=s((t=>{void 0!==Bat&&(Bat.id=t)}),"setNewReqId"),jat=s((t=>{void 0!==Bat&&(Bat.text=t)}),"setNewReqText"),Yat=s((t=>{void 0!==Bat&&(Bat.risk=t)}),"setNewReqRisk"),Wat=s((t=>{void 0!==Bat&&(Bat.verifyMethod=t)}),"setNewReqVerifyMethod"),Hat=s((t=>(zat.has(t)||(zat.set(t,{name:t,type:Fat.type,docRef:Fat.docRef}),m.info("Added new requirement: ",t)),Fat={},zat.get(t))),"addElement"),Vat=s((()=>zat),"getElements"),Xat=s((t=>{void 0!==Fat&&(Fat.type=t)}),"setNewElementType"),Kat=s((t=>{void 0!==Fat&&(Fat.docRef=t)}),"setNewElementDocRef"),Zat=s(((t,e,n)=>{Pat.push({type:t,src:e,dst:n})}),"addRelationship"),Qat=s((()=>Pat),"getRelationships"),Jat=s((()=>{Pat=[],Bat={},$at=new Map,Fat={},zat=new Map,$n()}),"clear"),tst={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:s((()=>Hn().req),"getConfig"),addRequirement:Uat,getRequirements:Gat,setNewReqId:qat,setNewReqText:jat,setNewReqRisk:Yat,setNewReqVerifyMethod:Wat,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,addElement:Hat,getElements:Vat,setNewElementType:Xat,setNewElementDocRef:Kat,addRelationship:Zat,getRelationships:Qat,clear:Jat},est=s((t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`),"getStyles"),nst={CONTAINS:"contains",ARROW:"arrow"},rst={ReqMarkers:nst,insertLineEndings:s(((t,e)=>{let n=t.append("defs").append("marker").attr("id",nst.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");n.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),n.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),n.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",nst.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)}),"insertLineEndings")},ist={},ast=0,sst=s(((t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",ist.rect_min_width+"px").attr("height",ist.rect_min_height+"px")),"newRectNode"),ost=s(((t,e,n)=>{let r=ist.rect_min_width/2,i=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",r).attr("y",ist.rect_padding).attr("dominant-baseline","hanging"),a=0;n.forEach((t=>{0==a?i.append("tspan").attr("text-anchor","middle").attr("x",ist.rect_min_width/2).attr("dy",0).text(t):i.append("tspan").attr("text-anchor","middle").attr("x",ist.rect_min_width/2).attr("dy",.75*ist.line_height).text(t),a++}));let s=1.5*ist.rect_padding+a*ist.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",ist.rect_min_width).attr("y1",s).attr("y2",s),{titleNode:i,y:s}}),"newTitleNode"),lst=s(((t,e,n,r)=>{let i=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",ist.rect_padding).attr("y",r).attr("dominant-baseline","hanging"),a=0;let s=[];return n.forEach((t=>{let e=t.length;for(;e>30&&a<3;){let n=t.substring(0,30);e=(t=t.substring(30,t.length)).length,s[s.length]=n,a++}if(3==a){let t=s[s.length-1];s[s.length-1]=t.substring(0,t.length-4)+"..."}else s[s.length]=t;a=0})),s.forEach((t=>{i.append("tspan").attr("x",ist.rect_padding).attr("dy",ist.line_height).text(t)})),i}),"newBodyNode"),cst=s(((t,e,n,r)=>{const i=e.node().getTotalLength(),a=e.node().getPointAtLength(.5*i),s="rel"+ast;ast++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",s).attr("x",a.x).attr("y",a.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(r).node().getBBox();t.insert("rect","#"+s).attr("class","req reqLabelBox").attr("x",a.x-o.width/2).attr("y",a.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")}),"addEdgeLabel"),hst=s((function(t,e,n,r,i){const a=n.edge(fst(e.src),fst(e.dst)),s=Xh().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+r).attr("class","er relationshipLine").attr("d",s(a.points)).attr("fill","none");e.type==i.db.Relationships.CONTAINS?o.attr("marker-start","url("+_n.getUrl(ist.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+_n.getUrl(ist.arrowMarkerAbsolute)+"#"+rst.ReqMarkers.ARROW+"_line_ending)")),cst(t,o,ist,`<<${e.type}>>`)}),"drawRelationshipFromLayout"),ust=s(((t,e,n)=>{t.forEach(((t,r)=>{r=fst(r),m.info("Added new requirement: ",r);const i=n.append("g").attr("id",r),a=sst(i,"req-"+r);let s=[],o=ost(i,r+"_title",[`<<${t.type}>>`,`${t.name}`]);s.push(o.titleNode);let l=lst(i,r+"_body",[`Id: ${t.id}`,`Text: ${t.text}`,`Risk: ${t.risk}`,`Verification: ${t.verifyMethod}`],o.y);s.push(l);const c=a.node().getBBox();e.setNode(r,{width:c.width,height:c.height,shape:"rect",id:r})}))}),"drawReqs"),dst=s(((t,e,n)=>{t.forEach(((t,r)=>{const i=fst(r),a=n.append("g").attr("id",i),s="element-"+i,o=sst(a,s);let l=[],c=ost(a,s+"_title",["<>",`${r}`]);l.push(c.titleNode);let h=lst(a,s+"_body",[`Type: ${t.type||"Not Specified"}`,`Doc Ref: ${t.docRef||"None"}`],c.y);l.push(h);const u=o.node().getBBox();e.setNode(i,{width:u.width,height:u.height,shape:"rect",id:i})}))}),"drawElements"),pst=s(((t,e)=>(t.forEach((function(t){let n=fst(t.src),r=fst(t.dst);e.setEdge(n,r,{relationship:t})})),t)),"addRelationships"),gst=s((function(t,e){e.nodes().forEach((function(n){void 0!==n&&void 0!==e.node(n)&&(t.select("#"+n),t.select("#"+n).attr("transform","translate("+(e.node(n).x-e.node(n).width/2)+","+(e.node(n).y-e.node(n).height/2)+" )"))}))}),"adjustEntities"),fst=s((t=>t.replace(/\s/g,"").replace(/\./g,"_")),"elementString"),mst=s(((t,e,n,r)=>{const i=(ist=Hn().requirement).securityLevel;let a;"sandbox"===i&&(a=Oa("#i"+e));const s=Oa("sandbox"===i?a.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);rst.insertLineEndings(s,ist);const o=new nq({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:ist.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let l=r.db.getRequirements(),c=r.db.getElements(),h=r.db.getRelationships();ust(l,o,s),dst(c,o,s),pst(h,o),cY(o),gst(s,o),h.forEach((function(t){hst(s,t,o,e,r)}));const u=ist.rect_padding,d=s.node().getBBox(),p=d.width+2*u,g=d.height+2*u;Sn(s,g,p,ist.useMaxWidth),s.attr("viewBox",`${d.x-u} ${d.y-u} ${p} ${g}`)}),"draw"),yst={parser:Oat,db:tst,renderer:{draw:mst},styles:est},vst=Object.freeze({__proto__:null,diagram:yst}),xst=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],l=[1,13],c=[1,14],h=[1,16],u=[1,17],d=[1,18],p=[1,24],g=[1,25],f=[1,26],m=[1,27],y=[1,28],v=[1,29],x=[1,30],b=[1,31],w=[1,32],k=[1,33],T=[1,34],_=[1,35],E=[1,36],C=[1,37],S=[1,38],A=[1,39],L=[1,41],N=[1,42],I=[1,43],M=[1,44],R=[1,45],D=[1,46],O=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],P=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],$=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],z=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],U=[68,69,70],G=[1,122],q={trace:s((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",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",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,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],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 3:return r.apply(a[o]),a[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:a[o-1].push(a[o]),this.$=a[o-1];break;case 6:case 7:case 11:case 12:case 62:this.$=a[o];break;case 15:a[o].type="createParticipant",this.$=a[o];break;case 16:a[o-1].unshift({type:"boxStart",boxData:r.parseBoxData(a[o-2])}),a[o-1].push({type:"boxEnd",boxText:a[o-2]}),this.$=a[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-2]),sequenceIndexStep:Number(a[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[o-1].actor};break;case 29:r.setDiagramTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 30:r.setDiagramTitle(a[o].substring(7)),this.$=a[o].substring(7);break;case 31:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 34:a[o-1].unshift({type:"loopStart",loopText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.LOOP_START}),a[o-1].push({type:"loopEnd",loopText:a[o-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[o-1];break;case 35:a[o-1].unshift({type:"rectStart",color:r.parseMessage(a[o-2]),signalType:r.LINETYPE.RECT_START}),a[o-1].push({type:"rectEnd",color:r.parseMessage(a[o-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[o-1];break;case 36:a[o-1].unshift({type:"optStart",optText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.OPT_START}),a[o-1].push({type:"optEnd",optText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[o-1];break;case 37:a[o-1].unshift({type:"altStart",altText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.ALT_START}),a[o-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[o-1];break;case 38:a[o-1].unshift({type:"parStart",parText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.PAR_START}),a[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[o-1];break;case 39:a[o-1].unshift({type:"parStart",parText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[o-1];break;case 40:a[o-1].unshift({type:"criticalStart",criticalText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.CRITICAL_START}),a[o-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=a[o-1];break;case 41:a[o-1].unshift({type:"breakStart",breakText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.BREAK_START}),a[o-1].push({type:"breakEnd",optText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[o-1];break;case 43:this.$=a[o-3].concat([{type:"option",optionText:r.parseMessage(a[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[o]]);break;case 45:this.$=a[o-3].concat([{type:"and",parText:r.parseMessage(a[o-1]),signalType:r.LINETYPE.PAR_AND},a[o]]);break;case 47:this.$=a[o-3].concat([{type:"else",altText:r.parseMessage(a[o-1]),signalType:r.LINETYPE.ALT_ELSE},a[o]]);break;case 48:a[o-3].draw="participant",a[o-3].type="addParticipant",a[o-3].description=r.parseMessage(a[o-1]),this.$=a[o-3];break;case 49:a[o-1].draw="participant",a[o-1].type="addParticipant",this.$=a[o-1];break;case 50:a[o-3].draw="actor",a[o-3].type="addParticipant",a[o-3].description=r.parseMessage(a[o-1]),this.$=a[o-3];break;case 51:a[o-1].draw="actor",a[o-1].type="addParticipant",this.$=a[o-1];break;case 52:a[o-1].type="destroyParticipant",this.$=a[o-1];break;case 53:this.$=[a[o-1],{type:"addNote",placement:a[o-2],actor:a[o-1].actor,text:a[o]}];break;case 54:a[o-2]=[].concat(a[o-1],a[o-1]).slice(0,2),a[o-2][0]=a[o-2][0].actor,a[o-2][1]=a[o-2][1].actor,this.$=[a[o-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[o-2].slice(0,2),text:a[o]}];break;case 55:this.$=[a[o-1],{type:"addLinks",actor:a[o-1].actor,text:a[o]}];break;case 56:this.$=[a[o-1],{type:"addALink",actor:a[o-1].actor,text:a[o]}];break;case 57:this.$=[a[o-1],{type:"addProperties",actor:a[o-1].actor,text:a[o]}];break;case 58:this.$=[a[o-1],{type:"addDetails",actor:a[o-1].actor,text:a[o]}];break;case 61:this.$=[a[o-2],a[o]];break;case 63:this.$=r.PLACEMENT.LEFTOF;break;case 64:this.$=r.PLACEMENT.RIGHTOF;break;case 65:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[o-1].actor}];break;case 66:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[o-4].actor}];break;case 67:this.$=[a[o-3],a[o-1],{type:"addMessage",from:a[o-3].actor,to:a[o-1].actor,signalType:a[o-2],msg:a[o]}];break;case 68:this.$={type:"addParticipant",actor:a[o]};break;case 69:this.$=r.LINETYPE.SOLID_OPEN;break;case 70:this.$=r.LINETYPE.DOTTED_OPEN;break;case 71:this.$=r.LINETYPE.SOLID;break;case 72:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=r.LINETYPE.DOTTED;break;case 74:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=r.LINETYPE.SOLID_CROSS;break;case 76:this.$=r.LINETYPE.DOTTED_CROSS;break;case 77:this.$=r.LINETYPE.SOLID_POINT;break;case 78:this.$=r.LINETYPE.DOTTED_POINT;break;case 79:this.$=r.parseMessage(a[o].trim().substring(1))}}),"anonymous"),table:[{3:1,4:e,5:n,6:r},{1:[3]},{3:5,4:e,5:n,6:r},{3:6,4:e,5:n,6:r},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,12:12,13:l,14:c,17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},t(O,[2,5]),{9:47,12:12,13:l,14:c,17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},t(O,[2,7]),t(O,[2,8]),t(O,[2,14]),{12:48,50:C,52:S,53:A},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:D},{22:55,70:D},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(O,[2,29]),t(O,[2,30]),{32:[1,61]},{34:[1,62]},t(O,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:D},{22:72,70:D},{22:73,70:D},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:D},{22:90,70:D},{22:91,70:D},{22:92,70:D},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(O,[2,6]),t(O,[2,15]),t(P,[2,9],{10:93}),t(O,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(O,[2,21]),{5:[1,97]},{5:[1,98]},t(O,[2,24]),t(O,[2,25]),t(O,[2,26]),t(O,[2,27]),t(O,[2,28]),t(O,[2,31]),t(O,[2,32]),t(B,i,{7:99}),t(B,i,{7:100}),t(B,i,{7:101}),t($,i,{40:102,7:103}),t(F,i,{42:104,7:105}),t(F,i,{7:105,42:106}),t(z,i,{45:107,7:108}),t(B,i,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:D},t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),{22:118,70:D},{22:120,58:119,70:D},{70:[2,63]},{70:[2,64]},{56:121,81:G},{56:123,81:G},{56:124,81:G},{56:125,81:G},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:C,52:S,53:A},{5:[1,131]},t(O,[2,19]),t(O,[2,20]),t(O,[2,22]),t(O,[2,23]),{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[1,132],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[1,133],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[1,134],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{16:[1,135]},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[2,46],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,49:[1,136],50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{16:[1,137]},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[2,44],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,48:[1,138],50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{16:[1,139]},{16:[1,140]},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[2,42],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,47:[1,141],50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[1,142],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{15:[1,143]},t(O,[2,49]),{15:[1,144]},t(O,[2,51]),t(O,[2,52]),{22:145,70:D},{22:146,70:D},{56:147,81:G},{56:148,81:G},{56:149,81:G},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(O,[2,16]),t(P,[2,10]),{12:151,50:C,52:S,53:A},t(P,[2,12]),t(P,[2,13]),t(O,[2,18]),t(O,[2,34]),t(O,[2,35]),t(O,[2,36]),t(O,[2,37]),{15:[1,152]},t(O,[2,38]),{15:[1,153]},t(O,[2,39]),t(O,[2,40]),{15:[1,154]},t(O,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:G},{56:158,81:G},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:D},t(P,[2,11]),t($,i,{7:103,40:160}),t(F,i,{7:105,42:161}),t(z,i,{7:108,45:162}),t(O,[2,48]),t(O,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},j=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 51:case 66:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return e.yytext=e.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 67:return"INVALID"}}),"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/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,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return t}();function Y(){this.yy={}}return q.lexer=j,s(Y,"Parser"),Y.prototype=q,q.Parser=Y,new Y}();xst.parser=xst;var bst=xst,wst=new qX((()=>({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}))),kst=s((function(t){wst.records.boxes.push({name:t.text,wrap:t.wrap??Ust(),fill:t.color,actorKeys:[]}),wst.records.currentBox=wst.records.boxes.slice(-1)[0]}),"addBox"),Tst=s((function(t,e,n,r){let i=wst.records.currentBox;const a=wst.records.actors.get(t);if(a){if(wst.records.currentBox&&a.box&&wst.records.currentBox!==a.box)throw new Error(`A same participant should only be defined in one Box: ${a.name} can't be in '${a.box.name}' and in '${wst.records.currentBox.name}' at the same time.`);if(i=a.box?a.box:wst.records.currentBox,a.box=i,a&&e===a.name&&null==n)return}if(null==n?.text&&(n={text:e,type:r}),null!=r&&null!=n.text||(n={text:e,type:r}),wst.records.actors.set(t,{box:i,name:e,description:n.text,wrap:n.wrap??Ust(),prevActor:wst.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),wst.records.prevActor){const e=wst.records.actors.get(wst.records.prevActor);e&&(e.nextActor=t)}wst.records.currentBox&&wst.records.currentBox.actorKeys.push(t),wst.records.prevActor=t}),"addActor"),_st=s((t=>{let e,n=0;if(!t)return 0;for(e=0;e>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return wst.records.messages.push({from:t,to:e,message:n?.text??"",wrap:n?.wrap??Ust(),type:r,activate:i}),!0}),"addSignal"),Sst=s((function(){return wst.records.boxes.length>0}),"hasAtLeastOneBox"),Ast=s((function(){return wst.records.boxes.some((t=>t.name))}),"hasAtLeastOneBoxWithTitle"),Lst=s((function(){return wst.records.messages}),"getMessages"),Nst=s((function(){return wst.records.boxes}),"getBoxes"),Ist=s((function(){return wst.records.actors}),"getActors"),Mst=s((function(){return wst.records.createdActors}),"getCreatedActors"),Rst=s((function(){return wst.records.destroyedActors}),"getDestroyedActors"),Dst=s((function(t){return wst.records.actors.get(t)}),"getActor"),Ost=s((function(){return[...wst.records.actors.keys()]}),"getActorKeys"),Pst=s((function(){wst.records.sequenceNumbersEnabled=!0}),"enableSequenceNumbers"),Bst=s((function(){wst.records.sequenceNumbersEnabled=!1}),"disableSequenceNumbers"),$st=s((()=>wst.records.sequenceNumbersEnabled),"showSequenceNumbers"),Fst=s((function(t){wst.records.wrapEnabled=t}),"setWrap"),zst=s((t=>{if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}),"extractWrap"),Ust=s((()=>void 0!==wst.records.wrapEnabled?wst.records.wrapEnabled:Hn().sequence?.wrap??!1),"autoWrap"),Gst=s((function(){wst.reset(),$n()}),"clear"),qst=s((function(t){const e=t.trim(),{wrap:n,cleanedText:r}=zst(e),i={text:r,wrap:n};return m.debug(`parseMessage: ${JSON.stringify(i)}`),i}),"parseMessage"),jst=s((function(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let n=e?.[1]?e[1].trim():"transparent",r=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",n)||(n="transparent",r=t.trim());else{const e=(new Option).style;e.color=n,e.color!==n&&(n="transparent",r=t.trim())}const{wrap:i,cleanedText:a}=zst(r);return{text:a?an(a,Hn()):void 0,color:n,wrap:i}}),"parseBoxData"),Yst={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},Wst=s((function(t,e,n){const r={actor:t,placement:e,message:n.text,wrap:n.wrap??Ust()},i=[].concat(t,t);wst.records.notes.push(r),wst.records.messages.push({from:i[0],to:i[1],message:n.text,wrap:n.wrap??Ust(),type:Yst.NOTE,placement:e})}),"addNote"),Hst=s((function(t,e){const n=Dst(t);try{let t=an(e.text,Hn());t=t.replace(/&/g,"&"),t=t.replace(/=/g,"=");Xst(n,JSON.parse(t))}catch(t){m.error("error while parsing actor link text",t)}}),"addLinks"),Vst=s((function(t,e){const n=Dst(t);try{const t={};let r=an(e.text,Hn());const i=r.indexOf("@");r=r.replace(/&/g,"&"),r=r.replace(/=/g,"=");const a=r.slice(0,i-1).trim(),s=r.slice(i+1).trim();t[a]=s,Xst(n,t)}catch(t){m.error("error while parsing actor link text",t)}}),"addALink");function Xst(t,e){if(null==t.links)t.links=e;else for(const n in e)t.links[n]=e[n]}s(Xst,"insertLinks");var Kst=s((function(t,e){const n=Dst(t);try{const t=an(e.text,Hn());Zst(n,JSON.parse(t))}catch(t){m.error("error while parsing actor properties text",t)}}),"addProperties");function Zst(t,e){if(null==t.properties)t.properties=e;else for(const n in e)t.properties[n]=e[n]}function Qst(){wst.records.currentBox=void 0}s(Zst,"insertProperties"),s(Qst,"boxEnd");var Jst=s((function(t,e){const n=Dst(t),r=document.getElementById(e.text);try{const t=r.innerHTML,e=JSON.parse(t);e.properties&&Zst(n,e.properties),e.links&&Xst(n,e.links)}catch(t){m.error("error while parsing actor details text",t)}}),"addDetails"),tot=s((function(t,e){if(void 0!==t?.properties)return t.properties[e]}),"getActorProperty"),eot=s((function(t){if(Array.isArray(t))t.forEach((function(t){eot(t)}));else switch(t.type){case"sequenceIndex":wst.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":Tst(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(wst.records.actors.has(t.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");wst.records.lastCreated=t.actor,Tst(t.actor,t.actor,t.description,t.draw),wst.records.createdActors.set(t.actor,wst.records.messages.length);break;case"destroyParticipant":wst.records.lastDestroyed=t.actor,wst.records.destroyedActors.set(t.actor,wst.records.messages.length);break;case"activeStart":case"activeEnd":Cst(t.actor,void 0,void 0,t.signalType);break;case"addNote":Wst(t.actor,t.placement,t.text);break;case"addLinks":Hst(t.actor,t.text);break;case"addALink":Vst(t.actor,t.text);break;case"addProperties":Kst(t.actor,t.text);break;case"addDetails":Jst(t.actor,t.text);break;case"addMessage":if(wst.records.lastCreated){if(t.to!==wst.records.lastCreated)throw new Error("The created participant "+wst.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");wst.records.lastCreated=void 0}else if(wst.records.lastDestroyed){if(t.to!==wst.records.lastDestroyed&&t.from!==wst.records.lastDestroyed)throw new Error("The destroyed participant "+wst.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");wst.records.lastDestroyed=void 0}Cst(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":kst(t.boxData);break;case"boxEnd":Qst();break;case"loopStart":Cst(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":Cst(void 0,void 0,void 0,t.signalType);break;case"rectStart":Cst(void 0,void 0,t.color,t.signalType);break;case"optStart":Cst(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":Cst(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":Fn(t.text);break;case"parStart":case"and":Cst(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":Cst(void 0,void 0,t.criticalText,t.signalType);break;case"option":Cst(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":Cst(void 0,void 0,t.breakText,t.signalType)}}),"apply"),not={addActor:Tst,addMessage:Est,addSignal:Cst,addLinks:Hst,addDetails:Jst,addProperties:Kst,autoWrap:Ust,setWrap:Fst,enableSequenceNumbers:Pst,disableSequenceNumbers:Bst,showSequenceNumbers:$st,getMessages:Lst,getActors:Ist,getCreatedActors:Mst,getDestroyedActors:Rst,getActor:Dst,getActorKeys:Ost,getActorProperty:tot,getAccTitle:zn,getBoxes:Nst,getDiagramTitle:jn,setDiagramTitle:qn,getConfig:s((()=>Hn().sequence),"getConfig"),clear:Gst,parseMessage:qst,parseBoxData:jst,LINETYPE:Yst,ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},addNote:Wst,setAccTitle:Fn,apply:eot,setAccDescription:Un,getAccDescription:Gn,hasAtLeastOneBox:Sst,hasAtLeastOneBoxWithTitle:Ast},rot=s((t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`),"getStyles"),iot=d(Cy(),1),aot=s((function(t,e){return rW(t,e)}),"drawRect"),sot=s((function(t,e,n,r,i){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const c=t.append("g");c.attr("id","actor"+s+"_popup"),c.attr("class","actorPopupMenu"),c.attr("display",l);var h="";void 0!==o.class&&(h=" "+o.class);let u=o.width>n?o.width:n;const d=c.append("rect");if(d.attr("class","actorPopupMenuPanel"+h),d.attr("x",o.x),d.attr("y",o.height),d.attr("fill",o.fill),d.attr("stroke",o.stroke),d.attr("width",u),d.attr("height",o.height),d.attr("rx",o.rx),d.attr("ry",o.ry),null!=a){var p=20;for(let t in a){var g=c.append("a"),f=(0,iot.sanitizeUrl)(a[t]);g.attr("xlink:href",f),g.attr("target","_blank"),Iot(r)(t,g,o.x+10,o.height+p,u,20,{class:"actor"},r),p+=30}}return d.attr("height",p),{height:o.height+p,width:u}}),"drawPopup"),oot=s((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle"),lot=s((async function(t,e,n=null){let r=t.append("foreignObject");const i=await Tn(e.text,Ft()),a=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(a.height)).attr("width",Math.round(a.width)),"noteText"===e.class){const n=t.node().firstChild;n.setAttribute("height",a.height+2*e.textMargin);const i=n.getBBox();r.attr("x",Math.round(i.x+i.width/2-a.width/2)).attr("y",Math.round(i.y+i.height/2-a.height/2))}else if(n){let{startx:t,stopx:i,starty:s}=n;if(t>i){const e=t;t=i,i=e}r.attr("x",Math.round(t+Math.abs(t-i)/2-a.width/2)),"loopText"===e.class?r.attr("y",Math.round(s)):r.attr("y",Math.round(s-a.height))}return[r]}),"drawKatex"),cot=s((function(t,e){let n=0,r=0;const i=e.text.split(_n.lineBreakRegex),[a,o]=fk(e.fontSize);let l=[],c=0,h=s((()=>e.y),"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=s((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":h=s((()=>Math.round(e.y+(n+r+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":h=s((()=>Math.round(e.y+(n+r+2*e.textMargin)-e.textMargin)),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)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"}for(let[s,u]of i.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==a&&(c=s*a);const i=t.append("text");i.attr("x",e.x),i.attr("y",h()),void 0!==e.anchor&&i.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&i.style("font-family",e.fontFamily),void 0!==o&&i.style("font-size",o),void 0!==e.fontWeight&&i.style("font-weight",e.fontWeight),void 0!==e.fill&&i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class),void 0!==e.dy?i.attr("dy",e.dy):0!==c&&i.attr("dy",c);const d=u||"​";if(e.tspan){const t=i.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(d)}else i.text(d);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(r+=(i._groups||i)[0][0].getBBox().height,n=r),l.push(i)}return l}),"drawText"),hot=s((function(t,e){function n(t,e,n,r,i){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+r-i)+" "+(t+n-1.2*i)+","+(e+r)+" "+t+","+(e+r)}s(n,"genPoints");const r=t.append("polygon");return r.attr("points",n(e.x,e.y,e.width,e.height,7)),r.attr("class","labelBox"),e.y=e.y+e.height/2,cot(t,e),r}),"drawLabel"),uot=-1,dot=s(((t,e,n,r)=>{t.select&&n.forEach((n=>{const i=e.get(n),a=t.select("#actor"+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr("y2",i.stopy+i.height/2):r.mirrorActors&&a.attr("y2",i.stopy)}))}),"fixLifeLineHeights"),pot=s((function(t,e,n,r){const i=r?e.stopy:e.starty,a=e.x+e.width/2,s=i+e.height,o=t.append("g").lower();var l=o;r||(uot++,Object.keys(e.links||{}).length&&!n.forceMenus&&l.attr("onclick",oot(`actor${uot}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+uot).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),l=o.append("g"),e.actorCnt=uot,null!=e.links&&l.attr("id","root-"+uot));const c=lW();var h="actor";e.properties?.class?h=e.properties.class:c.fill="#eaeaea",h+=r?" actor-bottom":" actor-top",c.x=e.x,c.y=i,c.width=e.width,c.height=e.height,c.class=h,c.rx=3,c.ry=3,c.name=e.name;const u=aot(l,c);if(e.rectData=c,e.properties?.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?oW(l,c.x+c.width-20,c.y+10,t.substr(1)):sW(l,c.x+c.width-20,c.y+10,t)}Not(n,wn(e.description))(e.description,l,c.x,c.y,c.width,c.height,{class:"actor actor-box"},n);let d=e.height;if(u.node){const t=u.node().getBBox();e.height=t.height,d=t.height}return d}),"drawActorTypeParticipant"),got=s((function(t,e,n,r){const i=r?e.stopy:e.starty,a=e.x+e.width/2,s=i+80,o=t.append("g").lower();r||(uot++,o.append("line").attr("id","actor"+uot).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=uot);const l=t.append("g");let c="actor-man";c+=r?" actor-bottom":" actor-top",l.attr("class",c),l.attr("name",e.name);const h=lW();h.x=e.x,h.y=i,h.fill="#eaeaea",h.width=e.width,h.height=e.height,h.class="actor",h.rx=3,h.ry=3,l.append("line").attr("id","actor-man-torso"+uot).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+uot).attr("x1",a-18).attr("y1",i+33).attr("x2",a+18).attr("y2",i+33),l.append("line").attr("x1",a-18).attr("y1",i+60).attr("x2",a).attr("y2",i+45),l.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+18-2).attr("y2",i+60);const u=l.append("circle");u.attr("cx",e.x+e.width/2),u.attr("cy",i+10),u.attr("r",15),u.attr("width",e.width),u.attr("height",e.height);const d=l.node().getBBox();return e.height=d.height,Not(n,wn(e.description))(e.description,l,h.x,h.y+35,h.width,h.height,{class:"actor actor-man"},n),e.height}),"drawActorTypeActor"),fot=s((async function(t,e,n,r){switch(e.type){case"actor":return await got(t,e,n,r);case"participant":return await pot(t,e,n,r)}}),"drawActor"),mot=s((function(t,e,n){const r=t.append("g");bot(r,e),e.name&&Not(n)(e.name,r,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},n),r.lower()}),"drawBox"),yot=s((function(t){return t.append("g")}),"anchorElement"),vot=s((function(t,e,n,r,i){const a=lW(),s=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+i%3,a.width=e.stopx-e.startx,a.height=n-e.starty,aot(s,a)}),"drawActivation"),xot=s((async function(t,e,n,r){const{boxMargin:i,boxTextMargin:a,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:c,messageFontSize:h,messageFontWeight:u}=r,d=t.append("g"),p=s((function(t,e,n,r){return d.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).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),void 0!==e.sections&&e.sections.forEach((function(t){p(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}));let g=cW();g.text=n,g.x=e.startx,g.y=e.starty,g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=l||50,g.height=o||20,g.textMargin=a,g.class="labelText",hot(d,g),g=Aot(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+i+a,g.anchor="middle",g.valign="middle",g.textMargin=a,g.class="loopText",g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.wrap=!0;let f=wn(g.text)?await lot(d,g,e):cot(d,g);if(void 0!==e.sectionTitles)for(const[t,n]of Object.entries(e.sectionTitles))if(n.message){g.text=n.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[t].y+i+a,g.class="loopText",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.wrap=e.wrap,wn(g.text)?(e.starty=e.sections[t].y,await lot(d,g,e)):cot(d,g);let r=Math.round(f.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[t].height+=r-(i+a)}return e.height=Math.round(e.stopy-e.starty),d}),"drawLoop"),bot=s((function(t,e){iW(t,e)}),"drawBackgroundRect"),wot=s((function(t){t.append("defs").append("symbol").attr("id","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"),kot=s((function(t){t.append("defs").append("symbol").attr("id","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"),Tot=s((function(t){t.append("defs").append("symbol").attr("id","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"),_ot=s((function(t){t.append("defs").append("marker").attr("id","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"),Eot=s((function(t){t.append("defs").append("marker").attr("id","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"),Cot=s((function(t){t.append("defs").append("marker").attr("id","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"),Sot=s((function(t){t.append("defs").append("marker").attr("id","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"),Aot=s((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"),Lot=s((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),Not=function(){function t(t,e,n,r,a,s,o){i(e.append("text").attr("x",n+a/2).attr("y",r+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,n,r,a,s,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:u}=l,[d,p]=fk(c),g=t.split(_n.lineBreakRegex);for(let t=0;tt.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))}),"getHeight"),clear:s((function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]}),"clear"),addBox:s((function(t){this.boxes.push(t)}),"addBox"),addActor:s((function(t){this.actors.push(t)}),"addActor"),addLoop:s((function(t){this.loops.push(t)}),"addLoop"),addMessage:s((function(t){this.messages.push(t)}),"addMessage"),addNote:s((function(t){this.notes.push(t)}),"addNote"),lastActor:s((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:s((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:s((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:s((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:s((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,jot(Hn())}),"init"),updateVal:s((function(t,e,n,r){void 0===t[e]?t[e]=n:t[e]=r(n,t[e])}),"updateVal"),updateBounds:s((function(t,e,n,r){const i=this;let a=0;function o(o){return s((function(s){a++;const l=i.sequenceItems.length-a+1;i.updateVal(s,"starty",e-l*Rot.boxMargin,Math.min),i.updateVal(s,"stopy",r+l*Rot.boxMargin,Math.max),i.updateVal(Dot.data,"startx",t-l*Rot.boxMargin,Math.min),i.updateVal(Dot.data,"stopx",n+l*Rot.boxMargin,Math.max),"activation"!==o&&(i.updateVal(s,"startx",t-l*Rot.boxMargin,Math.min),i.updateVal(s,"stopx",n+l*Rot.boxMargin,Math.max),i.updateVal(Dot.data,"starty",e-l*Rot.boxMargin,Math.min),i.updateVal(Dot.data,"stopy",r+l*Rot.boxMargin,Math.max))}),"updateItemBounds")}s(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))}),"updateBounds"),insert:s((function(t,e,n,r){const i=_n.getMin(t,n),a=_n.getMax(t,n),s=_n.getMin(e,r),o=_n.getMax(e,r);this.updateVal(Dot.data,"startx",i,Math.min),this.updateVal(Dot.data,"starty",s,Math.min),this.updateVal(Dot.data,"stopx",a,Math.max),this.updateVal(Dot.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)}),"insert"),newActivation:s((function(t,e,n){const r=n.get(t.from),i=Yot(t.from).length||0,a=r.x+r.width/2+(i-1)*Rot.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Rot.activationWidth,stopy:void 0,actor:t.from,anchored:Mot.anchorElement(e)})}),"newActivation"),endActivation:s((function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from);return this.activations.splice(e,1)[0]}),"endActivation"),createLoop:s((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:s((function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:s((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:s((function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap}),"isLoopOverlap"),addSectionToLoop:s((function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Dot.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:s((function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)}),"saveVerticalPos"),resetVerticalPos:s((function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)}),"resetVerticalPos"),bumpVerticalPos:s((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=_n.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:s((function(){return this.verticalPos}),"getVerticalPos"),getBounds:s((function(){return{bounds:this.data,models:this.models}}),"getBounds")},Oot=s((async function(t,e){Dot.bumpVerticalPos(Rot.boxMargin),e.height=Rot.boxMargin,e.starty=Dot.getVerticalPos();const n=lW();n.x=e.startx,n.y=e.starty,n.width=e.width||Rot.width,n.class="note";const r=t.append("g"),i=Mot.drawRect(r,n),a=cW();a.x=e.startx,a.y=e.starty,a.width=n.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=Rot.noteFontFamily,a.fontSize=Rot.noteFontSize,a.fontWeight=Rot.noteFontWeight,a.anchor=Rot.noteAlign,a.textMargin=Rot.noteMargin,a.valign="center";const s=wn(a.text)?await lot(r,a):cot(r,a),o=Math.round(s.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));i.attr("height",o+2*Rot.noteMargin),e.height+=o+2*Rot.noteMargin,Dot.bumpVerticalPos(o+2*Rot.noteMargin),e.stopy=e.starty+o+2*Rot.noteMargin,e.stopx=e.startx+n.width,Dot.insert(e.startx,e.starty,e.stopx,e.stopy),Dot.models.addNote(e)}),"drawNote"),Pot=s((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont"),Bot=s((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont"),$ot=s((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function Fot(t,e){Dot.bumpVerticalPos(10);const{startx:n,stopx:r,message:i}=e,a=_n.splitBreaks(i).length,s=wn(i),o=s?await kn(i,Hn()):yk.calculateTextDimensions(i,Pot(Rot));if(!s){const t=o.height/a;e.height+=t,Dot.bumpVerticalPos(t)}let l,c=o.height-10;const h=o.width;if(n===r){l=Dot.getVerticalPos()+c,Rot.rightAngles||(c+=Rot.boxMargin,l=Dot.getVerticalPos()+c),c+=30;const t=_n.getMax(h/2,Rot.width/2);Dot.insert(n-t,Dot.getVerticalPos()-10+c,r+t,Dot.getVerticalPos()+30+c)}else c+=Rot.boxMargin,l=Dot.getVerticalPos()+c,Dot.insert(n,l-10,r,l);return Dot.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,Dot.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}s(Fot,"boundMessage");var zot=s((async function(t,e,n,r){const{startx:i,stopx:a,starty:s,message:o,type:l,sequenceIndex:c,sequenceVisible:h}=e,u=yk.calculateTextDimensions(o,Pot(Rot)),d=cW();d.x=i,d.y=s+10,d.width=a-i,d.class="messageText",d.dy="1em",d.text=o,d.fontFamily=Rot.messageFontFamily,d.fontSize=Rot.messageFontSize,d.fontWeight=Rot.messageFontWeight,d.anchor=Rot.messageAlign,d.valign="center",d.textMargin=Rot.wrapPadding,d.tspan=!1,wn(d.text)?await lot(t,d,{startx:i,stopx:a,starty:n}):cot(t,d);const p=u.width;let g;i===a?g=Rot.rightAngles?t.append("path").attr("d",`M ${i},${n} H ${i+_n.getMax(Rot.width/2,p/2)} V ${n+25} H ${i}`):t.append("path").attr("d","M "+i+","+n+" C "+(i+60)+","+(n-10)+" "+(i+60)+","+(n+30)+" "+i+","+(n+20)):(g=t.append("line"),g.attr("x1",i),g.attr("y1",n),g.attr("x2",a),g.attr("y2",n)),l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0");let f="";Rot.arrowMarkerAbsolute&&(f=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,f=f.replace(/\(/g,"\\("),f=f.replace(/\)/g,"\\)")),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),l!==r.db.LINETYPE.SOLID&&l!==r.db.LINETYPE.DOTTED||g.attr("marker-end","url("+f+"#arrowhead)"),l!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(g.attr("marker-start","url("+f+"#arrowhead)"),g.attr("marker-end","url("+f+"#arrowhead)")),l!==r.db.LINETYPE.SOLID_POINT&&l!==r.db.LINETYPE.DOTTED_POINT||g.attr("marker-end","url("+f+"#filled-head)"),l!==r.db.LINETYPE.SOLID_CROSS&&l!==r.db.LINETYPE.DOTTED_CROSS||g.attr("marker-end","url("+f+"#crosshead)"),(h||Rot.showSequenceNumbers)&&(g.attr("marker-start","url("+f+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",n+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))}),"drawMessage"),Uot=s((function(t,e,n,r,i,a,s){let o,l=0,c=0,h=0;for(const t of r){const r=e.get(t),a=r.box;o&&o!=a&&(s||Dot.models.addBox(o),c+=Rot.boxMargin+o.margin),a&&a!=o&&(s||(a.x=l+c,a.y=i),c+=a.margin),r.width=r.width||Rot.width,r.height=_n.getMax(r.height||Rot.height,Rot.height),r.margin=r.margin||Rot.actorMargin,h=_n.getMax(h,r.height),n.get(r.name)&&(c+=r.width/2),r.x=l+c,r.starty=Dot.getVerticalPos(),Dot.insert(r.x,i,r.x+r.width,r.height),l+=r.width+c,r.box&&(r.box.width=l+a.margin-r.box.x),c=r.margin,o=r.box,Dot.models.addActor(r)}o&&!s&&Dot.models.addBox(o),Dot.bumpVerticalPos(h)}),"addActorRenderingData"),Got=s((async function(t,e,n,r){if(r){let r=0;Dot.bumpVerticalPos(2*Rot.boxMargin);for(const i of n){const n=e.get(i);n.stopy||(n.stopy=Dot.getVerticalPos());const a=await Mot.drawActor(t,n,Rot,!0);r=_n.getMax(r,a)}Dot.bumpVerticalPos(r+Rot.boxMargin)}else for(const r of n){const n=e.get(r);await Mot.drawActor(t,n,Rot,!1)}}),"drawActors"),qot=s((function(t,e,n,r){let i=0,a=0;for(const s of n){const n=e.get(s),o=Zot(n),l=Mot.drawPopup(t,n,o,Rot,Rot.forceMenus,r);l.height>i&&(i=l.height),l.width+n.x>a&&(a=l.width+n.x)}return{maxHeight:i,maxWidth:a}}),"drawActorsPopup"),jot=s((function(t){L(Rot,t),t.fontFamily&&(Rot.actorFontFamily=Rot.noteFontFamily=Rot.messageFontFamily=t.fontFamily),t.fontSize&&(Rot.actorFontSize=Rot.noteFontSize=Rot.messageFontSize=t.fontSize),t.fontWeight&&(Rot.actorFontWeight=Rot.noteFontWeight=Rot.messageFontWeight=t.fontWeight)}),"setConf"),Yot=s((function(t){return Dot.activations.filter((function(e){return e.actor===t}))}),"actorActivations"),Wot=s((function(t,e){const n=e.get(t),r=Yot(t);return[r.reduce((function(t,e){return _n.getMin(t,e.startx)}),n.x+n.width/2-1),r.reduce((function(t,e){return _n.getMax(t,e.stopx)}),n.x+n.width/2+1)]}),"activationBounds");function Hot(t,e,n,r,i){Dot.bumpVerticalPos(n);let a=r;if(e.id&&e.message&&t[e.id]){const n=t[e.id].width,i=Pot(Rot);e.message=yk.wrapLabel(`[${e.message}]`,n-2*Rot.wrapPadding,i),e.width=n,e.wrap=!0;const s=yk.calculateTextDimensions(e.message,i),o=_n.getMax(s.height,Rot.labelBoxHeight);a=r+o,m.debug(`${o} - ${e.message}`)}i(e),Dot.bumpVerticalPos(a)}function Vot(t,e,n,r,i,a,o){function l(n,r){n.x{t.add(e.from),t.add(e.to)})),f=f.filter((e=>t.has(e)))}Uot(h,u,d,f,0,y,!1);const k=await elt(y,u,w,r);function T(t,e){const n=Dot.endActivation(t);n.starty+18>e&&(n.starty=e-6,e+=12),Mot.drawActivation(h,n,e,Rot,Yot(t.from).length),Dot.insert(n.startx,e-10,n.stopx,e)}Mot.insertArrowHead(h),Mot.insertArrowCrossHead(h),Mot.insertArrowFilledHead(h),Mot.insertSequenceNumber(h),s(T,"activeEnd");let _=1,E=1;const C=[],S=[];let A=0;for(const t of y){let e,n,i;switch(t.type){case r.db.LINETYPE.NOTE:Dot.resetVerticalPos(),n=t.noteModel,await Oot(h,n);break;case r.db.LINETYPE.ACTIVE_START:Dot.newActivation(t,h,u);break;case r.db.LINETYPE.ACTIVE_END:T(t,Dot.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.LOOP_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"loop",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.RECT_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin,(t=>Dot.newLoop(void 0,t.message)));break;case r.db.LINETYPE.RECT_END:e=Dot.endLoop(),S.push(e),Dot.models.addLoop(e),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos());break;case r.db.LINETYPE.OPT_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.OPT_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"opt",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.ALT_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.ALT_ELSE:Hot(k,t,Rot.boxMargin+Rot.boxTextMargin,Rot.boxMargin,(t=>Dot.addSectionToLoop(t)));break;case r.db.LINETYPE.ALT_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"alt",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t))),Dot.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:Hot(k,t,Rot.boxMargin+Rot.boxTextMargin,Rot.boxMargin,(t=>Dot.addSectionToLoop(t)));break;case r.db.LINETYPE.PAR_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"par",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.AUTONUMBER:_=t.message.start||_,E=t.message.step||E,t.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.CRITICAL_OPTION:Hot(k,t,Rot.boxMargin+Rot.boxTextMargin,Rot.boxMargin,(t=>Dot.addSectionToLoop(t)));break;case r.db.LINETYPE.CRITICAL_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"critical",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.BREAK_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.BREAK_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"break",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;default:try{i=t.msgModel,i.starty=Dot.getVerticalPos(),i.sequenceIndex=_,i.sequenceVisible=r.db.showSequenceNumbers();const e=await Fot(0,i);Vot(t,i,e,A,u,d,p),C.push({messageModel:i,lineStartY:e}),Dot.models.addMessage(i)}catch(t){m.error("error while drawing message",t)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(_+=E),A++}m.debug("createdActors",d),m.debug("destroyedActors",p),await Got(h,u,f,!1);for(const t of C)await zot(h,t.messageModel,t.lineStartY,r);Rot.mirrorActors&&await Got(h,u,f,!0),S.forEach((t=>Mot.drawBackgroundRect(h,t))),dot(h,u,f,Rot);for(const t of Dot.models.boxes)t.height=Dot.getVerticalPos()-t.y,Dot.insert(t.x,t.y,t.x+t.width,t.height),t.startx=t.x,t.starty=t.y,t.stopx=t.startx+t.width,t.stopy=t.starty+t.height,t.stroke="rgb(0,0,0, 0.5)",Mot.drawBox(h,t,Rot);x&&Dot.bumpVerticalPos(Rot.boxMargin);const L=qot(h,u,f,c),{bounds:N}=Dot.getBounds();void 0===N.startx&&(N.startx=0),void 0===N.starty&&(N.starty=0),void 0===N.stopx&&(N.stopx=0),void 0===N.stopy&&(N.stopy=0);let I=N.stopy-N.starty;I{const n=Pot(Rot);let r=e.actorKeys.reduce(((e,n)=>e+(t.get(n).width+(t.get(n).margin||0))),0);r-=2*Rot.boxTextMargin,e.wrap&&(e.name=yk.wrapLabel(e.name,r-2*Rot.wrapPadding,n));const a=yk.calculateTextDimensions(e.name,n);i=_n.getMax(a.height,i);const s=_n.getMax(r,a.width+2*Rot.wrapPadding);if(e.margin=Rot.boxTextMargin,rt.textMaxHeight=i)),_n.getMax(r,Rot.height)}s(Qot,"calculateActorMargins");var Jot=s((async function(t,e,n){const r=e.get(t.from),i=e.get(t.to),a=r.x,s=i.x,o=t.wrap&&t.message;let l=wn(t.message)?await kn(t.message,Hn()):yk.calculateTextDimensions(o?yk.wrapLabel(t.message,Rot.width,Bot(Rot)):t.message,Bot(Rot));const c={width:o?Rot.width:_n.getMax(Rot.width,l.width+2*Rot.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===n.db.PLACEMENT.RIGHTOF?(c.width=o?_n.getMax(Rot.width,l.width):_n.getMax(r.width/2+i.width/2,l.width+2*Rot.noteMargin),c.startx=a+(r.width+Rot.actorMargin)/2):t.placement===n.db.PLACEMENT.LEFTOF?(c.width=o?_n.getMax(Rot.width,l.width+2*Rot.noteMargin):_n.getMax(r.width/2+i.width/2,l.width+2*Rot.noteMargin),c.startx=a-c.width+(r.width-Rot.actorMargin)/2):t.to===t.from?(l=yk.calculateTextDimensions(o?yk.wrapLabel(t.message,_n.getMax(Rot.width,r.width),Bot(Rot)):t.message,Bot(Rot)),c.width=o?_n.getMax(Rot.width,r.width):_n.getMax(r.width,Rot.width,l.width+2*Rot.noteMargin),c.startx=a+(r.width-c.width)/2):(c.width=Math.abs(a+r.width/2-(s+i.width/2))+Rot.actorMargin,c.startx=a2,d=s((t=>l?-t:t),"adjustValue");t.from===t.to?h=c:(t.activate&&!u&&(h+=d(Rot.activationWidth/2-1)),[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=d(3)),[n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(c-=d(3)));const p=[r,i,a,o],g=Math.abs(c-h);t.wrap&&t.message&&(t.message=yk.wrapLabel(t.message,_n.getMax(g+2*Rot.wrapPadding,Rot.width),Pot(Rot)));const f=yk.calculateTextDimensions(t.message,Pot(Rot));return{width:_n.getMax(t.wrap?0:f.width+2*Rot.wrapPadding,g+2*Rot.wrapPadding,Rot.width),height:0,startx:c,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"),elt=s((async function(t,e,n,r){const i={},a=[];let s,o,l;for(const n of t){switch(n.id=yk.random({length:10}),n.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:a.push({id:n.id,msg:n.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:n.message&&(s=a.pop(),i[s.id]=s,i[n.id]=s,a.push(s));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case r.db.LINETYPE.ACTIVE_START:{const t=e.get(n.from?n.from:n.to.actor),r=Yot(n.from?n.from:n.to.actor).length,i=t.x+t.width/2+(r-1)*Rot.activationWidth/2,a={startx:i,stopx:i+Rot.activationWidth,actor:n.from,enabled:!0};Dot.activations.push(a)}break;case r.db.LINETYPE.ACTIVE_END:{const t=Dot.activations.map((t=>t.actor)).lastIndexOf(n.from);Dot.activations.splice(t,1).splice(0,1)}}void 0!==n.placement?(o=await Jot(n,e,r),n.noteModel=o,a.forEach((t=>{s=t,s.from=_n.getMin(s.from,o.startx),s.to=_n.getMax(s.to,o.startx+o.width),s.width=_n.getMax(s.width,Math.abs(s.from-s.to))-Rot.labelBoxWidth}))):(l=tlt(n,e,r),n.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach((t=>{if(s=t,l.startx===l.stopx){const t=e.get(n.from),r=e.get(n.to);s.from=_n.getMin(t.x-l.width/2,t.x-t.width/2,s.from),s.to=_n.getMax(r.x+l.width/2,r.x+t.width/2,s.to),s.width=_n.getMax(s.width,Math.abs(s.to-s.from))-Rot.labelBoxWidth}else s.from=_n.getMin(l.startx,s.from),s.to=_n.getMax(l.stopx,s.to),s.width=_n.getMax(s.width,l.width)-Rot.labelBoxWidth})))}return Dot.activations=[],m.debug("Loop type widths:",i),i}),"calculateLoopBounds"),nlt={parser:bst,db:not,renderer:{bounds:Dot,drawActors:Got,drawActorsPopup:qot,setConf:jot,draw:Xot},styles:rot,init:s((({wrap:t})=>{not.setWrap(t)}),"init")},rlt=Object.freeze({__proto__:null,diagram:nlt}),ilt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,18],n=[1,19],r=[1,20],i=[1,41],a=[1,42],o=[1,26],l=[1,24],c=[1,25],h=[1,32],u=[1,33],d=[1,34],p=[1,45],g=[1,35],f=[1,36],m=[1,37],y=[1,38],v=[1,27],x=[1,28],b=[1,29],w=[1,30],k=[1,31],T=[1,44],_=[1,46],E=[1,43],C=[1,47],S=[1,9],A=[1,8,9],L=[1,58],N=[1,59],I=[1,60],M=[1,61],R=[1,62],D=[1,63],O=[1,64],P=[1,8,9,41],B=[1,76],$=[1,8,9,12,13,22,39,41,44,66,67,68,69,70,71,72,77,79],F=[1,8,9,12,13,17,20,22,39,41,44,48,58,66,67,68,69,70,71,72,77,79,84,99,101,102],z=[13,58,84,99,101,102],U=[13,58,71,72,84,99,101,102],G=[13,58,66,67,68,69,70,84,99,101,102],q=[1,98],j=[1,115],Y=[1,107],W=[1,113],H=[1,108],V=[1,109],X=[1,110],K=[1,111],Z=[1,112],Q=[1,114],J=[22,58,59,80,84,85,86,87,88,89],tt=[1,8,9,39,41,44],et=[1,8,9,22],nt=[1,143],rt=[1,8,9,59],it=[1,8,9,22,58,59,80,84,85,86,87,88,89],at={trace:s((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,DOT:17,className:18,classLiteralName: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,CLASS:46,ANNOTATION_START:47,ANNOTATION_END:48,MEMBER:49,SEPARATOR:50,relation:51,NOTE_FOR:52,noteText:53,NOTE:54,CLASSDEF:55,classList:56,stylesOpt:57,ALPHA:58,COMMA:59,direction_tb:60,direction_bt:61,direction_rl:62,direction_lr:63,relationType:64,lineType:65,AGGREGATION:66,EXTENSION:67,COMPOSITION:68,DEPENDENCY:69,LOLLIPOP:70,LINE:71,DOTTED_LINE:72,CALLBACK:73,LINK:74,LINK_TARGET:75,CLICK:76,CALLBACK_NAME:77,CALLBACK_ARGS:78,HREF:79,STYLE:80,CSSCLASS:81,style:82,styleComponent:83,NUM:84,COLON:85,UNIT:86,SPACE:87,BRKT:88,PCT:89,commentToken:90,textToken:91,graphCodeTokens:92,textNoTagsToken:93,TAGSTART:94,TAGEND:95,"==":96,"--":97,DEFAULT:98,MINUS:99,keywords:100,UNICODE_TEXT:101,BQUOTE_STR:102,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",17:"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:"CLASS",47:"ANNOTATION_START",48:"ANNOTATION_END",49:"MEMBER",50:"SEPARATOR",52:"NOTE_FOR",54:"NOTE",55:"CLASSDEF",58:"ALPHA",59:"COMMA",60:"direction_tb",61:"direction_bt",62:"direction_rl",63:"direction_lr",66:"AGGREGATION",67:"EXTENSION",68:"COMPOSITION",69:"DEPENDENCY",70:"LOLLIPOP",71:"LINE",72:"DOTTED_LINE",73:"CALLBACK",74:"LINK",75:"LINK_TARGET",76:"CLICK",77:"CALLBACK_NAME",78:"CALLBACK_ARGS",79:"HREF",80:"STYLE",81:"CSSCLASS",84:"NUM",85:"COLON",86:"UNIT",87:"SPACE",88:"BRKT",89:"PCT",92:"graphCodeTokens",94:"TAGSTART",95:"TAGEND",96:"==",97:"--",98:"DEFAULT",99:"MINUS",100:"keywords",101:"UNICODE_TEXT",102:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,3],[15,2],[18,1],[18,3],[18,1],[18,2],[18,2],[18,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],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,6],[43,2],[43,3],[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],[56,1],[56,3],[32,1],[32,1],[32,1],[32,1],[51,3],[51,2],[51,2],[51,1],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,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],[57,1],[57,3],[82,1],[82,2],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[90,1],[90,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[93,1],[93,1],[93,1],[93,1],[16,1],[16,1],[16,1],[16,1],[19,1],[53,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 8:this.$=a[o-1];break;case 9:case 12:case 14:this.$=a[o];break;case 10:case 13:this.$=a[o-2]+"."+a[o];break;case 11:case 15:case 95:this.$=a[o-1]+a[o];break;case 16:case 17:this.$=a[o-1]+"~"+a[o]+"~";break;case 18:r.addRelation(a[o]);break;case 19:a[o-1].title=r.cleanupLabel(a[o]),r.addRelation(a[o-1]);break;case 30:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 31:case 32:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 33:r.addClassesToNamespace(a[o-3],a[o-1]);break;case 34:r.addClassesToNamespace(a[o-4],a[o-1]);break;case 35:this.$=a[o],r.addNamespace(a[o]);break;case 36:case 46:case 59:case 92:this.$=[a[o]];break;case 37:this.$=[a[o-1]];break;case 38:a[o].unshift(a[o-2]),this.$=a[o];break;case 40:r.setCssClass(a[o-2],a[o]);break;case 41:r.addMembers(a[o-3],a[o-1]);break;case 42:r.setCssClass(a[o-5],a[o-3]),r.addMembers(a[o-5],a[o-1]);break;case 43:this.$=a[o],r.addClass(a[o]);break;case 44:this.$=a[o-1],r.addClass(a[o-1]),r.setClassLabel(a[o-1],a[o]);break;case 45:r.addAnnotation(a[o],a[o-2]);break;case 47:a[o].push(a[o-1]),this.$=a[o];break;case 48:case 50:case 51:break;case 49:r.addMember(a[o-1],r.cleanupLabel(a[o]));break;case 52:this.$={id1:a[o-2],id2:a[o],relation:a[o-1],relationTitle1:"none",relationTitle2:"none"};break;case 53:this.$={id1:a[o-3],id2:a[o],relation:a[o-1],relationTitle1:a[o-2],relationTitle2:"none"};break;case 54:this.$={id1:a[o-3],id2:a[o],relation:a[o-2],relationTitle1:"none",relationTitle2:a[o-1]};break;case 55:this.$={id1:a[o-4],id2:a[o],relation:a[o-2],relationTitle1:a[o-3],relationTitle2:a[o-1]};break;case 56:r.addNote(a[o],a[o-1]);break;case 57:r.addNote(a[o]);break;case 58:this.$=a[o-2],r.defineClass(a[o-1],a[o]);break;case 60:this.$=a[o-2].concat([a[o]]);break;case 61:r.setDirection("TB");break;case 62:r.setDirection("BT");break;case 63:r.setDirection("RL");break;case 64:r.setDirection("LR");break;case 65:this.$={type1:a[o-2],type2:a[o],lineType:a[o-1]};break;case 66:this.$={type1:"none",type2:a[o],lineType:a[o-1]};break;case 67:this.$={type1:a[o-1],type2:"none",lineType:a[o]};break;case 68:this.$={type1:"none",type2:"none",lineType:a[o]};break;case 69:this.$=r.relationType.AGGREGATION;break;case 70:this.$=r.relationType.EXTENSION;break;case 71:this.$=r.relationType.COMPOSITION;break;case 72:this.$=r.relationType.DEPENDENCY;break;case 73:this.$=r.relationType.LOLLIPOP;break;case 74:this.$=r.lineType.LINE;break;case 75:this.$=r.lineType.DOTTED_LINE;break;case 76:case 82:this.$=a[o-2],r.setClickEvent(a[o-1],a[o]);break;case 77:case 83:this.$=a[o-3],r.setClickEvent(a[o-2],a[o-1]),r.setTooltip(a[o-2],a[o]);break;case 78:this.$=a[o-2],r.setLink(a[o-1],a[o]);break;case 79:this.$=a[o-3],r.setLink(a[o-2],a[o-1],a[o]);break;case 80:this.$=a[o-3],r.setLink(a[o-2],a[o-1]),r.setTooltip(a[o-2],a[o]);break;case 81:this.$=a[o-4],r.setLink(a[o-3],a[o-2],a[o]),r.setTooltip(a[o-3],a[o-1]);break;case 84:this.$=a[o-3],r.setClickEvent(a[o-2],a[o-1],a[o]);break;case 85:this.$=a[o-4],r.setClickEvent(a[o-3],a[o-2],a[o-1]),r.setTooltip(a[o-3],a[o]);break;case 86:this.$=a[o-3],r.setLink(a[o-2],a[o]);break;case 87:this.$=a[o-4],r.setLink(a[o-3],a[o-1],a[o]);break;case 88:this.$=a[o-4],r.setLink(a[o-3],a[o-1]),r.setTooltip(a[o-3],a[o]);break;case 89:this.$=a[o-5],r.setLink(a[o-4],a[o-2],a[o]),r.setTooltip(a[o-4],a[o-1]);break;case 90:this.$=a[o-2],r.setCssStyle(a[o-1],a[o]);break;case 91:r.setCssClass(a[o-1],a[o]);break;case 93:a[o-2].push(a[o]),this.$=a[o-2]}}),"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,18:21,19:40,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:n,37:r,38:22,42:i,43:23,46:a,47:o,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(S,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,18],{22:[1,50]}),t(A,[2,20]),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),{34:[1,51]},{36:[1,52]},t(A,[2,32]),t(A,[2,48],{51:53,64:56,65:57,13:[1,54],22:[1,55],66:L,67:N,68:I,69:M,70:R,71:D,72:O}),{39:[1,65]},t(P,[2,39],{39:[1,67],44:[1,66]}),t(A,[2,50]),t(A,[2,51]),{16:68,58:p,84:T,99:_,101:E},{16:39,18:69,19:40,58:p,84:T,99:_,101:E,102:C},{16:39,18:70,19:40,58:p,84:T,99:_,101:E,102:C},{16:39,18:71,19:40,58:p,84:T,99:_,101:E,102:C},{58:[1,72]},{13:[1,73]},{16:39,18:74,19:40,58:p,84:T,99:_,101:E,102:C},{13:B,53:75},{56:77,58:[1,78]},t(A,[2,61]),t(A,[2,62]),t(A,[2,63]),t(A,[2,64]),t($,[2,12],{16:39,19:40,18:80,17:[1,79],20:[1,81],58:p,84:T,99:_,101:E,102:C}),t($,[2,14],{20:[1,82]}),{15:83,16:84,58:p,84:T,99:_,101:E},{16:39,18:85,19:40,58:p,84:T,99:_,101:E,102:C},t(F,[2,118]),t(F,[2,119]),t(F,[2,120]),t(F,[2,121]),t([1,8,9,12,13,20,22,39,41,44,66,67,68,69,70,71,72,77,79],[2,122]),t(S,[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,18:21,38:22,43:23,16:39,19:40,5:86,33:e,35:n,37:r,42:i,46:a,47:o,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C}),{5:87,10:5,16:39,18:21,19:40,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:n,37:r,38:22,42:i,43:23,46:a,47:o,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C},t(A,[2,19]),t(A,[2,30]),t(A,[2,31]),{13:[1,89],16:39,18:88,19:40,58:p,84:T,99:_,101:E,102:C},{51:90,64:56,65:57,66:L,67:N,68:I,69:M,70:R,71:D,72:O},t(A,[2,49]),{65:91,71:D,72:O},t(z,[2,68],{64:92,66:L,67:N,68:I,69:M,70:R}),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(G,[2,74]),t(G,[2,75]),{8:[1,94],24:95,40:93,43:23,46:a},{16:96,58:p,84:T,99:_,101:E},{45:97,49:q},{48:[1,99]},{13:[1,100]},{13:[1,101]},{77:[1,102],79:[1,103]},{22:j,57:104,58:Y,80:W,82:105,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},{58:[1,116]},{13:B,53:117},t(A,[2,57]),t(A,[2,123]),{22:j,57:118,58:Y,59:[1,119],80:W,82:105,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},t(J,[2,59]),{16:39,18:120,19:40,58:p,84:T,99:_,101:E,102:C},t($,[2,15]),t($,[2,16]),t($,[2,17]),{39:[2,35]},{15:122,16:84,17:[1,121],39:[2,9],58:p,84:T,99:_,101:E},t(tt,[2,43],{11:123,12:[1,124]}),t(S,[2,7]),{9:[1,125]},t(et,[2,52]),{16:39,18:126,19:40,58:p,84:T,99:_,101:E,102:C},{13:[1,128],16:39,18:127,19:40,58:p,84:T,99:_,101:E,102:C},t(z,[2,67],{64:129,66:L,67:N,68:I,69:M,70:R}),t(z,[2,66]),{41:[1,130]},{24:95,40:131,43:23,46:a},{8:[1,132],41:[2,36]},t(P,[2,40],{39:[1,133]}),{41:[1,134]},{41:[2,46],45:135,49:q},{16:39,18:136,19:40,58:p,84:T,99:_,101:E,102:C},t(A,[2,76],{13:[1,137]}),t(A,[2,78],{13:[1,139],75:[1,138]}),t(A,[2,82],{13:[1,140],78:[1,141]}),{13:[1,142]},t(A,[2,90],{59:nt}),t(rt,[2,92],{83:144,22:j,58:Y,80:W,84:H,85:V,86:X,87:K,88:Z,89:Q}),t(it,[2,94]),t(it,[2,96]),t(it,[2,97]),t(it,[2,98]),t(it,[2,99]),t(it,[2,100]),t(it,[2,101]),t(it,[2,102]),t(it,[2,103]),t(it,[2,104]),t(A,[2,91]),t(A,[2,56]),t(A,[2,58],{59:nt}),{58:[1,145]},t($,[2,13]),{15:146,16:84,58:p,84:T,99:_,101:E},{39:[2,11]},t(tt,[2,44]),{13:[1,147]},{1:[2,4]},t(et,[2,54]),t(et,[2,53]),{16:39,18:148,19:40,58:p,84:T,99:_,101:E,102:C},t(z,[2,65]),t(A,[2,33]),{41:[1,149]},{24:95,40:150,41:[2,37],43:23,46:a},{45:151,49:q},t(P,[2,41]),{41:[2,47]},t(A,[2,45]),t(A,[2,77]),t(A,[2,79]),t(A,[2,80],{75:[1,152]}),t(A,[2,83]),t(A,[2,84],{13:[1,153]}),t(A,[2,86],{13:[1,155],75:[1,154]}),{22:j,58:Y,80:W,82:156,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},t(it,[2,95]),t(J,[2,60]),{39:[2,10]},{14:[1,157]},t(et,[2,55]),t(A,[2,34]),{41:[2,38]},{41:[1,158]},t(A,[2,81]),t(A,[2,85]),t(A,[2,87]),t(A,[2,88],{75:[1,159]}),t(rt,[2,93],{83:144,22:j,58:Y,80:W,84:H,85:V,86:X,87:K,88:Z,89:Q}),t(tt,[2,8]),t(P,[2,42]),t(A,[2,89])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,35],122:[2,11],125:[2,4],135:[2,47],146:[2,10],150:[2,38]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},st=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:s((function(t,e,n,r){switch(n){case 0:return 60;case 1:return 61;case 2:return 62;case 3:return 63;case 4:case 5:case 14:case 31:case 36:case 40:case 47: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:case 19:case 22:case 24:case 58:case 61:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 35:return 8;case 15:case 16:return 7;case 17:case 37:case 45:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 77;case 23:return 78;case 25:return"STR";case 26:this.begin("string");break;case 27:return 80;case 28:return 55;case 29:return this.begin("namespace"),42;case 30:case 39:return this.popState(),8;case 32:return this.begin("namespace-body"),39;case 33:case 43:return this.popState(),41;case 34:case 44:return"EOF_IN_STRUCT";case 38:return this.begin("class"),46;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 46:return"OPEN_IN_STRUCT";case 48:return"MEMBER";case 49:return 81;case 50:return 73;case 51:return 74;case 52:return 76;case 53:return 52;case 54:return 54;case 55:return 47;case 56:return 48;case 57:return 79;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:case 65:case 66:case 67:return 75;case 68:case 69:return 67;case 70:case 71:return 69;case 72:return 68;case 73:return 66;case 74:return 70;case 75:return 71;case 76:return 72;case 77:return 22;case 78:return 44;case 79:return 99;case 80:return 17;case 81:return"PLUS";case 82:return 85;case 83:return 59;case 84:case 85:return 88;case 86:return 89;case 87:case 88:return"EQUALS";case 89:return 58;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 84;case 94:return 101;case 95:case 96:return 87;case 97: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,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,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,94,95,96,97],inclusive:!0}}};return t}();function ot(){this.yy={}}return at.lexer=st,s(ot,"Parser"),ot.prototype=at,at.Parser=ot,new ot}();ilt.parser=ilt;var alt=ilt,slt=["#","+","~","-",""],olt=class{static{s(this,"ClassMember")}constructor(t,e){this.memberType=e,this.visibility="",this.classifier="",this.text="";const n=an(t,Hn());this.parseMember(n)}getDisplayDetails(){let t=this.visibility+fn(this.id);"method"===this.memberType&&(t+=`(${fn(this.parameters.trim())})`,this.returnType&&(t+=" : "+fn(this.returnType))),t=t.trim();return{displayText:t,cssStyle:this.parseClassifier()}}parseMember(t){let e="";if("method"===this.memberType){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(n){const t=n[1]?n[1].trim():"";if(slt.includes(t)&&(this.visibility=t),this.id=n[2],this.parameters=n[3]?n[3].trim():"",e=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",""===e){const t=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(t)&&(e=t,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const n=t.length,r=t.substring(0,1),i=t.substring(n-1);slt.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(e=i),this.id=t.substring(""===this.visibility?0:1,""===e?n:n-1)}this.classifier=e,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${fn(this.id)}${"method"===this.memberType?`(${fn(this.parameters)})${this.returnType?" : "+fn(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""}}},llt=[],clt=new Map,hlt=new Map,ult=[],dlt=[],plt=0,glt=new Map,flt=0,mlt=[],ylt=s((t=>_n.sanitizeText(t,Hn())),"sanitizeText"),vlt=s((function(t){const e=_n.sanitizeText(t,Hn());let n="",r=e;if(e.indexOf("~")>0){const t=e.split("~");r=ylt(t[0]),n=ylt(t[1])}return{className:r,type:n}}),"splitClassNameAndType"),xlt=s((function(t,e){const n=_n.sanitizeText(t,Hn());e&&(e=ylt(e));const{className:r}=vlt(n);clt.get(r).label=e,clt.get(r).text=`${e}${clt.get(r).type?`<${clt.get(r).type}>`:""}`}),"setClassLabel"),blt=s((function(t){const e=_n.sanitizeText(t,Hn()),{className:n,type:r}=vlt(e);if(clt.has(n))return;const i=_n.sanitizeText(n,Hn());clt.set(i,{id:i,type:r,label:i,text:`${i}${r?`<${r}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:"classId-"+i+"-"+plt}),plt++}),"addClass"),wlt=s((function(t,e){const n={id:`interface${dlt.length}`,label:t,classId:e};dlt.push(n)}),"addInterface"),klt=s((function(t){const e=_n.sanitizeText(t,Hn());if(clt.has(e))return clt.get(e).domId;throw new Error("Class not found: "+e)}),"lookUpDomId"),Tlt=s((function(){llt=[],clt=new Map,ult=[],dlt=[],(mlt=[]).push(qlt),glt=new Map,flt=0,jlt="TB",$n()}),"clear"),_lt=s((function(t){return clt.get(t)}),"getClass"),Elt=s((function(){return clt}),"getClasses"),Clt=s((function(){return llt}),"getRelations"),Slt=s((function(){return ult}),"getNotes"),Alt=s((function(t){m.debug("Adding relation: "+JSON.stringify(t));const e=[Glt.LOLLIPOP,Glt.AGGREGATION,Glt.COMPOSITION,Glt.DEPENDENCY,Glt.EXTENSION];t.relation.type1!==Glt.LOLLIPOP||e.includes(t.relation.type2)?t.relation.type2!==Glt.LOLLIPOP||e.includes(t.relation.type1)?(blt(t.id1),blt(t.id2)):(blt(t.id1),wlt(t.id2,t.id1),t.id2="interface"+(dlt.length-1)):(blt(t.id2),wlt(t.id1,t.id2),t.id1="interface"+(dlt.length-1)),t.id1=vlt(t.id1).className,t.id2=vlt(t.id2).className,t.relationTitle1=_n.sanitizeText(t.relationTitle1.trim(),Hn()),t.relationTitle2=_n.sanitizeText(t.relationTitle2.trim(),Hn()),llt.push(t)}),"addRelation"),Llt=s((function(t,e){const n=vlt(t).className;clt.get(n).annotations.push(e)}),"addAnnotation"),Nlt=s((function(t,e){blt(t);const n=vlt(t).className,r=clt.get(n);if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?r.annotations.push(ylt(t.substring(2,t.length-2))):t.indexOf(")")>0?r.methods.push(new olt(t,"method")):t&&r.members.push(new olt(t,"attribute"))}}),"addMember"),Ilt=s((function(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((e=>Nlt(t,e))))}),"addMembers"),Mlt=s((function(t,e){const n={id:`note${ult.length}`,class:e,text:t};ult.push(n)}),"addNote"),Rlt=s((function(t){return t.startsWith(":")&&(t=t.substring(1)),ylt(t.trim())}),"cleanupLabel"),Dlt=s((function(t,e){t.split(",").forEach((function(t){let n=t;/\d/.exec(t[0])&&(n="classId-"+n);const r=clt.get(n);r&&(r.cssClasses+=" "+e)}))}),"setCssClass"),Olt=s((function(t,e){for(const n of t){let t=hlt.get(n);void 0===t&&(t={id:n,styles:[],textStyles:[]},hlt.set(n,t)),e&&e.forEach((function(e){if(/color/.exec(e)){const n=e.replace("fill","bgFill");t.textStyles.push(n)}t.styles.push(e)})),clt.forEach((t=>{t.cssClasses.includes(n)&&t.styles.push(...e.flatMap((t=>t.split(","))))}))}}),"defineClass"),Plt=s((function(t,e){t.split(",").forEach((function(t){void 0!==e&&(clt.get(t).tooltip=ylt(e))}))}),"setTooltip"),Blt=s((function(t,e){return e&&glt.has(e)?glt.get(e).classes.get(t).tooltip:clt.get(t).tooltip}),"getTooltip"),$lt=s((function(t,e,n){const r=Hn();t.split(",").forEach((function(t){let i=t;/\d/.exec(t[0])&&(i="classId-"+i);const a=clt.get(i);a&&(a.link=yk.formatUrl(e,r),"sandbox"===r.securityLevel?a.linkTarget="_top":a.linkTarget="string"==typeof n?ylt(n):"_blank")})),Dlt(t,"clickable")}),"setLink"),Flt=s((function(t,e,n){t.split(",").forEach((function(t){zlt(t,e,n),clt.get(t).haveCallback=!0})),Dlt(t,"clickable")}),"setClickEvent"),zlt=s((function(t,e,n){const r=_n.sanitizeText(t,Hn());if("loose"!==Hn().securityLevel)return;if(void 0===e)return;const i=r;if(clt.has(i)){const t=klt(i);let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);Oa(this).classed("hover",!1)}))}),"setupToolTips");mlt.push(qlt);var jlt="TB",Ylt=s((()=>jlt),"getDirection"),Wlt=s((t=>{jlt=t}),"setDirection"),Hlt=s((function(t){glt.has(t)||(glt.set(t,{id:t,classes:new Map,children:{},domId:"classId-"+t+"-"+flt}),flt++)}),"addNamespace"),Vlt=s((function(t){return glt.get(t)}),"getNamespace"),Xlt=s((function(){return glt}),"getNamespaces"),Klt=s((function(t,e){if(glt.has(t))for(const n of e){const{className:e}=vlt(n);clt.get(e).parent=t,glt.get(t).classes.set(e,clt.get(e))}}),"addClassesToNamespace"),Zlt=s((function(t,e){const n=clt.get(t);if(e&&n)for(const t of e)t.includes(",")?n.styles.push(...t.split(",")):n.styles.push(t)}),"setCssStyle");function Qlt(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}s(Qlt,"getArrowMarker");var Jlt=s((()=>{const t=[],e=[],n=Hn();for(const e of glt.keys()){const r=glt.get(e);if(r){const e={id:r.id,label:r.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:n.look};t.push(e)}}for(const e of clt.keys()){const r=clt.get(e);if(r){const e=r;e.parentId=r.parent,e.look=n.look,t.push(e)}}let r=0;for(const i of ult){r++;const a={id:i.id,label:i.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};t.push(a);const s=clt.get(i.class)?.id??"";if(s){const t={id:`edgeNote${r}`,start:i.id,end:s,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};e.push(t)}}for(const e of dlt){const r={id:e.id,label:e.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};t.push(r)}r=0;for(const t of llt){r++;const i={id:bk(t.id1,t.id2,{prefix:"id",counter:r}),start:t.id1,end:t.id2,type:"normal",label:t.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:Qlt(t.relation.type1),arrowTypeEnd:Qlt(t.relation.type2),startLabelRight:"none"===t.relationTitle1?"":t.relationTitle1,endLabelLeft:"none"===t.relationTitle2?"":t.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:t.style||"",pattern:1==t.relation.lineType?"dashed":"solid",look:n.look};e.push(i)}return{nodes:t,edges:e,other:{},config:n,direction:Ylt()}}),"getData"),tct={setAccTitle:Fn,getAccTitle:zn,getAccDescription:Gn,setAccDescription:Un,getConfig:s((()=>Hn().class),"getConfig"),addClass:blt,bindFunctions:Ult,clear:Tlt,getClass:_lt,getClasses:Elt,getNotes:Slt,addAnnotation:Llt,addNote:Mlt,getRelations:Clt,addRelation:Alt,getDirection:Ylt,setDirection:Wlt,addMember:Nlt,addMembers:Ilt,cleanupLabel:Rlt,lineType:{LINE:0,DOTTED_LINE:1},relationType:Glt,setClickEvent:Flt,setCssClass:Dlt,defineClass:Olt,setLink:$lt,getTooltip:Blt,setTooltip:Plt,lookUpDomId:klt,setDiagramTitle:qn,getDiagramTitle:jn,setClassLabel:xlt,addNamespace:Hlt,addClassesToNamespace:Klt,getNamespace:Vlt,getNamespaces:Xlt,setCssStyle:Zlt,getData:Jlt},ect=s((t=>`g.classGroup text {\n fill: ${t.nodeBorder||t.classText};\n stroke: none;\n font-family: ${t.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${t.classText};\n}\n.edgeLabel .label rect {\n fill: ${t.mainBkg};\n}\n.label text {\n fill: ${t.classText};\n}\n\n.labelBkg {\n background: ${t.mainBkg};\n}\n.edgeLabel .label span {\n background: ${t.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${t.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n line-height: initial;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles"),nct=s(((t,e="TB")=>{if(!t.doc)return e;let n=e;for(const e of t.doc)"dir"===e.stmt&&(n=e.value);return n}),"getDir"),rct=s((function(t,e){return e.db.getClasses()}),"getClasses"),ict=s((async function(t,e,n,r){m.info("REF0:"),m.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Hn(),o=r.db.getData(),l=FH(e,i);o.type=r.type,o.layoutAlgorithm=nA(s),o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await eA(o,l);yk.insertTitle(l,"classDiagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),zH(l,8,"classDiagram",a?.useMaxWidth??!0)}),"draw"),act={getClasses:rct,draw:ict,getDir:nct},sct={parser:alt,db:tct,renderer:act,styles:ect,init:s((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,tct.clear()}),"init")},oct=Object.freeze({__proto__:null,diagram:sct}),lct={parser:alt,db:tct,renderer:act,styles:ect,init:s((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,tct.clear()}),"init")},cct=Object.freeze({__proto__:null,diagram:lct}),hct=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],l=[1,16],c=[1,17],h=[1,18],u=[1,19],d=[1,32],p=[1,20],g=[1,21],f=[1,22],m=[1,23],y=[1,24],v=[1,26],x=[1,27],b=[1,28],w=[1,29],k=[1,30],T=[1,31],_=[1,34],E=[1,35],C=[1,36],S=[1,37],A=[1,33],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],N=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],M={trace:s((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,"--\x3e":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,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",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:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"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],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 3:return r.setRootDoc(a[o]),a[o];case 4:this.$=[];break;case 5:"nl"!=a[o]&&(a[o-1].push(a[o]),this.$=a[o-1]);break;case 6:case 7:case 12:this.$=a[o];break;case 8:this.$="nl";break;case 13:const t=a[o-1];t.description=r.trimColon(a[o]),this.$=t;break;case 14:this.$={stmt:"relation",state1:a[o-2],state2:a[o]};break;case 15:const e=r.trimColon(a[o]);this.$={stmt:"relation",state1:a[o-3],state2:a[o-1],description:e};break;case 19:this.$={stmt:"state",id:a[o-3],type:"default",description:"",doc:a[o-1]};break;case 20:var l=a[o],c=a[o-2].trim();if(a[o].match(":")){var h=a[o].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:a[o-3],type:"default",description:a[o-5],doc:a[o-1]};break;case 22:this.$={stmt:"state",id:a[o],type:"fork"};break;case 23:this.$={stmt:"state",id:a[o],type:"join"};break;case 24:this.$={stmt:"state",id:a[o],type:"choice"};break;case 25:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[o-1].trim(),note:{position:a[o-2].trim(),text:a[o].trim()}};break;case 29:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:a[o-1].trim(),classes:a[o].trim()};break;case 34:this.$={stmt:"style",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 35:this.$={stmt:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 36:r.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:r.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:r.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:r.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:a[o].trim(),type:"default",description:""};break;case 44:case 45:this.$={stmt:"state",id:a[o-2].trim(),classes:[a[o].trim()],type:"default",description:""}}}),"anonymous"),table:[{3:1,4:e,5:n,6:r},{1:[3]},{3:5,4:e,5:n,6:r},{3:6,4:e,5:n,6:r},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,7]),t(L,[2,8]),t(L,[2,9]),t(L,[2,10]),t(L,[2,11]),t(L,[2,12],{14:[1,39],15:[1,40]}),t(L,[2,16]),{18:[1,41]},t(L,[2,18],{20:[1,42]}),{23:[1,43]},t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},t(L,[2,28]),{34:[1,48]},{36:[1,49]},t(L,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},t(N,[2,42],{55:[1,54]}),t(N,[2,43],{55:[1,55]}),t(L,[2,36]),t(L,[2,37]),t(L,[2,38]),t(L,[2,39]),t(L,[2,6]),t(L,[2,13]),{13:56,24:d,54:A},t(L,[2,17]),t(I,i,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},t(L,[2,29]),t(L,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},t(L,[2,14],{14:[1,67]}),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,68],22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},t(L,[2,32]),t(L,[2,33]),t(L,[2,34]),t(L,[2,35]),t(N,[2,44]),t(N,[2,45]),t(L,[2,15]),t(L,[2,19]),t(I,i,{7:72}),t(L,[2,26]),t(L,[2,27]),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,73],22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},R=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return 41;case 1:case 42:return 48;case 2:case 43:return 49;case 3:case 44:return 50;case 4:case 45:return 51;case 5:case 6:case 8:case 9:case 10:case 11:case 54:case 56:case 62:break;case 7:case 77:return 5;case 12:case 32:return this.pushState("SCALE"),17;case 13:case 33:return 18;case 14:case 20:case 34:case 49:case 52:this.popState();break;case 15:return this.begin("acc_title"),33;case 16:return this.popState(),"acc_title_value";case 17:return this.begin("acc_descr"),35;case 18:return this.popState(),"acc_descr_value";case 19:this.begin("acc_descr_multiline");break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),38;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 24:return this.popState(),this.pushState("CLASSDEFID"),39;case 25:return this.popState(),40;case 26:return this.pushState("CLASS"),45;case 27:return this.popState(),this.pushState("CLASS_STYLE"),46;case 28:return this.popState(),47;case 29:return this.pushState("STYLE"),42;case 30:return this.popState(),this.pushState("STYLEDEF_STYLES"),43;case 31:return this.popState(),44;case 35:this.pushState("STATE");break;case 36:case 39:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:case 64:return this.popState(),"ID";case 50:return"STATE_DESCR";case 51:return 19;case 53:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),56;case 59:return this.popState(),this.pushState("NOTE_ID"),57;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:return"NOTE_TEXT";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 67:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 68:case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return e.yytext=e.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 78:return"INVALID"}}),"anonymous"),rules:[/^(?: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,/^(?:[^\}]%%[^\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,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/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]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:!1},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[31],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[30],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,33,34],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[48],inclusive:!1},STATE_STRING:{rules:[49,50],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return t}();function D(){this.yy={}}return M.lexer=R,s(D,"Parser"),D.prototype=M,M.Parser=D,new D}();hct.parser=hct;var uct=hct,dct=s(((t,e="TB")=>{if(!t.doc)return e;let n=e;for(const e of t.doc)"dir"===e.stmt&&(n=e.value);return n}),"getDir"),pct=s((function(t,e){return e.db.extract(e.db.getRootDocV2()),e.db.getClasses()}),"getClasses"),gct=s((async function(t,e,n,r){m.info("REF0:"),m.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Hn();r.db.extract(r.db.getRootDocV2());const o=r.db.getData(),l=FH(e,i);o.type=r.type,o.layoutAlgorithm=s,o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["barb"],o.diagramId=e,await eA(o,l);yk.insertTitle(l,"statediagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),zH(l,8,"statediagram",a?.useMaxWidth??!0)}),"draw"),fct={getClasses:pct,draw:gct,getDir:dct},mct=new Map,yct=0;function vct(t="",e=0,n="",r="----"){return`state-${t}${null!==n&&n.length>0?`${r}${n}`:""}-${e}`}s(vct,"stateDomId");var xct=s(((t,e,n,r,i,a,s,o)=>{m.trace("items",e),e.forEach((e=>{switch(e.stmt){case"state":case"default":_ct(t,e,n,r,i,a,s,o);break;case"relation":{_ct(t,e.state1,n,r,i,a,s,o),_ct(t,e.state2,n,r,i,a,s,o);const l={id:"edge"+yct,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:"fill:none",labelStyle:"",label:_n.sanitizeText(e.description,Hn()),arrowheadStyle:"fill: #333",labelpos:"c",labelType:"text",thickness:"normal",classes:"transition",look:s};i.push(l),yct++}}}))}),"setupDoc"),bct=s(((t,e="TB")=>{let n=e;if(t.doc)for(const e of t.doc)"dir"===e.stmt&&(n=e.value);return n}),"getDir");function wct(t,e,n){if(!e.id||""===e.id||""===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach((t=>{if(n.get(t)){const r=n.get(t);e.cssCompiledStyles=[...e.cssCompiledStyles,...r.styles]}})));const r=t.find((t=>t.id===e.id));r?Object.assign(r,e):t.push(e)}function kct(t){return t?.classes?.join(" ")??""}function Tct(t){return t?.styles??[]}s(wct,"insertOrUpdateNode"),s(kct,"getClassesFromDbInfo"),s(Tct,"getStylesFromDbInfo");var _ct=s(((t,e,n,r,i,a,s,o)=>{const l=e.id,c=n.get(l),h=kct(c),u=Tct(c);if(m.info("dataFetcher parsedItem",e,c,u),"root"!==l){let n="rect";!0===e.start?n="stateStart":!1===e.start&&(n="stateEnd"),"default"!==e.type&&(n=e.type),mct.get(l)||mct.set(l,{id:l,shape:n,description:_n.sanitizeText(l,Hn()),cssClasses:`${h} statediagram-state`,cssStyles:u});const c=mct.get(l);e.description&&(Array.isArray(c.description)?(c.shape="rectWithTitle",c.description.push(e.description)):c.description?.length>0?(c.shape="rectWithTitle",c.description===l?c.description=[e.description]:c.description=[c.description,e.description]):(c.shape="rect",c.description=e.description),c.description=_n.sanitizeTextOrArray(c.description,Hn())),1===c.description?.length&&"rectWithTitle"===c.shape&&("group"===c.type?c.shape="roundedWithTitle":c.shape="rect"),!c.type&&e.doc&&(m.info("Setting cluster for XCX",l,bct(e)),c.type="group",c.isGroup=!0,c.dir=bct(e),c.shape="divider"===e.type?"divider":"roundedWithTitle",c.cssClasses=`${c.cssClasses} statediagram-cluster ${a?"statediagram-cluster-alt":""}`);const d={labelStyle:"",shape:c.shape,label:c.description,cssClasses:c.cssClasses,cssCompiledStyles:[],cssStyles:c.cssStyles,id:l,dir:c.dir,domId:vct(l,yct),type:c.type,isGroup:"group"===c.type,padding:8,rx:10,ry:10,look:s};if("divider"===d.shape&&(d.label=""),t&&"root"!==t.id&&(m.trace("Setting node ",l," to be child of its parent ",t.id),d.parentId=t.id),d.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,cssClasses:"statediagram-note",cssStyles:[],cssCompilesStyles:[],id:l+"----note-"+yct,domId:vct(l,yct,"note"),type:c.type,isGroup:"group"===c.type,padding:Hn().flowchart.padding,look:s,position:e.note.position},n=l+"----parent",a={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:c.cssClasses,cssStyles:[],id:l+"----parent",domId:vct(l,yct,"parent"),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};yct++,a.id=n,t.parentId=n,wct(r,a,o),wct(r,t,o),wct(r,d,o);let h=l,u=t.id;"left of"===e.note.position&&(h=t.id,u=l),i.push({id:h+"-"+u,start:h,end:u,arrowhead:"none",arrowTypeEnd:"",style:"fill:none",labelStyle:"",classes:"transition note-edge",arrowheadStyle:"fill: #333",labelpos:"c",labelType:"text",thickness:"normal",look:s})}else wct(r,d,o)}e.doc&&(m.trace("Adding nodes children "),xct(e,e.doc,n,r,i,!a,s,o))}),"dataFetcher"),Ect=s((()=>{mct.clear(),yct=0}),"reset");function Cct(){return new Map}s(Cct,"newClassesList");var Sct=[],Act=[],Lct="LR",Nct=[],Ict=Cct(),Mct=s((()=>({relations:[],states:new Map,documents:{}})),"newDoc"),Rct={root:Mct()},Dct=Rct.root,Oct=0,Pct=0,Bct=s((t=>JSON.parse(JSON.stringify(t))),"clone"),$ct=s((t=>{m.info("Setting root doc",t),Nct=t}),"setRootDoc"),Fct=s((()=>Nct),"getRootDoc"),zct=s(((t,e,n)=>{if("relation"===e.stmt)zct(t,e.state1,!0),zct(t,e.state2,!1);else if("state"===e.stmt&&("[*]"===e.id?(e.id=n?t.id+"_start":t.id+"_end",e.start=n):e.id=e.id.trim()),e.doc){const t=[];let n,r=[];for(n=0;n0&&r.length>0){const n={stmt:"state",id:tk(),type:"divider",doc:Bct(r)};t.push(Bct(n)),e.doc=t}e.doc.forEach((t=>zct(e,t,!0)))}}),"docTranslator"),Uct=s((()=>(zct({id:"root"},{id:"root",doc:Nct},!0),{id:"root",doc:Nct})),"getRootDocV2"),Gct=s((t=>{let e;e=t.doc?t.doc:t,m.info(e),jct(!0),m.info("Extract initial document:",e),e.forEach((t=>{switch(m.warn("Statement",t.stmt),t.stmt){case"state":qct(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case"relation":eht(t.state1,t.state2,t.description);break;case"classDef":aht(t.id.trim(),t.classes);break;case"style":{const e=t.id.trim().split(","),n=t.styleClass.split(",");e.forEach((t=>{let e=Yct(t);if(void 0===e){const n=t.trim();qct(n),e=Yct(n)}e.styles=n.map((t=>t.replace(/;/g,"")?.trim()))}))}break;case"applyClass":oht(t.id.trim(),t.styleClass)}}));const n=Wct(),r=Hn().look;Ect(),_ct(void 0,Uct(),n,Sct,Act,!0,r,Ict),Sct.forEach((t=>{if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+t.id+"]");t.label=t.label[0]}}))}),"extract"),qct=s((function(t,e="default",n=null,r=null,i=null,a=null,s=null,o=null){const l=t?.trim();if(Dct.states.has(l)?(Dct.states.get(l).doc||(Dct.states.get(l).doc=n),Dct.states.get(l).type||(Dct.states.get(l).type=e)):(m.info("Adding state ",l,r),Dct.states.set(l,{id:l,descriptions:[],type:e,doc:n,note:i,classes:[],styles:[],textStyles:[]})),r&&(m.info("Setting state description",l,r),"string"==typeof r&&nht(l,r.trim()),"object"==typeof r&&r.forEach((t=>nht(l,t.trim())))),i){const t=Dct.states.get(l);t.note=i,t.note.text=_n.sanitizeText(t.note.text,Hn())}if(a){m.info("Setting state classes",l,a);("string"==typeof a?[a]:a).forEach((t=>oht(l,t.trim())))}if(s){m.info("Setting state styles",l,s);("string"==typeof s?[s]:s).forEach((t=>lht(l,t.trim())))}if(o){m.info("Setting state styles",l,s);("string"==typeof o?[o]:o).forEach((t=>cht(l,t.trim())))}}),"addState"),jct=s((function(t){Sct=[],Act=[],Rct={root:Mct()},Dct=Rct.root,Oct=0,Ict=Cct(),t||$n()}),"clear"),Yct=s((function(t){return Dct.states.get(t)}),"getState"),Wct=s((function(){return Dct.states}),"getStates"),Hct=s((function(){m.info("Documents = ",Rct)}),"logDocuments"),Vct=s((function(){return Dct.relations}),"getRelations");function Xct(t=""){let e=t;return"[*]"===t&&(e=`start${++Oct}`),e}function Kct(t="",e="default"){return"[*]"===t?"start":e}function Zct(t=""){let e=t;return"[*]"===t&&(e=`end${++Oct}`),e}function Qct(t="",e="default"){return"[*]"===t?"end":e}function Jct(t,e,n){let r=Xct(t.id.trim()),i=Kct(t.id.trim(),t.type),a=Xct(e.id.trim()),s=Kct(e.id.trim(),e.type);qct(r,i,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),qct(a,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),Dct.relations.push({id1:r,id2:a,relationTitle:_n.sanitizeText(n,Hn())})}s(Xct,"startIdIfNeeded"),s(Kct,"startTypeIfNeeded"),s(Zct,"endIdIfNeeded"),s(Qct,"endTypeIfNeeded"),s(Jct,"addRelationObjs");var tht,eht=s((function(t,e,n){if("object"==typeof t)Jct(t,e,n);else{const r=Xct(t.trim()),i=Kct(t),a=Zct(e.trim()),s=Qct(e);qct(r,i),qct(a,s),Dct.relations.push({id1:r,id2:a,title:_n.sanitizeText(n,Hn())})}}),"addRelation"),nht=s((function(t,e){const n=Dct.states.get(t),r=e.startsWith(":")?e.replace(":","").trim():e;n.descriptions.push(_n.sanitizeText(r,Hn()))}),"addDescription"),rht=s((function(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()}),"cleanupLabel"),iht=s((()=>"divider-id-"+ ++Pct),"getDividerId"),aht=s((function(t,e=""){Ict.has(t)||Ict.set(t,{id:t,styles:[],textStyles:[]});const n=Ict.get(t);null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp("color").exec(t)){const t=e.replace("fill","bgFill").replace("color","fill");n.textStyles.push(t)}n.styles.push(e)}))}),"addStyleClass"),sht=s((function(){return Ict}),"getClasses"),oht=s((function(t,e){t.split(",").forEach((function(t){let n=Yct(t);if(void 0===n){const e=t.trim();qct(e),n=Yct(e)}n.classes.push(e)}))}),"setCssClass"),lht=s((function(t,e){const n=Yct(t);void 0!==n&&n.styles.push(e)}),"setStyle"),cht=s((function(t,e){const n=Yct(t);void 0!==n&&n.textStyles.push(e)}),"setTextStyle"),hht=s((()=>Lct),"getDirection"),uht=s((t=>{Lct=t}),"setDirection"),dht=s((t=>t&&":"===t[0]?t.substr(1).trim():t.trim()),"trimColon"),pht=s((()=>{const t=Hn();return{nodes:Sct,edges:Act,other:{},config:t,direction:dct(Uct())}}),"getData"),ght={getConfig:s((()=>Hn().state),"getConfig"),getData:pht,addState:qct,clear:jct,getState:Yct,getStates:Wct,getRelations:Vct,getClasses:sht,getDirection:hht,addRelation:eht,getDividerId:iht,setDirection:uht,cleanupLabel:rht,lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},logDocuments:Hct,getRootDoc:Fct,setRootDoc:$ct,getRootDocV2:Uct,extract:Gct,trimColon:dht,getAccTitle:zn,setAccTitle:Fn,getAccDescription:Gn,setAccDescription:Un,addStyleClass:aht,setCssClass:oht,addDescription:nht,setDiagramTitle:qn,getDiagramTitle:jn},fht=s((t=>`\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles"),mht={},yht=s(((t,e)=>{mht[t]=e}),"set"),vht=s((t=>mht[t]),"get"),xht=s((()=>Object.keys(mht)),"keys"),bht=s((()=>xht().length),"size"),wht={get:vht,set:yht,keys:xht,size:bht},kht=s((t=>t.append("circle").attr("class","start-state").attr("r",Hn().state.sizeUnit).attr("cx",Hn().state.padding+Hn().state.sizeUnit).attr("cy",Hn().state.padding+Hn().state.sizeUnit)),"drawStartState"),Tht=s((t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Hn().state.textHeight).attr("class","divider").attr("x2",2*Hn().state.textHeight).attr("y1",0).attr("y2",0)),"drawDivider"),_ht=s(((t,e)=>{const n=t.append("text").attr("x",2*Hn().state.padding).attr("y",Hn().state.textHeight+2*Hn().state.padding).attr("font-size",Hn().state.fontSize).attr("class","state-title").text(e.id),r=n.node().getBBox();return t.insert("rect",":first-child").attr("x",Hn().state.padding).attr("y",Hn().state.padding).attr("width",r.width+2*Hn().state.padding).attr("height",r.height+2*Hn().state.padding).attr("rx",Hn().state.radius),n}),"drawSimpleState"),Eht=s(((t,e)=>{const n=s((function(t,e,n){const r=t.append("tspan").attr("x",2*Hn().state.padding).text(e);n||r.attr("dy",Hn().state.textHeight)}),"addTspan"),r=t.append("text").attr("x",2*Hn().state.padding).attr("y",Hn().state.textHeight+1.3*Hn().state.padding).attr("font-size",Hn().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),i=r.height,a=t.append("text").attr("x",Hn().state.padding).attr("y",i+.4*Hn().state.padding+Hn().state.dividerMargin+Hn().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach((function(t){o||(n(a,t,l),l=!1),o=!1}));const c=t.append("line").attr("x1",Hn().state.padding).attr("y1",Hn().state.padding+i+Hn().state.dividerMargin/2).attr("y2",Hn().state.padding+i+Hn().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),u=Math.max(h.width,r.width);return c.attr("x2",u+3*Hn().state.padding),t.insert("rect",":first-child").attr("x",Hn().state.padding).attr("y",Hn().state.padding).attr("width",u+2*Hn().state.padding).attr("height",h.height+i+2*Hn().state.padding).attr("rx",Hn().state.radius),t}),"drawDescrState"),Cht=s(((t,e,n)=>{const r=Hn().state.padding,i=2*Hn().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Hn().state.titleShift).attr("font-size",Hn().state.fontSize).attr("class","state-title").text(e.id),c=l.node().getBBox().width+i;let h,u=Math.max(c,s);u===s&&(u+=i);const d=t.node().getBBox();e.doc,h=o-r,c>s&&(h=(s-u)/2+r),Math.abs(o-d.x)s&&(h=o-(c-s)/2);const p=1-Hn().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",p).attr("class",n?"alt-composit":"composit").attr("width",u).attr("height",d.height+Hn().state.textHeight+Hn().state.titleShift+1).attr("rx","0"),l.attr("x",h+r),c<=s&&l.attr("x",o+(u-i)/2-c/2+r),t.insert("rect",":first-child").attr("x",h).attr("y",Hn().state.titleShift-Hn().state.textHeight-Hn().state.padding).attr("width",u).attr("height",3*Hn().state.textHeight).attr("rx",Hn().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",Hn().state.titleShift-Hn().state.textHeight-Hn().state.padding).attr("width",u).attr("height",d.height+3+2*Hn().state.textHeight).attr("rx",Hn().state.radius),t}),"addTitleAndBox"),Sht=s((t=>(t.append("circle").attr("class","end-state-outer").attr("r",Hn().state.sizeUnit+Hn().state.miniPadding).attr("cx",Hn().state.padding+Hn().state.sizeUnit+Hn().state.miniPadding).attr("cy",Hn().state.padding+Hn().state.sizeUnit+Hn().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Hn().state.sizeUnit).attr("cx",Hn().state.padding+Hn().state.sizeUnit+2).attr("cy",Hn().state.padding+Hn().state.sizeUnit+2))),"drawEndState"),Aht=s(((t,e)=>{let n=Hn().state.forkWidth,r=Hn().state.forkHeight;if(e.parentId){let t=n;n=r,r=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",n).attr("height",r).attr("x",Hn().state.padding).attr("y",Hn().state.padding)}),"drawForkJoinState"),Lht=s(((t,e,n,r)=>{let i=0;const a=r.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(_n.lineBreakRegex);let l=1.25*Hn().state.noteMargin;for(const t of o){const r=t.trim();if(r.length>0){const t=a.append("tspan");if(t.text(r),0===l){l+=t.node().getBBox().height}i+=l,t.attr("x",e+Hn().state.noteMargin),t.attr("y",n+i+1.25*Hn().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}}),"_drawLongText"),Nht=s(((t,e)=>{e.attr("class","state-note");const n=e.append("rect").attr("x",0).attr("y",Hn().state.padding),r=e.append("g"),{textWidth:i,textHeight:a}=Lht(t,0,0,r);return n.attr("height",a+2*Hn().state.noteMargin),n.attr("width",i+2*Hn().state.noteMargin),n}),"drawNote"),Iht=s((function(t,e){const n=e.id,r={id:n,label:e.id,width:0,height:0},i=t.append("g").attr("id",n).attr("class","stateGroup");"start"===e.type&&kht(i),"end"===e.type&&Sht(i),"fork"!==e.type&&"join"!==e.type||Aht(i,e),"note"===e.type&&Nht(e.note.text,i),"divider"===e.type&&Tht(i),"default"===e.type&&0===e.descriptions.length&&_ht(i,e),"default"===e.type&&e.descriptions.length>0&&Eht(i,e);const a=i.node().getBBox();return r.width=a.width+2*Hn().state.padding,r.height=a.height+2*Hn().state.padding,wht.set(n,r),r}),"drawState"),Mht=0,Rht=s((function(t,e,n){const r=s((function(t){switch(t){case ght.relationType.AGGREGATION:return"aggregation";case ght.relationType.EXTENSION:return"extension";case ght.relationType.COMPOSITION:return"composition";case ght.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");e.points=e.points.filter((t=>!Number.isNaN(t.y)));const i=e.points,a=Xh().x((function(t){return t.x})).y((function(t){return t.y})).curve(iu),o=t.append("path").attr("d",a(i)).attr("id","edge"+Mht).attr("class","transition");let l="";if(Hn().state.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),o.attr("marker-end","url("+l+"#"+r(ght.relationType.DEPENDENCY)+"End)"),void 0!==n.title){const r=t.append("g").attr("class","stateLabel"),{x:i,y:a}=yk.calcLabelPosition(e.points),s=_n.getRows(n.title);let o=0;const l=[];let c=0,h=0;for(let t=0;t<=s.length;t++){const e=r.append("text").attr("text-anchor","middle").text(s[t]).attr("x",i).attr("y",a+o),n=e.node().getBBox();if(c=Math.max(c,n.width),h=Math.min(h,n.x),m.info(n.x,i,a+o),0===o){const t=e.node().getBBox();o=t.height,m.info("Title height",o,a)}l.push(e)}let u=o*s.length;if(s.length>1){const t=(s.length-1)*o*.5;l.forEach(((e,n)=>e.attr("y",a+n*o-t))),u=o*s.length}const d=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",i-c/2-Hn().state.padding/2).attr("y",a-u/2-Hn().state.padding/2-3.5).attr("width",c+Hn().state.padding).attr("height",u+Hn().state.padding),m.info(d)}Mht++}),"drawEdge"),Dht={},Oht=s((function(){}),"setConf"),Pht=s((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"),Bht=s((function(t,e,n,r){tht=Hn().state;const i=Hn().securityLevel;let a;"sandbox"===i&&(a=Oa("#i"+e));const s=Oa("sandbox"===i?a.nodes()[0].contentDocument.body:"body"),o="sandbox"===i?a.nodes()[0].contentDocument:document;m.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);Pht(l);const c=r.db.getRootDoc();Fht(c,l,void 0,!1,s,o,r);const h=tht.padding,u=l.node().getBBox(),d=u.width+2*h,p=u.height+2*h;Sn(l,p,1.75*d,tht.useMaxWidth),l.attr("viewBox",`${u.x-tht.padding} ${u.y-tht.padding} `+d+" "+p)}),"draw"),$ht=s((t=>t?t.length*tht.fontSizeFactor:1),"getLabelWidth"),Fht=s(((t,e,n,r,i,a,s)=>{const o=new nq({compound:!0,multigraph:!0});let l,c=!0;for(l=0;l{const e=t.parentElement;let n=0,r=0;e&&(e.parentElement&&(n=e.parentElement.getBBox().width),r=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(r)&&(r=0)),t.setAttribute("x1",0-r+8),t.setAttribute("x2",n-r-8)}))}else m.debug("No Node "+t+": "+JSON.stringify(o.node(t)))}));let f=g.getBBox();o.edges().forEach((function(t){void 0!==t&&void 0!==o.edge(t)&&(m.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(o.edge(t))),Rht(e,o.edge(t),o.edge(t).relation))})),f=g.getBBox();const y={id:n||"root",label:n||"root",width:0,height:0};return y.width=f.width+2*tht.padding,y.height=f.height+2*tht.padding,m.debug("Doc rendered",y,o),y}),"renderDoc"),zht={parser:uct,db:ght,renderer:{setConf:Oht,draw:Bht},styles:fht,init:s((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,ght.clear()}),"init")},Uht=Object.freeze({__proto__:null,diagram:zht}),Ght={parser:uct,db:ght,renderer:fct,styles:fht,init:s((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,ght.clear()}),"init")},qht=Object.freeze({__proto__:null,diagram:Ght}),jht=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],l=[1,14],c={trace:s((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:r.setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 9:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 13:r.addTask(a[o-1],a[o]),this.$="task"}}),"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:n,12:r,14:i,16:a,17:o,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:r,14:i,16:a,17:o,18:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},h=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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 t}();function u(){this.yy={}}return c.lexer=h,s(u,"Parser"),u.prototype=c,c.Parser=u,new u}();jht.parser=jht;var Yht=jht,Wht="",Hht=[],Vht=[],Xht=[],Kht=s((function(){Hht.length=0,Vht.length=0,Wht="",Xht.length=0,$n()}),"clear"),Zht=s((function(t){Wht=t,Hht.push(t)}),"addSection"),Qht=s((function(){return Hht}),"getSections"),Jht=s((function(){let t=rut();let e=0;for(;!t&&e<100;)t=rut(),e++;return Vht.push(...Xht),Vht}),"getTasks"),tut=s((function(){const t=[];Vht.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),eut=s((function(t,e){const n=e.substr(1).split(":");let r=0,i=[];1===n.length?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(","));const a=i.map((t=>t.trim())),s={section:Wht,type:Wht,people:a,task:t,score:r};Xht.push(s)}),"addTask"),nut=s((function(t){const e={section:Wht,type:Wht,description:t,task:t,classes:[]};Vht.push(e)}),"addTaskOrg"),rut=s((function(){const t=s((function(t){return Xht[t].processed}),"compileTask");let e=!0;for(const[n,r]of Xht.entries())t(n),e=e&&r.processed;return e}),"compileTasks"),iut=s((function(){return tut()}),"getActors"),aut={getConfig:s((()=>Hn().journey),"getConfig"),clear:Kht,setDiagramTitle:qn,getDiagramTitle:jn,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,addSection:Zht,getSections:Qht,getTasks:Jht,addTask:eut,addTaskOrg:nut,getActors:iut},sut=s((t=>`.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`),"getStyles"),out=s((function(t,e){return rW(t,e)}),"drawRect"),lut=s((function(t,e){const n=15,r=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const r=qh().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(t){const r=qh().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function l(t){t.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 i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s(a,"smile"),s(o,"sad"),s(l,"ambivalent"),e.score>3?a(i):e.score<3?o(i):l(i),r}),"drawFace"),cut=s((function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n}),"drawCircle"),hut=s((function(t,e){return aW(t,e)}),"drawText"),uut=s((function(t,e){function n(t,e,n,r,i){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+r-i)+" "+(t+n-1.2*i)+","+(e+r)+" "+t+","+(e+r)}s(n,"genPoints");const r=t.append("polygon");r.attr("points",n(e.x,e.y,50,20,7)),r.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,hut(t,e)}),"drawLabel"),dut=s((function(t,e,n){const r=t.append("g"),i=lW();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=n.width*e.taskCount+n.diagramMarginX*(e.taskCount-1),i.height=n.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,out(r,i),mut(n)(e.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},n,e.colour)}),"drawSection"),put=-1,gut=s((function(t,e,n){const r=e.x+n.width/2,i=t.append("g");put++;i.append("line").attr("id","task"+put).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),lut(i,{cx:r,cy:300+30*(5-e.score),score:e.score});const a=lW();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,out(i,a);let s=e.x+14;e.people.forEach((t=>{const n=e.actors[t].color,r={cx:s,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};cut(i,r),s+=10})),mut(n)(e.task,i,a.x,a.y,a.width,a.height,{class:"task"},n,e.colour)}),"drawTask"),fut=s((function(t,e){iW(t,e)}),"drawBackgroundRect"),mut=function(){function t(t,e,n,i,a,s,o,l){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(//gi);for(let t=0;t{const i=xut[r].color,a={cx:20,cy:n,r:7,fill:i,stroke:"#000",pos:xut[r].position};yut.drawCircle(t,a);const s={x:40,y:n+7,fill:"#666",text:r,textMargin:5|e.boxTextMargin};yut.drawText(t,s),n+=20}))}s(but,"drawActorLegend");var wut=Hn().journey,kut=wut.leftMargin,Tut=s((function(t,e,n,r){const i=Hn().journey,a=Hn().securityLevel;let s;"sandbox"===a&&(s=Oa("#i"+e));const o=Oa("sandbox"===a?s.nodes()[0].contentDocument.body:"body");_ut.init();const l=o.select("#"+e);yut.initGraphics(l);const c=r.db.getTasks(),h=r.db.getDiagramTitle(),u=r.db.getActors();for(const t in xut)delete xut[t];let d=0;u.forEach((t=>{xut[t]={color:i.actorColours[d%i.actorColours.length],position:d},d++})),but(l),_ut.insert(0,0,kut,50*Object.keys(xut).length),Sut(l,c,0);const p=_ut.getBounds();h&&l.append("text").text(h).attr("x",kut).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const g=p.stopy-p.starty+2*i.diagramMarginY,f=kut+p.stopx+2*i.diagramMarginX;Sn(l,g,f,i.useMaxWidth),l.append("line").attr("x1",kut).attr("y1",4*i.height).attr("x2",f-kut-4).attr("y2",4*i.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const m=h?70:0;l.attr("viewBox",`${p.startx} -25 ${f} ${g+m}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",g+m+25)}),"draw"),_ut={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:s((function(t,e,n,r){void 0===t[e]?t[e]=n:t[e]=r(n,t[e])}),"updateVal"),updateBounds:s((function(t,e,n,r){const i=Hn().journey,a=this;let o=0;function l(l){return s((function(s){o++;const c=a.sequenceItems.length-o+1;a.updateVal(s,"starty",e-c*i.boxMargin,Math.min),a.updateVal(s,"stopy",r+c*i.boxMargin,Math.max),a.updateVal(_ut.data,"startx",t-c*i.boxMargin,Math.min),a.updateVal(_ut.data,"stopx",n+c*i.boxMargin,Math.max),"activation"!==l&&(a.updateVal(s,"startx",t-c*i.boxMargin,Math.min),a.updateVal(s,"stopx",n+c*i.boxMargin,Math.max),a.updateVal(_ut.data,"starty",e-c*i.boxMargin,Math.min),a.updateVal(_ut.data,"stopy",r+c*i.boxMargin,Math.max))}),"updateItemBounds")}s(l,"updateFn"),this.sequenceItems.forEach(l())}),"updateBounds"),insert:s((function(t,e,n,r){const i=Math.min(t,n),a=Math.max(t,n),s=Math.min(e,r),o=Math.max(e,r);this.updateVal(_ut.data,"startx",i,Math.min),this.updateVal(_ut.data,"starty",s,Math.min),this.updateVal(_ut.data,"stopx",a,Math.max),this.updateVal(_ut.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)}),"insert"),bumpVerticalPos:s((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:s((function(){return this.verticalPos}),"getVerticalPos"),getBounds:s((function(){return this.data}),"getBounds")},Eut=wut.sectionFills,Cut=wut.sectionColours,Sut=s((function(t,e,n){const r=Hn().journey;let i="";const a=n+(2*r.height+r.diagramMarginY);let s=0,o="#CCC",l="black",c=0;for(const[n,h]of e.entries()){if(i!==h.section){o=Eut[s%Eut.length],c=s%Eut.length,l=Cut[s%Cut.length];let a=0;const u=h.section;for(let t=n;t(xut[e]&&(t[e]=xut[e]),t)),{});h.x=n*r.taskMargin+n*r.width+kut,h.y=a,h.width=r.diagramMarginX,h.height=r.diagramMarginY,h.colour=l,h.fill=o,h.num=c,h.actors=u,yut.drawTask(t,h,r),_ut.insert(h.x,h.y,h.x+h.width+r.taskMargin,450)}}),"drawTasks"),Aut={setConf:vut,draw:Tut},Lut={parser:Yht,db:aut,renderer:Aut,styles:sut,init:s((t=>{Aut.setConf(t.journey),aut.clear()}),"init")},Nut=Object.freeze({__proto__:null,diagram:Lut}),Iut=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[6,8,10,11,12,14,16,17,20,21],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],l=[1,16],c=[1,17],h={trace:s((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,timeline: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,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",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",20:"period",21:"event"},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,1],[9,1],[18,1],[19,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:r.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 9:this.$=a[o].trim(),r.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=a[o].trim(),r.getCommonDb().setAccDescription(this.$);break;case 12:r.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 15:r.addTask(a[o],0,""),this.$=a[o];break;case 16:r.addEvent(a[o].substr(2)),this.$=a[o]}}),"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:n,12:r,14:i,16:a,17:o,18:14,19:15,20:l,21:c},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:18,11:n,12:r,14:i,16:a,17:o,18:14,19:15,20:l,21:c},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,19]},{15:[1,20]},t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,4]),t(e,[2,9]),t(e,[2,10])],defaultActions:{},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},u=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/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]+)/i,/^(?:[^#:\n]+)/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],inclusive:!0}}};return t}();function d(){this.yy={}}return h.lexer=u,s(d,"Parser"),d.prototype=h,h.Parser=d,new d}();Iut.parser=Iut;var Mut=Iut,Rut={};l(Rut,{addEvent:()=>Yut,addSection:()=>Uut,addTask:()=>jut,addTaskOrg:()=>Wut,clear:()=>zut,default:()=>Vut,getCommonDb:()=>Fut,getSections:()=>Gut,getTasks:()=>qut});var Dut="",Out=0,Put=[],But=[],$ut=[],Fut=s((()=>Rn),"getCommonDb"),zut=s((function(){Put.length=0,But.length=0,Dut="",$ut.length=0,$n()}),"clear"),Uut=s((function(t){Dut=t,Put.push(t)}),"addSection"),Gut=s((function(){return Put}),"getSections"),qut=s((function(){let t=Hut();let e=0;for(;!t&&e<100;)t=Hut(),e++;return But.push(...$ut),But}),"getTasks"),jut=s((function(t,e,n){const r={id:Out++,section:Dut,type:Dut,task:t,score:e||0,events:n?[n]:[]};$ut.push(r)}),"addTask"),Yut=s((function(t){$ut.find((t=>t.id===Out-1)).events.push(t)}),"addEvent"),Wut=s((function(t){const e={section:Dut,type:Dut,description:t,task:t,classes:[]};But.push(e)}),"addTaskOrg"),Hut=s((function(){const t=s((function(t){return $ut[t].processed}),"compileTask");let e=!0;for(const[n,r]of $ut.entries())t(n),e=e&&r.processed;return e}),"compileTasks"),Vut={clear:zut,getCommonDb:Fut,addSection:Uut,getSections:Gut,getTasks:qut,addTask:jut,addTaskOrg:Wut,addEvent:Yut},Xut=s((function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n}),"drawRect"),Kut=s((function(t,e){const n=15,r=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const r=qh().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(t){const r=qh().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function l(t){t.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 i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s(a,"smile"),s(o,"sad"),s(l,"ambivalent"),e.score>3?a(i):e.score<3?o(i):l(i),r}),"drawFace"),Zut=s((function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n}),"drawCircle"),Qut=s((function(t,e){const n=e.text.replace(//gi," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),void 0!==e.class&&r.attr("class",e.class);const i=r.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(n),r}),"drawText"),Jut=s((function(t,e){function n(t,e,n,r,i){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+r-i)+" "+(t+n-1.2*i)+","+(e+r)+" "+t+","+(e+r)}s(n,"genPoints");const r=t.append("polygon");r.attr("points",n(e.x,e.y,50,20,7)),r.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Qut(t,e)}),"drawLabel"),tdt=s((function(t,e,n){const r=t.append("g"),i=adt();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=n.width,i.height=n.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,Xut(r,i),sdt(n)(e.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},n,e.colour)}),"drawSection"),edt=-1,ndt=s((function(t,e,n){const r=e.x+n.width/2,i=t.append("g");edt++;i.append("line").attr("id","task"+edt).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Kut(i,{cx:r,cy:300+30*(5-e.score),score:e.score});const a=adt();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,Xut(i,a),sdt(n)(e.task,i,a.x,a.y,a.width,a.height,{class:"task"},n,e.colour)}),"drawTask"),rdt=s((function(t,e){Xut(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()}),"drawBackgroundRect"),idt=s((function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}}),"getTextObj"),adt=s((function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),sdt=function(){function t(t,e,n,i,a,s,o,l){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(//gi);for(let t=0;t)/).reverse(),i=[],a=n.attr("y"),s=parseFloat(n.attr("dy")),o=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let s=0;se||"
    "===t)&&(i.pop(),o.text(i.join(" ").trim()),i="
    "===t?[""]:[t],o=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))}))}s(ldt,"wrap");var cdt=s((function(t,e,n,r){const i=n%12-1,a=t.append("g");e.section=i,a.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+i);const s=a.append("g"),o=a.append("g"),l=o.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ldt,e.width).node().getBBox(),c=r.fontSize?.replace?r.fontSize.replace("px",""):r.fontSize;return e.height=l.height+1.1*c*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,o.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),udt(s,e,i,r),e}),"drawNode"),hdt=s((function(t,e,n){const r=t.append("g"),i=r.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ldt,e.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return r.remove(),i.height+1.1*a*.5+e.padding}),"getVirtualNodeHeight"),udt=s((function(t,e,n){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("d",`M0 ${e.height-5} v${10-e.height} q0,-5 5,-5 h${e.width-10} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)}),"defaultBkg"),ddt={drawRect:Xut,drawCircle:Zut,drawSection:tdt,drawText:Qut,drawLabel:Jut,drawTask:ndt,drawBackgroundRect:rdt,getTextObj:idt,getNoteRect:adt,initGraphics:odt,drawNode:cdt,getVirtualNodeHeight:hdt},pdt=s((function(t,e,n,r){const i=Hn(),a=i.leftMargin??50;m.debug("timeline",r.db);const s=i.securityLevel;let o;"sandbox"===s&&(o=Oa("#i"+e));const l=Oa("sandbox"===s?o.nodes()[0].contentDocument.body:"body").select("#"+e);l.append("g");const c=r.db.getTasks(),h=r.db.getCommonDb().getDiagramTitle();m.debug("task",c),ddt.initGraphics(l);const u=r.db.getSections();m.debug("sections",u);let d=0,p=0,g=0,f=0,y=50+a,v=50;f=50;let x=0,b=!0;u.forEach((function(t){const e={number:x,descr:t,section:x,width:150,padding:20,maxHeight:d},n=ddt.getVirtualNodeHeight(l,e,i);m.debug("sectionHeight before draw",n),d=Math.max(d,n+20)}));let w=0,k=0;m.debug("tasks.length",c.length);for(const[t,e]of c.entries()){const n={number:t,descr:e,section:e.section,width:150,padding:20,maxHeight:p},r=ddt.getVirtualNodeHeight(l,n,i);m.debug("taskHeight before draw",r),p=Math.max(p,r+20),w=Math.max(w,e.events.length);let a=0;for(const t of e.events){const n={descr:t,section:e.section,number:e.section,width:150,padding:20,maxHeight:50};a+=ddt.getVirtualNodeHeight(l,n,i)}k=Math.max(k,a)}m.debug("maxSectionHeight before draw",d),m.debug("maxTaskHeight before draw",p),u&&u.length>0?u.forEach((t=>{const e=c.filter((e=>e.section===t)),n={number:x,descr:t,section:x,width:200*Math.max(e.length,1)-50,padding:20,maxHeight:d};m.debug("sectionNode",n);const r=l.append("g"),a=ddt.drawNode(r,n,x,i);m.debug("sectionNode output",a),r.attr("transform",`translate(${y}, 50)`),v+=d+50,e.length>0&&gdt(l,e,x,y,v,p,i,w,k,d,!1),y+=200*Math.max(e.length,1),v=50,x++})):(b=!1,gdt(l,c,x,y,v,p,i,w,k,d,!0));const T=l.node().getBBox();m.debug("bounds",T),h&&l.append("text").text(h).attr("x",T.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),g=b?d+p+150:p+100;l.append("g").attr("class","lineWrapper").append("line").attr("x1",a).attr("y1",g).attr("x2",T.width+3*a).attr("y2",g).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),An(void 0,l,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)}),"draw"),gdt=s((function(t,e,n,r,i,a,s,o,l,c,h){for(const o of e){const e={descr:o.task,section:n,number:n,width:150,padding:20,maxHeight:a};m.debug("taskNode",e);const u=t.append("g").attr("class","taskWrapper"),d=ddt.drawNode(u,e,n,s).height;if(m.debug("taskHeight after draw",d),u.attr("transform",`translate(${r}, ${i})`),a=Math.max(a,d),o.events){const e=t.append("g").attr("class","lineWrapper");let u=a;i+=100,u+=fdt(t,o.events,n,r,i,s),i-=100,e.append("line").attr("x1",r+95).attr("y1",i+a).attr("x2",r+95).attr("y2",i+a+(h?a:c)+l+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}r+=200,h&&!s.timeline?.disableMulticolor&&n++}i-=10}),"drawTasks"),fdt=s((function(t,e,n,r,i,a){let s=0;const o=i;i+=100;for(const o of e){const e={descr:o,section:n,number:n,width:150,padding:20,maxHeight:50};m.debug("eventNode",e);const l=t.append("g").attr("class","eventWrapper"),c=ddt.drawNode(l,e,n,a).height;s+=c,l.attr("transform",`translate(${r}, ${i})`),i=i+10+c}return i=o,s}),"drawEvents"),mdt={setConf:s((()=>{}),"setConf"),draw:pdt},ydt=s((t=>{let e="";for(let e=0;e`\n .edge {\n stroke-width: 3;\n }\n ${ydt(t)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`),"getStyles")},xdt=Object.freeze({__proto__:null,diagram:vdt});function bdt(t){return(bdt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wdt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kdt(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}),"n"),e:s((function(t){throw t}),"e"),f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:s((function(){n=n.call(t)}),"s"),n:s((function(){var t=n.next();return o=t.done,t}),"n"),e:s((function(t){l=!0,a=t}),"e"),f:s((function(){try{o||null==n.return||n.return()}finally{if(l)throw a}}),"f")}}s(bdt,"_typeof"),s(wdt,"_classCallCheck"),s(kdt,"_defineProperties"),s(Tdt,"_createClass"),s(_dt,"_defineProperty$1"),s(Edt,"_slicedToArray"),s(Cdt,"_arrayWithHoles"),s(Sdt,"_iterableToArrayLimit"),s(Adt,"_unsupportedIterableToArray"),s(Ldt,"_arrayLikeToArray"),s(Ndt,"_nonIterableRest"),s(Idt,"_createForOfIteratorHelper");var Mdt="undefined"==typeof window?null:window,Rdt=Mdt?Mdt.navigator:null;Mdt&&Mdt.document;var Ddt=bdt(""),Odt=bdt({}),Pdt=bdt((function(){})),Bdt="undefined"==typeof HTMLElement?"undefined":bdt(HTMLElement),$dt=s((function(t){return t&&t.instanceString&&zdt(t.instanceString)?t.instanceString():null}),"instanceStr"),Fdt=s((function(t){return null!=t&&bdt(t)==Ddt}),"string"),zdt=s((function(t){return null!=t&&bdt(t)===Pdt}),"fn"),Udt=s((function(t){return!Hdt(t)&&(Array.isArray?Array.isArray(t):null!=t&&t instanceof Array)}),"array"),Gdt=s((function(t){return null!=t&&bdt(t)===Odt&&!Udt(t)&&t.constructor===Object}),"plainObject"),qdt=s((function(t){return null!=t&&bdt(t)===Odt}),"object"),jdt=s((function(t){return null!=t&&bdt(t)===bdt(1)&&!isNaN(t)}),"number"),Ydt=s((function(t){return jdt(t)&&Math.floor(t)===t}),"integer"),Wdt=s((function(t){return"undefined"===Bdt?void 0:null!=t&&t instanceof HTMLElement}),"htmlElement"),Hdt=s((function(t){return Vdt(t)||Xdt(t)}),"elementOrCollection"),Vdt=s((function(t){return"collection"===$dt(t)&&t._private.single}),"element"),Xdt=s((function(t){return"collection"===$dt(t)&&!t._private.single}),"collection"),Kdt=s((function(t){return"core"===$dt(t)}),"core"),Zdt=s((function(t){return"stylesheet"===$dt(t)}),"stylesheet"),Qdt=s((function(t){return"event"===$dt(t)}),"event"),Jdt=s((function(t){return null==t||!(""!==t&&!t.match(/^\s+$/))}),"emptyString"),tpt=s((function(t){return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement}),"domElement"),ept=s((function(t){return Gdt(t)&&jdt(t.x1)&&jdt(t.x2)&&jdt(t.y1)&&jdt(t.y2)}),"boundingBox"),npt=s((function(t){return qdt(t)&&zdt(t.then)}),"promise"),rpt=s((function(){return Rdt&&Rdt.userAgent.match(/msie|trident|edge/i)}),"ms"),ipt=s((function(t,e){e||(e=s((function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var t=[],e=0;ee?1:0}),"ascending"),upt=s((function(t,e){return-1*hpt(t,e)}),"descending"),dpt=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments,n=1;n1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}s(h,"hue2rgb");var u=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(t);if(u){if((n=parseInt(u[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(u[2]))<0||r>100)return;if(r/=100,(i=parseFloat(u[3]))<0||i>100)return;if(i/=100,void 0!==(a=u[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=l=c=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,p=2*i-d;o=Math.round(255*h(p,d,n+1/3)),l=Math.round(255*h(p,d,n)),c=Math.round(255*h(p,d,n-1/3))}e=[o,l,c,a]}return e}),"hsl2tuple"),fpt=s((function(t){var e,n=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(t);if(n){e=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;e.push(Math.floor(a))}var s=r[1]||r[2]||r[3],o=r[1]&&r[2]&&r[3];if(s&&!o)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;e.push(l)}}return e}),"rgb2tuple"),mpt=s((function(t){return vpt[t.toLowerCase()]}),"colorname2tuple"),ypt=s((function(t){return(Udt(t)?t:null)||mpt(t)||ppt(t)||fpt(t)||gpt(t)}),"color2tuple"),vpt={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]},xpt=s((function(t){for(var e=t.map,n=t.keys,r=n.length,i=0;i=e||n<0||d&&t-h>=a}function v(){var t=Apt();if(y(t))return x(t);l=setTimeout(v,m(t))}function x(t){return l=void 0,p&&r?g(t):(r=i=void 0,o)}function b(){void 0!==l&&clearTimeout(l),h=0,r=c=i=l=void 0}function w(){return void 0===l?o:x(Apt())}function k(){var t=Apt(),n=y(t);if(r=arguments,i=this,c=t,n){if(void 0===l)return f(c);if(d)return clearTimeout(l),l=setTimeout(v,e),g(c)}return void 0===l&&(l=setTimeout(v,e)),o}return e=rgt(e)||0,kpt(n)&&(u=!!n.leading,a=(d="maxWait"in n)?igt(rgt(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),s(g,"invokeFunc"),s(f,"leadingEdge"),s(m,"remainingWait"),s(y,"shouldInvoke"),s(v,"timerExpired"),s(x,"trailingEdge"),s(b,"cancel"),s(w,"flush"),s(k,"debounced"),k.cancel=b,k.flush=w,k}s(sgt,"debounce");var ogt=sgt,lgt=Mdt?Mdt.performance:null,cgt=lgt&&lgt.now?function(){return lgt.now()}:function(){return Date.now()},hgt=function(){if(Mdt){if(Mdt.requestAnimationFrame)return function(t){Mdt.requestAnimationFrame(t)};if(Mdt.mozRequestAnimationFrame)return function(t){Mdt.mozRequestAnimationFrame(t)};if(Mdt.webkitRequestAnimationFrame)return function(t){Mdt.webkitRequestAnimationFrame(t)};if(Mdt.msRequestAnimationFrame)return function(t){Mdt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout((function(){t(cgt())}),1e3/60)}}(),ugt=s((function(t){return hgt(t)}),"requestAnimationFrame"),dgt=cgt,pgt=65599,ggt=s((function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261,r=n;!(e=t.next()).done;)r=r*pgt+e.value|0;return r}),"hashIterableInts"),fgt=s((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261;return e*pgt+t|0}),"hashInt"),mgt=s((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5381;return(e<<5)+e+t|0}),"hashIntAlt"),ygt=s((function(t,e){return 2097152*t+e}),"combineHashes"),vgt=s((function(t){return 2097152*t[0]+t[1]}),"combineHashesArray"),xgt=s((function(t,e){return[fgt(t[0],e[0]),mgt(t[1],e[1])]}),"hashArrays"),bgt=s((function(t,e){var n={value:0,done:!1},r=0,i=t.length;return ggt({next:s((function(){return r=0&&(t[r]!==e||(t.splice(r,1),!n));r--);}),"removeFromArray"),qgt=s((function(t){t.splice(0,t.length)}),"clearArray"),jgt=s((function(t,e){for(var n=0;n2&&void 0!==arguments[2])||arguments[2];if(void 0!==t&&void 0!==e&&Kdt(t)){var r=e.group;if(null==r&&(r=e.data&&null!=e.data.source&&null!=e.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:t,single:!0,data:e.data||{},position:e.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!e.selected,selectable:void 0===e.selectable||!!e.selectable,locked:!!e.locked,grabbed:!1,grabbable:void 0===e.grabbable||!!e.grabbable,pannable:void 0===e.pannable?"edges"===r:!!e.pannable,active:!1,classes:new Xgt,animation:{current:[],queue:[]},rscratch:{},scratch:e.scratch||{},edges:[],children:[],parent:e.parent&&e.parent.isNode()?e.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(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),e.renderedPosition){var a=e.renderedPosition,s=t.pan(),o=t.zoom();i.position={x:(a.x-s.x)/o,y:(a.y-s.y)/o}}var l=[];Udt(e.classes)?l=e.classes:Fdt(e.classes)&&(l=e.classes.split(/\s+/));for(var c=0,h=l.length;ce?1:0}),"defaultCmp"),h=s((function(t,e,i,a,s){var o;if(null==i&&(i=0),null==s&&(s=n),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=t.length);in;0<=n?e++:e--)c.push(e);return c}.apply(this).reverse()).length;af;0<=f?++d:--d)m.push(a(t,r));return m}),"nsmallest"),f=s((function(t,e,r,i){var a,s,o;for(null==i&&(i=n),a=t[r];r>e&&i(a,s=t[o=r-1>>1])<0;)t[r]=s,r=o;return t[r]=a}),"_siftdown"),m=s((function(t,e,r){var i,a,s,o,l;for(null==r&&(r=n),a=t.length,l=e,s=t[e],i=2*e+1;i0;){var k=v.pop(),T=m(k),_=k.id();if(d[_]=T,T!==1/0)for(var E=k.neighborhood().intersect(g),C=0;C0)for(n.unshift(e);u[i];){var a=u[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}),"pathTo")}}),"dijkstra")},rft={kruskal:s((function(t){t=t||function(t){return 1};for(var e=this.byGroup(),n=e.nodes,r=e.edges,i=n.length,a=new Array(i),o=n,l=s((function(t){for(var e=0;e0;){if(w(),T++,h===d){for(var _=[],E=i,C=d,S=x[C];_.unshift(E),null!=S&&_.unshift(S),null!=(E=v[C]);)S=x[C=E.id()];return{found:!0,distance:p[h],path:this.spawn(_),steps:T}}f[h]=!0;for(var A=c._private.edges,L=0;LS&&(g[C]=S,v[C]=E,x[C]=w),!i){var A=E*h+_;!i&&g[A]>S&&(g[A]=S,v[A]=_,x[A]=w)}}}for(var L=0;L1&&void 0!==arguments[1]?arguments[1]:a,r=x(t),i=[],s=r;;){if(null==s)return e.spawn();var o=v(s),c=o.edge,h=o.pred;if(i.unshift(s[0]),s.same(n)&&i.length>0)break;null!=c&&i.unshift(c),s=h}return l.spawn(i)}),"pathTo"),k=0;k=0;c--){var h=l[c],u=h[1],d=h[2];(e[u]===s&&e[d]===o||e[u]===o&&e[d]===s)&&l.splice(c,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*e.length);e=uft(i,t,e),n--}return e}),"contractUntil"),pft={kargerStein:s((function(){var t=this,e=this.byGroup(),n=e.nodes,r=e.edges;r.unmergeBy((function(t){return t.isLoop()}));var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/hft);if(!(i<2)){for(var c=[],h=0;h1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=1/0,i=e;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=-1/0,i=e;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=0,i=0,a=e;a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];r?t=t.slice(e,n):(n0&&t.splice(0,e));for(var s=0,o=t.length-1;o>=0;o--){var l=t[o];a?isFinite(l)||(t[o]=-1/0,s++):t.splice(o,1)}i&&t.sort((function(t,e){return t-e}));var c=t.length,h=Math.floor(c/2);return c%2!=0?t[h+1+s]:(t[h-1+s]+t[h+s])/2}),"median"),kft=s((function(t){return Math.PI*t/180}),"deg2rad"),Tft=s((function(t,e){return Math.atan2(e,t)-Math.PI/2}),"getAngleFromDisp"),_ft=Math.log2||function(t){return Math.log(t)/Math.log(2)},Eft=s((function(t){return t>0?1:t<0?-1:0}),"signum"),Cft=s((function(t,e){return Math.sqrt(Sft(t,e))}),"dist"),Sft=s((function(t,e){var n=e.x-t.x,r=e.y-t.y;return n*n+r*r}),"sqdist"),Aft=s((function(t){for(var e=t.length,n=0,r=0;r=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(null!=t.w&&null!=t.h&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}}),"makeBoundingBox"),Dft=s((function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}}),"copyBoundingBox"),Oft=s((function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0}),"clearBoundingBox"),Pft=s((function(t,e,n){return{x1:t.x1+e,x2:t.x2+e,y1:t.y1+n,y2:t.y2+n,w:t.w,h:t.h}}),"shiftBoundingBox"),Bft=s((function(t,e){t.x1=Math.min(t.x1,e.x1),t.x2=Math.max(t.x2,e.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,e.y1),t.y2=Math.max(t.y2,e.y2),t.h=t.y2-t.y1}),"updateBoundingBox"),$ft=s((function(t,e,n){t.x1=Math.min(t.x1,e),t.x2=Math.max(t.x2,e),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,n),t.y2=Math.max(t.y2,n),t.h=t.y2-t.y1}),"expandBoundingBoxByPoint"),Fft=s((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.x1-=e,t.x2+=e,t.y1-=e,t.y2+=e,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t}),"expandBoundingBox"),zft=s((function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)e=n=r=i=a[0];else if(2===a.length)e=r=a[0],i=n=a[1];else if(4===a.length){var s=Edt(a,4);e=s[0],n=s[1],r=s[2],i=s[3]}return t.x1-=i,t.x2+=n,t.y1-=e,t.y2+=r,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t}),"expandBoundingBoxSides"),Uft=s((function(t,e){t.x1=e.x1,t.y1=e.y1,t.x2=e.x2,t.y2=e.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1}),"assignBoundingBox"),Gft=s((function(t,e){return!(t.x1>e.x2)&&(!(e.x1>t.x2)&&(!(t.x2e.y2)&&!(e.y1>t.y2)))))))}),"boundingBoxesIntersect"),qft=s((function(t,e,n){return t.x1<=e&&e<=t.x2&&t.y1<=n&&n<=t.y2}),"inBoundingBox"),jft=s((function(t,e){return qft(t,e.x,e.y)}),"pointInBoundingBox"),Yft=s((function(t,e){return qft(t,e.x1,e.y1)&&qft(t,e.x2,e.y2)}),"boundingBoxInBoundingBox"),Wft=s((function(t,e,n,r,i,a,s){var o,l,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",h="auto"===c?fmt(i,a):c,u=i/2,d=a/2,p=(h=Math.min(h,u,d))!==u,g=h!==d;if(p){var f=n-u+h-s,m=r-d-s,y=n+u-h+s,v=m;if((o=lmt(t,e,n,r,f,m,y,v,!1)).length>0)return o}if(g){var x=n+u+s,b=r-d+h-s,w=x,k=r+d-h+s;if((o=lmt(t,e,n,r,x,b,w,k,!1)).length>0)return o}if(p){var T=n-u+h-s,_=r+d+s,E=n+u-h+s,C=_;if((o=lmt(t,e,n,r,T,_,E,C,!1)).length>0)return o}if(g){var S=n-u-s,A=r-d+h-s,L=S,N=r+d-h+s;if((o=lmt(t,e,n,r,S,A,L,N,!1)).length>0)return o}var I=n-u+h,M=r-d+h;if((l=smt(t,e,n,r,I,M,h+s)).length>0&&l[0]<=I&&l[1]<=M)return[l[0],l[1]];var R=n+u-h,D=r-d+h;if((l=smt(t,e,n,r,R,D,h+s)).length>0&&l[0]>=R&&l[1]<=D)return[l[0],l[1]];var O=n+u-h,P=r+d-h;if((l=smt(t,e,n,r,O,P,h+s)).length>0&&l[0]>=O&&l[1]>=P)return[l[0],l[1]];var B=n-u+h,$=r+d-h;return(l=smt(t,e,n,r,B,$,h+s)).length>0&&l[0]<=B&&l[1]>=$?[l[0],l[1]]:[]}),"roundRectangleIntersectLine"),Hft=s((function(t,e,n,r,i,a,s){var o=s,l=Math.min(n,i),c=Math.max(n,i),h=Math.min(r,a),u=Math.max(r,a);return l-o<=t&&t<=c+o&&h-o<=e&&e<=u+o}),"inLineVicinity"),Vft=s((function(t,e,n,r,i,a,s,o,l){var c=Math.min(n,s,i)-l,h=Math.max(n,s,i)+l,u=Math.min(r,o,a)-l,d=Math.max(r,o,a)+l;return!(th||ed)}),"inBezierVicinity"),Xft=s((function(t,e,n,r){var i=e*e-4*t*(n-=r);if(i<0)return[];var a=Math.sqrt(i),s=2*t;return[(-e+a)/s,(-e-a)/s]}),"solveQuadratic"),Kft=s((function(t,e,n,r,i){var a,s,o,l,c,h,u,d;return 0===t&&(t=1e-5),o=-27*(r/=t)+(e/=t)*(9*(n/=t)-e*e*2),a=(s=(3*n-e*e)/9)*s*s+(o/=54)*o,i[1]=0,u=e/3,a>0?(c=(c=o+Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),h=(h=o-Math.sqrt(a))<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-u+c+h,u+=(c+h)/2,i[4]=i[2]=-u,u=Math.sqrt(3)*(-h+c)/2,i[3]=u,void(i[5]=-u)):(i[5]=i[3]=0,0===a?(d=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3),i[0]=2*d-u,void(i[4]=i[2]=-(d+u))):(l=(s=-s)*s*s,l=Math.acos(o/Math.sqrt(l)),d=2*Math.sqrt(s),i[0]=-u+d*Math.cos(l/3),i[2]=-u+d*Math.cos((l+2*Math.PI)/3),void(i[4]=-u+d*Math.cos((l+4*Math.PI)/3))))}),"solveCubic"),Zft=s((function(t,e,n,r,i,a,s,o){var l=[];Kft(1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+r*r-4*r*a+2*r*o+4*a*a-4*a*o+o*o,9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*r*a-3*r*r-3*r*o-6*a*a+3*a*o,3*n*n-6*n*i+n*s-n*t+2*i*i+2*i*t-s*t+3*r*r-6*r*a+r*o-r*e+2*a*a+2*a*e-o*e,1*n*i-n*n+n*t-i*t+r*a-r*r+r*e-a*e,l);for(var c=[],h=0;h<6;h+=2)Math.abs(l[h+1])<1e-7&&l[h]>=0&&l[h]<=1&&c.push(l[h]);c.push(1),c.push(0);for(var u,d,p,g=-1,f=0;f=0?pl?(t-i)*(t-i)+(e-a)*(e-a):c-u}),"sqdistToFiniteLine"),Jft=s((function(t,e,n){for(var r,i,a,s,o=0,l=0;l=t&&t>=a||r<=t&&t<=a))continue;(t-r)/(a-r)*(s-i)+i>e&&o++}return o%2!=0}),"pointInsidePolygonPoints"),tmt=s((function(t,e,n,r,i,a,s,o,l){var c,h=new Array(n.length);null!=o[0]?(c=Math.atan(o[1]/o[0]),o[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=o;for(var u,d=Math.cos(-c),p=Math.sin(-c),g=0;g0){var f=rmt(h,-l);u=nmt(f)}else u=h;return Jft(t,e,u)}),"pointInsidePolygon"),emt=s((function(t,e,n,r,i,a,s,o){for(var l=new Array(2*n.length),c=0;c=0&&g<=1&&m.push(g),f>=0&&f<=1&&m.push(f),0===m.length)return[];var y=m[0]*o[0]+t,v=m[0]*o[1]+e;return m.length>1?m[0]==m[1]?[y,v]:[y,v,m[1]*o[0]+t,m[1]*o[1]+e]:[y,v]}),"intersectLineCircle"),omt=s((function(t,e,n){return e<=t&&t<=n||n<=t&&t<=e?t:t<=e&&e<=n||n<=e&&e<=t?e:n}),"midOfThree"),lmt=s((function(t,e,n,r,i,a,s,o,l){var c=t-i,h=n-t,u=s-i,d=e-a,p=r-e,g=o-a,f=u*d-g*c,m=h*d-p*c,y=g*h-u*p;if(0!==y){var v=f/y,x=m/y,b=-.001;return b<=v&&v<=1.001&&b<=x&&x<=1.001||l?[t+v*h,e+v*p]:[]}return 0===f||0===m?omt(t,n,s)===s?[s,o]:omt(t,n,i)===i?[i,a]:omt(i,s,n)===n?[n,r]:[]:[]}),"finiteLinesIntersect"),cmt=s((function(t,e,n,r,i,a,s,o){var l,c,h,u,d,p,g=[],f=new Array(n.length),m=!0;if(null==a&&(m=!1),m){for(var y=0;y0){var v=rmt(f,-o);c=nmt(v)}else c=f}else c=n;for(var x=0;x2){for(var p=[h[0],h[1]],g=Math.pow(p[0]-t,2)+Math.pow(p[1]-e,2),f=1;fh&&(h=e)}),"set"),get:s((function(t){return c[t]}),"get")},d=0;d0?v.edgesTo(y)[0]:y.edgesTo(v)[0];var b=r(x);y=y.id(),h[y]>h[f]+b&&(h[y]=h[f]+b,d.nodes.indexOf(y)<0?d.push(y):d.updateItem(y),c[y]=0,s[y]=[]),h[y]==h[f]+b&&(c[y]=c[y]+c[f],s[y].push(f))}else for(var w=0;w0;){for(var E=n.pop(),C=0;C0&&s.push(n[o]);0!==s.length&&i.push(r.collection(s))}return i}),"assign"),$mt=s((function(t,e){for(var n=0;n5&&void 0!==arguments[5]?arguments[5]:Gmt,s=r,o=0;o=2?Vmt(t,e,n,0,Ymt,Wmt):Vmt(t,e,n,0,jmt)}),"euclidean"),squaredEuclidean:s((function(t,e,n){return Vmt(t,e,n,0,Ymt)}),"squaredEuclidean"),manhattan:s((function(t,e,n){return Vmt(t,e,n,0,jmt)}),"manhattan"),max:s((function(t,e,n){return Vmt(t,e,n,-1/0,Hmt)}),"max")};function Kmt(t,e,n,r,i,a){var s;return s=zdt(t)?t:Xmt[t]||Xmt.euclidean,0===e&&zdt(t)?s(i,a):s(e,n,r,i,a)}Xmt["squared-euclidean"]=Xmt.squaredEuclidean,Xmt.squaredeuclidean=Xmt.squaredEuclidean,s(Kmt,"clusteringDistance");var Zmt=Ugt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Qmt=s((function(t){return Zmt(t)}),"setOptions"),Jmt=s((function(t,e,n,r,i){var a="kMedoids"!==i?function(t){return n[t]}:function(t){return r[t](n)},o=s((function(t){return r[t](e)}),"getQ"),l=n,c=e;return Kmt(t,r.length,a,o,l,c)}),"getDist"),tyt=s((function(t,e,n){for(var r=n.length,i=new Array(r),a=new Array(r),s=new Array(e),o=null,l=0;ln)return!1}return!0}),"haveMatricesConverged"),ayt=s((function(t,e,n){for(var r=0;ri&&(i=e[l][c],a=c);s[a].push(t[l])}for(var h=0;h=i.threshold||"dendrogram"===i.mode&&1===t.length)return!1;var g,f=e[o],m=e[r[o]];g="dendrogram"===i.mode?{left:f,right:m,key:f.key}:{value:f.value.concat(m.value),key:f.key},t[f.index]=g,t.splice(m.index,1),e[f.key]=g;for(var y=0;yn[m.key][v.key]&&(a=n[m.key][v.key])):"max"===i.linkage?(a=n[f.key][v.key],n[f.key][v.key]0&&r.push(i);return r}),"findExemplars"),Lyt=s((function(t,e,n){for(var r=[],i=0;is&&(a=l,s=e[i*t+l])}a>0&&r.push(a)}for(var c=0;cl&&(o=c,l=h)}n[i]=a[o]}return r=Lyt(t,e,n)}),"assign"),Iyt=s((function(t){for(var e,n,r,i,a,s,o=this.cy(),l=this.nodes(),c=Eyt(t),h={},u=0;u=C?(S=C,C=L,A=N):L>S&&(S=L);for(var I=0;I0?1:0;T[k%c.minIterations*e+B]=$,P+=$}if(P>0&&(k>=c.minIterations-1||k==c.maxIterations-1)){for(var F=0,z=0;z1||s>1)&&(h=!0),u[e]=[],t.outgoers().forEach((function(t){t.isEdge()&&u[e].push(t.id())}))}else d[e]=[void 0,t.target().id()]})):c.forEach((function(t){var e=t.id();t.isNode()?(t.degree(!0)%2&&(n?r?h=!0:r=e:n=e),u[e]=[],t.connectedEdges().forEach((function(t){return u[e].push(t.id())}))):d[e]=[t.source().id(),t.target().id()]}));var p={found:!1,trail:void 0};if(h)return p;if(r&&n)if(l){if(i&&r!=i)return p;i=r}else{if(i&&r!=i&&n!=i)return p;i||(i=r)}else i||(i=c[0].id());var g=s((function(t){for(var e,n,r,i=t,a=[t];u[i].length;)e=u[i].shift(),n=d[e][0],i!=(r=d[e][1])?(u[r]=u[r].filter((function(t){return t!=e})),i=r):l||i==n||(u[n]=u[n].filter((function(t){return t!=e})),i=n),a.unshift(e),a.unshift(i);return a}),"walk"),f=[],m=[];for(m=g(i);1!=m.length;)0==u[m[0]].length?(f.unshift(c.getElementById(m.shift())),f.unshift(c.getElementById(m.shift()))):m=g(m.shift()).concat(m);for(var y in f.unshift(c.getElementById(m.shift())),u)if(u[y].length)return p;return p.found=!0,p.trail=this.spawn(f,!0),p}),"hierholzer")},Oyt=s((function(){var t=this,e={},n=0,r=0,i=[],a=[],o={},l=s((function(n,r){for(var s=a.length-1,o=[],l=t.spawn();a[s].x!=n||a[s].y!=r;)o.push(a.pop().edge),s--;o.push(a.pop().edge),o.forEach((function(n){var r=n.connectedNodes().intersection(t);l.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(t);l.merge(n),e[r].cutVertex?l.merge(i.filter((function(t){return t.isLoop()}))):l.merge(i)}))})),i.push(l)}),"buildComponent"),c=s((function s(c,h,u){c===u&&(r+=1),e[h]={id:n,low:n++,cutVertex:!1};var d,p,g,f,m=t.getElementById(h).connectedEdges().intersection(t);0===m.size()?i.push(t.spawn(t.getElementById(h))):m.forEach((function(t){d=t.source().id(),p=t.target().id(),(g=d===h?p:d)!==u&&(f=t.id(),o[f]||(o[f]=!0,a.push({x:h,y:g,edge:t})),g in e?e[h].low=Math.min(e[h].low,e[g].id):(s(c,g,h),e[h].low=Math.min(e[h].low,e[g].low),e[h].id<=e[g].low&&(e[h].cutVertex=!0,l(h,g))))}))}),"biconnectedSearch");t.forEach((function(t){if(t.isNode()){var n=t.id();n in e||(r=0,c(n,n),e[n].cutVertex=r>1)}}));var h=Object.keys(e).filter((function(t){return e[t].cutVertex})).map((function(e){return t.getElementById(e)}));return{cut:t.spawn(h),components:i}}),"hopcroftTarjanBiconnected"),Pyt={hopcroftTarjanBiconnected:Oyt,htbc:Oyt,htb:Oyt,hopcroftTarjanBiconnectedComponents:Oyt},Byt=s((function(){var t=this,e={},n=0,r=[],i=[],a=t.spawn(t),o=s((function s(o){if(i.push(o),e[o]={index:n,low:n++,explored:!1},t.getElementById(o).connectedEdges().intersection(t).forEach((function(t){var n=t.target().id();n!==o&&(n in e||s(n),e[n].explored||(e[o].low=Math.min(e[o].low,e[n].low)))})),e[o].index===e[o].low){for(var l=t.spawn();;){var c=i.pop();if(l.merge(t.getElementById(c)),e[c].low=e[o].index,e[c].explored=!0,c===o)break}var h=l.edgesWith(l),u=l.merge(h);r.push(u),a=a.difference(u)}}),"stronglyConnectedSearch");return t.forEach((function(t){if(t.isNode()){var n=t.id();n in e||o(n)}})),{cut:a,components:r}}),"tarjanStronglyConnected"),$yt={};[Qgt,nft,rft,aft,oft,cft,pft,wmt,Tmt,Emt,Smt,Umt,gyt,Tyt,Myt,Dyt,Pyt,{tarjanStronglyConnected:Byt,tsc:Byt,tscc:Byt,tarjanStronglyConnectedComponents:Byt}].forEach((function(t){dpt($yt,t)}));var Fyt=s((function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))}),"api");Fyt.prototype={fulfill:s((function(t){return zyt(this,1,"fulfillValue",t)}),"fulfill"),reject:s((function(t){return zyt(this,2,"rejectReason",t)}),"reject"),then:s((function(t,e){var n=this,r=new Fyt;return n.onFulfilled.push(qyt(t,r,"fulfill")),n.onRejected.push(qyt(e,r,"reject")),Uyt(n),r.proxy}),"then")};var zyt=s((function(t,e,n,r){return 0===t.state&&(t.state=e,t[n]=r,Uyt(t)),t}),"deliver"),Uyt=s((function(t){1===t.state?Gyt(t,"onFulfilled",t.fulfillValue):2===t.state&&Gyt(t,"onRejected",t.rejectReason)}),"execute"),Gyt=s((function(t,e,n){if(0!==t[e].length){var r=t[e];t[e]=[];var i=s((function(){for(var t=0;t0:void 0}),"animatedImpl")}),"animated"),clearQueue:s((function(){return s((function(){var t=this,e=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1}s(Hvt,"listCacheHas");var Vvt=Hvt;function Xvt(t,e){var n=this.__data__,r=Uvt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}s(Xvt,"listCacheSet");var Kvt=Xvt;function Zvt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t0&&this.spawn(r).updateStyle().emit("class"),e}),"classes"),addClass:s((function(t){return this.toggleClass(t,!0)}),"addClass"),hasClass:s((function(t){var e=this[0];return null!=e&&e._private.classes.has(t)}),"hasClass"),toggleClass:s((function(t,e){Udt(t)||(t=t.match(/\S+/g)||[]);for(var n=this,r=void 0===e,i=[],a=0,s=n.length;a0&&this.spawn(i).updateStyle().emit("class"),n}),"toggleClass"),removeClass:s((function(t){return this.toggleClass(t,!1)}),"removeClass"),flashClass:s((function(t,e){var n=this;if(null==e)e=250;else if(0===e)return n;return n.addClass(t),setTimeout((function(){n.removeClass(t)}),e),n}),"flashClass")};sbt.className=sbt.classNames=sbt.classes;var obt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:cpt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};obt.variable="(?:[\\w-.]|(?:\\\\"+obt.metaChar+"))+",obt.className="(?:[\\w-]|(?:\\\\"+obt.metaChar+"))+",obt.value=obt.string+"|"+obt.number,obt.id=obt.variable,function(){var t,e,n;for(t=obt.comparatorOp.split("|"),n=0;n=0||"="!==e&&(obt.comparatorOp+="|\\!"+e)}();var lbt=s((function(){return{checks:[]}}),"newQuery"),cbt=0,hbt=1,ubt=2,dbt=3,pbt=4,gbt=5,fbt=6,mbt=7,ybt=8,vbt=9,xbt=10,bbt=11,wbt=12,kbt=13,Tbt=14,_bt=15,Ebt=16,Cbt=17,Sbt=18,Abt=19,Lbt=20,Nbt=[{selector:":selected",matches:s((function(t){return t.selected()}),"matches")},{selector:":unselected",matches:s((function(t){return!t.selected()}),"matches")},{selector:":selectable",matches:s((function(t){return t.selectable()}),"matches")},{selector:":unselectable",matches:s((function(t){return!t.selectable()}),"matches")},{selector:":locked",matches:s((function(t){return t.locked()}),"matches")},{selector:":unlocked",matches:s((function(t){return!t.locked()}),"matches")},{selector:":visible",matches:s((function(t){return t.visible()}),"matches")},{selector:":hidden",matches:s((function(t){return!t.visible()}),"matches")},{selector:":transparent",matches:s((function(t){return t.transparent()}),"matches")},{selector:":grabbed",matches:s((function(t){return t.grabbed()}),"matches")},{selector:":free",matches:s((function(t){return!t.grabbed()}),"matches")},{selector:":removed",matches:s((function(t){return t.removed()}),"matches")},{selector:":inside",matches:s((function(t){return!t.removed()}),"matches")},{selector:":grabbable",matches:s((function(t){return t.grabbable()}),"matches")},{selector:":ungrabbable",matches:s((function(t){return!t.grabbable()}),"matches")},{selector:":animated",matches:s((function(t){return t.animated()}),"matches")},{selector:":unanimated",matches:s((function(t){return!t.animated()}),"matches")},{selector:":parent",matches:s((function(t){return t.isParent()}),"matches")},{selector:":childless",matches:s((function(t){return t.isChildless()}),"matches")},{selector:":child",matches:s((function(t){return t.isChild()}),"matches")},{selector:":orphan",matches:s((function(t){return t.isOrphan()}),"matches")},{selector:":nonorphan",matches:s((function(t){return t.isChild()}),"matches")},{selector:":compound",matches:s((function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()}),"matches")},{selector:":loop",matches:s((function(t){return t.isLoop()}),"matches")},{selector:":simple",matches:s((function(t){return t.isSimple()}),"matches")},{selector:":active",matches:s((function(t){return t.active()}),"matches")},{selector:":inactive",matches:s((function(t){return!t.active()}),"matches")},{selector:":backgrounding",matches:s((function(t){return t.backgrounding()}),"matches")},{selector:":nonbackgrounding",matches:s((function(t){return!t.backgrounding()}),"matches")}].sort((function(t,e){return upt(t.selector,e.selector)})),Ibt=function(){for(var t,e={},n=0;n0&&c.edgeCount>0)return Dgt("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Dgt("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&Dgt("The selector `"+t+"` 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}),"parse"),zbt=s((function(){if(null!=this.toStringCache)return this.toStringCache;for(var t=s((function(t){return null==t?"":t}),"clean"),e=s((function(e){return Fdt(e)?'"'+e+'"':t(e)}),"cleanVal"),n=s((function(t){return" "+t+" "}),"space"),r=s((function(r,a){var s=r.type,o=r.value;switch(s){case cbt:var l=t(o);return l.substring(0,l.length-1);case dbt:var c=r.field,h=r.operator;return"["+c+n(t(h))+e(o)+"]";case gbt:var u=r.operator,d=r.field;return"["+t(u)+d+"]";case pbt:return"["+r.field+"]";case fbt:var p=r.operator;return"[["+r.field+n(t(p))+e(o)+"]]";case mbt:return o;case ybt:return"#"+o;case vbt:return"."+o;case Cbt:case _bt:return i(r.parent,a)+n(">")+i(r.child,a);case Sbt:case Ebt:return i(r.ancestor,a)+" "+i(r.descendant,a);case Abt:var g=i(r.left,a),f=i(r.subject,a),m=i(r.right,a);return g+(g.length>0?" ":"")+f+m;case Lbt:return""}}),"checkToString"),i=s((function(t,e){return t.checks.reduce((function(n,i,a){return n+(e===t&&0===a?"$":"")+r(i,e)}),"")}),"queryToString"),a="",o=0;o1&&o=0&&(e=e.replace("!",""),h=!0),e.indexOf("@")>=0&&(e=e.replace("@",""),c=!0),(s||l||c)&&(i=s||o?""+t:"",a=""+n),c&&(t=i=i.toLowerCase(),n=a=a.toLowerCase()),e){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=t===n;break;case">":u=!0,r=t>n;break;case">=":u=!0,r=t>=n;break;case"<":u=!0,r=t0;){var c=i.shift();e(c),a.add(c.id()),s&&r(i,a,c)}return t}function swt(t,e,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1];return awt(this,t,e,swt)},s(owt,"addParent"),iwt.forEachUp=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return awt(this,t,e,owt)},s(lwt,"addParentAndChildren"),iwt.forEachUpAndDown=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return awt(this,t,e,lwt)},iwt.ancestors=iwt.parents,(ewt=nwt={data:ibt.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:ibt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ibt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ibt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ibt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ibt.removeData({field:"rscratch",triggerEvent:!1}),id:s((function(){var t=this[0];if(t)return t._private.data.id}),"id")}).attr=ewt.data,ewt.removeAttr=ewt.removeData;var cwt,hwt,uwt=nwt,dwt={};function pwt(t){return function(e){var n=this;if(void 0===e&&(e=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,s=0;se})),minIndegree:gwt("indegree",(function(t,e){return te})),minOutdegree:gwt("outdegree",(function(t,e){return te}))}),dpt(dwt,{totalDegree:s((function(t){for(var e=0,n=this.nodes(),r=0;r0,h=c;c&&(l=l[0]);var u=h?l.position():{x:0,y:0};return i={x:o.x-u.x,y:o.y-u.y},void 0===t?i:i[t]}for(var d=0;d0,m=f;f&&(g=g[0]);var y=m?g.position():{x:0,y:0};void 0!==e?p.position(t,e+y[t]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!a)return;return this}),"relativePosition")},cwt.modelPosition=cwt.point=cwt.position,cwt.modelPositions=cwt.points=cwt.positions,cwt.renderedPoint=cwt.renderedPosition,cwt.relativePoint=cwt.relativePosition;var ywt,vwt,xwt=hwt;ywt=vwt={},vwt.renderedBoundingBox=function(t){var e=this.boundingBox(t),n=this.cy(),r=n.zoom(),i=n.pan(),a=e.x1*r+i.x,s=e.x2*r+i.x,o=e.y1*r+i.y,l=e.y2*r+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},vwt.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp((function(e){if(e.isParent()){var n=e._private;n.compoundBoundsClean=!1,n.bbCache=null,t||e.emitAndNotify("bounds")}})),this):this},vwt.updateCompoundBounds=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function n(t){if(t.isParent()){var e=t._private,n=t.children(),r="include"===t.pstyle("compound-sizing-wrt-labels").value,i={width:{val:t.pstyle("min-width").pfValue,left:t.pstyle("min-width-bias-left"),right:t.pstyle("min-width-bias-right")},height:{val:t.pstyle("min-height").pfValue,top:t.pstyle("min-height-bias-top"),bottom:t.pstyle("min-height-bias-bottom")}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=e.position;0!==a.w&&0!==a.h||((a={w:t.pstyle("width").pfValue,h:t.pstyle("height").pfValue}).x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2),s(v,"computeBiasValues"),s(x,"computePaddingValues");var l=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(l=100*l/i.width.val);var c=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(c=100*c/i.width.val);var h=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(h=100*h/i.height.val);var u=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(u=100*u/i.height.val);var d=v(i.width.val-a.w,l,c),p=d.biasDiff,g=d.biasComplementDiff,f=v(i.height.val-a.h,h,u),m=f.biasDiff,y=f.biasComplementDiff;e.autoPadding=x(a.w,a.h,t.pstyle("padding"),t.pstyle("padding-relative-to").value),e.autoWidth=Math.max(a.w,i.width.val),o.x=(-p+a.x1+a.x2+g)/2,e.autoHeight=Math.max(a.h,i.height.val),o.y=(-m+a.y1+a.y2+y)/2}function v(t,e,n){var r=0,i=0,a=e+n;return t>0&&a>0&&(r=e/a*t,i=n/a*t),{biasDiff:r,biasComplementDiff:i}}function x(t,e,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return t>0?n.pfValue*t:0;case"height":return e>0?n.pfValue*e:0;case"average":return t>0&&e>0?n.pfValue*(t+e)/2:0;case"min":return t>0&&e>0?t>e?n.pfValue*e:n.pfValue*t:0;case"max":return t>0&&e>0?t>e?n.pfValue*t:n.pfValue*e:0;default:return 0}}}s(n,"update");for(var r=0;rt.x2?r:t.x2,t.y1=nt.y2?i:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)}),"updateBounds"),kwt=s((function(t,e){return null==e?t:wwt(t,e.x1,e.y1,e.x2,e.y2)}),"updateBoundsFromBox"),Twt=s((function(t,e,n){return Ygt(t,e,n)}),"prefixedProperty"),_wt=s((function(t,e,n){if(!e.cy().headless()){var r,i,a=e._private,s=a.rstyle,o=s.arrowWidth/2;if("none"!==e.pstyle(n+"-arrow-shape").value){"source"===n?(r=s.srcX,i=s.srcY):"target"===n?(r=s.tgtX,i=s.tgtY):(r=s.midX,i=s.midY);var l=a.arrowBounds=a.arrowBounds||{},c=l[n]=l[n]||{};c.x1=r-o,c.y1=i-o,c.x2=r+o,c.y2=i+o,c.w=c.x2-c.x1,c.h=c.y2-c.y1,Fft(c,1),wwt(t,c.x1,c.y1,c.x2,c.y2)}}}),"updateBoundsFromArrow"),Ewt=s((function(t,e,n){if(!e.cy().headless()){var r;r=n?n+"-":"";var i=e._private,a=i.rstyle;if(e.pstyle(r+"label").strValue){var o,l,c,h,u=e.pstyle("text-halign"),d=e.pstyle("text-valign"),p=Twt(a,"labelWidth",n),g=Twt(a,"labelHeight",n),f=Twt(a,"labelX",n),m=Twt(a,"labelY",n),y=e.pstyle(r+"text-margin-x").pfValue,v=e.pstyle(r+"text-margin-y").pfValue,x=e.isEdge(),b=e.pstyle(r+"text-rotation"),w=e.pstyle("text-outline-width").pfValue,k=e.pstyle("text-border-width").pfValue/2,T=e.pstyle("text-background-padding").pfValue,_=g,E=p,C=E/2,S=_/2;if(x)o=f-C,l=f+C,c=m-S,h=m+S;else{switch(u.value){case"left":o=f-E,l=f;break;case"center":o=f-C,l=f+C;break;case"right":o=f,l=f+E}switch(d.value){case"top":c=m-_,h=m;break;case"center":c=m-S,h=m+S;break;case"bottom":c=m,h=m+_}}o+=y-Math.max(w,k)-T-2,l+=y+Math.max(w,k)+T+2,c+=v-Math.max(w,k)-T-2,h+=v+Math.max(w,k)+T+2;var A=n||"main",L=i.labelBounds,N=L[A]=L[A]||{};N.x1=o,N.y1=c,N.x2=l,N.y2=h,N.w=l-o,N.h=h-c;var I=x&&"autorotate"===b.strValue,M=null!=b.pfValue&&0!==b.pfValue;if(I||M){var R=I?Twt(i.rstyle,"labelAngle",n):b.pfValue,D=Math.cos(R),O=Math.sin(R),P=(o+l)/2,B=(c+h)/2;if(!x){switch(u.value){case"left":P=l;break;case"right":P=o}switch(d.value){case"top":B=h;break;case"bottom":B=c}}var $=s((function(t,e){return{x:(t-=P)*D-(e-=B)*O+P,y:t*O+e*D+B}}),"rotate"),F=$(o,c),z=$(o,h),U=$(l,c),G=$(l,h);o=Math.min(F.x,z.x,U.x,G.x),l=Math.max(F.x,z.x,U.x,G.x),c=Math.min(F.y,z.y,U.y,G.y),h=Math.max(F.y,z.y,U.y,G.y)}var q=A+"Rot",j=L[q]=L[q]||{};j.x1=o,j.y1=c,j.x2=l,j.y2=h,j.w=l-o,j.h=h-c,wwt(t,o,c,l,h),wwt(i.labelBounds.all,o,c,l,h)}return t}}),"updateBoundsFromLabel"),Cwt=s((function(t,e){if(!e.cy().headless()){var n=e.pstyle("outline-opacity").value,r=e.pstyle("outline-width").value;if(n>0&&r>0){var i=e.pstyle("outline-offset").value,a=e.pstyle("shape").value,s=r+i,o=(t.w+2*s)/t.w,l=(t.h+2*s)/t.h,c=0;["diamond","pentagon","round-triangle"].includes(a)?(o=(t.w+2.4*s)/t.w,c=-s/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(a)?o=(t.w+2.4*s)/t.w:"star"===a?(o=(t.w+2.8*s)/t.w,l=(t.h+2.6*s)/t.h,c=-s/3.8):"triangle"===a?(o=(t.w+2.8*s)/t.w,l=(t.h+2.4*s)/t.h,c=-s/1.4):"vee"===a&&(o=(t.w+4.4*s)/t.w,l=(t.h+3.8*s)/t.h,c=.5*-s);var h=t.h*l-t.h,u=t.w*o-t.w;if(zft(t,[Math.ceil(h/2),Math.ceil(u/2)]),0!==c){var d=Pft(t,0,c);Bft(t,d)}}}}),"updateBoundsFromOutline"),Swt=s((function(t,e){var n,r,i,a,o,l,c=t._private.cy,h=c.styleEnabled(),u=c.headless(),d=Rft(),p=t._private,g=t.isNode(),f=t.isEdge(),m=p.rstyle,y=g&&h?t.pstyle("bounds-expansion").pfValue:[0],v=s((function(t){return"none"!==t.pstyle("display").value}),"isDisplayed"),x=!h||v(t)&&(!f||v(t.source())&&v(t.target()));if(x){var b=0;h&&e.includeOverlays&&0!==t.pstyle("overlay-opacity").value&&(b=t.pstyle("overlay-padding").value);var w=0;h&&e.includeUnderlays&&0!==t.pstyle("underlay-opacity").value&&(w=t.pstyle("underlay-padding").value);var k=Math.max(b,w),T=0;if(h&&(T=t.pstyle("width").pfValue/2),g&&e.includeNodes){var _=t.position();o=_.x,l=_.y;var E=t.outerWidth()/2,C=t.outerHeight()/2;wwt(d,n=o-E,i=l-C,r=o+E,a=l+C),h&&e.includeOutlines&&Cwt(d,t)}else if(f&&e.includeEdges)if(h&&!u){var S=t.pstyle("curve-style").strValue;if(n=Math.min(m.srcX,m.midX,m.tgtX),r=Math.max(m.srcX,m.midX,m.tgtX),i=Math.min(m.srcY,m.midY,m.tgtY),a=Math.max(m.srcY,m.midY,m.tgtY),wwt(d,n-=T,i-=T,r+=T,a+=T),"haystack"===S){var A=m.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var L=n;n=r,r=L}if(i>(a=A[1].y)){var N=i;i=a,a=N}wwt(d,n-T,i-T,r+T,a+T)}}else if("bezier"===S||"unbundled-bezier"===S||S.endsWith("segments")||S.endsWith("taxi")){var I;switch(S){case"bezier":case"unbundled-bezier":I=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":I=m.linePts}if(null!=I)for(var M=0;M(r=O.x)){var P=n;n=r,r=P}if((i=D.y)>(a=O.y)){var B=i;i=a,a=B}wwt(d,n-=T,i-=T,r+=T,a+=T)}if(h&&e.includeEdges&&f&&(_wt(d,t,"mid-source"),_wt(d,t,"mid-target"),_wt(d,t,"source"),_wt(d,t,"target")),h)if("yes"===t.pstyle("ghost").value){var $=t.pstyle("ghost-offset-x").pfValue,F=t.pstyle("ghost-offset-y").pfValue;wwt(d,d.x1+$,d.y1+F,d.x2+$,d.y2+F)}var z=p.bodyBounds=p.bodyBounds||{};Uft(z,d),zft(z,y),Fft(z,1),h&&(n=d.x1,r=d.x2,i=d.y1,a=d.y2,wwt(d,n-k,i-k,r+k,a+k));var U=p.overlayBounds=p.overlayBounds||{};Uft(U,d),zft(U,y),Fft(U,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?Oft(G.all):G.all=Rft(),h&&e.includeLabels&&(e.includeMainLabels&&Ewt(d,t,null),f&&(e.includeSourceLabels&&Ewt(d,t,"source"),e.includeTargetLabels&&Ewt(d,t,"target")))}return d.x1=bwt(d.x1),d.y1=bwt(d.y1),d.x2=bwt(d.x2),d.y2=bwt(d.y2),d.w=bwt(d.x2-d.x1),d.h=bwt(d.y2-d.y1),d.w>0&&d.h>0&&x&&(zft(d,y),Fft(d,1)),d}),"boundingBoxImpl"),Awt=s((function(t){var e=0,n=s((function(t){return(t?1:0)<0&&void 0!==arguments[0]?arguments[0]:Qwt,e=arguments.length>1?arguments[1]:void 0,n=0;n=0;l--)o(l);return this},tkt.removeAllListeners=function(){return this.removeListener("*")},tkt.emit=tkt.trigger=function(t,e,n){var r=this.listeners,i=r.length;return this.emitting++,Udt(e)||(e=[e]),rkt(this,(function(t,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=s((function(n){var i=r[n];if(i.type===a.type&&(!i.namespace||i.namespace===a.namespace||".*"===i.namespace)&&t.eventMatches(t.context,i,a)){var s=[a];null!=e&&jgt(s,e),t.beforeEmit(t.context,i,a),i.conf&&i.conf.one&&(t.listeners=t.listeners.filter((function(t){return t!==i})));var o=t.callbackContext(t.context,i,a),l=i.callback.apply(o,s);t.afterEmit(t.context,i,a),!1===l&&(a.stopPropagation(),a.preventDefault())}}),"_loop2"),l=0;l1&&!r){var i=this.length-1,a=this[i],s=a._private.data.id;this[i]=void 0,this[t]=a,n.set(s,{ele:a,index:t})}return this.length--,this}),"unmergeAt"),unmergeOne:s((function(t){t=t[0];var e=this._private,n=t._private.data.id,r=e.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this}),"unmergeOne"),unmerge:s((function(t){var e=this._private.cy;if(!t)return this;if(t&&Fdt(t)){var n=t;t=e.mutableElements().filter(n)}for(var r=0;r=0;e--){t(this[e])&&this.unmergeAt(e)}return this}),"unmergeBy"),map:s((function(t,e){for(var n=[],r=this,i=0;ir&&(r=o,n=s)}return{value:r,ele:n}}),"max"),min:s((function(t,e){for(var n,r=1/0,i=this,a=0;a=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[t];return null!=i?i:e?r.style().getDefaultProperty(t):null}}),"parsedStyle"),numericStyle:s((function(t){var e=this[0];if(e.cy().styleEnabled()&&e){var n=e.pstyle(t);return void 0!==n.pfValue?n.pfValue:n.value}}),"numericStyle"),numericStyleUnits:s((function(t){var e=this[0];if(e.cy().styleEnabled())return e?e.pstyle(t).units:void 0}),"numericStyleUnits"),renderedStyle:s((function(t){var e=this.cy();if(!e.styleEnabled())return this;var n=this[0];return n?e.style().getRenderedStyle(n,t):void 0}),"renderedStyle"),style:s((function(t,e){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(Gdt(t)){var i=t;r.applyBypass(this,i,false),this.emitAndNotify("style")}else if(Fdt(t)){if(void 0===e){var a=this[0];return a?r.getStylePropertyValue(a,t):void 0}r.applyBypass(this,t,e,false),this.emitAndNotify("style")}else if(void 0===t){var s=this[0];return s?r.getRawStyle(s):void 0}return this}),"style"),removeStyle:s((function(t){var e=this.cy();if(!e.styleEnabled())return this;var n=e.style(),r=this;if(void 0===t)for(var i=0;i0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)}),"neighborhood"),closedNeighborhood:s((function(t){return this.neighborhood().add(this).filter(t)}),"closedNeighborhood"),openNeighborhood:s((function(t){return this.neighborhood(t)}),"openNeighborhood")}),Lkt.neighbourhood=Lkt.neighborhood,Lkt.closedNeighbourhood=Lkt.closedNeighborhood,Lkt.openNeighbourhood=Lkt.openNeighborhood,dpt(Lkt,{source:rwt(s((function(t){var e,n=this[0];return n&&(e=n._private.source||n.cy().collection()),e&&t?e.filter(t):e}),"sourceImpl"),"source"),target:rwt(s((function(t){var e,n=this[0];return n&&(e=n._private.target||n.cy().collection()),e&&t?e.filter(t):e}),"targetImpl"),"target"),sources:Rkt({attr:"source"}),targets:Rkt({attr:"target"})}),s(Rkt,"defineSourceFunction"),dpt(Lkt,{edgesWith:rwt(Dkt(),"edgesWith"),edgesTo:rwt(Dkt({thisIsSrc:!0}),"edgesTo")}),s(Dkt,"defineEdgesWithFunction"),dpt(Lkt,{connectedEdges:rwt((function(t){for(var e=[],n=0;n0);return a}),"components"),component:s((function(){var t=this[0];return t.cy().mutableElements().components(t)[0]}),"component")}),Lkt.componentsOf=Lkt.components;var Pkt=s((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t){var i=new Hgt,a=!1;if(e){if(e.length>0&&Gdt(e[0])&&!Vdt(e[0])){a=!0;for(var o=[],l=new Xgt,c=0,h=e.length;c0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),o=a._private,l=[],c=[],h=0,u=i.length;h0){for(var P=t.length===i.length?i:new Pkt(a,t),B=0;B0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},a=n._private.cy;function o(t){for(var e=t._private.edges,n=0;n0&&(t?A.emitAndNotify("remove"):e&&A.emit("remove"));for(var L=0;L0?i=s:r=s}while(Math.abs(a)>o&&++c=a?x(e,o):0===l?o:w(e,r,r+h)}s(g,"A"),s(f,"B"),s(m,"C"),s(y,"calcBezier"),s(v,"getSlope"),s(x,"newtonRaphsonIterate"),s(b,"calcSampleValues"),s(w,"binarySubdivide"),s(k,"getTForX");var T=!1;function _(){T=!0,t===e&&n===r||b()}s(_,"precompute");var E=s((function(i){return T||_(),t===e&&n===r?i:0===i?0:1===i?1:y(k(i),e,r)}),"f");E.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var C="generateBezier("+[t,e,n,r]+")";return E.toString=function(){return C},E}s(Fkt,"generateCubicBezier");var zkt=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,n,r){var i={x:e.x+r.dx*n,v:e.v+r.dv*n,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function n(n,r){var i={dx:n.v,dv:t(n)},a=e(n,.5*r,i),s=e(n,.5*r,a),o=e(n,r,s),l=1/6*(i.dx+2*(a.dx+s.dx)+o.dx),c=1/6*(i.dv+2*(a.dv+s.dv)+o.dv);return n.x=n.x+l*r,n.v=n.v+c*r,n}return s(t,"springAccelerationForState"),s(e,"springEvaluateStateWithDerivative"),s(n,"springIntegrateState"),s((function t(e,r,i){var a,s,o,l={x:-1,v:0,tension:null,friction:null},c=[0],h=0,u=1e-4;for(e=parseFloat(e)||500,r=parseFloat(r)||20,i=i||null,l.tension=e,l.friction=r,s=(a=null!==i)?(h=t(e,r))/i*.016:.016;o=n(o||l,s),c.push(1+o.x),h+=16,Math.abs(o.x)>u&&Math.abs(o.v)>u;);return a?function(t){return c[t*(c.length-1)|0]}:h}),"springRK4Factory")}(),Ukt=s((function(t,e,n,r){var i=Fkt(t,e,n,r);return function(t,e,n){return t+(e-t)*i(n)}}),"cubicBezier"),Gkt={linear:s((function(t,e,n){return t+(e-t)*n}),"linear"),ease:Ukt(.25,.1,.25,1),"ease-in":Ukt(.42,0,1,1),"ease-out":Ukt(0,0,.58,1),"ease-in-out":Ukt(.42,0,.58,1),"ease-in-sine":Ukt(.47,0,.745,.715),"ease-out-sine":Ukt(.39,.575,.565,1),"ease-in-out-sine":Ukt(.445,.05,.55,.95),"ease-in-quad":Ukt(.55,.085,.68,.53),"ease-out-quad":Ukt(.25,.46,.45,.94),"ease-in-out-quad":Ukt(.455,.03,.515,.955),"ease-in-cubic":Ukt(.55,.055,.675,.19),"ease-out-cubic":Ukt(.215,.61,.355,1),"ease-in-out-cubic":Ukt(.645,.045,.355,1),"ease-in-quart":Ukt(.895,.03,.685,.22),"ease-out-quart":Ukt(.165,.84,.44,1),"ease-in-out-quart":Ukt(.77,0,.175,1),"ease-in-quint":Ukt(.755,.05,.855,.06),"ease-out-quint":Ukt(.23,1,.32,1),"ease-in-out-quint":Ukt(.86,0,.07,1),"ease-in-expo":Ukt(.95,.05,.795,.035),"ease-out-expo":Ukt(.19,1,.22,1),"ease-in-out-expo":Ukt(1,0,0,1),"ease-in-circ":Ukt(.6,.04,.98,.335),"ease-out-circ":Ukt(.075,.82,.165,1),"ease-in-out-circ":Ukt(.785,.135,.15,.86),spring:s((function(t,e,n){if(0===n)return Gkt.linear;var r=zkt(t,e,n);return function(t,e,n){return t+(e-t)*r(n)}}),"spring"),"cubic-bezier":Ukt};function qkt(t,e,n,r,i){if(1===r)return n;if(e===n)return n;var a=i(e,n,r);return null==t||((t.roundValue||t.color)&&(a=Math.round(a)),void 0!==t.min&&(a=Math.max(a,t.min)),void 0!==t.max&&(a=Math.min(a,t.max))),a}function jkt(t,e){return null!=t.pfValue||null!=t.value?null==t.pfValue||null!=e&&"%"===e.type.units?t.value:t.pfValue:t}function Ykt(t,e,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var s=jkt(t,i),o=jkt(e,i);if(jdt(s)&&jdt(o))return qkt(a,s,o,n,r);if(Udt(s)&&Udt(o)){for(var l=[],c=0;c0?("spring"===u&&d.push(s.duration),s.easingImpl=Gkt[u].apply(null,d)):s.easingImpl=Gkt[u]}var p,g=s.easingImpl;if(p=0===s.duration?1:(n-l)/s.duration,s.applying&&(p=s.progress),p<0?p=0:p>1&&(p=1),null==s.delay){var f=s.startPosition,m=s.position;if(m&&i&&!t.locked()){var y={};Hkt(f.x,m.x)&&(y.x=Ykt(f.x,m.x,p,g)),Hkt(f.y,m.y)&&(y.y=Ykt(f.y,m.y,p,g)),t.position(y)}var v=s.startPan,x=s.pan,b=a.pan,w=null!=x&&r;w&&(Hkt(v.x,x.x)&&(b.x=Ykt(v.x,x.x,p,g)),Hkt(v.y,x.y)&&(b.y=Ykt(v.y,x.y,p,g)),t.emit("pan"));var k=s.startZoom,T=s.zoom,_=null!=T&&r;_&&(Hkt(k,T)&&(a.zoom=Mft(a.minZoom,Ykt(k,T,p,g),a.maxZoom)),t.emit("zoom")),(w||_)&&t.emit("viewport");var E=s.style;if(E&&E.length>0&&i){for(var C=0;C=0;e--){(0,t[e])()}t.splice(0,t.length)}),"callbacks"),u=a.length-1;u>=0;u--){var d=a[u],p=d._private;p.stopped?(a.splice(u,1),p.hooked=!1,p.playing=!1,p.started=!1,h(p.frames)):(p.playing||p.applying)&&(p.playing&&p.applying&&(p.applying=!1),p.started||Vkt(0,d,t),Wkt(e,d,t,n),p.applying&&(p.applying=!1),h(p.frames),null!=p.step&&p.step(t),d.completed()&&(a.splice(u,1),p.hooked=!1,p.playing=!1,p.started=!1,h(p.completes)),l=!0)}return n||0!==a.length||0!==o.length||r.push(e),l}s(i,"stepOne");for(var a=!1,o=0;o0?e.notify("draw",n):e.notify("draw")),n.unmerge(r),e.emit("step")}s(qkt,"getEasedValue"),s(jkt,"getValue"),s(Ykt,"ease"),s(Wkt,"step$1"),s(Hkt,"valid"),s(Vkt,"startAnimation"),s(Xkt,"stepAll");var Kkt={animate:ibt.animate(),animation:ibt.animation(),animated:ibt.animated(),clearQueue:ibt.clearQueue(),delay:ibt.delay(),delayAnimation:ibt.delayAnimation(),stop:ibt.stop(),addToAnimationPool:s((function(t){this.styleEnabled()&&this._private.aniEles.merge(t)}),"addToAnimationPool"),stopAnimationLoop:s((function(){this._private.animationsRunning=!1}),"stopAnimationLoop"),startAnimationLoop:s((function(){var t=this;if(t._private.animationsRunning=!0,t.styleEnabled()){s(n,"headlessStep");var e=t.renderer();e&&e.beforeRender?e.beforeRender(s((function(e,n){Xkt(n,t)}),"rendererAnimationStep"),e.beforeRenderPriorities.animations):n()}function n(){t._private.animationsRunning&&ugt(s((function(e){Xkt(e,t),n()}),"animationStep"))}}),"startAnimationLoop")},Zkt={qualifierCompare:s((function(t,e){return null==t||null==e?null==t&&null==e:t.sameText(e)}),"qualifierCompare"),eventMatches:s((function(t,e,n){var r=e.qualifier;return null==r||t!==n.target&&Vdt(n.target)&&r.matches(n.target)}),"eventMatches"),addEventFields:s((function(t,e){e.cy=t,e.target=t}),"addEventFields"),callbackContext:s((function(t,e,n){return null!=e.qualifier?n.target:t}),"callbackContext")},Qkt=s((function(t){return Fdt(t)?new Qbt(t):t}),"argSelector"),Jkt={createEmitter:s((function(){var t=this._private;return t.emitter||(t.emitter=new Jwt(Zkt,this)),this}),"createEmitter"),emitter:s((function(){return this._private.emitter}),"emitter"),on:s((function(t,e,n){return this.emitter().on(t,Qkt(e),n),this}),"on"),removeListener:s((function(t,e,n){return this.emitter().removeListener(t,Qkt(e),n),this}),"removeListener"),removeAllListeners:s((function(){return this.emitter().removeAllListeners(),this}),"removeAllListeners"),one:s((function(t,e,n){return this.emitter().one(t,Qkt(e),n),this}),"one"),once:s((function(t,e,n){return this.emitter().one(t,Qkt(e),n),this}),"once"),emit:s((function(t,e){return this.emitter().emit(t,e),this}),"emit"),emitAndNotify:s((function(t,e){return this.emit(t),this.notify(t,e),this}),"emitAndNotify")};ibt.eventAliasesOn(Jkt);var tTt={png:s((function(t){return t=t||{},this._private.renderer.png(t)}),"png"),jpg:s((function(t){var e=this._private.renderer;return(t=t||{}).bg=t.bg||"#fff",e.jpg(t)}),"jpg")};tTt.jpeg=tTt.jpg;var eTt={layout:s((function(t){var e=this;if(null!=t)if(null!=t.name){var n,r=t.name,i=e.extension("layout",r);if(null!=i)return n=Fdt(t.eles)?e.$(t.eles):null!=t.eles?t.eles:e.$(),new i(dpt({},t,{cy:e,eles:n}));Mgt("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Mgt("A `name` must be specified to make a layout");else Mgt("Layout options must be specified to make a layout")}),"layout")};eTt.createLayout=eTt.makeLayout=eTt.layout;var nTt={notify:s((function(t,e){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[t]=n.batchNotifications[t]||this.collection();null!=e&&r.merge(e)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(t,e)}}),"notify"),notifications:s((function(t){var e=this._private;return void 0===t?e.notificationsEnabled:(e.notificationsEnabled=!!t,this)}),"notifications"),noNotifications:s((function(t){this.notifications(!1),t(),this.notifications(!0)}),"noNotifications"),batching:s((function(){return this._private.batchCount>0}),"batching"),startBatch:s((function(){var t=this._private;return null==t.batchCount&&(t.batchCount=0),0===t.batchCount&&(t.batchStyleEles=this.collection(),t.batchNotifications={}),t.batchCount++,this}),"startBatch"),endBatch:s((function(){var t=this._private;if(0===t.batchCount)return this;if(t.batchCount--,0===t.batchCount){t.batchStyleEles.updateStyle();var e=this.renderer();Object.keys(t.batchNotifications).forEach((function(n){var r=t.batchNotifications[n];r.empty()?e.notify(n):e.notify(n,r)}))}return this}),"endBatch"),batch:s((function(t){return this.startBatch(),t(),this.endBatch(),this}),"batch"),batchData:s((function(t){var e=this;return this.batch((function(){for(var n=Object.keys(t),r=0;r0;)e.removeChild(e.childNodes[0]);t._private.renderer=null,t.mutableElements().forEach((function(t){var e=t._private;e.rscratch={},e.rstyle={},e.animation.current=[],e.animation.queue=[]}))}),"destroyRenderer"),onRender:s((function(t){return this.on("render",t)}),"onRender"),offRender:s((function(t){return this.off("render",t)}),"offRender")};iTt.invalidateDimensions=iTt.resize;var aTt={collection:s((function(t,e){return Fdt(t)?this.$(t):Hdt(t)?t.collection():Udt(t)?(e||(e={}),new Pkt(this,t,e.unique,e.removed)):new Pkt(this)}),"collection"),nodes:s((function(t){var e=this.$((function(t){return t.isNode()}));return t?e.filter(t):e}),"nodes"),edges:s((function(t){var e=this.$((function(t){return t.isEdge()}));return t?e.filter(t):e}),"edges"),$:s((function(t){var e=this._private.elements;return t?e.filter(t):e.spawnSelf()}),"$"),mutableElements:s((function(){return this._private.elements}),"mutableElements")};aTt.elements=aTt.filter=aTt.$;var sTt={};sTt.apply=function(t){for(var e=this,n=e._private.cy.collection(),r=0;r0;if(d||u&&p){var g=void 0;d&&p||d?g=c.properties:p&&(g=c.mappedProperties);for(var f=0;f1&&(y=1),l.color){var k=i.valueMin[0],T=i.valueMax[0],_=i.valueMin[1],E=i.valueMax[1],C=i.valueMin[2],S=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],L=null==i.valueMax[3]?1:i.valueMax[3],N=[Math.round(k+(T-k)*y),Math.round(_+(E-_)*y),Math.round(C+(S-C)*y),Math.round(A+(L-A)*y)];n={bypass:i.bypass,name:i.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else{if(!l.number)return!1;var I=i.valueMin+(i.valueMax-i.valueMin)*y;n=this.parse(i.name,I,i.bypass,p)}if(!n)return m(),!1;n.mapping=i,i=n;break;case o.data:for(var M=i.field.split("."),R=d.data,D=0;D0&&a>0){for(var o={},l=!1,c=0;c0?t.delayAnimation(s).play().promise().then(e):e()})).then((function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(t,i),t.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),r.transitioning=!1)},sTt.checkTrigger=function(t,e,n,r,i,a){var s=this.properties[e],o=i(s);null!=o&&o(n,r)&&a(s)},sTt.checkZOrderTrigger=function(t,e,n,r){var i=this;this.checkTrigger(t,e,n,r,(function(t){return t.triggersZOrder}),(function(){i._private.cy.notify("zorder",t)}))},sTt.checkBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,(function(t){return t.triggersBounds}),(function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==e||"bezier"!==n&&"bezier"!==r||t.parallelEdges().forEach((function(t){t.isBundledBezier()&&t.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==e||"none"!==n&&"none"!==r||t.connectedEdges().forEach((function(t){t.dirtyBoundingBoxCache()}))}))},sTt.checkTriggers=function(t,e,n,r){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,n,r),this.checkBoundsTrigger(t,e,n,r)};var oTt={applyBypass:function(t,e,n,r){var i=[];if("*"===e||"**"===e){if(void 0!==n)for(var a=0;ae.length?a.substr(e.length):""}function l(){n=n.length>r.length?n.substr(r.length):""}for(a=a.replace(/[/][*](\s|.)+?[*][/]/g,""),s(o,"removeSelAndBlockFromRemaining"),s(l,"removePropAndValFromRem");;){if(a.match(/^\s*$/))break;var c=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Dgt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}e=c[0];var h=c[1];if("core"!==h)if(new Qbt(h).invalid){Dgt("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),o();continue}var u=c[2],d=!1;n=u;for(var p=[];;){if(n.match(/^\s*$/))break;var g=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Dgt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),d=!0;break}r=g[0];var f=g[1],m=g[2];if(this.properties[f])i.parse(f,m)?(p.push({name:f,val:m}),l()):(Dgt("Skipping property: Invalid property definition in: "+r),l());else Dgt("Skipping property: Invalid property name in: "+r),l()}if(d){o();break}i.selector(h);for(var y=0;y=7&&"d"===e[0]&&(h=new RegExp(l.data.regex).exec(e))){if(n)return!1;var p=l.data;return{name:t,value:h,strValue:""+e,mapped:p,field:h[1],bypass:n}}if(e.length>=10&&"m"===e[0]&&(u=new RegExp(l.mapData.regex).exec(e))){if(n)return!1;if(d.multiple)return!1;var g=l.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(t,u[4]);if(!f||f.mapped)return!1;var m=this.parse(t,u[5]);if(!m||m.mapped)return!1;if(f.pfValue===m.pfValue||f.strValue===m.strValue)return Dgt("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+f.strValue+"`"),this.parse(t,f.strValue);if(d.color){var y=f.value,v=m.value;if(!(y[0]!==v[0]||y[1]!==v[1]||y[2]!==v[2]||y[3]!==v[3]&&(null!=y[3]&&1!==y[3]||null!=v[3]&&1!==v[3])))return!1}return{name:t,value:u,strValue:""+e,mapped:g,field:u[1],fieldMin:parseFloat(u[2]),fieldMax:parseFloat(u[3]),valueMin:f.value,valueMax:m.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var x;if(x=c?e.split(/\s+/):Udt(e)?e:[e],d.evenMultiple&&x.length%2!=0)return null;for(var b=[],w=[],k=[],T="",_=!1,E=0;E0?" ":"")+C.strValue}return d.validate&&!d.validate(b,w)?null:d.singleEnum&&_?1===b.length&&Fdt(b[0])?{name:t,value:b[0],strValue:b[0],bypass:n}:null:{name:t,value:b,pfValue:k,strValue:T,bypass:n,units:w}}var S=s((function(){for(var r=0;rd.max||d.strictMax&&e===d.max))return null;var M={name:t,value:e,strValue:""+e+(A||""),units:A,bypass:n};return d.unitless||"px"!==A&&"em"!==A?M.pfValue=e:M.pfValue="px"!==A&&A?this.getEmSizeInPixels()*e:e,"ms"!==A&&"s"!==A||(M.pfValue="ms"===A?e:1e3*e),"deg"!==A&&"rad"!==A||(M.pfValue="rad"===A?e:kft(e)),"%"===A&&(M.pfValue=e/100),M}if(d.propList){var R=[],D=""+e;if("none"===D);else{for(var O=D.split(/\s*,\s*|\s+/),P=0;P0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*e)/n.w,(o-2*e)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=e),this}),"zoomRange"),minZoom:s((function(t){return void 0===t?this._private.minZoom:this.zoomRange({min:t})}),"minZoom"),maxZoom:s((function(t){return void 0===t?this._private.maxZoom:this.zoomRange({max:t})}),"maxZoom"),getZoomedViewport:s((function(t){var e,n,r=this._private,i=r.pan,a=r.zoom,s=!1;if(r.zoomingEnabled||(s=!0),jdt(t)?n=t:Gdt(t)&&(n=t.level,null!=t.position?e=fft(t.position,a,i):null!=t.renderedPosition&&(e=t.renderedPosition),null==e||r.panningEnabled||(s=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)e.maxZoom||!e.zoomingEnabled?a=!0:(e.zoom=o,i.push("zoom"))}if(r&&(!a||!t.cancelOnFailedZoom)&&e.panningEnabled){var l=t.pan;jdt(l.x)&&(e.pan.x=l.x,s=!1),jdt(l.y)&&(e.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this}),"viewport"),center:s((function(t){var e=this.getCenterPan(t);return e&&(this._private.pan=e,this.emit("pan viewport"),this.notify("viewport")),this}),"center"),getCenterPan:s((function(t,e){if(this._private.panningEnabled){if(Fdt(t)){var n=t;t=this.mutableElements().filter(n)}else Hdt(t)||(t=this.mutableElements());if(0!==t.length){var r=t.boundingBox(),i=this.width(),a=this.height();return{x:(i-(e=void 0===e?this._private.zoom:e)*(r.x1+r.x2))/2,y:(a-e*(r.y1+r.y2))/2}}}}),"getCenterPan"),reset:s((function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this}),"reset"),invalidateSize:s((function(){this._private.sizeCache=null}),"invalidateSize"),size:s((function(){var t,e,n=this._private,r=n.container,i=this;return n.sizeCache=n.sizeCache||(r?(t=i.window().getComputedStyle(r),e=s((function(e){return parseFloat(t.getPropertyValue(e))}),"val"),{width:r.clientWidth-e("padding-left")-e("padding-right"),height:r.clientHeight-e("padding-top")-e("padding-bottom")}):{width:1,height:1})}),"size"),width:s((function(){return this.size().width}),"width"),height:s((function(){return this.size().height}),"height"),extent:s((function(){var t=this._private.pan,e=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-t.x)/e,x2:(n.x2-t.x)/e,y1:(n.y1-t.y)/e,y2:(n.y2-t.y)/e};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r}),"extent"),renderedExtent:s((function(){var t=this.width(),e=this.height();return{x1:0,y1:0,x2:t,y2:e,w:t,h:e}}),"renderedExtent"),multiClickDebounceTime:s((function(t){return t?(this._private.multiClickDebounceTime=t,this):this._private.multiClickDebounceTime}),"multiClickDebounceTime")};yTt.centre=yTt.center,yTt.autolockNodes=yTt.autolock,yTt.autoungrabifyNodes=yTt.autoungrabify;var vTt={data:ibt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ibt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ibt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ibt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};vTt.attr=vTt.data,vTt.removeAttr=vTt.removeData;var xTt=s((function(t){var e=this,n=(t=dpt({},t)).container;n&&!Wdt(n)&&Wdt(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=e;var a=void 0!==Mdt&&void 0!==n&&!t.headless,o=t;o.layout=dpt({name:a?"grid":"null"},o.layout),o.renderer=dpt({name:a?"canvas":"null"},o.renderer);var l=s((function(t,e,n){return void 0!==e?e:void 0!==n?n:t}),"defVal"),c=this._private={container:n,ready:!1,options:o,elements:new Pkt(this),listeners:[],aniEles:new Pkt(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:void 0===o.styleEnabled?a:o.styleEnabled,zoom:jdt(o.zoom)?o.zoom:1,pan:{x:Gdt(o.pan)&&jdt(o.pan.x)?o.pan.x:0,y:Gdt(o.pan)&&jdt(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=s((function(t,e){if(t.some(npt))return Yyt.all(t).then(e);e(t)}),"loadExtData");c.styleEnabled&&e.setStyle([]);var u=dpt({},o,o.renderer);e.initRenderer(u);var d=s((function(t,n,r){e.notifications(!1);var i=e.mutableElements();i.length>0&&i.remove(),null!=t&&(Gdt(t)||Udt(t))&&e.add(t),e.one("layoutready",(function(t){e.notifications(!0),e.emit(t),e.one("load",n),e.emitAndNotify("load")})).one("layoutstop",(function(){e.one("done",r),e.emit("done")}));var a=dpt({},e._private.options.layout);a.eles=e.elements(),e.layout(a).run()}),"setElesAndLayout");h([o.style,o.elements],(function(t){var n=t[0],a=t[1];c.styleEnabled&&e.style().append(n),d(a,(function(){e.startAnimationLoop(),c.ready=!0,zdt(o.ready)&&e.on("ready",o.ready);for(var t=0;t0,h=Rft(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(Hdt(n.roots))t=n.roots;else if(Udt(n.roots)){for(var u=[],d=0;d0;){var M=I(),R=S(M,L);if(R)M.outgoers().filter((function(t){return t.isNode()&&i.has(t)})).forEach(N);else if(null===R){Dgt("Detected double maximal shift for node `"+M.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}C();var D=0;if(n.avoidOverlap)for(var O=0;O0&&v[0].length<=3?l/2:0),u=2*Math.PI/v[r].length*i;return 0===r&&1===v[0].length&&(c=1),{x:H+c*Math.cos(u),y:V+c*Math.sin(u)}}return{x:H+(i+1-(a+1)/2)*s,y:(r+1)*o}}),"getPosition");return i.nodes().layoutPositions(this,n,K),this};var CTt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")};function STt(t){this.options=dpt({},CTt,t)}s(STt,"CircleLayout"),STt.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,i=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,a=r.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var o,l=Rft(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c=l.x1+l.w/2,h=l.y1+l.h/2,u=(void 0===e.sweep?2*Math.PI-2*Math.PI/a.length:e.sweep)/Math.max(1,a.length-1),d=0,p=0;p1&&e.avoidOverlap){d*=1.75;var y=Math.cos(u)-Math.cos(0),v=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(y*y+v*v));o=Math.max(x,o)}var b=s((function(t,n){var r=e.startAngle+n*u*(i?1:-1),a=o*Math.cos(r),s=o*Math.sin(r);return{x:c+a,y:h+s}}),"getPos");return r.nodes().layoutPositions(this,e,b),this};var ATt,LTt={fit:!0,padding:30,startAngle:1.5*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:s((function(t){return t.degree()}),"concentric"),levelWidth:s((function(t){return t.maxDegree()/4}),"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")};function NTt(t){this.options=dpt({},LTt,t)}s(NTt,"ConcentricLayout"),NTt.prototype.run=function(){for(var t=this.options,e=t,n=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,r=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Rft(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o=s.x1+s.w/2,l=s.y1+s.h/2,c=[],h=0,u=0;u0)Math.abs(v[0].value-b.value)>=m&&(v=[],y.push(v));v.push(b)}var w=h+e.minNodeSpacing;if(!e.avoidOverlap){var k=y.length>0&&y[0].length>1,T=(Math.min(s.w,s.h)/2-w)/(y.length+k?1:0);w=Math.min(w,T)}for(var _=0,E=0;E1&&e.avoidOverlap){var L=Math.cos(A)-Math.cos(0),N=Math.sin(A)-Math.sin(0),I=Math.sqrt(w*w/(L*L+N*N));_=Math.max(I,_)}C.r=_,_+=w}if(e.equidistant){for(var M=0,R=0,D=0;D=t.numIter)&&(FTt(r,t),r.temperature=r.temperature*t.coolingFactor,!(r.temperature=t.animationThreshold&&a(),ugt(e)):(ZTt(r,t),l())}),"frame");u()}else{for(;h;)h=o(c),c++;ZTt(r,t),l()}return this},MTt.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},MTt.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var RTt=s((function(t,e,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=Rft(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},o=n.eles.components(),l={},c=0;c0){s.graphSet.push(w);for(c=0;cr.count?0:r.graph}),"findLCA"),OTt=s((function t(e,n,r,i){var a=i.graphSet[r];if(-10)var o=(c=r.nodeOverlap*s)*i/(f=Math.sqrt(i*i+a*a)),l=c*a/f;else{var c,h=jTt(t,i,a),u=jTt(e,-1*i,-1*a),d=u.x-h.x,p=u.y-h.y,g=d*d+p*p,f=Math.sqrt(g);o=(c=(t.nodeRepulsion+e.nodeRepulsion)/g)*d/f,l=c*p/f}t.isLocked||(t.offsetX-=o,t.offsetY-=l),e.isLocked||(e.offsetX+=o,e.offsetY+=l)}}),"nodeRepulsion"),qTt=s((function(t,e,n,r){if(n>0)var i=t.maxX-e.minX;else i=e.maxX-t.minX;if(r>0)var a=t.maxY-e.minY;else a=e.maxY-t.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0}),"nodesOverlap"),jTt=s((function(t,e,n){var r=t.positionX,i=t.positionY,a=t.height||1,s=t.width||1,o=n/e,l=a/s,c={};return 0===e&&0n?(c.x=r,c.y=i+a/2,c):0e&&-1*l<=o&&o<=l?(c.x=r-s/2,c.y=i-s*n/2/e,c):0=l)?(c.x=r+a*e/2/n,c.y=i+a/2,c):0>n&&(o<=-1*l||o>=l)?(c.x=r-a*e/2/n,c.y=i-a/2,c):c}),"findClippingPoint"),YTt=s((function(t,e){for(var n=0;n1){var g=e.gravity*u/p,f=e.gravity*d/p;h.offsetX+=g,h.offsetY+=f}}}}}),"calculateGravityForces"),HTt=s((function(t,e){var n=[],r=0,i=-1;for(n.push.apply(n,t.graphSet[0]),i+=t.graphSet[0].length;r<=i;){var a=n[r++],s=t.idToIndex[a],o=t.layoutNodes[s],l=o.children;if(0n)var i={x:n*t/r,y:n*e/r};else i={x:t,y:e};return i}),"limitForce"),KTt=s((function t(e,n){var r=e.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],a=!1;return(null==i.maxX||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(null==i.minX||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(null==i.minY||e.minY-i.padTopg&&(u+=p+e.componentSpacing,h=0,d=0,p=0)}}}),"separateComponents"),QTt={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:s((function(t){}),"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")};function JTt(t){this.options=dpt({},QTt,t)}s(JTt,"GridLayout"),JTt.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,i=r.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Rft(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===a.h||0===a.w)r.nodes().layoutPositions(this,e,(function(t){return{x:a.x1,y:a.y1}}));else{var o=i.size(),l=Math.sqrt(o*a.h/a.w),c=Math.round(l),h=Math.round(a.w/a.h*l),u=s((function(t){if(null==t)return Math.min(c,h);Math.min(c,h)==c?c=t:h=t}),"small"),d=s((function(t){if(null==t)return Math.max(c,h);Math.max(c,h)==c?c=t:h=t}),"large"),p=e.rows,g=null!=e.cols?e.cols:e.columns;if(null!=p&&null!=g)c=p,h=g;else if(null!=p&&null==g)c=p,h=Math.ceil(o/c);else if(null==p&&null!=g)h=g,c=Math.ceil(o/h);else if(h*c>o){var f=u(),m=d();(f-1)*m>=o?u(f-1):(m-1)*f>=o&&d(m-1)}else for(;h*c=o?d(v+1):u(y+1)}var x=a.w/h,b=a.h/c;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var w=0;w=h&&(M=0,I++)}),"moveToNextCell"),D={},O=0;O(r=Qft(t,e,b[w],b[w+1],b[w+2],b[w+3])))return y(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(b=a.allpts,w=0;w+5(r=Zft(t,e,b[w],b[w+1],b[w+2],b[w+3],b[w+4],b[w+5])))return y(n,r),!0;m=m||i.source,x=x||i.target;var k=o.getArrowWidth(s,c),T=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}];for(w=0;w0&&(v(m),v(x))}function b(t,e,n){return Ygt(t,e,n)}function w(n,r){var i,a=n._private,o=f;i=r?r+"-":"",n.boundingBox();var l=a.labelBounds[r||"main"],c=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&c){var h=b(a.rscratch,"labelX",r),u=b(a.rscratch,"labelY",r),d=b(a.rscratch,"labelAngle",r),p=n.pstyle(i+"text-margin-x").pfValue,g=n.pstyle(i+"text-margin-y").pfValue,m=l.x1-o-p,v=l.x2+o-p,x=l.y1-o-g,w=l.y2+o-g;if(d){var k=Math.cos(d),T=Math.sin(d),_=s((function(t,e){return{x:(t-=h)*k-(e-=u)*T+h,y:t*T+e*k+u}}),"rotate"),E=_(m,x),C=_(m,w),S=_(v,x),A=_(v,w),L=[E.x+p,E.y+g,S.x+p,S.y+g,A.x+p,A.y+g,C.x+p,C.y+g];if(Jft(t,e,L))return y(n),!0}else if(qft(l,t,e))return y(n),!0}}n&&(c=c.interactive),s(y,"addEle"),s(v,"checkNode"),s(x,"checkEdge"),s(b,"preprop"),s(w,"checkLabel");for(var k=c.length-1;k>=0;k--){var T=c[k];T.isNode()?v(T)||w(T):x(T)||w(T)||w(T,"source")||w(T,"target")}return h},getAllInBox:function(t,e,n,r){for(var i=this.getCachedZSortedEles().interactive,a=[],s=Math.min(t,n),o=Math.max(t,n),l=Math.min(e,r),c=Math.max(e,r),h=Rft({x1:t=s,y1:e=l,x2:n=o,y2:r=c}),u=0;u0?-(Math.PI-t.ang):Math.PI+t.ang}),"invertVec"),D_t=s((function(t,e,n,r,i){if(t!==L_t?M_t(e,t,N_t):R_t(I_t,N_t),M_t(e,n,I_t),f_t=N_t.nx*I_t.ny-N_t.ny*I_t.nx,m_t=N_t.nx*I_t.nx-N_t.ny*-I_t.ny,x_t=Math.asin(Math.max(-1,Math.min(1,f_t))),Math.abs(x_t)<1e-6)return h_t=e.x,u_t=e.y,void(w_t=T_t=0);y_t=1,v_t=!1,m_t<0?x_t<0?x_t=Math.PI+x_t:(x_t=Math.PI-x_t,y_t=-1,v_t=!0):x_t>0&&(y_t=-1,v_t=!0),T_t=void 0!==e.radius?e.radius:r,b_t=x_t/2,__t=Math.min(N_t.len/2,I_t.len/2),i?(k_t=Math.abs(Math.cos(b_t)*T_t/Math.sin(b_t)))>__t?(k_t=__t,w_t=Math.abs(k_t*Math.sin(b_t)/Math.cos(b_t))):w_t=T_t:(k_t=Math.min(__t,T_t),w_t=Math.abs(k_t*Math.sin(b_t)/Math.cos(b_t))),S_t=e.x+I_t.nx*k_t,A_t=e.y+I_t.ny*k_t,h_t=S_t-I_t.ny*w_t*y_t,u_t=A_t+I_t.nx*w_t*y_t,E_t=e.x+N_t.nx*k_t,C_t=e.y+N_t.ny*k_t,L_t=e}),"calcCornerArc");function O_t(t,e){0===e.radius?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function P_t(t,e,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return 0===r||0===e.radius?{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}:(D_t(t,e,n,r,i),{cx:h_t,cy:u_t,radius:w_t,startX:E_t,startY:C_t,stopX:S_t,stopY:A_t,startAngle:N_t.ang+Math.PI/2*y_t,endAngle:I_t.ang-Math.PI/2*y_t,counterClockwise:v_t})}s(O_t,"drawPreparedRoundCorner"),s(P_t,"getRoundCorner");var B_t={};function $_t(t){var e=[];if(null!=t){for(var n=0;n0?Math.max(t-e,0):Math.min(t+e,0)}),"subDWH"),A=S(E,T),L=S(C,_),N=!1;"auto"===y?m=Math.abs(A)>Math.abs(L)?i:r:y===c||y===l?(m=r,N=!0):y!==a&&y!==o||(m=i,N=!0);var I,M=m===r,R=M?L:A,D=M?C:E,O=Eft(D),P=!1;(N&&(x||w)||!(y===l&&D<0||y===c&&D>0||y===a&&D>0||y===o&&D<0)||(R=(O*=-1)*Math.abs(R),P=!0),x)?I=(b<0?1+b:b)*R:I=(b<0?R:0)+b*O;var B=s((function(t){return Math.abs(t)=Math.abs(R)}),"getIsTooClose"),$=B(I),F=B(Math.abs(R)-Math.abs(I));if(($||F)&&!P)if(M){var z=Math.abs(D)<=d/2,U=Math.abs(E)<=p/2;if(z){var G=(h.x1+h.x2)/2,q=h.y1,j=h.y2;n.segpts=[G,q,G,j]}else if(U){var Y=(h.y1+h.y2)/2,W=h.x1,H=h.x2;n.segpts=[W,Y,H,Y]}else n.segpts=[h.x1,h.y2]}else{var V=Math.abs(D)<=u/2,X=Math.abs(C)<=g/2;if(V){var K=(h.y1+h.y2)/2,Z=h.x1,Q=h.x2;n.segpts=[Z,K,Q,K]}else if(X){var J=(h.x1+h.x2)/2,tt=h.y1,et=h.y2;n.segpts=[J,tt,J,et]}else n.segpts=[h.x2,h.y1]}else if(M){var nt=h.y1+I+(f?d/2*O:0),rt=h.x1,it=h.x2;n.segpts=[rt,nt,it,nt]}else{var at=h.x1+I+(f?u/2*O:0),st=h.y1,ot=h.y2;n.segpts=[at,st,at,ot]}if(n.isRound){var lt=t.pstyle("taxi-radius").value,ct="arc-radius"===t.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(lt),n.isArcRadius=new Array(n.segpts.length/2).fill(ct)}},B_t.tryToCorrectInvalidPoints=function(t,e){var n=t._private.rscratch;if("bezier"===n.edgeType){var r=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,c=e.srcShape,h=e.tgtShape,u=e.srcCornerRadius,d=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,f=!jdt(n.startX)||!jdt(n.startY),m=!jdt(n.arrowStartX)||!jdt(n.arrowStartY),y=!jdt(n.endX)||!jdt(n.endY),v=!jdt(n.arrowEndX)||!jdt(n.arrowEndY),x=3*(this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth),b=Cft({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=bd.poolIndex()){var p=u;u=d,d=p}var g=o.srcPos=u.position(),f=o.tgtPos=d.position(),m=o.srcW=u.outerWidth(),y=o.srcH=u.outerHeight(),v=o.tgtW=d.outerWidth(),x=o.tgtH=d.outerHeight(),b=o.srcShape=n.nodeShapes[e.getNodeShape(u)],w=o.tgtShape=n.nodeShapes[e.getNodeShape(d)],k=o.srcCornerRadius="auto"===u.pstyle("corner-radius").value?"auto":u.pstyle("corner-radius").pfValue,T=o.tgtCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,_=o.tgtRs=d._private.rscratch,E=o.srcRs=u._private.rscratch;o.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var C=0;C0){var Y=c,W=Sft(Y,yft(e)),H=Sft(Y,yft(j)),V=W;if(H2)Sft(Y,{x:j[2],y:j[3]})0){var ot=h,lt=Sft(ot,yft(e)),ct=Sft(ot,yft(st)),ht=lt;if(ct2)Sft(ot,{x:st[2],y:st[3]})=l||v){h={cp:f,segment:y};break}}if(h)break}var x=h.cp,b=h.segment,w=(l-d)/b.length,k=b.t1-b.t0,T=s?b.t0+k*w:b.t1-k*w;T=Mft(0,T,1),e=Nft(x.p0,x.p1,x.p2,T),i=Y_t(x.p0,x.p1,x.p2,T);break;case"straight":case"segments":case"haystack":for(var _,E,C,S,A=0,L=r.allpts.length,N=0;N+3=l));N+=2);var I=(l-E)/_;I=Mft(0,I,1),e=Ift(C,S,I),i=j_t(C,S)}o("labelX",n,e.x),o("labelY",n,e.y),o("labelAutoAngle",n,i)}}),"calculateEndProjection");h("source"),h("target"),this.applyLabelDimensions(t)}},G_t.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},G_t.applyPrefixedLabelDimensions=function(t,e){var n=t._private,r=this.getLabelText(t,e),i=this.calculateLabelDimensions(t,r),a=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=Ygt(n.rscratch,"labelWrapCachedLines",e)||[],l="wrap"!==s?1:Math.max(o.length,1),c=i.height/l,h=c*a,u=i.width,d=i.height+(l-1)*(a-1)*c;Wgt(n.rstyle,"labelWidth",e,u),Wgt(n.rscratch,"labelWidth",e,u),Wgt(n.rstyle,"labelHeight",e,d),Wgt(n.rscratch,"labelHeight",e,d),Wgt(n.rscratch,"labelLineHeight",e,h)},G_t.getLabelText=function(t,e){var n=t._private,r=e?e+"-":"",i=t.pstyle(r+"label").strValue,a=t.pstyle("text-transform").value,o=s((function(t,r){return r?(Wgt(n.rscratch,t,e,r),r):Ygt(n.rscratch,t,e)}),"rscratch");if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var l=t.pstyle("text-wrap").value;if("wrap"===l){var c=o("labelKey");if(null!=c&&o("labelWrapKey")===c)return o("labelWrapCachedText");for(var h=i.split("\n"),u=t.pstyle("text-max-width").pfValue,d="anywhere"===t.pstyle("text-overflow-wrap").value,p=[],g=/[\s\u200b]+|$/g,f=0;fu){var x,b="",w=0,k=Idt(m.matchAll(g));try{for(k.s();!(x=k.n()).done;){var T=x.value,_=T[0],E=m.substring(w,T.index);w=T.index+_.length;var C=0===b.length?E:b+E+_;this.calculateLabelDimensions(t,C).width<=u?b+=E+_:(b&&p.push(b),b=E+_)}}catch(t){k.e(t)}finally{k.f()}b.match(/^[\s\u200b]+$/)||p.push(b)}else p.push(m)}o("labelWrapCachedLines",p),i=o("labelWrapCachedText",p.join("\n")),o("labelWrapKey",c)}else if("ellipsis"===l){var S=t.pstyle("text-max-width").pfValue,A="",L=!1;if(this.calculateLabelDimensions(t,i).widthS)break;A+=i[N],N===i.length-1&&(L=!0)}return L||(A+="…"),A}return i},G_t.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,n=t.pstyle("text-halign").strValue;if("auto"!==e)return e;if(!t.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},G_t.calculateLabelDimensions=function(t,e){var n=this,r=n.cy.window().document,i=wgt(e,t._private.labelDimsKey),a=n.labelDimCache||(n.labelDimCache=[]),s=a[i];if(null!=s)return s;var o=t.pstyle("font-style").strValue,l=t.pstyle("font-size").pfValue,c=t.pstyle("font-family").strValue,h=t.pstyle("font-weight").strValue,u=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!u){u=this.labelCalcCanvas=r.createElement("canvas"),d=this.labelCalcCanvasContext=u.getContext("2d");var p=u.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}d.font="".concat(o," ").concat(h," ").concat(l,"px ").concat(c);for(var g=0,f=0,m=e.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(e.merge(t),n)for(var r=0;r=t.desktopTapThreshold2}var C=i(e);m&&(t.hoverData.tapholdCancelled=!0);var S=s((function(){var e=t.hoverData.dragDelta=t.hoverData.dragDelta||[];0===e.length?(e.push(b[0]),e.push(b[1])):(e[0]+=b[0],e[1]+=b[1])}),"updateDragDelta");n=!0,r(g,["mousemove","vmousemove","tapdrag"],e,{x:h[0],y:h[1]});var A=s((function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||o.emit({originalEvent:e,type:"boxstart",position:{x:h[0],y:h[1]}}),p[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()}),"goIntoBoxMode");if(3===t.hoverData.which){if(m){var N={originalEvent:e,type:"cxtdrag",position:{x:h[0],y:h[1]}};x?x.emit(N):o.emit(N),t.hoverData.cxtDragged=!0,t.hoverData.cxtOver&&g===t.hoverData.cxtOver||(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:h[0],y:h[1]}}),t.hoverData.cxtOver=g,g&&g.emit({originalEvent:e,type:"cxtdragover",position:{x:h[0],y:h[1]}}))}}else if(t.hoverData.dragging){if(n=!0,o.panningEnabled()&&o.userPanningEnabled()){var I;if(t.hoverData.justStartedPan){var M=t.hoverData.mdownPos;I={x:(h[0]-M[0])*l,y:(h[1]-M[1])*l},t.hoverData.justStartedPan=!1}else I={x:b[0]*l,y:b[1]*l};o.panBy(I),o.emit("dragpan"),t.hoverData.dragged=!0}h=t.projectIntoViewport(e.clientX,e.clientY)}else if(1!=p[4]||null!=x&&!x.pannable()){if(x&&x.pannable()&&x.active()&&x.unactivate(),x&&x.grabbed()||g==v||(v&&r(v,["mouseout","tapdragout"],e,{x:h[0],y:h[1]}),g&&r(g,["mouseover","tapdragover"],e,{x:h[0],y:h[1]}),t.hoverData.last=g),x)if(m){if(o.boxSelectionEnabled()&&C)x&&x.grabbed()&&(y(w),x.emit("freeon"),w.emit("free"),t.dragData.didDrag&&(x.emit("dragfreeon"),w.emit("dragfree"))),A();else if(x&&x.grabbed()&&t.nodeIsDraggable(x)){var R=!t.dragData.didDrag;R&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||f(w,{inDragLayer:!0});var D={x:0,y:0};if(jdt(b[0])&&jdt(b[1])&&(D.x+=b[0],D.y+=b[1],R)){var O=t.hoverData.dragDelta;O&&jdt(O[0])&&jdt(O[1])&&(D.x+=O[0],D.y+=O[1])}t.hoverData.draggingEles=!0,w.silentShift(D).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else S();n=!0}else if(m){if(t.hoverData.dragging||!o.boxSelectionEnabled()||!C&&o.panningEnabled()&&o.userPanningEnabled()){if(!t.hoverData.selecting&&o.panningEnabled()&&o.userPanningEnabled()){a(x,t.hoverData.downs)&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,p[4]=0,t.data.bgActivePosistion=yft(u),t.redrawHint("select",!0),t.redraw())}}else A();x&&x.pannable()&&x.active()&&x.unactivate()}return p[2]=h[0],p[3]=h[1],n?(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1):void 0}}),"mousemoveHandler"),!1),t.registerBinding(e,"mouseup",s((function(e){if((1!==t.hoverData.which||1===e.which||!t.hoverData.capture)&&t.hoverData.capture){t.hoverData.capture=!1;var a=t.cy,o=t.projectIntoViewport(e.clientX,e.clientY),l=t.selection,c=t.findNearestElement(o[0],o[1],!0,!1),h=t.dragData.possibleDragElements,u=t.hoverData.down,d=i(e);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,u&&u.unactivate(),3===t.hoverData.which){var p={originalEvent:e,type:"cxttapend",position:{x:o[0],y:o[1]}};if(u?u.emit(p):a.emit(p),!t.hoverData.cxtDragged){var g={originalEvent:e,type:"cxttap",position:{x:o[0],y:o[1]}};u?u.emit(g):a.emit(g)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(1===t.hoverData.which){if(r(c,["mouseup","tapend","vmouseup"],e,{x:o[0],y:o[1]}),t.dragData.didDrag||t.hoverData.dragged||t.hoverData.selecting||t.hoverData.isOverThresholdDrag||(r(u,["click","tap","vclick"],e,{x:o[0],y:o[1]}),C=!1,e.timeStamp-S<=a.multiClickDebounceTime()?(E&&clearTimeout(E),C=!0,S=null,r(u,["dblclick","dbltap","vdblclick"],e,{x:o[0],y:o[1]})):(E=setTimeout((function(){C||r(u,["oneclick","onetap","voneclick"],e,{x:o[0],y:o[1]})}),a.multiClickDebounceTime()),S=e.timeStamp)),null!=u||t.dragData.didDrag||t.hoverData.selecting||t.hoverData.dragged||i(e)||(a.$(n).unselect(["tapunselect"]),h.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=h=a.collection()),c!=u||t.dragData.didDrag||t.hoverData.selecting||null!=c&&c._private.selectable&&(t.hoverData.dragging||("additive"===a.selectionType()||d?c.selected()?c.unselect(["tapunselect"]):c.select(["tapselect"]):d||(a.$(n).unmerge(c).unselect(["tapunselect"]),c.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var f=a.collection(t.getAllInBox(l[0],l[1],l[2],l[3]));t.redrawHint("select",!0),f.length>0&&t.redrawHint("eles",!0),a.emit({type:"boxend",originalEvent:e,position:{x:o[0],y:o[1]}});var m=s((function(t){return t.selectable()&&!t.selected()}),"eleWouldBeSelected");"additive"===a.selectionType()||d||a.$(n).unmerge(f).unselect(),f.emit("box").stdFilter(m).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!l[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var v=u&&u.grabbed();y(h),v&&(u.emit("freeon"),h.emit("free"),t.dragData.didDrag&&(u.emit("dragfreeon"),h.emit("dragfree")))}}l[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}}),"mouseupHandler"),!1);var N,I,M,R,D,O,P,B,$,F,z,U,G,q=s((function(e){if(!t.scrollingPage){var n=t.cy,r=n.zoom(),i=n.pan(),a=t.projectIntoViewport(e.clientX,e.clientY),s=[a[0]*r+i.x,a[1]*r+i.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||A())e.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var o;e.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),o=null!=e.deltaY?e.deltaY/-250:null!=e.wheelDeltaY?e.wheelDeltaY/1e3:e.wheelDelta/1e3,o*=t.wheelSensitivity,1===e.deltaMode&&(o*=33);var l=n.zoom()*Math.pow(10,o);"gesturechange"===e.type&&(l=t.gestureStartZoom*e.scale),n.zoom({level:l,renderedPosition:{x:s[0],y:s[1]}}),n.emit("gesturechange"===e.type?"pinchzoom":"scrollzoom")}}}),"wheelHandler");t.registerBinding(t.container,"wheel",q,!0),t.registerBinding(e,"scroll",s((function(e){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout((function(){t.scrollingPage=!1}),250)}),"scrollHandler"),!0),t.registerBinding(t.container,"gesturestart",s((function(e){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||e.preventDefault()}),"gestureStartHandler"),!0),t.registerBinding(t.container,"gesturechange",(function(e){t.hasTouchStarted||q(e)}),!0),t.registerBinding(t.container,"mouseout",s((function(e){var n=t.projectIntoViewport(e.clientX,e.clientY);t.cy.emit({originalEvent:e,type:"mouseout",position:{x:n[0],y:n[1]}})}),"mouseOutHandler"),!1),t.registerBinding(t.container,"mouseover",s((function(e){var n=t.projectIntoViewport(e.clientX,e.clientY);t.cy.emit({originalEvent:e,type:"mouseover",position:{x:n[0],y:n[1]}})}),"mouseOverHandler"),!1);var j,Y,W,H,V,X,K,Z=s((function(t,e,n,r){return Math.sqrt((n-t)*(n-t)+(r-e)*(r-e))}),"distance"),Q=s((function(t,e,n,r){return(n-t)*(n-t)+(r-e)*(r-e)}),"distanceSq");if(t.registerBinding(t.container,"touchstart",j=s((function(e){if(t.hasTouchStarted=!0,L(e)){x(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var n=t.cy,i=t.touchData.now,a=t.touchData.earlier;if(e.touches[0]){var o=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(e.touches[1]){o=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(e.touches[2]){o=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);i[4]=o[0],i[5]=o[1]}if(e.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var l=t.findContainerClientCoords();$=l[0],F=l[1],z=l[2],U=l[3],N=e.touches[0].clientX-$,I=e.touches[0].clientY-F,M=e.touches[1].clientX-$,R=e.touches[1].clientY-F,G=0<=N&&N<=z&&0<=M&&M<=z&&0<=I&&I<=U&&0<=R&&R<=U;var c=n.pan(),h=n.zoom();D=Z(N,I,M,R),O=Q(N,I,M,R),B=[((P=[(N+M)/2,(I+R)/2])[0]-c.x)/h,(P[1]-c.y)/h];if(O<4e4&&!e.touches[2]){var d=t.findNearestElement(i[0],i[1],!0,!0),p=t.findNearestElement(i[2],i[3],!0,!0);return d&&d.isNode()?(d.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:i[0],y:i[1]}}),t.touchData.start=d):p&&p.isNode()?(p.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:i[0],y:i[1]}}),t.touchData.start=p):n.emit({originalEvent:e,type:"cxttapstart",position:{x:i[0],y:i[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,void t.redraw()}}if(e.touches[2])n.boxSelectionEnabled()&&e.preventDefault();else if(e.touches[1]);else if(e.touches[0]){var g=t.findNearestElements(i[0],i[1],!0,!0),v=g[0];if(null!=v&&(v.activate(),t.touchData.start=v,t.touchData.starts=g,t.nodeIsGrabbable(v))){var b=t.dragData.touchDragEles=n.collection(),w=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),v.selected()?(w=n.$((function(e){return e.selected()&&t.nodeIsGrabbable(e)})),f(w,{addToList:b})):m(v,{addToList:b}),u(v);var k=s((function(t){return{originalEvent:e,type:t,position:{x:i[0],y:i[1]}}}),"makeEvent");v.emit(k("grabon")),w?w.forEach((function(t){t.emit(k("grab"))})):v.emit(k("grab"))}r(v,["touchstart","tapstart","vmousedown"],e,{x:i[0],y:i[1]}),null==v&&(t.data.bgActivePosistion={x:o[0],y:o[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout((function(){!1!==t.touchData.singleTouchMoved||t.pinching||t.touchData.selecting||r(t.touchData.start,["taphold"],e,{x:i[0],y:i[1]})}),t.tapholdDuration)}if(e.touches.length>=1){for(var T=t.touchData.startPosition=[null,null,null,null,null,null],_=0;_=t.touchTapThreshold2}if(n&&t.touchData.cxt){e.preventDefault();var b=e.touches[0].clientX-$,w=e.touches[0].clientY-F,k=e.touches[1].clientX-$,T=e.touches[1].clientY-F,_=Q(b,w,k,T);if(_/O>=2.25||_>=22500){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var E={originalEvent:e,type:"cxttapend",position:{x:o[0],y:o[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(E),t.touchData.start=null):s.emit(E)}}if(n&&t.touchData.cxt){E={originalEvent:e,type:"cxtdrag",position:{x:o[0],y:o[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(E):s.emit(E),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var C=t.findNearestElement(o[0],o[1],!0,!0);t.touchData.cxtOver&&C===t.touchData.cxtOver||(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:o[0],y:o[1]}}),t.touchData.cxtOver=C,C&&C.emit({originalEvent:e,type:"cxtdragover",position:{x:o[0],y:o[1]}}))}else if(n&&e.touches[2]&&s.boxSelectionEnabled())e.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||s.emit({originalEvent:e,type:"boxstart",position:{x:o[0],y:o[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(o[0]+o[2]+o[4])/3,i[3]=(o[1]+o[3]+o[5])/3):(i[0]=(o[0]+o[2]+o[4])/3,i[1]=(o[1]+o[3]+o[5])/3,i[2]=(o[0]+o[2]+o[4])/3+1,i[3]=(o[1]+o[3]+o[5])/3+1),t.redrawHint("select",!0),t.redraw();else if(n&&e.touches[1]&&!t.touchData.didSelect&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){if(e.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),J=t.dragData.touchDragEles){t.redrawHint("drag",!0);for(var S=0;S0&&!t.hoverData.draggingEles&&!t.swipePanning&&null!=t.data.bgActivePosistion&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}}),"touchmoveHandler"),!1),t.registerBinding(e,"touchcancel",W=s((function(e){var n=t.touchData.start;t.touchData.capture=!1,n&&n.unactivate()}),"touchcancelHandler")),t.registerBinding(e,"touchend",H=s((function(e){var i=t.touchData.start;if(t.touchData.capture){0===e.touches.length&&(t.touchData.capture=!1),e.preventDefault();var a=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var o,l=t.cy,c=l.zoom(),h=t.touchData.now,u=t.touchData.earlier;if(e.touches[0]){var d=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);h[0]=d[0],h[1]=d[1]}if(e.touches[1]){d=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);h[2]=d[0],h[3]=d[1]}if(e.touches[2]){d=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);h[4]=d[0],h[5]=d[1]}if(i&&i.unactivate(),t.touchData.cxt){if(o={originalEvent:e,type:"cxttapend",position:{x:h[0],y:h[1]}},i?i.emit(o):l.emit(o),!t.touchData.cxtDragged){var p={originalEvent:e,type:"cxttap",position:{x:h[0],y:h[1]}};i?i.emit(p):l.emit(p)}return t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,void t.redraw()}if(!e.touches[2]&&l.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var g=l.collection(t.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,t.redrawHint("select",!0),l.emit({type:"boxend",originalEvent:e,position:{x:h[0],y:h[1]}});var f=s((function(t){return t.selectable()&&!t.selected()}),"eleWouldBeSelected");g.emit("box").stdFilter(f).select().emit("boxselect"),g.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(null!=i&&i.unactivate(),e.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(e.touches[1]);else if(e.touches[0]);else if(!e.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var m=t.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;y(m),t.redrawHint("drag",!0),t.redrawHint("eles",!0),v&&(i.emit("freeon"),m.emit("free"),t.dragData.didDrag&&(i.emit("dragfreeon"),m.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],e,{x:h[0],y:h[1]}),i.unactivate(),t.touchData.start=null}else{var x=t.findNearestElement(h[0],h[1],!0,!0);r(x,["touchend","tapend","vmouseup","tapdragout"],e,{x:h[0],y:h[1]})}var b=t.touchData.startPosition[0]-h[0],w=b*b,k=t.touchData.startPosition[1]-h[1],T=(w+k*k)*c*c;t.touchData.singleTouchMoved||(i||l.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],e,{x:h[0],y:h[1]}),V=!1,e.timeStamp-K<=l.multiClickDebounceTime()?(X&&clearTimeout(X),V=!0,K=null,r(i,["dbltap","vdblclick"],e,{x:h[0],y:h[1]})):(X=setTimeout((function(){V||r(i,["onetap","voneclick"],e,{x:h[0],y:h[1]})}),l.multiClickDebounceTime()),K=e.timeStamp)),null!=i&&!t.dragData.didDrag&&i._private.selectable&&T0)return p[0]}return null}),"getCurveT"),g=Object.keys(d),f=0;f0?c:Wft(i,a,t,e,n,r,s,o)}),"intersectLine"),checkPoint:s((function(t,e,n,r,i,a,s,o){var l=2*(o="auto"===o?fmt(r,i):o);if(tmt(t,e,this.points,a,s,r,i-l,[0,-1],n))return!0;if(tmt(t,e,this.points,a,s,r-l,i,[0,-1],n))return!0;var c=r/2+2*n,h=i/2+2*n;return!!Jft(t,e,[a-c,s-h,a-c,s,a+c,s,a+c,s-h])||(!!amt(t,e,l,l,a+r/2-o,s+i/2-o,n)||!!amt(t,e,l,l,a-r/2+o,s+i/2-o,n))}),"checkPoint")}},registerNodeShapes:function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",dmt(3,0)),this.generateRoundPolygon("round-triangle",dmt(3,0)),this.generatePolygon("rectangle",dmt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",dmt(5,0)),this.generateRoundPolygon("round-pentagon",dmt(5,0)),this.generatePolygon("hexagon",dmt(6,0)),this.generateRoundPolygon("round-hexagon",dmt(6,0)),this.generatePolygon("heptagon",dmt(7,0)),this.generateRoundPolygon("round-heptagon",dmt(7,0)),this.generatePolygon("octagon",dmt(8,0)),this.generateRoundPolygon("round-octagon",dmt(8,0));var r=new Array(20),i=gmt(5,0),a=gmt(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=t.deqFastCost*f)break}else if(i){if(p>=t.deqCost*l||p>=t.deqAvgCost*o)break}else if(g>=16.666666666666668*t.deqNoDrawCost)break;var m=t.deq(e,u,h);if(!(m.length>0))break;for(var y=0;y0&&(t.onDeqd(e,c),!i&&t.shouldRedraw(e,c,u,h)&&r())}),"dequeue"),a=t.priority||Igt;n.beforeRender(i,a(e))}}),"setupDequeueingImpl")}),"setupDequeueing")},aEt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lgt;wdt(this,t),this.idsByKey=new Hgt,this.keyForId=new Hgt,this.cachesByLvl=new Hgt,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=n}return s(t,"ElementTextureCacheLookup"),Tdt(t,[{key:"getIdsFor",value:s((function(t){null==t&&Mgt("Can not get id list for null key");var e=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new Xgt,e.set(t,n)),n}),"getIdsFor")},{key:"addIdForKey",value:s((function(t,e){null!=t&&this.getIdsFor(t).add(e)}),"addIdForKey")},{key:"deleteIdForKey",value:s((function(t,e){null!=t&&this.getIdsFor(t).delete(e)}),"deleteIdForKey")},{key:"getNumberOfIdsForKey",value:s((function(t){return null==t?0:this.getIdsFor(t).size}),"getNumberOfIdsForKey")},{key:"updateKeyMappingFor",value:s((function(t){var e=t.id(),n=this.keyForId.get(e),r=this.getKey(t);this.deleteIdForKey(n,e),this.addIdForKey(r,e),this.keyForId.set(e,r)}),"updateKeyMappingFor")},{key:"deleteKeyMappingFor",value:s((function(t){var e=t.id(),n=this.keyForId.get(e);this.deleteIdForKey(n,e),this.keyForId.delete(e)}),"deleteKeyMappingFor")},{key:"keyHasChangedFor",value:s((function(t){var e=t.id();return this.keyForId.get(e)!==this.getKey(t)}),"keyHasChangedFor")},{key:"isInvalid",value:s((function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}),"isInvalid")},{key:"getCachesAt",value:s((function(t){var e=this.cachesByLvl,n=this.lvls,r=e.get(t);return r||(r=new Hgt,e.set(t,r),n.push(t)),r}),"getCachesAt")},{key:"getCache",value:s((function(t,e){return this.getCachesAt(e).get(t)}),"getCache")},{key:"get",value:s((function(t,e){var n=this.getKey(t),r=this.getCache(n,e);return null!=r&&this.updateKeyMappingFor(t),r}),"get")},{key:"getForCachedKey",value:s((function(t,e){var n=this.keyForId.get(t.id());return this.getCache(n,e)}),"getForCachedKey")},{key:"hasCache",value:s((function(t,e){return this.getCachesAt(e).has(t)}),"hasCache")},{key:"has",value:s((function(t,e){var n=this.getKey(t);return this.hasCache(n,e)}),"has")},{key:"setCache",value:s((function(t,e,n){n.key=t,this.getCachesAt(e).set(t,n)}),"setCache")},{key:"set",value:s((function(t,e,n){var r=this.getKey(t);this.setCache(r,e,n),this.updateKeyMappingFor(t)}),"set")},{key:"deleteCache",value:s((function(t,e){this.getCachesAt(e).delete(t)}),"deleteCache")},{key:"delete",value:s((function(t,e){var n=this.getKey(t);this.deleteCache(n,e)}),"_delete")},{key:"invalidateKey",value:s((function(t){var e=this;this.lvls.forEach((function(n){return e.deleteCache(t,n)}))}),"invalidateKey")},{key:"invalidate",value:s((function(t){var e=t.id(),n=this.keyForId.get(e);this.deleteKeyMappingFor(t);var r=this.doesEleInvalidateKey(t);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}),"invalidate")}]),t}(),sEt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},oEt=Ugt({getKey:null,doesEleInvalidateKey:Lgt,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Agt,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),lEt=s((function(t,e){var n=this;n.renderer=t,n.onDequeues=[];var r=oEt(e);dpt(n,r),n.lookup=new aEt(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()}),"ElementTextureCache"),cEt=lEt.prototype;cEt.reasons=sEt,cEt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},cEt.getRetiredTextureQueue=function(t){var e=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return e[t]=e[t]||[]},cEt.getElementQueue=function(){var t=this.eleCacheQueue=this.eleCacheQueue||new tft((function(t,e){return e.reqs-t.reqs}));return t},cEt.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},cEt.getElement=function(t,e,n,r,i){var a=this,o=this.renderer,l=o.cy.zoom(),c=this.lookup;if(!e||0===e.w||0===e.h||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed())return null;if(!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(null==r&&(r=Math.ceil(_ft(l*n))),r<-4)r=-4;else if(l>=7.99||r>3)return null;var h=Math.pow(2,r),u=e.h*h,d=e.w*h,p=o.eleTextBiggerThanMin(t,h);if(!this.isVisible(t,p))return null;var g,f=c.get(t,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(g=u<=25?25:u<=50?50:50*Math.ceil(u/50),u>1024||d>1024)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=s((function(){return a.recycleTexture(g,d)||a.addTexture(g,d)}),"addNewTxr");y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthr;A--)C=a.getElement(t,e,n,A,sEt.downscale);S()}else{var L;if(!w&&!k&&!T)for(var N=r-1;N>=-4;N--){var I=c.get(t,N);if(I){L=I;break}}if(b(L))return a.queueElement(t,r),L;y.context.translate(y.usedWidth,0),y.context.scale(h,h),this.drawElement(y.context,t,e,p,!1),y.context.scale(1/h,1/h),y.context.translate(-y.usedWidth,0)}return f={x:y.usedWidth,texture:y,level:r,scale:h,width:d,height:u,scaledLabelShown:p},y.usedWidth+=Math.ceil(d+8),y.eleCaches.push(f),c.set(t,r,f),a.checkTextureFullness(y),f},cEt.invalidateElements=function(t){for(var e=0;e=.2*t.width&&this.retireTexture(t)},cEt.checkTextureFullness=function(t){var e=this.getTextureQueue(t.height);t.usedWidth/t.width>.8&&t.fullnessChecks>=10?Ggt(e,t):t.fullnessChecks++},cEt.retireTexture=function(t){var e=t.height,n=this.getTextureQueue(e),r=this.lookup;Ggt(n,t),t.retired=!0;for(var i=t.eleCaches,a=0;a=e)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,qgt(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),Ggt(r,a),n.push(a),a}},cEt.queueElement=function(t,e){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(t),a=r[i];if(a)a.level=Math.max(a.level,e),a.eles.merge(t),a.reqs++,n.updateItem(a);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(s),r[i]=s}},cEt.dequeue=function(t){for(var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<1&&n.size()>0;s++){var o=n.pop(),l=o.key,c=o.eles[0],h=a.hasCache(c,o.level);if(r[l]=null,!h){i.push(o);var u=e.getBoundingBox(c);e.getElement(c,u,t,o.level,sEt.dequeue)}}return i},cEt.removeFromQueue=function(t){var e=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(t),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Sgt,e.updateItem(i),e.pop(),n[r]=null):i.eles.unmerge(t))},cEt.onDequeue=function(t){this.onDequeues.push(t)},cEt.offDequeue=function(t){Ggt(this.onDequeues,t)},cEt.setupDequeueing=iEt.setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:s((function(t,e,n){return t.dequeue(e,n)}),"deq"),onDeqd:s((function(t,e){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,t);var o,l,c=r.layersByLevel,h=Math.pow(2,n),u=c[n]=c[n]||[],d=r.levelIsComplete(n,t),p=s((function(){var e=s((function(e){if(r.validateLayersElesOrdering(e,t),r.levelIsComplete(e,t))return l=c[e],!0}),"canUseAsTmpLvl"),i=s((function(t){if(!l)for(var r=n+t;-4<=r&&r<=2&&!e(r);r+=t);}),"checkLvls");i(1),i(-1);for(var a=u.length-1;a>=0;a--){var o=u[a];o.invalid&&Ggt(u,o)}}),"checkTempLevels");if(d)return u;p();var g=s((function(){if(!o){o=Rft();for(var e=0;e16e6)return null;var i=r.makeLayer(o,n);if(null!=e){var a=u.indexOf(e)+1;u.splice(a,0,i)}else(void 0===t.insert||t.insert)&&u.unshift(i);return i}),"makeLayer");if(r.skipping&&!a)return null;for(var m=null,y=t.length/1,v=!a,x=0;x=y||!Yft(m.bb,b.boundingBox()))&&!(m=f({insert:!0,after:m})))return null;l||v?r.queueLayer(m,b):r.drawEleInLayer(m,b,n,e),m.eles.push(b),k[n]=m}}return l||(v?null:u)},uEt.getEleLevelForLayerLevel=function(t,e){return t},uEt.drawEleInLayer=function(t,e,n,r){var i=this.renderer,a=t.context,s=e.boundingBox();0!==s.w&&0!==s.h&&e.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,e,null,null,n,true),i.setImgSmoothing(a,!0))},uEt.levelIsComplete=function(t,e){var n=this.layersByLevel[t];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(a.invalid)return!1;r+=a.eles.length}return r===e.length},uEt.validateLayersElesOrdering=function(t,e){var n=this.layersByLevel[t];if(n)for(var r=0;r0){t=!0;break}}return t},uEt.invalidateElements=function(t){var e=this;0!==t.length&&(e.lastInvalidationTime=dgt(),0!==t.length&&e.haveLayers()&&e.updateElementsInLayers(t,s((function(t,n,r){e.invalidateLayer(t)}),"invalAssocLayers")))},uEt.invalidateLayer=function(t){if(this.lastInvalidationTime=dgt(),!t.invalid){var e=t.level,n=t.eles,r=this.layersByLevel[e];Ggt(r,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this,l=e._private.rscratch;if((!a||e.visible())&&!l.badLine&&null!=l.allpts&&!isNaN(l.allpts[0])){var c;n&&(c=n,t.translate(-c.x1,-c.y1));var h=a?e.pstyle("opacity").value:1,u=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,f=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=h*u,x=h*u,b=s((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(o.eleStrokeStyle(t,e,n),o.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=g,t.lineCap=f,o.eleStrokeStyle(t,e,n),o.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")}),"drawLine"),w=s((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;t.lineWidth=g+m,t.lineCap=f,m>0?(o.colorStrokeStyle(t,y[0],y[1],y[2],n),"straight-triangle"===d?o.drawEdgeTrianglePath(e,t,l.allpts):(o.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")):t.lineCap="butt"}),"drawLineOutline"),k=s((function(){i&&o.drawEdgeOverlay(t,e)}),"drawOverlay"),T=s((function(){i&&o.drawEdgeUnderlay(t,e)}),"drawUnderlay"),_=s((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;o.drawArrowheads(t,e,n)}),"drawArrows"),E=s((function(){o.drawElementText(t,e,null,r)}),"drawText");t.lineJoin="round";var C="yes"===e.pstyle("ghost").value;if(C){var S=e.pstyle("ghost-offset-x").pfValue,A=e.pstyle("ghost-offset-y").pfValue,L=e.pstyle("ghost-opacity").value,N=v*L;t.translate(S,A),b(N),_(N),t.translate(-S,-A)}else w();T(),b(),_(),k(),E(),n&&t.translate(c.x1,c.y1)}}},LEt=s((function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(e,n){if(n.visible()){var r=n.pstyle("".concat(t,"-opacity")).value;if(0!==r){var i=this,a=i.usePaths(),s=n._private.rscratch,o=2*n.pstyle("".concat(t,"-padding")).pfValue,l=n.pstyle("".concat(t,"-color")).value;e.lineWidth=o,"self"!==s.edgeType||a?e.lineCap="round":e.lineCap="butt",i.colorStrokeStyle(e,l[0],l[1],l[2],r),i.drawEdgePath(n,e,s.allpts,"solid")}}}}),"drawEdgeOverlayUnderlay");AEt.drawEdgeOverlay=LEt("overlay"),AEt.drawEdgeUnderlay=LEt("underlay"),AEt.drawEdgePath=function(t,e,n,r){var i,a=t._private.rscratch,s=e,o=!1,l=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var u=n.join("$");a.pathCacheKey&&a.pathCacheKey===u?(i=e=a.pathCache,o=!0):(i=e=new Path2D,a.pathCacheKey=u,a.pathCache=i)}if(s.setLineDash)switch(r){case"dotted":s.setLineDash([1,1]);break;case"dashed":s.setLineDash(c),s.lineDashOffset=h;break;case"solid":s.setLineDash([])}if(!o&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+35&&void 0!==arguments[5]?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+a,n),t.lineTo(e+r-a,n),t.quadraticCurveTo(e+r,n,e+r,n+a),t.lineTo(e+r,n+i-a),t.quadraticCurveTo(e+r,n+i,e+r-a,n+i),t.lineTo(e+a,n+i),t.quadraticCurveTo(e,n+i,e,n+i-a),t.lineTo(e,n+a),t.quadraticCurveTo(e,n,e+a,n),t.closePath(),s?t.stroke():t.fill()}IEt.eleTextBiggerThanMin=function(t,e){if(!e){var n=t.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(_ft(n*r));e=Math.pow(2,i)}return!(t.pstyle("font-size").pfValue*e5&&void 0!==arguments[5])||arguments[5],s=this;if(null==r){if(a&&!s.eleTextBiggerThanMin(e))return}else if(!1===r)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,h=e.pstyle("label"),u=e.pstyle("source-label"),d=e.pstyle("target-label");if(c||(!h||!h.value)&&(!u||!u.value)&&(!d||!d.value))return;t.textAlign="center",t.textBaseline="bottom"}var p,g=!n;n&&(p=n,t.translate(-p.x1,-p.y1)),null==i?(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),n&&t.translate(p.x1,p.y1)},IEt.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=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=n?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=r+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)},s(MEt,"roundRect"),IEt.getTextAngle=function(t,e){var n=t._private.rscratch,r=e?e+"-":"",i=t.pstyle(r+"text-rotation"),a=Ygt(n,"labelAngle",e);return"autorotate"===i.strValue?t.isEdge()?a:0:"none"===i.strValue?0:i.pfValue},IEt.drawText=function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!i||0!==o&&0!==e.pstyle("text-opacity").value){"main"===n&&(n=null);var l,c,h=Ygt(s,"labelX",n),u=Ygt(s,"labelY",n),d=this.getLabelText(e,n);if(null!=d&&""!==d&&!isNaN(h)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p,g=n?n+"-":"",f=Ygt(s,"labelWidth",n),m=Ygt(s,"labelHeight",n),y=e.pstyle(g+"text-margin-x").pfValue,v=e.pstyle(g+"text-margin-y").pfValue,x=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;switch(x&&(b="center",w="center"),h+=y,u+=v,0!==(p=r?this.getTextAngle(e,n):0)&&(l=h,c=u,t.translate(l,c),t.rotate(p),h=0,u=0),w){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m}var k=e.pstyle("text-background-opacity").value,T=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,E=e.pstyle("text-background-padding").pfValue,C=e.pstyle("text-background-shape").strValue,S=0===C.indexOf("round"),A=2;if(k>0||_>0&&T>0){var L=h-E;switch(b){case"left":L-=f;break;case"center":L-=f/2}var N=u-m-E,I=f+2*E,M=m+2*E;if(k>0){var R=t.fillStyle,D=e.pstyle("text-background-color").value;t.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+k*o+")",S?MEt(t,L,N,I,M,A):t.fillRect(L,N,I,M),t.fillStyle=R}if(_>0&&T>0){var O=t.strokeStyle,P=t.lineWidth,B=e.pstyle("text-border-color").value,$=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+T*o+")",t.lineWidth=_,t.setLineDash)switch($){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":t.setLineDash([])}if(S?MEt(t,L,N,I,M,A,"stroke"):t.strokeRect(L,N,I,M),"double"===$){var F=_/2;S?MEt(t,L+F,N+F,I-2*F,M-2*F,A,"stroke"):t.strokeRect(L+F,N+F,I-2*F,M-2*F)}t.setLineDash&&t.setLineDash([]),t.lineWidth=P,t.strokeStyle=O}}var z=2*e.pstyle("text-outline-width").pfValue;if(z>0&&(t.lineWidth=z),"wrap"===e.pstyle("text-wrap").value){var U=Ygt(s,"labelWrapCachedLines",n),G=Ygt(s,"labelLineHeight",n),q=f/2,j=this.getLabelJustification(e);switch("auto"===j||("left"===b?"left"===j?h+=-f:"center"===j&&(h+=-q):"center"===b?"left"===j?h+=-q:"right"===j&&(h+=q):"right"===b&&("center"===j?h+=q:"right"===j&&(h+=f))),w){case"top":case"center":case"bottom":u-=(U.length-1)*G}for(var Y=0;Y0&&t.strokeText(U[Y],h,u),t.fillText(U[Y],h,u),u+=G}else z>0&&t.strokeText(d,h,u),t.fillText(d,h,u);0!==p&&(t.rotate(-p),t.translate(-l,-c))}}};var REt={drawNode:function(t,e,n){var r,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],l=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],c=this,h=e._private,u=h.rscratch,d=e.position();if(jdt(d.x)&&jdt(d.y)&&(!l||e.visible())){var p,g,f=l?e.effectiveOpacity():1,m=c.usePaths(),y=!1,v=e.padding();r=e.width()+2*v,i=e.height()+2*v,n&&(g=n,t.translate(-g.x1,-g.y1));for(var x=e.pstyle("background-image"),b=x.value,w=new Array(b.length),k=new Array(b.length),T=0,_=0;_0&&void 0!==arguments[0]?arguments[0]:N;c.eleFillStyle(t,e,n)}),"setupShapeColor"),W=s((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$;c.colorStrokeStyle(t,I[0],I[1],I[2],e)}),"setupBorderColor"),H=s((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G;c.colorStrokeStyle(t,z[0],z[1],z[2],e)}),"setupOutlineColor"),V=s((function(t,e,n,r){var i,a=c.nodePathCache=c.nodePathCache||[],s=kgt("polygon"===n?n+","+r.join(","):n,""+e,""+t,""+j),o=a[s],l=!1;return null!=o?(i=o,l=!0,u.pathCache=i):(i=new Path2D,a[s]=u.pathCache=i),{path:i,cacheHit:l}}),"getPath"),X=e.pstyle("shape").strValue,K=e.pstyle("shape-polygon-points").pfValue;if(m){t.translate(d.x,d.y);var Z=V(r,i,X,K);p=Z.path,y=Z.cacheHit}var Q=s((function(){if(!y){var n=d;m&&(n={x:0,y:0}),c.nodeShapes[c.getNodeShape(e)].draw(p||t,n.x,n.y,r,i,j,u)}m?t.fill(p):t.fill()}),"drawShape"),J=s((function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=h.backgrounding,a=0,s=0;s0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;c.hasPie(e)&&(c.drawPie(t,e,a),n&&(m||c.nodeShapes[c.getNodeShape(e)].draw(t,d.x,d.y,r,i,j,u)))}),"drawPie"),et=s((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,n=(A>0?A:-A)*e,r=A>0?0:255;0!==A&&(c.colorFillStyle(t,r,r,r,n),m?t.fill(p):t.fill())}),"darken"),nt=s((function(){if(L>0){if(t.lineWidth=L,t.lineCap=D,t.lineJoin=R,t.setLineDash)switch(M){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(P),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([])}if("center"!==O){if(t.save(),t.lineWidth*=2,"inside"===O)m?t.clip(p):t.clip();else{var e=new Path2D;e.rect(-r/2-L,-i/2-L,r+2*L,i+2*L),e.addPath(p),t.clip(e,"evenodd")}m?t.stroke(p):t.stroke(),t.restore()}else m?t.stroke(p):t.stroke();if("double"===M){t.lineWidth=L/3;var n=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(p):t.stroke(),t.globalCompositeOperation=n}t.setLineDash&&t.setLineDash([])}}),"drawBorder"),rt=s((function(){if(F>0){if(t.lineWidth=F,t.lineCap="butt",t.setLineDash)switch(U){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([])}var n=d;m&&(n={x:0,y:0});var a=c.getNodeShape(e),s=L;"inside"===O&&(s=0),"outside"===O&&(s*=2);var o,l=(r+s+(F+q))/r,h=(i+s+(F+q))/i,u=r*l,p=i*h,g=c.nodeShapes[a].points;if(m)o=V(u,p,a,g).path;if("ellipse"===a)c.drawEllipsePath(o||t,n.x,n.y,u,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(a)){var f=0,y=0,v=0;"round-diamond"===a?f=1.4*(s+q+F):"round-heptagon"===a?(f=1.075*(s+q+F),v=-(s/2+q+F)/35):"round-hexagon"===a?f=1.12*(s+q+F):"round-pentagon"===a?(f=1.13*(s+q+F),v=-(s/2+q+F)/15):"round-tag"===a?(f=1.12*(s+q+F),y=.07*(s/2+F+q)):"round-triangle"===a&&(f=(s+q+F)*(Math.PI/2),v=-(s+q/2+F)/Math.PI),0!==f&&(u=r*(l=(r+f)/r),["round-hexagon","round-tag"].includes(a)||(p=i*(h=(i+f)/i)));for(var x=u/2,b=p/2,w=(j="auto"===j?mmt(u,p):j)+(s+F+q)/2,k=new Array(g.length/2),T=new Array(g.length/2),_=0;_0){if(r=r||n.position(),null==i||null==a){var u=n.padding();i=n.width()+2*u,a=n.height()+2*u}this.colorFillStyle(e,l[0],l[1],l[2],o),this.nodeShapes[c].draw(e,r.x,r.y,i+2*s,a+2*s,h),e.fill()}}}}),"drawNodeOverlayUnderlay");REt.drawNodeOverlay=DEt("overlay"),REt.drawNodeUnderlay=DEt("underlay"),REt.hasPie=function(t){return(t=t[0])._private.hasPie},REt.drawPie=function(t,e,n,r){e=e[0],r=r||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=r.x,o=r.y,l=e.width(),c=e.height(),h=Math.min(l,c)/2,u=0;this.usePaths()&&(s=0,o=0),"%"===a.units?h*=a.pfValue:void 0!==a.pfValue&&(h=a.pfValue/2);for(var d=1;d<=i.pieBackgroundN;d++){var p=e.pstyle("pie-"+d+"-background-size").value,g=e.pstyle("pie-"+d+"-background-color").value,f=e.pstyle("pie-"+d+"-background-opacity").value*n,m=p/100;m+u>1&&(m=1-u);var y=1.5*Math.PI+2*Math.PI*u,v=y+2*Math.PI*m;0===p||u>=1||u+m>1||(t.beginPath(),t.moveTo(s,o),t.arc(s,o,h,y,v),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],f),t.fill(),u+=m)}};var OEt={};OEt.getPixelRatio=function(){var t=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var e=this.cy.window(),n=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/n},OEt.paintCache=function(t){for(var e,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;io.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!d&&(u[o.NODE]=!0,u[o.SELECT_BOX]=!0);var x=c.style(),b=c.zoom(),w=void 0!==i?i:b,k=c.pan(),T={x:k.x,y:k.y},_={zoom:b,pan:{x:k.x,y:k.y}},E=o.prevViewport;void 0===E||_.zoom!==E.zoom||_.pan.x!==E.pan.x||_.pan.y!==E.pan.y||m&&!f||(o.motionBlurPxRatio=1),a&&(T=a),w*=l,T.x*=l,T.y*=l;var C=o.getCachedZSortedEles();function S(t,e,n,r,i){var a=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,o.motionBlurTransparency),t.fillRect(e,n,r,i),t.globalCompositeOperation=a}function A(t,r){var s,l,c,u;o.clearingMotionBlur||t!==h.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]&&t!==h.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]?(s=T,l=w,c=o.canvasWidth,u=o.canvasHeight):(s={x:k.x*g,y:k.y*g},l=b*g,c=o.canvasWidth*g,u=o.canvasHeight*g),t.setTransform(1,0,0,1,0,0),"motionBlur"===r?S(t,0,0,c,u):e||void 0!==r&&!r||t.clearRect(0,0,c,u),n||(t.translate(s.x,s.y),t.scale(l,l)),a&&t.translate(a.x,a.y),i&&t.scale(i,i)}if(s(S,"mbclear"),s(A,"setContextTransform"),d||(o.textureDrawLastFrame=!1),d){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=c.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var L=o.data.bufferContexts[o.TEXTURE_BUFFER];L.setTransform(1,0,0,1,0,0),L.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:L,drawOnlyNodeLayer:!0,forcedPxRatio:l*o.textureMult}),(_=o.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:o.canvasWidth,height:o.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}u[o.DRAG]=!1,u[o.NODE]=!1;var N=h.contexts[o.NODE],I=o.textureCache.texture;_=o.textureCache.viewport;N.setTransform(1,0,0,1,0,0),p?S(N,0,0,_.width,_.height):N.clearRect(0,0,_.width,_.height);var M=x.core("outside-texture-bg-color").value,R=x.core("outside-texture-bg-opacity").value;o.colorFillStyle(N,M[0],M[1],M[2],R),N.fillRect(0,0,_.width,_.height);b=c.zoom();A(N,!1),N.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l),N.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l)}else o.textureOnViewport&&!e&&(o.textureCache=null);var D=c.extent(),O=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),P=o.hideEdgesOnViewport&&O,B=[];if(B[o.NODE]=!u[o.NODE]&&p&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,B[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),B[o.DRAG]=!u[o.DRAG]&&p&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,B[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),u[o.NODE]||n||r||B[o.NODE]){var $=p&&!B[o.NODE]&&1!==g;A(N=e||($?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:h.contexts[o.NODE]),p&&!$?"motionBlur":void 0),P?o.drawCachedNodes(N,C.nondrag,l,D):o.drawLayeredElements(N,C.nondrag,l,D),o.debug&&o.drawDebugPoints(N,C.nondrag),n||p||(u[o.NODE]=!1)}if(!r&&(u[o.DRAG]||n||B[o.DRAG])){$=p&&!B[o.DRAG]&&1!==g;A(N=e||($?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:h.contexts[o.DRAG]),p&&!$?"motionBlur":void 0),P?o.drawCachedNodes(N,C.drag,l,D):o.drawCachedElements(N,C.drag,l,D),o.debug&&o.drawDebugPoints(N,C.drag),n||p||(u[o.DRAG]=!1)}if(o.showFps||!r&&u[o.SELECT_BOX]&&!n){if(A(N=e||h.contexts[o.SELECT_BOX]),1==o.selection[4]&&(o.hoverData.selecting||o.touchData.selecting)){b=o.cy.zoom();var F=x.core("selection-box-border-width").value/b;N.lineWidth=F,N.fillStyle="rgba("+x.core("selection-box-color").value[0]+","+x.core("selection-box-color").value[1]+","+x.core("selection-box-color").value[2]+","+x.core("selection-box-opacity").value+")",N.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),F>0&&(N.strokeStyle="rgba("+x.core("selection-box-border-color").value[0]+","+x.core("selection-box-border-color").value[1]+","+x.core("selection-box-border-color").value[2]+","+x.core("selection-box-opacity").value+")",N.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(h.bgActivePosistion&&!o.hoverData.selecting){b=o.cy.zoom();var z=h.bgActivePosistion;N.fillStyle="rgba("+x.core("active-bg-color").value[0]+","+x.core("active-bg-color").value[1]+","+x.core("active-bg-color").value[2]+","+x.core("active-bg-opacity").value+")",N.beginPath(),N.arc(z.x,z.y,x.core("active-bg-size").pfValue/b,0,2*Math.PI),N.fill()}var U=o.lastRedrawTime;if(o.showFps&&U){U=Math.round(U);var G=Math.round(1e3/U);N.setTransform(1,0,0,1,0,0),N.fillStyle="rgba(255, 0, 0, 0.75)",N.strokeStyle="rgba(255, 0, 0, 0.75)",N.lineWidth=1,N.fillText("1 frame = "+U+" ms = "+G+" fps",0,20);N.strokeRect(0,30,250,20),N.fillRect(0,30,250*Math.min(G/60,1),20)}n||(u[o.SELECT_BOX]=!1)}if(p&&1!==g){var q=h.contexts[o.NODE],j=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],Y=h.contexts[o.DRAG],W=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],H=s((function(t,e,n){t.setTransform(1,0,0,1,0,0),n||!v?t.clearRect(0,0,o.canvasWidth,o.canvasHeight):S(t,0,0,o.canvasWidth,o.canvasHeight);var r=g;t.drawImage(e,0,0,o.canvasWidth*r,o.canvasHeight*r,0,0,o.canvasWidth,o.canvasHeight)}),"drawMotionBlur");(u[o.NODE]||B[o.NODE])&&(H(q,j,B[o.NODE]),u[o.NODE]=!1),(u[o.DRAG]||B[o.DRAG])&&(H(Y,W,B[o.DRAG]),u[o.DRAG]=!1)}o.prevViewport=_,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),p&&(o.motionBlurTimeout=setTimeout((function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!d,o.mbFrames=0,u[o.NODE]=!0,u[o.DRAG]=!0,o.redraw()}),100)),e||c.emit("render")};var PEt,BEt={drawPolygonPath:function(t,e,n,r,i,a){var s=r/2,o=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*a[0],n+o*a[1]);for(var l=1;l0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)d.translate(-n.x1*l,-n.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(n.x1*l,n.y1*l);else{var g=e.pan(),f={x:g.x*l,y:g.y*l};l*=e.zoom(),d.translate(f.x,f.y),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(-f.x,-f.y)}t.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=t.bg,d.rect(0,0,i,a),d.fill())}return u},s(jEt,"b64ToBlob"),s(YEt,"b64UriToB64"),s(WEt,"output"),qEt.png=function(t){return WEt(t,this.bufferCanvasImage(t),"image/png")},qEt.jpg=function(t){return WEt(t,this.bufferCanvasImage(t),"image/jpeg")};var HEt={nodeShapeImpl:function(t,e,n,r,i,a,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,n,r,i,a);case"polygon":return this.drawPolygonPath(e,n,r,i,a,s);case"round-polygon":return this.drawRoundPolygonPath(e,n,r,i,a,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,n,r,i,a,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,n,r,i,a,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,n,r,i,a,o);case"barrel":return this.drawBarrelPath(e,n,r,i,a)}}},VEt=KEt,XEt=KEt.prototype;function KEt(t){var e=this,n=e.cy.window().document;e.data={canvases:new Array(XEt.CANVAS_LAYERS),contexts:new Array(XEt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(XEt.CANVAS_LAYERS),bufferCanvases:new Array(XEt.BUFFER_COUNT),bufferContexts:new Array(XEt.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var a=e.data.canvasContainer.style;e.data.canvasContainer.style[r]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[r]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};rpt()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var c=0;ce&&(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-n)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(t){var e=this.rect.x;e>o.WORLD_BOUNDARY?e=o.WORLD_BOUNDARY:e<-o.WORLD_BOUNDARY&&(e=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(e,n),i=t.inverseTransformPoint(r);this.setLocation(i.x,i.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=h},function(t,e,n){function r(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}s(r,"PointD"),r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=r},function(t,e,n){var r=n(2),i=n(10),a=n(0),o=n(6),l=n(3),c=n(1),h=n(13),u=n(12),d=n(11);function p(t,e,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof o?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var g in s(p,"LGraph"),p.prototype=Object.create(r.prototype),r)p[g]=r[g];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(t,e,n){if(null==e&&null==n){var r=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(e.owner!=n.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=n.owner?null:(i.source=e,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),n!=e&&n.edges.push(i),i)},p.prototype.remove=function(t){var e=t;if(t instanceof l){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=e.edges.slice(),r=n.length,i=0;i-1&&h>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(o,1),a.target!=a.source&&a.target.edges.splice(h,1),-1==(s=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(s,1)}},p.prototype.updateLeftTop=function(){for(var t,e,n,r=i.MAX_VALUE,a=i.MAX_VALUE,s=this.getNodes(),o=s.length,l=0;l(t=c.getTop())&&(r=t),a>(e=c.getLeft())&&(a=e)}return r==i.MAX_VALUE?null:(n=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},p.prototype.updateBounds=function(t){for(var e,n,r,a,s,o=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,u=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;g(e=f.getLeft())&&(o=e),l<(n=f.getRight())&&(l=n),c>(r=f.getTop())&&(c=r),u<(a=f.getBottom())&&(u=a)}var m=new h(o,c,l-o,u-c);o==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-s,this.right=m.x+m.width+s,this.top=m.y-s,this.bottom=m.y+m.height+s},p.calculateBounds=function(t){for(var e,n,r,a,s=i.MAX_VALUE,o=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,u=t.length,d=0;d(e=p.getLeft())&&(s=e),o<(n=p.getRight())&&(o=n),l>(r=p.getTop())&&(l=r),c<(a=p.getBottom())&&(c=a)}return new h(s,l,o-s,c-l)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,n=e.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(e){e.owner==t&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=p},function(t,e,n){var r,i=n(1);function a(t){r=n(5),this.layout=t,this.graphs=[],this.edges=[]}s(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),n=this.add(t,e);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(t,e,n,r,i){if(null==n&&null==r&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=n,n=t;var a=(r=e).getOwner(),s=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==s)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(t){if(t instanceof r){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],s=(a=a.concat(e.getEdges())).length,o=0;o=e.getRight()?n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var a=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(a=1);var s=a*n[0],o=n[1]/a;n[0]s)return n[0]=r,n[1]=l,n[2]=a,n[3]=x,!1;if(ia)return n[0]=o,n[1]=i,n[2]=y,n[3]=s,!1;if(ra?(n[0]=h,n[1]=u,T=!0):(n[0]=c,n[1]=l,T=!0):E===S&&(r>a?(n[0]=o,n[1]=l,T=!0):(n[0]=d,n[1]=u,T=!0)),-C===S?a>r?(n[2]=v,n[3]=x,_=!0):(n[2]=y,n[3]=m,_=!0):C===S&&(a>r?(n[2]=f,n[3]=m,_=!0):(n[2]=b,n[3]=x,_=!0)),T&&_)return!1;if(r>a?i>s?(A=this.getCardinalDirection(E,S,4),L=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-E,S,3),L=this.getCardinalDirection(-C,S,1)):i>s?(A=this.getCardinalDirection(-E,S,1),L=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(E,S,2),L=this.getCardinalDirection(C,S,4)),!T)switch(A){case 1:I=l,N=r+-g/S,n[0]=N,n[1]=I;break;case 2:N=d,I=i+p*S,n[0]=N,n[1]=I;break;case 3:I=u,N=r+g/S,n[0]=N,n[1]=I;break;case 4:N=h,I=i+-p*S,n[0]=N,n[1]=I}if(!_)switch(L){case 1:R=m,M=a+-k/S,n[2]=M,n[3]=R;break;case 2:M=b,R=s+w*S,n[2]=M,n[3]=R;break;case 3:R=x,M=a+k/S,n[2]=M,n[3]=R;break;case 4:M=v,R=s+-w*S,n[2]=M,n[3]=R}}return!1},i.getCardinalDirection=function(t,e,n){return t>e?n:1+n%4},i.getIntersection=function(t,e,n,i){if(null==i)return this.getIntersection2(t,e,n);var a,s,o,l,c,h,u,d=t.x,p=t.y,g=e.x,f=e.y,m=n.x,y=n.y,v=i.x,x=i.y;return 0===(u=(a=f-p)*(l=m-v)-(s=x-y)*(o=d-g))?null:new r((o*(h=v*y-m*x)-l*(c=g*p-d*f))/u,(s*c-a*h)/u)},i.angleOfVector=function(t,e,n,r){var i=void 0;return t!==n?(i=Math.atan((r-e)/(n-t)),n0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=r},function(t,e,n){function r(){}s(r,"Integer"),r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n0&&e;){for(o.push(c[0]);o.length>0&&e;){var h=o[0];o.splice(0,1),s.add(h);var u=h.getEdges();for(a=0;a-1&&c.splice(f,1)}s=new Set,l=new Map}else t=[]}return t},p.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],n=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&e.splice(u,1),h.getNeighborsList().forEach((function(t){if(n.indexOf(t)<0){var e=r.get(t)-1;1==e&&l.push(t),r.set(t,e)}}))}n=n.concat(l),1!=e.length&&2!=e.length||(i=!0,a=e[0])}return a},p.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=p},function(t,e,n){function r(){}s(r,"RandomSeed"),r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},t.exports=r},function(t,e,n){var r=n(4);function i(t,e){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(i,"Transform"),i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,n=this.lworldExtX;return 0!=n&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/n),e},i.prototype.transformY=function(t){var e=0,n=this.lworldExtY;return 0!=n&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/n),e},i.prototype.inverseTransformX=function(t){var e=0,n=this.ldeviceExtX;return 0!=n&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/n),e},i.prototype.inverseTransformY=function(t){var e=0,n=this.ldeviceExtY;return 0!=n&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/n),e},i.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,n){function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);ea.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),i=new Set,t=0;t(l=e.getEstimatedSize()*this.gravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*a):(s>(l=e.getEstimatedSize()*this.compoundGravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=l.length||h>=l[0].length))for(var u=0;ut}),"_defaultCompareFunction")}]),t}();t.exports=o},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;i(this,t),this.sequence1=e,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=s,this.iMax=e.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;n--){var r=this.listeners[n];r.event===t&&r.callback===e&&this.listeners.splice(n,1)}},i.emit=function(t,e){for(var n=0;nt.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),t.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},a.prototype.propogateDisplacementToChildren=function(t,e){for(var n,r=this.getChild().getNodes(),i=0;i0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=h.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=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},n=0;n1)for(o=0;or&&(r=Math.floor(s.y)),a=Math.floor(s.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(u.WORLD_CENTER_X-s.x/2,u.WORLD_CENTER_Y-s.y/2))},x.radialLayout=function(t,e,n){var r=Math.max(this.maxDiagonalInTree(t),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(e,null,0,359,0,r);var i=y.calculateBounds(t),a=new v;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var s=0;s1;){var y=f[0];f.splice(0,1);var v=h.indexOf(y);v>=0&&h.splice(v,1),g--,u--}d=null!=e?(h.indexOf(f[0])+1)%g:0;for(var b=Math.abs(r-n)/u,w=d;p!=u;w=++w%g){var k=h[w].getOtherEnd(t);if(k!=e){var T=(n+p*b)%360,_=(T+b)%360;x.branchRadialLayout(k,t,T,_,i+a,a),p++}}},x.maxDiagonalInTree=function(t){for(var e=f.MIN_VALUE,n=0;ne&&(e=r)}return e},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;t.memberGroups[r]=e[n];var i=e[n][0].getParent(),a=new o(t.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,t.idToDummyNode[r]=a;var s=t.getGraphManager().add(t.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c=0;t--){var e=this.compoundOrder[t],n=e.id,r=e.paddingLeft,i=e.paddingTop;this.adjustLocations(this.tiledMemberPack[n],e.rect.x,e.rect.y,r,i)}},x.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(n){var r=t.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;t.adjustLocations(e[n],r.rect.x,r.rect.y,i,a)}))},x.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var n=t.getChild();if(null==n)return this.toBeTiled[e]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[e]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[e]=!0,!0},x.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),n=0,r=0;rl&&(l=h.rect.height)}n+=l+t.verticalPadding}},x.prototype.tileCompoundMembers=function(t,e){var n=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(r){var i=e[r];n.tiledMemberPack[r]=n.tileNodes(t[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height}))},x.prototype.tileNodes=function(t,e){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:c.TILING_PADDING_VERTICAL,horizontalPadding:c.TILING_PADDING_HORIZONTAL};t.sort((function(t,e){return t.rect.width*t.rect.height>e.rect.width*e.rect.height?-1:t.rect.width*t.rect.height0&&(a+=t.horizontalPadding),t.rowWidth[n]=a,t.width0&&(s+=t.verticalPadding);var o=0;s>t.rowHeight[n]&&(o=t.rowHeight[n],t.rowHeight[n]=s,o=t.rowHeight[n]-o),t.height+=o,t.rows[n].push(e)},x.prototype.getShortestRowIndex=function(t){for(var e=-1,n=Number.MAX_VALUE,r=0;rn&&(e=r,n=t.rowWidth[r]);return e},x.prototype.canAddHorizontal=function(t,e,n){var r=this.getShortestRowIndex(t);if(r<0)return!0;var i=t.rowWidth[r];if(i+t.horizontalPadding+e<=t.width)return!0;var a,s,o=0;return t.rowHeight[r]0&&(o=n+t.verticalPadding-t.rowHeight[r]),a=t.width-i>=e+t.horizontalPadding?(t.height+o)/(i+e+t.horizontalPadding):(t.height+o)/t.width,o=n+t.verticalPadding,(s=t.widtha&&e!=n){r.splice(-1,1),t.rows[n].push(i),t.rowWidth[e]=t.rowWidth[e]-a,t.rowWidth[n]=t.rowWidth[n]+a,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,o=0;os&&(s=r[o].height);e>0&&(s+=t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[n];t.rowHeight[e]=s,t.rowHeight[n]0)for(var c=i;c<=a;c++)l[0]+=this.grid[c][s-1].length+this.grid[c][s].length-1;if(a0)for(c=s;c<=o;c++)l[3]+=this.grid[i-1][c].length+this.grid[i][c].length-1;for(var u,d,p=f.MAX_VALUE,g=0;g0)s=n.getGraphManager().add(n.newGraph(),a),this.processChildrenList(s,u,n)}},p.prototype.stop=function(){return this.stopped=!0,this};var f=s((function(t){t("layout","cose-bilkent",p)}),"register");"undefined"!=typeof cytoscape&&f(cytoscape),t.exports=f}])}))}}),dCt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],p=[6,7,11],g=[1,6,13,15,16,19,22],f=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",a[o].id),r.addNode(a[o-1].length,a[o].id,a[o].descr,a[o].type);break;case 16:r.getLogger().trace("Icon: ",a[o]),r.decorateNode({icon:a[o]});break;case 17:case 21:r.decorateNode({class:a[o]});break;case 18:r.getLogger().trace("SPACELIST");break;case 19:r.getLogger().trace("Node: ",a[o].id),r.addNode(0,a[o].id,a[o].descr,a[o].type);break;case 20:r.decorateNode({icon:a[o]});break;case 25:r.getLogger().trace("node found ..",a[o-2]),this.$={id:a[o-1],descr:a[o-1],type:r.getType(a[o-2],a[o])};break;case 26:this.$={id:a[o],descr:a[o],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace("node found ..",a[o-3]),this.$={id:a[o-3],descr:a[o-1],type:r.getType(a[o-2],a[o])}}}),"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:n,7:[1,10],9:9,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:l},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:l},{6:n,9:22,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:l},{6:h,7:u,10:23,11:d},t(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:o,22:l}),t(p,[2,18]),t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),t(p,[2,23]),t(p,[2,24]),t(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:h,7:u,10:32,11:d},{1:[2,7],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:l},t(g,[2,14],{7:f,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(p,[2,15]),t(p,[2,16]),t(p,[2,17]),{20:[1,35]},{21:[1,36]},t(g,[2,13],{7:f,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(p,[2,25]),t(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},x=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return t.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:case 23:case 26:this.popState();break;case 5:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return t.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:t.getLogger().trace("end icon"),this.popState();break;case 10:return t.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return t.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16: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 24:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 27:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return t.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 t}();function b(){this.yy={}}return v.lexer=x,s(b,"Parser"),b.prototype=v,v.Parser=b,new b}();dCt.parser=dCt;var pCt=dCt,gCt=[],fCt=0,mCt={},yCt=s((()=>{gCt=[],fCt=0,mCt={}}),"clear"),vCt=s((function(t){for(let e=gCt.length-1;e>=0;e--)if(gCt[e].levelgCt.length>0?gCt[0]:null),"getMindmap"),bCt=s(((t,e,n,r)=>{m.info("addNode",t,e,n,r);const i=Hn();let a=i.mindmap?.padding??Ct.mindmap.padding;switch(r){case wCt.ROUNDED_RECT:case wCt.RECT:case wCt.HEXAGON:a*=2}const s={id:fCt++,nodeId:an(e,i),level:t,descr:an(n,i),type:r,children:[],width:i.mindmap?.maxNodeWidth??Ct.mindmap.maxNodeWidth,padding:a},o=vCt(t);if(o)o.children.push(s),gCt.push(s);else{if(0!==gCt.length)throw new Error('There can be only one root. No parent could be found for ("'+s.descr+'")');gCt.push(s)}}),"addNode"),wCt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},kCt=s(((t,e)=>{switch(m.debug("In get type",t,e),t){case"[":return wCt.RECT;case"(":return")"===e?wCt.ROUNDED_RECT:wCt.CLOUD;case"((":return wCt.CIRCLE;case")":return wCt.CLOUD;case"))":return wCt.BANG;case"{{":return wCt.HEXAGON;default:return wCt.DEFAULT}}),"getType"),TCt=s(((t,e)=>{mCt[t]=e}),"setElementForId"),_Ct=s((t=>{if(!t)return;const e=Hn(),n=gCt[gCt.length-1];t.icon&&(n.icon=an(t.icon,e)),t.class&&(n.class=an(t.class,e))}),"decorateNode"),ECt=s((t=>{switch(t){case wCt.DEFAULT:return"no-border";case wCt.RECT:return"rect";case wCt.ROUNDED_RECT:return"rounded-rect";case wCt.CIRCLE:return"circle";case wCt.CLOUD:return"cloud";case wCt.BANG:return"bang";case wCt.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),CCt=s((()=>m),"getLogger"),SCt=s((t=>mCt[t]),"getElementById"),ACt={clear:yCt,addNode:bCt,getMindmap:xCt,nodeType:wCt,getType:kCt,setElementForId:TCt,decorateNode:_Ct,type2Str:ECt,getLogger:CCt,getElementById:SCt},LCt=d(uCt(),1),NCt=s((function(t,e,n,r){e.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("d",`M0 ${n.height-5} v${10-n.height} q0,-5 5,-5 h${n.width-10} q5,0 5,5 v${n.height-5} H0 Z`),e.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",n.height).attr("x2",n.width).attr("y2",n.height)}),"defaultBkg"),ICt=s((function(t,e,n){e.append("rect").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("height",n.height).attr("width",n.width)}),"rectBkg"),MCt=s((function(t,e,n){const r=n.width,i=n.height,a=.15*r,s=.25*r,o=.35*r,l=.2*r;e.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("d",`M0 0 a${a},${a} 0 0,1 ${.25*r},${-1*r*.1}\n a${o},${o} 1 0,1 ${.4*r},${-1*r*.1}\n a${s},${s} 1 0,1 ${.35*r},${1*r*.2}\n\n a${a},${a} 1 0,1 ${.15*r},${1*i*.35}\n a${l},${l} 1 0,1 ${-1*r*.15},${1*i*.65}\n\n a${s},${a} 1 0,1 ${-1*r*.25},${.15*r}\n a${o},${o} 1 0,1 ${-1*r*.5},0\n a${a},${a} 1 0,1 ${-1*r*.25},${-1*r*.15}\n\n a${a},${a} 1 0,1 ${-1*r*.1},${-1*i*.35}\n a${l},${l} 1 0,1 ${.1*r},${-1*i*.65}\n\n H0 V0 Z`)}),"cloudBkg"),RCt=s((function(t,e,n){const r=n.width,i=n.height,a=.15*r;e.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("d",`M0 0 a${a},${a} 1 0,0 ${.25*r},${-1*i*.1}\n a${a},${a} 1 0,0 ${.25*r},0\n a${a},${a} 1 0,0 ${.25*r},0\n a${a},${a} 1 0,0 ${.25*r},${1*i*.1}\n\n a${a},${a} 1 0,0 ${.15*r},${1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${1*i*.34}\n a${a},${a} 1 0,0 ${-1*r*.15},${1*i*.33}\n\n a${a},${a} 1 0,0 ${-1*r*.25},${.15*i}\n a${a},${a} 1 0,0 ${-1*r*.25},0\n a${a},${a} 1 0,0 ${-1*r*.25},0\n a${a},${a} 1 0,0 ${-1*r*.25},${-1*i*.15}\n\n a${a},${a} 1 0,0 ${-1*r*.1},${-1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${-1*i*.34}\n a${a},${a} 1 0,0 ${.1*r},${-1*i*.33}\n\n H0 V0 Z`)}),"bangBkg"),DCt=s((function(t,e,n){e.append("circle").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("r",n.width/2)}),"circleBkg");function OCt(t,e,n,r,i){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("transform","translate("+(i.width-e)/2+", "+n+")")}s(OCt,"insertPolygonShape");var PCt=s((function(t,e,n){const r=n.height,i=r/4,a=n.width-n.padding+2*i;OCt(e,a,r,[{x:i,y:0},{x:a-i,y:0},{x:a,y:-r/2},{x:a-i,y:-r},{x:i,y:-r},{x:0,y:-r/2}],n)}),"hexagonBkg"),BCt=s((function(t,e,n){e.append("rect").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("height",n.height).attr("rx",n.padding).attr("ry",n.padding).attr("width",n.width)}),"roundedRectBkg"),$Ct=s((async function(t,e,n,r,i){const a=i.htmlLabels,s=r%11,o=e.append("g");n.section=s;let l="section-"+s;s<0&&(l+=" section-root"),o.attr("class",(n.class?n.class+" ":"")+"mindmap-node "+l);const c=o.append("g"),h=o.append("g"),u=n.descr.replace(/()/g,"\n");await KT(h,u,{useHtmlLabels:a,width:n.width,classes:"mindmap-node-label"},i),a||h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const d=h.node().getBBox(),[p]=fk(i.fontSize);if(n.height=d.height+1.1*p*.5+n.padding,n.width=d.width+2*n.padding,n.icon)if(n.type===t.nodeType.CIRCLE){n.height+=50,n.width+=50;o.append("foreignObject").attr("height","50px").attr("width",n.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+n.icon),h.attr("transform","translate("+n.width/2+", "+(n.height/2-1.5*n.padding)+")")}else{n.width+=50;const t=n.height;n.height=Math.max(t,60);const e=Math.abs(n.height-t);o.append("foreignObject").attr("width","60px").attr("height",n.height).attr("style","text-align: center;margin-top:"+e/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+n.icon),h.attr("transform","translate("+(25+n.width/2)+", "+(e/2+n.padding/2)+")")}else if(a){const t=(n.width-d.width)/2,e=(n.height-d.height)/2;h.attr("transform","translate("+t+", "+e+")")}else{const t=n.width/2,e=n.padding/2;h.attr("transform","translate("+t+", "+e+")")}switch(n.type){case t.nodeType.DEFAULT:NCt(t,c,n,s);break;case t.nodeType.ROUNDED_RECT:BCt(t,c,n,s);break;case t.nodeType.RECT:ICt(t,c,n,s);break;case t.nodeType.CIRCLE:c.attr("transform","translate("+n.width/2+", "+ +n.height/2+")"),DCt(t,c,n,s);break;case t.nodeType.CLOUD:MCt(t,c,n,s);break;case t.nodeType.BANG:RCt(t,c,n,s);break;case t.nodeType.HEXAGON:PCt(t,c,n,s)}return t.setElementForId(n.id,o),n.height}),"drawNode"),FCt=s((function(t,e){const n=t.getElementById(e.id),r=e.x||0,i=e.y||0;n.attr("transform","translate("+r+","+i+")")}),"positionNode");async function zCt(t,e,n,r,i){await $Ct(t,e,n,r,i),n.children&&await Promise.all(n.children.map(((n,a)=>zCt(t,e,n,r<0?a:r,i))))}function UCt(t,e){e.edges().map(((e,n)=>{const r=e.data();if(e[0]._private.bodyBounds){const i=e[0]._private.rscratch;m.trace("Edge: ",n,r),t.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+r.section+" edge-depth-"+r.depth)}}))}function GCt(t,e,n,r){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:r,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach((i=>{GCt(i,e,n,r+1),e.add({group:"edges",data:{id:`${t.id}_${i.id}`,source:t.id,target:i.id,depth:r,section:i.section}})}))}function qCt(t,e){return new Promise((n=>{const r=Oa("body").append("div").attr("id","cy").attr("style","display:none"),i=lCt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),GCt(t,i,e,0),i.nodes().forEach((function(t){t.layoutDimensions=()=>{const e=t.data();return{w:e.width,h:e.height}}})),i.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),i.ready((t=>{m.info("Ready",t),n(i)}))}))}function jCt(t,e){e.nodes().map(((e,n)=>{const r=e.data();r.x=e.position().x,r.y=e.position().y,FCt(t,r);const i=t.getElementById(r.nodeId);m.info("Id:",n,"Position: (",e.position().x,", ",e.position().y,")",r),i.attr("transform",`translate(${e.position().x-r.width/2}, ${e.position().y-r.height/2})`),i.attr("attr",`apa-${n})`)}))}lCt.use(LCt.default),s(zCt,"drawNodes"),s(UCt,"drawEdges"),s(GCt,"addNodes"),s(qCt,"layoutMindmap"),s(jCt,"positionNodes");var YCt=s((async(t,e,n,r)=>{m.debug("Rendering mindmap diagram\n"+t);const i=r.db,a=i.getMindmap();if(!a)return;const s=Hn();s.htmlLabels=!1;const o=zp(e),l=o.append("g");l.attr("class","mindmap-edges");const c=o.append("g");c.attr("class","mindmap-nodes"),await zCt(i,c,a,-1,s);const h=await qCt(a,s);UCt(l,h),jCt(i,h),An(void 0,o,s.mindmap?.padding??Ct.mindmap.padding,s.mindmap?.useMaxWidth??Ct.mindmap.useMaxWidth)}),"draw"),WCt={draw:YCt},HCt=s((t=>{let e="";for(let e=0;e`\n .edge {\n stroke-width: 3;\n }\n ${HCt(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")},XCt=Object.freeze({__proto__:null,diagram:VCt}),KCt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],p=[6,7,11],g=[1,31],f=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],x=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",a[o-1].id),r.addNode(a[o-2].length,a[o-1].id,a[o-1].descr,a[o-1].type,a[o]);break;case 16:r.getLogger().info("Node: ",a[o].id),r.addNode(a[o-1].length,a[o].id,a[o].descr,a[o].type);break;case 17:r.getLogger().trace("Icon: ",a[o]),r.decorateNode({icon:a[o]});break;case 18:case 23:r.decorateNode({class:a[o]});break;case 19:r.getLogger().trace("SPACELIST");break;case 20:r.getLogger().trace("Node: ",a[o-1].id),r.addNode(0,a[o-1].id,a[o-1].descr,a[o-1].type,a[o]);break;case 21:r.getLogger().trace("Node: ",a[o].id),r.addNode(0,a[o].id,a[o].descr,a[o].type);break;case 22:r.decorateNode({icon:a[o]});break;case 27:r.getLogger().trace("node found ..",a[o-2]),this.$={id:a[o-1],descr:a[o-1],type:r.getType(a[o-2],a[o])};break;case 28:this.$={id:a[o],descr:a[o],type:0};break;case 29:r.getLogger().trace("node found ..",a[o-3]),this.$={id:a[o-3],descr:a[o-1],type:r.getType(a[o-2],a[o])};break;case 30:this.$=a[o-1]+a[o];break;case 31:this.$=a[o]}}),"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:n,7:[1,10],9:9,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:l},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:l},{6:n,9:22,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:l},{6:h,7:u,10:23,11:d},t(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:o,23:l}),t(p,[2,19]),t(p,[2,21],{15:30,24:g}),t(p,[2,22]),t(p,[2,23]),t(f,[2,25]),t(f,[2,26]),t(f,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:d},{1:[2,7],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:l},t(m,[2,14],{7:y,11:v}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(p,[2,16],{15:37,24:g}),t(p,[2,17]),t(p,[2,18]),t(p,[2,20],{24:b}),t(f,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(x,[2,11]),t(x,[2,12]),t(p,[2,15],{24:b}),t(f,[2,30]),{22:[1,41]},t(f,[2,27]),t(f,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},k=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"
    "),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22: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 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.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 t}();function T(){this.yy={}}return w.lexer=k,s(T,"Parser"),T.prototype=w,w.Parser=T,new T}();KCt.parser=KCt;var ZCt=KCt,QCt=[],JCt=[],tSt=0,eSt={},nSt=s((()=>{QCt=[],JCt=[],tSt=0,eSt={}}),"clear"),rSt=s((t=>{if(0===QCt.length)return null;const e=QCt[0].level;let n=null;for(let t=QCt.length-1;t>=0;t--)if(QCt[t].level!==e||n||(n=QCt[t]),QCt[t].levelt.parentId===r.id));for(const e of i){const i={id:e.id,parentId:r.id,label:an(e.label??"",n),isGroup:!1,ticket:e?.ticket,priority:e?.priority,assigned:e?.assigned,icon:e?.icon,shape:"kanbanItem",level:e.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(i)}}return{nodes:t,edges:[],other:{},config:Hn()}}),"getData"),sSt=s(((t,e,n,r,i)=>{const a=Hn();let s=a.mindmap?.padding??Ct.mindmap.padding;switch(r){case oSt.ROUNDED_RECT:case oSt.RECT:case oSt.HEXAGON:s*=2}const o={id:an(e,a)||"kbn"+tSt++,level:t,label:an(n,a),width:a.mindmap?.maxNodeWidth??Ct.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(void 0!==i){let t;t=i.includes("\n")?i+"\n":"{\n"+i+"\n}";const e=Um(t,{schema:zm});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);e?.shape&&"kanbanItem"===e.shape&&(o.shape=e?.shape),e?.label&&(o.label=e?.label),e?.icon&&(o.icon=e?.icon.toString()),e?.assigned&&(o.assigned=e?.assigned.toString()),e?.ticket&&(o.ticket=e?.ticket.toString()),e?.priority&&(o.priority=e?.priority)}const l=rSt(t);l?o.parentId=l.id||"kbn"+tSt++:JCt.push(o),QCt.push(o)}),"addNode"),oSt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},lSt=s(((t,e)=>{switch(m.debug("In get type",t,e),t){case"[":return oSt.RECT;case"(":return")"===e?oSt.ROUNDED_RECT:oSt.CLOUD;case"((":return oSt.CIRCLE;case")":return oSt.CLOUD;case"))":return oSt.BANG;case"{{":return oSt.HEXAGON;default:return oSt.DEFAULT}}),"getType"),cSt=s(((t,e)=>{eSt[t]=e}),"setElementForId"),hSt=s((t=>{if(!t)return;const e=Hn(),n=QCt[QCt.length-1];t.icon&&(n.icon=an(t.icon,e)),t.class&&(n.cssClasses=an(t.class,e))}),"decorateNode"),uSt=s((t=>{switch(t){case oSt.DEFAULT:return"no-border";case oSt.RECT:return"rect";case oSt.ROUNDED_RECT:return"rounded-rect";case oSt.CIRCLE:return"circle";case oSt.CLOUD:return"cloud";case oSt.BANG:return"bang";case oSt.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),dSt=s((()=>m),"getLogger"),pSt=s((t=>eSt[t]),"getElementById"),gSt={clear:nSt,addNode:sSt,getSections:iSt,getData:aSt,nodeType:oSt,getType:lSt,setElementForId:cSt,decorateNode:hSt,type2Str:uSt,getLogger:dSt,getElementById:pSt},fSt=s((async(t,e,n,r)=>{m.debug("Rendering kanban diagram\n"+t);const i=r.db.getData(),a=Hn();a.htmlLabels=!1;const s=zp(e),o=s.append("g");o.attr("class","sections");const l=s.append("g");l.attr("class","items");const c=i.nodes.filter((t=>t.isGroup));let h=0;const u=[];let d=25;for(const t of c){const e=a?.kanban?.sectionWidth||200;h+=1,t.x=e*h+10*(h-1)/2,t.width=e,t.y=0,t.height=3*e,t.rx=5,t.ry=5,t.cssClasses=t.cssClasses+" section-"+h;const n=await CE(o,t);d=Math.max(d,n?.labelBBox?.height),u.push(n)}let p=0;for(const t of c){const e=u[p];p+=1;const n=a?.kanban?.sectionWidth||200,r=3*-n/2+d;let s=r;const o=i.nodes.filter((e=>e.parentId===t.id));for(const e of o){if(e.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");e.x=t.x,e.width=n-15;const r=(await fS(l,e,{config:a})).node().getBBox();e.y=s+r.height/2,await vS(e),s=e.y+r.height/2+5}const c=e.cluster.select("rect"),h=Math.max(s-r+30,50)+(d-25);c.attr("height",h)}An(void 0,s,a.mindmap?.padding??Ct.kanban.padding,a.mindmap?.useMaxWidth??Ct.kanban.useMaxWidth)}),"draw"),mSt={draw:fSt},ySt=s((t=>{let e="";for(let e=0;et.darkMode?st(e,n):at(e,n)),"adjuster");for(let r=0;r`\n .edge {\n stroke-width: 3;\n }\n ${ySt(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")},xSt=Object.freeze({__proto__:null,diagram:vSt}),bSt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,9],n=[1,10],r=[1,5,10,12],i={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 7:const t=r.findOrCreateNode(a[o-4].trim().replaceAll('""','"')),e=r.findOrCreateNode(a[o-2].trim().replaceAll('""','"')),n=parseFloat(a[o].trim());r.addLink(t,e,n);break;case 8:case 9:case 11:this.$=a[o];break;case 10:this.$=a[o-1]}}),"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:n},{1:[2,6],7:11,10:[1,12]},t(n,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(r,[2,8]),t(r,[2,9]),{19:[1,16]},t(r,[2,11]),{1:[2,1]},{1:[2,5]},t(n,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:n},{15:18,16:7,17:8,18:e,20:n},{18:[1,19]},t(n,[2,3]),{12:[1,20]},t(r,[2,10]),{15:21,16:7,17:8,18:e,20:n},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},a=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\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:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return t}();function o(){this.yy={}}return i.lexer=a,s(o,"Parser"),o.prototype=i,i.Parser=o,new o}();bSt.parser=bSt;var wSt=bSt,kSt=[],TSt=[],_St=new Map,ESt=s((()=>{kSt=[],TSt=[],_St=new Map,$n()}),"clear"),CSt=class{constructor(t,e,n=0){this.source=t,this.target=e,this.value=n}static{s(this,"SankeyLink")}},SSt=s(((t,e,n)=>{kSt.push(new CSt(t,e,n))}),"addLink"),ASt=class{constructor(t){this.ID=t}static{s(this,"SankeyNode")}},LSt=s((t=>{t=_n.sanitizeText(t,Hn());let e=_St.get(t);return void 0===e&&(e=new ASt(t),_St.set(t,e),TSt.push(e)),e}),"findOrCreateNode"),NSt=s((()=>TSt),"getNodes"),ISt=s((()=>kSt),"getLinks"),MSt=s((()=>({nodes:TSt.map((t=>({id:t.ID}))),links:kSt.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),RSt={nodesMap:_St,getConfig:s((()=>Hn().sankey),"getConfig"),getNodes:NSt,getLinks:ISt,getGraph:MSt,addLink:SSt,findOrCreateNode:LSt,getAccTitle:zn,setAccTitle:Fn,getAccDescription:Gn,setAccDescription:Un,getDiagramTitle:jn,setDiagramTitle:qn,clear:ESt};function DSt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function OSt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function PSt(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function BSt(t){return t.target.depth}function $St(t){return t.depth}function FSt(t,e){return e-1-t.height}function zSt(t,e){return t.sourceLinks.length?t.depth:e-1}function USt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?OSt(t.sourceLinks,BSt)-1:0}function GSt(t){return function(){return t}}function qSt(t,e){return YSt(t.source,e.source)||t.index-e.index}function jSt(t,e){return YSt(t.target,e.target)||t.index-e.index}function YSt(t,e){return t.y0-e.y0}function WSt(t){return t.value}function HSt(t){return t.index}function VSt(t){return t.nodes}function XSt(t){return t.links}function KSt(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function ZSt({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function QSt(){let t,e,n,r=0,i=0,a=1,o=1,l=24,c=8,h=HSt,u=zSt,d=VSt,p=XSt,g=6;function f(){const t={nodes:d.apply(null,arguments),links:p.apply(null,arguments)};return m(t),y(t),v(t),x(t),k(t),ZSt(t),t}function m({nodes:t,links:e}){for(const[e,n]of t.entries())n.index=e,n.sourceLinks=[],n.targetLinks=[];const r=new Map(t.map(((e,n)=>[h(e,n,t),e])));for(const[t,n]of e.entries()){n.index=t;let{source:e,target:i}=n;"object"!=typeof e&&(e=n.source=KSt(r,e)),"object"!=typeof i&&(i=n.target=KSt(r,i)),e.sourceLinks.push(n),i.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:e,targetLinks:r}of t)e.sort(n),r.sort(n)}function y({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(PSt(e.sourceLinks,WSt),PSt(e.targetLinks,WSt)):e.fixedValue}function v({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){for(const t of n){t.depth=i;for(const{target:e}of t.sourceLinks)r.add(e)}if(++i>e)throw new Error("circular link");n=r,r=new Set}}function x({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){for(const t of n){t.height=i;for(const{source:e}of t.targetLinks)r.add(e)}if(++i>e)throw new Error("circular link");n=r,r=new Set}}function b({nodes:t}){const n=DSt(t,(t=>t.depth))+1,i=(a-r-l)/(n-1),s=new Array(n);for(const e of t){const t=Math.max(0,Math.min(n-1,Math.floor(u.call(null,e,n))));e.layer=t,e.x0=r+t*i,e.x1=e.x0+l,s[t]?s[t].push(e):s[t]=[e]}if(e)for(const t of s)t.sort(e);return s}function w(e){const n=OSt(e,(e=>(o-i-(e.length-1)*t)/PSt(e,WSt)));for(const r of e){let e=i;for(const i of r){i.y0=e,i.y1=e+i.value*n,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*n}e=(o-e+t)/(r.length+1);for(let t=0;tt.length))-1)),w(n);for(let t=0;t0))continue;let i=(e/r-t.y0)*n;t.y0+=i,t.y1+=i,A(t)}void 0===e&&a.sort(YSt),E(a,r)}}function _(t,n,r){for(let i=t.length-2;i>=0;--i){const a=t[i];for(const t of a){let e=0,r=0;for(const{target:n,value:i}of t.sourceLinks){let a=i*(n.layer-t.layer);e+=I(t,n)*a,r+=a}if(!(r>0))continue;let i=(e/r-t.y0)*n;t.y0+=i,t.y1+=i,A(t)}void 0===e&&a.sort(YSt),E(a,r)}}function E(e,n){const r=e.length>>1,a=e[r];S(e,a.y0-t,r-1,n),C(e,a.y1+t,r+1,n),S(e,o,e.length-1,n),C(e,i,0,n)}function C(e,n,r,i){for(;r1e-6&&(a.y0+=s,a.y1+=s),n=a.y1+t}}function S(e,n,r,i){for(;r>=0;--r){const a=e[r],s=(a.y1-n)*i;s>1e-6&&(a.y0-=s,a.y1-=s),n=a.y0-t}}function A({sourceLinks:t,targetLinks:e}){if(void 0===n){for(const{source:{sourceLinks:t}}of e)t.sort(jSt);for(const{target:{targetLinks:e}}of t)e.sort(qSt)}}function L(t){if(void 0===n)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(jSt),n.sort(qSt)}function N(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:a}of e.sourceLinks){if(i===n)break;r+=a+t}for(const{source:t,width:i}of n.targetLinks){if(t===e)break;r-=i}return r}function I(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:i,width:a}of n.targetLinks){if(i===e)break;r+=a+t}for(const{target:t,width:i}of e.sourceLinks){if(t===n)break;r-=i}return r}return s(f,"sankey"),f.update=function(t){return ZSt(t),t},f.nodeId=function(t){return arguments.length?(h="function"==typeof t?t:GSt(t),f):h},f.nodeAlign=function(t){return arguments.length?(u="function"==typeof t?t:GSt(t),f):u},f.nodeSort=function(t){return arguments.length?(e=t,f):e},f.nodeWidth=function(t){return arguments.length?(l=+t,f):l},f.nodePadding=function(e){return arguments.length?(c=t=+e,f):c},f.nodes=function(t){return arguments.length?(d="function"==typeof t?t:GSt(t),f):d},f.links=function(t){return arguments.length?(p="function"==typeof t?t:GSt(t),f):p},f.linkSort=function(t){return arguments.length?(n=t,f):n},f.size=function(t){return arguments.length?(r=i=0,a=+t[0],o=+t[1],f):[a-r,o-i]},f.extent=function(t){return arguments.length?(r=+t[0][0],a=+t[1][0],i=+t[0][1],o=+t[1][1],f):[[r,i],[a,o]]},f.iterations=function(t){return arguments.length?(g=+t,f):g},s(m,"computeNodeLinks"),s(y,"computeNodeValues"),s(v,"computeNodeDepths"),s(x,"computeNodeHeights"),s(b,"computeNodeLayers"),s(w,"initializeNodeBreadths"),s(k,"computeNodeBreadths"),s(T,"relaxLeftToRight"),s(_,"relaxRightToLeft"),s(E,"resolveCollisions"),s(C,"resolveCollisionsTopToBottom"),s(S,"resolveCollisionsBottomToTop"),s(A,"reorderNodeLinks"),s(L,"reorderLinks"),s(N,"targetTop"),s(I,"sourceTop"),f}s(DSt,"max"),s(OSt,"min"),s(PSt,"sum"),s(BSt,"targetDepth"),s($St,"left"),s(FSt,"right"),s(zSt,"justify"),s(USt,"center"),s(GSt,"constant"),s(qSt,"ascendingSourceBreadth"),s(jSt,"ascendingTargetBreadth"),s(YSt,"ascendingBreadth"),s(WSt,"value"),s(HSt,"defaultId"),s(VSt,"defaultNodes"),s(XSt,"defaultLinks"),s(KSt,"find"),s(ZSt,"computeLinkBreadths"),s(QSt,"Sankey");var JSt=Math.PI,tAt=2*JSt,eAt=tAt-1e-6;function nAt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function rAt(){return new nAt}s(nAt,"Path"),s(rAt,"path"),nAt.prototype=rAt.prototype={constructor:nAt,moveTo:s((function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)}),"moveTo"),closePath:s((function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}),"closePath"),lineTo:s((function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)}),"lineTo"),quadraticCurveTo:s((function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)}),"quadraticCurveTo"),bezierCurveTo:s((function(t,e,n,r,i,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)}),"bezierCurveTo"),arcTo:s((function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var a=this._x1,s=this._y1,o=n-t,l=r-e,c=a-t,h=s-e,u=c*c+h*h;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>1e-6)if(Math.abs(h*o-l*c)>1e-6&&i){var d=n-a,p=r-s,g=o*o+l*l,f=d*d+p*p,m=Math.sqrt(g),y=Math.sqrt(u),v=i*Math.tan((JSt-Math.acos((g+u-f)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>1e-6&&(this._+="L"+(t+x*c)+","+(e+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*d>c*p)+","+(this._x1=t+b*o)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;}),"arcTo"),arc:s((function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var s=(n=+n)*Math.cos(r),o=n*Math.sin(r),l=t+s,c=e+o,h=1^a,u=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+l+","+c),n&&(u<0&&(u=u%tAt+tAt),u>eAt?this._+="A"+n+","+n+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>1e-6&&(this._+="A"+n+","+n+",0,"+ +(u>=JSt)+","+h+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))}),"arc"),rect:s((function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"}),"rect"),toString:s((function(){return this._}),"toString")};var iAt=rAt;function aAt(t){return s((function(){return t}),"constant")}function sAt(t){return t[0]}function oAt(t){return t[1]}s(aAt,"default"),s(sAt,"x"),s(oAt,"y");var lAt=Array.prototype.slice;function cAt(t){return t.source}function hAt(t){return t.target}function uAt(t){var e=cAt,n=hAt,r=sAt,i=oAt,a=null;function o(){var s,o=lAt.call(arguments),l=e.apply(this,o),c=n.apply(this,o);if(a||(a=s=iAt()),t(a,+r.apply(this,(o[0]=l,o)),+i.apply(this,o),+r.apply(this,(o[0]=c,o)),+i.apply(this,o)),s)return a=null,s+""||null}return s(o,"link"),o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(n=t,o):n},o.x=function(t){return arguments.length?(r="function"==typeof t?t:aAt(+t),o):r},o.y=function(t){return arguments.length?(i="function"==typeof t?t:aAt(+t),o):i},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o}function dAt(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function pAt(){return uAt(dAt)}function gAt(t){return[t.source.x1,t.y0]}function fAt(t){return[t.target.x0,t.y1]}function mAt(){return pAt().source(gAt).target(fAt)}s(cAt,"linkSource"),s(hAt,"linkTarget"),s(uAt,"link"),s(dAt,"curveHorizontal"),s(pAt,"linkHorizontal"),s(gAt,"horizontalSource"),s(fAt,"horizontalTarget"),s(mAt,"default");var yAt=class t{static{s(this,"Uid")}static{this.count=0}static next(e){return new t(e+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},vAt={left:$St,right:FSt,center:USt,justify:zSt},xAt=s((function(t,e,n,r){const{securityLevel:i,sankey:a}=Hn(),o=Xn.sankey;let l;"sandbox"===i&&(l=Oa("#i"+e));const c=Oa("sandbox"===i?l.nodes()[0].contentDocument.body:"body"),h="sandbox"===i?c.select(`[id="${e}"]`):Oa(`[id="${e}"]`),u=a?.width??o.width,d=a?.height??o.width,p=a?.useMaxWidth??o.useMaxWidth,g=a?.nodeAlignment??o.nodeAlignment,f=a?.prefix??o.prefix,m=a?.suffix??o.suffix,y=a?.showValues??o.showValues,v=r.db.getGraph(),x=vAt[g],b=QSt().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(y?15:0)).nodeAlign(x).extent([[0,0],[u,d]]);b(v);const w=yo(gh);h.append("g").attr("class","nodes").selectAll(".node").data(v.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=yAt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>w(t.id)));const k=s((({id:t,value:e})=>y?`${t}\n${f}${Math.round(100*e)/100}${m}`:t),"getText");h.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(v.nodes).join("text").attr("x",(t=>t.x0(t.y1+t.y0)/2)).attr("dy",(y?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0(t.uid=yAt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>w(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>w(t.target.id)))}let E;switch(_){case"gradient":E=s((t=>t.uid),"coloring");break;case"source":E=s((t=>w(t.source.id)),"coloring");break;case"target":E=s((t=>w(t.target.id)),"coloring");break;default:E=_}T.append("path").attr("d",mAt()).attr("stroke",E).attr("stroke-width",(t=>Math.max(1,t.width))),An(void 0,h,0,p)}),"draw"),bAt={draw:xAt},wAt=s((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),kAt=wSt.parse.bind(wSt);wSt.parse=t=>kAt(wAt(t));var TAt={parser:wSt,db:RSt,renderer:bAt},_At=Object.freeze({__proto__:null,diagram:TAt}),EAt={packet:[]},CAt=structuredClone(EAt),SAt=Ct.packet,AAt=s((()=>{const t=mk({...SAt,...Ft().packet});return t.showBits&&(t.paddingY+=10),t}),"getConfig"),LAt=s((()=>CAt.packet),"getPacket"),NAt={pushWord:s((t=>{t.length>0&&CAt.packet.push(t)}),"pushWord"),getPacket:LAt,getConfig:AAt,clear:s((()=>{$n(),CAt=structuredClone(EAt)}),"clear"),setAccTitle:Fn,getAccTitle:zn,setDiagramTitle:qn,getDiagramTitle:jn,getAccDescription:Gn,setAccDescription:Un},IAt=s((t=>{jX(t,NAt);let e=-1,n=[],r=1;const{bitsPerRow:i}=NAt.getConfig();for(let{start:a,end:s,label:o}of t.blocks){if(s&&s{if(void 0===t.end&&(t.end=t.start),t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);return t.end+1<=e*n?[t,void 0]:[{start:t.start,end:e*n-1,label:t.label},{start:e*n,end:t.end,label:t.label}]}),"getNextFittingBlock"),RAt={parse:s((async t=>{const e=await Att("packet",t);m.debug(e),IAt(e)}),"parse")},DAt=s(((t,e,n,r)=>{const i=r.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:c}=a,h=i.getPacket(),u=i.getDiagramTitle(),d=s+o,p=d*(h.length+1)-(u?0:s),g=l*c+2,f=zp(e);f.attr("viewbox",`0 0 ${g} ${p}`),Sn(f,p,g,a.useMaxWidth);for(const[t,e]of h.entries())OAt(f,e,t,a);f.append("text").text(u).attr("x",g/2).attr("y",p-d/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")}),"draw"),OAt=s(((t,e,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const c=t.append("g"),h=n*(r+a)+a;for(const t of e){const e=t.start%o*s+1,n=(t.end-t.start+1)*s-i;if(c.append("rect").attr("x",e).attr("y",h).attr("width",n).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",e+n/2).attr("y",h+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(t.label),!l)continue;const a=t.end===t.start,u=h-2;c.append("text").attr("x",e+(a?n/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",a?"middle":"start").text(t.start),a||c.append("text").attr("x",e+n).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(t.end)}}),"drawWord"),PAt={draw:DAt},BAt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},$At=s((({packet:t}={})=>{const e=mk(BAt,t);return`\n\t.packetByte {\n\t\tfont-size: ${e.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${e.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${e.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${e.labelColor};\n\t\tfont-size: ${e.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${e.titleColor};\n\t\tfont-size: ${e.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${e.blockStrokeColor};\n\t\tstroke-width: ${e.blockStrokeWidth};\n\t\tfill: ${e.blockFillColor};\n\t}\n\t`}),"styles"),FAt={parser:RAt,db:NAt,renderer:PAt,styles:$At},zAt=Object.freeze({__proto__:null,diagram:FAt}),UAt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,7],n=[1,13],r=[1,14],i=[1,15],a=[1,19],o=[1,16],l=[1,17],c=[1,18],h=[8,30],u=[8,21,28,29,30,31,32,40,44,47],d=[1,23],p=[1,24],g=[8,15,16,21,28,29,30,31,32,40,44,47],f=[8,15,16,21,27,28,29,30,31,32,40,44,47],m=[1,49],y={trace:s((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,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList: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:49,$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:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"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],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 4:r.getLogger().debug("Rule: separator (NL) ");break;case 5:r.getLogger().debug("Rule: separator (Space) ");break;case 6:r.getLogger().debug("Rule: separator (EOF) ");break;case 7:r.getLogger().debug("Rule: hierarchy: ",a[o-1]),r.setHierarchy(a[o-1]);break;case 8:r.getLogger().debug("Stop NL ");break;case 9:r.getLogger().debug("Stop EOF ");break;case 10:r.getLogger().debug("Stop NL2 ");break;case 11:r.getLogger().debug("Stop EOF2 ");break;case 12:r.getLogger().debug("Rule: statement: ",a[o]),"number"==typeof a[o].length?this.$=a[o]:this.$=[a[o]];break;case 13:r.getLogger().debug("Rule: statement #2: ",a[o-1]),this.$=[a[o-1]].concat(a[o]);break;case 14:r.getLogger().debug("Rule: link: ",a[o],t),this.$={edgeTypeStr:a[o],label:""};break;case 15:r.getLogger().debug("Rule: LABEL link: ",a[o-3],a[o-1],a[o]),this.$={edgeTypeStr:a[o],label:a[o-1]};break;case 18:const e=parseInt(a[o]),n=r.generateId();this.$={id:n,type:"space",label:"",width:e,children:[]};break;case 23:r.getLogger().debug("Rule: (nodeStatement link node) ",a[o-2],a[o-1],a[o]," typestr: ",a[o-1].edgeTypeStr);const i=r.edgeStrToEdgeData(a[o-1].edgeTypeStr);this.$=[{id:a[o-2].id,label:a[o-2].label,type:a[o-2].type,directions:a[o-2].directions},{id:a[o-2].id+"-"+a[o].id,start:a[o-2].id,end:a[o].id,label:a[o-1].label,type:"edge",directions:a[o].directions,arrowTypeEnd:i,arrowTypeStart:"arrow_open"},{id:a[o].id,label:a[o].label,type:r.typeStr2Type(a[o].typeStr),directions:a[o].directions}];break;case 24:r.getLogger().debug("Rule: nodeStatement (abc88 node size) ",a[o-1],a[o]),this.$={id:a[o-1].id,label:a[o-1].label,type:r.typeStr2Type(a[o-1].typeStr),directions:a[o-1].directions,widthInColumns:parseInt(a[o],10)};break;case 25:r.getLogger().debug("Rule: nodeStatement (node) ",a[o]),this.$={id:a[o].id,label:a[o].label,type:r.typeStr2Type(a[o].typeStr),directions:a[o].directions,widthInColumns:1};break;case 26:r.getLogger().debug("APA123",this?this:"na"),r.getLogger().debug("COLUMNS: ",a[o]),this.$={type:"column-setting",columns:"auto"===a[o]?-1:parseInt(a[o])};break;case 27:r.getLogger().debug("Rule: id-block statement : ",a[o-2],a[o-1]),r.generateId(),this.$={...a[o-2],type:"composite",children:a[o-1]};break;case 28:r.getLogger().debug("Rule: blockStatement : ",a[o-2],a[o-1],a[o]);const s=r.generateId();this.$={id:s,type:"composite",label:"",children:a[o-1]};break;case 29:r.getLogger().debug("Rule: node (NODE_ID separator): ",a[o]),this.$={id:a[o]};break;case 30:r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",a[o-1],a[o]),this.$={id:a[o-1],label:a[o].label,typeStr:a[o].typeStr,directions:a[o].directions};break;case 31:r.getLogger().debug("Rule: dirList: ",a[o]),this.$=[a[o]];break;case 32:r.getLogger().debug("Rule: dirList: ",a[o-1],a[o]),this.$=[a[o-1]].concat(a[o]);break;case 33:r.getLogger().debug("Rule: nodeShapeNLabel: ",a[o-2],a[o-1],a[o]),this.$={typeStr:a[o-2]+a[o],label:a[o-1]};break;case 34:r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",a[o-3],a[o-2]," #3:",a[o-1],a[o]),this.$={typeStr:a[o-3]+a[o],label:a[o-2],directions:a[o-1]};break;case 35:case 36:this.$={type:"classDef",id:a[o-1].trim(),css:a[o].trim()};break;case 37:this.$={type:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 38:this.$={type:"applyStyles",id:a[o-1].trim(),stylesStr:a[o].trim()}}}),"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:l,47:c},{8:[1,20]},t(h,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:e,28:n,29:r,31:i,32:a,40:o,44:l,47:c}),t(u,[2,16],{14:22,15:d,16:p}),t(u,[2,17]),t(u,[2,18]),t(u,[2,19]),t(u,[2,20]),t(u,[2,21]),t(u,[2,22]),t(g,[2,25],{27:[1,25]}),t(u,[2,26]),{19:26,26:12,32:a},{11:27,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:l,47:c},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},t(f,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},t(h,[2,13]),{26:35,32:a},{32:[2,14]},{17:[1,36]},t(g,[2,24]),{11:37,13:4,14:22,15:d,16:p,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:l,47:c},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},t(f,[2,30]),{18:[1,43]},{18:[1,44]},t(g,[2,23]),{18:[1,45]},{30:[1,46]},t(u,[2,28]),t(u,[2,35]),t(u,[2,36]),t(u,[2,37]),t(u,[2,38]),{37:[1,47]},{34:48,35:m},{15:[1,50]},t(u,[2,27]),t(f,[2,33]),{39:[1,51]},{34:52,35:m,39:[2,31]},{32:[2,15]},t(f,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},v=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:s((function(t,e,n,r){switch(n){case 0:return 10;case 1:return t.getLogger().debug("Found space-block"),31;case 2:return t.getLogger().debug("Found nl-block"),31;case 3:return t.getLogger().debug("Found space-block"),29;case 4:t.getLogger().debug(".",e.yytext);break;case 5:t.getLogger().debug("_",e.yytext);break;case 6:return 5;case 7:return e.yytext=-1,28;case 8:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 9:case 77:case 78:case 100:this.pushState("md_string");break;case 10:return"MD_STR";case 11:case 35:case 80:this.popState();break;case 12:this.pushState("string");break;case 13:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 14:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 15:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 16:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:case 39:case 41:case 42:case 45:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:case 50:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:case 60:case 61:case 62:case 65:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 63:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 66:case 67:case 68:case 69:case 70:case 71:case 72:return this.pushState("NODE"),36;case 73:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),38;case 75:return t.getLogger().debug("Lex: NODE_ID",e.yytext),32;case 76:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 79:return"NODE_DESCR";case 81:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 84:t.getLogger().debug("LEX POPPING"),this.popState();break;case 85:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 91:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 92:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 94:case 95:case 96:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 97:case 98:case 99:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 101:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 103:case 104:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 105:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}}),"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\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:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return t}();function x(){this.yy={}}return y.lexer=v,s(x,"Parser"),x.prototype=y,y.Parser=x,new x}();UAt.parser=UAt;var GAt=UAt,qAt=new Map,jAt=[],YAt=new Map,WAt=Hn(),HAt=new Map,VAt=s((t=>_n.sanitizeText(t,WAt)),"sanitizeText"),XAt=s((function(t,e=""){let n=HAt.get(t);n||(n={id:t,styles:[],textStyles:[]},HAt.set(t,n)),null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp("color").exec(t)){const t=e.replace("fill","bgFill").replace("color","fill");n.textStyles.push(t)}n.styles.push(e)}))}),"addStyleClass"),KAt=s((function(t,e=""){const n=qAt.get(t);null!=e&&(n.styles=e.split(","))}),"addStyle2Node"),ZAt=s((function(t,e){t.split(",").forEach((function(t){let n=qAt.get(t);if(void 0===n){const e=t.trim();n={id:e,type:"na",children:[]},qAt.set(e,n)}n.classes||(n.classes=[]),n.classes.push(e)}))}),"setCssClass"),QAt=s(((t,e)=>{const n=t.flat(),r=[];for(const t of n)if(t.label&&(t.label=VAt(t.label)),"classDef"!==t.type)if("applyClass"!==t.type)if("applyStyles"!==t.type)if("column-setting"===t.type)e.columns=t.columns??-1;else if("edge"===t.type){const e=(YAt.get(t.id)??0)+1;YAt.set(t.id,e),t.id=e+"-"+t.id,jAt.push(t)}else{t.label||("composite"===t.type?t.label="":t.label=t.id);const e=qAt.get(t.id);if(void 0===e?qAt.set(t.id,t):("na"!==t.type&&(e.type=t.type),t.label!==t.id&&(e.label=t.label)),t.children&&QAt(t.children,t),"space"===t.type){const e=t.width??1;for(let n=0;n{m.debug("Clear called"),$n(),tLt={id:"root",type:"composite",children:[],columns:-1},qAt=new Map([["root",tLt]]),JAt=[],HAt=new Map,jAt=[],YAt=new Map}),"clear");function nLt(t){switch(m.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return m.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"}}function rLt(t){return m.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function iLt(t){switch(t.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}s(nLt,"typeStr2Type"),s(rLt,"edgeTypeStr2Type"),s(iLt,"edgeStrToEdgeData");var aLt=0,sLt=s((()=>(aLt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+aLt)),"generateId"),oLt=s((t=>{tLt.children=t,QAt(t,tLt),JAt=tLt.children}),"setHierarchy"),lLt=s((t=>{const e=qAt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1}),"getColumns"),cLt=s((()=>[...qAt.values()]),"getBlocksFlat"),hLt=s((()=>JAt||[]),"getBlocks"),uLt=s((()=>jAt),"getEdges"),dLt=s((t=>qAt.get(t)),"getBlock"),pLt=s((t=>{qAt.set(t.id,t)}),"setBlock"),gLt=s((()=>console),"getLogger"),fLt=s((function(){return HAt}),"getClasses"),mLt={getConfig:s((()=>Ft().block),"getConfig"),typeStr2Type:nLt,edgeTypeStr2Type:rLt,edgeStrToEdgeData:iLt,getLogger:gLt,getBlocksFlat:cLt,getBlocks:hLt,getEdges:uLt,setHierarchy:oLt,getBlock:dLt,setBlock:pLt,getColumns:lLt,getClasses:fLt,clear:eLt,generateId:sLt},yLt=s(((t,e)=>{const n=J,r=n(t,"r"),i=n(t,"g"),a=n(t,"b");return Q(r,i,a,e)}),"fade"),vLt=s((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span,p {\n color: ${t.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${yLt(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${yLt(t.mainBkg,.5)};\n fill: ${yLt(t.clusterBkg,.5)};\n stroke: ${yLt(t.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span,p {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`),"getStyles"),xLt=s(((t,e,n,r)=>{e.forEach((e=>{LLt[e](t,n,r)}))}),"insertMarkers"),bLt=s(((t,e,n)=>{m.trace("Making markers for ",n),t.append("defs").append("marker").attr("id",n+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",n+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")}),"extension"),wLt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",n+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"composition"),kLt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",n+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"aggregation"),TLt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",n+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"dependency"),_Lt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",n+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),ELt=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).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").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",n+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"point"),CLt=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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")}),"circle"),SLt=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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")}),"cross"),ALt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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 L9,13 L14,7 L9,1 Z")}),"barb"),LLt={extension:bLt,composition:wLt,aggregation:kLt,dependency:TLt,lollipop:_Lt,point:ELt,circle:CLt,cross:SLt,barb:ALt},NLt=xLt,ILt=Hn()?.block?.padding??8;function MLt(t,e){if(0===t||!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(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}s(MLt,"calculateBlockPosition");var RLt=s((t=>{let e=0,n=0;for(const r of t.children){const{width:i,height:a,x:s,y:o}=r.size??{width:0,height:0,x:0,y:0};m.debug("getMaxChildSize abc95 child:",r.id,"width:",i,"height:",a,"x:",s,"y:",o,r.type),"space"!==r.type&&(i>e&&(e=i/(t.widthInColumns??1)),a>n&&(n=a))}return{width:e,height:n}}),"getMaxChildSize");function DLt(t,e,n=0,r=0){m.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"sieblingWidth",n),t?.size?.width||(t.size={width:n,height:r,x:0,y:0});let i=0,a=0;if(t.children?.length>0){for(const n of t.children)DLt(n,e);const s=RLt(t);i=s.width,a=s.height,m.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const e of t.children)e.size&&(m.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${i} ${a} ${JSON.stringify(e.size)}`),e.size.width=i*(e.widthInColumns??1)+ILt*((e.widthInColumns??1)-1),e.size.height=a,e.size.x=0,e.size.y=0,m.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${i} maxHeight:${a}`));for(const n of t.children)DLt(n,e,i,a);const o=t.columns??-1;let l=0;for(const e of t.children)l+=e.widthInColumns??1;let c=t.children.length;o>0&&o0?Math.min(t.children.length,o):t.children.length;if(e>0){const n=(u-e*ILt-ILt)/e;m.debug("abc95 (growing to fit) width",t.id,u,t.size?.width,n);for(const e of t.children)e.size&&(e.size.width=n)}}t.size={width:u,height:d,x:0,y:0}}m.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function OLt(t,e){m.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);const n=t.columns??-1;if(m.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const e=t?.children[0]?.size?.width??0,r=t.children.length*e+(t.children.length-1)*ILt;m.debug("widthOfChildren 88",r,"posX");let i=0;m.debug("abc91 block?.size?.x",t.id,t?.size?.x);let a=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-ILt,s=0;for(const e of t.children){const r=t;if(!e.size)continue;const{width:o,height:l}=e.size,{px:c,py:h}=MLt(n,i);if(h!=s&&(s=h,a=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-ILt,m.debug("New row in layout for block",t.id," and child ",e.id,s)),m.debug(`abc89 layout blocks (child) id: ${e.id} Pos: ${i} (px, py) ${c},${h} (${r?.size?.x},${r?.size?.y}) parent: ${r.id} width: ${o}${ILt}`),r.size){const t=o/2;e.size.x=a+ILt+t,m.debug(`abc91 layout blocks (calc) px, pyid:${e.id} startingPos=X${a} new startingPosX${e.size.x} ${t} padding=${ILt} width=${o} halfWidth=${t} => x:${e.size.x} y:${e.size.y} ${e.widthInColumns} (width * (child?.w || 1)) / 2 ${o*(e?.widthInColumns??1)/2}`),a=e.size.x+t,e.size.y=r.size.y-r.size.height/2+h*(l+ILt)+l/2+ILt,m.debug(`abc88 layout blocks (calc) px, pyid:${e.id}startingPosX${a}${ILt}${t}=>x:${e.size.x}y:${e.size.y}${e.widthInColumns}(width * (child?.w || 1)) / 2${o*(e?.widthInColumns??1)/2}`)}e.children&&OLt(e),i+=e?.widthInColumns??1,m.debug("abc88 columnsPos",e,i)}}m.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function PLt(t,{minX:e,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:a,y:s,width:o,height:l}=t.size;a-o/2r&&(r=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:n,maxX:r,maxY:i}=PLt(a,{minX:e,minY:n,maxX:r,maxY:i}));return{minX:e,minY:n,maxX:r,maxY:i}}function BLt(t){const e=t.getBlock("root");if(!e)return;DLt(e,t,0,0),OLt(e),m.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:r,maxX:i,maxY:a}=PLt(e);return{x:n,y:r,width:i-n,height:a-r}}function $Lt(t,e){e&&t.attr("style",e)}function FLt(t){const e=Oa(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=e.append("xhtml:div"),r=t.label,i=t.isNode?"nodeLabel":"edgeLabel",a=n.append("span");return a.html(r),$Lt(a,t.labelStyle),a.attr("class",i),$Lt(n,t.labelStyle),n.style("display","inline-block"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}s(DLt,"setBlockSizes"),s(OLt,"layoutBlocks"),s(PLt,"findBounds"),s(BLt,"layout"),s($Lt,"applyStyle"),s(FLt,"addHtmlLabel");var zLt=s(((t,e,n,r)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),dn(Hn().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),m.debug("vertexText"+i);return FLt({isNode:r,label:XT(xk(i)),labelStyle:e.replace("fill:","color:")})}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let r=[];r="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(const e of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),n?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=e.trim(),t.appendChild(r)}return t}}),"createLabel"),ULt=s(((t,e,n,r,i)=>{e.arrowTypeStart&&qLt(t,"start",e.arrowTypeStart,n,r,i),e.arrowTypeEnd&&qLt(t,"end",e.arrowTypeEnd,n,r,i)}),"addEdgeMarkers"),GLt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},qLt=s(((t,e,n,r,i,a)=>{const s=GLt[n];if(!s)return void m.warn(`Unknown arrow type: ${n}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${r}#${i}_${a}-${s}${o})`)}),"addEdgeMarker"),jLt={},YLt={},WLt=s(((t,e)=>{const n=Hn(),r=dn(n.flowchart.htmlLabels),i="markdown"===e.labelType?KT(t,e.label,{style:e.labelStyle,useHtmlLabels:r,addSvgBackground:!0},n):zLt(e.label,e.labelStyle),a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(i);let o,l=i.getBBox();if(r){const t=i.children[0],e=Oa(i);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}if(s.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),jLt[e.id]=a,e.width=l.width,e.height=l.height,e.startLabelLeft){const n=zLt(e.startLabelLeft,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),YLt[e.id]||(YLt[e.id]={}),YLt[e.id].startLeft=r,HLt(o,e.startLabelLeft)}if(e.startLabelRight){const n=zLt(e.startLabelRight,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=r.node().appendChild(n),i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),YLt[e.id]||(YLt[e.id]={}),YLt[e.id].startRight=r,HLt(o,e.startLabelRight)}if(e.endLabelLeft){const n=zLt(e.endLabelLeft,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),YLt[e.id]||(YLt[e.id]={}),YLt[e.id].endLeft=r,HLt(o,e.endLabelLeft)}if(e.endLabelRight){const n=zLt(e.endLabelRight,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),YLt[e.id]||(YLt[e.id]={}),YLt[e.id].endRight=r,HLt(o,e.endLabelRight)}return i}),"insertEdgeLabel");function HLt(t,e){Hn().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}s(HLt,"setTerminalWidth");var VLt=s(((t,e)=>{m.debug("Moving label abc88 ",t.id,t.label,jLt[t.id],e);let n=e.updatedPath?e.updatedPath:e.originalPath;const r=Hn(),{subGraphTitleTotalMargin:i}=Gm(r);if(t.label){const r=jLt[t.id];let a=t.x,s=t.y;if(n){const r=yk.calcLabelPosition(n);m.debug("Moving label "+t.label+" from (",a,",",s,") to (",r.x,",",r.y,") abc88"),e.updatedPath&&(a=r.x,s=r.y)}r.attr("transform",`translate(${a}, ${s+i/2})`)}if(t.startLabelLeft){const e=YLt[t.id].startLeft;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.startLabelRight){const e=YLt[t.id].startRight;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.endLabelLeft){const e=YLt[t.id].endLeft;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.endLabelRight){const e=YLt[t.id].endRight;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}}),"positionEdgeLabel"),XLt=s(((t,e)=>{const n=t.x,r=t.y,i=Math.abs(e.x-n),a=Math.abs(e.y-r),s=t.width/2,o=t.height/2;return i>=s||a>=o}),"outsideNode"),KLt=s(((t,e,n)=>{m.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const r=t.x,i=t.y,a=Math.abs(r-n.x),s=t.width/2;let o=n.xMath.abs(r-e.x)*l){let t=n.y{m.debug("abc88 cutPathAtIntersect",t,e);let n=[],r=t[0],i=!1;return t.forEach((t=>{if(XLt(e,t)||i)r=t,i||n.push(t);else{const a=KLt(e,r,t);let s=!1;n.forEach((t=>{s=s||t.x===a.x&&t.y===a.y})),n.some((t=>t.x===a.x&&t.y===a.y))||n.push(a),i=!0}})),n}),"cutPathAtIntersect"),QLt=s((function(t,e,n,r,i,a,s){let o=n.points;m.debug("abc88 InsertEdge: edge=",n,"e=",e);let l=!1;const c=a.node(e.v);var h=a.node(e.w);h?.intersect&&c?.intersect&&(o=o.slice(1,n.points.length-1),o.unshift(c.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),n.toCluster&&(m.debug("to cluster abc88",r[n.toCluster]),o=ZLt(n.points,r[n.toCluster].node),l=!0),n.fromCluster&&(m.debug("from cluster abc88",r[n.fromCluster]),o=ZLt(o.reverse(),r[n.fromCluster].node).reverse(),l=!0);const u=o.filter((t=>!Number.isNaN(t.y)));let d=iu;!n.curve||"graph"!==i&&"flowchart"!==i||(d=n.curve);const{x:p,y:g}=kS(n),f=Xh().x(p).y(g).curve(d);let y;switch(n.thickness){case"normal":y="edge-thickness-normal";break;case"thick":case"invisible":y="edge-thickness-thick";break;default:y=""}switch(n.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed"}const v=t.append("path").attr("d",f(u)).attr("id",n.id).attr("class"," "+y+(n.classes?" "+n.classes:"")).attr("style",n.style);let x="";(Hn().flowchart.arrowMarkerAbsolute||Hn().state.arrowMarkerAbsolute)&&(x=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,x=x.replace(/\(/g,"\\("),x=x.replace(/\)/g,"\\)")),ULt(v,n,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=n.points,b}),"insertEdge"),JLt=s((t=>{const e=new Set;for(const n of t)switch(n){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(n)}return e}),"expandAndDeduplicateDirections"),tNt=s(((t,e,n)=>{const r=JLt(t),i=e.height+2*n.padding,a=i/2,s=e.width+2*a+n.padding,o=n.padding/2;return r.has("right")&&r.has("left")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:a,y:0},{x:s/2,y:2*o},{x:s-a,y:0},{x:s,y:0},{x:s,y:-i/3},{x:s+2*o,y:-i/2},{x:s,y:-2*i/3},{x:s,y:-i},{x:s-a,y:-i},{x:s/2,y:-i-2*o},{x:a,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*o,y:-i/2},{x:0,y:-i/3}]:r.has("right")&&r.has("left")&&r.has("up")?[{x:a,y:0},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}]:r.has("right")&&r.has("left")&&r.has("down")?[{x:0,y:0},{x:a,y:-i},{x:s-a,y:-i},{x:s,y:0}]:r.has("right")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:s,y:-a},{x:s,y:-i+a},{x:0,y:-i}]:r.has("left")&&r.has("up")&&r.has("down")?[{x:s,y:0},{x:0,y:-a},{x:0,y:-i+a},{x:s,y:-i}]:r.has("right")&&r.has("left")?[{x:a,y:0},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i},{x:0,y:-i/2}]:r.has("up")&&r.has("down")?[{x:s/2,y:0},{x:0,y:-o},{x:a,y:-o},{x:a,y:-i+o},{x:0,y:-i+o},{x:s/2,y:-i},{x:s,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o},{x:s,y:-o}]:r.has("right")&&r.has("up")?[{x:0,y:0},{x:s,y:-a},{x:0,y:-i}]:r.has("right")&&r.has("down")?[{x:0,y:0},{x:s,y:0},{x:0,y:-i}]:r.has("left")&&r.has("up")?[{x:s,y:0},{x:0,y:-a},{x:s,y:-i}]:r.has("left")&&r.has("down")?[{x:s,y:0},{x:0,y:0},{x:s,y:-i}]:r.has("right")?[{x:a,y:-o},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i+o}]:r.has("left")?[{x:a,y:0},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i},{x:0,y:-i/2}]:r.has("up")?[{x:a,y:-o},{x:a,y:-i+o},{x:0,y:-i+o},{x:s/2,y:-i},{x:s,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o}]:r.has("down")?[{x:s/2,y:0},{x:0,y:-o},{x:a,y:-o},{x:a,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o},{x:s,y:-o}]:[{x:0,y:0}]}),"getArrowPoints");function eNt(t,e){return t.intersect(e)}s(eNt,"intersectNode");var nNt=eNt;function rNt(t,e,n,r){var i=t.x,a=t.y,s=i-r.x,o=a-r.y,l=Math.sqrt(e*e*o*o+n*n*s*s),c=Math.abs(e*n*s/l);r.x0}s(oNt,"intersectLine"),s(lNt,"sameSign");var cNt=oNt,hNt=uNt;function uNt(t,e,n){var r=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)})):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=r-t.width/2-s,c=i-t.height/2-o,h=0;h1&&a.sort((function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),s=e.x-n.x,o=e.y-n.y,l=Math.sqrt(s*s+o*o);return a{var n,r,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),n=0===o?0:c*s/o,r=c):(s<0&&(l=-l),n=l,r=0===s?0:l*o/s),{x:i+n,y:a+r}}),"intersectRect"),pNt={node:nNt,circle:sNt,ellipse:iNt,polygon:hNt,rect:dNt},gNt=s((async(t,e,n,r)=>{const i=Hn();let a;const o=e.useHtmlLabels||dn(i.flowchart.htmlLabels);a=n||"node default";const l=t.insert("g").attr("class",a).attr("id",e.domId||e.id),c=l.insert("g").attr("class","label").attr("style",e.labelStyle);let h;h=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];const u=c.node();let d;d="markdown"===e.labelType?KT(c,an(xk(h),i),{useHtmlLabels:o,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):u.appendChild(zLt(an(xk(h),i),e.labelStyle,!1,r));let p=d.getBBox();const g=e.padding/2;if(dn(i.flowchart.htmlLabels)){const t=d.children[0],e=Oa(d),n=t.getElementsByTagName("img");if(n){const t=""===h.replace(/]*>/g,"").trim();await Promise.all([...n].map((e=>new Promise((n=>{function r(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,n=5,r=parseInt(t,10)*n+"px";e.style.minWidth=r,e.style.maxWidth=r}else e.style.width="100%";n(e)}s(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}return o?c.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):c.attr("transform","translate(0, "+-p.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:l,bbox:p,halfPadding:g,label:c}}),"labelHelper"),fNt=s(((t,e)=>{const n=e.node().getBBox();t.width=n.width,t.height=n.height}),"updateNodeBounds");function mNt(t,e,n,r){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+n/2+")")}s(mNt,"insertPolygonShape");var yNt=s((async(t,e)=>{e.useHtmlLabels||Hn().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,"node "+e.classes,!0);m.info("Classes = ",e.classes);const a=n.insert("rect",":first-child");return a.attr("rx",e.rx).attr("ry",e.ry).attr("x",-r.width/2-i).attr("y",-r.height/2-i).attr("width",r.width+e.padding).attr("height",r.height+e.padding),fNt(e,a),e.intersect=function(t){return pNt.rect(e,t)},n}),"note"),vNt=yNt,xNt=s((t=>t?" "+t:""),"formatClass"),bNt=s(((t,e)=>`${e||"node default"}${xNt(t.classes)} ${xNt(t.class)}`),"getClassesFromNode"),wNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding+(r.height+e.padding),a=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];m.info("Question main (Circle)");const s=mNt(n,i,i,a);return s.attr("style",e.style),fNt(e,s),e.intersect=function(t){return m.warn("Intersect called"),pNt.polygon(e,a,t)},n}),"question"),kNt=s(((t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}],i=n.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" "));return i.attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return pNt.circle(e,14,t)},n}),"choice"),TNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.height+e.padding,a=i/4,s=r.width+2*a+e.padding,o=[{x:a,y:0},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}],l=mNt(n,s,i,o);return l.attr("style",e.style),fNt(e,l),e.intersect=function(t){return pNt.polygon(e,o,t)},n}),"hexagon"),_Nt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,void 0,!0),i=r.height+2*e.padding,a=i/2,s=r.width+2*a+e.padding,o=tNt(e.directions,r,e),l=mNt(n,s,i,o);return l.attr("style",e.style),fNt(e,l),e.intersect=function(t){return pNt.polygon(e,o,t)},n}),"block_arrow"),ENt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return mNt(n,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"rect_left_inv_arrow"),CNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e),!0),i=r.width+e.padding,a=r.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"lean_right"),SNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"lean_left"),ANt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"trapezoid"),LNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"inv_trapezoid"),NNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"rect_right_inv_arrow"),INt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=i/2,s=a/(2.5+i/50),o=r.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,c=n.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return fNt(e,c),e.intersect=function(t){const n=pNt.rect(e,t),r=n.x-e.x;if(0!=a&&(Math.abs(r)e.height/2-s)){let i=s*s*(1-r*r/(a*a));0!=i&&(i=Math.sqrt(i)),i=s-i,t.y-e.y>0&&(i=-i),n.y+=i}return n},n}),"cylinder"),MNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,"node "+e.classes+" "+e.class,!0),a=n.insert("rect",":first-child"),s=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,l=e.positioned?-s/2:-r.width/2-i,c=e.positioned?-o/2:-r.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ONt(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{m.warn(`Unknown node property ${t}`)}))}return fNt(e,a),e.intersect=function(t){return pNt.rect(e,t)},n}),"rect"),RNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,"node "+e.classes,!0),a=n.insert("rect",":first-child"),s=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,l=e.positioned?-s/2:-r.width/2-i,c=e.positioned?-o/2:-r.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ONt(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{m.warn(`Unknown node property ${t}`)}))}return fNt(e,a),e.intersect=function(t){return pNt.rect(e,t)},n}),"composite"),DNt=s((async(t,e)=>{const{shapeSvg:n}=await gNt(t,e,"label",!0);m.trace("Classes = ",e.class);const r=n.insert("rect",":first-child");if(r.attr("width",0).attr("height",0),n.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ONt(r,e.props.borders,0,0),t.delete("borders")),t.forEach((t=>{m.warn(`Unknown node property ${t}`)}))}return fNt(e,r),e.intersect=function(t){return pNt.rect(e,t)},n}),"labelRect");function ONt(t,e,n,r){const i=[],a=s((t=>{i.push(t,0)}),"addBorder"),o=s((t=>{i.push(0,t)}),"skipBorder");e.includes("t")?(m.debug("add top border"),a(n)):o(n),e.includes("r")?(m.debug("add right border"),a(r)):o(r),e.includes("b")?(m.debug("add bottom border"),a(n)):o(n),e.includes("l")?(m.debug("add left border"),a(r)):o(r),t.attr("stroke-dasharray",i.join(" "))}s(ONt,"applyNodePropertyBorders");var PNt=s(((t,e)=>{let n;n=e.classes?"node "+e.classes:"node default";const r=t.insert("g").attr("class",n).attr("id",e.domId||e.id),i=r.insert("rect",":first-child"),a=r.insert("line"),s=r.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,m.info("Label text abc79",l,o,"object"==typeof o);const c=s.node().appendChild(zLt(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(dn(Hn().flowchart.htmlLabels)){const t=c.children[0],e=Oa(c);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}m.info("Text 2",o);const u=o.slice(1,o.length);let d=c.getBBox();const p=s.node().appendChild(zLt(u.join?u.join("
    "):u,e.labelStyle,!0,!0));if(dn(Hn().flowchart.htmlLabels)){const t=p.children[0],e=Oa(p);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}const g=e.padding/2;return Oa(p).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+g+5)+")"),Oa(c).attr("transform","translate( "+(h.width{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.height+e.padding,a=r.width+i/4+e.padding,s=n.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return fNt(e,s),e.intersect=function(t){return pNt.rect(e,t)},n}),"stadium"),$Nt=s((async(t,e)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,bNt(e,void 0),!0),a=n.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+i).attr("width",r.width+e.padding).attr("height",r.height+e.padding),m.info("Circle main"),fNt(e,a),e.intersect=function(t){return m.info("Circle intersect",e,r.width/2+i,t),pNt.circle(e,r.width/2+i,t)},n}),"circle"),FNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,bNt(e,void 0),!0),a=n.insert("g",":first-child"),s=a.insert("circle"),o=a.insert("circle");return a.attr("class",e.class),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+i+5).attr("width",r.width+e.padding+10).attr("height",r.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+i).attr("width",r.width+e.padding).attr("height",r.height+e.padding),m.info("DoubleCircle main"),fNt(e,s),e.intersect=function(t){return m.info("DoubleCircle intersect",e,r.width/2+i+5,t),pNt.circle(e,r.width/2+i+5,t)},n}),"doublecircle"),zNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"subroutine"),UNt=s(((t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=n.insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),fNt(e,r),e.intersect=function(t){return pNt.circle(e,7,t)},n}),"start"),GNt=s(((t,e,n)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;"LR"===n&&(i=10,a=70);const s=r.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return fNt(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return pNt.rect(e,t)},r}),"forkJoin"),qNt=s(((t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=n.insert("circle",":first-child"),i=n.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),fNt(e,i),e.intersect=function(t){return pNt.circle(e,7,t)},n}),"end"),jNt=s(((t,e)=>{const n=e.padding/2;let r;r=e.classes?"node "+e.classes:"node default";const i=t.insert("g").attr("class",r).attr("id",e.domId||e.id),a=i.insert("rect",":first-child"),s=i.insert("line"),o=i.insert("line");let l=0,c=4;const h=i.insert("g").attr("class","label");let u=0;const d=e.classData.annotations?.[0],p=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",g=h.node().appendChild(zLt(p,e.labelStyle,!0,!0));let f=g.getBBox();if(dn(Hn().flowchart.htmlLabels)){const t=g.children[0],e=Oa(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}e.classData.annotations[0]&&(c+=f.height+4,l+=f.width);let m=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(Hn().flowchart.htmlLabels?m+="<"+e.classData.type+">":m+="<"+e.classData.type+">");const y=h.node().appendChild(zLt(m,e.labelStyle,!0,!0));Oa(y).attr("class","classTitle");let v=y.getBBox();if(dn(Hn().flowchart.htmlLabels)){const t=y.children[0],e=Oa(y);v=t.getBoundingClientRect(),e.attr("width",v.width),e.attr("height",v.height)}c+=v.height+4,v.width>l&&(l=v.width);const x=[];e.classData.members.forEach((t=>{const n=t.getDisplayDetails();let r=n.displayText;Hn().flowchart.htmlLabels&&(r=r.replace(//g,">"));const i=h.node().appendChild(zLt(r,n.cssStyle?n.cssStyle:e.labelStyle,!0,!0));let a=i.getBBox();if(dn(Hn().flowchart.htmlLabels)){const t=i.children[0],e=Oa(i);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,x.push(i)})),c+=8;const b=[];if(e.classData.methods.forEach((t=>{const n=t.getDisplayDetails();let r=n.displayText;Hn().flowchart.htmlLabels&&(r=r.replace(//g,">"));const i=h.node().appendChild(zLt(r,n.cssStyle?n.cssStyle:e.labelStyle,!0,!0));let a=i.getBBox();if(dn(Hn().flowchart.htmlLabels)){const t=i.children[0],e=Oa(i);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,b.push(i)})),c+=8,d){let t=(l-f.width)/2;Oa(g).attr("transform","translate( "+(-1*l/2+t)+", "+-1*c/2+")"),u=f.height+4}let w=(l-v.width)/2;return Oa(y).attr("transform","translate( "+(-1*l/2+w)+", "+(-1*c/2+u)+")"),u+=v.height+4,s.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+u).attr("y2",-c/2-n+8+u),u+=8,x.forEach((t=>{Oa(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u+4)+")");const e=t?.getBBox();u+=(e?.height??0)+4})),u+=8,o.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+u).attr("y2",-c/2-n+8+u),u+=8,b.forEach((t=>{Oa(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u)+")");const e=t?.getBBox();u+=(e?.height??0)+4})),a.attr("style",e.style).attr("class","outer title-state").attr("x",-l/2-n).attr("y",-c/2-n).attr("width",l+e.padding).attr("height",c+e.padding),fNt(e,a),e.intersect=function(t){return pNt.rect(e,t)},i}),"class_box"),YNt={rhombus:wNt,composite:RNt,question:wNt,rect:MNt,labelRect:DNt,rectWithTitle:PNt,choice:kNt,circle:$Nt,doublecircle:FNt,stadium:BNt,hexagon:TNt,block_arrow:_Nt,rect_left_inv_arrow:ENt,lean_right:CNt,lean_left:SNt,trapezoid:ANt,inv_trapezoid:LNt,rect_right_inv_arrow:NNt,cylinder:INt,start:UNt,end:qNt,note:vNt,subroutine:zNt,fork:GNt,join:GNt,class_box:jNt},WNt={},HNt=s((async(t,e,n)=>{let r,i;if(e.link){let a;"sandbox"===Hn().securityLevel?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),r=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await YNt[e.shape](r,e,n)}else i=await YNt[e.shape](t,e,n),r=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),WNt[e.id]=r,e.haveCallback&&WNt[e.id].attr("class",WNt[e.id].attr("class")+" clickable"),r}),"insertNode"),VNt=s((t=>{const e=WNt[t.id];m.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n}),"positionNode");function XNt(t,e,n=!1){const r=t;let i="default";(r?.classes?.length||0)>0&&(i=(r?.classes??[]).join(" ")),i+=" flowchart-label";let a,s=0,o="";switch(r.type){case"round":s=5,o="rect";break;case"composite":s=0,o="composite",a=0;break;case"square":case"group":default:o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":case"rect_left_inv_arrow":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"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"doublecircle":o="doublecircle"}const l=Qw(r?.styles??[]),c=r.label,h=r.size??{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:o,labelText:c,rx:s,ry:s,class:i,style:l.style,id:r.id,directions:r.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:n,intersect:void 0,type:r.type,padding:a??Ft()?.block?.padding??0}}async function KNt(t,e,n){const r=XNt(e,0,!1);if("group"===r.type)return;const i=Ft(),a=await HNt(t,r,{config:i}),s=a.node().getBBox(),o=n.getBlock(r.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},n.setBlock(o),a.remove()}async function ZNt(t,e,n){const r=XNt(e,0,!0);if("space"!==n.getBlock(r.id).type){const n=Ft();await HNt(t,r,{config:n}),e.intersect=r?.intersect,VNt(r)}}async function QNt(t,e,n,r){for(const i of e)await r(t,i,n),i.children&&await QNt(t,i.children,n,r)}async function JNt(t,e,n){await QNt(t,e,n,KNt)}async function tIt(t,e,n){await QNt(t,e,n,ZNt)}async function eIt(t,e,n,r,i){const a=new nq({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const t of n)t.size&&a.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(const n of e)if(n.start&&n.end){const e=r.getBlock(n.start),s=r.getBlock(n.end);if(e?.size&&s?.size){const r=e.size,o=s.size,l=[{x:r.x,y:r.y},{x:r.x+(o.x-r.x)/2,y:r.y+(o.y-r.y)/2},{x:o.x,y:o.y}];QLt(t,{v:n.start,w:n.end,name:n.id},{...n,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),n.label&&(await WLt(t,{...n,label:n.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),VLt({...n,x:l[1].x,y:l[1].y},{originalPath:l}))}}}s(XNt,"getNodeFromBlock"),s(KNt,"calculateBlockSize"),s(ZNt,"insertBlockPositioned"),s(QNt,"performOperations"),s(JNt,"calculateBlockSizes"),s(tIt,"insertBlocks"),s(eIt,"insertEdges");var nIt=s((function(t,e){return e.db.getClasses()}),"getClasses"),rIt=s((async function(t,e,n,r){const{securityLevel:i,block:a}=Ft(),s=r.db;let o;"sandbox"===i&&(o=Oa("#i"+e));const l=Oa("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${e}"]`):Oa(`[id="${e}"]`);NLt(c,["point","circle","cross"],r.type,e);const h=s.getBlocks(),u=s.getBlocksFlat(),d=s.getEdges(),p=c.insert("g").attr("class","block");await JNt(p,h,s);const g=BLt(s);if(await tIt(p,h,s),await eIt(p,d,u,s,e),g){const t=g,e=Math.max(1,Math.round(t.width/t.height*.125)),n=t.height+e+10,r=t.width+10,{useMaxWidth:i}=a;Sn(c,n,r,!!i),m.debug("Here Bounds",g,t),c.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}}),"draw"),iIt={parser:GAt,db:mLt,renderer:{draw:rIt,getClasses:nIt},styles:vLt},aIt=Object.freeze({__proto__:null,diagram:iIt}),sIt=o({"../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js"(t,e){s((function(n,r){"object"==typeof t&&"object"==typeof e?e.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof t?t.layoutBase=r():n.layoutBase=r()}),"webpackUniversalModuleDefinition")(t,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return s(n,"__webpack_require__"),n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?s((function(){return t.default}),"getDefault"):s((function(){return t}),"getModuleExports");return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=28)}([function(t,e,n){function r(){}s(r,"LayoutConstants"),r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,t.exports=r},function(t,e,n){var r=n(2),i=n(8),a=n(9);function o(t,e,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=t,this.target=e}for(var l in s(o,"LEdge"),o.prototype=Object.create(r.prototype),r)o[l]=r[l];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(t,e){for(var n=this.getOtherEnd(t),r=e.getGraphManager().getRoot();;){if(n.getOwner()==e)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=o},function(t,e,n){function r(t){this.vGraphObject=t}s(r,"LGraphObject"),t.exports=r},function(t,e,n){var r=n(2),i=n(10),a=n(13),o=n(0),l=n(16),c=n(5);function h(t,e,n,s){null==n&&null==s&&(s=e),r.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,this.rect=null!=n&&null!=e?new a(e.x,e.y,n.width,n.height):new a}for(var u in s(h,"LNode"),h.prototype=Object.create(r.prototype),r)h[u]=r[u];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(t){this.rect.width=t},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(t){this.rect.height=t},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},h.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},h.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},h.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},h.prototype.getEdgeListToNode=function(t){var e=[],n=this;return n.edges.forEach((function(r){if(r.target==t){if(r.source!=n)throw"Incorrect edge source!";e.push(r)}})),e},h.prototype.getEdgesBetween=function(t){var e=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=t&&r.source!=t||e.push(r)})),e},h.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(n){if(n.source==e)t.add(n.target);else{if(n.target!=e)throw"Incorrect incidency!";t.add(n.source)}})),t},h.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),n=0;ne?(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(e+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(t){var e=this.rect.x;e>o.WORLD_BOUNDARY?e=o.WORLD_BOUNDARY:e<-o.WORLD_BOUNDARY&&(e=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(e,n),i=t.inverseTransformPoint(r);this.setLocation(i.x,i.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=h},function(t,e,n){var r=n(0);function i(){}for(var a in s(i,"FDLayoutConstants"),r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,n){function r(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}s(r,"PointD"),r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=r},function(t,e,n){var r=n(2),i=n(10),a=n(0),o=n(7),l=n(3),c=n(1),h=n(13),u=n(12),d=n(11);function p(t,e,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof o?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var g in s(p,"LGraph"),p.prototype=Object.create(r.prototype),r)p[g]=r[g];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(t,e,n){if(null==e&&null==n){var r=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(e.owner!=n.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=n.owner?null:(i.source=e,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),n!=e&&n.edges.push(i),i)},p.prototype.remove=function(t){var e=t;if(t instanceof l){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=e.edges.slice(),r=n.length,i=0;i-1&&h>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(o,1),a.target!=a.source&&a.target.edges.splice(h,1),-1==(s=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(s,1)}},p.prototype.updateLeftTop=function(){for(var t,e,n,r=i.MAX_VALUE,a=i.MAX_VALUE,s=this.getNodes(),o=s.length,l=0;l(t=c.getTop())&&(r=t),a>(e=c.getLeft())&&(a=e)}return r==i.MAX_VALUE?null:(n=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},p.prototype.updateBounds=function(t){for(var e,n,r,a,s,o=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,u=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;g(e=f.getLeft())&&(o=e),l<(n=f.getRight())&&(l=n),c>(r=f.getTop())&&(c=r),u<(a=f.getBottom())&&(u=a)}var m=new h(o,c,l-o,u-c);o==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-s,this.right=m.x+m.width+s,this.top=m.y-s,this.bottom=m.y+m.height+s},p.calculateBounds=function(t){for(var e,n,r,a,s=i.MAX_VALUE,o=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,u=t.length,d=0;d(e=p.getLeft())&&(s=e),o<(n=p.getRight())&&(o=n),l>(r=p.getTop())&&(l=r),c<(a=p.getBottom())&&(c=a)}return new h(s,l,o-s,c-l)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,n=e.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(e){e.owner==t&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=p},function(t,e,n){var r,i=n(1);function a(t){r=n(6),this.layout=t,this.graphs=[],this.edges=[]}s(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),n=this.add(t,e);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(t,e,n,r,i){if(null==n&&null==r&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=n,n=t;var a=(r=e).getOwner(),s=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==s)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(t){if(t instanceof r){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],s=(a=a.concat(e.getEdges())).length,o=0;o=e.getRight()?n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var a=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(a=1);var s=a*n[0],o=n[1]/a;n[0]s)return n[0]=r,n[1]=l,n[2]=a,n[3]=x,!1;if(ia)return n[0]=o,n[1]=i,n[2]=y,n[3]=s,!1;if(ra?(n[0]=h,n[1]=u,T=!0):(n[0]=c,n[1]=l,T=!0):E===S&&(r>a?(n[0]=o,n[1]=l,T=!0):(n[0]=d,n[1]=u,T=!0)),-C===S?a>r?(n[2]=v,n[3]=x,_=!0):(n[2]=y,n[3]=m,_=!0):C===S&&(a>r?(n[2]=f,n[3]=m,_=!0):(n[2]=b,n[3]=x,_=!0)),T&&_)return!1;if(r>a?i>s?(A=this.getCardinalDirection(E,S,4),L=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-E,S,3),L=this.getCardinalDirection(-C,S,1)):i>s?(A=this.getCardinalDirection(-E,S,1),L=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(E,S,2),L=this.getCardinalDirection(C,S,4)),!T)switch(A){case 1:I=l,N=r+-g/S,n[0]=N,n[1]=I;break;case 2:N=d,I=i+p*S,n[0]=N,n[1]=I;break;case 3:I=u,N=r+g/S,n[0]=N,n[1]=I;break;case 4:N=h,I=i+-p*S,n[0]=N,n[1]=I}if(!_)switch(L){case 1:R=m,M=a+-k/S,n[2]=M,n[3]=R;break;case 2:M=b,R=s+w*S,n[2]=M,n[3]=R;break;case 3:R=x,M=a+k/S,n[2]=M,n[3]=R;break;case 4:M=v,R=s+-w*S,n[2]=M,n[3]=R}}return!1},i.getCardinalDirection=function(t,e,n){return t>e?n:1+n%4},i.getIntersection=function(t,e,n,i){if(null==i)return this.getIntersection2(t,e,n);var a,s,o,l,c,h,u,d=t.x,p=t.y,g=e.x,f=e.y,m=n.x,y=n.y,v=i.x,x=i.y;return 0===(u=(a=f-p)*(l=m-v)-(s=x-y)*(o=d-g))?null:new r((o*(h=v*y-m*x)-l*(c=g*p-d*f))/u,(s*c-a*h)/u)},i.angleOfVector=function(t,e,n,r){var i=void 0;return t!==n?(i=Math.atan((r-e)/(n-t)),n=0){var h=(-l+Math.sqrt(l*l-4*o*c))/(2*o),u=(-l-Math.sqrt(l*l-4*o*c))/(2*o);return h>=0&&h<=1?[h]:u>=0&&u<=1?[u]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,n){function r(){}s(r,"IMath"),r.sign=function(t){return t>0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=r},function(t,e,n){function r(){}s(r,"Integer"),r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n0&&e;){for(o.push(c[0]);o.length>0&&e;){var h=o[0];o.splice(0,1),s.add(h);var u=h.getEdges();for(a=0;a-1&&c.splice(f,1)}s=new Set,l=new Map}else t=[]}return t},p.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],n=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&e.splice(u,1),h.getNeighborsList().forEach((function(t){if(n.indexOf(t)<0){var e=r.get(t)-1;1==e&&l.push(t),r.set(t,e)}}))}n=n.concat(l),1!=e.length&&2!=e.length||(i=!0,a=e[0])}return a},p.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=p},function(t,e,n){function r(){}s(r,"RandomSeed"),r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},t.exports=r},function(t,e,n){var r=n(5);function i(t,e){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(i,"Transform"),i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,n=this.lworldExtX;return 0!=n&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/n),e},i.prototype.transformY=function(t){var e=0,n=this.lworldExtY;return 0!=n&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/n),e},i.prototype.inverseTransformX=function(t){var e=0,n=this.ldeviceExtX;return 0!=n&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/n),e},i.prototype.inverseTransformY=function(t){var e=0,n=this.ldeviceExtY;return 0!=n&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/n),e},i.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,n){function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);ea.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),i=new Set,t=0;t(l=e.getEstimatedSize()*this.gravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*a):(s>(l=e.getEstimatedSize()*this.compoundGravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=l.length||h>=l[0].length))for(var u=0;ut}),"_defaultCompareFunction")}]),t}();t.exports=o},function(t,e,n){function r(){}s(r,"SVD"),r.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var e,n,i=Math.min(this.m,this.n);this.s=function(t){for(var e=[];t-- >0;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=(e=[this.m,i],n=s((function t(e){if(0==e.length)return 0;for(var n=[],r=0;r0;)e.push(0);return e}(this.n),o=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.m),l=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),h=0;h=0;N--)if(0!==this.s[N]){for(var I=N+1;I=0;$--){if(function(t,e){return t&&e}($0;){var H=void 0,V=void 0;for(H=S-2;H>=-1&&-1!==H;H--)if(Math.abs(a[H])<=W+Y*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){a[H]=0;break}if(H===S-2)V=4;else{var X=void 0;for(X=S-1;X>=H&&X!==H;X--){var K=(X!==S?Math.abs(a[X]):0)+(X!==H+1?Math.abs(a[X-1]):0);if(Math.abs(this.s[X])<=W+Y*K){this.s[X]=0;break}}X===H?V=3:X===S-1?V=1:(V=2,H=X)}switch(H++,V){case 1:var Z=a[S-2];a[S-2]=0;for(var Q=S-2;Q>=H;Q--){var J=r.hypot(this.s[Q],Z),tt=this.s[Q]/J,et=Z/J;this.s[Q]=J,Q!==H&&(Z=-et*a[Q-1],a[Q-1]=tt*a[Q-1]);for(var nt=0;nt=this.s[H+1]);){var St=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=St,HMath.abs(e)?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):0!=e?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):n=0,n},t.exports=r},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;i(this,t),this.sequence1=e,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=s,this.iMax=e.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;n--){var r=this.listeners[n];r.event===t&&r.callback===e&&this.listeners.splice(n,1)}},i.emit=function(t,e){for(var n=0;n{var e={45:(t,e,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),t.exports=r},806:(t,e,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in s(i,"CoSEConstants"),r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,t.exports=i},767:(t,e,n)=>{var r=n(551).FDLayoutEdge;function i(t,e,n){r.call(this,t,e,n)}for(var a in s(i,"CoSEEdge"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},880:(t,e,n)=>{var r=n(551).LGraph;function i(t,e,n){r.call(this,t,e,n)}for(var a in s(i,"CoSEGraph"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},578:(t,e,n)=>{var r=n(551).LGraphManager;function i(t){r.call(this,t)}for(var a in s(i,"CoSEGraphManager"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},765:(t,e,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),l=n(767),c=n(806),h=n(902),u=n(551).FDLayoutConstants,d=n(551).LayoutConstants,p=n(551).Point,g=n(551).PointD,f=n(551).DimensionD,m=n(551).Layout,y=n(551).Integer,v=n(551).IGeometry,x=n(551).LGraph,b=n(551).Transform,w=n(551).LinkedList;function k(){r.call(this),this.toBeTiled={},this.constraints={}}for(var T in s(k,"CoSELayout"),k.prototype=Object.create(r.prototype),r)k[T]=r[T];k.prototype.newGraphManager=function(){var t=new i(this);return this.graphManager=t,t},k.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},k.prototype.newNode=function(t){return new o(this.graphManager,t)},k.prototype.newEdge=function(t){return new l(null,null,t)},k.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(c.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},k.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},k.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},k.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(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();e=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(n)}}else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(h.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},k.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.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()),c.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},n=0;n0&&this.updateDisplacements();for(e=0;e0&&(r.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var o=new Map,l=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var h=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*t.length/3;r--)e=Math.floor(Math.random()*(r+1)),n=t[r],t[r]=t[e],t[e]=n;return t},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(e){if(e.left){var n=o.has(e.left)?o.get(e.left):e.left,r=o.has(e.right)?o.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:e.gap})}else{var i=l.has(e.top)?l.get(e.top):e.top,a=l.has(e.bottom)?l.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(i)||(t.nodesInRelativeVertical.push(i),t.nodeToRelativeConstraintMapVertical.set(i,[]),t.dummyToNodeForHorizontalAlignment.has(i)?t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(i).getCenterY())),t.nodesInRelativeVertical.includes(a)||(t.nodesInRelativeVertical.push(a),t.nodeToRelativeConstraintMapVertical.set(a,[]),t.dummyToNodeForHorizontalAlignment.has(a)?t.nodeToTempPositionMapVertical.set(a,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(a,t.idToNodeMap.get(a).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:e.gap})}}));else{var d=new Map,p=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=o.has(t.left)?o.get(t.left):t.left,n=o.has(t.right)?o.get(t.right):t.right;d.has(e)?d.get(e).push(n):d.set(e,[n]),d.has(n)?d.get(n).push(e):d.set(n,[e])}else{var r=l.has(t.top)?l.get(t.top):t.top,i=l.has(t.bottom)?l.get(t.bottom):t.bottom;p.has(r)?p.get(r).push(i):p.set(r,[i]),p.has(i)?p.get(i).push(r):p.set(i,[r])}}));var g=s((function(t,e){var n=[],r=[],i=new w,a=new Set,s=0;return t.forEach((function(o,l){if(!a.has(l)){n[s]=[],r[s]=!1;var c=l;for(i.push(c),a.add(c),n[s].push(c);0!=i.length;){c=i.shift(),e.has(c)&&(r[s]=!0),t.get(c).forEach((function(t){a.has(t)||(i.push(t),a.add(t),n[s].push(t))}))}s++}})),{components:n,isFixed:r}}),"constructComponents"),f=g(d,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var m=g(p,t.fixedNodesOnVertical);this.componentsOnVertical=m.components,this.fixedComponentsOnVertical=m.isFixed}}},k.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){var n=t.idToNodeMap.get(e.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,n=0;n1)for(o=0;or&&(r=Math.floor(s.y)),a=Math.floor(s.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(d.WORLD_CENTER_X-s.x/2,d.WORLD_CENTER_Y-s.y/2))},k.radialLayout=function(t,e,n){var r=Math.max(this.maxDiagonalInTree(t),c.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(e,null,0,359,0,r);var i=x.calculateBounds(t),a=new b;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var s=0;s1;){var m=f[0];f.splice(0,1);var y=h.indexOf(m);y>=0&&h.splice(y,1),g--,u--}d=null!=e?(h.indexOf(f[0])+1)%g:0;for(var x=Math.abs(r-n)/u,b=d;p!=u;b=++b%g){var w=h[b].getOtherEnd(t);if(w!=e){var T=(n+p*x)%360,_=(T+x)%360;k.branchRadialLayout(w,t,T,_,i+a,a),p++}}},k.maxDiagonalInTree=function(t){for(var e=y.MIN_VALUE,n=0;ne&&(e=r)}return e},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;t.memberGroups[r]=e[n];var i=e[n][0].getParent(),a=new o(t.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,t.idToDummyNode[r]=a;var s=t.getGraphManager().add(t.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;ci?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):"bottom"==r.labelPosVertical&&r.setHeight(a+r.labelHeight))}}))},k.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],n=e.id,r=e.paddingLeft,i=e.paddingTop,a=e.labelMarginLeft,s=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],e.rect.x,e.rect.y,r,i,a,s)}},k.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(n){var r=t.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,s=r.labelMarginLeft,o=r.labelMarginTop;t.adjustLocations(e[n],r.rect.x,r.rect.y,i,a,s,o)}))},k.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var n=t.getChild();if(null==n)return this.toBeTiled[e]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[e]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[e]=!0,!0},k.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),n=0,r=0;rh&&(h=d.rect.height)}n+=h+t.verticalPadding}},k.prototype.tileCompoundMembers=function(t,e){var n=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(r){var i=e[r];if(n.tiledMemberPack[r]=n.tileNodes(t[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,s=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):"right"==i.labelPosHorizontal&&i.setWidth(a+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(s+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>s?(i.rect.y-=(i.labelHeight-s)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-s)/2):"bottom"==i.labelPosVertical&&i.setHeight(s+i.labelHeight))}}))},k.prototype.tileNodes=function(t,e){var n=this.tileNodesByFavoringDim(t,e,!0),r=this.tileNodesByFavoringDim(t,e,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)o&&(o=t.getWidth())}));var l,h=a/i,u=s/i,d=Math.pow(n-r,2)+4*(h+r)*(u+n)*i,p=(r-n+Math.sqrt(d))/(2*(h+r));e?(l=Math.ceil(p))==p&&l++:l=Math.floor(p);var g=l*(h+r)-r;return o>g&&(g=o),g+=2*r},k.prototype.tileNodesByFavoringDim=function(t,e,n){var r=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(t,n));var l=s((function(t){return t.rect.width*t.rect.height}),"getNodeArea"),h=s((function(t,e){return l(e)-l(t)}),"areaCompareFcn");t.sort((function(t,e){var n=h;return o.idealRowWidth?(n=a)(t.id,e.id):n(t,e)}));for(var u=0,d=0,p=0;p0&&(a+=t.horizontalPadding),t.rowWidth[n]=a,t.width0&&(s+=t.verticalPadding);var o=0;s>t.rowHeight[n]&&(o=t.rowHeight[n],t.rowHeight[n]=s,o=t.rowHeight[n]-o),t.height+=o,t.rows[n].push(e)},k.prototype.getShortestRowIndex=function(t){for(var e=-1,n=Number.MAX_VALUE,r=0;rn&&(e=r,n=t.rowWidth[r]);return e},k.prototype.canAddHorizontal=function(t,e,n){if(t.idealRowWidth){var r=t.rows.length-1;return t.rowWidth[r]+e+t.horizontalPadding<=t.idealRowWidth}var i=this.getShortestRowIndex(t);if(i<0)return!0;var a=t.rowWidth[i];if(a+t.horizontalPadding+e<=t.width)return!0;var s,o,l=0;return t.rowHeight[i]0&&(l=n+t.verticalPadding-t.rowHeight[i]),s=t.width-a>=e+t.horizontalPadding?(t.height+l)/(a+e+t.horizontalPadding):(t.height+l)/t.width,l=n+t.verticalPadding,(o=t.widtha&&e!=n){r.splice(-1,1),t.rows[n].push(i),t.rowWidth[e]=t.rowWidth[e]-a,t.rowWidth[n]=t.rowWidth[n]+a,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,o=0;os&&(s=r[o].height);e>0&&(s+=t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[n];t.rowHeight[e]=s,t.rowHeight[n]0)for(var h=i;h<=a;h++)l[0]+=this.grid[h][s-1].length+this.grid[h][s].length-1;if(a0)for(h=s;h<=o;h++)l[3]+=this.grid[i-1][h].length+this.grid[i][h].length-1;for(var d,p,g=y.MAX_VALUE,f=0;f{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(t,e,n,i){r.call(this,t,e,n,i)}for(var o in s(a,"CoSENode"),a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(t,e){for(var n,r=this.getChild().getNodes(),i=0;i{function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0){var a=0;r.forEach((function(t){"horizontal"==e?(p.set(t,c.has(t)?h[c.get(t)]:i.get(t)),a+=p.get(t)):(p.set(t,c.has(t)?u[c.get(t)]:i.get(t)),a+=p.get(t))})),a/=r.length,t.forEach((function(t){n.has(t)||p.set(t,a)}))}else{var s=0;t.forEach((function(t){s+="horizontal"==e?c.has(t)?h[c.get(t)]:i.get(t):c.has(t)?u[c.get(t)]:i.get(t)})),s/=t.length,t.forEach((function(t){p.set(t,s)}))}}));for(var m=s((function(){var r=f.shift();t.get(r).forEach((function(t){if(p.get(t.id)s&&(s=v),xo&&(o=x)}}catch(t){d=!0,g=t}finally{try{!l&&m.return&&m.return()}finally{if(d)throw g}}var b=(r+s)/2-(a+o)/2,w=!0,k=!1,T=void 0;try{for(var _,E=t[Symbol.iterator]();!(w=(_=E.next()).done);w=!0){var C=_.value;p.set(C,p.get(C)+b)}}catch(t){k=!0,T=t}finally{try{!w&&E.return&&E.return()}finally{if(k)throw T}}}))}return p}),"findAppropriatePositionForRelativePlacement"),x=s((function(t){var e=0,n=0,r=0,i=0;if(t.forEach((function(t){t.left?h[c.get(t.left)]-h[c.get(t.right)]>=0?e++:n++:u[c.get(t.top)]-u[c.get(t.bottom)]>=0?r++:i++})),e>n&&r>i)for(var a=0;an)for(var s=0;si)for(var o=0;o1)e.fixedNodeConstraint.forEach((function(t,e){T[e]=[t.position.x,t.position.y],_[e]=[h[c.get(t.nodeId)],u[c.get(t.nodeId)]]})),E=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var n=e.alignmentConstraint.vertical,i=s((function(e){var i=new Set;n[e].forEach((function(t){i.add(t)}));var a=new Set([].concat(r(i)).filter((function(t){return S.has(t)}))),s=void 0;s=a.size>0?h[c.get(a.values().next().value)]:y(i).x,n[e].forEach((function(e){T[t]=[s,u[c.get(e)]],_[t]=[h[c.get(e)],u[c.get(e)]],t++}))}),"_loop2"),a=0;a0?h[c.get(i.values().next().value)]:y(n).y,o[e].forEach((function(e){T[t]=[h[c.get(e)],a],_[t]=[h[c.get(e)],u[c.get(e)]],t++}))}),"_loop3"),d=0;dI&&(I=N[R].length,M=R);if(I0){var X={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var n={x:h[c.get(t.nodeId)],y:u[c.get(t.nodeId)]},r=t.position,i=m(r,n);X.x+=i.x,X.y+=i.y})),X.x/=e.fixedNodeConstraint.length,X.y/=e.fixedNodeConstraint.length,h.forEach((function(t,e){h[e]+=X.x})),u.forEach((function(t,e){u[e]+=X.y})),e.fixedNodeConstraint.forEach((function(t){h[c.get(t.nodeId)]=t.position.x,u[c.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var K=e.alignmentConstraint.vertical,Z=s((function(t){var e=new Set;K[t].forEach((function(t){e.add(t)}));var n=new Set([].concat(r(e)).filter((function(t){return S.has(t)}))),i=void 0;i=n.size>0?h[c.get(n.values().next().value)]:y(e).x,e.forEach((function(t){S.has(t)||(h[c.get(t)]=i)}))}),"_loop4"),Q=0;Q0?u[c.get(n.values().next().value)]:y(e).y,e.forEach((function(t){S.has(t)||(u[c.get(t)]=i)}))}),"_loop5"),et=0;et{e.exports=t}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,r),a.exports}return s(r,"__webpack_require__"),r(45)})()}))}}),lIt=o({"../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.30.2/node_modules/cytoscape-fcose/cytoscape-fcose.js"(t,e){s((function(n,r){"object"==typeof t&&"object"==typeof e?e.exports=r(oIt()):"function"==typeof define&&define.amd?define(["cose-base"],r):"object"==typeof t?t.cytoscapeFcose=r(oIt()):n.cytoscapeFcose=r(n.coseBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return(()=>{var e={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r{var r=function(){function t(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return s(t,"sliceIterator"),function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=n(140).layoutBase.LinkedList,a={getTopMostNodes:function(t){for(var e={},n=0;n0&&s.merge(t)}));for(var h=0;h1){h=l[0],u=h.connectedEdges().length,l.forEach((function(t){t.connectedEdges().length0&&r.set("dummy"+(r.size+1),g),f},relocateComponent:function(t,e,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,c=!1,h=void 0;try{for(var u,d=e.nodeIndexes[Symbol.iterator]();!(l=(u=d.next()).done);l=!0){var p=u.value,g=r(p,2),f=g[0],m=g[1],y=n.cy.getElementById(f);if(y){var v=y.boundingBox(),x=e.xCoords[m]-v.w/2,b=e.xCoords[m]+v.w/2,w=e.yCoords[m]-v.h/2,k=e.yCoords[m]+v.h/2;xa&&(a=b),wo&&(o=k)}}}catch(t){c=!0,h=t}finally{try{!l&&d.return&&d.return()}finally{if(c)throw h}}var T=t.x-(a+i)/2,_=t.y-(o+s)/2;e.xCoords=e.xCoords.map((function(t){return t+T})),e.yCoords=e.yCoords.map((function(t){return t+_}))}else{Object.keys(e).forEach((function(t){var n=e[t],r=n.getRect().x,l=n.getRect().x+n.getRect().width,c=n.getRect().y,h=n.getRect().y+n.getRect().height;ra&&(a=l),co&&(o=h)}));var E=t.x-(a+i)/2,C=t.y-(o+s)/2;Object.keys(e).forEach((function(t){var n=e[t];n.setCenter(n.getCenterX()+E,n.getCenterY()+C)}))}}},calcBoundingBox:function(t,e,n,r){for(var i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,l=void 0,c=void 0,h=void 0,u=void 0,d=t.descendants().not(":parent"),p=d.length,g=0;g(l=e[r.get(f.id())]-f.width()/2)&&(i=l),a<(c=e[r.get(f.id())]+f.width()/2)&&(a=c),s>(h=n[r.get(f.id())]-f.height()/2)&&(s=h),o<(u=n[r.get(f.id())]+f.height()/2)&&(o=u)}var m={};return m.topLeftX=i,m.topLeftY=s,m.width=a-i,m.height=o-s,m},calcParentsWithoutChildren:function(t,e){var n=t.collection();return e.nodes(":parent").forEach((function(t){var e=!1;t.children().forEach((function(t){"none"!=t.css("display")&&(e=!0)})),e||n.merge(t)})),n}};t.exports=a},816:(t,e,n)=>{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,l=n(140).layoutBase.DimensionD,c=n(140).layoutBase.LayoutConstants,h=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants,d=s((function(t,e){var n=t.cy,d=t.eles,p=d.nodes(),g=d.edges(),f=void 0,m=void 0,y=void 0,v={};t.randomize&&(f=e.nodeIndexes,m=e.xCoords,y=e.yCoords);var x=s((function(t){return"function"==typeof t}),"isFn"),b=s((function(t,e){return x(t)?t(e):t}),"optFn"),w=r.calcParentsWithoutChildren(n,d),k=s((function t(e,n,i,s){for(var c=n.length,h=0;h0){t(i.getGraphManager().add(i.newGraph(),p),d,i,s)}}}),"processChildrenList"),T=s((function(e,n,r){for(var i=0,a=0,s=0;s0?u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=i/a:x(t.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,u.MIN_REPULSION_DIST=h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH)}),"processEdges"),_=s((function(t,e){e.fixedNodeConstraint&&(t.constraints.fixedNodeConstraint=e.fixedNodeConstraint),e.alignmentConstraint&&(t.constraints.alignmentConstraint=e.alignmentConstraint),e.relativePlacementConstraint&&(t.constraints.relativePlacementConstraint=e.relativePlacementConstraint)}),"processConstraints");null!=t.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=h.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(u.MAX_ITERATIONS=h.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=h.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=h.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(u.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?c.QUALITY=2:c.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!t.randomize,u.ANIMATE=h.ANIMATE=c.ANIMATE=t.animate,u.TILE=t.tile,u.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!t.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var E=new i,C=E.newGraphManager();return k(C.addRoot(),r.getTopMostNodes(p),E,t),T(E,C,g),_(E,t),E.runLayout(),v}),"coseLayout");t.exports={coseLayout:d}},212:(t,e,n)=>{var r=function(){function t(t,e){for(var n=0;n0)if(d){var p=o.getTopMostNodes(t.eles.nodes());if((a=o.connectComponents(e,t.eles,p)).forEach((function(t){var e=t.boundingBox();h.push({x:e.x1+e.w/2,y:e.y1+e.h/2})})),t.randomize&&a.forEach((function(e){t.eles=e,r.push(l(t))})),"default"==t.quality||"proof"==t.quality){var g=e.collection();if(t.tile){var f=0,m={nodeIndexes:new Map,xCoords:[],yCoords:[]},y=[];if(a.forEach((function(t,e){0==t.edges().length&&(t.nodes().forEach((function(e,n){g.merge(t.nodes()[n]),e.isParent()||(m.nodeIndexes.set(t.nodes()[n].id(),f++),m.xCoords.push(t.nodes()[0].position().x),m.yCoords.push(t.nodes()[0].position().y))})),y.push(e))})),g.length>1){var v=g.boundingBox();h.push({x:v.x1+v.w/2,y:v.y1+v.h/2}),a.push(g),r.push(m);for(var x=y.length-1;x>=0;x--)a.splice(y[x],1),r.splice(y[x],1),h.splice(y[x],1)}}a.forEach((function(e,n){t.eles=e,i.push(c(t,r[n])),o.relocateComponent(h[n],i[n],t)}))}else a.forEach((function(e,n){o.relocateComponent(h[n],r[n],t)}));var b=new Set;if(a.length>1){var w=[],k=n.filter((function(t){return"none"==t.css("display")}));a.forEach((function(e,n){var a=void 0;if("draft"==t.quality&&(a=r[n].nodeIndexes),e.nodes().not(k).length>0){var s={edges:[],nodes:[]},l=void 0;e.nodes().not(k).forEach((function(e){if("draft"==t.quality)if(e.isParent()){var c=o.calcBoundingBox(e,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:c.topLeftX,y:c.topLeftY,width:c.width,height:c.height})}else l=a.get(e.id()),s.nodes.push({x:r[n].xCoords[l]-e.boundingbox().w/2,y:r[n].yCoords[l]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else i[n][e.id()]&&s.nodes.push({x:i[n][e.id()].getLeft(),y:i[n][e.id()].getTop(),width:i[n][e.id()].getWidth(),height:i[n][e.id()].getHeight()})})),e.edges().forEach((function(e){var l=e.source(),c=e.target();if("none"!=l.css("display")&&"none"!=c.css("display"))if("draft"==t.quality){var h=a.get(l.id()),u=a.get(c.id()),d=[],p=[];if(l.isParent()){var g=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);d.push(g.topLeftX+g.width/2),d.push(g.topLeftY+g.height/2)}else d.push(r[n].xCoords[h]),d.push(r[n].yCoords[h]);if(c.isParent()){var f=o.calcBoundingBox(c,r[n].xCoords,r[n].yCoords,a);p.push(f.topLeftX+f.width/2),p.push(f.topLeftY+f.height/2)}else p.push(r[n].xCoords[u]),p.push(r[n].yCoords[u]);s.edges.push({startX:d[0],startY:d[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][c.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][c.id()].getCenterX(),endY:i[n][c.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),b.add(n))}}));var T=u.packComponents(w,t.randomize).shifts;if("draft"==t.quality)r.forEach((function(t,e){var n=t.xCoords.map((function(t){return t+T[e].dx})),r=t.yCoords.map((function(t){return t+T[e].dy}));t.xCoords=n,t.yCoords=r}));else{var _=0;b.forEach((function(t){Object.keys(i[t]).forEach((function(e){var n=i[t][e];n.setCenter(n.getCenterX()+T[_].dx,n.getCenterY()+T[_].dy)})),_++}))}}}else{var E=t.eles.boundingBox();if(h.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),t.randomize){var C=l(t);r.push(C)}"default"==t.quality||"proof"==t.quality?(i.push(c(t,r[0])),o.relocateComponent(h[0],i[0],t)):o.relocateComponent(h[0],r[0],t)}var S=s((function(e,n){if("default"==t.quality||"proof"==t.quality){"number"==typeof e&&(e=n);var a=void 0,s=void 0,o=e.data("id");return i.forEach((function(t){o in t&&(a={x:t[o].getRect().getCenterX(),y:t[o].getRect().getCenterY()},s=t[o])})),t.nodeDimensionsIncludeLabels&&(s.labelWidth&&("left"==s.labelPosHorizontal?a.x+=s.labelWidth/2:"right"==s.labelPosHorizontal&&(a.x-=s.labelWidth/2)),s.labelHeight&&("top"==s.labelPosVertical?a.y+=s.labelHeight/2:"bottom"==s.labelPosVertical&&(a.y-=s.labelHeight/2))),null==a&&(a={x:e.position("x"),y:e.position("y")}),{x:a.x,y:a.y}}var l=void 0;return r.forEach((function(t){var n=t.nodeIndexes.get(e.id());null!=n&&(l={x:t.xCoords[n],y:t.yCoords[n]})})),null==l&&(l={x:e.position("x"),y:e.position("y")}),{x:l.x,y:l.y}}),"getPositions");if("default"==t.quality||"proof"==t.quality||t.randomize){var A=o.calcParentsWithoutChildren(e,n),L=n.filter((function(t){return"none"==t.css("display")}));t.eles=n.not(L),n.nodes().not(":parent").not(L).layoutPositions(this,t,S),A.length>0&&A.forEach((function(t){t.position(S(t))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}),"run")}]),t}();t.exports=u},657:(t,e,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD,o=s((function(t){var e=t.cy,n=t.eles,o=n.nodes(),l=n.nodes(":parent"),c=new Map,h=new Map,u=new Map,d=[],p=[],g=[],f=[],m=[],y=[],v=[],x=[],b=void 0,w=1e8,k=1e-9,T=t.piTol,_=t.samplingType,E=t.nodeSeparation,C=void 0,S=s((function(){for(var t=0,e=0,n=!1;e=i;){s=r[i++];for(var g=d[s],f=0;fc&&(c=m[x],u=x)}return u}),"BFS"),L=s((function(t){var e=void 0;if(t){e=Math.floor(Math.random()*b);for(var n=0;n=1)break;c=l}for(var d=0;d=1)break;c=l}for(var m=0;m0&&(r.isParent()?d[e].push(u.get(r.id())):d[e].push(r.id()))}))}));var U=s((function(t){var n=h.get(t),r=void 0;c.get(t).forEach((function(i){r=e.getElementById(i).isParent()?u.get(i):i,d[n].push(r),d[h.get(r)].push(t)}))}),"_loop"),G=!0,q=!1,j=void 0;try{for(var Y,W=c.keys()[Symbol.iterator]();!(G=(Y=W.next()).done);G=!0){U(Y.value)}}catch(t){q=!0,j=t}finally{try{!G&&W.return&&W.return()}finally{if(q)throw j}}var H=void 0;if((b=h.size)>2){C=b{var r=n(212),i=s((function(t){t&&t("layout","fcose",r)}),"register");"undefined"!=typeof cytoscape&&i(cytoscape),t.exports=i},140:e=>{e.exports=t}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,r),a.exports}return s(r,"__webpack_require__"),r(579)})()}))}}),cIt={L:"left",R:"right",T:"top",B:"bottom"},hIt={L:s((t=>`${t},${t/2} 0,${t} 0,0`),"L"),R:s((t=>`0,${t/2} ${t},0 ${t},${t}`),"R"),T:s((t=>`0,0 ${t},0 ${t/2},${t}`),"T"),B:s((t=>`${t/2},0 ${t},${t} 0,${t}`),"B")},uIt={L:s(((t,e)=>t-e+2),"L"),R:s(((t,e)=>t-2),"R"),T:s(((t,e)=>t-e+2),"T"),B:s(((t,e)=>t-2),"B")},dIt=s((function(t){return gIt(t)?"L"===t?"R":"L":"T"===t?"B":"T"}),"getOppositeArchitectureDirection"),pIt=s((function(t){return"L"===t||"R"===t||"T"===t||"B"===t}),"isArchitectureDirection"),gIt=s((function(t){return"L"===t||"R"===t}),"isArchitectureDirectionX"),fIt=s((function(t){return"T"===t||"B"===t}),"isArchitectureDirectionY"),mIt=s((function(t,e){const n=gIt(t)&&fIt(e),r=fIt(t)&&gIt(e);return n||r}),"isArchitectureDirectionXY"),yIt=s((function(t){const e=t[0],n=t[1],r=gIt(e)&&fIt(n),i=fIt(e)&&gIt(n);return r||i}),"isArchitecturePairXY"),vIt=s((function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t}),"isValidArchitectureDirectionPair"),xIt=s((function(t,e){const n=`${t}${e}`;return vIt(n)?n:void 0}),"getArchitectureDirectionPair"),bIt=s((function([t,e],n){const r=n[0],i=n[1];return gIt(r)?fIt(i)?[t+("L"===r?-1:1),e+("T"===i?1:-1)]:[t+("L"===r?-1:1),e]:gIt(i)?[t+("L"===i?1:-1),e+("T"===r?1:-1)]:[t,e+("T"===r?1:-1)]}),"shiftPositionByArchitectureDirectionPair"),wIt=s((function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]}),"getArchitectureDirectionXYFactors"),kIt=s((function(t){return"service"===t.type}),"isArchitectureService"),TIt=s((function(t){return"junction"===t.type}),"isArchitectureJunction"),_It=s((t=>t.data()),"edgeData"),EIt=s((t=>t.data()),"nodeData"),CIt=Ct.architecture,SIt=new qX((()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:CIt,dataStructures:void 0,elements:{}}))),AIt=s((()=>{SIt.reset(),$n()}),"clear"),LIt=s((function({id:t,icon:e,in:n,title:r,iconText:i}){if(void 0!==SIt.records.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another ${SIt.records.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===SIt.records.registeredIds[n])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===SIt.records.registeredIds[n])throw new Error(`The service [${t}]'s parent is not a group`)}SIt.records.registeredIds[t]="node",SIt.records.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:r,edges:[],in:n}}),"addService"),NIt=s((()=>Object.values(SIt.records.nodes).filter(kIt)),"getServices"),IIt=s((function({id:t,in:e}){SIt.records.registeredIds[t]="node",SIt.records.nodes[t]={id:t,type:"junction",edges:[],in:e}}),"addJunction"),MIt=s((()=>Object.values(SIt.records.nodes).filter(TIt)),"getJunctions"),RIt=s((()=>Object.values(SIt.records.nodes)),"getNodes"),DIt=s((t=>SIt.records.nodes[t]),"getNode"),OIt=s((function({id:t,icon:e,in:n,title:r}){if(void 0!==SIt.records.registeredIds[t])throw new Error(`The group id [${t}] is already in use by another ${SIt.records.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===SIt.records.registeredIds[n])throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===SIt.records.registeredIds[n])throw new Error(`The group [${t}]'s parent is not a group`)}SIt.records.registeredIds[t]="group",SIt.records.groups[t]={id:t,icon:e,title:r,in:n}}),"addGroup"),PIt=s((()=>Object.values(SIt.records.groups)),"getGroups"),BIt=s((function({lhsId:t,rhsId:e,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:o,title:l}){if(!pIt(n))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${n}`);if(!pIt(r))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(void 0===SIt.records.nodes[t]&&void 0===SIt.records.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===SIt.records.nodes[e]&&void 0===SIt.records.groups[t])throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const c=SIt.records.nodes[t].in,h=SIt.records.nodes[e].in;if(s&&c&&h&&c==h)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(o&&c&&h&&c==h)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const u={lhsId:t,lhsDir:n,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:r,rhsInto:a,rhsGroup:o,title:l};SIt.records.edges.push(u),SIt.records.nodes[t]&&SIt.records.nodes[e]&&(SIt.records.nodes[t].edges.push(SIt.records.edges[SIt.records.edges.length-1]),SIt.records.nodes[e].edges.push(SIt.records.edges[SIt.records.edges.length-1]))}),"addEdge"),$It=s((()=>SIt.records.edges),"getEdges"),FIt=s((()=>{if(void 0===SIt.records.dataStructures){const t=Object.entries(SIt.records.nodes).reduce(((t,[e,n])=>(t[e]=n.edges.reduce(((t,n)=>{if(n.lhsId===e){const e=xIt(n.lhsDir,n.rhsDir);e&&(t[e]=n.rhsId)}else{const e=xIt(n.rhsDir,n.lhsDir);e&&(t[e]=n.lhsId)}return t}),{}),t)),{}),e=Object.keys(t)[0],n={[e]:1},r=Object.keys(t).reduce(((t,n)=>n===e?t:{...t,[n]:1}),{}),i=s((e=>{const i={[e]:[0,0]},a=[e];for(;a.length>0;){const e=a.shift();if(e){n[e]=1,delete r[e];const s=t[e],[o,l]=i[e];Object.entries(s).forEach((([t,e])=>{n[e]||(i[e]=bIt([o,l],t),a.push(e))}))}}return i}),"BFS"),a=[i(e)];for(;Object.keys(r).length>0;)a.push(i(Object.keys(r)[0]));SIt.records.dataStructures={adjList:t,spatialMaps:a}}return SIt.records.dataStructures}),"getDataStructures"),zIt=s(((t,e)=>{SIt.records.elements[t]=e}),"setElementForId"),UIt=s((t=>SIt.records.elements[t]),"getElementById"),GIt={clear:AIt,setDiagramTitle:qn,getDiagramTitle:jn,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,addService:LIt,getServices:NIt,addJunction:IIt,getJunctions:MIt,getNodes:RIt,getNode:DIt,addGroup:OIt,getGroups:PIt,addEdge:BIt,getEdges:$It,setElementForId:zIt,getElementById:UIt,getDataStructures:FIt};function qIt(t){const e=Hn().architecture;return e?.[t]?e[t]:CIt[t]}s(qIt,"getConfigField");var jIt=s(((t,e)=>{jX(t,e),t.groups.map(e.addGroup),t.services.map((t=>e.addService({...t,type:"service"}))),t.junctions.map((t=>e.addJunction({...t,type:"junction"}))),t.edges.map(e.addEdge)}),"populateDb"),YIt={parse:s((async t=>{const e=await Att("architecture",t);m.debug(e),jIt(e,GIt)}),"parse")},WIt=s((t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`),"getStyles"),HIt=d(lIt(),1),VIt=s((t=>`${t}`),"wrapIcon"),XIt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:VIt('')},server:{body:VIt('')},disk:{body:VIt('')},internet:{body:VIt('')},cloud:{body:VIt('')},unknown:xy,blank:{body:VIt("")}}},KIt=s((async function(t,e){const n=qIt("padding"),r=qIt("iconSize"),i=r/2,a=r/6,s=a/2;await Promise.all(e.edges().map((async e=>{const{source:r,sourceDir:o,sourceArrow:l,sourceGroup:c,target:h,targetDir:u,targetArrow:d,targetGroup:p,label:g}=_It(e);let{x:f,y:m}=e[0].sourceEndpoint();const{x:y,y:v}=e[0].midpoint();let{x:x,y:b}=e[0].targetEndpoint();const w=n+4;if(c&&(gIt(o)?f+="L"===o?-w:w:m+="T"===o?-w:w+18),p&&(gIt(u)?x+="L"===u?-w:w:b+="T"===u?-w:w+18),c||"junction"!==GIt.getNode(r)?.type||(gIt(o)?f+="L"===o?i:-i:m+="T"===o?i:-i),p||"junction"!==GIt.getNode(h)?.type||(gIt(u)?x+="L"===u?i:-i:b+="T"===u?i:-i),e[0]._private.rscratch){const e=t.insert("g");if(e.insert("path").attr("d",`M ${f},${m} L ${y},${v} L${x},${b} `).attr("class","edge"),l){const t=gIt(o)?uIt[o](f,a):f-s,n=fIt(o)?uIt[o](m,a):m-s;e.insert("polygon").attr("points",hIt[o](a)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(d){const t=gIt(u)?uIt[u](x,a):x-s,n=fIt(u)?uIt[u](b,a):b-s;e.insert("polygon").attr("points",hIt[u](a)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(g){const t=mIt(o,u)?"XY":gIt(o)?"X":"Y";let n=0;n="X"===t?Math.abs(f-x):"Y"===t?Math.abs(m-b)/1.5:Math.abs(f-x)/2;const r=e.append("g");if(await KT(r,g,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},Hn()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)r.attr("transform","translate("+y+", "+v+")");else if("Y"===t)r.attr("transform","translate("+y+", "+v+") rotate(-90)");else if("XY"===t){const t=xIt(o,u);if(t&&yIt(t)){const e=r.node().getBoundingClientRect(),[n,i]=wIt(t);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*n*i*45})`);const a=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${y}, ${v-e.height/2})\n translate(${n*a.width/2}, ${i*a.height/2})\n rotate(${-1*n*i*45}, 0, ${e.height/2})\n `)}}}}})))}),"drawEdges"),ZIt=s((async function(t,e){const n=.75*qIt("padding"),r=qIt("fontSize"),i=qIt("iconSize")/2;await Promise.all(e.nodes().map((async e=>{const a=EIt(e);if("group"===a.type){const{h:s,w:o,x1:l,y1:c}=e.boundingBox();t.append("rect").attr("x",l+i).attr("y",c+i).attr("width",o).attr("height",s).attr("class","node-bkg");const h=t.append("g");let u=l,d=c;if(a.icon){const t=h.append("g");t.html(`${await _y(a.icon,{height:n,width:n,fallbackPrefix:XIt.prefix})}`),t.attr("transform","translate("+(u+i+1)+", "+(d+i+1)+")"),u+=n,d+=r/2-1-2}if(a.label){const t=h.append("g");await KT(t,a.label,{useHtmlLabels:!1,width:o,classes:"architecture-service-label"},Hn()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(u+i+4)+", "+(d+i+2)+")")}}})))}),"drawGroups"),QIt=s((async function(t,e,n){for(const r of n){const n=e.append("g"),i=qIt("iconSize");if(r.title){const t=n.append("g");await KT(t,r.title,{useHtmlLabels:!1,width:1.5*i,classes:"architecture-service-label"},Hn()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+i/2+", "+i+")")}const a=n.append("g");if(r.icon)a.html(`${await _y(r.icon,{height:i,width:i,fallbackPrefix:XIt.prefix})}`);else if(r.iconText){a.html(`${await _y("blank",{height:i,width:i,fallbackPrefix:XIt.prefix})}`);const t=a.append("g").append("foreignObject").attr("width",i).attr("height",i).append("div").attr("class","node-icon-text").attr("style",`height: ${i}px;`).append("div").html(r.iconText),e=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/e)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+r.id).attr("d",`M0 ${i} v${-i} q0,-5 5,-5 h${i} q5,0 5,5 v${i} H0 Z`);n.attr("class","architecture-service");const{width:s,height:o}=n._groups[0][0].getBBox();r.width=s,r.height=o,t.setElementForId(r.id,n)}return 0}),"drawServices"),JIt=s((function(t,e,n){n.forEach((n=>{const r=e.append("g"),i=qIt("iconSize");r.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",i).attr("height",i),r.attr("class","architecture-junction");const{width:a,height:s}=r._groups[0][0].getBBox();r.width=a,r.height=s,t.setElementForId(n.id,r)}))}),"drawJunctions");function tMt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:qIt("iconSize"),height:qIt("iconSize")},classes:"node-service"})}))}function eMt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:qIt("iconSize"),height:qIt("iconSize")},classes:"node-junction"})}))}function nMt(t,e){e.nodes().map((e=>{const n=EIt(e);if("group"===n.type)return;n.x=e.position().x,n.y=e.position().y;t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")}))}function rMt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})}))}function iMt(t,e){t.forEach((t=>{const{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:s,lhsDir:o,rhsDir:l,rhsGroup:c,title:h}=t,u=mIt(t.lhsDir,t.rhsDir)?"segments":"straight",d={id:`${n}-${r}`,label:h,source:n,sourceDir:o,sourceArrow:i,sourceGroup:a,sourceEndpoint:"L"===o?"0 50%":"R"===o?"100% 50%":"T"===o?"50% 0":"50% 100%",target:r,targetDir:l,targetArrow:s,targetGroup:c,targetEndpoint:"L"===l?"0 50%":"R"===l?"100% 50%":"T"===l?"50% 0":"50% 100%"};e.add({group:"edges",data:d,classes:u})}))}function aMt(t){const e=t.map((t=>{const e={},n={};return Object.entries(t).forEach((([t,[r,i]])=>{e[i]||(e[i]=[]),n[r]||(n[r]=[]),e[i].push(t),n[r].push(t)})),{horiz:Object.values(e).filter((t=>t.length>1)),vert:Object.values(n).filter((t=>t.length>1))}})),[n,r]=e.reduce((([t,e],{horiz:n,vert:r})=>[[...t,...n],[...e,...r]]),[[],[]]);return{horizontal:n,vertical:r}}function sMt(t){const e=[],n=s((t=>`${t[0]},${t[1]}`),"posToStr"),r=s((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");return t.forEach((t=>{const i=Object.fromEntries(Object.entries(t).map((([t,e])=>[n(e),t]))),a=[n([0,0])],s={},o={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const t=a.shift();if(t){s[t]=1;const l=i[t];if(l){const c=r(t);Object.entries(o).forEach((([t,r])=>{const o=n([c[0]+r[0],c[1]+r[1]]),h=i[o];h&&!s[o]&&(a.push(o),e.push({[cIt[t]]:h,[cIt[dIt(t)]]:l,gap:1.5*qIt("iconSize")}))}))}}}})),e}function oMt(t,e,n,r,{spatialMaps:i}){return new Promise((a=>{const o=Oa("body").append("div").attr("id","cy").attr("style","display:none"),l=lCt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{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":`${qIt("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:`${qIt("padding")}px`}}]});o.remove(),rMt(n,l),tMt(t,l),eMt(e,l),iMt(r,l);const c=aMt(i),h=sMt(i),u=l.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[e,n]=t.connectedNodes(),{parent:r}=EIt(e),{parent:i}=EIt(n);return r===i?1.5*qIt("iconSize"):.5*qIt("iconSize")},edgeElasticity(t){const[e,n]=t.connectedNodes(),{parent:r}=EIt(e),{parent:i}=EIt(n);return r===i?.45:.001},alignmentConstraint:c,relativePlacementConstraint:h});u.one("layoutstop",(()=>{function t(t,e,n,r){let i,a;const{x:s,y:o}=t,{x:l,y:c}=e;a=(r-o+(s-n)*(o-c)/(s-l))/Math.sqrt(1+Math.pow((o-c)/(s-l),2)),i=Math.sqrt(Math.pow(r-o,2)+Math.pow(n-s,2)-Math.pow(a,2));i/=Math.sqrt(Math.pow(l-s,2)+Math.pow(c-o,2));let h=(l-s)*(r-o)-(c-o)*(n-s);switch(!0){case h>=0:h=1;break;case h<0:h=-1}let u=(l-s)*(n-s)+(c-o)*(r-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}return a=Math.abs(a)*h,i*=u,{distances:a,weights:i}}s(t,"getSegmentWeights"),l.startBatch();for(const e of Object.values(l.edges()))if(e.data?.()){const{x:n,y:r}=e.source().position(),{x:i,y:a}=e.target().position();if(n!==i&&r!==a){const n=e.sourceEndpoint(),r=e.targetEndpoint(),{sourceDir:i}=_It(e),[a,s]=fIt(i)?[n.x,r.y]:[r.x,n.y],{weights:o,distances:l}=t(n,r,a,s);e.style("segment-distances",l),e.style("segment-weights",o)}}l.endBatch(),u.run()})),u.run(),l.ready((t=>{m.info("Ready",t),a(l)}))}))}ky([{name:XIt.prefix,icons:XIt}]),lCt.use(HIt.default),s(tMt,"addServices"),s(eMt,"addJunctions"),s(nMt,"positionNodes"),s(rMt,"addGroups"),s(iMt,"addEdges"),s(aMt,"getAlignments"),s(sMt,"getRelativeConstraints"),s(oMt,"layoutArchitecture");var lMt=s((async(t,e,n,r)=>{const i=r.db,a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),c=i.getDataStructures(),h=zp(e),u=h.append("g");u.attr("class","architecture-edges");const d=h.append("g");d.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await QIt(i,d,a),JIt(i,d,s);const g=await oMt(a,s,o,l,c);await KIt(u,g),await ZIt(p,g),nMt(i,g),An(void 0,h,qIt("padding"),qIt("useMaxWidth"))}),"draw"),cMt={parser:YIt,db:GIt,renderer:{draw:lMt},styles:WIt},hMt=Object.freeze({__proto__:null,diagram:cMt}),uMt=Object.freeze({__proto__:null,InfoModule:Gtt,createInfoServices:qtt}),dMt=Object.freeze({__proto__:null,PacketModule:Ytt,createPacketServices:Wtt}),pMt=Object.freeze({__proto__:null,PieModule:Mtt,createPieServices:Rtt}),gMt=Object.freeze({__proto__:null,ArchitectureModule:Ptt,createArchitectureServices:Btt}),fMt=Object.freeze({__proto__:null,GitGraphModule:Ftt,createGitGraphServices:ztt});export{zN as default};